Skip to content

test(wallet): add #[ignore]d live-mainnet integration test for control.wallet.balance (#1959) - #146

Merged
MichaelTaylor3d merged 1 commit into
mainfrom
test/1959-wallet-balance-live-integration
Aug 2, 2026
Merged

test(wallet): add #[ignore]d live-mainnet integration test for control.wallet.balance (#1959)#146
MichaelTaylor3d merged 1 commit into
mainfrom
test/1959-wallet-balance-live-integration

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

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 $DIG spend, not the balance read. This adds live_wallet_balance_reads_a_funded_address to crates/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 normal cargo test, and even a bare cargo test -- --ignored, does not touch mainnet without the explicit opt-in. CI never runs it live (both tests report ignored).
  • Brings up a live WalletService (mainnet), imports the funded test wallet from env (never a source literal, never logged), calls balance_for_address(&addr, BalanceAsset::Xch), and asserts a real confirmed balance (result.balance > 0) — a Known reading, not Unknown — plus surfaces WalletBalanceResult { 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).
  • No secrets in source or commit — the mnemonic is read from DIG_TEST_WALLET_MNEMONIC at runtime only, never echoed or committed (/.test-credentials stays untouched and git-ignored).
  • To run locally: 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].version 0.75.4 → 0.75.5. Cargo.lock updated + committed.


Generated by Claude Code

…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>
@MichaelTaylor3d
MichaelTaylor3d merged commit ab2d6ea into main Aug 2, 2026
15 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the test/1959-wallet-balance-live-integration branch August 2, 2026 16: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.

1 participant