move signAndSendTransaction to Personal trait.

This commit is contained in:
Robert Habermeier 2016-05-26 20:07:47 +02:00
parent 72031d6f95
commit db2efe8485
2 changed files with 4 additions and 4 deletions

View File

@ -80,9 +80,6 @@ pub trait Eth: Sized + Send + Sync + 'static {
/// Sends transaction.
fn send_transaction(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Sends transaction and signs it in single call. The account is not unlocked in such case.
fn sign_and_send_transaction(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Sends signed transaction.
fn send_raw_transaction(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
@ -155,7 +152,6 @@ pub trait Eth: Sized + Send + Sync + 'static {
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_signAndSendTransaction", Eth::sign_and_send_transaction);
delegate.add_method("eth_sendRawTransaction", Eth::send_raw_transaction);
delegate.add_method("eth_call", Eth::call);
delegate.add_method("eth_estimateGas", Eth::estimate_gas);

View File

@ -30,12 +30,16 @@ pub trait Personal: Sized + Send + Sync + 'static {
/// Unlocks specified account for use (can only be one unlocked account at one moment)
fn unlock_account(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Sends transaction and signs it in single call. The account is not unlocked in such case.
fn sign_and_send_transaction(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
/// Should be used to convert object to io delegate.
fn to_delegate(self) -> IoDelegate<Self> {
let mut delegate = IoDelegate::new(Arc::new(self));
delegate.add_method("personal_listAccounts", Personal::accounts);
delegate.add_method("personal_newAccount", Personal::new_account);
delegate.add_method("personal_unlockAccount", Personal::unlock_account);
delegate.add_method("personal_signAndSendTransaction", Personal::sign_and_send_transaction);
delegate
}
}