Onchain.RPC.Proof (onchain v0.16.0)

Copy Markdown View Source

EIP-1186 account proof. Quantities are integers; addresses, hashes and RLP proof nodes are raw bytes. Storage keys are integers, accepting either padded DATA or QUANTITY encodings from clients. Proofs are not verified locally.

Summary

Types

An eth_getProof result as the node returns it: hex strings under "address", "balance", "nonce", "codeHash", "storageHash", a hex list under "accountProof", and "storageProof" entries.

One storageProof entry: hex "key" and "value", hex list "proof".

t()

Functions

Decodes all required EIP-1186 fields, raising on missing or malformed data.

Types

raw()

@type raw() :: %{required(String.t()) => String.t() | [String.t()] | [raw_storage()]}

An eth_getProof result as the node returns it: hex strings under "address", "balance", "nonce", "codeHash", "storageHash", a hex list under "accountProof", and "storageProof" entries.

raw_storage()

@type raw_storage() :: %{required(String.t()) => String.t() | [String.t()]}

One storageProof entry: hex "key" and "value", hex list "proof".

t()

@type t() :: %Onchain.RPC.Proof{
  account_proof: [binary()],
  address: <<_::160>>,
  balance: non_neg_integer(),
  code_hash: <<_::256>>,
  nonce: non_neg_integer(),
  storage_hash: <<_::256>>,
  storage_proof: [Onchain.RPC.Proof.StorageProof.t()]
}

Functions

deserialize(params)

@spec deserialize(raw()) :: t()

Decodes all required EIP-1186 fields, raising on missing or malformed data.