Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server/v2): add SimulateWithState to AppManager
There is already the QueryWithState method to query against a modified state, but the Simulate analog was missing. This is useful in particular when a server component receives different transactions at different times, and wants to ensure that subsequent transactions would be valid to apply after the prior transactions. In other words, the first received transaction can be validated with Simulate; then the returned corestore.WriterMap is used to seed the input to the following call to SimulateWithState; and then the returned corestore.WriterMap is used for all following SimulateWithState calls. While it is currently impossible for SimulateWithState to return an error, an error value is in the return signature for symmetry with other AppManager methods and to allow the possibility of returned errors in the future. There were no existing tests in the server/v2/appmanager package, to be expanded to include test coverage for the new method.
- Loading branch information