Skip to content

Commit

Permalink
refactor(distribution): CLI tests using Tendermint Mock (#13692)
Browse files Browse the repository at this point in the history
* move distribution cli tests to e2e tests

* wip: add cli tests

* wip: remove duplicate helpers.go file

* fix something

Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
  • Loading branch information
4 people authored Nov 3, 2022
1 parent 0e421d8 commit 155bcfa
Show file tree
Hide file tree
Showing 5 changed files with 718 additions and 9 deletions.
8 changes: 3 additions & 5 deletions tests/e2e/distribution/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ import (
"testing"

"github.com/stretchr/testify/suite"

"github.com/cosmos/cosmos-sdk/x/distribution/client/testutil"
)

func TestIntegrationTestSuite(t *testing.T) {
suite.Run(t, new(testutil.IntegrationTestSuite))
suite.Run(t, new(IntegrationTestSuite))
}

func TestGRPCQueryTestSuite(t *testing.T) {
suite.Run(t, new(testutil.GRPCQueryTestSuite))
suite.Run(t, new(GRPCQueryTestSuite))
}

func TestWithdrawAllSuite(t *testing.T) {
suite.Run(t, new(testutil.WithdrawAllTestSuite))
suite.Run(t, new(WithdrawAllTestSuite))
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package testutil
package distribution

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package testutil
package distribution

import (
"encoding/hex"
Expand All @@ -16,6 +16,7 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/distribution/client/cli"
distrclitestutil "github.com/cosmos/cosmos-sdk/x/distribution/client/testutil"
"github.com/cosmos/cosmos-sdk/x/distribution/testutil"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
Expand Down Expand Up @@ -557,7 +558,7 @@ func (s *IntegrationTestSuite) TestNewWithdrawRewardsCmd() {
clientCtx := val.ClientCtx

_, _ = s.network.WaitForHeightWithTimeout(10, time.Minute)
bz, err := MsgWithdrawDelegatorRewardExec(clientCtx, tc.valAddr, tc.args...)
bz, err := distrclitestutil.MsgWithdrawDelegatorRewardExec(clientCtx, tc.valAddr, tc.args...)
if tc.expectErr {
s.Require().Error(err)
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package testutil
package distribution

import (
"fmt"
Expand Down
Loading

0 comments on commit 155bcfa

Please sign in to comment.