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

Workaround to enable communication between Empty and Custom contracts in mt #189

Merged
merged 6 commits into from
May 13, 2024

Conversation

jawoznia
Copy link
Contributor

I didn't push to sylvia-upgrade as there is still an issue while running virtual-staking tests.

You can play with this approach. I think this might be the least impact workaround for custom<->empty interoperability in tests.

@jawoznia jawoznia requested a review from ethanfrey May 10, 2024 19:36
@ethanfrey ethanfrey force-pushed the sylvia-upgrade-custom-empty branch from d0b6a22 to 4938265 Compare May 13, 2024 14:29
Copy link
Collaborator

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Great idea from Jan on how to get this to play together well given the current state of sylvia and cw-multi-test.

Great job to me for getting all the details to work :)

@@ -22,6 +24,16 @@ pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

const REPLY_ID_INSTANTIATE: u64 = 1;

#[cfg(not(any(test, feature = "mt")))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah very clever... so we make it ask like it uses all these custom messages for test code only

It seems a bit risky (if we actually start using those types, test will pass but production will fail), but for this case, a pretty clean workaround

Copy link
Collaborator

Choose a reason for hiding this comment

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

I made this a much more explicit fake-custom flag and did some more plumbing (with associated types on the various traits), but this is a great idea to allow the contracts to play well in the test code without all kinds of nastiness when using them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nicely done Ethan ;) Happy to help!

@ethanfrey ethanfrey merged commit 19e50b2 into sylvia-upgrade May 13, 2024
2 checks passed
@ethanfrey ethanfrey deleted the sylvia-upgrade-custom-empty branch May 13, 2024 14:49
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