forked from contrun/ckb-lua
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update deps and clang-18 * Update ckb-debugger * Implement spawn * Implement spawn cell * Update docs
- Loading branch information
Showing
15 changed files
with
711 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule compiler-rt-builtins-riscv
updated
137 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
local callee_code = [[ | ||
local m = arg[2] .. arg[3] | ||
local inherited_fds, err = ckb.inherited_fds() | ||
local n, err = ckb.write(inherited_fds[1], m) | ||
ckb.close(inherited_fds[1]) | ||
assert(n == 10) | ||
local pid = ckb.process_id() | ||
assert(pid >= 1) | ||
]] | ||
|
||
local fds, err = ckb.pipe() | ||
assert(err == nil) | ||
local pid, err = ckb.spawn(0, ckb.SOURCE_CELL_DEP, 0, 0, {"-e", callee_code, "hello", "world"}, {fds[2]}) | ||
assert(err == nil) | ||
local ret = ckb.read(fds[1], 10) | ||
assert(ret == "helloworld") | ||
ckb.wait(pid) | ||
|
||
local code_hash, err = ckb.load_cell_by_field(0, ckb.SOURCE_CELL_DEP, ckb.CELL_FIELD_DATA_HASH) | ||
assert(err == nil) | ||
local fds, err = ckb.pipe() | ||
assert(err == nil) | ||
local pid, err = ckb.spawn_cell(code_hash, 4, 0, 0, {"-e", callee_code, "hello", "world"}, {fds[2]}) | ||
assert(err == nil) | ||
local ret = ckb.read(fds[1], 10) | ||
assert(ret == "helloworld") | ||
ckb.wait(pid) |
Submodule ckb-c-stdlib
updated
17 files
+17 −0 | .github/workflows/ci.yml | |
+2 −0 | .gitignore | |
+22 −2 | Makefile | |
+0 −2 | README.md | |
+13 −4 | ckb_consts.h | |
+1 −1 | ckb_dlfcn.h | |
+2 −2 | ckb_keccak256.h | |
+28 −10 | ckb_syscall_apis.h | |
+39 −14 | ckb_syscalls.h | |
+9 −17 | libc/src/impl.c | |
+0 −3 | molecule/blockchain-api2.h | |
+2,038 −1,838 | molecule/blockchain.h | |
+0 −17 | molecule/molecule2_reader.h | |
+231 −182 | molecule/molecule_builder.h | |
+140 −112 | molecule/molecule_reader.h | |
+1 −1 | simulator/ckb_syscall_simulator.c | |
+29 −0 | tests/ci.c |
Oops, something went wrong.