Chia-Network / clvm_rs

Rust implementation of clvm
Apache License 2.0
67 stars 54 forks source link

Support backref for wasm #395

Closed ChiaMineJP closed 3 months ago

ChiaMineJP commented 3 months ago

Added support compressed form of clvm byte representation.

Changed

Added

coveralls-official[bot] commented 3 months ago

Pull Request Test Coverage Report for Build 8829620756

Details


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 Coverage Status
Change from base Build 8310295107: -0.4%
Covered Lines: 5789
Relevant Lines: 6162

💛 - Coveralls
ChiaMineJP commented 3 months ago

Consider moving ALLOW_BACKREFS to wasm api, or simply exporting node_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.