You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use StorageTransaction::new(), a number of places to give us:
ability to revert/commit changes written to a cache
read-only access to an underlying snapshot and write access to a cache, which is needed for wasm execution (at least)
This is also called a number of places. I would simplify this by calling it primarily one place: Router.execute, which works like the "ante handler" transaction wrapper from the SDK. This also means any sub messages from WasmKeeper (which call into that) also are automatically transaction wrapped.
We can provide a helper method to make it cleaner. Something like:
It would wrap the base, return a cache and a read-only reference to base to the closure. Only on Ok, it will commit the cache to base, and it will return the Result from the closure to the caller.
The text was updated successfully, but these errors were encountered:
We use
StorageTransaction::new()
, a number of places to give us:This is also called a number of places. I would simplify this by calling it primarily one place:
Router.execute
, which works like the "ante handler" transaction wrapper from the SDK. This also means any sub messages from WasmKeeper (which call into that) also are automatically transaction wrapped.We can provide a helper method to make it cleaner. Something like:
It would wrap the base, return a cache and a read-only reference to base to the closure. Only on
Ok
, it will commit the cache to base, and it will return the Result from the closure to the caller.The text was updated successfully, but these errors were encountered: