Merged
Conversation
2874128 to
5fe7be4
Compare
Contributor
Author
|
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
Contributor
Author
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handle most of the memory items needed (with
CellandBox<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 inRouteras theQuerier, which is also the execution environment of the contract itself, is impossible.I basically need
&RouterandRouterat once! If we could loosenExternto only require&Querierrather 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
cosmwasmto 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.