Skip to content

Commit 2d469bf

Browse files
committed
Implement encryptwallet method and test
1 parent b1f1461 commit 2d469bf

File tree

42 files changed

+87
-39
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+87
-39
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ crate::impl_client_v17__bump_fee!();
117117
crate::impl_client_v17__create_wallet!();
118118
crate::impl_client_v17__dump_priv_key!();
119119
crate::impl_client_v17__dump_wallet!();
120+
crate::impl_client_v17__encrypt_wallet!();
120121
crate::impl_client_v17__get_addresses_by_label!();
121122
crate::impl_client_v17__get_address_info!();
122123
crate::impl_client_v17__get_balance!();

client/src/client_sync/v17/wallet.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,19 @@ macro_rules! impl_client_v17__dump_wallet {
124124
};
125125
}
126126

127+
/// Implements Bitcoin Core JSON-RPC API method `encryptwallet`.
128+
#[macro_export]
129+
macro_rules! impl_client_v17__encrypt_wallet {
130+
() => {
131+
impl Client {
132+
// filename is either absolute or relative to bitcoind.
133+
pub fn encrypt_wallet(&self, passphrase: &str) -> Result<EncryptWallet> {
134+
self.call("encryptwallet", &[into_json(passphrase)?])
135+
}
136+
}
137+
};
138+
}
139+
127140
/// Implements Bitcoin Core JSON-RPC API method `getaddressesbylabel`.
128141
#[macro_export]
129142
macro_rules! impl_client_v17__get_addresses_by_label {

client/src/client_sync/v18/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ crate::impl_client_v17__bump_fee!();
131131
crate::impl_client_v17__create_wallet!();
132132
crate::impl_client_v17__dump_priv_key!();
133133
crate::impl_client_v17__dump_wallet!();
134+
crate::impl_client_v17__encrypt_wallet!();
134135
crate::impl_client_v17__get_addresses_by_label!();
135136
crate::impl_client_v17__get_address_info!();
136137
crate::impl_client_v17__get_balance!();

client/src/client_sync/v19/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ crate::impl_client_v17__bump_fee!();
126126
crate::impl_client_v17__create_wallet!();
127127
crate::impl_client_v17__dump_priv_key!();
128128
crate::impl_client_v17__dump_wallet!();
129+
crate::impl_client_v17__encrypt_wallet!();
129130
crate::impl_client_v17__get_addresses_by_label!();
130131
crate::impl_client_v17__get_address_info!();
131132
crate::impl_client_v17__get_balance!();

client/src/client_sync/v20/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ crate::impl_client_v17__bump_fee!();
123123
crate::impl_client_v17__create_wallet!();
124124
crate::impl_client_v17__dump_priv_key!();
125125
crate::impl_client_v17__dump_wallet!();
126+
crate::impl_client_v17__encrypt_wallet!();
126127
crate::impl_client_v17__get_addresses_by_label!();
127128
crate::impl_client_v17__get_address_info!();
128129
crate::impl_client_v17__get_balance!();

client/src/client_sync/v21/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ crate::impl_client_v17__bump_fee!();
125125
crate::impl_client_v17__create_wallet!();
126126
crate::impl_client_v17__dump_priv_key!();
127127
crate::impl_client_v17__dump_wallet!();
128+
crate::impl_client_v17__encrypt_wallet!();
128129
crate::impl_client_v18__get_received_by_label!();
129130
crate::impl_client_v17__get_addresses_by_label!();
130131
crate::impl_client_v17__get_address_info!();

client/src/client_sync/v22/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ crate::impl_client_v17__bump_fee!();
125125
crate::impl_client_v17__create_wallet!();
126126
crate::impl_client_v17__dump_priv_key!();
127127
crate::impl_client_v17__dump_wallet!();
128+
crate::impl_client_v17__encrypt_wallet!();
128129
crate::impl_client_v18__get_received_by_label!();
129130
crate::impl_client_v17__get_addresses_by_label!();
130131
crate::impl_client_v17__get_address_info!();

client/src/client_sync/v23/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ crate::impl_client_v17__bump_fee!();
127127
crate::impl_client_v23__create_wallet!();
128128
crate::impl_client_v17__dump_priv_key!();
129129
crate::impl_client_v17__dump_wallet!();
130+
crate::impl_client_v17__encrypt_wallet!();
130131
crate::impl_client_v17__get_addresses_by_label!();
131132
crate::impl_client_v17__get_address_info!();
132133
crate::impl_client_v17__get_balance!();

client/src/client_sync/v24/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ crate::impl_client_v17__bump_fee!();
124124
crate::impl_client_v23__create_wallet!();
125125
crate::impl_client_v17__dump_priv_key!();
126126
crate::impl_client_v17__dump_wallet!();
127+
crate::impl_client_v17__encrypt_wallet!();
127128
crate::impl_client_v17__get_addresses_by_label!();
128129
crate::impl_client_v17__get_address_info!();
129130
crate::impl_client_v17__get_balance!();

client/src/client_sync/v25/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ crate::impl_client_v17__bump_fee!();
124124
crate::impl_client_v23__create_wallet!();
125125
crate::impl_client_v17__dump_priv_key!();
126126
crate::impl_client_v17__dump_wallet!();
127+
crate::impl_client_v17__encrypt_wallet!();
127128
crate::impl_client_v17__get_addresses_by_label!();
128129
crate::impl_client_v17__get_address_info!();
129130
crate::impl_client_v17__get_balance!();

0 commit comments

Comments
 (0)