Skip to content

Commit 86b06c5

Browse files
committed
Implement walletpassphrase method and test
1 parent 6875709 commit 86b06c5

File tree

15 files changed

+40
-0
lines changed

15 files changed

+40
-0
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
155155
crate::impl_client_v17__unload_wallet!();
156156
crate::impl_client_v17__wallet_create_funded_psbt!();
157157
crate::impl_client_v17__wallet_lock!();
158+
crate::impl_client_v17__wallet_passphrase!();
158159
crate::impl_client_v17__wallet_process_psbt!();
159160

160161
/// Argument to the `Client::get_new_address_with_type` function.

client/src/client_sync/v17/wallet.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,22 @@ macro_rules! impl_client_v17__unload_wallet {
666666
};
667667
}
668668

669+
/// Implements Bitcoin Core JSON-RPC API method `walletpassphrase`
670+
#[macro_export]
671+
macro_rules! impl_client_v17__wallet_passphrase {
672+
() => {
673+
impl Client {
674+
pub fn wallet_passphrase(&self, passphrase: &str, timeout: u64) -> Result<()> {
675+
match self.call("walletpassphrase", &[passphrase.into(), timeout.into()]) {
676+
Ok(serde_json::Value::Null) => Ok(()),
677+
Ok(res) => Err(Error::Returned(res.to_string())),
678+
Err(err) => Err(err.into()),
679+
}
680+
}
681+
}
682+
};
683+
}
684+
669685
/// Implements Bitcoin Core JSON-RPC API method `walletcreatefundedpsbt`.
670686
#[macro_export]
671687
macro_rules! impl_client_v17__wallet_create_funded_psbt {

client/src/client_sync/v18/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,5 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
172172
crate::impl_client_v17__unload_wallet!();
173173
crate::impl_client_v17__wallet_create_funded_psbt!();
174174
crate::impl_client_v17__wallet_lock!();
175+
crate::impl_client_v17__wallet_passphrase!();
175176
crate::impl_client_v17__wallet_process_psbt!();

client/src/client_sync/v19/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,5 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
169169
crate::impl_client_v17__unload_wallet!();
170170
crate::impl_client_v17__wallet_create_funded_psbt!();
171171
crate::impl_client_v17__wallet_lock!();
172+
crate::impl_client_v17__wallet_passphrase!();
172173
crate::impl_client_v17__wallet_process_psbt!();

client/src/client_sync/v20/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,5 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
169169
crate::impl_client_v17__unload_wallet!();
170170
crate::impl_client_v17__wallet_create_funded_psbt!();
171171
crate::impl_client_v17__wallet_lock!();
172+
crate::impl_client_v17__wallet_passphrase!();
172173
crate::impl_client_v17__wallet_process_psbt!();

client/src/client_sync/v21/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,5 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
169169
crate::impl_client_v21__unload_wallet!();
170170
crate::impl_client_v17__wallet_create_funded_psbt!();
171171
crate::impl_client_v17__wallet_lock!();
172+
crate::impl_client_v17__wallet_passphrase!();
172173
crate::impl_client_v17__wallet_process_psbt!();

client/src/client_sync/v22/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,5 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
169169
crate::impl_client_v21__unload_wallet!();
170170
crate::impl_client_v17__wallet_create_funded_psbt!();
171171
crate::impl_client_v17__wallet_lock!();
172+
crate::impl_client_v17__wallet_passphrase!();
172173
crate::impl_client_v17__wallet_process_psbt!();

client/src/client_sync/v23/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
171171
crate::impl_client_v21__unload_wallet!();
172172
crate::impl_client_v17__wallet_create_funded_psbt!();
173173
crate::impl_client_v17__wallet_lock!();
174+
crate::impl_client_v17__wallet_passphrase!();
174175
crate::impl_client_v17__wallet_process_psbt!();
175176

176177
/// Argument to the `Client::get_new_address_with_type` function.

client/src/client_sync/v24/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,5 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
168168
crate::impl_client_v21__unload_wallet!();
169169
crate::impl_client_v17__wallet_create_funded_psbt!();
170170
crate::impl_client_v17__wallet_lock!();
171+
crate::impl_client_v17__wallet_passphrase!();
171172
crate::impl_client_v17__wallet_process_psbt!();

client/src/client_sync/v25/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,5 @@ crate::impl_client_v17__sign_raw_transaction_with_wallet!();
168168
crate::impl_client_v21__unload_wallet!();
169169
crate::impl_client_v17__wallet_create_funded_psbt!();
170170
crate::impl_client_v17__wallet_lock!();
171+
crate::impl_client_v17__wallet_passphrase!();
171172
crate::impl_client_v17__wallet_process_psbt!();

0 commit comments

Comments
 (0)