From 7f50618c16cfba541056bd3fe41129ce1835746d Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Tue, 1 Aug 2023 16:45:17 +0200 Subject: [PATCH] refactor: simplify code generated by Ignite CLI (#850) * remove var _ = strconv.Itoa(0 * remove var _ = binary.ByteOrder * group add command * group codec register implementation * remove unused variables in module_simulation --------- Co-authored-by: Denis Fadeev Co-authored-by: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> --- x/crosschain/client/cli/cli_cctx.go | 2 -- .../client/cli/cli_out_tx_tracker_test.go | 6 +--- x/crosschain/client/cli/cli_zeta_height.go | 6 +--- x/crosschain/client/cli/query.go | 34 ++++++++++--------- .../client/cli/query_get_tss_address.go | 4 --- x/crosschain/client/cli/tx.go | 32 +++++++---------- x/crosschain/module_simulation.go | 14 -------- x/crosschain/types/codec.go | 15 -------- x/crosschain/types/key_in_tx_hash_to_cctx.go | 4 --- x/emissions/client/cli/query.go | 6 ++-- x/emissions/client/cli/query_list_balances.go | 4 --- x/fungible/client/cli/query.go | 8 +++-- x/fungible/client/cli/tx.go | 14 +++----- .../cli/tx_deploy_fungible_coin_zrc_4.go | 2 -- .../client/cli/tx_remove_foreign_coin.go | 4 --- x/fungible/module_simulation.go | 14 -------- x/fungible/types/codec.go | 5 +-- x/fungible/types/key_foreign_coins.go | 4 --- x/observer/client/cli/query.go | 34 +++++++++---------- x/observer/client/cli/query_ballot.go | 4 --- x/observer/client/cli/query_blame.go | 3 -- x/observer/client/cli/query_core_params.go | 2 -- x/observer/client/cli/query_observers.go | 4 --- .../client/cli/query_show_observer_count.go | 4 --- x/observer/client/cli/tx.go | 17 ++++++---- x/observer/client/cli/tx_add_blame_vote.go | 9 +++-- x/observer/client/cli/tx_add_observer.go | 2 -- .../client/cli/tx_update_core_params.go | 3 -- x/observer/client/cli/tx_update_keygen.go | 4 +-- x/observer/module_simulation.go | 14 -------- x/observer/types/codec.go | 4 --- 31 files changed, 78 insertions(+), 204 deletions(-) diff --git a/x/crosschain/client/cli/cli_cctx.go b/x/crosschain/client/cli/cli_cctx.go index f4b7dc0e9c..398108765a 100644 --- a/x/crosschain/client/cli/cli_cctx.go +++ b/x/crosschain/client/cli/cli_cctx.go @@ -14,8 +14,6 @@ import ( "github.com/zeta-chain/zetacore/x/crosschain/types" ) -var _ = strconv.Itoa(0) - func CmdListSend() *cobra.Command { cmd := &cobra.Command{ Use: "list-cctx", diff --git a/x/crosschain/client/cli/cli_out_tx_tracker_test.go b/x/crosschain/client/cli/cli_out_tx_tracker_test.go index 4cfb17b6e1..01976193dc 100644 --- a/x/crosschain/client/cli/cli_out_tx_tracker_test.go +++ b/x/crosschain/client/cli/cli_out_tx_tracker_test.go @@ -2,19 +2,15 @@ package cli_test import ( "fmt" - "github.com/zeta-chain/zetacore/app" - "strconv" "testing" "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/app" "github.com/zeta-chain/zetacore/testutil/network" "github.com/zeta-chain/zetacore/testutil/nullify" "github.com/zeta-chain/zetacore/x/crosschain/types" ) -// Prevent strconv unused error -var _ = strconv.IntSize - func networkWithOutTxTrackerObjects(t *testing.T, n int) (*network.Network, []types.OutTxTracker) { t.Helper() cfg := network.DefaultConfig() diff --git a/x/crosschain/client/cli/cli_zeta_height.go b/x/crosschain/client/cli/cli_zeta_height.go index 24b698eff9..8f855cd46e 100644 --- a/x/crosschain/client/cli/cli_zeta_height.go +++ b/x/crosschain/client/cli/cli_zeta_height.go @@ -1,16 +1,12 @@ package cli import ( - "github.com/spf13/cobra" - "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/crosschain/types" ) -var _ = strconv.Itoa(0) - func CmdLastZetaHeight() *cobra.Command { cmd := &cobra.Command{ Use: "last-zeta-height", diff --git a/x/crosschain/client/cli/query.go b/x/crosschain/client/cli/query.go index 5f896a9f20..2618a7e794 100644 --- a/x/crosschain/client/cli/query.go +++ b/x/crosschain/client/cli/query.go @@ -26,22 +26,24 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdListOutTxTracker()) - cmd.AddCommand(CmdShowOutTxTracker()) - cmd.AddCommand(cli.CmdShowKeygen()) - cmd.AddCommand(CmdShowTSS()) - cmd.AddCommand(CmdListGasPrice()) - cmd.AddCommand(CmdShowGasPrice()) - cmd.AddCommand(CmdListChainNonces()) - cmd.AddCommand(CmdShowChainNonces()) - cmd.AddCommand(CmdListSend()) - cmd.AddCommand(CmdShowSend()) - cmd.AddCommand(CmdLastZetaHeight()) - cmd.AddCommand(CmdListInTxHashToCctx()) - cmd.AddCommand(CmdShowInTxHashToCctx()) - cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(cli.CmdShowPermissionFlags()) - cmd.AddCommand(CmdGetTssAddress()) + cmd.AddCommand( + CmdListOutTxTracker(), + CmdShowOutTxTracker(), + cli.CmdShowKeygen(), + CmdShowTSS(), + CmdListGasPrice(), + CmdShowGasPrice(), + CmdListChainNonces(), + CmdShowChainNonces(), + CmdListSend(), + CmdShowSend(), + CmdLastZetaHeight(), + CmdListInTxHashToCctx(), + CmdShowInTxHashToCctx(), + CmdQueryParams(), + cli.CmdShowPermissionFlags(), + CmdGetTssAddress(), + ) // this line is used by starport scaffolding # 1 diff --git a/x/crosschain/client/cli/query_get_tss_address.go b/x/crosschain/client/cli/query_get_tss_address.go index b10a1df02d..b6322d84bc 100644 --- a/x/crosschain/client/cli/query_get_tss_address.go +++ b/x/crosschain/client/cli/query_get_tss_address.go @@ -1,16 +1,12 @@ package cli import ( - "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/crosschain/types" ) -var _ = strconv.Itoa(0) - func CmdGetTssAddress() *cobra.Command { cmd := &cobra.Command{ Use: "get-tss-address", diff --git a/x/crosschain/client/cli/tx.go b/x/crosschain/client/cli/tx.go index bd885dadf5..571b468bf1 100644 --- a/x/crosschain/client/cli/tx.go +++ b/x/crosschain/client/cli/tx.go @@ -2,24 +2,14 @@ package cli import ( "fmt" - "github.com/zeta-chain/zetacore/x/observer/client/cli" - "time" - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" + "github.com/zeta-chain/zetacore/x/observer/client/cli" // "github.com/cosmos/cosmos-sdk/client/flags" "github.com/zeta-chain/zetacore/x/crosschain/types" ) -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) - -const ( -// flagPacketTimeoutTimestamp = "packet-timeout-timestamp" -) - // GetTxCmd returns the transaction commands for this module func GetTxCmd() *cobra.Command { cmd := &cobra.Command{ @@ -30,15 +20,17 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdAddToWatchList()) - cmd.AddCommand(CmdCreateTSSVoter()) - cmd.AddCommand(CmdGasPriceVoter()) - cmd.AddCommand(CmdNonceVoter()) - cmd.AddCommand(CmdCCTXOutboundVoter()) - cmd.AddCommand(CmdCCTXInboundVoter()) - cmd.AddCommand(CmdRemoveFromWatchList()) - cmd.AddCommand(cli.CmdUpdatePermissionFlags()) - cmd.AddCommand(cli.CmdUpdateKeygen()) + cmd.AddCommand( + CmdAddToWatchList(), + CmdCreateTSSVoter(), + CmdGasPriceVoter(), + CmdNonceVoter(), + CmdCCTXOutboundVoter(), + CmdCCTXInboundVoter(), + CmdRemoveFromWatchList(), + cli.CmdUpdatePermissionFlags(), + cli.CmdUpdateKeygen(), + ) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/crosschain/module_simulation.go b/x/crosschain/module_simulation.go index 1ba988d1bc..26118e09aa 100644 --- a/x/crosschain/module_simulation.go +++ b/x/crosschain/module_simulation.go @@ -3,26 +3,12 @@ package crosschain import ( "math/rand" - "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/zeta-chain/zetacore/testutil/sample" - crosschainsimulation "github.com/zeta-chain/zetacore/x/crosschain/simulation" "github.com/zeta-chain/zetacore/x/crosschain/types" ) -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = crosschainsimulation.FindAccount - _ = simappparams.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - const ( // this line is used by starport scaffolding # simapp/module/const ) diff --git a/x/crosschain/types/codec.go b/x/crosschain/types/codec.go index 94b63b67f0..1dbd981cfd 100644 --- a/x/crosschain/types/codec.go +++ b/x/crosschain/types/codec.go @@ -23,27 +23,12 @@ func RegisterCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAddToOutTxTracker{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRemoveFromOutTxTracker{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateTSSVoter{}, - ) - - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgGasPriceVoter{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgNonceVoter{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgVoteOnObservedOutboundTx{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgVoteOnObservedInboundTx{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSetNodeKeys{}, ) diff --git a/x/crosschain/types/key_in_tx_hash_to_cctx.go b/x/crosschain/types/key_in_tx_hash_to_cctx.go index b5366e1294..43f0bf8a33 100644 --- a/x/crosschain/types/key_in_tx_hash_to_cctx.go +++ b/x/crosschain/types/key_in_tx_hash_to_cctx.go @@ -1,9 +1,5 @@ package types -import "encoding/binary" - -var _ binary.ByteOrder - const ( // InTxHashToCctxKeyPrefix is the prefix to retrieve all InTxHashToCctx InTxHashToCctxKeyPrefix = "InTxHashToCctx/value/" diff --git a/x/emissions/client/cli/query.go b/x/emissions/client/cli/query.go index 771307efd7..efd2cfad5c 100644 --- a/x/emissions/client/cli/query.go +++ b/x/emissions/client/cli/query.go @@ -24,8 +24,10 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(CmdListPoolAddresses()) + cmd.AddCommand( + CmdQueryParams(), + CmdListPoolAddresses(), + ) // this line is used by starport scaffolding # 1 diff --git a/x/emissions/client/cli/query_list_balances.go b/x/emissions/client/cli/query_list_balances.go index ccb9efaed4..c20ca85500 100644 --- a/x/emissions/client/cli/query_list_balances.go +++ b/x/emissions/client/cli/query_list_balances.go @@ -1,16 +1,12 @@ package cli import ( - "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/emissions/types" ) -var _ = strconv.Itoa(0) - func CmdListPoolAddresses() *cobra.Command { cmd := &cobra.Command{ Use: "list-pool-addresses", diff --git a/x/fungible/client/cli/query.go b/x/fungible/client/cli/query.go index fb7dc6c9f9..0a0ce40cd0 100644 --- a/x/fungible/client/cli/query.go +++ b/x/fungible/client/cli/query.go @@ -24,9 +24,11 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(CmdListForeignCoins()) - cmd.AddCommand(CmdShowForeignCoins()) + cmd.AddCommand( + CmdQueryParams(), + CmdListForeignCoins(), + CmdShowForeignCoins(), + ) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/fungible/client/cli/tx.go b/x/fungible/client/cli/tx.go index df32f4d9bb..827ec0851e 100644 --- a/x/fungible/client/cli/tx.go +++ b/x/fungible/client/cli/tx.go @@ -2,19 +2,13 @@ package cli import ( "fmt" - "time" - - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" // "github.com/cosmos/cosmos-sdk/client/flags" "github.com/zeta-chain/zetacore/x/fungible/types" ) -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) - // GetTxCmd returns the transaction commands for this module func GetTxCmd() *cobra.Command { cmd := &cobra.Command{ @@ -25,8 +19,10 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdDeployFungibleCoinZRC4()) - cmd.AddCommand(CmdRemoveForeignCoin()) + cmd.AddCommand( + CmdDeployFungibleCoinZRC4(), + CmdRemoveForeignCoin(), + ) // this line is used by starport scaffolding # 1 return cmd 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 3d5557e052..f4bf1696c2 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 @@ -13,8 +13,6 @@ import ( "github.com/zeta-chain/zetacore/x/fungible/types" ) -var _ = strconv.Itoa(0) - func CmdDeployFungibleCoinZRC4() *cobra.Command { cmd := &cobra.Command{ Use: "deploy-fungible-coin-zrc-4 [erc-20] [foreign-chain] [decimals] [name] [symbol] [coin-type] [gas-limit]", diff --git a/x/fungible/client/cli/tx_remove_foreign_coin.go b/x/fungible/client/cli/tx_remove_foreign_coin.go index b5b891297d..00c6a32352 100644 --- a/x/fungible/client/cli/tx_remove_foreign_coin.go +++ b/x/fungible/client/cli/tx_remove_foreign_coin.go @@ -1,8 +1,6 @@ package cli import ( - "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -10,8 +8,6 @@ import ( "github.com/zeta-chain/zetacore/x/fungible/types" ) -var _ = strconv.Itoa(0) - func CmdRemoveForeignCoin() *cobra.Command { cmd := &cobra.Command{ Use: "remove-foreign-coin [name]", diff --git a/x/fungible/module_simulation.go b/x/fungible/module_simulation.go index bea5ddd952..b757c60a6b 100644 --- a/x/fungible/module_simulation.go +++ b/x/fungible/module_simulation.go @@ -3,26 +3,12 @@ package fungible import ( "math/rand" - "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/zeta-chain/zetacore/testutil/sample" - fungiblesimulation "github.com/zeta-chain/zetacore/x/fungible/simulation" "github.com/zeta-chain/zetacore/x/fungible/types" ) -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = fungiblesimulation.FindAccount - _ = simappparams.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - const ( // this line is used by starport scaffolding # simapp/module/const ) diff --git a/x/fungible/types/codec.go b/x/fungible/types/codec.go index 87a1573de0..8343265cbb 100644 --- a/x/fungible/types/codec.go +++ b/x/fungible/types/codec.go @@ -14,14 +14,11 @@ func RegisterCodec(cdc *codec.LegacyAmino) { } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgDeployFungibleCoinZRC20{}, - ) - - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRemoveForeignCoin{}, ) + // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/fungible/types/key_foreign_coins.go b/x/fungible/types/key_foreign_coins.go index 395b529ef1..fc13f38486 100644 --- a/x/fungible/types/key_foreign_coins.go +++ b/x/fungible/types/key_foreign_coins.go @@ -1,9 +1,5 @@ package types -import "encoding/binary" - -var _ binary.ByteOrder - const ( // ForeignCoinsKeyPrefix is the prefix to retrieve all ForeignCoins ForeignCoinsKeyPrefix = "ForeignCoins/value/" diff --git a/x/observer/client/cli/query.go b/x/observer/client/cli/query.go index 8d58e79802..d67a0be176 100644 --- a/x/observer/client/cli/query.go +++ b/x/observer/client/cli/query.go @@ -24,24 +24,22 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(CmdBallotByIdentifier()) - - cmd.AddCommand(CmdObserversByChainAndType()) - cmd.AddCommand(CmdAllObserverMappers()) - cmd.AddCommand(CmdGetSupportedChains()) - - cmd.AddCommand(CmdGetCoreParamsForChain()) - - cmd.AddCommand(CmdGetCoreParams()) - cmd.AddCommand(CmdListNodeAccount()) - cmd.AddCommand(CmdShowNodeAccount()) - cmd.AddCommand(CmdShowPermissionFlags()) - cmd.AddCommand(CmdShowKeygen()) - - cmd.AddCommand(CmdShowObserverCount()) - cmd.AddCommand(CmdBlameByIdentifier()) - cmd.AddCommand(CmdGetAllBlameRecords()) + cmd.AddCommand( + CmdQueryParams(), + CmdBallotByIdentifier(), + CmdObserversByChainAndType(), + CmdAllObserverMappers(), + CmdGetSupportedChains(), + CmdGetCoreParamsForChain(), + CmdGetCoreParams(), + CmdListNodeAccount(), + CmdShowNodeAccount(), + CmdShowPermissionFlags(), + CmdShowKeygen(), + CmdShowObserverCount(), + CmdBlameByIdentifier(), + CmdGetAllBlameRecords(), + ) // this line is used by starport scaffolding # 1 diff --git a/x/observer/client/cli/query_ballot.go b/x/observer/client/cli/query_ballot.go index 72468e7759..a686736b61 100644 --- a/x/observer/client/cli/query_ballot.go +++ b/x/observer/client/cli/query_ballot.go @@ -1,16 +1,12 @@ package cli import ( - "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/observer/types" ) -var _ = strconv.Itoa(0) - func CmdBallotByIdentifier() *cobra.Command { cmd := &cobra.Command{ Use: "show-ballot [ballot-identifier]", diff --git a/x/observer/client/cli/query_blame.go b/x/observer/client/cli/query_blame.go index 39ec0e1be8..aee13732b4 100644 --- a/x/observer/client/cli/query_blame.go +++ b/x/observer/client/cli/query_blame.go @@ -5,11 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/observer/types" - "strconv" ) -var _ = strconv.Itoa(0) - func CmdBlameByIdentifier() *cobra.Command { cmd := &cobra.Command{ Use: "show-blame [blame-identifier]", diff --git a/x/observer/client/cli/query_core_params.go b/x/observer/client/cli/query_core_params.go index 0534ab5579..cf64eb7d6a 100644 --- a/x/observer/client/cli/query_core_params.go +++ b/x/observer/client/cli/query_core_params.go @@ -9,8 +9,6 @@ import ( "github.com/zeta-chain/zetacore/x/observer/types" ) -var _ = strconv.Itoa(0) - func CmdGetCoreParamsForChain() *cobra.Command { cmd := &cobra.Command{ Use: "show-core-params [chain-id]", diff --git a/x/observer/client/cli/query_observers.go b/x/observer/client/cli/query_observers.go index 013b761559..edca162189 100644 --- a/x/observer/client/cli/query_observers.go +++ b/x/observer/client/cli/query_observers.go @@ -1,16 +1,12 @@ package cli import ( - "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/observer/types" ) -var _ = strconv.Itoa(0) - func CmdAllObserverMappers() *cobra.Command { cmd := &cobra.Command{ Use: "list-observer", diff --git a/x/observer/client/cli/query_show_observer_count.go b/x/observer/client/cli/query_show_observer_count.go index afa714943f..84ad22dde1 100644 --- a/x/observer/client/cli/query_show_observer_count.go +++ b/x/observer/client/cli/query_show_observer_count.go @@ -1,16 +1,12 @@ package cli import ( - "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/observer/types" ) -var _ = strconv.Itoa(0) - func CmdShowObserverCount() *cobra.Command { cmd := &cobra.Command{ Use: "show-observer-count", diff --git a/x/observer/client/cli/tx.go b/x/observer/client/cli/tx.go index ca8a05ff66..f81743030b 100644 --- a/x/observer/client/cli/tx.go +++ b/x/observer/client/cli/tx.go @@ -17,14 +17,17 @@ func GetTxCmd() *cobra.Command { SuggestionsMinimumDistance: 2, RunE: client.ValidateCmd, } - //cmd.AddCommand(CmdSetSupportedChains()) - //cmd.AddCommand(CmdAddObserver()) - cmd.AddCommand(CmdUpdateCoreParams()) - cmd.AddCommand(CmdUpdatePermissionFlags()) - cmd.AddCommand(CmdUpdateKeygen()) - cmd.AddCommand(CmdAddBlameVote()) - cmd.AddCommand(CmdEncode()) + cmd.AddCommand( + //CmdSetSupportedChains(), + //CmdAddObserver(), + CmdUpdateCoreParams(), + CmdUpdatePermissionFlags(), + CmdUpdateKeygen(), + CmdAddBlameVote(), + CmdEncode(), + ) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/observer/client/cli/tx_add_blame_vote.go b/x/observer/client/cli/tx_add_blame_vote.go index 74d62ce5d6..e9597d26f0 100644 --- a/x/observer/client/cli/tx_add_blame_vote.go +++ b/x/observer/client/cli/tx_add_blame_vote.go @@ -4,19 +4,18 @@ import ( "encoding/hex" "encoding/json" "fmt" + "os" + "path/filepath" + "strconv" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/observer/types" "gitlab.com/thorchain/tss/go-tss/blame" - "os" - "path/filepath" - "strconv" ) -var _ = strconv.Itoa(0) - func CmdAddBlameVote() *cobra.Command { cmd := &cobra.Command{ Use: "add-blame-vote [chain-id] [index] [failure-reason] [node-list]", diff --git a/x/observer/client/cli/tx_add_observer.go b/x/observer/client/cli/tx_add_observer.go index f6ded60a8a..b4bf059352 100644 --- a/x/observer/client/cli/tx_add_observer.go +++ b/x/observer/client/cli/tx_add_observer.go @@ -10,8 +10,6 @@ import ( "github.com/zeta-chain/zetacore/x/observer/types" ) -var _ = strconv.Itoa(0) - func CmdAddObserver() *cobra.Command { cmd := &cobra.Command{ Use: "add-observer [observer-chain-id] [observation-type]", diff --git a/x/observer/client/cli/tx_update_core_params.go b/x/observer/client/cli/tx_update_core_params.go index efc4f849b2..e506edeec9 100644 --- a/x/observer/client/cli/tx_update_core_params.go +++ b/x/observer/client/cli/tx_update_core_params.go @@ -4,7 +4,6 @@ import ( "encoding/json" "os" "path/filepath" - "strconv" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -13,8 +12,6 @@ import ( "github.com/zeta-chain/zetacore/x/observer/types" ) -var _ = strconv.Itoa(0) - func CmdUpdateCoreParams() *cobra.Command { cmd := &cobra.Command{ Use: "update-client-params [chain-id] [client-params.json]", diff --git a/x/observer/client/cli/tx_update_keygen.go b/x/observer/client/cli/tx_update_keygen.go index 3c9408d0d7..776389369c 100644 --- a/x/observer/client/cli/tx_update_keygen.go +++ b/x/observer/client/cli/tx_update_keygen.go @@ -1,17 +1,15 @@ package cli import ( - "github.com/zeta-chain/zetacore/x/observer/types" "strconv" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" + "github.com/zeta-chain/zetacore/x/observer/types" ) -var _ = strconv.Itoa(0) - func CmdUpdateKeygen() *cobra.Command { cmd := &cobra.Command{ Use: "update-keygen [block]", diff --git a/x/observer/module_simulation.go b/x/observer/module_simulation.go index 6be931e2ec..6ee008cb23 100644 --- a/x/observer/module_simulation.go +++ b/x/observer/module_simulation.go @@ -3,26 +3,12 @@ package observer import ( "math/rand" - "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/zeta-chain/zetacore/testutil/sample" - observersimulation "github.com/zeta-chain/zetacore/x/observer/simulation" "github.com/zeta-chain/zetacore/x/observer/types" ) -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = observersimulation.FindAccount - _ = simappparams.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - /* #nosec */ const ( opWeightMsgUpdateClientParams = "op_weight_msg_update_client_params" diff --git a/x/observer/types/codec.go b/x/observer/types/codec.go index 81572dfc9d..7fe3c684dd 100644 --- a/x/observer/types/codec.go +++ b/x/observer/types/codec.go @@ -17,11 +17,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateCoreParams{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdatePermissionFlags{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateKeygen{}, ) // this line is used by starport scaffolding # 3