Skip to main content

StateView

Trait StateView 

Source
pub trait StateView {
    // Required methods
    fn account(&self, id: AccountId) -> Option<&Account>;
    fn pending(&self, id: TransferId) -> Option<&PendingReservation>;
    fn now(&self) -> u64;
}
Expand description

Read-only view of ledger state the engine needs. Backends implement this over their own storage (a BTreeMap for MemLedger, RocksDB point-reads for RocksLedger).

Required Methods§

Source

fn account(&self, id: AccountId) -> Option<&Account>

Look up an account by id.

Source

fn pending(&self, id: TransferId) -> Option<&PendingReservation>

Look up a pending reservation by its phase-1 transfer id.

Source

fn now(&self) -> u64

The ledger’s logical commit clock (seconds). Deadlines are judged against this at apply time (plan §2b.5) — never a caller clock.

Implementors§