File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ impl WrapPsbt {
27
27
pub fn update_input_with_descriptor (
28
28
& mut self ,
29
29
input_index : usize ,
30
- descriptor : WrapDescriptor ,
30
+ descriptor : & WrapDescriptor ,
31
31
) -> Result < ( ) , JsError > {
32
- match descriptor. 0 {
32
+ match & descriptor. 0 {
33
33
WrapDescriptorEnum :: Definite ( d) => self
34
34
. 0
35
35
. update_input_with_descriptor ( input_index, & d)
@@ -47,9 +47,9 @@ impl WrapPsbt {
47
47
pub fn update_output_with_descriptor (
48
48
& mut self ,
49
49
output_index : usize ,
50
- descriptor : WrapDescriptor ,
50
+ descriptor : & WrapDescriptor ,
51
51
) -> Result < ( ) , JsError > {
52
- match descriptor. 0 {
52
+ match & descriptor. 0 {
53
53
WrapDescriptorEnum :: Definite ( d) => self
54
54
. 0
55
55
. update_output_with_descriptor ( output_index, & d)
Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ function describeUpdateInputWithDescriptor(
43
43
describe ( "Wrapped PSBT updateInputWithDescriptor" , function ( ) {
44
44
it ( "should update the input with the descriptor" , function ( ) {
45
45
const wrappedPsbt = toWrappedPsbt ( psbt ) ;
46
- wrappedPsbt . updateInputWithDescriptor ( 0 , descriptor . atDerivationIndex ( index ) ) ;
47
- wrappedPsbt . updateOutputWithDescriptor ( 0 , descriptor . atDerivationIndex ( index ) ) ;
46
+ const descriptorAtDerivation = descriptor . atDerivationIndex ( index ) ;
47
+ wrappedPsbt . updateInputWithDescriptor ( 0 , descriptorAtDerivation ) ;
48
+ wrappedPsbt . updateOutputWithDescriptor ( 0 , descriptorAtDerivation ) ;
48
49
const updatedPsbt = toUtxoPsbt ( wrappedPsbt ) ;
49
50
assertEqualPsbt ( updatedPsbt , getFixtureAtStage ( "unsigned" ) . psbt ) ;
50
51
updatedPsbt . signAllInputsHD ( rootWalletKeys . triple [ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments