diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-10-21 11:48:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-21 11:48:10 +0800 |
commit | 3b46478024f87bd237b507e5fb18068febf02de9 (patch) | |
tree | 1b70c2e7f431e7e3eb638c7630a2d220fa3dd030 /ui/app/helpers/transactions.util.js | |
parent | 600f755dbf8d4cfdc152e3d521b537ee9a046a35 (diff) | |
parent | ba3617b685b9dcd8a62e0009ee2015c5997fead3 (diff) | |
download | tangerine-wallet-browser-3b46478024f87bd237b507e5fb18068febf02de9.tar tangerine-wallet-browser-3b46478024f87bd237b507e5fb18068febf02de9.tar.gz tangerine-wallet-browser-3b46478024f87bd237b507e5fb18068febf02de9.tar.bz2 tangerine-wallet-browser-3b46478024f87bd237b507e5fb18068febf02de9.tar.lz tangerine-wallet-browser-3b46478024f87bd237b507e5fb18068febf02de9.tar.xz tangerine-wallet-browser-3b46478024f87bd237b507e5fb18068febf02de9.tar.zst tangerine-wallet-browser-3b46478024f87bd237b507e5fb18068febf02de9.zip |
Merge branch 'develop' into develop
Diffstat (limited to 'ui/app/helpers/transactions.util.js')
-rw-r--r-- | ui/app/helpers/transactions.util.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/app/helpers/transactions.util.js b/ui/app/helpers/transactions.util.js index b2c617384..9be77e14f 100644 --- a/ui/app/helpers/transactions.util.js +++ b/ui/app/helpers/transactions.util.js @@ -126,3 +126,21 @@ export function sumHexes (...args) { return ethUtil.addHexPrefix(total) } + +/** + * Returns a status key for a transaction. Requires parsing the txMeta.txReceipt on top of + * txMeta.status because txMeta.status does not reflect on-chain errors. + * @param {Object} transaction - The txMeta object of a transaction. + * @param {Object} transaction.txReceipt - The transaction receipt. + * @returns {string} + */ +export function getStatusKey (transaction) { + const { txReceipt: { status } = {} } = transaction + + // There was an on-chain failure + if (status === '0x0') { + return 'failed' + } + + return transaction.status +} |