Skip to content

Add wallet_transparent_coinbase_balance test; support post-beta.1 zallet encryption init#174

Open
pacu wants to merge 7 commits into
mainfrom
test-wallet-transparent-coinbase-balance
Open

Add wallet_transparent_coinbase_balance test; support post-beta.1 zallet encryption init#174
pacu wants to merge 7 commits into
mainfrom
test-wallet-transparent-coinbase-balance

Conversation

@pacu

@pacu pacu commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes #173.

Summary

End-to-end regtest coverage for zcash/zallet#639 / zcash/librustzcash#2654 (the fix for zcash/zallet#635), plus a framework compatibility fix for zallet builds after 0.1.0-beta.1.

New test: qa/rpc-tests/wallet_transparent_coinbase_balance.py (registered in NEW_SCRIPTS), single zebrad+zainod node with a wallet-owned miner address, four phases:

  1. Immature coinbase: z_getbalances reports it under transparent.coinbase.pending (zero spendable, no regular key); z_listunspent shows no coinbase entries (upstream maturity clause).
  2. Mature coinbase: coinbase.spendable equals the mature UTXO sum to the zatoshi; total.spendable/total.pending equal the sum of parts bucket-by-bucket; every transparent entry has generated == true.
  3. Regular UTXO: z_shieldcoinbasez_sendmany z→t to a second wallet taddr; the new UTXO lands in regular.spendable only, z_listunspent reports it with generated == false, shielded entries carry no generated key.
  4. Cross-check: z_gettotalbalance.transparent equals the regular+coinbase bucket totals.

Framework fix: init_wallet_encryption helper — zallet after 0.1.0-beta.1 requires generate-encryption-identity before init-wallet-encryption (zcash/zallet#621). All three wallet-provisioning sites now run it first, tolerating older binaries that lack the subcommand. Without this, wallet prep silently produces an empty miner address and zebrad fails to start.

Verification

Full run against locally-built zallet from the zcash/zallet#639 branch (zaino backend): all four phases pass. pyflakes qa and test/lint/lint-whitespace.sh clean.

Note: the new test requires a zallet build containing zcash/zallet#639; against current release binaries the split assertions will fail (by design).

🤖 Generated with Claude Code

https://claude.ai/code/session_017WB1TU6tyLmMa1n4SQ9XgK

pacu and others added 6 commits July 11, 2026 12:04
Add the lightwallet-protocol proto definitions and generated Python gRPC stubs used by future gRPC parity tests.

Include the grpcio/protobuf dependencies and a helper script for regenerating the stubs.

Co-Authored-By: OpenAI Codex <codex@openai.com>
Add framework support for starting lightwalletd and standalone zcashd fixtures, then add a manual gRPC parity test comparing zainod and lightwalletd responses.

Include cached regtest fixtures and documentation so the test can run locally without rebuilding the fixture chain every time.

Co-Authored-By: OpenAI Codex <codex@openai.com>
Build and package lightwalletd for integration tests, use the uv-managed environment in RPC jobs, and register grpc_comparison.py in the RPC test matrix.

Keep the workflow changes separate from the manual test so reviewers can evaluate CI enablement independently.

Co-Authored-By: OpenAI Codex <codex@openai.com>
…nbase split and z_listunspent generated flag

Integration test for zcash/zallet#635: z_getbalances now splits each
account's transparent pool into regular (non-coinbase) and coinbase
buckets, with immature coinbase under pending and mature coinbase under
spendable, and folds transparent value into the account total.
z_listunspent transparent entries gain a boolean "generated" flag
(absent on shielded entries), while immature coinbase stays excluded
from z_listunspent and z_gettotalbalance semantics are unchanged.

The test drives four phases against the Z3 stack: immature-only
coinbase, matured coinbase, a regular UTXO created by shielding and
then sending back to a second wallet-owned taddr, and a final
z_gettotalbalance cross-check. Registered in NEW_SCRIPTS.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WB1TU6tyLmMa1n4SQ9XgK
…ncryption

Zallet after 0.1.0-beta.1 requires an age encryption identity to exist
before init-wallet-encryption succeeds (zcash/zallet#621 made recipient
initialization atomic and moved identity generation to a dedicated
generate-encryption-identity subcommand). Run it first at every wallet
provisioning site, tolerating failure so older zallet binaries (which
lack the subcommand and generate the identity inside
init-wallet-encryption) keep working.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WB1TU6tyLmMa1n4SQ9XgK
…re sending

z_gettotalbalance's private field counts pending value, so polling it is
not sufficient before z_sendmany: the freshly-shielded note must become
spendable (zcash/zallet#316 lag) or the send fails with insufficient
balance. Poll the shielded spendable buckets from z_getbalances, with
ZIP-317 fee headroom, before proposing the send.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WB1TU6tyLmMa1n4SQ9XgK
Comment thread qa/rpc-tests/test_framework/util.py Dismissed
@pacu
pacu marked this pull request as ready for review July 17, 2026 13:19
@pacu
pacu requested a review from dannywillems July 20, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover z_getbalances transparent regular/coinbase split and z_listunspent 'generated' flag; support post-beta.1 zallet encryption init

2 participants