Skip to content

Commit c84035e

Browse files
committed
test(chain): Add scenario: coinbase tx must not become unconfirmed
1 parent e8da007 commit c84035e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

crates/chain/tests/test_tx_graph_conflicts.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,28 @@ fn test_tx_conflict_handling() {
943943
confirmed: Amount::ZERO,
944944
},
945945
},
946+
Scenario {
947+
name: "coinbase tx must not become unconfirmed",
948+
tx_templates: &[
949+
TxTemplate {
950+
tx_name: "coinbase",
951+
inputs: &[TxInTemplate::Coinbase],
952+
outputs: &[TxOutTemplate::new(21_000, Some(0))],
953+
// Stale block
954+
anchors: &[block_id!(1, "B-prime")],
955+
..Default::default()
956+
}
957+
],
958+
exp_chain_txs: HashSet::from([]),
959+
exp_chain_txouts: HashSet::from([]),
960+
exp_unspents: HashSet::from([]),
961+
exp_balance: Balance {
962+
immature: Amount::ZERO,
963+
trusted_pending: Amount::ZERO,
964+
untrusted_pending: Amount::ZERO,
965+
confirmed: Amount::ZERO,
966+
}
967+
}
946968
];
947969

948970
for scenario in scenarios {

0 commit comments

Comments
 (0)