pub struct WasmKeeper<ExecC, QueryC> { /* private fields */ }

Implementations§

source§

impl<ExecC, QueryC> WasmKeeper<ExecC, QueryC>

source

pub fn store_code(&mut self, code: Box<dyn Contract<ExecC, QueryC>>) -> usize

source

pub fn load_contract( &self, storage: &dyn Storage, address: &Addr ) -> AnyResult<ContractData>

source

pub fn dump_wasm_raw( &self, storage: &dyn Storage, address: &Addr ) -> Vec<Record>

source§

impl<ExecC, QueryC> WasmKeeper<ExecC, QueryC>where ExecC: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static,

source

pub fn new() -> Self

source

pub fn new_with_custom_address_generator( generator: impl AddressGenerator + 'static ) -> Self

source

pub fn query_smart( &self, address: Addr, api: &dyn Api, storage: &dyn Storage, querier: &dyn Querier, block: &BlockInfo, msg: Vec<u8> ) -> AnyResult<Binary>

source

pub fn query_raw( &self, address: Addr, storage: &dyn Storage, key: &[u8] ) -> Binary

source

pub fn register_contract( &self, storage: &mut dyn Storage, code_id: usize, creator: Addr, admin: impl Into<Option<Addr>>, label: String, created: u64 ) -> AnyResult<Addr>

This just creates an address and empty storage instance, returning the new address You must call init after this to set up the contract properly. These are separated into two steps to have cleaner return values.

source

pub fn call_execute( &self, api: &dyn Api, storage: &mut dyn Storage, address: Addr, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, info: MessageInfo, msg: Vec<u8> ) -> AnyResult<Response<ExecC>>

source

pub fn call_instantiate( &self, address: Addr, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, info: MessageInfo, msg: Vec<u8> ) -> AnyResult<Response<ExecC>>

source

pub fn call_reply( &self, address: Addr, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, reply: Reply ) -> AnyResult<Response<ExecC>>

source

pub fn call_sudo( &self, address: Addr, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, msg: Vec<u8> ) -> AnyResult<Response<ExecC>>

source

pub fn call_migrate( &self, address: Addr, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, msg: Vec<u8> ) -> AnyResult<Response<ExecC>>

source

pub fn save_contract( &self, storage: &mut dyn Storage, address: &Addr, contract: &ContractData ) -> AnyResult<()>

Trait Implementations§

source§

impl<ExecC, QueryC> Default for WasmKeeper<ExecC, QueryC>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<ExecC, QueryC> Wasm<ExecC, QueryC> for WasmKeeper<ExecC, QueryC>where ExecC: Clone + Debug + PartialEq + JsonSchema + DeserializeOwned + 'static, QueryC: CustomQuery + DeserializeOwned + 'static,

source§

fn query( &self, api: &dyn Api, storage: &dyn Storage, querier: &dyn Querier, block: &BlockInfo, request: WasmQuery ) -> AnyResult<Binary>

Handles all WasmQuery requests
source§

fn execute( &self, api: &dyn Api, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, sender: Addr, msg: WasmMsg ) -> AnyResult<AppResponse>

Handles all WasmMsg messages
source§

fn sudo( &self, api: &dyn Api, contract: Addr, storage: &mut dyn Storage, router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, block: &BlockInfo, msg: Binary ) -> AnyResult<AppResponse>

Admin interface, cannot be called via CosmosMsg

Auto Trait Implementations§

§

impl<ExecC, QueryC> !RefUnwindSafe for WasmKeeper<ExecC, QueryC>

§

impl<ExecC, QueryC> !Send for WasmKeeper<ExecC, QueryC>

§

impl<ExecC, QueryC> !Sync for WasmKeeper<ExecC, QueryC>

§

impl<ExecC, QueryC> Unpin for WasmKeeper<ExecC, QueryC>where QueryC: Unpin,

§

impl<ExecC, QueryC> !UnwindSafe for WasmKeeper<ExecC, QueryC>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.