move signAndSendTransaction to Personal trait.
This commit is contained in:
parent
72031d6f95
commit
db2efe8485
@ -80,9 +80,6 @@ pub trait Eth: Sized + Send + Sync + 'static {
|
|||||||
/// 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 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.
|
/// Sends signed transaction.
|
||||||
fn send_raw_transaction(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
|
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_getCode", Eth::code_at);
|
||||||
delegate.add_method("eth_sign", Eth::sign);
|
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_signAndSendTransaction", Eth::sign_and_send_transaction);
|
|
||||||
delegate.add_method("eth_sendRawTransaction", Eth::send_raw_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);
|
||||||
|
@ -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)
|
/// Unlocks specified account for use (can only be one unlocked account at one moment)
|
||||||
fn unlock_account(&self, _: Params) -> Result<Value, Error> { rpc_unimplemented!() }
|
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.
|
/// Should be used to convert object to io delegate.
|
||||||
fn to_delegate(self) -> IoDelegate<Self> {
|
fn to_delegate(self) -> IoDelegate<Self> {
|
||||||
let mut delegate = IoDelegate::new(Arc::new(self));
|
let mut delegate = IoDelegate::new(Arc::new(self));
|
||||||
delegate.add_method("personal_listAccounts", Personal::accounts);
|
delegate.add_method("personal_listAccounts", Personal::accounts);
|
||||||
delegate.add_method("personal_newAccount", Personal::new_account);
|
delegate.add_method("personal_newAccount", Personal::new_account);
|
||||||
delegate.add_method("personal_unlockAccount", Personal::unlock_account);
|
delegate.add_method("personal_unlockAccount", Personal::unlock_account);
|
||||||
|
delegate.add_method("personal_signAndSendTransaction", Personal::sign_and_send_transaction);
|
||||||
delegate
|
delegate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user