Skip to content

Commit

Permalink
add integration test and doc comment for get_zmq_notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
antonilol committed Apr 19, 2023
1 parent d8c90ad commit 213489e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,7 @@ pub trait RpcApi: Sized {
self.call("scantxoutset", &["start".into(), into_json(descriptors)?])
}

/// Returns information about the active ZeroMQ notifications
fn get_zmq_notifications(&self) -> Result<Vec<json::GetZmqNotificationsResult>> {
self.call("getzmqnotifications", &[])
}
Expand Down
8 changes: 8 additions & 0 deletions integration_test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ fn main() {
test_add_ban(&cl);
test_set_network_active(&cl);
test_get_index_info(&cl);
test_get_zmq_notifications(&cl);
test_stop(cl);
}

Expand Down Expand Up @@ -1291,6 +1292,13 @@ fn test_get_index_info(cl: &Client) {
}
}

fn test_get_zmq_notifications(cl: &Client) {
let zmq_info = cl.get_zmq_notifications().unwrap();

// no zmq subscribers are configured
assert!(zmq_info.is_empty());
}

fn test_stop(cl: Client) {
println!("Stopping: '{}'", cl.stop().unwrap());
}

0 comments on commit 213489e

Please sign in to comment.