Fix for styleCheck:usages
This commit is contained in:
parent
4b504ac784
commit
c0e7772f52
|
@ -15,6 +15,8 @@ proc test(name: string, lang: string = "cpp") =
|
||||||
mkDir "build"
|
mkDir "build"
|
||||||
--run
|
--run
|
||||||
switch("out", ("./build/" & name))
|
switch("out", ("./build/" & name))
|
||||||
|
switch("styleCheck", "usages")
|
||||||
|
switch("styleCheck", "error")
|
||||||
setCommand lang, "tests/" & name & ".nim"
|
setCommand lang, "tests/" & name & ".nim"
|
||||||
|
|
||||||
task test_debug, "Run all tests - test implementation":
|
task test_debug, "Run all tests - test implementation":
|
||||||
|
|
|
@ -55,11 +55,11 @@ proc copyCode*(ctx: HostContext, address: var evmc_address, codeOffset: int = 0)
|
||||||
let size = ctx.getCodeSize(address)
|
let size = ctx.getCodeSize(address)
|
||||||
if size - codeOffset > 0:
|
if size - codeOffset > 0:
|
||||||
result = newSeq[byte](size - codeOffset)
|
result = newSeq[byte](size - codeOffset)
|
||||||
let read = ctx.host.copy_code(ctx.context, address, code_offset.csize_t, result[0].addr, result.len.csize_t).int
|
let read = ctx.host.copy_code(ctx.context, address, codeOffset.csize_t, result[0].addr, result.len.csize_t).int
|
||||||
doAssert(read == result.len)
|
doAssert(read == result.len)
|
||||||
|
|
||||||
proc copyCode*(ctx: HostContext, address: var evmc_address, codeOffset: int, output: ptr byte, output_len: int): int =
|
proc copyCode*(ctx: HostContext, address: var evmc_address, codeOffset: int, output: ptr byte, output_len: int): int =
|
||||||
ctx.host.copy_code(ctx.context, address, code_offset.csize_t, output, output_len.csize_t).int
|
ctx.host.copy_code(ctx.context, address, codeOffset.csize_t, output, output_len.csize_t).int
|
||||||
|
|
||||||
proc selfdestruct*(ctx: HostContext, address, beneficiary: var evmc_address) =
|
proc selfdestruct*(ctx: HostContext, address, beneficiary: var evmc_address) =
|
||||||
ctx.host.selfdestruct(ctx.context, address, beneficiary)
|
ctx.host.selfdestruct(ctx.context, address, beneficiary)
|
||||||
|
|
|
@ -18,10 +18,10 @@ import stew/byteutils
|
||||||
|
|
||||||
{.compile: "evmc_c/example_host.cpp".}
|
{.compile: "evmc_c/example_host.cpp".}
|
||||||
{.compile: "evmc_c/example_vm.cpp".}
|
{.compile: "evmc_c/example_vm.cpp".}
|
||||||
{.passL: "-lstdc++"}
|
{.passl: "-lstdc++"}
|
||||||
|
|
||||||
when defined(posix):
|
when defined(posix):
|
||||||
{.passC: "-std=c++14".}
|
{.passc: "-std=c++14".}
|
||||||
|
|
||||||
# The original EVMC C/C++ `example_host_create_context` test code wants struct
|
# The original EVMC C/C++ `example_host_create_context` test code wants struct
|
||||||
# `evmc_tx_context` passed by value, and `(tx_context: evmc_tx_context)` looks
|
# `evmc_tx_context` passed by value, and `(tx_context: evmc_tx_context)` looks
|
||||||
|
|
Loading…
Reference in New Issue