Expand description
ContractRuntimeState — the per-contract client-side view.
Holds a plain read-only snapshot the caller owns by value. Private
state is the caller’s responsibility — see the crate-level lib.rs
docs for the witness-bytes-at-call-time contract.
§What lives here
ContractRuntimeState— a bundle of theContractAddress, the latest observedContractState<InMemoryDB>, and the transaction id + block height of the indexer tick that produced the current snapshot.contract_address_to_hex/decode_contract_address/encode_contract_state/decode_contract_state— small pure-compute hex codecs the indexer-driven fold uses.
The indexer-driven fold helper (fold_contract_actions) lives in
[moonproof_contracts::state_fold] — it consumes
[moonproof_indexer_client::ContractActionTickRaw] which would pull
a heavy network dep into this wasm-friendly crate.
Structs§
- Contract
Runtime State - The client-side view of a single deployed contract.
Functions§
- contract_
address_ to_ hex - Hex-encode a
ContractAddressin the same lower-case-64-char convention the indexer uses on the wire. - decode_
contract_ address - Parse a 64-hex-char address into a
ContractAddress. - decode_
contract_ state - Parse a hex-encoded tagged
ContractStateblob into aContractState<InMemoryDB>. - encode_
contract_ state - Tagged-serialize a
ContractState<InMemoryDB>to hex — inverse ofdecode_contract_state.