Bugfix: do not try to decode method selector on contract creation txs fix #96

This commit is contained in:
Willian Mitsuda 2021-10-18 19:04:43 -03:00
parent 22da8082d8
commit 719ce4bd35
2 changed files with 7 additions and 5 deletions

View File

@ -76,7 +76,7 @@ const TransactionItem: React.FC<TransactionItemProps> = ({
<TransactionLink txHash={tx.hash} />
</span>
</div>
<MethodName data={tx.data} />
{tx.to !== null ? <MethodName data={tx.data} /> : <span></span>}
<span>
<BlockLink blockTag={tx.blockNumber} />
</span>

View File

@ -72,7 +72,7 @@ const Details: React.FC<DetailsProps> = ({
}
}, [txData]);
const fourBytes = rawInputTo4Bytes(txData.data);
const fourBytes = txData.to !== null ? rawInputTo4Bytes(txData.data) : "0x";
const fourBytesEntry = use4Bytes(fourBytes);
const fourBytesTxDesc = useMemo(() => {
if (!txData || !fourBytesEntry?.signature) {
@ -202,9 +202,11 @@ const Details: React.FC<DetailsProps> = ({
</div>
)}
</InfoRow>
{txData.to && (
<InfoRow title="Transaction Action">
<MethodName data={txData.data} />
</InfoRow>
)}
{txData.tokenTransfers.length > 0 && (
<InfoRow title={`Tokens Transferred (${txData.tokenTransfers.length})`}>
<div>