mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
RPCs for reserved peers (#4423)
* RPC forwarders for adding reserved peers * implement service side of reserved-peer RPCs * Clean up unnecessary format! invocation Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com> * add some tests for the new RPC methods * remove redundant `data` field Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
637d95e5ea
commit
da87c3c1e3
@@ -28,6 +28,8 @@ pub enum Error {
|
||||
/// Provided block range couldn't be resolved to a list of blocks.
|
||||
#[display(fmt = "Node is not fully functional: {}", _0)]
|
||||
NotHealthy(Health),
|
||||
/// Peer argument is malformatted.
|
||||
MalformattedPeerArg(String),
|
||||
}
|
||||
|
||||
impl std::error::Error for Error {}
|
||||
@@ -43,6 +45,11 @@ impl From<Error> for rpc::Error {
|
||||
message: format!("{}", e),
|
||||
data: serde_json::to_value(h).ok(),
|
||||
},
|
||||
Error::MalformattedPeerArg(ref e) => rpc::Error {
|
||||
code :rpc::ErrorCode::ServerError(BASE_ERROR + 2),
|
||||
message: e.clone(),
|
||||
data: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user