mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-10 02:57:58 +00:00
Add an system_syncState RPC method (#7315)
* Add system_syncState RPC method * Update client/rpc-api/src/system/helpers.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -104,6 +104,13 @@ fn api<T: Into<Option<Status>>>(sync: T) -> System<Block> {
|
||||
Request::NodeRoles(sender) => {
|
||||
let _ = sender.send(vec![NodeRole::Authority]);
|
||||
}
|
||||
Request::SyncState(sender) => {
|
||||
let _ = sender.send(SyncState {
|
||||
starting_block: 1,
|
||||
current_block: 2,
|
||||
highest_block: Some(3),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
future::ready(())
|
||||
@@ -291,6 +298,18 @@ fn system_node_roles() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn system_sync_state() {
|
||||
assert_eq!(
|
||||
wait_receiver(api(None).system_sync_state()),
|
||||
SyncState {
|
||||
starting_block: 1,
|
||||
current_block: 2,
|
||||
highest_block: Some(3),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn system_network_add_reserved() {
|
||||
let good_peer_id = "/ip4/198.51.100.19/tcp/30333/p2p/QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV";
|
||||
|
||||
Reference in New Issue
Block a user