pub trait Contract<T, Q = Empty>where
T: CustomMsg + DeserializeOwned + Clone + Debug + PartialEq + JsonSchema,
Q: CustomQuery + DeserializeOwned,{
// Required methods
fn execute(
&self,
deps: DepsMut<'_, Q>,
env: Env,
info: MessageInfo,
msg: Vec<u8>,
fork_state: ForkState<T, Q>,
) -> AnyResult<Response<T>>;
fn instantiate(
&self,
deps: DepsMut<'_, Q>,
env: Env,
info: MessageInfo,
msg: Vec<u8>,
fork_state: ForkState<T, Q>,
) -> AnyResult<Response<T>>;
fn query(
&self,
deps: Deps<'_, Q>,
env: Env,
msg: Vec<u8>,
fork_state: ForkState<T, Q>,
) -> AnyResult<Binary>;
fn sudo(
&self,
deps: DepsMut<'_, Q>,
env: Env,
msg: Vec<u8>,
fork_state: ForkState<T, Q>,
) -> AnyResult<Response<T>>;
fn reply(
&self,
deps: DepsMut<'_, Q>,
env: Env,
msg: Reply,
fork_state: ForkState<T, Q>,
) -> AnyResult<Response<T>>;
fn migrate(
&self,
deps: DepsMut<'_, Q>,
env: Env,
msg: Vec<u8>,
fork_state: ForkState<T, Q>,
) -> AnyResult<Response<T>>;
// Provided method
fn checksum(&self) -> Option<Checksum> { ... }
}Expand description
Interface to call into a Contract.