diff --git a/premix/assets/js/index.js b/premix/assets/js/index.js index fdb403862..f6070e41f 100644 --- a/premix/assets/js/index.js +++ b/premix/assets/js/index.js @@ -209,7 +209,7 @@ function transactionsRenderer(txId, nimbus, geth) { } } - txId = parseInt(txId); + let tx = geth.block.transactions[txId]; let ntx = nimbus.txTraces[txId]; let gtx = geth.txTraces[txId]; @@ -231,6 +231,7 @@ function transactionsRenderer(txId, nimbus, geth) { geth.receipts[txId] ); + $(`
+ In Transactions section, you'll see the transaction kind. + It has three kind: Regular, ContractCreation, and ContractCall. + Each kind will help you locate the bug in Nimbus implementation, they have their own proc. +
diff --git a/premix/premixcore.nim b/premix/premixcore.nim index acb3fce07..d28899dde 100644 --- a/premix/premixcore.nim +++ b/premix/premixcore.nim @@ -130,21 +130,32 @@ proc updateAccount*(address: string, account: JsonNode, blockNumber: Uint256) = account["storage"][x["key"].getStr] = x["value"] proc requestPostState*(premix, n: JsonNode, blockNumber: Uint256) = + type + TxKind {.pure.} = enum + Regular + ContractCreation + ContractCall + let txs = n["transactions"] if txs.len == 0: return let tracer = jsonTracer(postStateTracer) for t in txs: + var txKind = TxKind.Regular let tx = parseTransaction(t) + if tx.isContractCreation: txKind = TxKind.ContractCreation if hasInternalTx(tx, blockNumber): let txTrace = requestInternalTx(t["hash"], tracer) for address, account in txTrace: updateAccount(address, account, blockNumber) premix.add account + if not tx.isContractCreation: txKind = TxKind.ContractCall else: premix.requestAccount(blockNumber, tx.getRecipient) premix.requestAccount(blockNumber, tx.getSender) + t["txKind"] = %($txKind) + proc requestPostState*(thisBlock: Block): JsonNode = let blockNumber = thisBlock.header.blockNumber var premix = newJArray()