Mask.Attachedinclude Merkle_mask.Base_merkle_tree_intf.S
with module Addr = Addr
with module Location = Location
with type account := Mina_base.Account.t
and type root_hash := Mina_base.Ledger_hash.t
and type hash := Mina_base.Ledger_hash.t
and type key := Signature_lib.Public_key.Compressed.t
and type token_id := Mina_base.Token_id.t
and type token_id_set := Mina_base.Token_id.Set.t
and type account_id := Mina_base.Account_id.t
and type account_id_set := Mina_base.Account_id.Set.t
with module Addr = Location.Addrmodule Addr = Location.Addrmodule Path :
Merkle_ledger.Merkle_path.S with type hash := Mina_base.Ledger_hash.tmodule Location = Locationinclude Merkle_ledger.Syncable_intf.S
with type root_hash := Mina_base.Ledger_hash.t
and type hash := Mina_base.Ledger_hash.t
and type account := Mina_base.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 -> Mina_base.Ledger_hash.tval set_inner_hash_at_addr_exn : t -> Addr.t -> Mina_base.Ledger_hash.t -> unitval set_all_accounts_rooted_at_exn :
t ->
Addr.t ->
Mina_base.Account.t list ->
unitval set_batch_accounts : t -> (Addr.t * Mina_base.Account.t) list -> unitval get_all_accounts_rooted_at_exn :
t ->
Addr.t ->
(Addr.t * Mina_base.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 -> Mina_base.Account.t listlist of accounts in the ledger
val iteri : t -> f:( index -> Mina_base.Account.t -> unit ) -> unititerate over all indexes and accounts
val foldi :
t ->
init:'accum ->
f:( Addr.t -> 'accum -> Mina_base.Account.t -> 'accum ) ->
'accumfold over accounts in the ledger, passing the Merkle address
val foldi_with_ignored_accounts :
t ->
Mina_base.Account_id.Set.t ->
init:'accum ->
f:( Addr.t -> 'accum -> Mina_base.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 ->
Mina_base.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 -> Mina_base.Account_id.Set.tset of account ids associated with accounts
val token_owner : t -> Mina_base.Token_id.t -> Mina_base.Account_id.t optionGet the account id that owns a token.
val token_owners : t -> Mina_base.Account_id.Set.tGet the set of all accounts which own a token.
val tokens :
t ->
Signature_lib.Public_key.Compressed.t ->
Mina_base.Token_id.Set.tGet all of the tokens for which a public key has accounts.
val location_of_account : t -> Mina_base.Account_id.t -> Location.t optionval location_of_account_batch :
t ->
Mina_base.Account_id.t list ->
(Mina_base.Account_id.t * Location.t option) listval get_or_create_account :
t ->
Mina_base.Account_id.t ->
Mina_base.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 -> Mina_base.Account.t optionval get_batch :
t ->
Location.t list ->
(Location.t * Mina_base.Account.t option) listval set : t -> Location.t -> Mina_base.Account.t -> unitval set_batch : t -> (Location.t * Mina_base.Account.t) list -> unitval get_at_index_exn : t -> int -> Mina_base.Account.tval set_at_index_exn : t -> int -> Mina_base.Account.t -> unitval index_of_account_exn : t -> Mina_base.Account_id.t -> intval merkle_root : t -> Mina_base.Ledger_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 -> Mina_base.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 get_hash : t -> Addr.t -> Mina_base.Ledger_hash.t optionget hash from mask, if present, else from its parent
val commit : t -> unitcommit all state to the parent, flush state locally
val unset_parent : ?trigger_signal:bool -> loc:string -> t -> unattachedunset_parent ?trigger_signal ~loc:__LOC__ t detaches the parent from t. The loc argument is shown in the Dangling_parent_reference exception, which will be raised if t is used while no parent is registered.
If the trigger_signal optional argument is true or omitted, detached_signal for t will be resolved. This should only be set to false when the mask will be reparented.
val get_parent : t -> Any_ledger.M.tget mask parent
val parent_set_notify : t -> Mina_base.Account.t -> unitcalled when parent sets an account; update local state
module For_testing : sig ... endalready have module For_testing from include above