Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generics support for QueryResponses derive macro #1516

Closed
CyberHoward opened this issue Nov 27, 2022 · 1 comment · Fixed by #1520
Closed

Generics support for QueryResponses derive macro #1516

CyberHoward opened this issue Nov 27, 2022 · 1 comment · Fixed by #1520
Milestone

Comments

@CyberHoward
Copy link

Currently the use of generics in query endpoint messages are not supported by the #[derive(QueryResponses)] macro.
By supporting generics in QueryMsg definitions developers can more easily modularise their smart-contracts.

Example:

#[cosmwasm_schema::cw_serde]
#[derive(QueryResponses)]
#[query_responses(nested)]
pub enum QueryMsg<BaseMsg, AppMsg = Empty> {
    /// A configuration message to a base implementation.
    Base(BaseMsg),
    /// Custom query
    App(AppMsg),
}
@uint
Copy link
Contributor

uint commented Nov 28, 2022

I just checked and yeah, generics work for QueryMsg generally, but not when the QueryMsg is nested. Looking into it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants