From a18a24ad1051c3264979ec462cd9c8d6c3171346 Mon Sep 17 00:00:00 2001 From: lianahus Date: Fri, 3 Sep 2021 12:38:43 +0200 Subject: [PATCH 1/2] do not show undefined property in details --- libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index 7b85038aa6..efac0765ec 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -115,7 +115,7 @@ export const ContractSelection = (props: ContractSelectionProps) => { let node if (propertyName === 'web3Deploy' || propertyName === 'name' || propertyName === 'Assembly') { node =
{ details[propertyName] }
- } else if (propertyName === 'abi' || propertyName === 'metadata') { + } else if (details[propertyName] && (propertyName === 'abi' || propertyName === 'metadata')) { if (details[propertyName] !== '') { try { node =
From 3e8e083644fb133158635c2a6c4f60d21b78f9cd Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 10 Sep 2021 19:33:29 +0200 Subject: [PATCH 2/2] fix gasUsed in the receipt (#1542) Make sure the receipt `gasUsed` is the actual amount of gas used, not the `gasLimit`. --- libs/remix-lib/src/web3Provider/web3VmProvider.ts | 5 +++-- libs/remix-simulator/src/methods/transactions.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/remix-lib/src/web3Provider/web3VmProvider.ts b/libs/remix-lib/src/web3Provider/web3VmProvider.ts index ff2c5ac9e8..f29e225e5a 100644 --- a/libs/remix-lib/src/web3Provider/web3VmProvider.ts +++ b/libs/remix-lib/src/web3Provider/web3VmProvider.ts @@ -144,8 +144,9 @@ export class Web3VmProvider { if (lastOp) { lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' && lastOp.op !== 'DESTRUCT' } - this.vmTraces[this.processingHash].gas = '0x' + data.gasUsed.toString(16) - + const gasUsed = '0x' + data.gasUsed.toString(16) + this.vmTraces[this.processingHash].gas = gasUsed + this.txsReceipt[this.processingHash].gasUsed = gasUsed const logs = [] for (const l in data.execResult.logs) { const log = data.execResult.logs[l] diff --git a/libs/remix-simulator/src/methods/transactions.ts b/libs/remix-simulator/src/methods/transactions.ts index 90e3df270f..44786c6f62 100644 --- a/libs/remix-simulator/src/methods/transactions.ts +++ b/libs/remix-simulator/src/methods/transactions.ts @@ -102,8 +102,8 @@ export class Transactions { transactionIndex: '0x00', blockHash: '0x' + txBlock.hash().toString('hex'), blockNumber: '0x' + txBlock.header.number.toString('hex'), - gasUsed: Web3.utils.toHex(receipt.gas), - cumulativeGasUsed: Web3.utils.toHex(receipt.gas), + gasUsed: receipt.gasUsed, + cumulativeGasUsed: receipt.gasUsed, // only 1 tx per block contractAddress: receipt.contractAddress, logs: receipt.logs, status: receipt.status,