Skip to content

Commit b32a91d

Browse files
committed
Merge #277: Implement keypoolrefill method and test
f42ff9b Implement keypoolrefill method and test (GideonBature) Pull request description: The JSON-RPC method `keypoolrefill` does not return anything. We want to test this to catch any changes in behavior in future Core versions. This PR adds a client function that errors if the return value is anything other than `null`, along with an integration test that calls this function. Ref: [#116](#116) ACKs for top commit: tcharding: ACK f42ff9b Tree-SHA512: f1b632b718e36836092b25814a9073e0acf9ba2d34db72a6541c3bc4407e34b81673d9bbb180f067ff04421fa3f2ada3bd4d2fcea78363d9650155b80392ec9e
2 parents 857cfb6 + f42ff9b commit b32a91d

File tree

15 files changed

+36
-0
lines changed

15 files changed

+36
-0
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ crate::impl_client_v17__import_privkey!();
133133
crate::impl_client_v17__import_pruned_funds!();
134134
crate::impl_client_v17__import_pubkey!();
135135
crate::impl_client_v17__import_wallet!();
136+
crate::impl_client_v17__key_pool_refill!();
136137
crate::impl_client_v17__list_address_groupings!();
137138
crate::impl_client_v17__list_labels!();
138139
crate::impl_client_v17__list_lock_unspent!();

client/src/client_sync/v17/wallet.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,22 @@ macro_rules! impl_client_v17__import_wallet {
381381
};
382382
}
383383

384+
/// Implements Bitcoin Core JSON-RPC API method `keypoolrefill`.
385+
#[macro_export]
386+
macro_rules! impl_client_v17__key_pool_refill {
387+
() => {
388+
impl Client {
389+
pub fn key_pool_refill(&self) -> Result<()> {
390+
match self.call("keypoolrefill", &[]) {
391+
Ok(serde_json::Value::Null) => Ok(()),
392+
Ok(res) => Err(Error::Returned(res.to_string())),
393+
Err(err) => Err(err.into()),
394+
}
395+
}
396+
}
397+
};
398+
}
399+
384400
/// Implements Bitcoin Core JSON-RPC API method `listaddressgroupings`.
385401
#[macro_export]
386402
macro_rules! impl_client_v17__list_address_groupings {

client/src/client_sync/v18/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ crate::impl_client_v17__import_privkey!();
148148
crate::impl_client_v17__import_pruned_funds!();
149149
crate::impl_client_v17__import_pubkey!();
150150
crate::impl_client_v17__import_wallet!();
151+
crate::impl_client_v17__key_pool_refill!();
151152
crate::impl_client_v17__list_address_groupings!();
152153
crate::impl_client_v17__list_labels!();
153154
crate::impl_client_v17__list_lock_unspent!();

client/src/client_sync/v19/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ crate::impl_client_v17__import_privkey!();
144144
crate::impl_client_v17__import_pruned_funds!();
145145
crate::impl_client_v17__import_pubkey!();
146146
crate::impl_client_v17__import_wallet!();
147+
crate::impl_client_v17__key_pool_refill!();
147148
crate::impl_client_v17__list_address_groupings!();
148149
crate::impl_client_v18__list_received_by_label!();
149150
crate::impl_client_v17__list_labels!();

client/src/client_sync/v20/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ crate::impl_client_v17__import_privkey!();
141141
crate::impl_client_v17__import_pruned_funds!();
142142
crate::impl_client_v17__import_pubkey!();
143143
crate::impl_client_v17__import_wallet!();
144+
crate::impl_client_v17__key_pool_refill!();
144145
crate::impl_client_v17__list_address_groupings!();
145146
crate::impl_client_v17__list_labels!();
146147
crate::impl_client_v18__list_received_by_label!();

client/src/client_sync/v21/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ crate::impl_client_v17__import_privkey!();
143143
crate::impl_client_v17__import_pruned_funds!();
144144
crate::impl_client_v17__import_pubkey!();
145145
crate::impl_client_v17__import_wallet!();
146+
crate::impl_client_v17__key_pool_refill!();
146147
crate::impl_client_v17__list_address_groupings!();
147148
crate::impl_client_v17__list_labels!();
148149
crate::impl_client_v18__list_received_by_label!();

client/src/client_sync/v22/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ crate::impl_client_v17__import_privkey!();
143143
crate::impl_client_v17__import_pruned_funds!();
144144
crate::impl_client_v17__import_pubkey!();
145145
crate::impl_client_v17__import_wallet!();
146+
crate::impl_client_v17__key_pool_refill!();
146147
crate::impl_client_v17__list_address_groupings!();
147148
crate::impl_client_v18__list_received_by_label!();
148149
crate::impl_client_v17__list_labels!();

client/src/client_sync/v23/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ crate::impl_client_v17__import_privkey!();
145145
crate::impl_client_v17__import_pruned_funds!();
146146
crate::impl_client_v17__import_pubkey!();
147147
crate::impl_client_v17__import_wallet!();
148+
crate::impl_client_v17__key_pool_refill!();
148149
crate::impl_client_v17__list_address_groupings!();
149150
crate::impl_client_v18__list_received_by_label!();
150151
crate::impl_client_v17__list_labels!();

client/src/client_sync/v24/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ crate::impl_client_v17__import_privkey!();
142142
crate::impl_client_v17__import_pruned_funds!();
143143
crate::impl_client_v17__import_pubkey!();
144144
crate::impl_client_v17__import_wallet!();
145+
crate::impl_client_v17__key_pool_refill!();
145146
crate::impl_client_v17__list_address_groupings!();
146147
crate::impl_client_v18__list_received_by_label!();
147148
crate::impl_client_v17__list_labels!();

client/src/client_sync/v25/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ crate::impl_client_v17__import_privkey!();
142142
crate::impl_client_v17__import_pruned_funds!();
143143
crate::impl_client_v17__import_pubkey!();
144144
crate::impl_client_v17__import_wallet!();
145+
crate::impl_client_v17__key_pool_refill!();
145146
crate::impl_client_v17__list_address_groupings!();
146147
crate::impl_client_v18__list_received_by_label!();
147148
crate::impl_client_v17__list_labels!();

0 commit comments

Comments
 (0)