-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
d0b6a22
to
4938265
Compare
There was a problem hiding this 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")))] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
I didn't push to
sylvia-upgrade
as there is still an issue while runningvirtual-staking
tests.You can play with this approach. I think this might be the least impact workaround for custom<->empty interoperability in tests.