diff --git a/tests/macro_assembler.nim b/tests/macro_assembler.nim index be11cc29e..66b2a2154 100644 --- a/tests/macro_assembler.nim +++ b/tests/macro_assembler.nim @@ -193,6 +193,7 @@ proc initComputation(vmState: BaseVMState, tx: Transaction, sender: EthAddress, let contractAddress = generateAddress(sender, tx.accountNonce) let msg = newMessage(tx.gasLimit - gasUsed, tx.gasPrice, tx.to, sender, tx.value, data, tx.payload, + contractCreation = false, options = newMessageOptions(origin = sender, createAddress = contractAddress)) newBaseComputation(vmState, vmState.blockNumber, msg, some(fork)) diff --git a/tests/test_opcode.nim b/tests/test_opcode.nim index 95517331d..dce40bdca 100644 --- a/tests/test_opcode.nim +++ b/tests/test_opcode.nim @@ -32,6 +32,7 @@ proc testCode(code: string, initialGas: GasInt, blockNum: UInt256): BaseComputat value=0.u256, data = @[], code=code.hexToSeqByte, + contractCreation = true, gas=initial_gas, gasPrice=1) # What is this used for? # gasPrice=fixture{"exec"}{"gasPrice"}.getHexadecimalInt.u256, diff --git a/tests/test_precompiles.nim b/tests/test_precompiles.nim index 99ce29186..bc9348c15 100644 --- a/tests/test_precompiles.nim +++ b/tests/test_precompiles.nim @@ -28,7 +28,7 @@ template doTest(fixture: JsonNode, address: byte, action: untyped): untyped = gasPrice = 1.GasInt sender: EthAddress to = initAddress(address) - message = newMessage(gas, gasPrice, to, sender, 0.u256, data, @[]) + message = newMessage(gas, gasPrice, to, sender, 0.u256, data, @[], contractCreation = false) computation = newBaseComputation(vmState, header.blockNumber, message) echo "Running ", action.astToStr, " - ", test["name"] `action`(computation) diff --git a/tests/test_vm_json.nim b/tests/test_vm_json.nim index c34d74659..780da8c7c 100644 --- a/tests/test_vm_json.nim +++ b/tests/test_vm_json.nim @@ -50,6 +50,7 @@ proc testFixture(fixtures: JsonNode, testStatusIMPL: var TestStatus) = value = cast[uint64](fexec{"value"}.getHexadecimalInt).u256, # Cast workaround for negative value data = fexec{"data"}.getStr.hexToSeqByte, code = code, + contractCreation = toAddress == ZERO_ADDRESS, # assume ZERO_ADDRESS is a contract creation gas = fexec{"gas"}.getHexadecimalInt, gasPrice = fexec{"gasPrice"}.getHexadecimalInt, options = newMessageOptions(origin=fexec{"origin"}.getStr.parseAddress, @@ -57,7 +58,7 @@ proc testFixture(fixtures: JsonNode, testStatusIMPL: var TestStatus) = var computation = newBaseComputation(vmState, header.blockNumber, message) computation.executeOpcodes() - + if not fixture{"post"}.isNil: # Success checks check(not computation.isError)