Renaming signAndSendTransaction to sendTransaction (#4351)

This commit is contained in:
Tomasz Drwięga 2017-01-30 12:49:08 +01:00 committed by Gav Wood
parent f627bef08b
commit 3fb445e198
7 changed files with 11 additions and 11 deletions

View File

@ -34,9 +34,9 @@ export default class Personal {
.then(outAddress);
}
signAndSendTransaction (options, password) {
sendTransaction (options, password) {
return this._transport
.execute('personal_signAndSendTransaction', inOptions(options), password);
.execute('personal_sendTransaction', inOptions(options), password);
}
unlockAccount (account, password, duration = 1) {

View File

@ -46,7 +46,7 @@ export default {
}
},
signAndSendTransaction: {
sendTransaction: {
desc: 'Sends transaction and signs it in a single call. The account does not need to be unlocked to make this call, and will not be left unlocked after.',
params: [
{

View File

@ -21,8 +21,8 @@ export default function web3extensions (web3) {
property: 'personal',
methods: [
new Method({
name: 'signAndSendTransaction',
call: 'personal_signAndSendTransaction',
name: 'sendTransaction',
call: 'personal_sendTransaction',
params: 2,
inputFormatter: [formatters.inputTransactionFormatter, null]
}),

View File

@ -829,7 +829,7 @@
"outputFormatter": null
},
{
"name": "personal_signAndSendTransaction",
"name": "personal_sendTransaction",
"desc": "Sends and signs a transaction given account passphrase. Does not require the account to be unlocked nor unlocks the account for future transactions. ",
"params": [
{

View File

@ -102,7 +102,7 @@ impl<C: 'static, M: 'static> Personal for PersonalClient<C, M> where C: MiningBl
}
}
fn sign_and_send_transaction(&self, request: TransactionRequest, password: String) -> Result<RpcH256, Error> {
fn send_transaction(&self, request: TransactionRequest, password: String) -> Result<RpcH256, Error> {
self.active()?;
let client = take_weak!(self.client);
let miner = take_weak!(self.miner);

View File

@ -96,7 +96,7 @@ fn sign_and_send_transaction_with_invalid_password() {
let address = tester.accounts.new_account("password123").unwrap();
let request = r#"{
"jsonrpc": "2.0",
"method": "personal_signAndSendTransaction",
"method": "personal_sendTransaction",
"params": [{
"from": ""#.to_owned() + format!("0x{:?}", address).as_ref() + r#"",
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
@ -119,7 +119,7 @@ fn sign_and_send_transaction() {
let request = r#"{
"jsonrpc": "2.0",
"method": "personal_signAndSendTransaction",
"method": "personal_sendTransaction",
"params": [{
"from": ""#.to_owned() + format!("0x{:?}", address).as_ref() + r#"",
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",

View File

@ -36,7 +36,7 @@ build_rpc_trait! {
fn unlock_account(&self, H160, String, Option<U128>) -> Result<bool, Error>;
/// Sends transaction and signs it in single call. The account is not unlocked in such case.
#[rpc(name = "personal_signAndSendTransaction")]
fn sign_and_send_transaction(&self, TransactionRequest, String) -> Result<H256, Error>;
#[rpc(name = "personal_sendTransaction")]
fn send_transaction(&self, TransactionRequest, String) -> Result<H256, Error>;
}
}