@@ -1139,7 +1139,7 @@ fn test_chain_spends() {
11391139 ) ;
11401140
11411141 // Chain position of the `tx_2` is now none, as it is older than `tx_2_conflict`
1142- assert ! ( canonical_positions. get ( & tx_2. compute_txid( ) ) . is_none ( ) ) ;
1142+ assert ! ( ! canonical_positions. contains_key ( & tx_2. compute_txid( ) ) ) ;
11431143 }
11441144}
11451145
@@ -1278,30 +1278,20 @@ fn call_map_anchors_with_non_deterministic_anchor() {
12781278 }
12791279
12801280 let template = [
1281- TxTemplate {
1282- tx_name : "tx1" ,
1283- inputs : & [ TxInTemplate :: Bogus ] ,
1284- outputs : & [ TxOutTemplate :: new ( 10000 , Some ( 1 ) ) ] ,
1285- anchors : & [ block_id ! ( 1 , "A" ) ] ,
1286- last_seen : None ,
1287- ..Default :: default ( )
1288- } ,
1289- TxTemplate {
1290- tx_name : "tx2" ,
1291- inputs : & [ TxInTemplate :: PrevTx ( "tx1" , 0 ) ] ,
1292- outputs : & [ TxOutTemplate :: new ( 20000 , Some ( 2 ) ) ] ,
1293- anchors : & [ block_id ! ( 2 , "B" ) ] ,
1294- ..Default :: default ( )
1295- } ,
1296- TxTemplate {
1297- tx_name : "tx3" ,
1298- inputs : & [ TxInTemplate :: PrevTx ( "tx2" , 0 ) ] ,
1299- outputs : & [ TxOutTemplate :: new ( 30000 , Some ( 3 ) ) ] ,
1300- anchors : & [ block_id ! ( 3 , "C" ) , block_id ! ( 4 , "D" ) ] ,
1301- ..Default :: default ( )
1302- } ,
1281+ TxTemplate :: new ( "tx1" )
1282+ . with_inputs ( vec ! [ TxInTemplate :: Bogus ] )
1283+ . with_outputs ( vec ! [ TxOutTemplate :: new( 10_000 , Some ( 1 ) ) ] )
1284+ . with_anchors ( vec ! [ block_id!( 1 , "A" ) ] ) ,
1285+ TxTemplate :: new ( "tx2" )
1286+ . with_inputs ( vec ! [ TxInTemplate :: PrevTx ( "tx1" . into( ) , 0 ) ] )
1287+ . with_outputs ( vec ! [ TxOutTemplate :: new( 20_000 , Some ( 2 ) ) ] )
1288+ . with_anchors ( vec ! [ block_id!( 2 , "B" ) ] ) ,
1289+ TxTemplate :: new ( "tx3" )
1290+ . with_inputs ( vec ! [ TxInTemplate :: PrevTx ( "tx2" . into( ) , 0 ) ] )
1291+ . with_outputs ( vec ! [ TxOutTemplate :: new( 30_000 , Some ( 3 ) ) ] )
1292+ . with_anchors ( vec ! [ block_id!( 3 , "C" ) , block_id!( 4 , "D" ) ] ) ,
13031293 ] ;
1304- let graph = init_graph ( & template) . tx_graph ;
1294+ let graph = init_graph ( template) . tx_graph ;
13051295 let new_graph = graph. clone ( ) . map_anchors ( |a| NonDeterministicAnchor {
13061296 anchor_block : a,
13071297 // A non-deterministic value
0 commit comments