Skip to content

Commit 4778897

Browse files
committed
add integration test and doc comment for get_zmq_notifications
1 parent 04bb03e commit 4778897

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

client/src/client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,7 @@ pub trait RpcApi: Sized {
12641264
self.call("scantxoutset", &["start".into(), into_json(descriptors)?])
12651265
}
12661266

1267+
/// Returns information about the active ZeroMQ notifications
12671268
fn get_zmq_notifications(&self) -> Result<Vec<json::GetZmqNotificationsResult>> {
12681269
self.call("getzmqnotifications", &[])
12691270
}

integration_test/src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ fn main() {
226226
test_add_ban(&cl);
227227
test_set_network_active(&cl);
228228
test_get_index_info(&cl);
229+
test_get_zmq_notifications(&cl);
229230
test_stop(cl);
230231
}
231232

@@ -1422,6 +1423,13 @@ fn test_get_index_info(cl: &Client) {
14221423
}
14231424
}
14241425

1426+
fn test_get_zmq_notifications(cl: &Client) {
1427+
let zmq_info = cl.get_zmq_notifications().unwrap();
1428+
1429+
// no zmq subscribers are configured
1430+
assert!(zmq_info.is_empty());
1431+
}
1432+
14251433
fn test_stop(cl: Client) {
14261434
println!("Stopping: '{}'", cl.stop().unwrap());
14271435
}

0 commit comments

Comments
 (0)