Skip to content

Commit

Permalink
fix unit tests by using higher gas limits for inbound and outbound vo…
Browse files Browse the repository at this point in the history
…ters
  • Loading branch information
kingpinXD committed Jan 21, 2024
1 parent 6b4e3e3 commit 3702dc3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
16 changes: 12 additions & 4 deletions x/crosschain/client/integrationtests/cli_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions x/crosschain/client/integrationtests/inbound_voter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions x/fungible/client/cli/tx_deploy_fungible_coin_zrc_4.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cli

import (
"fmt"
"strconv"

"github.com/zeta-chain/zetacore/common"
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions x/fungible/client/cli/tx_update_zrc20_liquidity_cap.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package cli

import (
"fmt"

"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand All @@ -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],
Expand Down

0 comments on commit 3702dc3

Please sign in to comment.