Skip to content

Fix instaniate reply data#517

Merged
ethanfrey merged 8 commits intomainfrom
516-demo-reply-errors
Oct 28, 2021
Merged

Fix instaniate reply data#517
ethanfrey merged 8 commits intomainfrom
516-demo-reply-errors

Conversation

@ethanfrey
Copy link
Copy Markdown
Contributor

@ethanfrey ethanfrey commented Oct 27, 2021

Par one of #516

This properly handles the instantiate wrapping, even when they set data in reply.

I started working on the envelope for WasmMsg::Execute and WasmMsg::Migrate, but that broke quite some tests. Let's merge this first (as it caused issues testing some PRs) and then do the exec ones in a follow up PR.

@ethanfrey ethanfrey force-pushed the 516-demo-reply-errors branch from 8ef0e6d to 8c09265 Compare October 28, 2021 10:21
@ethanfrey ethanfrey changed the title Demo reply errors Fix instaniate reply data Oct 28, 2021
Copy link
Copy Markdown
Contributor

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

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

I don't understand the main changes, in the sequence of operations; approving on your behalf.

let parsed = parse_instantiate_response_data(res.data.unwrap().as_slice()).unwrap();
assert!(parsed.data.is_some());
// from the reply, not the top level
assert_eq!(parsed.data.unwrap(), Binary::from(b"babble"));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious, what about the top level data?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The contract returned "remove-me" on the message, it was overwritten with "babble" via the reply.

This is what I wanted to test. I guess the comment could be improved

@maurolacy maurolacy force-pushed the 516-demo-reply-errors branch from 8c09265 to 7b3b1cf Compare October 28, 2021 13:53
@ethanfrey ethanfrey merged commit 9a4d36d into main Oct 28, 2021
@ethanfrey ethanfrey deleted the 516-demo-reply-errors branch October 28, 2021 14:13
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.

2 participants