File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1113,14 +1113,13 @@ mod test {
1113
1113
let resp = client. script_list_unspent ( & addr. script_pubkey ( ) ) . unwrap ( ) ;
1114
1114
1115
1115
assert ! ( resp. len( ) >= 329 ) ;
1116
- assert_eq ! ( resp[ 0 ] . value, 7995600000000 ) ;
1117
- assert_eq ! ( resp[ 0 ] . height, 111194 ) ;
1118
- assert_eq ! ( resp[ 0 ] . tx_pos, 0 ) ;
1119
- assert_eq ! (
1120
- resp[ 0 ] . tx_hash,
1121
- Txid :: from_hex( "e67a0550848b7932d7796aeea16ab0e48a5cfe81c4e8cca2c5b03e0416850114" )
1122
- . unwrap( )
1123
- ) ;
1116
+ let txid = "e67a0550848b7932d7796aeea16ab0e48a5cfe81c4e8cca2c5b03e0416850114" ;
1117
+ let txid = Txid :: from_hex ( txid) . unwrap ( ) ;
1118
+ let txs: Vec < _ > = resp. iter ( ) . filter ( |e| e. tx_hash == txid) . collect ( ) ;
1119
+ assert_eq ! ( txs. len( ) , 1 ) ;
1120
+ assert_eq ! ( txs[ 0 ] . value, 7995600000000 ) ;
1121
+ assert_eq ! ( txs[ 0 ] . height, 111194 ) ;
1122
+ assert_eq ! ( txs[ 0 ] . tx_pos, 0 ) ;
1124
1123
}
1125
1124
1126
1125
#[ test]
You can’t perform that action at this time.
0 commit comments