diff options
author | Fabio Berger <me@fabioberger.com> | 2017-05-27 00:35:35 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-05-27 00:35:35 +0800 |
commit | a34d083cad3a07965bcb1687dd6534a30d79b7d0 (patch) | |
tree | 0293879e434f63436b4ed5aa2b0fe92453867e2f /src | |
parent | 7e96b45ea0c51ca5589640018172a91a35596148 (diff) | |
download | dexon-sol-tools-a34d083cad3a07965bcb1687dd6534a30d79b7d0.tar.gz dexon-sol-tools-a34d083cad3a07965bcb1687dd6534a30d79b7d0.tar.zst dexon-sol-tools-a34d083cad3a07965bcb1687dd6534a30d79b7d0.zip |
Refactor to ternary
Diffstat (limited to 'src')
-rw-r--r-- | src/ts/contract_wrappers/contract_wrapper.ts | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ts/contract_wrappers/contract_wrapper.ts b/src/ts/contract_wrappers/contract_wrapper.ts index 225cb960f..9f4cd8039 100644 --- a/src/ts/contract_wrappers/contract_wrapper.ts +++ b/src/ts/contract_wrappers/contract_wrapper.ts @@ -33,12 +33,7 @@ export class ContractWrapper { } try { - let contractInstance; - if (_.isUndefined(address)) { - contractInstance = await c.deployed(); - } else { - contractInstance = await c.at(address); - } + const contractInstance = _.isUndefined(address) ? await c.deployed() : await c.at(address); return contractInstance; } catch (err) { const errMsg = `${err}`; |