fix(pay): wait for note maturity on the real wallet, and stop re-shielding
Two defects the first live mainnet run exposed: 1. Only MockWallet implemented the maturity hook, so against a real wallet the flow fired the payment one block after the deposit. Pool notes need about ten blocks, so that payment could never land. WalletApiAdapter now records the block its shield settled in and polls the chain until the notes are spendable, reporting blocks remaining as it waits. 2. shieldedBalance answered "0" when the wallet declined to report, so a payer with funds already in the pool shielded a second time: a wasted pool fee and an extra public leg. It now answers null for UNKNOWN, and the flow pays first in that case, shielding only if the wallet actually reports insufficient funds. 30 tests green, including regressions for both; full flow re-verified in the browser end to end. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
B
bongbongcrypto committed
e5e82fdae61a81f9eeb1e93b5b4c8d26ef1e9326
Parent: 5a7107f