Skip to content

Commit 863039d

Browse files
committed
Fix tx_graph_conflicts test
Due to the Tapyrus conversion, the TXID values changed, causing the order of transactions sorted lexicographically by TXID to change, which resulted in the test failures.
1 parent 1c7c1e0 commit 863039d

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

crates/chain/tests/test_tx_graph_conflicts.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ fn test_tx_conflict_handling() {
114114
},
115115
],
116116
// the txgraph is going to pick tx_conflict_2 because of higher lexicographical txid
117-
exp_chain_txs: HashSet::from(["tx1", "tx_conflict_2"]),
118-
exp_chain_txouts: HashSet::from([("tx1", 0), ("tx_conflict_2", 0)]),
119-
exp_unspents: HashSet::from([("tx_conflict_2", 0)]),
117+
exp_chain_txs: HashSet::from(["tx1", "tx_conflict_1"]),
118+
exp_chain_txouts: HashSet::from([("tx1", 0), ("tx_conflict_1", 0)]),
119+
exp_unspents: HashSet::from([("tx_conflict_1", 0)]),
120120
exp_balance: Balance {
121121
immature: Amount::ZERO,
122-
trusted_pending: Amount::from_tap(30000),
122+
trusted_pending: Amount::from_tap(20000),
123123
untrusted_pending: Amount::ZERO,
124124
confirmed: Amount::ZERO,
125125
},
@@ -597,8 +597,6 @@ fn test_tx_conflict_handling() {
597597
for scenario in scenarios {
598598
let (tx_graph, spk_index, exp_tx_ids) = init_graph(scenario.tx_templates.iter());
599599

600-
println!("Scenario: {}", scenario.name);
601-
602600
let txs = tx_graph
603601
.list_chain_txs(&local_chain, chain_tip)
604602
.map(|tx| tx.tx_node.txid)

0 commit comments

Comments
 (0)