• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Chia-Network / chia-blockchain / 23662684159

27 Mar 2026 06:58PM UTC coverage: 91.162% (-0.08%) from 91.246%
23662684159

push

github

web-flow
Fix flaky test_trade_bad_spend: use set_remainder for post-block CAT balance (#20731)

The post_block_balance_updates for both wallet environments previously used
`"cat": {}` (assert no change from pre-block snapshot). But the pre-block
snapshot is taken with `set_remainder: True`, which captures the wallet's
live state at that instant. Because this test submits a deliberately bad
spend (zeroed BLS signature), the CAT wallet's unconfirmed_wallet_balance
is non-deterministic at snapshot time — it may be 4 (pending bad tx) or 0
(rejection already processed). After the block is farmed the wallet always
settles to 0, so if pre-block captured 4, the post-block assertion fails.

Fix: use `"cat": {"set_remainder": True}` in both post_block_balance_updates
so the checker snapshots the final state rather than asserting a delta. The
important behavioral guarantee (trade ends up FAILED) is still verified by
the `get_trade_and_status` assertion at the end of the test.

10450 of 11632 branches covered (89.84%)

Branch coverage included in aggregate %.

106057 of 116170 relevant lines covered (91.29%)

1.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.03
/chia/full_node/full_node_api.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc