test(wallet): add #[ignore]d live-mainnet integration test for control.wallet.balance (#1959) - #146
Merged
Conversation
…1959) Add #[ignore]d live-mainnet wallet balance read test to verify the control.wallet.balance RPC reads confirmed balance from a funded address on mainnet. Test gates on DIG_LIVE_FUNDS_TEST=1 + DIG_TEST_WALLET_MNEMONIC env vars (sourced from /.test-credentials, never printed or committed). Imports the funded test wallet and asserts the balance read returns Known with confirmed > 0 mojos, distinguishing from StillSyncing/Unknown states. Bump version 0.75.4 → 0.75.5 (test: patch). Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Closes DIG-Network/dig_ecosystem#1959.
control.wallet.balance(shipped in #1851, rate-bounded in #1957) had a live-mainnet e2e gap: the existing live test (live_funds_dev_tip_broadcasts_and_confirms) covers a$DIGspend, not the balance read. This addslive_wallet_balance_reads_a_funded_addresstocrates/dig-node-service/tests/live_funds_tip_e2e.rs, reusing that file's harness and gating conventions.#[ignore]+ env-gated (DIG_LIVE_FUNDS_TEST=1+DIG_TEST_WALLET_MNEMONIC), mirroring the sibling spend test — so a normalcargo test, and even a barecargo test -- --ignored, does not touch mainnet without the explicit opt-in. CI never runs it live (both tests report ignored).WalletService(mainnet), imports the funded test wallet from env (never a source literal, never logged), callsbalance_for_address(&addr, BalanceAsset::Xch), and asserts a real confirmed balance (result.balance > 0) — aKnownreading, notUnknown— plus surfacesWalletBalanceResult { balance, pending, synced, peak_height }so the confirmed/pending/syncing shapes are exercised.Verification
cargo fmt --all -- --check→ 0 ·cargo clippy -p dig-node-service --all-targets --all-features -- -D warnings→ 0 ·cargo build --tests -p dig-node-service→ 0 (the#[ignore]d test compiles) ·cargo test -p dig-node-service --test live_funds_tip_e2e→ 0 passed, 2 ignored (the live tests are skipped in CI).DIG_TEST_WALLET_MNEMONICat runtime only, never echoed or committed (/.test-credentialsstays untouched and git-ignored).DIG_LIVE_FUNDS_TEST=1 DIG_TEST_WALLET_MNEMONIC=… cargo test -p dig-node-service --test live_funds_tip_e2e -- --ignored.Version
test:(test-only addition; the version-increment gate requires a bump) →[workspace.package].version0.75.4 → 0.75.5.Cargo.lockupdated + committed.Generated by Claude Code