pub struct Contract<Chain: CwEnv> {
pub id: String,
/* private fields */
}
Expand description
An instance of a contract. Contains references to the execution environment (chain) and a local state (state) The state is used to store contract addresses/code-ids
Fields§
§id: String
ID of the contract, used to retrieve addr/code-id
Implementations§
source§impl<Chain: CwEnv + Clone> Contract<Chain>
impl<Chain: CwEnv + Clone> Contract<Chain>
Expose chain and state function to call them on the contract
pub fn new(id: impl ToString, chain: Chain) -> Self
sourcepub fn get_chain(&self) -> &Chain
pub fn get_chain(&self) -> &Chain
get_chain
instead of chain
to disambiguate from the std prelude .chain() method.
pub fn with_wasm_path(self, path: impl ToString) -> Self
pub fn with_mock( self, mock_contract: Box<dyn TestContract<Empty, Empty>> ) -> Self
pub fn set_mock(&mut self, mock_contract: Box<dyn TestContract<Empty, Empty>>)
sourcepub fn with_address(self, address: Option<&Addr>) -> Self
pub fn with_address(self, address: Option<&Addr>) -> Self
Sets the address of the contract in the local state