From 1ff7d68b7f8092f1dc24b57055b0f5a2b48e1693 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Wed, 31 Jan 2024 13:50:30 -0700 Subject: [PATCH] update json to const --- tests/e2e/auth/vesting/suite.go | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/tests/e2e/auth/vesting/suite.go b/tests/e2e/auth/vesting/suite.go index b9d91fa626c8..bfb6b2d141ff 100644 --- a/tests/e2e/auth/vesting/suite.go +++ b/tests/e2e/auth/vesting/suite.go @@ -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 @@ -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()), @@ -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()), @@ -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()), @@ -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), @@ -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()),