implement light dispatcher

This commit is contained in:
Robert Habermeier
2017-02-09 21:12:28 +01:00
parent 53774d4792
commit e53d023a8a
6 changed files with 100 additions and 11 deletions

View File

@@ -49,6 +49,7 @@ mod codes {
pub const COMPILATION_ERROR: i64 = -32050;
pub const ENCRYPTION_ERROR: i64 = -32055;
pub const FETCH_ERROR: i64 = -32060;
pub const NO_LIGHT_PEERS: i64 = -32065;
}
pub fn unimplemented(details: Option<String>) -> Error {
@@ -308,3 +309,11 @@ pub fn unknown_block() -> Error {
data: None,
}
}
pub fn no_light_peers() -> Error {
Error {
code: ErrorCode::ServerError(codes::NO_LIGHT_PEERS),
message: "No light peers who can serve data".into(),
data: None,
}
}