implemented eth_getCompilers

This commit is contained in:
debris 2016-03-13 15:02:46 +01:00
parent 29c85e16cd
commit 6ee13b0000
2 changed files with 14 additions and 0 deletions

View File

@ -250,6 +250,13 @@ impl<C, S, A> Eth for EthClient<C, S, A> where C: BlockChainClient + 'static, S:
.and_then(|(number, index)| self.transaction(TransactionId::Location(number.into(), index.value())))
}
fn compilers(&self, params: Params) -> Result<Value, Error> {
match params {
Params::None => to_value(&vec![] as &Vec<String>),
_ => Err(Error::invalid_params())
}
}
fn logs(&self, params: Params) -> Result<Value, Error> {
from_params::<(Filter,)>(params)
.and_then(|(filter,)| {

View File

@ -260,6 +260,13 @@ fn rpc_eth_estimate_gas() {
unimplemented!()
}
#[test]
fn rpc_eth_compilers() {
let request = r#"{"jsonrpc": "2.0", "method": "eth_getCompilers", "params": [], "id": 1}"#;
let response = r#"{"jsonrpc":"2.0","result":[],"id":1}"#;
assert_eq!(EthTester::default().io.handle_request(request), Some(response.to_owned()));
}