[][src]Struct cw_multi_test::WasmCache

pub struct WasmCache<'a> { /* fields omitted */ }

A writable transactional cache over the wasm state.

Reads hit local hashmap or then hit router Getting storage wraps the internal contract storage

  • adding handler
  • adding contract
  • writing existing contract Return op-log to flush, like transactional:
  • consume this struct (release router) and return list of ops to perform
  • pass ops &mut WasmRouter to update them

In Router, we use this exclusively in all the calls in execute (not self.wasm) In Querier, we use self.wasm

Implementations

impl<'a> WasmCache<'a>[src]

pub fn prepare(self) -> WasmOps[src]

When we want to commit the WasmCache, we need a 2 step process to satisfy Rust reference counting:

  1. prepare() consumes WasmCache, releasing &WasmRouter, and creating a self-owned update info.
  2. WasmOps::commit() can now take &mut WasmRouter and updates the underlying state

pub fn register_contract(&mut self, code_id: usize) -> Result<HumanAddr, String>[src]

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.

pub fn handle(
    &mut self,
    address: HumanAddr,
    querier: &dyn Querier,
    info: MessageInfo,
    msg: Vec<u8>
) -> Result<HandleResponse, String>
[src]

pub fn init(
    &mut self,
    address: HumanAddr,
    querier: &dyn Querier,
    info: MessageInfo,
    msg: Vec<u8>
) -> Result<InitResponse, String>
[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for WasmCache<'a>[src]

impl<'a> !Send for WasmCache<'a>[src]

impl<'a> !Sync for WasmCache<'a>[src]

impl<'a> Unpin for WasmCache<'a>[src]

impl<'a> !UnwindSafe for WasmCache<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.