[−][src]Struct cw_multi_test::WasmCache
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:
- prepare() consumes WasmCache, releasing &WasmRouter, and creating a self-owned update info.
- 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]
&mut self,
address: HumanAddr,
querier: &dyn Querier,
info: MessageInfo,
msg: Vec<u8>
) -> Result<HandleResponse, String>
pub fn init(
&mut self,
address: HumanAddr,
querier: &dyn Querier,
info: MessageInfo,
msg: Vec<u8>
) -> Result<InitResponse, String>
[src]
&mut self,
address: HumanAddr,
querier: &dyn Querier,
info: MessageInfo,
msg: Vec<u8>
) -> Result<InitResponse, String>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,