diff --git a/rpc/src/v1/helpers/errors.rs b/rpc/src/v1/helpers/errors.rs index 4afd40ff843..090e1677fb5 100644 --- a/rpc/src/v1/helpers/errors.rs +++ b/rpc/src/v1/helpers/errors.rs @@ -426,7 +426,7 @@ pub fn filter_not_found() -> Error { pub fn filter_block_not_found(id: BlockId) -> Error { Error { code: ErrorCode::ServerError(codes::UNSUPPORTED_REQUEST), // Specified in EIP-234. - message: "One of the blocks specified in filter (fromBlock, toBlock or blockHash) cannot be found".into(), + message: "One of the blocks specified in filter (fromBlock, toBlock or blockHash) cannot be found, or fromBlock and toBlock are out of order".into(), data: Some(Value::String(match id { BlockId::Hash(hash) => format!("0x{:x}", hash), BlockId::Number(number) => format!("0x{:x}", number), diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 33f820f1cf2..d8a36150906 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -238,7 +238,7 @@ fn rpc_eth_logs_error() { let tester = EthTester::default(); tester.client.set_error_on_logs(Some(BlockId::Hash(H256::from([5u8].as_ref())))); let request = r#"{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"limit":1,"blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","error":{"code":-32000,"message":"One of the blocks specified in filter (fromBlock, toBlock or blockHash) cannot be found","data":"0x0500000000000000000000000000000000000000000000000000000000000000"},"id":1}"#; + let response = r#"{"jsonrpc":"2.0","error":{"code":-32000,"message":"One of the blocks specified in filter (fromBlock, toBlock or blockHash) cannot be found, or fromBlock and toBlock are out of order","data":"0x0500000000000000000000000000000000000000000000000000000000000000"},"id":1}"#; assert_eq!(tester.io.handle_request_sync(request), Some(response.to_owned())); }