From 448cc643d8433d974351c43d307d20cf5fedb1a6 Mon Sep 17 00:00:00 2001 From: Alexander Peters Date: Thu, 29 Jun 2023 10:59:48 +0200 Subject: [PATCH] Bump seq in ibctests for failed messages as well (#1464) * Bump seq in ibctests for failed messages as well * Increase wait time for system tests * Revert "Increase wait time for system tests" This reverts commit 1b233bc30b270b031237d9a4a71b074211faf565. --- x/wasm/ibctesting/chain.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/x/wasm/ibctesting/chain.go b/x/wasm/ibctesting/chain.go index cfa540ce..f12ffb3c 100644 --- a/x/wasm/ibctesting/chain.go +++ b/x/wasm/ibctesting/chain.go @@ -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(), @@ -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