mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 06:21:11 +00:00
WIP: Node role RPC call (#3719)
* Add a Node Role RPC call * Formatting * Fix tests * Change tests to use NodeRole::Authority so I don't forget to update the test * Improve role checking * return a vec instead * fix tests
This commit is contained in:
@@ -79,6 +79,9 @@ fn api<T: Into<Option<Status>>>(sync: T) -> System<Block> {
|
||||
average_upload_per_sec: 0,
|
||||
peerset: serde_json::Value::Null,
|
||||
}).unwrap());
|
||||
},
|
||||
Request::NodeRoles(sender) => {
|
||||
let _ = sender.send(vec![NodeRole::Authority]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -221,3 +224,11 @@ fn system_network_state() {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn system_node_roles() {
|
||||
assert_eq!(
|
||||
wait_receiver(api(None).system_node_roles()),
|
||||
vec![NodeRole::Authority]
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user