logo
pub trait StorageProvider {
    fn read<T: FromBytes + CLTyped>(
        &mut self,
        uref: URef
    ) -> Result<Option<T>, Error>; fn write<T: ToBytes + CLTyped>(
        &mut self,
        uref: URef,
        value: T
    ) -> Result<(), Error>; fn read_bid(
        &mut self,
        account_hash: &AccountHash
    ) -> Result<Option<Bid>, Error>; fn write_bid(
        &mut self,
        account_hash: AccountHash,
        bid: Bid
    ) -> Result<(), Error>; fn read_withdraw(
        &mut self,
        account_hash: &AccountHash
    ) -> Result<Vec<UnbondingPurse>, Error>; fn write_withdraw(
        &mut self,
        account_hash: AccountHash,
        unbonding_purses: Vec<UnbondingPurse>
    ) -> Result<(), Error>; fn record_era_info(
        &mut self,
        era_id: EraId,
        era_info: EraInfo
    ) -> Result<(), Error>; fn write_seigniorage_recipients_snapshot(
        &mut self,
        uref: URef,
        snapshot: SeigniorageRecipientsSnapshot
    ) -> Result<(), Error>; }
Expand description

Provides functionality of a contract storage.

Required methods

Reads data from URef.

Writes data to `URef.

Reads Bid at account hash derived from given public key

Writes given Bid at account hash derived from given public key

Reads collection of UnbondingPurses at account hash derived from given public key

Writes given UnbondingPurses at account hash derived from given public key

Records era info at the given era id.

Writes a SeigniorageRecipientsSnapshot to global state and charges for bytes stored.

The value is force-written, i.e. accidentally exceeding the write size limit will not cause this to return Err.

Implementors