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

Feature-gates in pattern matching of CosmWasm 2.0 Enum Variants #170

Merged
merged 1 commit into from
May 23, 2024

Conversation

AmitPr
Copy link
Contributor

@AmitPr AmitPr commented May 18, 2024

With the cosmwasm_2_0 default feature disabled, compilation of cw-multi-test fails with an error along the lines of the below:

error[E0599]: no variant or associated item named `Any` found for enum `CosmosMsg` in the current scope
   --> /cw-multi-test-2.0.1/src/app.rs:666:24
    |
666 |             CosmosMsg::Any(msg) => self
    |                        ^^^ variant or associated item not found in `CosmosMsg<_>`

error[E0599]: no variant or associated item named `Grpc` found for enum `QueryRequest` in the current scope
   --> /cw-multi-test-2.0.1/src/app.rs:694:27
    |
694 |             QueryRequest::Grpc(req) => self.stargate.query_grpc(api, storage, &querier, block, req),
    |                           ^^^^ variant or associated item not found in `QueryRequest<_>`

This PR feature gates these enums to allow compilation to succeed when the cosmwasm_2_0 feature is disabled.

@AmitPr AmitPr changed the title Feature-gates in pattern mathing of CosmWasm 2.0 Enum Variants Feature-gates in pattern matching of CosmWasm 2.0 Enum Variants May 18, 2024
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a CI job that would catch this (cargo build --no-default-features and cargo test --no-default-features). There are a few more to be cleaned up.

@DariuszDepta DariuszDepta marked this pull request as draft May 22, 2024 07:56
@DariuszDepta DariuszDepta marked this pull request as ready for review May 22, 2024 07:58
@DariuszDepta DariuszDepta added this to the 2.1.0 milestone May 23, 2024
@DariuszDepta DariuszDepta self-assigned this May 23, 2024
@DariuszDepta DariuszDepta merged commit 364fd51 into CosmWasm:main May 23, 2024
7 checks passed
@DariuszDepta DariuszDepta assigned AmitPr and unassigned DariuszDepta Jun 28, 2024
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 this pull request may close these issues.

3 participants