[wallet] Add test that shwpkh populates witness_utxo
This commit is contained in:
parent
004f81b0a8
commit
fcc408f346
@ -2121,6 +2121,23 @@ mod test {
|
|||||||
assert!(psbt.inputs[0].witness_utxo.is_some());
|
assert!(psbt.inputs[0].witness_utxo.is_some());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_create_tx_shwpkh_has_witness_utxo() {
|
||||||
|
let (wallet, _, _) =
|
||||||
|
get_funded_wallet("sh(wpkh(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW))");
|
||||||
|
let addr = wallet.get_new_address().unwrap();
|
||||||
|
let (psbt, _) = wallet
|
||||||
|
.create_tx(
|
||||||
|
TxBuilder::new()
|
||||||
|
.set_single_recipient(addr.script_pubkey())
|
||||||
|
.drain_wallet(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert!(psbt.inputs[0].non_witness_utxo.is_none());
|
||||||
|
assert!(psbt.inputs[0].witness_utxo.is_some());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_create_tx_both_non_witness_utxo_and_witness_utxo() {
|
fn test_create_tx_both_non_witness_utxo_and_witness_utxo() {
|
||||||
let (wallet, _, _) =
|
let (wallet, _, _) =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user