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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user