@@ -420,21 +420,21 @@ impl Script {
420
420
/// Checks whether a script pubkey is a p2sh output
421
421
#[ inline]
422
422
pub fn is_p2sh ( & self ) -> bool {
423
- self . 0 . len ( ) == 23 &&
424
- self . 0 [ 0 ] == opcodes:: all:: OP_HASH160 . into_u8 ( ) &&
425
- self . 0 [ 1 ] == opcodes:: all:: OP_PUSHBYTES_20 . into_u8 ( ) &&
426
- self . 0 [ 22 ] == opcodes:: all:: OP_EQUAL . into_u8 ( )
423
+ self . 0 . len ( ) == 23
424
+ && self . 0 [ 0 ] == opcodes:: all:: OP_HASH160 . into_u8 ( )
425
+ && self . 0 [ 1 ] == opcodes:: all:: OP_PUSHBYTES_20 . into_u8 ( )
426
+ && self . 0 [ 22 ] == opcodes:: all:: OP_EQUAL . into_u8 ( )
427
427
}
428
428
429
429
/// Checks whether a script pubkey is a p2pkh output
430
430
#[ inline]
431
431
pub fn is_p2pkh ( & self ) -> bool {
432
- self . 0 . len ( ) == 25 &&
433
- self . 0 [ 0 ] == opcodes:: all:: OP_DUP . into_u8 ( ) &&
434
- self . 0 [ 1 ] == opcodes:: all:: OP_HASH160 . into_u8 ( ) &&
435
- self . 0 [ 2 ] == opcodes:: all:: OP_PUSHBYTES_20 . into_u8 ( ) &&
436
- self . 0 [ 23 ] == opcodes:: all:: OP_EQUALVERIFY . into_u8 ( ) &&
437
- self . 0 [ 24 ] == opcodes:: all:: OP_CHECKSIG . into_u8 ( )
432
+ self . 0 . len ( ) == 25
433
+ && self . 0 [ 0 ] == opcodes:: all:: OP_DUP . into_u8 ( )
434
+ && self . 0 [ 1 ] == opcodes:: all:: OP_HASH160 . into_u8 ( )
435
+ && self . 0 [ 2 ] == opcodes:: all:: OP_PUSHBYTES_20 . into_u8 ( )
436
+ && self . 0 [ 23 ] == opcodes:: all:: OP_EQUALVERIFY . into_u8 ( )
437
+ && self . 0 [ 24 ] == opcodes:: all:: OP_CHECKSIG . into_u8 ( )
438
438
}
439
439
440
440
/// Checks whether a script pubkey is a p2pk output
@@ -476,25 +476,25 @@ impl Script {
476
476
/// Checks whether a script pubkey is a p2wsh output
477
477
#[ inline]
478
478
pub fn is_v0_p2wsh ( & self ) -> bool {
479
- self . 0 . len ( ) == 34 &&
480
- self . witness_version ( ) == Some ( WitnessVersion :: V0 ) &&
481
- self . 0 [ 1 ] == opcodes:: all:: OP_PUSHBYTES_32 . into_u8 ( )
479
+ self . 0 . len ( ) == 34
480
+ && self . witness_version ( ) == Some ( WitnessVersion :: V0 )
481
+ && self . 0 [ 1 ] == opcodes:: all:: OP_PUSHBYTES_32 . into_u8 ( )
482
482
}
483
483
484
484
/// Checks whether a script pubkey is a p2wpkh output
485
485
#[ inline]
486
486
pub fn is_v0_p2wpkh ( & self ) -> bool {
487
- self . 0 . len ( ) == 22 &&
488
- self . witness_version ( ) == Some ( WitnessVersion :: V0 ) &&
489
- self . 0 [ 1 ] == opcodes:: all:: OP_PUSHBYTES_20 . into_u8 ( )
487
+ self . 0 . len ( ) == 22
488
+ && self . witness_version ( ) == Some ( WitnessVersion :: V0 )
489
+ && self . 0 [ 1 ] == opcodes:: all:: OP_PUSHBYTES_20 . into_u8 ( )
490
490
}
491
491
492
492
/// Checks whether a script pubkey is a P2TR output
493
493
#[ inline]
494
494
pub fn is_v1_p2tr ( & self ) -> bool {
495
- self . 0 . len ( ) == 34 &&
496
- self . witness_version ( ) == Some ( WitnessVersion :: V1 ) &&
497
- self . 0 [ 1 ] == opcodes:: all:: OP_PUSHBYTES_32 . into_u8 ( )
495
+ self . 0 . len ( ) == 34
496
+ && self . witness_version ( ) == Some ( WitnessVersion :: V1 )
497
+ && self . 0 [ 1 ] == opcodes:: all:: OP_PUSHBYTES_32 . into_u8 ( )
498
498
}
499
499
500
500
/// Check if this is an OP_RETURN output
0 commit comments