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

please bring back parse_reply_instantiate_data #39

Open
PFC-developer opened this issue Apr 16, 2024 · 3 comments
Open

please bring back parse_reply_instantiate_data #39

PFC-developer opened this issue Apr 16, 2024 · 3 comments

Comments

@PFC-developer
Copy link

hi.

somewhere along the way this function disappeared.
sadly the cw_nft's use this, and it makes it challenging to migrate to v2.0.0 there.

Thanks!

@hashedone
Copy link
Contributor

hashedone commented Apr 16, 2024

To parse the instantiate data, you should use https://docs.rs/cw-utils/latest/cw_utils/fn.parse_instantiate_response_data.html.
Previously, data in Reply was always found in the SubMsgResponse::data, and only single data was accessible. Now it is possible to collect data from deeper sub-calls, and it is not clear which data should be passed - the SubMsgResponse::data is deprecated, and the proper one from msg_responses should be used, unless working on pre-2.0 chain in which case you should pass the deprecated field until chain updates to 2.0.

@PFC-developer
Copy link
Author

possibly.. but shouldn't you have waited a bit and marked it as deprecated first?
(and yes. I'm working with pre-2.0 chains)

@kulikthebird
Copy link
Contributor

Making the parse_reply_instantiate_data deprecated in cw-utils v2.0 instead of removing it would result in bugs. As @hashedone mentioned, since CosmWasm v2.0 there can be more than one response in the data field and parsing that with the removed method would occasionally return error.

The pub data: Option<Binary> field couldn't be marked as deprecated in CW v1.5.3 because there were no pub msg_responses: Vec<MsgResponse> back then. Therefore, the removed method couldn't be deprecated in the pre2.0 cw-utils version as well.

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

No branches or pull requests

3 participants