Skip to content

Commit

Permalink
rebase and fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Aug 11, 2023
1 parent 2c2b85d commit 92c765b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
11 changes: 10 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,16 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
});
unit_tests.addIncludePath(LazyPath{ .path = "evmone" });
unit_tests.addIncludePath(LazyPath{ .path = "evmone/include/evmone" });
unit_tests.addIncludePath(LazyPath{ .path = "evmone/evmc/include" });
if (target.getCpuArch() == .x86_64) {
// On x86_64, some functions are missing from the static library,
// so we define dummy functions to make sure that it compiles.
unit_tests.addCSourceFile(.{
.file = .{ .path = "src/glue.c" },
.flags = &cflags,
});
}
unit_tests.linkLibrary(ethash);
unit_tests.linkLibrary(evmone);
unit_tests.linkLibC();
Expand Down
9 changes: 8 additions & 1 deletion src/exec-spec-tests/execspectests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,16 @@ test "execution-spec-tests" {
defer ft.deinit();

var it = ft.tests.value.map.iterator();
var count: usize = 0;

while (it.next()) |entry| {
log.debug("##### Executing fixture {s} #####", .{entry.key_ptr.*});
try std.testing.expect(try entry.value_ptr.*.run(test_allocator));
return; // TODO(jsign): only run the first test for now. Then we can enable all and continue with the integration.
count += 1;

// TODO: Only run the first test for now. Then we can enable all and continue with the integration.
if (count == 1) {
break;
}
}
}
4 changes: 0 additions & 4 deletions src/vm/vm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const BlockContext = struct {
gas_limit: i64,
prev_randao: u256,
base_fee: u256,
blob_hashes: ?[]const [32]u8,
};

pub const VM = struct {
Expand Down Expand Up @@ -115,7 +114,6 @@ pub const VM = struct {
.gas_limit = block.header.gas_limit,
.prev_randao = std.mem.readIntSlice(u256, &block.header.prev_randao, std.builtin.Endian.Big),
.base_fee = @as(u256, std.mem.readIntSlice(u32, &block.header.base_fee_per_gas, std.builtin.Endian.Big)),
.blob_hashes = null, // TODO
};
}

Expand Down Expand Up @@ -224,8 +222,6 @@ pub const VM = struct {
.block_prev_randao = util.to_evmc_bytes32(vm.context.?.block.prev_randao),
.chain_id = util.to_evmc_bytes32(vm.context.?.txn.chain_id),
.block_base_fee = util.to_evmc_bytes32(vm.context.?.block.base_fee),
.blob_hashes = null, // TODO
.blob_hashes_count = 0, // TODO
};
}

Expand Down

0 comments on commit 92c765b

Please sign in to comment.