Module Verify.Registry

type t
val hash : t -> bytes

hash registry computes the Merkle root hash of registry, derived from the root hashes of all its databases. Normal and Prove return bytes directly from the Rust binding; Verify converts a verification_error return into a raised Nds_errors.Verification_failed, so the signature stays bytes across modes. Catch the exception at the Nds.with_verification boundary rather than at individual call sites.

val size : t -> int64

size registry returns the number of databases currently held in registry. Same exception convention as hash: Normal/Prove return int64 directly, Verify raises Nds_errors.Verification_failed on a proof mismatch.

val resize : t -> int64 -> (unit, Octez_riscv_nds_common.Nds_errors.invalid_argument_error) Stdlib.result

resize registry n adjusts registry to contain exactly n databases. The size can only change by one at a time; call this function in a loop for larger adjustments. Growing appends a new empty database; shrinking drops the last database. Returns an error if |current_size - n| > 1.

val copy_database : t -> src:int64 -> dst:int64 -> (unit, Octez_riscv_nds_common.Nds_errors.invalid_argument_error) Stdlib.result

copy_database registry ~src ~dst duplicates all contents of the database at index src into index dst, completely replacing the previous contents of dst. The source database is unchanged. Copying to the same index is a no-op. Returns an error if src or dst is out of bounds.

val move_database : t -> src:int64 -> dst:int64 -> (unit, Octez_riscv_nds_common.Nds_errors.invalid_argument_error) Stdlib.result

move_database registry ~src ~dst transfers the database at index src to index dst, completely replacing the previous contents of dst. The source is replaced with a fresh empty database. Moving to the same index is a no-op. Returns an error if src or dst is out of bounds.

val clear : t -> int64 -> (unit, Octez_riscv_nds_common.Nds_errors.invalid_argument_error) Stdlib.result

clear registry db_index replaces the database at db_index with a fresh empty database. Returns an error if db_index is out of bounds.