diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-01-05 05:04:33 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2017-01-05 05:04:33 +0800 |
commit | e6da8e2762cd54975c334314357f1cd27cc980c8 (patch) | |
tree | 995589dbb09b07b0b19e9d956aff49e0c9854bd4 /app/scripts/keyring-controller.js | |
parent | fb002dc44eae82e0471b8b52acecc61ba5f39332 (diff) | |
download | tangerine-wallet-browser-e6da8e2762cd54975c334314357f1cd27cc980c8.tar tangerine-wallet-browser-e6da8e2762cd54975c334314357f1cd27cc980c8.tar.gz tangerine-wallet-browser-e6da8e2762cd54975c334314357f1cd27cc980c8.tar.bz2 tangerine-wallet-browser-e6da8e2762cd54975c334314357f1cd27cc980c8.tar.lz tangerine-wallet-browser-e6da8e2762cd54975c334314357f1cd27cc980c8.tar.xz tangerine-wallet-browser-e6da8e2762cd54975c334314357f1cd27cc980c8.tar.zst tangerine-wallet-browser-e6da8e2762cd54975c334314357f1cd27cc980c8.zip |
Fix signing of transactions
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r-- | app/scripts/keyring-controller.js | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 016740d88..acec8feb1 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -310,20 +310,22 @@ module.exports = class KeyringController extends EventEmitter { // // This method signs tx and returns a promise for // TX Manager to update the state after signing - signTransaction (ethTx, selectedAddress, txId, cb) { - try { - const address = normalize(selectedAddress) - return this.getKeyringForAccount(address) - .then((keyring) => { - return keyring.signTransaction(address, ethTx) - }).then((tx) => { - this.emit(`${txId}:signed`, {tx, txId, cb}) - }) - } catch (e) { - cb(e) - } - } + signTransaction (ethTx, selectedAddress, txId) { + return new Promise((resolve, reject) => { + try { + const address = normalize(selectedAddress) + return this.getKeyringForAccount(address) + .then((keyring) => { + return keyring.signTransaction(address, ethTx) + }).then((tx) => { + resolve({tx, txId}) + }) + } catch (e) { + reject(e) + } + }) + } // Add Unconfirmed Message // @object msgParams // @function cb |