Skip to content

Commit 8c14cd0

Browse files
committed
Implement backupwallet method and test
1 parent f9f907a commit 8c14cd0

File tree

15 files changed

+46
-0
lines changed

15 files changed

+46
-0
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ crate::impl_client_v17__verify_message!();
111111
crate::impl_client_v17__abandon_transaction!();
112112
crate::impl_client_v17__abort_rescan!();
113113
crate::impl_client_v17__add_multisig_address!();
114+
crate::impl_client_v17__backup_wallet!();
114115
crate::impl_client_v17__bump_fee!();
115116
crate::impl_client_v17__create_wallet!();
116117
crate::impl_client_v17__dump_priv_key!();

client/src/client_sync/v17/wallet.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ macro_rules! impl_client_v17__add_multisig_address {
5959
};
6060
}
6161

62+
/// Implements Bitcoin Core JSON-RPC API method `bumpfee`.
63+
#[macro_export]
64+
macro_rules! impl_client_v17__backup_wallet {
65+
() => {
66+
impl Client {
67+
pub fn backup_wallet(&self, destination: &Path) -> Result<()> {
68+
match self.call("backupwallet", &[into_json(destination)?]) {
69+
Ok(serde_json::Value::Null) => Ok(()),
70+
Ok(res) => Err(Error::Returned(res.to_string())),
71+
Err(err) => Err(err.into()),
72+
}
73+
}
74+
}
75+
};
76+
}
77+
6278
/// Implements Bitcoin Core JSON-RPC API method `bumpfee`.
6379
#[macro_export]
6480
macro_rules! impl_client_v17__bump_fee {

client/src/client_sync/v18/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ crate::impl_client_v17__verify_message!();
125125
crate::impl_client_v17__abandon_transaction!();
126126
crate::impl_client_v17__abort_rescan!();
127127
crate::impl_client_v17__add_multisig_address!();
128+
crate::impl_client_v17__backup_wallet!();
128129
crate::impl_client_v17__bump_fee!();
129130
crate::impl_client_v17__create_wallet!();
130131
crate::impl_client_v17__dump_priv_key!();

client/src/client_sync/v19/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ crate::impl_client_v17__verify_message!();
120120
crate::impl_client_v17__abandon_transaction!();
121121
crate::impl_client_v17__abort_rescan!();
122122
crate::impl_client_v17__add_multisig_address!();
123+
crate::impl_client_v17__backup_wallet!();
123124
crate::impl_client_v17__bump_fee!();
124125
crate::impl_client_v17__create_wallet!();
125126
crate::impl_client_v17__dump_priv_key!();

client/src/client_sync/v20/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ crate::impl_client_v17__verify_message!();
117117
crate::impl_client_v17__abandon_transaction!();
118118
crate::impl_client_v17__abort_rescan!();
119119
crate::impl_client_v17__add_multisig_address!();
120+
crate::impl_client_v17__backup_wallet!();
120121
crate::impl_client_v17__bump_fee!();
121122
crate::impl_client_v17__create_wallet!();
122123
crate::impl_client_v17__dump_priv_key!();

client/src/client_sync/v21/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ crate::impl_client_v17__verify_message!();
119119
crate::impl_client_v17__abandon_transaction!();
120120
crate::impl_client_v17__abort_rescan!();
121121
crate::impl_client_v17__add_multisig_address!();
122+
crate::impl_client_v17__backup_wallet!();
122123
crate::impl_client_v17__bump_fee!();
123124
crate::impl_client_v17__create_wallet!();
124125
crate::impl_client_v17__dump_priv_key!();

client/src/client_sync/v22/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ crate::impl_client_v17__verify_message!();
119119
crate::impl_client_v17__abandon_transaction!();
120120
crate::impl_client_v17__abort_rescan!();
121121
crate::impl_client_v17__add_multisig_address!();
122+
crate::impl_client_v17__backup_wallet!();
122123
crate::impl_client_v17__bump_fee!();
123124
crate::impl_client_v17__create_wallet!();
124125
crate::impl_client_v17__dump_priv_key!();

client/src/client_sync/v23/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ crate::impl_client_v17__verify_message!();
121121
crate::impl_client_v17__abandon_transaction!();
122122
crate::impl_client_v17__abort_rescan!();
123123
crate::impl_client_v17__add_multisig_address!();
124+
crate::impl_client_v17__backup_wallet!();
124125
crate::impl_client_v17__bump_fee!();
125126
crate::impl_client_v23__create_wallet!();
126127
crate::impl_client_v17__dump_priv_key!();

client/src/client_sync/v24/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ crate::impl_client_v17__verify_message!();
118118
crate::impl_client_v17__abandon_transaction!();
119119
crate::impl_client_v17__abort_rescan!();
120120
crate::impl_client_v17__add_multisig_address!();
121+
crate::impl_client_v17__backup_wallet!();
121122
crate::impl_client_v17__bump_fee!();
122123
crate::impl_client_v23__create_wallet!();
123124
crate::impl_client_v17__dump_priv_key!();

client/src/client_sync/v25/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ crate::impl_client_v17__verify_message!();
118118
crate::impl_client_v17__abandon_transaction!();
119119
crate::impl_client_v17__abort_rescan!();
120120
crate::impl_client_v17__add_multisig_address!();
121+
crate::impl_client_v17__backup_wallet!();
121122
crate::impl_client_v17__bump_fee!();
122123
crate::impl_client_v23__create_wallet!();
123124
crate::impl_client_v17__dump_priv_key!();

0 commit comments

Comments
 (0)