From 44c6e3bce22804805cb7f1f3ab7fa5dc3ee18c18 Mon Sep 17 00:00:00 2001 From: "davidzagi93@gmail.com" Date: Wed, 18 Aug 2021 15:17:48 +0100 Subject: [PATCH] creating a KnownTransaction function --- .../terminal/src/lib/remix-ui-terminal.tsx | 53 +++++++++++++++---- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index 7d7e37bbb2..29289cdb6d 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -1228,16 +1228,14 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { )} - {console.log(opts['decoded input'], 'opts["decoded input"]')} - {console.log(opts.log, 'opts log')} - {/* {opts['decoded input'] && ( + {opts['decoded input'] && ( decode input {opts['decoded input']} - )} */} + )} {opts['decoded output'] && ( decode output @@ -1246,7 +1244,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { )} - {/* {opts.logs && ( + {opts.logs && ( logs @@ -1255,7 +1253,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { - )} */} + )} {opts.val && ( val @@ -1283,9 +1281,9 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { } } - const renderUnKnownTransactions = (tx, receipt, resolvedData, logs, index) => { + const renderUnKnownTransactions = (tx, receipt, index) => { const from = tx.from - const to = tx.to ? tx.to : resolvedData.contractName + '.' + resolvedData.fn + const to = tx.to const obj = { from, to } const showDetails = showTableDetails === tx.from const txType = 'unknown' + (tx.isCall ? 'Call' : 'Tx') @@ -1297,7 +1295,44 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { {context({ from, to, tx }, props.blockchain)} { console.log('under context and checkTxStatus')}
-
debug(event, tx)}>Debug
+
debug(event, tx)}>Debug
+
+ + + {showTableHash.includes(tx.hash) ? showTable({ + hash: tx.hash, + status: receipt !== null ? receipt.status : null, + isCall: tx.isCall, + contractAddress: tx.contractAddress, + data: tx, + from, + to, + gas: tx.gas, + input: tx.input, + 'decoded output': ' - ', + val: tx.value, + transactionCost: tx.transactionCost, + executionCost: tx.executionCost + }) : null} + { console.log('end')} + + ) + } + + const renderKnownTransactions = (tx, receipt, resolvedData, logs, index) => { + const from = tx.from + const to = resolvedData.contractName + '.' + resolvedData.fn + const obj = { from, to } + const txType = 'knownTx' + console.log('render unknown transaction ') + return ( + +
txDetails(event, tx, obj)}> + {/* onClick={e => txDetails(e, tx, data, obj)} */} + {checkTxStatus(receipt, txType)} + {context({ from, to, tx }, props.blockchain)} +
+
debug(event, tx)}>Debug