Closed ChiaMineJP closed 3 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
wasm/src/serialize.rs | 0 | 15 | 0.0% | ||
wasm/src/lazy_node.rs | 0 | 16 | 0.0% | ||
wasm/src/run_program.rs | 0 | 19 | 0.0% | ||
<!-- | Total: | 29 | 79 | 36.71% | --> |
Totals | |
---|---|
Change from base Build 8310295107: | -0.4% |
Covered Lines: | 5789 |
Relevant Lines: | 6162 |
Consider moving
ALLOW_BACKREFS
towasm
api, or simply exportingnode_to_bytes_backrefs
separately.
I'll move ALLOW_BACKREFS
to wasm
api.
In Rust part of clvm_rs
, whether to allow backrefs will be decided in the upper scope (like chia_rs
).
However, in wasm/js part of clvm_rs
, developers must tell whether to allow backref or not in the clvm_wasm
(clvm_rs
)'s scope because from JS world, SExp is always passed as uint8 byte array.
So whether the byte stream is compressed or not must be immediately known in run_chia_program
or run_clvm
and cannot defer.
Added support compressed form of clvm byte representation.
Changed
wasm/src/api.rs
towasm/src/run_program.rs
allow_backrefs()
method toFlag
structrun_clvm
requiresflag
argument. IfALLOW_BACKREFS
bit is set, it deserializes bytes input of clvm objects as compressed forms.ALLOW_BACKREFS
bit is set when callingrun_chia_program
, it deserializes bytes input of clvm objects as compressed forms.Added
sexp_from_bytes
function.to_bytes()
method toLazyNode