Add error for sendRawTransaction and estimateGas (#3194)
* sendRawTransaction invalid RLP error * Returning proper error for estimate_gas
This commit is contained in:
committed by
Arkadiy Paronyan
parent
2563189316
commit
501b2cdd18
@@ -21,6 +21,7 @@ macro_rules! rpc_unimplemented {
|
||||
}
|
||||
|
||||
use std::fmt;
|
||||
use rlp::DecoderError;
|
||||
use ethcore::error::{Error as EthcoreError, CallError};
|
||||
use ethcore::account_provider::{Error as AccountError};
|
||||
use fetch::FetchError;
|
||||
@@ -271,6 +272,14 @@ pub fn from_transaction_error(error: EthcoreError) -> Error {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_rlp_error(error: DecoderError) -> Error {
|
||||
Error {
|
||||
code: ErrorCode::InvalidParams,
|
||||
message: "Invalid RLP.".into(),
|
||||
data: Some(Value::String(format!("{:?}", error))),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_call_error(error: CallError) -> Error {
|
||||
match error {
|
||||
CallError::StatePruned => state_pruned(),
|
||||
|
||||
Reference in New Issue
Block a user