Skip to content

Commit

Permalink
Add test and fix for new address
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharding committed Jun 13, 2024
1 parent 28cc7db commit 4127166
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/client_sync/v17/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ crate::impl_client_v17__gettransaction!();

/// Argument to the `Client::get_new_address_with_type` function.
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum AddressType {
Legacy,
P2ShSegwit,
Expand Down
1 change: 1 addition & 0 deletions client/src/client_sync/v23.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ crate::impl_client_v17__gettransaction!();

/// Argument to the `Client::get_new_address_with_type` function.
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum AddressType {
Legacy,
P2ShSegwit,
Expand Down
8 changes: 8 additions & 0 deletions integration_test/src/v17/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@ macro_rules! impl_test_v17__getnewaddress {
() => {
#[test]
fn get_new_address() {
use bitcoind::AddressType;

let bitcoind = $crate::bitcoind_with_default_wallet();
let _ = bitcoind.client.get_new_address().expect("getnewaddress");

let addr = bitcoind
.client
.new_address_with_type(AddressType::Bech32)
.unwrap();

}
};
}
Expand Down

0 comments on commit 4127166

Please sign in to comment.