-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update to cw-plus 0.12.1 #103
Conversation
Use type safe / validated bound for `Member` start_after
6eb4efb
to
662f08b
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.
lgtm
I wonder if those inserted implementations of mock_dependencies()
can be handled somehow better. Could cosmwasm_std
part be extended with CustomQuery
?
Very interesting idea. However, I think we cannot just do it on
Yes, we should make multitest allow arbitrary contracts to easily plug in. |
I have no time to review this. But can you make a tracking issue for the multitest changes, and link this and anything else. And mention me in it? So I have an overview of all that is needed to fix this up |
Extending |
Good point. I hadn't thought of that :-) |
On second thought, why not? Instead of having #[cfg_attr(not(feature = "library"), entry_point)]
pub fn instantiate(
mut deps: DepsMut<TgradeQuery>, we have something like #[cfg_attr(not(feature = "library"), entry_point(TgradeQuery)]
pub fn instantiate<Q: CustomQuery>(
mut deps: DepsMut<Q>, instead. And we modify the That means that, in test code we would be able to call both Am I missing something? Of course, writing a procedural macro like this is relatively non-trivial, as the |
Tracking issue: CosmWasm/cw-multi-test#2 |
Closes CosmWasm/cw-plus#90.
This ended being more work than anticipated, because of the extensive
CustomQuery
param changes. This is required by a bound onTgradeApp
, part of tgrade multi-test. @hashedone and @uint , please take a look, as I'm not sure there's a simpler approach here.On the other hand, this is already done. So, we can in the end benefit from this early introduction of
CustomQuery
everywhere.Creating as Draft to prevent / delay merge after 0.6.0 is released.(done)Update:
CustomQuery
type parameter. Specifying it asTgradeQuery
only when needed (i.e. in entry points). That way, unit tests can still call functions usingEmpty
for simplicity. There exists the possibility to extending this generality to entry points as well. Basically, by extending ourentry_point
procedural macro to accept a query parameter, and doing the renaming for us. This would allow calling the entry points usingEmpty
as query type. Will create an issue to explore / document this approach.TgradeApp
must now (since cw-plus 0.12.1) useTgradeQuery
. I'm a little worried that our (multi-) test environment is putting requirements on our contracts API. It is supposed to be the other way around. But, I don't see an easy way out; at least for for the moment (See Properly handle generic queries in multi-test CosmWasm/cw-plus#660 (comment) and follow-ups).