Skip to content

Commit 0fe8f1b

Browse files
committed
Test getzmqnotifications
The RPC struct exists but there is no client macro or test. The return changes in v18 and then stays the same up to v29. Add an updated struct for v18. Add the client macro, test and update the types table.
1 parent 17e19ce commit 0fe8f1b

File tree

29 files changed

+139
-36
lines changed

29 files changed

+139
-36
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub mod network;
1212
pub mod raw_transactions;
1313
pub mod util;
1414
pub mod wallet;
15+
pub mod zmq;
1516

1617
use std::collections::{BTreeMap, HashMap};
1718
use std::path::Path;
@@ -159,6 +160,9 @@ crate::impl_client_v17__wallet_passphrase!();
159160
crate::impl_client_v17__wallet_passphrase_change!();
160161
crate::impl_client_v17__wallet_process_psbt!();
161162

163+
// == Zmq ==
164+
crate::impl_client_v17__get_zmq_notifications!();
165+
162166
/// Argument to the `Client::get_new_address_with_type` function.
163167
///
164168
/// For Core versions 0.17 through to v22. For Core v23 and onwards use `v23::AddressType`.

client/src/client_sync/v17/zmq.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: CC0-1.0
2+
3+
//! Macros for implementing JSON-RPC methods for the `== Zmq ==` section (v0.17).
4+
5+
/// Implements Bitcoin Core JSON-RPC API method `getzmqnotifications`.
6+
#[macro_export]
7+
macro_rules! impl_client_v17__get_zmq_notifications {
8+
() => {
9+
impl Client {
10+
pub fn get_zmq_notifications(&self) -> Result<Vec<GetZmqNotifications>> {
11+
self.call("getzmqnotifications", &[])
12+
}
13+
}
14+
};
15+
}

client/src/client_sync/v18/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,6 @@ crate::impl_client_v17__wallet_lock!();
175175
crate::impl_client_v17__wallet_passphrase!();
176176
crate::impl_client_v17__wallet_passphrase_change!();
177177
crate::impl_client_v17__wallet_process_psbt!();
178+
179+
// == Zmq ==
180+
crate::impl_client_v17__get_zmq_notifications!();

client/src/client_sync/v19/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,6 @@ crate::impl_client_v17__wallet_lock!();
172172
crate::impl_client_v17__wallet_passphrase!();
173173
crate::impl_client_v17__wallet_passphrase_change!();
174174
crate::impl_client_v17__wallet_process_psbt!();
175+
176+
// == Zmq ==
177+
crate::impl_client_v17__get_zmq_notifications!();

client/src/client_sync/v20/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,6 @@ crate::impl_client_v17__wallet_lock!();
172172
crate::impl_client_v17__wallet_passphrase!();
173173
crate::impl_client_v17__wallet_passphrase_change!();
174174
crate::impl_client_v17__wallet_process_psbt!();
175+
176+
// == Zmq ==
177+
crate::impl_client_v17__get_zmq_notifications!();

client/src/client_sync/v21/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ crate::impl_client_v17__wallet_passphrase!();
186186
crate::impl_client_v17__wallet_passphrase_change!();
187187
crate::impl_client_v17__wallet_process_psbt!();
188188

189+
// == Zmq ==
190+
crate::impl_client_v17__get_zmq_notifications!();
191+
189192
/// Request object for the `importdescriptors` method.
190193
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
191194
#[serde(deny_unknown_fields)]

client/src/client_sync/v22/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,6 @@ crate::impl_client_v17__wallet_lock!();
188188
crate::impl_client_v17__wallet_passphrase!();
189189
crate::impl_client_v17__wallet_passphrase_change!();
190190
crate::impl_client_v17__wallet_process_psbt!();
191+
192+
// == Zmq ==
193+
crate::impl_client_v17__get_zmq_notifications!();

client/src/client_sync/v23/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ crate::impl_client_v17__wallet_passphrase!();
194194
crate::impl_client_v17__wallet_passphrase_change!();
195195
crate::impl_client_v17__wallet_process_psbt!();
196196

197+
// == Zmq ==
198+
crate::impl_client_v17__get_zmq_notifications!();
199+
197200
/// Argument to the `Client::get_new_address_with_type` function.
198201
///
199202
/// For Core v23 and onwards. For earlier versions use `v17::AddressType`.

client/src/client_sync/v24/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,6 @@ crate::impl_client_v17__wallet_lock!();
197197
crate::impl_client_v17__wallet_passphrase!();
198198
crate::impl_client_v17__wallet_passphrase_change!();
199199
crate::impl_client_v17__wallet_process_psbt!();
200+
201+
// == Zmq ==
202+
crate::impl_client_v17__get_zmq_notifications!();

client/src/client_sync/v25/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,6 @@ crate::impl_client_v17__wallet_lock!();
198198
crate::impl_client_v17__wallet_passphrase!();
199199
crate::impl_client_v17__wallet_passphrase_change!();
200200
crate::impl_client_v17__wallet_process_psbt!();
201+
202+
// == Zmq ==
203+
crate::impl_client_v17__get_zmq_notifications!();

0 commit comments

Comments
 (0)