File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ function p2tr(a, opts) {
67
67
const tweakedKey = ( 0 , types_1 . tweakPublicKey ) ( a . internalPubkey , o . hash ) ;
68
68
if ( tweakedKey ) return tweakedKey . x ;
69
69
}
70
- return null ;
71
70
} ) ;
72
71
lazy . prop ( o , 'signature' , ( ) => {
73
72
if ( a . witness ?. length !== 1 ) return ;
Original file line number Diff line number Diff line change 59
59
]
60
60
}
61
61
},
62
+ {
63
+ "description" : " address, output and signature from pubkey and witness" ,
64
+ "arguments" : {
65
+ "pubkey" : " ab610d22c801def8a1e02368d1b92018970eb52a729919705e8a1a2f60c750f5" ,
66
+ "witness" : [
67
+ " 300602010002010001"
68
+ ]
69
+ },
70
+ "expected" : {
71
+ "name" : " p2tr" ,
72
+ "address" : " bc1p4dss6gkgq8003g0qyd5drwfqrztsadf2w2v3juz73gdz7cx82r6sj7lcqx" ,
73
+ "output" : " OP_1 ab610d22c801def8a1e02368d1b92018970eb52a729919705e8a1a2f60c750f5" ,
74
+ "input" : null ,
75
+ "signature" : " 300602010002010001" ,
76
+ "witness" : [
77
+ " 300602010002010001"
78
+ ]
79
+ }
80
+ },
62
81
{
63
82
"description" : " address, pubkey and output from internalPubkey" ,
64
83
"arguments" : {
150
169
"pubkey" : " ab610d22c801def8a1e02368d1b92018970eb52a729919705e8a1a2f60c750f5"
151
170
}
152
171
},
172
+ {
173
+ "exception" : " Invalid internalPubkey for p2t" ,
174
+ "options" : {},
175
+ "arguments" : {
176
+ "internalPubkey" : " 9fa5ffb68821cf559001caa0577eeea4978b29416def328a707b15e91701a2f8"
177
+ }
178
+ },
153
179
{
154
180
"exception" : " Signature mismatch" ,
155
181
"arguments" : {
Original file line number Diff line number Diff line change @@ -73,7 +73,6 @@ export function p2tr(a: Payment, opts?: PaymentOpts): Payment {
73
73
const tweakedKey = tweakPublicKey ( a . internalPubkey , o . hash )
74
74
if ( tweakedKey ) return tweakedKey . x
75
75
}
76
- return null
77
76
} ) ;
78
77
lazy . prop ( o , 'signature' , ( ) => {
79
78
if ( a . witness ?. length !== 1 ) return ;
You can’t perform that action at this time.
0 commit comments