Module Prove.Registry

type t
type invalid_argument_error

Backend-specific invalid-argument error type for registry operations.

val hash : t -> (bytes, invalid_argument_error) Stdlib.result

hash registry computes the Merkle root hash of registry, derived from the root hashes of all its databases.

val size : t -> (int64, invalid_argument_error) Stdlib.result

size registry returns the number of databases currently held in registry.

val resize : t -> int64 -> (unit, 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, 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, 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, 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.