Database.Makemodule Inputs : Inputs_intfinclude Base_ledger_intf.S
with module Location = Inputs.Location
with module Addr = Inputs.Location.Addr
with type key := Inputs.Key.t
with type token_id := Inputs.Token_id.t
with type token_id_set := Inputs.Token_id.Set.t
with type account := Inputs.Account.t
with type root_hash := Inputs.Hash.t
with type hash := Inputs.Hash.t
with type account_id := Inputs.Account_id.t
with type account_id_set := Inputs.Account_id.Set.tmodule Addr = Inputs.Location.Addrmodule Path : Merkle_path.S with type hash := Inputs.Hash.tmodule Location = Inputs.Locationinclude Syncable_intf.S
with type root_hash := Inputs.Hash.t
and type hash := Inputs.Hash.t
and type account := Inputs.Account.t
and type addr := Addr.t
and type path = Path.t
and type t := ttype path = Path.tval depth : t -> intval num_accounts : t -> intval get_inner_hash_at_addr_exn : t -> Addr.t -> Inputs.Hash.tval set_inner_hash_at_addr_exn : t -> Addr.t -> Inputs.Hash.t -> unitval set_all_accounts_rooted_at_exn :
t ->
Addr.t ->
Inputs.Account.t list ->
unitval set_batch_accounts : t -> (Addr.t * Inputs.Account.t) list -> unitval get_all_accounts_rooted_at_exn :
t ->
Addr.t ->
(Addr.t * Inputs.Account.t) listGet 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 -> unitval to_list : t -> Inputs.Account.t listlist of accounts in the ledger
val iteri : t -> f:( index -> Inputs.Account.t -> unit ) -> unititerate over all indexes and accounts
val foldi :
t ->
init:'accum ->
f:( Addr.t -> 'accum -> Inputs.Account.t -> 'accum ) ->
'accumfold over accounts in the ledger, passing the Merkle address
val foldi_with_ignored_accounts :
t ->
Inputs.Account_id.Set.t ->
init:'accum ->
f:( Addr.t -> 'accum -> Inputs.Account.t -> '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 -> Inputs.Account.t -> ( '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 -> Inputs.Account_id.Set.tset of account ids associated with accounts
val token_owner : t -> Inputs.Token_id.t -> Inputs.Account_id.t optionGet the account id that owns a token.
val token_owners : t -> Inputs.Account_id.Set.tGet the set of all accounts which own a token.
val tokens : t -> Inputs.Key.t -> Inputs.Token_id.Set.tGet all of the tokens for which a public key has accounts.
val location_of_account : t -> Inputs.Account_id.t -> Location.t optionval location_of_account_batch :
t ->
Inputs.Account_id.t list ->
(Inputs.Account_id.t * Location.t option) listval get_or_create_account :
t ->
Inputs.Account_id.t ->
Inputs.Account.t ->
([ `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 -> Inputs.Account.t optionval get_batch :
t ->
Location.t list ->
(Location.t * Inputs.Account.t option) listval set : t -> Location.t -> Inputs.Account.t -> unitval set_batch : t -> (Location.t * Inputs.Account.t) list -> unitval get_at_index_exn : t -> int -> Inputs.Account.tval set_at_index_exn : t -> int -> Inputs.Account.t -> unitval index_of_account_exn : t -> Inputs.Account_id.t -> intval merkle_root : t -> Inputs.Hash.tmeant 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 -> Inputs.Account_id.t 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