From fed8116eb64224bc7b140c6f60da9ea7bcb9bb21 Mon Sep 17 00:00:00 2001 From: Cehhiro Date: Tue, 15 Jan 2019 15:00:20 -0600 Subject: [PATCH] make the tx immutable --- packages/web3-eth-accounts/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web3-eth-accounts/src/index.js b/packages/web3-eth-accounts/src/index.js index f3da6f30f34..6f0cc8da553 100644 --- a/packages/web3-eth-accounts/src/index.js +++ b/packages/web3-eth-accounts/src/index.js @@ -129,9 +129,10 @@ Accounts.prototype.privateKeyToAccount = function privateKeyToAccount(privateKey return this._addAccountFunctions(Account.fromPrivate(privateKey)); }; -Accounts.prototype.signTransaction = function signTransaction(tx, privateKey, callback) { +Accounts.prototype.signTransaction = function signTransaction(inputTx, privateKey, callback) { var _this = this, error = false, + tx = JSON.parse(JSON.stringify(inputTx)), result; callback = callback || function () {};