@@ -181,7 +181,7 @@ mod tests {
181
181
assert_eq ! ( ledger. get_block_height( ) . unwrap( ) , 3 ) ;
182
182
183
183
let script = Builder :: new ( )
184
- . push_int ( 0x1 as i64 )
184
+ . push_int ( 0x1_i64 )
185
185
. push_opcode ( OP_CSV )
186
186
. push_opcode ( OP_DROP )
187
187
. push_x_only_key ( & xonly_pk)
@@ -195,7 +195,7 @@ mod tests {
195
195
assert_eq ! ( ledger. get_block_height( ) . unwrap( ) , 6 ) ;
196
196
197
197
let script = Builder :: new ( )
198
- . push_int ( 0x1 as i64 )
198
+ . push_int ( 0x1_i64 )
199
199
. push_opcode ( OP_CSV )
200
200
. push_opcode ( OP_DROP )
201
201
. push_x_only_key ( & xonly_pk)
@@ -208,22 +208,20 @@ mod tests {
208
208
}
209
209
assert_eq ! ( ledger. get_block_height( ) . unwrap( ) , 9 ) ;
210
210
let script = Builder :: new ( )
211
- . push_int ( 0x45 as i64 )
211
+ . push_int ( 0x45_i64 )
212
212
. push_opcode ( OP_CSV )
213
213
. push_opcode ( OP_DROP )
214
214
. push_x_only_key ( & xonly_pk)
215
215
. push_opcode ( OP_CHECKSIG )
216
216
. into_script ( ) ;
217
- if let Ok ( _) = ledger. check_sequence ( utxo, script, 0x46 ) {
218
- assert ! ( false ) ;
219
- }
217
+ assert ! ( ledger. check_sequence( utxo, script, 0x46 ) . is_err( ) ) ;
220
218
221
219
for _ in 0 ..0x100 {
222
220
ledger. mine_block ( & credential. address ) . unwrap ( ) ;
223
221
}
224
222
assert_eq ! ( ledger. get_block_height( ) . unwrap( ) , 9 + 0x100 ) ;
225
223
let script = Builder :: new ( )
226
- . push_int ( 0x100 as i64 )
224
+ . push_int ( 0x100_i64 )
227
225
. push_opcode ( OP_CSV )
228
226
. push_opcode ( OP_DROP )
229
227
. push_x_only_key ( & xonly_pk)
@@ -271,13 +269,13 @@ mod tests {
271
269
. push_x_only_key ( & xonly_pk)
272
270
. push_opcode ( OP_CHECKSIG )
273
271
. into_script ( ) ;
274
- if let Ok ( _ ) = ledger. check_sequence (
275
- utxo ,
276
- script ,
277
- Sequence :: from_512_second_intervals ( 0x44 ) . to_consensus_u32 ( ) ,
278
- ) {
279
- assert ! ( false ) ;
280
- } ;
272
+ assert ! ( ledger
273
+ . check_sequence (
274
+ utxo ,
275
+ script ,
276
+ Sequence :: from_512_second_intervals ( 0x44 ) . to_consensus_u32 ( ) ,
277
+ )
278
+ . is_err ( ) ) ;
281
279
282
280
ledger. mine_block ( & credential. address ) . unwrap ( ) ;
283
281
0 commit comments