Struct fadroma::ensemble::ContractEnsemble
source · [−]pub struct ContractEnsemble { /* private fields */ }
Implementations
sourceimpl ContractEnsemble
impl ContractEnsemble
pub fn new(canonical_length: usize) -> Self
pub fn register(
&mut self,
harness: Box<dyn ContractHarness>
) -> ContractInstantiationInfo
pub fn block(&self) -> &Block
pub fn block_mut(&mut self) -> &mut Block
pub fn set_chain_id(&mut self, id: impl Into<String>)
pub fn add_funds(&mut self, address: impl Into<HumanAddr>, coins: Vec<Coin>)
pub fn balances(
&self,
address: impl Into<HumanAddr>
) -> Option<&HashMap<String, Uint128>>
pub fn balances_mut(
&mut self,
address: impl Into<HumanAddr>
) -> Option<&mut HashMap<String, Uint128>>
sourcepub fn deps<F>(
&self,
address: impl Into<HumanAddr>,
borrow: F
) -> Result<(), String> where
F: FnOnce(&MockDeps),
pub fn deps<F>(
&self,
address: impl Into<HumanAddr>,
borrow: F
) -> Result<(), String> where
F: FnOnce(&MockDeps),
Returns an Err
if the contract with address
wasn’t found.
sourcepub fn deps_mut<F>(
&mut self,
address: impl Into<HumanAddr>,
mutate: F
) -> Result<(), String> where
F: FnOnce(&mut MockDeps),
pub fn deps_mut<F>(
&mut self,
address: impl Into<HumanAddr>,
mutate: F
) -> Result<(), String> where
F: FnOnce(&mut MockDeps),
Returns an Err
if the contract with address
wasn’t found.
sourcepub fn instantiate<T: Serialize>(
&mut self,
id: u64,
msg: &T,
env: MockEnv
) -> StdResult<InstantiateResponse>
pub fn instantiate<T: Serialize>(
&mut self,
id: u64,
msg: &T,
env: MockEnv
) -> StdResult<InstantiateResponse>
Returned address and code hash correspond to the values in env
.
sourcepub fn execute<T: Serialize + ?Sized>(
&mut self,
msg: &T,
env: MockEnv
) -> StdResult<ExecuteResponse>
pub fn execute<T: Serialize + ?Sized>(
&mut self,
msg: &T,
env: MockEnv
) -> StdResult<ExecuteResponse>
Executes the contract with the address provided in env
.
pub fn query<T: Serialize + ?Sized, R: DeserializeOwned>(
&self,
address: impl Into<HumanAddr>,
msg: &T
) -> StdResult<R>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ContractEnsemble
impl !Send for ContractEnsemble
impl !Sync for ContractEnsemble
impl Unpin for ContractEnsemble
impl !UnwindSafe for ContractEnsemble
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more