Skip to content

Commit

Permalink
simple code 0 check
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed May 4, 2022
1 parent 531fc64 commit b7b76c7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/osmosis-labs/osmosis/v7/tests/e2e/util"
)

func (s *IntegrationTestSuite) TestAIBCTokenTransfer() {
func (s *IntegrationTestSuite) Test1IBCTokenTransfer() {
var ibcStakeDenom string

s.Run("send_uosmo_to_chainB", func() {
Expand Down Expand Up @@ -52,7 +52,7 @@ func (s *IntegrationTestSuite) TestAIBCTokenTransfer() {
})
}

func (s *IntegrationTestSuite) TestBQueryBalances() {
func (s *IntegrationTestSuite) Test2QueryBalances() {
var (
expectedDenomsA = []string{chain.OsmoDenom, chain.StakeDenom}
expectedDenomsB = []string{chain.OsmoDenom, chain.StakeDenom, chain.IbcDenom}
Expand Down
19 changes: 17 additions & 2 deletions tests/e2e/e2e_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"strings"
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -121,7 +122,7 @@ func (s *IntegrationTestSuite) submitProposal(c *chain.Chain) {
Container: s.valResources[c.ChainMeta.Id][0].Container.ID,
User: "root",
Cmd: []string{
"osmosisd", "tx", "gov", "submit-proposal", "software-upgrade", "v8", "--title=\"v8 upgrade\"", "--description=\"v8 upgrade proposal\"", "--upgrade-height=75", "--upgrade-info=\"\"", fmt.Sprintf("--chain-id=%s", c.ChainMeta.Id), "--from=val", "-b=block", "--yes", "--keyring-backend=test",
"osmosisd", "tx", "gov", "submit-proposal", "software-upgrade", "v8", "--title=\"v8 upgrade\"", "--description=\"v8 upgrade proposal\"", "--upgrade-height=75", "--upgrade-info=\"\"", fmt.Sprintf("--chain-id=%s", c.ChainMeta.Id), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json",
},
})
s.Require().NoError(err)
Expand All @@ -143,8 +144,12 @@ func (s *IntegrationTestSuite) submitProposal(c *chain.Chain) {
"failed to submit proposal; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(),
)

s.T().Log("successfully submitted proposal")
s.Require().Truef(
strings.Contains(outBuf.String(), "code: 0"),
"tx returned non code 0",
)

s.T().Log("successfully submitted proposal")
}

func (s *IntegrationTestSuite) depositProposal(c *chain.Chain) {
Expand Down Expand Up @@ -181,6 +186,11 @@ func (s *IntegrationTestSuite) depositProposal(c *chain.Chain) {
"failed to deposit to upgrade proposal; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(),
)

s.Require().Truef(
strings.Contains(outBuf.String(), "code: 0"),
"tx returned non code 0",
)

s.T().Log("successfully deposited to proposal")

}
Expand Down Expand Up @@ -219,6 +229,11 @@ func (s *IntegrationTestSuite) voteProposal(c *chain.Chain) {
"failed to vote for proposal; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(),
)

s.Require().Truef(
strings.Contains(outBuf.String(), "code: 0"),
"tx returned non code 0",
)

s.T().Log("successfully voted for proposal")

}
Expand Down

0 comments on commit b7b76c7

Please sign in to comment.