refactor: x/bank integration and e2e tests (#12779)

* retain x/bank integration tests

* Move bank end to end tests

* refactor: move bank e2e tests and move common code to testutil/cli/cmd.go

* refactor x/bank integration tests to remove simapp dep
This commit is contained in:
Matt Kocubinski
2022-08-02 10:10:31 -05:00
committed by GitHub
parent f002e54d26
commit 0f7e56c6f9
13 changed files with 1791 additions and 104 deletions
+17
View File
@@ -2,11 +2,14 @@ package cli
import (
"context"
"fmt"
"github.com/spf13/cobra"
cli2 "github.com/tendermint/tendermint/libs/cli"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/testutil"
"github.com/cosmos/cosmos-sdk/x/bank/client/cli"
)
// ExecTestCLICmd builds the client context, mocks the output and executes the command.
@@ -25,3 +28,17 @@ func ExecTestCLICmd(clientCtx client.Context, cmd *cobra.Command, extraArgs []st
return out, nil
}
func MsgSendExec(clientCtx client.Context, from, to, amount fmt.Stringer, extraArgs ...string) (testutil.BufferWriter, error) {
args := []string{from.String(), to.String(), amount.String()}
args = append(args, extraArgs...)
return ExecTestCLICmd(clientCtx, cli.NewSendTxCmd(), args)
}
func QueryBalancesExec(clientCtx client.Context, address fmt.Stringer, extraArgs ...string) (testutil.BufferWriter, error) {
args := []string{address.String(), fmt.Sprintf("--%s=json", cli2.OutputFlag)}
args = append(args, extraArgs...)
return ExecTestCLICmd(clientCtx, cli.GetBalancesCmd(), args)
}