/
test_helpers.go
42 lines (32 loc) · 1.27 KB
/
test_helpers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package testutil
import (
"fmt"
"github.com/tendermint/tendermint/libs/cli"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/testutil"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
guardiancli "github.com/nimrostafarian/gridfury/modules/guardian/client/cli"
)
// MsgRedelegateExec creates a redelegate message.
func CreateSuperExec(clientCtx client.Context, from string, extraArgs ...string) (testutil.BufferWriter, error) {
args := []string{
fmt.Sprintf("--%s=%s", flags.FlagFrom, from),
}
args = append(args, extraArgs...)
return clitestutil.ExecTestCLICmd(clientCtx, guardiancli.GetCmdCreateSuper(), args)
}
func DeleteSuperExec(clientCtx client.Context, from string, extraArgs ...string) (testutil.BufferWriter, error) {
args := []string{
fmt.Sprintf("--%s=%s", flags.FlagFrom, from),
}
args = append(args, extraArgs...)
return clitestutil.ExecTestCLICmd(clientCtx, guardiancli.GetCmdDeleteSuper(), args)
}
func QuerySupersExec(clientCtx client.Context, extraArgs ...string) (testutil.BufferWriter, error) {
args := []string{
fmt.Sprintf("--%s=json", cli.OutputFlag),
}
args = append(args, extraArgs...)
return clitestutil.ExecTestCLICmd(clientCtx, guardiancli.GetCmdQuerySupers(), args)
}