pub struct Mock<S: StateInterface = MockState> {
pub sender: Addr,
pub state: Rc<RefCell<S>>,
pub app: Rc<RefCell<App>>,
}
Fields§
§sender: Addr
§state: Rc<RefCell<S>>
§app: Rc<RefCell<App>>
Implementations§
source§impl<S: StateInterface> Mock<S>
impl<S: StateInterface> Mock<S>
sourcepub fn set_balance(
&self,
address: &Addr,
amount: Vec<Coin>
) -> Result<(), BootError>
pub fn set_balance( &self, address: &Addr, amount: Vec<Coin> ) -> Result<(), BootError>
set the Bank balance of an address
pub fn set_balances( &self, balances: &[(&Addr, &[Coin])] ) -> Result<(), BootError>
Trait Implementations§
source§impl<T: BootExecute<Mock> + ContractInstance<Mock> + Clone> CallAs<Mock<MockState>> for T
impl<T: BootExecute<Mock> + ContractInstance<Mock> + Clone> CallAs<Mock<MockState>> for T
source§impl<S: StateInterface> ChainState for Mock<S>
impl<S: StateInterface> ChainState for Mock<S>
source§impl<S: StateInterface> TxHandler for Mock<S>
impl<S: StateInterface> TxHandler for Mock<S>
type Response = AppResponse
type Error = BootError
fn sender(&self) -> Addr
fn execute<E: Serialize + Debug>( &self, exec_msg: &E, coins: &[Coin], contract_address: &Addr ) -> Result<Self::Response, BootError>
fn instantiate<I: Serialize + Debug>( &self, code_id: u64, init_msg: &I, label: Option<&str>, admin: Option<&Addr>, coins: &[Coin] ) -> Result<Self::Response, BootError>
fn query<Q: Serialize + Debug, T: Serialize + DeserializeOwned>( &self, query_msg: &Q, contract_address: &Addr ) -> Result<T, BootError>
fn migrate<M: Serialize + Debug>( &self, migrate_msg: &M, new_code_id: u64, contract_address: &Addr ) -> Result<Self::Response, BootError>
fn upload( &self, contract_source: &mut ContractCodeReference<Empty> ) -> Result<Self::Response, BootError>
fn wait_blocks(&self, amount: u64) -> Result<(), BootError>
fn next_block(&self) -> Result<(), BootError>
fn block_info(&self) -> Result<BlockInfo, BootError>
Auto Trait Implementations§
impl<S = MockState> !RefUnwindSafe for Mock<S>
impl<S = MockState> !Send for Mock<S>
impl<S = MockState> !Sync for Mock<S>
impl<S> Unpin for Mock<S>
impl<S = MockState> !UnwindSafe for Mock<S>
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request