File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -521,6 +521,7 @@ impl FieldAccess for Value {
521
521
Value :: Descriptor ( x) => x. get_field ( field) ,
522
522
Value :: TapInfo ( x) => x. get_field ( field) ,
523
523
Value :: Address ( x) => x. get_field ( field) ,
524
+ Value :: WshScript ( x) => x. get_field ( field) ,
524
525
_ => None ,
525
526
}
526
527
}
Original file line number Diff line number Diff line change @@ -552,6 +552,20 @@ impl FieldAccess for Address {
552
552
}
553
553
}
554
554
555
+ impl FieldAccess for WshScript {
556
+ fn get_field ( self , field : & Value ) -> Option < Value > {
557
+ Some ( match field. as_str ( ) ? {
558
+ "script_pubkey" => self . 0 . to_p2wsh ( ) . into ( ) ,
559
+ "explicit_script" => self . 0 . into ( ) ,
560
+ "address_type" => bitcoin:: AddressType :: P2wsh . into ( ) ,
561
+ "witness_program" => bitcoin:: WitnessProgram :: p2wsh ( & self . 0 ) . into ( ) ,
562
+ _ => {
563
+ return None ;
564
+ }
565
+ } )
566
+ }
567
+ }
568
+
555
569
// Display
556
570
557
571
impl PrettyDisplay for ScriptBuf {
You can’t perform that action at this time.
0 commit comments