aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/keyring-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r--app/scripts/keyring-controller.js28
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