Skip to content

Commit 0d93ad7

Browse files
committed
node: Use get_peer_info method
The client supports `getpeerinfo`, use it and remove the TODO.
1 parent d561e5c commit 0d93ad7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

node/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,8 @@ mod test {
918918
}
919919

920920
fn peers_connected(client: &Client) -> usize {
921-
// FIXME: Once client implements get_peer_info use it.
922-
// This is kinda cool, it shows we can call any RPC method using the client.
923-
let result: Vec<serde_json::Value> = client.call("getpeerinfo", &[]).unwrap();
924-
result.len()
921+
let json = client.get_peer_info().expect("get_peer_info");
922+
json.0.len()
925923
}
926924

927925
fn init() -> String {

0 commit comments

Comments
 (0)