Skip to content

Commit

Permalink
Improve error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed May 8, 2024
1 parent ecfbbbc commit ccd7ca2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/mbt/driver/mbt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ func UpdateProviderClientOnConsumer(t *testing.T, driver *Driver, consumerChainI
t.Helper()
driver.path(ChainId(consumerChainId)).AddClientHeader(PROVIDER, driver.providerHeader())
err := driver.path(ChainId(consumerChainId)).UpdateClient(consumerChainId, false)
require.True(t, err == nil, "Error updating client from %v on provider: %v", consumerChainId, err)
require.True(t, err == nil, "Error updating client from %v on consumer: %v", consumerChainId, err)
}

func UpdateConsumerClientOnProvider(t *testing.T, driver *Driver, consumerChain string) {
Expand Down
8 changes: 7 additions & 1 deletion testutil/simibc/relay_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func UpdateReceiverClient(sender, receiver *ibctesting.Endpoint, header *ibctmty
return err
}

_, err = simapp.SignAndDeliver(
res, err := simapp.SignAndDeliver(
receiver.Chain.TB,
receiver.Chain.TxConfig,
receiver.Chain.App.GetBaseApp(),
Expand All @@ -52,6 +52,12 @@ func UpdateReceiverClient(sender, receiver *ibctesting.Endpoint, header *ibctmty
receiver.Chain.SenderPrivKey,
)

for _, txRes := range res.TxResults {
if txRes.Code != 0 {
return fmt.Errorf("tx failed with code %d, tx result: %s", txRes.Code, txRes)
}
}

setSequenceErr := receiver.Chain.SenderAccount.SetSequence(receiver.Chain.SenderAccount.GetSequence() + 1)
if err != nil {
return err
Expand Down

0 comments on commit ccd7ca2

Please sign in to comment.