Trait cw_orch_core::environment::TxHandler
source · pub trait TxHandler: ChainState + Clone {
type Response: IndexResponse + Debug + Send + Clone;
type Error: Into<CwEnvError> + Debug + Error + Send + Sync + 'static;
type ContractSource;
type Sender: Clone;
// Required methods
fn sender(&self) -> Addr;
fn set_sender(&mut self, sender: Self::Sender);
fn upload<T: Uploadable>(
&self,
contract_source: &T
) -> Result<Self::Response, Self::Error>;
fn instantiate<I: Serialize + Debug>(
&self,
code_id: u64,
init_msg: &I,
label: Option<&str>,
admin: Option<&Addr>,
coins: &[Coin]
) -> Result<Self::Response, Self::Error>;
fn instantiate2<I: Serialize + Debug>(
&self,
code_id: u64,
init_msg: &I,
label: Option<&str>,
admin: Option<&Addr>,
coins: &[Coin],
salt: Binary
) -> Result<Self::Response, Self::Error>;
fn execute<E: Serialize + Debug>(
&self,
exec_msg: &E,
coins: &[Coin],
contract_address: &Addr
) -> Result<Self::Response, Self::Error>;
fn migrate<M: Serialize + Debug>(
&self,
migrate_msg: &M,
new_code_id: u64,
contract_address: &Addr
) -> Result<Self::Response, Self::Error>;
// Provided method
fn call_as(&self, sender: &<Self as TxHandler>::Sender) -> Self { ... }
}
Expand description
Signer trait for chains. Accesses the sender information from the chain object to perform actions.
Required Associated Types§
sourcetype Response: IndexResponse + Debug + Send + Clone
type Response: IndexResponse + Debug + Send + Clone
Response type for transactions on an environment.
sourcetype Error: Into<CwEnvError> + Debug + Error + Send + Sync + 'static
type Error: Into<CwEnvError> + Debug + Error + Send + Sync + 'static
Error type for transactions on an environment.
sourcetype ContractSource
type ContractSource
Source type for uploading to the environment.
type Sender: Clone
Required Methods§
sourcefn set_sender(&mut self, sender: Self::Sender)
fn set_sender(&mut self, sender: Self::Sender)
Sets wallet to sign transactions.
sourcefn upload<T: Uploadable>(
&self,
contract_source: &T
) -> Result<Self::Response, Self::Error>
fn upload<T: Uploadable>( &self, contract_source: &T ) -> Result<Self::Response, Self::Error>
Uploads a contract to the chain.
sourcefn instantiate<I: Serialize + Debug>(
&self,
code_id: u64,
init_msg: &I,
label: Option<&str>,
admin: Option<&Addr>,
coins: &[Coin]
) -> Result<Self::Response, Self::Error>
fn instantiate<I: Serialize + Debug>( &self, code_id: u64, init_msg: &I, label: Option<&str>, admin: Option<&Addr>, coins: &[Coin] ) -> Result<Self::Response, Self::Error>
Send a InstantiateMsg to a contract.
sourcefn instantiate2<I: Serialize + Debug>(
&self,
code_id: u64,
init_msg: &I,
label: Option<&str>,
admin: Option<&Addr>,
coins: &[Coin],
salt: Binary
) -> Result<Self::Response, Self::Error>
fn instantiate2<I: Serialize + Debug>( &self, code_id: u64, init_msg: &I, label: Option<&str>, admin: Option<&Addr>, coins: &[Coin], salt: Binary ) -> Result<Self::Response, Self::Error>
Send a Instantiate2Msg to a contract.
Provided Methods§
Object Safety§
This trait is not object safe.