Forge v0.7.2 Forge.Account View Source

hanlde account state in MPT

Link to this section Summary

Functions

Create a new state based on the context. The state will inherit the time of the block

Retrieve the state from an address

Put a state data with current context into the trie for the giving address

Update an account with update balance and data. Internally, it woul update the nonce (if advance is true) and num_txs

Link to this section Types

Link to this section Functions

Link to this function genesis(context) View Source
genesis(map()) :: Forge.AccountState.t()

Create a new state based on the context. The state will inherit the time of the block.

Link to this function get(trie, addr) View Source
get(Forge.Mpt.t(), String.t()) :: Forge.AccountState.t() | nil

Retrieve the state from an address

Link to this function put(trie, addr, data, context) View Source
put(Forge.Mpt.t(), String.t(), Forge.AccountState.t(), Forge.Context.t()) ::
  Forge.Mpt.t()

Put a state data with current context into the trie for the giving address

Link to this function renaissance(account, new_balance, data, advance \\ true) View Source
renaissance(
  Forge.AccountState.t(),
  non_neg_integer(),
  Google.Protobuf.Any.t() | nil,
  boolean()
) :: Forge.AccountState.t()

Update an account with update balance and data. Internally, it woul update the nonce (if advance is true) and num_txs.