-
Notifications
You must be signed in to change notification settings - Fork 355
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
Properly handle generic queries in multi-test #660
Conversation
@maurolacy this is a start. Maybe you can try this in your tfi branch |
Will give it a try tomorrow. Ended up avoiding the need for this by removing the custom message from |
Trying this, but needs to do an upgrade of dependencies / patches locally to properly assess it works. That said, I think this is a good idea, and we should merge this, after confirming it works, or making the needed changes. |
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.
LGTM
I think this is a way to go.
I only wonder, is this change breaking? From generic type to concrete (Empty
) one?
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.
Seems good enough!
In theory, but everyone using Maybe we can add two extra functions for those two (less likely cases). I am sure they will pop up eventually |
Tried this finally, after setting up the local env properly. For the specific use case of the The only missing piece seems to be that there are some queries to That is failing with the expected
So, it seems that we still need a helper for "downcasting" from Anyway: I have a strong feeling that the message type (custom or empty) should be orthogonal to the multi-test blockchain / app. And that we are running into all these clashes, in the end, because it isn't. It would be good to fix this for good, as these "mixed" or heterogeneous setups will become more and more common, the more and more contracts we have around. |
It would be much easier if they were. But I think they cannot be. Basically, we need to ensure the Response returned is a subset of the possible responses managed by the app. The other option is just use |
Can you make a PR to the case you mention that almost works and I will look into it? |
I would like to:
|
There you go: confio/tfi#68 |
Can't we define the message type at the calls / It's a matter of decoupling the message type from the app. I understand it will require some major overhauling, though. |
The issue is the App has a custom module (not contract) that can handle custom messages C and queries Q. The contracts must all return C or Empty so they can be dispatched. |
I see. Some thoughts or ideas that come to mind:
These are just off the top of my head. I'm not sure how relevant / practical / possible / sensible they are. |
Make ContractWrapper::new_with_empty convert Deps to Deps