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

Add Any message with blanket implementation #1926

Merged
merged 6 commits into from
Nov 16, 2023
Merged

Add Any message with blanket implementation #1926

merged 6 commits into from
Nov 16, 2023

Conversation

webmaster128
Copy link
Member

@webmaster128 webmaster128 commented Oct 18, 2023

Closes #1924

@chipshort
Copy link
Collaborator

I removed the Stargate variant here, since Any will take over that role and 2.0 is our chance to do these kinds of breaking changes. I also added a changelog and migrating entry.
One thing I am wondering about atm: We could add a #[serde(rename = "stargate")] here. That way the json representation will become the same as the previous Stargate message and no changes to wasmd would be needed (otherwise wasmd would have to support both anyways for backwards compatibility).

@webmaster128
Copy link
Member Author

One thing I am wondering about atm: We could add a #[serde(rename = "stargate")] here. That way the json representation will become the same as the previous Stargate message and no changes to wasmd would be needed (otherwise wasmd would have to support both anyways for backwards compatibility).

I tend to agree. But can we move this consolidation to the wasmvm codebase somehow? I.e. deserialize "any" and "stargate" into a single field in the struct? This would create a cleaner JSON interface for a future where we have different host environments.

@chipshort
Copy link
Collaborator

I agree, that would be even better. It can be done, but I think only with a custom unmarshalling function in wasmvm (or by having both fields, but that seems a bit ugly). I'll prepare a PR

Copy link
Member Author

@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.

I think this is ready assuming we solve the "stargate"/"any" cases ion the Go side

@chipshort
Copy link
Collaborator

Yes, this is ready. "stargate" / "any" handling is also ready in CosmWasm/wasmvm#468

@webmaster128 webmaster128 merged commit 8a652d7 into main Nov 16, 2023
5 checks passed
@webmaster128 webmaster128 deleted the try-IntoAny branch November 16, 2023 09:46
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.

Remove CosmosMsg::Stargate, add CosmosMsg::Any
2 participants