Skip to content

Commit

Permalink
check revert reason smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Nov 3, 2023
1 parent 9a7a781 commit 0b2f828
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/localnet/orchestrator/smoketest/test_deposit_eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"math/big"
"strings"
"time"

"cosmossdk.io/math"
Expand Down Expand Up @@ -281,6 +282,12 @@ func (sm *SmokeTest) TestEtherDepositAndCall() {
panic(fmt.Sprintf("expected cctx status to be reverted; got %s", cctx.CctxStatus.Status))
}
fmt.Println("Cross-chain call to reverter reverted")

// check the status message contains revert error hash in case of revert
// 0xbfb4ebcf is the hash of "Foo()"
if !strings.Contains(cctx.CctxStatus.StatusMessage, "reason: 0xbfb4ebcf") {
panic(fmt.Sprintf("expected cctx status message to contain revert reason; got %s", cctx.CctxStatus.StatusMessage))
}
}

func (sm *SmokeTest) TestDepositAndCallRefund() {
Expand Down

0 comments on commit 0b2f828

Please sign in to comment.