Trait abstract_sdk::ApplicationInterface
source · pub trait ApplicationInterface: Identification + Dependencies {
fn applications<'a>(&'a self, deps: Deps<'a>) -> Applications<'_, Self> { ... }
}Expand description
Interact with other applications on the OS.
Provided Methods§
sourcefn applications<'a>(&'a self, deps: Deps<'a>) -> Applications<'_, Self>
fn applications<'a>(&'a self, deps: Deps<'a>) -> Applications<'_, Self>
Examples found in repository?
src/base/endpoints/ibc_callback.rs (line 17)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
fn handle_ibc_callback(
self,
deps: DepsMut,
env: Env,
info: MessageInfo,
msg: IbcResponseMsg,
) -> Result<Response, Self::Error> {
// Todo: Change to use version control instead?
let ibc_client = self.applications(deps.as_ref()).app_address(IBC_CLIENT)?;
if info.sender.ne(&ibc_client) {
return Err(StdError::GenericErr {
msg: format! {"ibc callback can only be called by local ibc client {}",ibc_client },
}
.into());
}
let IbcResponseMsg { id, msg: ack } = msg;
let maybe_handler = self.maybe_ibc_callback_handler(&id);
maybe_handler.map_or_else(
|| Ok(Response::new()),
|f| f(deps, env, info, self, id, ack),
)
}