Skip to content

Commit 1106a6a

Browse files
committed
fix default handling for sighash type
1 parent 0965a24 commit 1106a6a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

client/src/client.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -972,10 +972,12 @@ pub trait RpcApi: Sized {
972972
opt_into_json(sighash_type)?,
973973
opt_into_json(bip32derivs)?,
974974
];
975-
self.call(
976-
"walletprocesspsbt",
977-
handle_defaults(&mut args, &[true.into(), null(), true.into()]),
978-
)
975+
let defaults = [
976+
true.into(),
977+
into_json(json::SigHashType::from(bitcoin::SigHashType::All))?,
978+
true.into(),
979+
];
980+
self.call("walletprocesspsbt", handle_defaults(&mut args, &defaults))
979981
}
980982

981983
fn get_descriptor_info(&self, desc: &str) -> Result<json::GetDescriptorInfoResult> {

integration_test/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,7 @@ fn test_wallet_process_psbt(cl: &Client) {
721721
.wallet_create_funded_psbt(&[input.clone()], &output, Some(500_000), None, Some(true))
722722
.unwrap();
723723

724-
let res = cl
725-
.wallet_process_psbt(&psbt.psbt, Some(true), Some(SigHashType::All.into()), Some(true))
726-
.unwrap();
724+
let res = cl.wallet_process_psbt(&psbt.psbt, Some(true), None, Some(true)).unwrap();
727725
assert!(res.complete);
728726
}
729727

0 commit comments

Comments
 (0)