Trait casper_types::system::auction::StorageProvider
source ·
[−]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_summary: 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
fn read_withdraw(
&mut self,
account_hash: &AccountHash
) -> Result<Vec<UnbondingPurse>, Error>
fn read_withdraw(
&mut self,
account_hash: &AccountHash
) -> Result<Vec<UnbondingPurse>, Error>
Reads collection of UnbondingPurse
s at account hash derived from given public key
fn write_withdraw(
&mut self,
account_hash: AccountHash,
unbonding_purses: Vec<UnbondingPurse>
) -> Result<(), Error>
fn write_withdraw(
&mut self,
account_hash: AccountHash,
unbonding_purses: Vec<UnbondingPurse>
) -> Result<(), Error>
Writes given UnbondingPurse
s at account hash derived from given public key
Records era summary.
fn write_seigniorage_recipients_snapshot(
&mut self,
uref: URef,
snapshot: SeigniorageRecipientsSnapshot
) -> Result<(), Error>
fn write_seigniorage_recipients_snapshot(
&mut self,
uref: URef,
snapshot: SeigniorageRecipientsSnapshot
) -> Result<(), Error>
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
.