Skip to content

Commit d99a583

Browse files
committed
test: add test_legacy_create_tx_custom_sighash()
1 parent 436e09b commit d99a583

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

wallet/tests/wallet.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,22 @@ fn test_create_tx_custom_sighash() {
11781178
);
11791179
}
11801180

1181+
#[test]
1182+
fn test_legacy_create_tx_custom_sighash() {
1183+
let (mut wallet, _) = get_funded_wallet(get_test_pkh(), None);
1184+
let addr = wallet.next_unused_address(KeychainKind::External);
1185+
let mut builder = wallet.build_tx();
1186+
builder
1187+
.add_recipient(addr.script_pubkey(), Amount::from_sat(30_000))
1188+
.sighash(EcdsaSighashType::Single.into());
1189+
let psbt = builder.finish().unwrap();
1190+
1191+
assert_eq!(
1192+
psbt.inputs[0].sighash_type,
1193+
Some(EcdsaSighashType::Single.into())
1194+
);
1195+
}
1196+
11811197
#[test]
11821198
fn test_create_tx_input_hd_keypaths() {
11831199
use bitcoin::bip32::{DerivationPath, Fingerprint};

0 commit comments

Comments
 (0)