added eth_sign and eth_sendRawTransaction to eth interface

This commit is contained in:
debris 2016-03-13 14:57:26 +01:00
parent 00820c342a
commit 29c85e16cd
2 changed files with 41 additions and 0 deletions

View File

@ -230,3 +230,36 @@ fn rpc_eth_code() {
assert_eq!(EthTester::default().io.handle_request(request), Some(response.to_owned())); assert_eq!(EthTester::default().io.handle_request(request), Some(response.to_owned()));
} }
#[test]
#[ignore]
fn rpc_eth_call() {
unimplemented!()
}
#[test]
#[ignore]
fn rpc_eth_send_transaction() {
unimplemented!()
}
#[test]
#[ignore]
fn rpc_eth_send_raw_transaction() {
unimplemented!()
}
#[test]
#[ignore]
fn rpc_eth_sign() {
unimplemented!()
}
#[test]
#[ignore]
fn rpc_eth_estimate_gas() {
unimplemented!()
}

View File

@ -74,9 +74,15 @@ pub trait Eth: Sized + Send + Sync + 'static {
/// Returns the code at given address at given time (block number). /// Returns the code at given address at given time (block number).
fn code_at(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() } fn code_at(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Signs the data with given address signature.
fn sign(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Sends transaction. /// Sends transaction.
fn send_transaction(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() } fn send_transaction(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Sends signed transaction.
fn send_raw_transaction(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Call contract. /// Call contract.
fn call(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() } fn call(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
@ -141,7 +147,9 @@ pub trait Eth: Sized + Send + Sync + 'static {
delegate.add_method("eth_getUncleCountByBlockHash", Eth::block_uncles_count_by_hash); delegate.add_method("eth_getUncleCountByBlockHash", Eth::block_uncles_count_by_hash);
delegate.add_method("eth_getUncleCountByBlockNumber", Eth::block_uncles_count_by_number); delegate.add_method("eth_getUncleCountByBlockNumber", Eth::block_uncles_count_by_number);
delegate.add_method("eth_getCode", Eth::code_at); delegate.add_method("eth_getCode", Eth::code_at);
delegate.add_method("eth_sign", Eth::sign);
delegate.add_method("eth_sendTransaction", Eth::send_transaction); delegate.add_method("eth_sendTransaction", Eth::send_transaction);
delegate.add_method("eth_sendRawTransaction", Eth::send_raw_transaction);
delegate.add_method("eth_call", Eth::call); delegate.add_method("eth_call", Eth::call);
delegate.add_method("eth_estimateGas", Eth::estimate_gas); delegate.add_method("eth_estimateGas", Eth::estimate_gas);
delegate.add_method("eth_getBlockByHash", Eth::block_by_hash); delegate.add_method("eth_getBlockByHash", Eth::block_by_hash);