Skip to content

Commit 19f9095

Browse files
committed
test: add test_legacy_create_tx_custom_sighash()
1 parent ba06877 commit 19f9095

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

wallet/tests/wallet.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,22 @@ fn test_create_tx_custom_sighash() {
11951195
);
11961196
}
11971197

1198+
#[test]
1199+
fn test_legacy_create_tx_custom_sighash() {
1200+
let (mut wallet, _) = get_funded_wallet_single(get_test_pkh());
1201+
let addr = wallet.next_unused_address(KeychainKind::External);
1202+
let mut builder = wallet.build_tx();
1203+
builder
1204+
.add_recipient(addr.script_pubkey(), Amount::from_sat(30_000))
1205+
.sighash(EcdsaSighashType::Single.into());
1206+
let psbt = builder.finish().unwrap();
1207+
1208+
assert_eq!(
1209+
psbt.inputs[0].sighash_type,
1210+
Some(EcdsaSighashType::Single.into())
1211+
);
1212+
}
1213+
11981214
#[test]
11991215
fn test_create_tx_input_hd_keypaths() {
12001216
use bitcoin::bip32::{DerivationPath, Fingerprint};

0 commit comments

Comments
 (0)