From 3fb445e19877b51a523450162d511f7ab291d29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Mon, 30 Jan 2017 12:49:08 +0100 Subject: [PATCH] Renaming signAndSendTransaction to sendTransaction (#4351) --- js/src/api/rpc/personal/personal.js | 4 ++-- js/src/jsonrpc/interfaces/personal.js | 2 +- js/src/util/web3.extensions.js | 4 ++-- js/src/views/Status/data/rpc.json | 2 +- rpc/src/v1/impls/personal.rs | 2 +- rpc/src/v1/tests/mocked/personal.rs | 4 ++-- rpc/src/v1/traits/personal.rs | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/js/src/api/rpc/personal/personal.js b/js/src/api/rpc/personal/personal.js index 2c876b837..dd9c40f62 100644 --- a/js/src/api/rpc/personal/personal.js +++ b/js/src/api/rpc/personal/personal.js @@ -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) { diff --git a/js/src/jsonrpc/interfaces/personal.js b/js/src/jsonrpc/interfaces/personal.js index 5daa019a4..5cd564472 100644 --- a/js/src/jsonrpc/interfaces/personal.js +++ b/js/src/jsonrpc/interfaces/personal.js @@ -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: [ { diff --git a/js/src/util/web3.extensions.js b/js/src/util/web3.extensions.js index 107d2fb91..0755e365b 100644 --- a/js/src/util/web3.extensions.js +++ b/js/src/util/web3.extensions.js @@ -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] }), diff --git a/js/src/views/Status/data/rpc.json b/js/src/views/Status/data/rpc.json index ebb2800e8..ec85b7c5b 100644 --- a/js/src/views/Status/data/rpc.json +++ b/js/src/views/Status/data/rpc.json @@ -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": [ { diff --git a/rpc/src/v1/impls/personal.rs b/rpc/src/v1/impls/personal.rs index 59f665950..082ec8de0 100644 --- a/rpc/src/v1/impls/personal.rs +++ b/rpc/src/v1/impls/personal.rs @@ -102,7 +102,7 @@ impl Personal for PersonalClient where C: MiningBl } } - fn sign_and_send_transaction(&self, request: TransactionRequest, password: String) -> Result { + fn send_transaction(&self, request: TransactionRequest, password: String) -> Result { self.active()?; let client = take_weak!(self.client); let miner = take_weak!(self.miner); diff --git a/rpc/src/v1/tests/mocked/personal.rs b/rpc/src/v1/tests/mocked/personal.rs index a4cd262d9..ab8fc1331 100644 --- a/rpc/src/v1/tests/mocked/personal.rs +++ b/rpc/src/v1/tests/mocked/personal.rs @@ -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", diff --git a/rpc/src/v1/traits/personal.rs b/rpc/src/v1/traits/personal.rs index 6d6d75d01..afca38f06 100644 --- a/rpc/src/v1/traits/personal.rs +++ b/rpc/src/v1/traits/personal.rs @@ -36,7 +36,7 @@ build_rpc_trait! { fn unlock_account(&self, H160, String, Option) -> Result; /// 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; + #[rpc(name = "personal_sendTransaction")] + fn send_transaction(&self, TransactionRequest, String) -> Result; } }