-
Notifications
You must be signed in to change notification settings - Fork 353
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
Sketch integration test framework #130
Conversation
2874128
to
5fe7be4
Compare
Code is (almost) all implemented as I envisioned it. A number of TODOs and of course this needs tests with real contracts, but the Rust compiler is happy with the lifetimes here. There is one obvious issue about a contract querying it's own address in handle, which leads to a runtime error. I can add tests to trigger with mock contracts and look at handling that better, but let's discuss this on a call Wednesday first. |
205b63b
to
8f6c496
Compare
Handle most of the memory items needed (with
Cell
andBox<dyn Trait>
). However, I hit an issue trying to construct theExtern
. Ideally we would only need&mut Storage
, so I could useRefCell
, but that is acceptable. However, passing inRouter
as theQuerier
, which is also the execution environment of the contract itself, is impossible.I basically need
&Router
andRouter
at once! If we could loosenExtern
to only require&Querier
rather thanQuerier
(which is all it actually uses), then this would be much easier to implement in Rust.Raised issue CosmWasm/cosmwasm#584 (and maybe this code belongs in
cosmwasm
to iterate closer with the APIs)Update: With the 0.12 cosmwasm API this works quite well. More or less code-complete, including bank.
Done:
This rollback on error is a bit trickier than I thought... it affects cases where one step succeeds (and writes) and a sub-message fails. Maybe I merge this first, then do another PR for that.