Skip to content

Commit

Permalink
update json to const
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Jan 31, 2024
1 parent 0fd8103 commit 1ff7d68
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions tests/e2e/auth/vesting/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli"
)

const periods = `{
"start_time": 1625204910,
"periods": [
{
"coins": "10stake",
"length": 2592000
},
{
"coins": "10stake",
"length":2592000
}
]
}`

type E2ETestSuite struct {
suite.Suite

Expand Down Expand Up @@ -234,8 +248,8 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
args: []string{
sdk.AccAddress("addr10______________").String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, periods),
fmt.Sprintf("--%s=%s", cli.FlagVesting, periods),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand All @@ -249,7 +263,7 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
args: []string{
sdk.AccAddress("addr11______________").String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, periods),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand All @@ -263,7 +277,7 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
args: []string{
sdk.AccAddress("addr12______________").String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, periods),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand All @@ -277,8 +291,8 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
args: []string{
sdk.AccAddress("addr10______________").String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, periods),
fmt.Sprintf("--%s=%s", cli.FlagVesting, periods),
fmt.Sprintf("--%s=%s", cli.FlagMerge, "true"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
Expand Down Expand Up @@ -375,8 +389,8 @@ func (s *E2ETestSuite) TestNewMsgClawbackCmd() {
_, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cli.NewMsgCreateClawbackVestingAccountCmd(), []string{
addr.String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, periods),
fmt.Sprintf("--%s=%s", cli.FlagVesting, periods),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand Down

0 comments on commit 1ff7d68

Please sign in to comment.