Added a wallet unit test to send to a Bech32m address

This commit is contained in:
Sandipan Dey
2021-09-13 21:59:20 +05:30
committed by Steve Myers
parent 5830226216
commit 54f61d17f2
3 changed files with 17 additions and 2 deletions

View File

@@ -370,7 +370,7 @@ impl ConfigurableBlockchain for RpcBlockchain {
client.load_wallet(&wallet_name)?;
debug!("wallet loaded {:?}", wallet_name);
} else {
client.create_wallet(&wallet_name, Some(true), None, None, None)?;
client.create_wallet(&wallet_name, Some(true), None, None, None, None)?;
debug!("wallet created {:?}", wallet_name);
}
}
@@ -445,7 +445,7 @@ where
}
/// return the wallets available in default wallet directory
//TODO use bitcoincore_rpc method when PR #179 lands
//TODO use core_rpc method when PR #179 lands
fn list_wallet_dir(client: &Client) -> Result<Vec<String>, Error> {
#[derive(Deserialize)]
struct Name {

View File

@@ -3994,4 +3994,15 @@ pub(crate) mod test {
}
);
}
#[test]
fn test_sending_to_bip350_bech32m_address() {
let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
let addr =
Address::from_str("tb1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesf3hn0c")
.unwrap();
let mut builder = wallet.build_tx();
builder.add_recipient(addr.script_pubkey(), 45_000);
builder.finish().unwrap();
}
}