pub trait RuntimeProvider {
    // Required methods
    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§

source

fn get_caller(&self) -> AccountHash

This method should return the caller of the current context.

source

fn get_immediate_caller(&self) -> Option<&CallStackElement>

This method should return the immediate caller of the current context.

source

fn get_phase(&self) -> Phase

Gets execution phase

source

fn put_key(&mut self, name: &str, key: Key) -> Result<(), Error>

This method should handle storing given Key under name.

source

fn get_key(&self, name: &str) -> Option<Key>

This method should handle obtaining a given named Key under a name.

source

fn get_approved_spending_limit(&self) -> U512

Returns approved CSPR spending limit.

source

fn sub_approved_spending_limit(&mut self, transferred: U512)

Signal to host that transferred amount of tokens has been transferred.

source

fn get_main_purse(&self) -> URef

Returns main purse of the sender account.

Implementors§