Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

QueryResponses full path not used in cosmwasm_schema::generate_api! #1527

Closed
chris-ricketts opened this issue Dec 1, 2022 · 4 comments
Closed

Comments

@chris-ricketts
Copy link
Contributor

The full module path (starting from crate root) is not used when specifying the QueryResponses type in the cosmwasm_schema::generate_api! macro.

This can result in the following error when using it without cosmwasm_schema::write_api!:

error[E0433]: failed to resolve: use of undeclared type `QueryResponses`
  --> contracts/mock-core/mock-core.rs:39:5
   |
39 | /     cosmwasm_schema::generate_api! {
40 | |         instantiate: InstantiateMsg,
41 | |         execute: ExecuteMsg,
42 | |         query: QueryMsg,
43 | |     }
   | |_____^ use of undeclared type `QueryResponses`
   |
   = note: this error originates in the macro `cosmwasm_schema::generate_api` (in Nightly builds, run with -Z macro-backtrace for more inf
o)
@webmaster128
Copy link
Member

Thanks a lot for bringing this up and providing the patch. In #1534 I was able to reproduce the issue in a test case and cherry-picked your patch. I'll release that as part of the next 1.1.x, most likely this week.

@webmaster128
Copy link
Member

Fixed and shipped in 1.1.9

@chris-ricketts
Copy link
Contributor Author

Much appreciated! I'll be sure to add a test case next time to save you the hassle - I wasn't sure whether it was warranted, but it does make sense after looking at the one you added.

@webmaster128
Copy link
Member

I made it a habbit for bugs. Whenever there is a bug, I do not ask how do I fix this? but how was it possible to slip through and how can we ensure this never happens again?. Then the fixing part is usually easy.

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

Successfully merging a pull request may close this issue.

2 participants