Skip to content

Commit

Permalink
[ETCM-472] Fix missing status code (#10)
Browse files Browse the repository at this point in the history
* [ETCM-472] Fix erroneous name statusCode

* [ETCM-472] Simplify code

- Simplify display "true :  Execution success" -> " Execution success"
- Remove converting function. In web3 library, TransactionReceipt.status
  is a boolean. ("0x0" -> false and "0x1" -> true).
  • Loading branch information
jb-lunatech committed Apr 8, 2021
1 parent d72aa0d commit 59c3f62
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/components/blockchain/TransactionInfoTable.js
Expand Up @@ -3,14 +3,6 @@ import { Link } from 'react-router-dom';
import { Input } from 'antd';
import { bigNumber, decToHex } from '../../utils/format-utils';

const translateReceiptStatusCode = statusCode => {
switch(parseInt(statusCode, 16)) {
case 0: return "Execution failure";
case 1: return "Execution success";
default: return "???";
}
};

const TransactionInfoTable = ({tx, receipt}) => {
return (
<table className="pure-table pure-table-horizontal">
Expand Down Expand Up @@ -46,7 +38,7 @@ const TransactionInfoTable = ({tx, receipt}) => {
<tr>
<td>Status code</td>
<td>
<span> { receipt.statusCode ? `${receipt.statusCode} : ${translateReceiptStatusCode(receipt.statusCode)}` : '???' } </span>
<span> { receipt.status ? "Execution success" : "Execution failed" } </span>
</td>
</tr>
}
Expand Down

0 comments on commit 59c3f62

Please sign in to comment.