code wiki / (root) / nx_substrate_manifest_test.nx

nx_substrate_manifest_test.nx

buildroot/runtime/nx_substrate_manifest_test.nx

6319 B138 linesdepth 7pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic substrate
docsdependenciesstructsconstsfunctions

about

nx_substrate_manifest_test.nx -- smoke for nx_substrate_manifest EM-3 partial. Exercises: 1. Allocation + canary + initial state 2. Add expected hashes; n_expected increments 3. Idempotent re-add 4. is_complete + n_missing reflect state correctly 5. INGEST happy path: bytes hash to claimed AND claimed is in manifest -> stored, received_flag set, n_received++ 6. NOT_IN_MANIFEST: ingest with claimed-hash NOT in expected set -> rejected; counter incremented 7. HASH_MISMATCH: ingest with bytes that DON'T hash to claimed -> rejected; tamper counter 8. ALREADY_RECEIVED: re-ingest same blob -> idempotent 9. Multiple distinct ingests -> n_received tracks correctly; eventually is_complete 10. Bad-input gates + canary tamper

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_blob_store.nx nx_substrate_manifest.nx nx_substrate_manifest_test.nx

imports: nx_syscalls.nxnx_blob_store.nxnx_substrate_manifest.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_blob_store_new sys_mmap nx_substrate_manifest_new sys_mmap ↻ nx_substrate_manifest_is_v nx_substrate_manifest_is_c nx_substrate_manifest_is_v ↻ nx_substrate_manifest_n_mi nx_substrate_manifest_is_v ↻ nx_substrate_manifest_n_re nx_substrate_manifest_is_v ↻ nx_substrate_manifest_n_re nx_substrate_manifest_is_v ↻ sys_mmap ↻ _fill_pattern _compute_hash nx_blob_store_new ↻ nx_blob_hash_new sys_mmap ↻ nx_blob_store_put nx_blob_store_is_valid _hash_bytes_to_struct sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_final blk_set_byte ↻ sha256_compress ↻ _load_i64_le _find_entry_idx _entry_hash_eq _alloc_entry

structs

none

consts

none

functions

20func _fill_pattern(buf: *u8, len: i64, seed: i64) -> i64
called by 1: main
32func _compute_hash(bytes: *u8, len: i64) -> *NxBlobHash
39func main() -> i64