From f31a68b061e580e42426589cf73401e2f5fcd34d Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 12 Jun 2019 16:34:55 +0300 Subject: [PATCH] RSK tx status fix --- old-ui/app/components/transaction-list-item.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/old-ui/app/components/transaction-list-item.js b/old-ui/app/components/transaction-list-item.js index a85eec02b..5158a5bec 100644 --- a/old-ui/app/components/transaction-list-item.js +++ b/old-ui/app/components/transaction-list-item.js @@ -25,6 +25,7 @@ const { POA_CODE, GOERLI_TESTNET_CODE, CLASSIC_CODE, RSK_CODE, + RSK_TESTNET_CODE, } = require('../../../app/scripts/controllers/network/enums') const mapDispatchToProps = dispatch => { @@ -164,7 +165,7 @@ TransactionListItem.prototype.render = function () { }, [ domainField(txParams), h('div.flex-row', [ - recipientField(txParams, transaction, isTx, isMsg), + recipientField(txParams, transaction, isTx, isMsg, numericNet), ]), h('div', { style: { @@ -239,7 +240,7 @@ function domainField (txParams) { ]) } -function recipientField (txParams, transaction, isTx, isMsg) { +function recipientField (txParams, transaction, isTx, isMsg, numericNet) { let message if (isMsg) { @@ -259,7 +260,7 @@ function recipientField (txParams, transaction, isTx, isMsg) { h('span', (!txParams.to ? {style: {whiteSpace: 'nowrap'}} : null), message), // Places a copy button if tx is successful, else places a placeholder empty div. transaction.hash ? h(CopyButton, { value: transaction.hash, display: 'inline' }) : h('div', {style: { display: 'flex', alignItems: 'center', width: '26px' }}), - renderErrorOrWarning(transaction), + renderErrorOrWarning(transaction, numericNet), ]) } @@ -267,7 +268,7 @@ function formatDate (date) { return vreme.format(new Date(date), 'March 16 2014 14:30') } -function renderErrorOrWarning (transaction) { +function renderErrorOrWarning (transaction, numericNet) { const { status, err, warning } = transaction // show dropped @@ -294,7 +295,8 @@ function renderErrorOrWarning (transaction) { } // show warning - if (warning) { + const isRSK = numericNet === RSK_CODE || numericNet === RSK_TESTNET_CODE + if (warning && !isRSK || (isRSK && !warning.error.includes('[ethjs-rpc] rpc error with payload'))) { const message = warning.message return h(Tooltip, { title: message,