@@ -1001,9 +1001,12 @@ pub enum ScriptType {
10011001 P2sh ,
10021002 P2shP2wsh ,
10031003 P2wsh ,
1004- P2tr ,
1005- P2trMusig2 ,
1006- TaprootKeypath ,
1004+ // Chain 30 and 31 - we only support script path spending for these
1005+ P2trLegacyScriptPath ,
1006+ // Chain 40 and 41 - script path spend
1007+ P2trMusig2ScriptPath ,
1008+ // Chain 40 and 41 - keypath spend
1009+ P2trMusig2TaprootKeypath ,
10071010}
10081011
10091012impl ScriptType {
@@ -1013,9 +1016,9 @@ impl ScriptType {
10131016 ScriptType :: P2sh => "p2sh" ,
10141017 ScriptType :: P2shP2wsh => "p2shP2wsh" ,
10151018 ScriptType :: P2wsh => "p2wsh" ,
1016- ScriptType :: P2tr => "p2tr" ,
1017- ScriptType :: P2trMusig2 => "p2trMusig2" ,
1018- ScriptType :: TaprootKeypath => "taprootKeypath" ,
1019+ ScriptType :: P2trLegacyScriptPath => "p2tr" ,
1020+ ScriptType :: P2trMusig2ScriptPath => "p2trMusig2" ,
1021+ ScriptType :: P2trMusig2TaprootKeypath => "taprootKeypath" ,
10191022 }
10201023 }
10211024
@@ -1026,13 +1029,16 @@ impl ScriptType {
10261029 ( ScriptType :: P2sh , PsbtInputFixture :: P2sh ( _) )
10271030 | ( ScriptType :: P2shP2wsh , PsbtInputFixture :: P2shP2wsh ( _) )
10281031 | ( ScriptType :: P2wsh , PsbtInputFixture :: P2wsh ( _) )
1029- | ( ScriptType :: P2tr , PsbtInputFixture :: P2trLegacy ( _) )
10301032 | (
1031- ScriptType :: P2trMusig2 ,
1033+ ScriptType :: P2trLegacyScriptPath ,
1034+ PsbtInputFixture :: P2trLegacy ( _)
1035+ )
1036+ | (
1037+ ScriptType :: P2trMusig2ScriptPath ,
10321038 PsbtInputFixture :: P2trMusig2ScriptPath ( _)
10331039 )
10341040 | (
1035- ScriptType :: TaprootKeypath ,
1041+ ScriptType :: P2trMusig2TaprootKeypath ,
10361042 PsbtInputFixture :: P2trMusig2KeyPath ( _)
10371043 )
10381044 )
@@ -1045,13 +1051,16 @@ impl ScriptType {
10451051 ( ScriptType :: P2sh , PsbtFinalInputFixture :: P2sh ( _) )
10461052 | ( ScriptType :: P2shP2wsh , PsbtFinalInputFixture :: P2shP2wsh ( _) )
10471053 | ( ScriptType :: P2wsh , PsbtFinalInputFixture :: P2wsh ( _) )
1048- | ( ScriptType :: P2tr , PsbtFinalInputFixture :: P2trLegacy ( _) )
10491054 | (
1050- ScriptType :: P2trMusig2 ,
1055+ ScriptType :: P2trLegacyScriptPath ,
1056+ PsbtFinalInputFixture :: P2trLegacy ( _)
1057+ )
1058+ | (
1059+ ScriptType :: P2trMusig2ScriptPath ,
10511060 PsbtFinalInputFixture :: P2trMusig2ScriptPath ( _)
10521061 )
10531062 | (
1054- ScriptType :: TaprootKeypath ,
1063+ ScriptType :: P2trMusig2TaprootKeypath ,
10551064 PsbtFinalInputFixture :: P2trMusig2KeyPath ( _)
10561065 )
10571066 )
@@ -1064,7 +1073,9 @@ impl ScriptType {
10641073 pub fn is_taproot ( & self ) -> bool {
10651074 matches ! (
10661075 self ,
1067- ScriptType :: P2tr | ScriptType :: P2trMusig2 | ScriptType :: TaprootKeypath
1076+ ScriptType :: P2trLegacyScriptPath
1077+ | ScriptType :: P2trMusig2ScriptPath
1078+ | ScriptType :: P2trMusig2TaprootKeypath
10681079 )
10691080 }
10701081
@@ -1382,7 +1393,7 @@ mod tests {
13821393
13831394 // Test finding taproot key path finalized input
13841395 let ( index, input) = fixture
1385- . find_finalized_input_with_script_type ( ScriptType :: TaprootKeypath )
1396+ . find_finalized_input_with_script_type ( ScriptType :: P2trMusig2TaprootKeypath )
13861397 . expect ( "Failed to find taproot key path finalized input" ) ;
13871398 assert_eq ! ( index, 5 ) ;
13881399 assert ! ( matches!( input, PsbtFinalInputFixture :: P2trMusig2KeyPath ( _) ) ) ;
0 commit comments