From c84035e4d804943da7b3308411a1402b1ff6e2ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BF=97=E5=AE=87?= Date: Fri, 13 Jun 2025 13:12:59 +1000 Subject: [PATCH] test(chain): Add scenario: coinbase tx must not become unconfirmed --- crates/chain/tests/test_tx_graph_conflicts.rs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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 { -- 2.49.0