-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
Milestone
Description
As described in #141, see comment we need a cap9-build lib utility that:
- Decodes a
.wasmmodule processed bywasm-build - Searches for:
(import "env" "cap9_syscall_low" (func $env.storage_write (type $t0)))- Replaces
$cap9_syscall_lowimport declaration with a statically linked system-call with:
(func $cap9_syscall_low (type $t0) (param $p0 i32) (param $p1 i32) (param $p2 i32) (param $p3 i32) (result i32)
call $env.gasleft
call $env.sender
get_local $p0
get_local $p1
get_local $p2
get_local $p3
call $env.dcall)Lib
Library should be included in a separate cargo folder named: "cap9-build" and added as a dev-dependency in Cargo.toml. Use as a binary might not be necessary if integration tests allow using the lib as a dev-dependency.
Tests
Tests should be included:
- For cap9-build tests in
kernel-ewasm/cap9-build/tests/ - For all other tests use
cap9_buildas a lib inkernel-ewasm/tests/**