From 16cebc469bf66e484e108cda7a11502b26b4f726 Mon Sep 17 00:00:00 2001
From: andri lim Transaction Kind: ${tx.txKind}
`).appendTo(container);
renderTx(ncr, gcr);
}
diff --git a/premix/index.html b/premix/index.html
index 3ef313b66..9d49037e8 100644
--- a/premix/index.html
+++ b/premix/index.html
@@ -153,6 +153,12 @@
of other transactions. In opcode section, the same thing happened, perhaps only the first instruction
with red colored text have the problem, but it will affect the rest of other instructions.
+ 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()