Database_intf.Sinclude Base_ledger_intf.Smodule Addr : module type of Merkle_addressmodule Path : Merkle_path.S with type hash := hashmodule Location : sig ... endinclude Syncable_intf.S
with type root_hash := root_hash
and type hash := hash
and type account := account
and type addr := Addr.t
and type path = Path.t
and type t := ttype path = Path.tval depth : t -> intval num_accounts : t -> intGet all of the accounts that are in a subtree of the underlying Merkle tree rooted at `address`. The accounts are ordered by their addresses.
val make_space_for : t -> int -> unitfold over accounts in the ledger, passing the Merkle address
val foldi_with_ignored_accounts :
t ->
account_id_set ->
init:'accum ->
f:( Addr.t -> 'accum -> account -> 'accum ) ->
'accumthe set of account_ids are ledger elements to skip during the fold, because they're in a mask
val fold_until :
t ->
init:'accum ->
f:( 'accum -> account -> ( 'accum, 'stop ) Base.Continue_or_stop.t ) ->
finish:( 'accum -> 'stop ) ->
'stopfold over accounts until stop condition reached when calling f; calls finish for result
val accounts : t -> account_id_setset of account ids associated with accounts
val token_owner : t -> token_id -> account_id optionGet the account id that owns a token.
val token_owners : t -> account_id_setGet the set of all accounts which own a token.
val tokens : t -> key -> token_id_setGet all of the tokens for which a public key has accounts.
val location_of_account : t -> account_id -> Location.t optionval location_of_account_batch :
t ->
account_id list ->
(account_id * Location.t option) listval get_or_create_account :
t ->
account_id ->
account ->
([ `Added | `Existed ] * Location.t) Core.Or_error.tThis may return an error if the ledger is full.
val close : t -> unitthe ledger should not be used after calling close
val last_filled : t -> Location.t optionfor account locations in the ledger, the last (rightmost) filled location
val get_uuid : t -> Uuid.tval get_directory : t -> string optionreturn Some directory for ledgers that use a file system, else None
val get : t -> Location.t -> account optionval get_batch : t -> Location.t list -> (Location.t * account option) listval set : t -> Location.t -> account -> unitval set_batch : t -> (Location.t * account) list -> unitval index_of_account_exn : t -> account_id -> intmeant to be a fast operation: the root hash is stored, rather than calculated dynamically
val merkle_path : t -> Location.t -> Path.tval remove_accounts_exn : t -> account_id list -> unitval detached_signal : t -> unit Async_kernel.Deferred.tTriggers when the ledger has been detached and should no longer be accessed.
val create : ?directory_name:string -> depth:int -> unit -> tcreate_checkpoint would create the checkpoint and open a db connection to that checkpoint
val make_checkpoint : t -> directory_name:string -> unitmake_checkpoint would only create the checkpoint
val with_ledger : depth:int -> f:( t -> 'a ) -> 'amodule For_tests : sig ... end