Trait casper_types::system::mint::RuntimeProvider
source ·
[−]pub trait RuntimeProvider {
fn get_caller(&self) -> AccountHash;
fn get_immediate_caller(&self) -> Option<&CallStackElement>;
fn get_phase(&self) -> Phase;
fn put_key(&mut self, name: &str, key: Key) -> Result<(), Error>;
fn get_key(&self, name: &str) -> Option<Key>;
fn get_approved_spending_limit(&self) -> U512;
fn sub_approved_spending_limit(&mut self, transferred: U512);
fn get_main_purse(&self) -> URef;
}
Expand description
Provider of runtime host functionality.
Required methods
fn get_caller(&self) -> AccountHash
fn get_caller(&self) -> AccountHash
This method should return the caller of the current context.
fn get_immediate_caller(&self) -> Option<&CallStackElement>
fn get_immediate_caller(&self) -> Option<&CallStackElement>
This method should return the immediate caller of the current context.
This method should handle storing given Key
under name
.
This method should handle obtaining a given named Key
under a name
.
fn get_approved_spending_limit(&self) -> U512
fn get_approved_spending_limit(&self) -> U512
Returns approved CSPR spending limit.
fn sub_approved_spending_limit(&mut self, transferred: U512)
fn sub_approved_spending_limit(&mut self, transferred: U512)
Signal to host that transferred
amount of tokens has been transferred.
fn get_main_purse(&self) -> URef
fn get_main_purse(&self) -> URef
Returns main purse of the sender account.