Skip to content
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

Functionality test that all transactions on the remote chain roll back if a single one fails #2

Open
0xekez opened this issue Mar 21, 2023 · 1 comment
Labels

Comments

@0xekez
Copy link
Contributor

0xekez commented Mar 21, 2023

When submitting a Vec<CosmosMsg> for execution on a remote chain, if any of those messages fail:

  1. An error should be returned containing the error for the first message to fail.
  2. State changes for all of the other messages should be rolled back.

To do this, I recommend sending a message in the form [hello {}, bank_send {}], where the first call to hello is on the tester contract, and the second sends more tokens than the proxy owns. Execution for the first message should not add a sender (as added in #1), and the callback should return an error about the bank module.

@0xekez
Copy link
Contributor Author

0xekez commented Mar 24, 2023

// If multiple messages are executed, a single one failing should roll
// back all the other messages. This executes three messages:
// ```[good, error1, error2]```
// Good causes a state change. The expected behavior is that an error
// callback is returned containing error1, and the state change is not
// applied.
func TestRollback(t *testing.T) {
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant