]> Untitled Git - bdk/commit
test(chain): Add comprehensive tests for min_confirmations parameter
author志宇 <hello@evanlinjin.me>
Thu, 11 Sep 2025 03:48:27 +0000 (03:48 +0000)
committer志宇 <hello@evanlinjin.me>
Wed, 17 Sep 2025 23:46:29 +0000 (23:46 +0000)
commit54409bc4aac05fb25d02909398008204eee70634
tree5c1e05f7478f08470adbc435e863e52f8893e9b7
parent45249457aa2f1205f5944e73c8d14468712648ab
test(chain): Add comprehensive tests for min_confirmations parameter

Add test file `tests/test_canonical_view.rs` with three comprehensive test cases:

1. `test_min_confirmations_parameter`: Tests basic min_confirmations functionality
   - Verifies min_confirmations = 0 and 1 behave identically
   - Tests edge case where transaction has exactly required confirmations
   - Tests case where transaction has insufficient confirmations

2. `test_min_confirmations_with_untrusted_tx`: Tests trust predicate interaction
   - Verifies insufficient confirmations + untrusted predicate = untrusted_pending
   - Ensures trust predicate is respected when confirmations are insufficient

3. `test_min_confirmations_multiple_transactions`: Tests complex scenarios
   - Multiple transactions with different confirmation counts
   - Verifies correct categorization based on min_confirmations threshold
   - Tests both min_confirmations = 5 and min_confirmations = 10 scenarios

These tests validate that the min_confirmations parameter correctly controls
when transactions are treated as confirmed vs trusted/untrusted pending.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
crates/chain/tests/test_canonical_view.rs [new file with mode: 0644]