From 3702dc38dd8b6598acdeb4e4ad22bb85dcb4f571 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Sun, 21 Jan 2024 13:49:54 -0500 Subject: [PATCH] fix unit tests by using higher gas limits for inbound and outbound voters --- .../client/integrationtests/cli_helpers.go | 16 ++++++++++++---- .../integrationtests/inbound_voter_test.go | 7 +++++-- .../client/cli/tx_deploy_fungible_coin_zrc_4.go | 2 -- .../client/cli/tx_update_zrc20_liquidity_cap.go | 3 --- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/x/crosschain/client/integrationtests/cli_helpers.go b/x/crosschain/client/integrationtests/cli_helpers.go index 626706a627..3195782031 100644 --- a/x/crosschain/client/integrationtests/cli_helpers.go +++ b/x/crosschain/client/integrationtests/cli_helpers.go @@ -165,7 +165,9 @@ func BuildSignedGasPriceVote(t testing.TB, val *network.Validator, denom string, fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(denom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagGas, "400000"), + fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fmt.Sprintf("%s%s", "10", denom)), } args := append(inboundVoterArgs, txArgs...) out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) @@ -188,7 +190,9 @@ func BuildSignedTssVote(t testing.TB, val *network.Validator, denom string, acco fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(denom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagGas, "400000"), + fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fmt.Sprintf("%s%s", "10", denom)), } args := append(inboundVoterArgs, txArgs...) out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) @@ -229,7 +233,9 @@ func BuildSignedOutboundVote( fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(denom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagGas, "400000"), + fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fmt.Sprintf("%s%s", "10", denom)), } args := append(outboundVoterArgs, txArgs...) out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) @@ -262,7 +268,9 @@ func BuildSignedInboundVote(t testing.TB, val *network.Validator, denom string, fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(denom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagGas, "4000000"), + fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fmt.Sprintf("%s%s", "10", denom)), } args := append(inboundVoterArgs, txArgs...) out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) diff --git a/x/crosschain/client/integrationtests/inbound_voter_test.go b/x/crosschain/client/integrationtests/inbound_voter_test.go index 424a7e68eb..b838250745 100644 --- a/x/crosschain/client/integrationtests/inbound_voter_test.go +++ b/x/crosschain/client/integrationtests/inbound_voter_test.go @@ -241,10 +241,13 @@ func (s *IntegrationTestSuite) TestCCTXInboundVoter() { s.Require().NoError(s.network.WaitForNBlocks(2)) out, err := clitestutil.ExecTestCLICmd(broadcaster.ClientCtx, observercli.CmdListPendingNonces(), []string{"--output", "json"}) s.Require().NoError(err) - fmt.Println(out.String()) + //fmt.Println(out.String()) out, err = clitestutil.ExecTestCLICmd(broadcaster.ClientCtx, observercli.CmdGetSupportedChains(), []string{"--output", "json"}) s.Require().NoError(err) - fmt.Println(out.String()) + //fmt.Println(out.String()) + out, err = clitestutil.ExecTestCLICmd(broadcaster.ClientCtx, crosschaincli.CmdListGasPrice(), []string{"--output", "json"}) + s.Require().NoError(err) + //fmt.Println(out.String()) // Vote the inbound tx for _, val := range s.network.Validators { diff --git a/x/fungible/client/cli/tx_deploy_fungible_coin_zrc_4.go b/x/fungible/client/cli/tx_deploy_fungible_coin_zrc_4.go index adc638e69f..2be8037801 100644 --- a/x/fungible/client/cli/tx_deploy_fungible_coin_zrc_4.go +++ b/x/fungible/client/cli/tx_deploy_fungible_coin_zrc_4.go @@ -1,7 +1,6 @@ package cli import ( - "fmt" "strconv" "github.com/zeta-chain/zetacore/common" @@ -43,7 +42,6 @@ func CmdDeployFungibleCoinZRC4() *cobra.Command { if err != nil { return err } - fmt.Printf("CLI address: %s\n", clientCtx.GetFromAddress().String()) msg := types.NewMsgDeployFungibleCoinZRC20( clientCtx.GetFromAddress().String(), argERC20, diff --git a/x/fungible/client/cli/tx_update_zrc20_liquidity_cap.go b/x/fungible/client/cli/tx_update_zrc20_liquidity_cap.go index 4944e12d81..4c84c38527 100644 --- a/x/fungible/client/cli/tx_update_zrc20_liquidity_cap.go +++ b/x/fungible/client/cli/tx_update_zrc20_liquidity_cap.go @@ -1,8 +1,6 @@ package cli import ( - "fmt" - "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -23,7 +21,6 @@ func CmdUpdateZRC20LiquidityCap() *cobra.Command { if err != nil { return err } - fmt.Printf("CLI address: %s\n", clientCtx.GetFromAddress().String()) msg := types.NewMsgUpdateZRC20LiquidityCap( clientCtx.GetFromAddress().String(), args[0],