From: 志宇 Date: Fri, 13 Jun 2025 03:12:59 +0000 (+1000) Subject: test(chain): Add scenario: coinbase tx must not become unconfirmed X-Git-Tag: bitcoind_rpc-0.21.0~11^2 X-Git-Url: http://internal-gitweb-vhost/trait.impl/bitcoin/psbt/trait.GetKey.js?a=commitdiff_plain;h=c84035e4d804943da7b3308411a1402b1ff6e2ad;p=bdk test(chain): Add scenario: coinbase tx must not become unconfirmed --- diff --git a/crates/chain/tests/test_tx_graph_conflicts.rs b/crates/chain/tests/test_tx_graph_conflicts.rs index 862eb9b4..71944e40 100644 --- a/crates/chain/tests/test_tx_graph_conflicts.rs +++ b/crates/chain/tests/test_tx_graph_conflicts.rs @@ -943,6 +943,28 @@ fn test_tx_conflict_handling() { confirmed: Amount::ZERO, }, }, + Scenario { + name: "coinbase tx must not become unconfirmed", + tx_templates: &[ + TxTemplate { + tx_name: "coinbase", + inputs: &[TxInTemplate::Coinbase], + outputs: &[TxOutTemplate::new(21_000, Some(0))], + // Stale block + anchors: &[block_id!(1, "B-prime")], + ..Default::default() + } + ], + exp_chain_txs: HashSet::from([]), + exp_chain_txouts: HashSet::from([]), + exp_unspents: HashSet::from([]), + exp_balance: Balance { + immature: Amount::ZERO, + trusted_pending: Amount::ZERO, + untrusted_pending: Amount::ZERO, + confirmed: Amount::ZERO, + } + } ]; for scenario in scenarios {