Struct cw_multi_test::ContractWrapper [−][src]
pub struct ContractWrapper<T1, T2, T3, E1, E2, E3, C = Empty, T4 = Empty, E4 = Error, E5 = Error, T6 = Empty, E6 = Error> where
T1: DeserializeOwned,
T2: DeserializeOwned,
T3: DeserializeOwned,
T4: DeserializeOwned,
T6: DeserializeOwned,
E1: Display + Debug + Send + Sync + 'static,
E2: Display + Debug + Send + Sync + 'static,
E3: Display + Debug + Send + Sync + 'static,
E4: Display + Debug + Send + Sync + 'static,
E5: Display + Debug + Send + Sync + 'static,
E6: Display + Debug + Send + Sync + 'static,
C: Clone + Debug + PartialEq + JsonSchema, { /* fields omitted */ }
Expand description
Wraps the exported functions from a contract and provides the normalized format Place T4 and E4 at the end, as we just want default placeholders for most contracts that don’t have sudo
Implementations
impl<T1, T2, T3, E1, E2, E3, C> ContractWrapper<T1, T2, T3, E1, E2, E3, C> where
T1: DeserializeOwned + 'static,
T2: DeserializeOwned + 'static,
T3: DeserializeOwned + 'static,
E1: Display + Debug + Send + Sync + 'static,
E2: Display + Debug + Send + Sync + 'static,
E3: Display + Debug + Send + Sync + 'static,
C: Clone + Debug + PartialEq + JsonSchema + 'static,
impl<T1, T2, T3, E1, E2, E3, C> ContractWrapper<T1, T2, T3, E1, E2, E3, C> where
T1: DeserializeOwned + 'static,
T2: DeserializeOwned + 'static,
T3: DeserializeOwned + 'static,
E1: Display + Debug + Send + Sync + 'static,
E2: Display + Debug + Send + Sync + 'static,
E3: Display + Debug + Send + Sync + 'static,
C: Clone + Debug + PartialEq + JsonSchema + 'static,
pub fn new(
execute_fn: fn(deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: T1) -> Result<Response<C>, E1>,
instantiate_fn: fn(deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: T2) -> Result<Response<C>, E2>,
query_fn: fn(deps: Deps<'_>, env: Env, msg: T3) -> Result<Binary, E3>
) -> Self
pub fn new_with_empty(
execute_fn: fn(deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: T1) -> Result<Response<Empty>, E1>,
instantiate_fn: fn(deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: T2) -> Result<Response<Empty>, E2>,
query_fn: fn(deps: Deps<'_>, env: Env, msg: T3) -> Result<Binary, E3>
) -> Self
pub fn new_with_empty(
execute_fn: fn(deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: T1) -> Result<Response<Empty>, E1>,
instantiate_fn: fn(deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: T2) -> Result<Response<Empty>, E2>,
query_fn: fn(deps: Deps<'_>, env: Env, msg: T3) -> Result<Binary, E3>
) -> Self
this will take a contract that returns Response
impl<T1, T2, T3, E1, E2, E3, C, T4, E4, E5, T6, E6> ContractWrapper<T1, T2, T3, E1, E2, E3, C, T4, E4, E5, T6, E6> where
T1: DeserializeOwned + 'static,
T2: DeserializeOwned + 'static,
T3: DeserializeOwned + 'static,
T4: DeserializeOwned + 'static,
T6: DeserializeOwned + 'static,
E1: Display + Debug + Send + Sync + 'static,
E2: Display + Debug + Send + Sync + 'static,
E3: Display + Debug + Send + Sync + 'static,
E4: Display + Debug + Send + Sync + 'static,
E5: Display + Debug + Send + Sync + 'static,
E6: Display + Debug + Send + Sync + 'static,
C: Clone + Debug + PartialEq + JsonSchema + 'static,
impl<T1, T2, T3, E1, E2, E3, C, T4, E4, E5, T6, E6> ContractWrapper<T1, T2, T3, E1, E2, E3, C, T4, E4, E5, T6, E6> where
T1: DeserializeOwned + 'static,
T2: DeserializeOwned + 'static,
T3: DeserializeOwned + 'static,
T4: DeserializeOwned + 'static,
T6: DeserializeOwned + 'static,
E1: Display + Debug + Send + Sync + 'static,
E2: Display + Debug + Send + Sync + 'static,
E3: Display + Debug + Send + Sync + 'static,
E4: Display + Debug + Send + Sync + 'static,
E5: Display + Debug + Send + Sync + 'static,
E6: Display + Debug + Send + Sync + 'static,
C: Clone + Debug + PartialEq + JsonSchema + 'static,
pub fn with_sudo<T4A, E4A>(
self,
sudo_fn: fn(deps: DepsMut<'_>, env: Env, msg: T4A) -> Result<Response<C>, E4A>
) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, T4A, E4A, E5, T6, E6> where
T4A: DeserializeOwned + 'static,
E4A: Display + Debug + Send + Sync + 'static,
pub fn with_sudo_empty<T4A, E4A>(
self,
sudo_fn: fn(deps: DepsMut<'_>, env: Env, msg: T4A) -> Result<Response<Empty>, E4A>
) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, T4A, E4A, E5, T6, E6> where
T4A: DeserializeOwned + 'static,
E4A: Display + Debug + Send + Sync + 'static,
pub fn with_reply<E5A>(
self,
reply_fn: fn(deps: DepsMut<'_>, env: Env, msg: Reply) -> Result<Response<C>, E5A>
) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, T4, E4, E5A, T6, E6> where
E5A: Display + Debug + Send + Sync + 'static,
A correlate of new_with_empty