mirror of
https://github.com/status-im/evmc.git
synced 2025-02-22 07:58:19 +00:00
attempt to make test green
This commit is contained in:
parent
e2b88bbc0b
commit
9af19a284c
@ -17,7 +17,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
/// The example VM instance struct extending the evmc_vm.
|
||||
struct example_vm
|
||||
{
|
||||
@ -225,8 +226,10 @@ struct evmc_vm* evmc_create_example_vm()
|
||||
.get_capabilities = get_capabilities,
|
||||
.set_option = set_option,
|
||||
};
|
||||
struct example_vm* vm = calloc(1, sizeof(struct example_vm));
|
||||
struct example_vm* vm = (example_vm*)calloc(1, sizeof(struct example_vm));
|
||||
struct evmc_vm* interface = &vm->instance;
|
||||
memcpy(interface, &init, sizeof(init));
|
||||
return interface;
|
||||
}
|
||||
|
||||
}
|
@ -3,7 +3,7 @@ import evmc_nim/nim_host
|
||||
import stew/byteutils
|
||||
|
||||
{.compile: "evmc_c/example_host.cpp".}
|
||||
{.compile: "evmc_c/example_vm.c".}
|
||||
{.compile: "evmc_c/example_vm.cpp".}
|
||||
{.passL: "-lstdc++"}
|
||||
|
||||
when defined(posix):
|
||||
@ -62,12 +62,6 @@ template runTest(testName: string, create_vm, get_host_interface, create_host_co
|
||||
|
||||
test "getTxContext":
|
||||
let txc = hc.getTxContext()
|
||||
|
||||
debugEcho tx_context.block_number, " " , txc.block_number
|
||||
debugEcho tx_context.block_timestamp, " " , txc.block_timestamp
|
||||
debugEcho tx_context.block_gas_limit, " " , txc.block_gas_limit
|
||||
|
||||
|
||||
check tx_context.block_number == txc.block_number
|
||||
check tx_context.block_timestamp == txc.block_timestamp
|
||||
check tx_context.block_gas_limit == txc.block_gas_limit
|
||||
|
Loading…
x
Reference in New Issue
Block a user