Deprecate eth_compile* RPCs (#4577)

* Deprecate eth_compile* RPCs

* Add deprecation doc comments
This commit is contained in:
Robert Habermeier
2017-02-17 12:00:33 +01:00
committed by Gav Wood
parent aca808b021
commit 54c48d14ec
4 changed files with 23 additions and 55 deletions

View File

@@ -46,10 +46,10 @@ mod codes {
pub const REQUEST_REJECTED: i64 = -32040;
pub const REQUEST_REJECTED_LIMIT: i64 = -32041;
pub const REQUEST_NOT_FOUND: i64 = -32042;
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 const DEPRECATED: i64 = -32070;
}
pub fn unimplemented(details: Option<String>) -> Error {
@@ -92,14 +92,6 @@ pub fn account<T: fmt::Debug>(error: &str, details: T) -> Error {
}
}
pub fn compilation<T: fmt::Debug>(error: T) -> Error {
Error {
code: ErrorCode::ServerError(codes::COMPILATION_ERROR),
message: "Error while compiling code.".into(),
data: Some(Value::String(format!("{:?}", error))),
}
}
pub fn internal<T: fmt::Debug>(error: &str, data: T) -> Error {
Error {
code: ErrorCode::InternalError,
@@ -317,3 +309,11 @@ pub fn no_light_peers() -> Error {
data: None,
}
}
pub fn deprecated<T: Into<Option<String>>>(message: T) -> Error {
Error {
code: ErrorCode::ServerError(codes::DEPRECATED),
message: "Method deprecated".into(),
data: message.into().map(Value::String),
}
}