From ace7f134d7858837070d50dd67c0f231087d5379 Mon Sep 17 00:00:00 2001 From: Joe Monem Date: Mon, 18 Mar 2024 16:48:48 +0200 Subject: [PATCH] create AppContractResponse, added AppContract query to andr_query and AndromedaQuery --- packages/std/macros/src/lib.rs | 2 ++ packages/std/src/ado_base/app_contract.rs | 7 +++++++ packages/std/src/ado_base/mod.rs | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 packages/std/src/ado_base/app_contract.rs diff --git a/packages/std/macros/src/lib.rs b/packages/std/macros/src/lib.rs index 7e7bf8d46..884e37bbc 100644 --- a/packages/std/macros/src/lib.rs +++ b/packages/std/macros/src/lib.rs @@ -167,6 +167,8 @@ pub fn andr_query(_metadata: TokenStream, input: TokenStream) -> TokenStream { Type {}, #[returns(andromeda_std::ado_base::kernel_address::KernelAddressResponse)] KernelAddress {}, + #[returns(andromeda_std::ado_base::app_contract::AppContractResponse)] + AppContract {}, #[returns(andromeda_std::ado_base::ownership::PublisherResponse)] OriginalPublisher {}, #[returns(andromeda_std::ado_base::block_height::BlockHeightResponse)] diff --git a/packages/std/src/ado_base/app_contract.rs b/packages/std/src/ado_base/app_contract.rs new file mode 100644 index 000000000..25053dd70 --- /dev/null +++ b/packages/std/src/ado_base/app_contract.rs @@ -0,0 +1,7 @@ +use cosmwasm_schema::cw_serde; +use cosmwasm_std::Addr; + +#[cw_serde] +pub struct AppContractResponse { + pub app_contract: Addr, +} diff --git a/packages/std/src/ado_base/mod.rs b/packages/std/src/ado_base/mod.rs index 995a541b3..42eb6d141 100644 --- a/packages/std/src/ado_base/mod.rs +++ b/packages/std/src/ado_base/mod.rs @@ -1,4 +1,5 @@ pub mod ado_type; +pub mod app_contract; pub mod block_height; #[cfg(any(feature = "module_hooks", feature = "modules"))] pub mod hooks; @@ -70,7 +71,7 @@ pub enum AndromedaQuery { BlockHeightUponCreation {}, #[returns(self::version::VersionResponse)] Version {}, - #[returns(Option<::cosmwasm_std::Addr>)] + #[returns(self::app_contract::AppContractResponse)] AppContract {}, #[cfg(feature = "modules")] #[returns(Module)]