From 34c65f60ef051e07dc563c54b7791d6a430758b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 11 Oct 2017 21:05:38 +0200 Subject: [PATCH] Fix estimate gas if from is not provided. (#6714) --- js/src/util/tx.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/js/src/util/tx.js b/js/src/util/tx.js index e325e6024..d5dae650d 100644 --- a/js/src/util/tx.js +++ b/js/src/util/tx.js @@ -81,12 +81,11 @@ export function getTxOptions (api, func, _options, values = []) { options.to = options.to || func.contract.address; } - if (!address) { - return Promise.resolve({ func, options, values }); - } + const promise = (!address) + ? Promise.resolve(false) + : WalletsUtils.isWallet(api, address); - return WalletsUtils - .isWallet(api, address) + return promise .then((isWallet) => { if (!isWallet) { return { func, options, values };