Skip to content

Commit

Permalink
Merge #1359
Browse files Browse the repository at this point in the history
1359: Some blocks are not displayed in Explorer r=popzxc a=perekopskiy

- For ChangePubKey transactions with zero fee, the fee is displayed as '0.0 ETH'
- ~~Currently, for transactions with zero fee, we can't define if it is a part of a batch or it is an old ChangePubKey op. That's why the label "This transaction is a part of a batch. The fee was paid in another transaction." was removed.~~

Co-authored-by: perekopskiy <[email protected]>
Co-authored-by: perekopskiy <[email protected]>
  • Loading branch information
3 people authored Jan 29, 2021
2 parents 24c7a2d + 11e0abd commit a8d5df6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog/infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ components, the logs will have the following format:

### Fixed

- (`explorer`): Bug with not displaying old blocks was fixed.
- (`explorer`): bug with updating transaction data after searching another transaction was fixed.

## Release 2021-01-12
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/explorer/src/blockTxEnries.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function getTxFeeEntry(tx, token) {
const entry = makeEntry('Fee');
const fee = getTxFee(tx);

if (!fee) {
if (!fee && tx.op.type != 'ChangePubKey') {
return entry;
}

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/explorer/src/blockUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function getTxToken(tx) {
}

if (tx.op.type === 'ChangePubKey') {
return tx.op.feeToken;
return tx.op.feeToken || 0;
}

return tx.op.token;
Expand Down
4 changes: 3 additions & 1 deletion infrastructure/explorer/src/transactionEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ function statusEntry(txData) {

function feeEntry(txData) {
const fee = txData.fee || 0;
if (!txData.feeTokenName) {
return makeEntry('Fee').innerHTML(`${'ETH'} ${formatToken(fee, 'ETH')}`);
}

try {
const feeBN = BigNumber.from(fee);
Expand All @@ -73,7 +76,6 @@ function feeEntry(txData) {
} catch {
return makeEntry('Fee');
}

return makeEntry('Fee').innerHTML(`${txData.feeTokenName} ${formatToken(fee, txData.feeTokenName)}`);
}

Expand Down

0 comments on commit a8d5df6

Please sign in to comment.