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

Bump seq in ibctests for failed messages as well #1464

Merged
merged 3 commits into from
Jun 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions x/wasm/ibctesting/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*sdk.Result, error) {
// ensure the chain has the latest time
chain.Coordinator.UpdateTimeForChain(chain)

_, r, err := app.SignAndDeliverWithoutCommit(
_, r, gotErr := app.SignAndDeliverWithoutCommit(
chain.t,
chain.TxConfig,
chain.App.GetBaseApp(),
Expand All @@ -369,21 +369,18 @@ func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*sdk.Result, error) {
[]uint64{chain.SenderAccount.GetSequence()},
chain.SenderPrivKey,
)
if err != nil {
return nil, err
}

// NextBlock calls app.Commit()
chain.NextBlock()

// increment sequence for successful transaction execution
err = chain.SenderAccount.SetSequence(chain.SenderAccount.GetSequence() + 1)
if err != nil {
return nil, err
}

// increment sequence for successful and failed transaction execution
require.NoError(chain.t, chain.SenderAccount.SetSequence(chain.SenderAccount.GetSequence()+1))
chain.Coordinator.IncrementTime()

if gotErr != nil {
return nil, gotErr
}

chain.CaptureIBCEvents(r)

return r, nil
Expand Down