From 3257688c32c5e684688abdf398bed284e702c834 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 25 Dec 2023 01:03:53 +0700 Subject: [PATCH 1/4] update golangci configuration --- .golangci.yml | 117 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 82 insertions(+), 35 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5b000296..f9dd7041 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,15 +1,13 @@ run: tests: true - timeout: 5m - allow-parallel-runners: true + timeout: 10m linters: disable-all: true enable: - - bodyclose - - dogsled - - errcheck - exportloopref + - errcheck # this is more reasonable than revive's version + - gci - goconst - gocritic - gofumpt @@ -19,50 +17,99 @@ linters: - ineffassign - misspell - nakedret - - nolintlint - - revive - staticcheck + - thelper + - typecheck - stylecheck + - revive - typecheck + - tenv - unconvert - - unparam + - unparam # Prefer unparam over revive's unused param. It is more thorough in its checking. - unused - -# TODO: fix the errorsmod.Wrap deprecation warning and re-enable staticcheck -# TODO: fix the use of deprecated gov style + - misspell issues: exclude-rules: - - text: "simtypes" + - text: 'differs only by capitalization to method' linters: - - staticcheck - - text: "Use of weak random number generator" + - revive + - text: 'Use of weak random number generator' linters: - gosec - - text: "ST1003:" - linters: - - stylecheck - # FIXME: Disabled until golangci-lint updates stylecheck with this fix: - # https://github.com/dominikh/go-tools/issues/389 - - text: "ST1016:" - linters: - - stylecheck - - path: "migrations" - text: "SA1019:" - linters: + - linters: - staticcheck + text: "SA1019:" # silence errors on usage of deprecated funcs max-issues-per-linter: 10000 max-same-issues: 10000 linters-settings: - dogsled: - max-blank-identifiers: 3 - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true - nolintlint: - allow-unused: false - allow-leading-space: true - require-explanation: false - require-specific: false + gci: + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - blank # blank imports + - dot # dot imports + - prefix(cosmossdk.io) + - prefix(github.com/cosmos/cosmos-sdk) + - prefix(github.com/cometbft/cometbft) + - prefix(github.com/cosmos/ibc-go) + custom-order: true + revive: + enable-all-rules: true + # Do NOT whine about the following, full explanation found in: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#description-of-available-rules + rules: + - name: use-any + disabled: true + - name: if-return + disabled: true + - name: max-public-structs + disabled: true + - name: cognitive-complexity + disabled: true + - name: argument-limit + disabled: true + - name: cyclomatic + disabled: true + - name: file-header + disabled: true + - name: function-length + disabled: true + - name: function-result-limit + disabled: true + - name: line-length-limit + disabled: true + - name: flag-parameter + disabled: true + - name: add-constant + disabled: true + - name: empty-lines + disabled: true + - name: banned-characters + disabled: true + - name: deep-exit + disabled: true + - name: confusing-results + disabled: true + - name: unused-parameter + disabled: true + - name: modifies-value-receiver + disabled: true + - name: early-return + disabled: true + - name: confusing-naming + disabled: true + - name: defer + disabled: true + # Disabled in favour of unparam. + - name: unused-parameter + disabled: true + - name: unhandled-error + disabled: true + arguments: + - 'fmt.Printf' + - 'fmt.Print' + - 'fmt.Println' + - 'myFunction' From e7b5f23989a61baba403ad3902bf8e0b4a525e98 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 25 Dec 2023 01:23:50 +0700 Subject: [PATCH 2/4] begin to lint --- .golangci.yml | 1 + app/app.go | 25 +++++++------- app/app_test.go | 7 ++-- app/export.go | 1 + app/genesis_account_test.go | 7 ++-- app/sim_test.go | 3 +- app/state.go | 1 + app/test_helpers.go | 3 +- cmd/liquidstakingd/cmd/cmd_test.go | 1 + cmd/liquidstakingd/cmd/genaccounts.go | 1 + cmd/liquidstakingd/cmd/genaccounts_test.go | 8 ++--- cmd/liquidstakingd/cmd/root.go | 1 + cmd/liquidstakingd/cmd/testnet.go | 2 +- cmd/liquidstakingd/cmd/testnet_test.go | 1 + cmd/liquidstakingd/main.go | 1 + go.mod | 2 +- go.sum | 33 +++++++++++++++++++ testutil/network/network.go | 1 + testutil/network/util.go | 1 + x/distribution/abci.go | 1 + x/distribution/client/cli/query.go | 1 + x/distribution/client/cli/tx.go | 1 + x/distribution/client/cli/tx_test.go | 9 ++--- x/distribution/client/cli/utils.go | 1 + x/distribution/client/common/common.go | 1 + x/distribution/client/common/common_test.go | 3 +- x/distribution/client/proposal_handler.go | 1 + .../client/testutil/grpc_query_suite.go | 1 + x/distribution/client/testutil/helpers.go | 1 + x/distribution/client/testutil/suite.go | 1 + .../client/testutil/withdraw_all_suite.go | 4 ++- x/distribution/handler.go | 1 + x/distribution/handler_test.go | 6 ++-- x/distribution/keeper/alias_functions.go | 1 + x/distribution/keeper/allocation.go | 1 + x/distribution/keeper/allocation_test.go | 1 + x/distribution/keeper/common_test.go | 1 + x/distribution/keeper/delegation.go | 2 +- x/distribution/keeper/delegation_test.go | 1 + x/distribution/keeper/fee_pool.go | 1 + x/distribution/keeper/genesis.go | 1 + x/distribution/keeper/grpc_query.go | 5 +-- x/distribution/keeper/grpc_query_test.go | 1 + x/distribution/keeper/hooks.go | 9 ++--- x/distribution/keeper/invariants.go | 1 + x/distribution/keeper/keeper.go | 7 ++-- x/distribution/keeper/keeper_test.go | 1 + x/distribution/keeper/msg_server.go | 1 + x/distribution/keeper/params.go | 1 + x/distribution/keeper/proposal_handler.go | 2 ++ x/distribution/keeper/querier.go | 5 +-- x/distribution/keeper/querier_test.go | 1 + x/distribution/keeper/store.go | 1 + x/distribution/keeper/validator.go | 2 +- x/distribution/module.go | 5 +-- x/distribution/module_test.go | 1 + x/distribution/proposal_handler_test.go | 1 + x/distribution/simulation/decoder.go | 1 + x/distribution/simulation/decoder_test.go | 1 + x/distribution/simulation/genesis.go | 1 + x/distribution/simulation/genesis_test.go | 1 + x/distribution/simulation/operations.go | 1 + x/distribution/simulation/operations_test.go | 4 +-- x/distribution/simulation/params.go | 2 +- x/distribution/simulation/proposals.go | 1 + x/distribution/simulation/proposals_test.go | 1 + x/distribution/types/expected_keepers.go | 1 + x/distribution/types/fee_pool_test.go | 1 + x/distribution/types/msg.go | 26 +++++++-------- x/distribution/types/params_test.go | 1 + x/distribution/types/proposal.go | 4 +-- x/genutil/client/cli/collect.go | 1 + x/genutil/client/cli/gentx.go | 1 + x/genutil/client/cli/init.go | 1 + x/genutil/client/cli/init_test.go | 1 + x/genutil/client/testutil/helpers.go | 1 + x/genutil/client/testutil/suite.go | 1 + x/genutil/collect.go | 1 + x/genutil/collect_test.go | 4 +-- x/genutil/genesis.go | 1 + x/genutil/gentx.go | 1 + x/genutil/gentx_test.go | 1 + x/genutil/module.go | 6 ++-- x/genutil/types/genesis_state.go | 1 + x/genutil/types/genesis_state_test.go | 1 + x/slashing/abci.go | 1 + x/slashing/abci_test.go | 1 + x/slashing/app_test.go | 1 + x/slashing/client/cli/query.go | 1 + x/slashing/client/cli/tx.go | 1 + x/slashing/client/testutil/suite.go | 1 + x/slashing/keeper/genesis.go | 1 + x/slashing/keeper/genesis_test.go | 1 + x/slashing/keeper/grpc_query.go | 1 + x/slashing/keeper/grpc_query_test.go | 1 + x/slashing/keeper/hooks.go | 17 +++++----- x/slashing/keeper/infractions.go | 1 + x/slashing/keeper/keeper.go | 3 +- x/slashing/keeper/keeper_test.go | 1 + x/slashing/keeper/migrations.go | 2 +- x/slashing/keeper/msg_server.go | 1 + x/slashing/keeper/params.go | 1 + x/slashing/keeper/querier.go | 4 ++- x/slashing/keeper/querier_test.go | 2 +- x/slashing/keeper/signing_info.go | 1 + x/slashing/keeper/signing_info_test.go | 1 + x/slashing/module.go | 7 ++-- x/slashing/simulation/decoder.go | 1 + x/slashing/simulation/decoder_test.go | 1 + x/slashing/simulation/genesis.go | 1 + x/slashing/simulation/genesis_test.go | 1 + x/slashing/simulation/operations.go | 1 + x/slashing/simulation/operations_test.go | 4 +-- x/slashing/simulation/params.go | 1 + x/slashing/types/msg.go | 4 +-- x/staking/abci.go | 1 + x/staking/app_test.go | 1 + x/staking/bench_test.go | 1 + x/staking/client/cli/query.go | 1 + x/staking/client/cli/tx.go | 1 + x/staking/client/cli/utils.go | 1 + x/staking/client/testutil/grpc.go | 1 + x/staking/client/testutil/suite.go | 1 + x/staking/client/testutil/test_helpers.go | 1 + x/staking/common_test.go | 1 + x/staking/genesis.go | 1 + x/staking/genesis_test.go | 1 + x/staking/handler.go | 3 +- x/staking/handler_test.go | 1 + x/staking/keeper/alias_functions.go | 1 + x/staking/keeper/common_test.go | 1 + x/staking/keeper/delegation.go | 1 + x/staking/keeper/delegation_test.go | 1 + x/staking/keeper/genesis.go | 1 + x/staking/keeper/genesis_test.go | 1 + x/staking/keeper/grpc_query.go | 1 + x/staking/keeper/grpc_query_test.go | 1 + x/staking/keeper/historical_info.go | 1 + x/staking/keeper/historical_info_test.go | 1 + x/staking/keeper/hooks.go | 1 + x/staking/keeper/invariants.go | 1 + x/staking/keeper/keeper.go | 3 +- x/staking/keeper/keeper_test.go | 2 +- x/staking/keeper/liquid_stake.go | 3 +- x/staking/keeper/liquid_stake_test.go | 4 ++- x/staking/keeper/msg_server.go | 5 +-- x/staking/keeper/msg_server_test.go | 5 +-- x/staking/keeper/params.go | 5 +-- x/staking/keeper/pool.go | 1 + x/staking/keeper/querier.go | 5 +-- x/staking/keeper/querier_test.go | 1 + x/staking/keeper/query_utils.go | 1 + x/staking/keeper/slash.go | 1 + x/staking/keeper/slash_test.go | 1 + x/staking/keeper/test_common.go | 1 + x/staking/keeper/tokenize_share_record.go | 3 +- x/staking/keeper/val_state_change.go | 1 + x/staking/keeper/validator.go | 1 + x/staking/keeper/validator_test.go | 1 + x/staking/module.go | 5 +-- x/staking/module_test.go | 1 + x/staking/simulation/decoder.go | 1 + x/staking/simulation/decoder_test.go | 1 + x/staking/simulation/genesis.go | 1 + x/staking/simulation/genesis_test.go | 1 + x/staking/simulation/operations.go | 1 + x/staking/simulation/params.go | 1 + x/staking/teststaking/helper.go | 1 + x/staking/teststaking/tm.go | 1 + x/staking/teststaking/validator.go | 1 + x/staking/types/authz.go | 2 +- x/staking/types/authz_test.go | 1 + x/staking/types/commission_test.go | 1 + x/staking/types/delegation_test.go | 1 + x/staking/types/historical_info.go | 4 +-- x/staking/types/historical_info_test.go | 6 ++-- x/staking/types/keys_test.go | 1 + x/staking/types/msg.go | 22 ++++++------- x/staking/types/msg_test.go | 1 + x/staking/types/params_test.go | 1 + x/staking/types/validator.go | 6 ++-- x/staking/types/validator_test.go | 1 + 182 files changed, 321 insertions(+), 131 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f9dd7041..cef63f22 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -55,6 +55,7 @@ linters-settings: - prefix(github.com/cosmos/cosmos-sdk) - prefix(github.com/cometbft/cometbft) - prefix(github.com/cosmos/ibc-go) + - prefix(github.com/iqlusioninc/liquidity-staking-module) custom-order: true revive: enable-all-rules: true diff --git a/app/app.go b/app/app.go index c68929a0..f1749477 100644 --- a/app/app.go +++ b/app/app.go @@ -15,6 +15,9 @@ import ( tmos "github.com/tendermint/tendermint/libs/os" dbm "github.com/tendermint/tm-db" + // unnamed import of statik for swagger UI support + _ "github.com/cosmos/cosmos-sdk/client/docs/statik" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" @@ -59,17 +62,21 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - distrclient "github.com/iqlusioninc/liquidity-staking-module/x/distribution/client" - "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/params" + paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + "github.com/cosmos/cosmos-sdk/x/upgrade" + upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + distr "github.com/iqlusioninc/liquidity-staking-module/x/distribution" + distrclient "github.com/iqlusioninc/liquidity-staking-module/x/distribution/client" distrkeeper "github.com/iqlusioninc/liquidity-staking-module/x/distribution/keeper" distrtypes "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" "github.com/iqlusioninc/liquidity-staking-module/x/genutil" @@ -80,14 +87,6 @@ import ( "github.com/iqlusioninc/liquidity-staking-module/x/staking" stakingkeeper "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" - - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - // unnamed import of statik for swagger UI support - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" ) const appName = "SimApp" @@ -477,7 +476,7 @@ func (app *SimApp) LoadHeight(height int64) error { } // ModuleAccountAddrs returns all the app's module account addresses. -func (app *SimApp) ModuleAccountAddrs() map[string]bool { +func (*SimApp) ModuleAccountAddrs() map[string]bool { modAccAddrs := make(map[string]bool) for acc := range maccPerms { modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true @@ -543,7 +542,7 @@ func (app *SimApp) SimulationManager() *module.SimulationManager { // RegisterAPIRoutes registers all application module routes with the provided // API server. -func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { +func (*SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) diff --git a/app/app_test.go b/app/app_test.go index 6fef7e62..790a08e9 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -6,9 +6,6 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/iqlusioninc/liquidity-staking-module/x/distribution" - "github.com/iqlusioninc/liquidity-staking-module/x/slashing" - "github.com/iqlusioninc/liquidity-staking-module/x/staking" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" @@ -32,7 +29,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/mint" "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/upgrade" + + "github.com/iqlusioninc/liquidity-staking-module/x/distribution" "github.com/iqlusioninc/liquidity-staking-module/x/genutil" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing" + "github.com/iqlusioninc/liquidity-staking-module/x/staking" ) func TestSimAppExportAndBlockedAddrs(t *testing.T) { diff --git a/app/export.go b/app/export.go index e34129bb..04cc17a2 100644 --- a/app/export.go +++ b/app/export.go @@ -9,6 +9,7 @@ import ( servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + slashingtypes "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" "github.com/iqlusioninc/liquidity-staking-module/x/staking" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/app/genesis_account_test.go b/app/genesis_account_test.go index 8fb4a1f3..0bf35ee4 100644 --- a/app/genesis_account_test.go +++ b/app/genesis_account_test.go @@ -4,13 +4,14 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - simapp "github.com/iqlusioninc/liquidity-staking-module/app" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" ) func TestSimGenesisAccountValidate(t *testing.T) { diff --git a/app/sim_test.go b/app/sim_test.go index dc2917a8..183a7859 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -9,7 +9,6 @@ import ( "strings" "testing" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" @@ -19,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp/helpers" "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -30,6 +30,7 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/simulation" + distrtypes "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" slashingtypes "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/app/state.go b/app/state.go index 4679e3dd..2a7b9c82 100644 --- a/app/state.go +++ b/app/state.go @@ -20,6 +20,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/app/test_helpers.go b/app/test_helpers.go index e25c2b71..5d19039a 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -34,6 +34,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stdstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) @@ -520,6 +521,6 @@ func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey) { type EmptyAppOptions struct{} // Get implements AppOptions -func (ao EmptyAppOptions) Get(_ string) interface{} { +func (EmptyAppOptions) Get(_ string) interface{} { return nil } diff --git a/cmd/liquidstakingd/cmd/cmd_test.go b/cmd/liquidstakingd/cmd/cmd_test.go index 266d6481..ba8cc658 100644 --- a/cmd/liquidstakingd/cmd/cmd_test.go +++ b/cmd/liquidstakingd/cmd/cmd_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/cmd/liquidstakingd/cmd" "github.com/iqlusioninc/liquidity-staking-module/x/genutil/client/cli" diff --git a/cmd/liquidstakingd/cmd/genaccounts.go b/cmd/liquidstakingd/cmd/genaccounts.go index e086e709..6d2282d7 100644 --- a/cmd/liquidstakingd/cmd/genaccounts.go +++ b/cmd/liquidstakingd/cmd/genaccounts.go @@ -16,6 +16,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil" genutiltypes "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" ) diff --git a/cmd/liquidstakingd/cmd/genaccounts_test.go b/cmd/liquidstakingd/cmd/genaccounts_test.go index f249c7de..6cebed66 100644 --- a/cmd/liquidstakingd/cmd/genaccounts_test.go +++ b/cmd/liquidstakingd/cmd/genaccounts_test.go @@ -5,19 +5,19 @@ import ( "fmt" "testing" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/libs/log" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" simcmd "github.com/iqlusioninc/liquidity-staking-module/cmd/liquidstakingd/cmd" "github.com/iqlusioninc/liquidity-staking-module/x/genutil" diff --git a/cmd/liquidstakingd/cmd/root.go b/cmd/liquidstakingd/cmd/root.go index fc2726cf..cc1a3fae 100644 --- a/cmd/liquidstakingd/cmd/root.go +++ b/cmd/liquidstakingd/cmd/root.go @@ -30,6 +30,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" genutilcli "github.com/iqlusioninc/liquidity-staking-module/x/genutil/client/cli" ) diff --git a/cmd/liquidstakingd/cmd/testnet.go b/cmd/liquidstakingd/cmd/testnet.go index 5583e1c5..d2897f67 100644 --- a/cmd/liquidstakingd/cmd/testnet.go +++ b/cmd/liquidstakingd/cmd/testnet.go @@ -12,7 +12,6 @@ import ( "github.com/spf13/cobra" tmconfig "github.com/tendermint/tendermint/config" - tmos "github.com/tendermint/tendermint/libs/os" tmrand "github.com/tendermint/tendermint/libs/rand" "github.com/tendermint/tendermint/types" @@ -31,6 +30,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/iqlusioninc/liquidity-staking-module/testutil/network" "github.com/iqlusioninc/liquidity-staking-module/x/genutil" genutiltypes "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" diff --git a/cmd/liquidstakingd/cmd/testnet_test.go b/cmd/liquidstakingd/cmd/testnet_test.go index 38c4d5fa..1cb141f4 100644 --- a/cmd/liquidstakingd/cmd/testnet_test.go +++ b/cmd/liquidstakingd/cmd/testnet_test.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" genutiltest "github.com/iqlusioninc/liquidity-staking-module/x/genutil/client/testutil" genutiltypes "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" diff --git a/cmd/liquidstakingd/main.go b/cmd/liquidstakingd/main.go index dca3fadd..465c2db1 100644 --- a/cmd/liquidstakingd/main.go +++ b/cmd/liquidstakingd/main.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/cmd/liquidstakingd/cmd" ) diff --git a/go.mod b/go.mod index 73212139..010fc505 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/iqlusioninc/liquidity-staking-module -go 1.20 +go 1.21 require ( cosmossdk.io/errors v1.0.0-beta.7 diff --git a/go.sum b/go.sum index 655981a8..9c9a4129 100644 --- a/go.sum +++ b/go.sum @@ -60,6 +60,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= @@ -79,7 +80,9 @@ github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKz github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= @@ -93,11 +96,13 @@ github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSa github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -147,6 +152,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJ github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -196,6 +202,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= @@ -229,6 +236,7 @@ github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSM github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -264,7 +272,9 @@ github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= +github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= +github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= @@ -301,7 +311,9 @@ github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/ github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -327,8 +339,11 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -340,9 +355,11 @@ github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+ github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -366,6 +383,7 @@ github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclK github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -412,6 +430,7 @@ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= +github.com/gofrs/uuid v4.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -612,6 +631,7 @@ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1C github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c h1:XImQJfpJLmGEEd8ll5yPVyL/aEvmgGHW4WYTyNseLOM= +github.com/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= @@ -809,8 +829,11 @@ github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -821,7 +844,9 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= +github.com/otiai10/copy v1.6.0/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -904,6 +929,7 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= +github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= @@ -945,6 +971,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1155,6 +1182,7 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1240,6 +1268,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1425,11 +1454,13 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1598,6 +1629,7 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1610,6 +1642,7 @@ honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= +pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/testutil/network/network.go b/testutil/network/network.go index d15c09dd..45889f2a 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -40,6 +40,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/genutil" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/testutil/network/util.go b/testutil/network/util.go index 79bfaead..5d6e8340 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -20,6 +20,7 @@ import ( srvtypes "github.com/cosmos/cosmos-sdk/server/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil" genutiltypes "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" ) diff --git a/x/distribution/abci.go b/x/distribution/abci.go index d0e65c83..b7258978 100644 --- a/x/distribution/abci.go +++ b/x/distribution/abci.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/client/cli/query.go b/x/distribution/client/cli/query.go index f6c35570..5d5dba84 100644 --- a/x/distribution/client/cli/query.go +++ b/x/distribution/client/cli/query.go @@ -12,6 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index 744df970..d4fbc269 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -14,6 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/client/cli/tx_test.go b/x/distribution/client/cli/tx_test.go index 36a946e7..bdef34ed 100644 --- a/x/distribution/client/cli/tx_test.go +++ b/x/distribution/client/cli/tx_test.go @@ -4,17 +4,14 @@ import ( "testing" "github.com/spf13/pflag" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/simapp/params" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" - - "github.com/stretchr/testify/require" - - "github.com/stretchr/testify/assert" - - "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/distribution/client/cli/utils.go b/x/distribution/client/cli/utils.go index 56912904..b0223b01 100644 --- a/x/distribution/client/cli/utils.go +++ b/x/distribution/client/cli/utils.go @@ -4,6 +4,7 @@ import ( "os" "github.com/cosmos/cosmos-sdk/codec" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/client/common/common.go b/x/distribution/client/common/common.go index 1c3f1d04..b1e31081 100644 --- a/x/distribution/client/common/common.go +++ b/x/distribution/client/common/common.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/client/common/common_test.go b/x/distribution/client/common/common_test.go index ff9bb88d..05fa5930 100644 --- a/x/distribution/client/common/common_test.go +++ b/x/distribution/client/common/common_test.go @@ -3,11 +3,10 @@ package common import ( "testing" - "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec/legacy" ) func TestQueryDelegationRewardsAddrValidation(t *testing.T) { diff --git a/x/distribution/client/proposal_handler.go b/x/distribution/client/proposal_handler.go index 1cfe7962..65865e93 100644 --- a/x/distribution/client/proposal_handler.go +++ b/x/distribution/client/proposal_handler.go @@ -3,6 +3,7 @@ package client import ( "github.com/cosmos/cosmos-sdk/x/distribution/client/rest" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/client/cli" ) diff --git a/x/distribution/client/testutil/grpc_query_suite.go b/x/distribution/client/testutil/grpc_query_suite.go index 5e902ff1..36ced097 100644 --- a/x/distribution/client/testutil/grpc_query_suite.go +++ b/x/distribution/client/testutil/grpc_query_suite.go @@ -12,6 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/types/rest" "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/iqlusioninc/liquidity-staking-module/testutil/network" ) diff --git a/x/distribution/client/testutil/helpers.go b/x/distribution/client/testutil/helpers.go index 845d68ec..201f40d6 100644 --- a/x/distribution/client/testutil/helpers.go +++ b/x/distribution/client/testutil/helpers.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/client" + distrcli "github.com/iqlusioninc/liquidity-staking-module/x/distribution/client/cli" ) diff --git a/x/distribution/client/testutil/suite.go b/x/distribution/client/testutil/suite.go index d4169041..dd1df199 100644 --- a/x/distribution/client/testutil/suite.go +++ b/x/distribution/client/testutil/suite.go @@ -14,6 +14,7 @@ import ( clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/iqlusioninc/liquidity-staking-module/testutil/network" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/client/cli" ) diff --git a/x/distribution/client/testutil/withdraw_all_suite.go b/x/distribution/client/testutil/withdraw_all_suite.go index 30ba477f..164f226f 100644 --- a/x/distribution/client/testutil/withdraw_all_suite.go +++ b/x/distribution/client/testutil/withdraw_all_suite.go @@ -4,16 +4,18 @@ import ( "fmt" "strings" + "github.com/stretchr/testify/suite" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" + "github.com/iqlusioninc/liquidity-staking-module/testutil/network" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/client/cli" stakingcli "github.com/iqlusioninc/liquidity-staking-module/x/staking/client/cli" - "github.com/stretchr/testify/suite" ) type WithdrawAllTestSuite struct { diff --git a/x/distribution/handler.go b/x/distribution/handler.go index c7ede8ac..df0cb36f 100644 --- a/x/distribution/handler.go +++ b/x/distribution/handler.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/handler_test.go b/x/distribution/handler_test.go index 862b0984..8fdaa26d 100644 --- a/x/distribution/handler_test.go +++ b/x/distribution/handler_test.go @@ -3,12 +3,14 @@ package distribution_test import ( "testing" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) // test msg registration diff --git a/x/distribution/keeper/alias_functions.go b/x/distribution/keeper/alias_functions.go index 87e8c10a..661a4532 100644 --- a/x/distribution/keeper/alias_functions.go +++ b/x/distribution/keeper/alias_functions.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go index 59981e86..55df4da7 100644 --- a/x/distribution/keeper/allocation.go +++ b/x/distribution/keeper/allocation.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index 7e8ccaf3..cb32b1e7 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -10,6 +10,7 @@ import ( simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" distrtypes "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" diff --git a/x/distribution/keeper/common_test.go b/x/distribution/keeper/common_test.go index 8a088d45..17498807 100644 --- a/x/distribution/keeper/common_test.go +++ b/x/distribution/keeper/common_test.go @@ -3,6 +3,7 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index 7ac0b9e4..e7845735 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -4,9 +4,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index f17b9758..88dbfd5f 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -9,6 +9,7 @@ import ( simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" "github.com/iqlusioninc/liquidity-staking-module/x/staking" diff --git a/x/distribution/keeper/fee_pool.go b/x/distribution/keeper/fee_pool.go index c75d9413..0f8e215f 100644 --- a/x/distribution/keeper/fee_pool.go +++ b/x/distribution/keeper/fee_pool.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/genesis.go b/x/distribution/keeper/genesis.go index a6a42e57..94f2cf0e 100644 --- a/x/distribution/keeper/genesis.go +++ b/x/distribution/keeper/genesis.go @@ -4,6 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/grpc_query.go b/x/distribution/keeper/grpc_query.go index 29b5a5c2..709bd65f 100644 --- a/x/distribution/keeper/grpc_query.go +++ b/x/distribution/keeper/grpc_query.go @@ -3,16 +3,17 @@ package keeper import ( "context" - errorsmod "cosmossdk.io/errors" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/grpc_query_test.go b/x/distribution/keeper/grpc_query_test.go index 5086af82..b689ddbb 100644 --- a/x/distribution/keeper/grpc_query_test.go +++ b/x/distribution/keeper/grpc_query_test.go @@ -14,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" "github.com/iqlusioninc/liquidity-staking-module/x/staking" diff --git a/x/distribution/keeper/hooks.go b/x/distribution/keeper/hooks.go index 10ff8680..1520c82a 100644 --- a/x/distribution/keeper/hooks.go +++ b/x/distribution/keeper/hooks.go @@ -2,6 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) @@ -117,15 +118,15 @@ func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, f return nil } -func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { return nil } +func (Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } diff --git a/x/distribution/keeper/invariants.go b/x/distribution/keeper/invariants.go index 03135d69..ef08ca9e 100644 --- a/x/distribution/keeper/invariants.go +++ b/x/distribution/keeper/invariants.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go index 3e1222b7..645961ec 100644 --- a/x/distribution/keeper/keeper.go +++ b/x/distribution/keeper/keeper.go @@ -3,16 +3,17 @@ package keeper import ( "fmt" - errorsmod "cosmossdk.io/errors" - "github.com/tendermint/tendermint/libs/log" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) @@ -56,7 +57,7 @@ func NewKeeper( } // Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { +func (Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+types.ModuleName) } diff --git a/x/distribution/keeper/keeper_test.go b/x/distribution/keeper/keeper_test.go index 07f35a93..3b8bbc39 100644 --- a/x/distribution/keeper/keeper_test.go +++ b/x/distribution/keeper/keeper_test.go @@ -9,6 +9,7 @@ import ( simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go index 9ab1f327..9c795807 100644 --- a/x/distribution/keeper/msg_server.go +++ b/x/distribution/keeper/msg_server.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/params.go b/x/distribution/keeper/params.go index 11a161f3..60da3017 100644 --- a/x/distribution/keeper/params.go +++ b/x/distribution/keeper/params.go @@ -2,6 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/proposal_handler.go b/x/distribution/keeper/proposal_handler.go index da0d47b3..c1af296a 100644 --- a/x/distribution/keeper/proposal_handler.go +++ b/x/distribution/keeper/proposal_handler.go @@ -2,8 +2,10 @@ package keeper import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/querier.go b/x/distribution/keeper/querier.go index 0f1626e4..e26adbc3 100644 --- a/x/distribution/keeper/querier.go +++ b/x/distribution/keeper/querier.go @@ -3,15 +3,16 @@ package keeper import ( "encoding/json" - errorsmod "cosmossdk.io/errors" - abci "github.com/tendermint/tendermint/abci/types" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/querier_test.go b/x/distribution/keeper/querier_test.go index 12e15382..00f4a590 100644 --- a/x/distribution/keeper/querier_test.go +++ b/x/distribution/keeper/querier_test.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" diff --git a/x/distribution/keeper/store.go b/x/distribution/keeper/store.go index 6c6109d1..cea7ff57 100644 --- a/x/distribution/keeper/store.go +++ b/x/distribution/keeper/store.go @@ -4,6 +4,7 @@ import ( gogotypes "github.com/gogo/protobuf/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/keeper/validator.go b/x/distribution/keeper/validator.go index a90690b9..00884bb0 100644 --- a/x/distribution/keeper/validator.go +++ b/x/distribution/keeper/validator.go @@ -4,8 +4,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/module.go b/x/distribution/module.go index 1fd5e8c1..dfca7bf8 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -17,6 +17,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/client/cli" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/simulation" @@ -84,7 +85,7 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { } // RegisterInterfaces implements InterfaceModule -func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { types.RegisterInterfaces(registry) } @@ -123,7 +124,7 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { } // Deprecated: Route returns the message routing key for the distribution module. -func (am AppModule) Route() sdk.Route { +func (AppModule) Route() sdk.Route { return sdk.Route{} } diff --git a/x/distribution/module_test.go b/x/distribution/module_test.go index 3012fbb9..661f8cb0 100644 --- a/x/distribution/module_test.go +++ b/x/distribution/module_test.go @@ -11,6 +11,7 @@ import ( dbm "github.com/tendermint/tm-db" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/proposal_handler_test.go b/x/distribution/proposal_handler_test.go index 21ffdc1e..716b6873 100644 --- a/x/distribution/proposal_handler_test.go +++ b/x/distribution/proposal_handler_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" diff --git a/x/distribution/simulation/decoder.go b/x/distribution/simulation/decoder.go index 13a21859..d897dd64 100644 --- a/x/distribution/simulation/decoder.go +++ b/x/distribution/simulation/decoder.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/simulation/decoder_test.go b/x/distribution/simulation/decoder_test.go index c7797b5c..00da7cbc 100644 --- a/x/distribution/simulation/decoder_test.go +++ b/x/distribution/simulation/decoder_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/simulation" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" diff --git a/x/distribution/simulation/genesis.go b/x/distribution/simulation/genesis.go index 5c0dfcec..df6d64b7 100644 --- a/x/distribution/simulation/genesis.go +++ b/x/distribution/simulation/genesis.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/simulation/genesis_test.go b/x/distribution/simulation/genesis_test.go index 26784b4d..2b51b74c 100644 --- a/x/distribution/simulation/genesis_test.go +++ b/x/distribution/simulation/genesis_test.go @@ -12,6 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/simulation" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/simulation/operations.go b/x/distribution/simulation/operations.go index 5490afed..93d5d6a5 100644 --- a/x/distribution/simulation/operations.go +++ b/x/distribution/simulation/operations.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" stakingkeeper "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index 7a684017..4ecd76d1 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -4,15 +4,15 @@ import ( "math/rand" "testing" - "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec/legacy" simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" simappparams "github.com/iqlusioninc/liquidity-staking-module/app/params" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/simulation" diff --git a/x/distribution/simulation/params.go b/x/distribution/simulation/params.go index 8b47db05..ad433581 100644 --- a/x/distribution/simulation/params.go +++ b/x/distribution/simulation/params.go @@ -6,9 +6,9 @@ import ( "fmt" "math/rand" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/simulation/proposals.go b/x/distribution/simulation/proposals.go index ccb0b7d9..d219cd8e 100644 --- a/x/distribution/simulation/proposals.go +++ b/x/distribution/simulation/proposals.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/simulation/proposals_test.go b/x/distribution/simulation/proposals_test.go index 14acf3cd..2df306dd 100644 --- a/x/distribution/simulation/proposals_test.go +++ b/x/distribution/simulation/proposals_test.go @@ -10,6 +10,7 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/distribution/simulation" ) diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index 1bf201e4..8a156c03 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/distribution/types/fee_pool_test.go b/x/distribution/types/fee_pool_test.go index 121b9ceb..8ed7a21b 100644 --- a/x/distribution/types/fee_pool_test.go +++ b/x/distribution/types/fee_pool_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/types/msg.go b/x/distribution/types/msg.go index fccacfc9..34628cc8 100644 --- a/x/distribution/types/msg.go +++ b/x/distribution/types/msg.go @@ -2,8 +2,8 @@ package types import ( errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -32,8 +32,8 @@ func NewMsgSetWithdrawAddress(delAddr, withdrawAddr sdk.AccAddress) *MsgSetWithd } } -func (msg MsgSetWithdrawAddress) Route() string { return ModuleName } -func (msg MsgSetWithdrawAddress) Type() string { return TypeMsgSetWithdrawAddress } +func (MsgSetWithdrawAddress) Route() string { return ModuleName } +func (MsgSetWithdrawAddress) Type() string { return TypeMsgSetWithdrawAddress } // Return address that must sign over msg.GetSignBytes() func (msg MsgSetWithdrawAddress) GetSigners() []sdk.AccAddress { @@ -69,8 +69,8 @@ func NewMsgWithdrawDelegatorReward(delAddr sdk.AccAddress, valAddr sdk.ValAddres } } -func (msg MsgWithdrawDelegatorReward) Route() string { return ModuleName } -func (msg MsgWithdrawDelegatorReward) Type() string { return TypeMsgWithdrawDelegatorReward } +func (MsgWithdrawDelegatorReward) Route() string { return ModuleName } +func (MsgWithdrawDelegatorReward) Type() string { return TypeMsgWithdrawDelegatorReward } // Return address that must sign over msg.GetSignBytes() func (msg MsgWithdrawDelegatorReward) GetSigners() []sdk.AccAddress { @@ -104,8 +104,8 @@ func NewMsgWithdrawValidatorCommission(valAddr sdk.ValAddress) *MsgWithdrawValid } } -func (msg MsgWithdrawValidatorCommission) Route() string { return ModuleName } -func (msg MsgWithdrawValidatorCommission) Type() string { return TypeMsgWithdrawValidatorCommission } +func (MsgWithdrawValidatorCommission) Route() string { return ModuleName } +func (MsgWithdrawValidatorCommission) Type() string { return TypeMsgWithdrawValidatorCommission } // Return address that must sign over msg.GetSignBytes() func (msg MsgWithdrawValidatorCommission) GetSigners() []sdk.AccAddress { @@ -137,10 +137,10 @@ func NewMsgFundCommunityPool(amount sdk.Coins, depositor sdk.AccAddress) *MsgFun } // Route returns the MsgFundCommunityPool message route. -func (msg MsgFundCommunityPool) Route() string { return ModuleName } +func (MsgFundCommunityPool) Route() string { return ModuleName } // Type returns the MsgFundCommunityPool message type. -func (msg MsgFundCommunityPool) Type() string { return TypeMsgFundCommunityPool } +func (MsgFundCommunityPool) Type() string { return TypeMsgFundCommunityPool } // GetSigners returns the signer addresses that are expected to sign the result // of GetSignBytes. @@ -177,8 +177,8 @@ func NewMsgWithdrawTokenizeShareRecordReward(ownerAddr sdk.AccAddress, recordID } } -func (msg MsgWithdrawTokenizeShareRecordReward) Route() string { return ModuleName } -func (msg MsgWithdrawTokenizeShareRecordReward) Type() string { +func (MsgWithdrawTokenizeShareRecordReward) Route() string { return ModuleName } +func (MsgWithdrawTokenizeShareRecordReward) Type() string { return TypeMsgWithdrawTokenizeShareRecordReward } @@ -211,8 +211,8 @@ func NewMsgWithdrawAllTokenizeShareRecordReward(ownerAddr sdk.AccAddress) *MsgWi } } -func (msg MsgWithdrawAllTokenizeShareRecordReward) Route() string { return ModuleName } -func (msg MsgWithdrawAllTokenizeShareRecordReward) Type() string { +func (MsgWithdrawAllTokenizeShareRecordReward) Route() string { return ModuleName } +func (MsgWithdrawAllTokenizeShareRecordReward) Type() string { return TypeMsgWithdrawAllTokenizeShareRecordReward } diff --git a/x/distribution/types/params_test.go b/x/distribution/types/params_test.go index efc35364..776d65c1 100644 --- a/x/distribution/types/params_test.go +++ b/x/distribution/types/params_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" ) diff --git a/x/distribution/types/proposal.go b/x/distribution/types/proposal.go index fa032bbf..8e8da8ff 100644 --- a/x/distribution/types/proposal.go +++ b/x/distribution/types/proposal.go @@ -37,10 +37,10 @@ func (csp *CommunityPoolSpendProposal) GetTitle() string { return csp.Title } func (csp *CommunityPoolSpendProposal) GetDescription() string { return csp.Description } // GetDescription returns the routing key of a community pool spend proposal. -func (csp *CommunityPoolSpendProposal) ProposalRoute() string { return RouterKey } +func (*CommunityPoolSpendProposal) ProposalRoute() string { return RouterKey } // ProposalType returns the type of a community pool spend proposal. -func (csp *CommunityPoolSpendProposal) ProposalType() string { return ProposalTypeCommunityPoolSpend } +func (*CommunityPoolSpendProposal) ProposalType() string { return ProposalTypeCommunityPoolSpend } // ValidateBasic runs basic stateless validity checks func (csp *CommunityPoolSpendProposal) ValidateBasic() error { diff --git a/x/genutil/client/cli/collect.go b/x/genutil/client/cli/collect.go index f0d4f159..2788deb8 100644 --- a/x/genutil/client/cli/collect.go +++ b/x/genutil/client/cli/collect.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil" "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" ) diff --git a/x/genutil/client/cli/gentx.go b/x/genutil/client/cli/gentx.go index 6d6875d2..d3bb7ba5 100644 --- a/x/genutil/client/cli/gentx.go +++ b/x/genutil/client/cli/gentx.go @@ -23,6 +23,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil" "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" "github.com/iqlusioninc/liquidity-staking-module/x/staking/client/cli" diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index b74f951d..c8a2111b 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -22,6 +22,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/genutil/client/cli/init_test.go b/x/genutil/client/cli/init_test.go index f421c2c1..f68bfed2 100644 --- a/x/genutil/client/cli/init_test.go +++ b/x/genutil/client/cli/init_test.go @@ -24,6 +24,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil" genutilcli "github.com/iqlusioninc/liquidity-staking-module/x/genutil/client/cli" genutiltest "github.com/iqlusioninc/liquidity-staking-module/x/genutil/client/testutil" diff --git a/x/genutil/client/testutil/helpers.go b/x/genutil/client/testutil/helpers.go index d7d7d6a8..d188ae19 100644 --- a/x/genutil/client/testutil/helpers.go +++ b/x/genutil/client/testutil/helpers.go @@ -14,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/types/module" + genutilcli "github.com/iqlusioninc/liquidity-staking-module/x/genutil/client/cli" ) diff --git a/x/genutil/client/testutil/suite.go b/x/genutil/client/testutil/suite.go index 6bc94ba2..758a612e 100644 --- a/x/genutil/client/testutil/suite.go +++ b/x/genutil/client/testutil/suite.go @@ -15,6 +15,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/genutil/client/cli" stakingcli "github.com/iqlusioninc/liquidity-staking-module/x/staking/client/cli" diff --git a/x/genutil/collect.go b/x/genutil/collect.go index f21c1abd..dfc90b33 100644 --- a/x/genutil/collect.go +++ b/x/genutil/collect.go @@ -19,6 +19,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/genutil/collect_test.go b/x/genutil/collect_test.go index 1db1a9b5..87251cbb 100644 --- a/x/genutil/collect_test.go +++ b/x/genutil/collect_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/gogo/protobuf/proto" - tmtypes "github.com/tendermint/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" @@ -15,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil" gtypes "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" ) @@ -31,7 +31,7 @@ type doNothingIterator struct { gtypes.GenesisBalancesIterator } -func (dni *doNothingIterator) IterateGenesisBalances(_ codec.JSONCodec, _ map[string]json.RawMessage, _ func(bankexported.GenesisBalance) bool) { +func (*doNothingIterator) IterateGenesisBalances(_ codec.JSONCodec, _ map[string]json.RawMessage, _ func(bankexported.GenesisBalance) bool) { } // Ensures that CollectTx correctly traverses directories and won't error out on encountering diff --git a/x/genutil/genesis.go b/x/genutil/genesis.go index 0a58556b..d62cfa2a 100644 --- a/x/genutil/genesis.go +++ b/x/genutil/genesis.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" ) diff --git a/x/genutil/gentx.go b/x/genutil/gentx.go index e407ce69..e35aca49 100644 --- a/x/genutil/gentx.go +++ b/x/genutil/gentx.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/genutil/gentx_test.go b/x/genutil/gentx_test.go index 951bba3c..fe317a7b 100644 --- a/x/genutil/gentx_test.go +++ b/x/genutil/gentx_test.go @@ -16,6 +16,7 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/genutil" "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" diff --git a/x/genutil/module.go b/x/genutil/module.go index a5b14d51..70ccf831 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -7,7 +7,6 @@ import ( "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/client" @@ -15,6 +14,7 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" ) @@ -35,7 +35,7 @@ func (AppModuleBasic) Name() string { func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} // RegisterInterfaces registers the module's interface types -func (b AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry) {} +func (AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry) {} // DefaultGenesis returns default genesis state as raw bytes for the genutil // module. @@ -44,7 +44,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // ValidateGenesis performs genesis state validation for the genutil module. -func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, txEncodingConfig client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, txEncodingConfig client.TxEncodingConfig, bz json.RawMessage) error { var data types.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) diff --git a/x/genutil/types/genesis_state.go b/x/genutil/types/genesis_state.go index 4c2b5215..d4fb487e 100644 --- a/x/genutil/types/genesis_state.go +++ b/x/genutil/types/genesis_state.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/genutil/types/genesis_state_test.go b/x/genutil/types/genesis_state_test.go index f9f46372..f22afa41 100644 --- a/x/genutil/types/genesis_state_test.go +++ b/x/genutil/types/genesis_state_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/genutil/types" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/slashing/abci.go b/x/slashing/abci.go index da5b2c16..89372a6c 100644 --- a/x/slashing/abci.go +++ b/x/slashing/abci.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index c6676474..b36743b3 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/slashing" "github.com/iqlusioninc/liquidity-staking-module/x/staking" diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 30bf9e6c..dfb14bad 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -15,6 +15,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/slashing/client/cli/query.go b/x/slashing/client/cli/query.go index 342f6496..583c096a 100644 --- a/x/slashing/client/cli/query.go +++ b/x/slashing/client/cli/query.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/client/cli/tx.go b/x/slashing/client/cli/tx.go index eb01fee3..9ee47e17 100644 --- a/x/slashing/client/cli/tx.go +++ b/x/slashing/client/cli/tx.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/client/testutil/suite.go b/x/slashing/client/testutil/suite.go index de52adc3..136f559e 100644 --- a/x/slashing/client/testutil/suite.go +++ b/x/slashing/client/testutil/suite.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/testutil/network" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/client/cli" ) diff --git a/x/slashing/keeper/genesis.go b/x/slashing/keeper/genesis.go index b3422d8e..8a616b21 100644 --- a/x/slashing/keeper/genesis.go +++ b/x/slashing/keeper/genesis.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/keeper/genesis_test.go b/x/slashing/keeper/genesis_test.go index 18ca1bb8..3728d100 100644 --- a/x/slashing/keeper/genesis_test.go +++ b/x/slashing/keeper/genesis_test.go @@ -8,6 +8,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/testslashing" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" diff --git a/x/slashing/keeper/grpc_query.go b/x/slashing/keeper/grpc_query.go index 17f6a1f0..642afc24 100644 --- a/x/slashing/keeper/grpc_query.go +++ b/x/slashing/keeper/grpc_query.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/keeper/grpc_query_test.go b/x/slashing/keeper/grpc_query_test.go index 50b341a8..8520e6ab 100644 --- a/x/slashing/keeper/grpc_query_test.go +++ b/x/slashing/keeper/grpc_query_test.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/testslashing" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index 89593652..9be2163e 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -6,6 +6,7 @@ import ( "github.com/tendermint/tendermint/crypto" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) @@ -75,34 +76,34 @@ func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) er } // Implements sdk.ValidatorHooks - just addition to fulfill the staking hook interface -func (h Hooks) BeforeTokenizeShareRecordRemoved(_ sdk.Context, _ uint64) error { +func (Hooks) BeforeTokenizeShareRecordRemoved(_ sdk.Context, _ uint64) error { return nil } -func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { +func (Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) error { +func (Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) error { return nil } diff --git a/x/slashing/keeper/infractions.go b/x/slashing/keeper/infractions.go index c02fb6ae..8ce794aa 100644 --- a/x/slashing/keeper/infractions.go +++ b/x/slashing/keeper/infractions.go @@ -6,6 +6,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/keeper/keeper.go b/x/slashing/keeper/keeper.go index 98978552..534a68bb 100644 --- a/x/slashing/keeper/keeper.go +++ b/x/slashing/keeper/keeper.go @@ -10,6 +10,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) @@ -37,7 +38,7 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, sk types.StakingK } // Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { +func (Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+types.ModuleName) } diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index a2d34662..a5829fe2 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/testslashing" "github.com/iqlusioninc/liquidity-staking-module/x/staking" diff --git a/x/slashing/keeper/migrations.go b/x/slashing/keeper/migrations.go index ea1dba04..f77bb200 100644 --- a/x/slashing/keeper/migrations.go +++ b/x/slashing/keeper/migrations.go @@ -15,6 +15,6 @@ func NewMigrator(keeper Keeper) Migrator { } // Migrate1to2 migrates from version 1 to 2. -func (m Migrator) Migrate1to2(_ sdk.Context) error { +func (Migrator) Migrate1to2(_ sdk.Context) error { return nil } diff --git a/x/slashing/keeper/msg_server.go b/x/slashing/keeper/msg_server.go index 1d8f8366..c0a1447b 100644 --- a/x/slashing/keeper/msg_server.go +++ b/x/slashing/keeper/msg_server.go @@ -4,6 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/keeper/params.go b/x/slashing/keeper/params.go index 46a72e8a..1bd62200 100644 --- a/x/slashing/keeper/params.go +++ b/x/slashing/keeper/params.go @@ -4,6 +4,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/keeper/querier.go b/x/slashing/keeper/querier.go index aa3d5015..d6776bce 100644 --- a/x/slashing/keeper/querier.go +++ b/x/slashing/keeper/querier.go @@ -1,14 +1,16 @@ package keeper import ( - errorsmod "cosmossdk.io/errors" abci "github.com/tendermint/tendermint/abci/types" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/keeper/querier_test.go b/x/slashing/keeper/querier_test.go index 19302e9d..d734d39c 100644 --- a/x/slashing/keeper/querier_test.go +++ b/x/slashing/keeper/querier_test.go @@ -4,11 +4,11 @@ import ( "testing" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/testslashing" diff --git a/x/slashing/keeper/signing_info.go b/x/slashing/keeper/signing_info.go index 4479da7c..a32e6ac3 100644 --- a/x/slashing/keeper/signing_info.go +++ b/x/slashing/keeper/signing_info.go @@ -6,6 +6,7 @@ import ( gogotypes "github.com/gogo/protobuf/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/keeper/signing_info_test.go b/x/slashing/keeper/signing_info_test.go index f8f2722b..3806ac6e 100644 --- a/x/slashing/keeper/signing_info_test.go +++ b/x/slashing/keeper/signing_info_test.go @@ -8,6 +8,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/module.go b/x/slashing/module.go index bc128d06..c88a94ab 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -17,6 +17,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/client/cli" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/simulation" @@ -48,7 +49,7 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { types.RegisterInterfaces(registry) } @@ -117,10 +118,10 @@ func (AppModule) Name() string { } // RegisterInvariants registers the slashing module invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // Deprecated: Route returns the message routing key for the slashing module. -func (am AppModule) Route() sdk.Route { +func (AppModule) Route() sdk.Route { return sdk.Route{} } diff --git a/x/slashing/simulation/decoder.go b/x/slashing/simulation/decoder.go index e899c6ee..d6d67cde 100644 --- a/x/slashing/simulation/decoder.go +++ b/x/slashing/simulation/decoder.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types/kv" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/simulation/decoder_test.go b/x/slashing/simulation/decoder_test.go index 8a36ca1d..790e4cf2 100644 --- a/x/slashing/simulation/decoder_test.go +++ b/x/slashing/simulation/decoder_test.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/simulation" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" diff --git a/x/slashing/simulation/genesis.go b/x/slashing/simulation/genesis.go index 6fd62c92..c65170ae 100644 --- a/x/slashing/simulation/genesis.go +++ b/x/slashing/simulation/genesis.go @@ -11,6 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/simulation/genesis_test.go b/x/slashing/simulation/genesis_test.go index fbd23c61..9a8f1778 100644 --- a/x/slashing/simulation/genesis_test.go +++ b/x/slashing/simulation/genesis_test.go @@ -13,6 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/simulation" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/simulation/operations.go b/x/slashing/simulation/operations.go index 39966a7a..0e2210bb 100644 --- a/x/slashing/simulation/operations.go +++ b/x/slashing/simulation/operations.go @@ -11,6 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" stakingkeeper "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index 1abaecca..705f2dab 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -5,13 +5,12 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec/legacy" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" simapp_test "github.com/cosmos/cosmos-sdk/simapp" @@ -21,6 +20,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" distrtypes "github.com/iqlusioninc/liquidity-staking-module/x/distribution/types" "github.com/iqlusioninc/liquidity-staking-module/x/slashing/simulation" diff --git a/x/slashing/simulation/params.go b/x/slashing/simulation/params.go index b0692507..cdcd4d0d 100644 --- a/x/slashing/simulation/params.go +++ b/x/slashing/simulation/params.go @@ -8,6 +8,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/slashing/types" ) diff --git a/x/slashing/types/msg.go b/x/slashing/types/msg.go index 62bec0bb..86621207 100644 --- a/x/slashing/types/msg.go +++ b/x/slashing/types/msg.go @@ -23,8 +23,8 @@ func NewMsgUnjail(validatorAddr sdk.ValAddress) *MsgUnjail { } } -func (msg MsgUnjail) Route() string { return RouterKey } -func (msg MsgUnjail) Type() string { return TypeMsgUnjail } +func (MsgUnjail) Route() string { return RouterKey } +func (MsgUnjail) Type() string { return TypeMsgUnjail } func (msg MsgUnjail) GetSigners() []sdk.AccAddress { valAddr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddr) return []sdk.AccAddress{sdk.AccAddress(valAddr)} diff --git a/x/staking/abci.go b/x/staking/abci.go index d801164b..e9a25cd8 100644 --- a/x/staking/abci.go +++ b/x/staking/abci.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/app_test.go b/x/staking/app_test.go index d9730292..cf23469f 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -11,6 +11,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/bench_test.go b/x/staking/bench_test.go index 8bc208d8..6c03d010 100644 --- a/x/staking/bench_test.go +++ b/x/staking/bench_test.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/client/cli/query.go b/x/staking/client/cli/query.go index 81f5d714..e469fa58 100644 --- a/x/staking/client/cli/query.go +++ b/x/staking/client/cli/query.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index 3dd0c0b2..0805903a 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -15,6 +15,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/client/cli/utils.go b/x/staking/client/cli/utils.go index b0f529f8..3b0d9f2f 100644 --- a/x/staking/client/cli/utils.go +++ b/x/staking/client/cli/utils.go @@ -4,6 +4,7 @@ import ( "errors" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/client/testutil/grpc.go b/x/staking/client/testutil/grpc.go index ea6738f9..36bae973 100644 --- a/x/staking/client/testutil/grpc.go +++ b/x/staking/client/testutil/grpc.go @@ -12,6 +12,7 @@ import ( grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/types/rest" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/client/cli" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/client/testutil/suite.go b/x/staking/client/testutil/suite.go index 908d3e7f..43e51d20 100644 --- a/x/staking/client/testutil/suite.go +++ b/x/staking/client/testutil/suite.go @@ -20,6 +20,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" + "github.com/iqlusioninc/liquidity-staking-module/testutil/network" "github.com/iqlusioninc/liquidity-staking-module/x/staking/client/cli" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/client/testutil/test_helpers.go b/x/staking/client/testutil/test_helpers.go index 1cb38728..53ad1c3e 100644 --- a/x/staking/client/testutil/test_helpers.go +++ b/x/staking/client/testutil/test_helpers.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" + stakingcli "github.com/iqlusioninc/liquidity-staking-module/x/staking/client/cli" ) diff --git a/x/staking/common_test.go b/x/staking/common_test.go index 1eb7eb0a..7168829d 100644 --- a/x/staking/common_test.go +++ b/x/staking/common_test.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/genesis.go b/x/staking/genesis.go index fa1c5979..0c75ed8c 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -8,6 +8,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index c766376b..5ed91d61 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/handler.go b/x/staking/handler.go index 6d84afc9..cb75e077 100644 --- a/x/staking/handler.go +++ b/x/staking/handler.go @@ -2,9 +2,10 @@ package staking import ( errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/handler_test.go b/x/staking/handler_test.go index 4befdadf..ab75b3d3 100644 --- a/x/staking/handler_test.go +++ b/x/staking/handler_test.go @@ -8,6 +8,7 @@ import ( simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" ) diff --git a/x/staking/keeper/alias_functions.go b/x/staking/keeper/alias_functions.go index b34e5f86..2ea411c7 100644 --- a/x/staking/keeper/alias_functions.go +++ b/x/staking/keeper/alias_functions.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/common_test.go b/x/staking/keeper/common_test.go index a68931d9..10e17a90 100644 --- a/x/staking/keeper/common_test.go +++ b/x/staking/keeper/common_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index 0f5413ec..04bc6075 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index dab8169b..b6dd72e8 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -9,6 +9,7 @@ import ( simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" diff --git a/x/staking/keeper/genesis.go b/x/staking/keeper/genesis.go index 04b1d5b5..ebbb45e2 100644 --- a/x/staking/keeper/genesis.go +++ b/x/staking/keeper/genesis.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/genesis_test.go b/x/staking/keeper/genesis_test.go index a7d0042f..b5fd1393 100644 --- a/x/staking/keeper/genesis_test.go +++ b/x/staking/keeper/genesis_test.go @@ -12,6 +12,7 @@ import ( simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index 455290d2..5c629799 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -11,6 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/grpc_query_test.go b/x/staking/keeper/grpc_query_test.go index f02bee36..90c84a61 100644 --- a/x/staking/keeper/grpc_query_test.go +++ b/x/staking/keeper/grpc_query_test.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" diff --git a/x/staking/keeper/historical_info.go b/x/staking/keeper/historical_info.go index 00c93210..a3d8676f 100644 --- a/x/staking/keeper/historical_info.go +++ b/x/staking/keeper/historical_info.go @@ -2,6 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/historical_info_test.go b/x/staking/keeper/historical_info_test.go index 948818d9..4b7ea494 100644 --- a/x/staking/keeper/historical_info_test.go +++ b/x/staking/keeper/historical_info_test.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/keeper/hooks.go b/x/staking/keeper/hooks.go index 31965e89..42185d0b 100644 --- a/x/staking/keeper/hooks.go +++ b/x/staking/keeper/hooks.go @@ -2,6 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/invariants.go b/x/staking/keeper/invariants.go index d724b51a..a4fe28bd 100644 --- a/x/staking/keeper/invariants.go +++ b/x/staking/keeper/invariants.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index 2866825c..f1a38ee4 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -9,6 +9,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) @@ -58,7 +59,7 @@ func NewKeeper( } // Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { +func (Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+types.ModuleName) } diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index d5361b4a..650f9bf1 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -5,11 +5,11 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/keeper/liquid_stake.go b/x/staking/keeper/liquid_stake.go index c87a2312..c009d8ee 100644 --- a/x/staking/keeper/liquid_stake.go +++ b/x/staking/keeper/liquid_stake.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) @@ -41,7 +42,7 @@ func (k Keeper) GetTotalLiquidStakedTokens(ctx sdk.Context) sdk.Int { // Check if an account is a owned by a liquid staking provider // This is determined by checking if the account has a 32-length address // NOTE: This will have to be refactored before adapting it to chains beyond gaia -func (k Keeper) AccountIsLiquidStakingProvider(address sdk.AccAddress) bool { +func (Keeper) AccountIsLiquidStakingProvider(address sdk.AccAddress) bool { return len(address) == 32 } diff --git a/x/staking/keeper/liquid_stake_test.go b/x/staking/keeper/liquid_stake_test.go index 468796f6..c74620c6 100644 --- a/x/staking/keeper/liquid_stake_test.go +++ b/x/staking/keeper/liquid_stake_test.go @@ -5,14 +5,16 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" - "github.com/stretchr/testify/require" ) // Helper function to create a base account from an account name diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index cb67adcd..98ddf64c 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -7,12 +7,12 @@ import ( "strconv" "time" - errorsmod "cosmossdk.io/errors" - metrics "github.com/armon/go-metrics" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + errorsmod "cosmossdk.io/errors" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,6 +20,7 @@ import ( vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/msg_server_test.go b/x/staking/keeper/msg_server_test.go index 3700aff9..14b0a2ef 100644 --- a/x/staking/keeper/msg_server_test.go +++ b/x/staking/keeper/msg_server_test.go @@ -5,19 +5,20 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" - "github.com/stretchr/testify/require" ) func TestTokenizeSharesAndRedeemTokens(t *testing.T) { diff --git a/x/staking/keeper/params.go b/x/staking/keeper/params.go index 5074ebf0..bffce4b6 100644 --- a/x/staking/keeper/params.go +++ b/x/staking/keeper/params.go @@ -4,6 +4,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) @@ -36,14 +37,14 @@ func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32) { // BondDenom - Bondable coin denomination func (k Keeper) BondDenom(ctx sdk.Context) (res string) { k.paramstore.Get(ctx, types.KeyBondDenom, &res) - return + return res } // PowerReduction - is the amount of staking tokens required for 1 unit of consensus-engine power. // Currently, this returns a global variable that the app developer can tweak. // TODO: we might turn this into an on-chain param: // https://github.com/cosmos/cosmos-sdk/issues/8365 -func (k Keeper) PowerReduction(_ sdk.Context) sdk.Int { +func (Keeper) PowerReduction(_ sdk.Context) sdk.Int { return sdk.DefaultPowerReduction } diff --git a/x/staking/keeper/pool.go b/x/staking/keeper/pool.go index c9d6a431..33622c5c 100644 --- a/x/staking/keeper/pool.go +++ b/x/staking/keeper/pool.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/querier.go b/x/staking/keeper/querier.go index 5bc90df2..341e48c4 100644 --- a/x/staking/keeper/querier.go +++ b/x/staking/keeper/querier.go @@ -4,15 +4,16 @@ import ( "errors" "strings" - errorsmod "cosmossdk.io/errors" - abci "github.com/tendermint/tendermint/abci/types" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/querier_test.go b/x/staking/keeper/querier_test.go index 2b90c722..79515529 100644 --- a/x/staking/keeper/querier_test.go +++ b/x/staking/keeper/querier_test.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" diff --git a/x/staking/keeper/query_utils.go b/x/staking/keeper/query_utils.go index 1cf6e8d7..da302ec7 100644 --- a/x/staking/keeper/query_utils.go +++ b/x/staking/keeper/query_utils.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/slash.go b/x/staking/keeper/slash.go index d284ffe4..3b3f9dec 100644 --- a/x/staking/keeper/slash.go +++ b/x/staking/keeper/slash.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + types "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index 065dcdbe..c986671e 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -11,6 +11,7 @@ import ( simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" diff --git a/x/staking/keeper/test_common.go b/x/staking/keeper/test_common.go index 8f491c3b..1fd94643 100644 --- a/x/staking/keeper/test_common.go +++ b/x/staking/keeper/test_common.go @@ -5,6 +5,7 @@ import ( "math/rand" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/tokenize_share_record.go b/x/staking/keeper/tokenize_share_record.go index 7c69679f..7e17c1ef 100644 --- a/x/staking/keeper/tokenize_share_record.go +++ b/x/staking/keeper/tokenize_share_record.go @@ -3,10 +3,11 @@ package keeper import ( "fmt" + gogotypes "github.com/gogo/protobuf/types" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - gogotypes "github.com/gogo/protobuf/types" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index 6fdae193..5fd5476e 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index 26781cc4..7d45410b 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index 3d203e7e..4977b2ea 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -14,6 +14,7 @@ import ( simapp_test "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" diff --git a/x/staking/module.go b/x/staking/module.go index 75fbfb10..74bac2dc 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -17,6 +17,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/client/cli" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/simulation" @@ -51,7 +52,7 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { types.RegisterInterfaces(registry) } @@ -123,7 +124,7 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { } // Deprecated: Route returns the message routing key for the staking module. -func (am AppModule) Route() sdk.Route { +func (AppModule) Route() sdk.Route { return sdk.Route{} } diff --git a/x/staking/module_test.go b/x/staking/module_test.go index 3e102039..3ae3108a 100644 --- a/x/staking/module_test.go +++ b/x/staking/module_test.go @@ -11,6 +11,7 @@ import ( dbm "github.com/tendermint/tm-db" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/simulation/decoder.go b/x/staking/simulation/decoder.go index 783e5c85..97f355e6 100644 --- a/x/staking/simulation/decoder.go +++ b/x/staking/simulation/decoder.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/simulation/decoder_test.go b/x/staking/simulation/decoder_test.go index 99d67b49..779696b7 100644 --- a/x/staking/simulation/decoder_test.go +++ b/x/staking/simulation/decoder_test.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" "github.com/iqlusioninc/liquidity-staking-module/x/staking/simulation" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go index 501fd44c..b2d58967 100644 --- a/x/staking/simulation/genesis.go +++ b/x/staking/simulation/genesis.go @@ -11,6 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/simulation/genesis_test.go b/x/staking/simulation/genesis_test.go index 1e625398..c41044ab 100644 --- a/x/staking/simulation/genesis_test.go +++ b/x/staking/simulation/genesis_test.go @@ -12,6 +12,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/simulation" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index 4c5202fb..ee8187ac 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -11,6 +11,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/simulation/params.go b/x/staking/simulation/params.go index f0f36114..3181d797 100644 --- a/x/staking/simulation/params.go +++ b/x/staking/simulation/params.go @@ -8,6 +8,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/teststaking/helper.go b/x/staking/teststaking/helper.go index 041f8b2a..a5f0ccb9 100644 --- a/x/staking/teststaking/helper.go +++ b/x/staking/teststaking/helper.go @@ -10,6 +10,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/keeper" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" diff --git a/x/staking/teststaking/tm.go b/x/staking/teststaking/tm.go index 8ab3b44f..a84a2e31 100644 --- a/x/staking/teststaking/tm.go +++ b/x/staking/teststaking/tm.go @@ -6,6 +6,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/teststaking/validator.go b/x/staking/teststaking/validator.go index 2536c96b..a27090a3 100644 --- a/x/staking/teststaking/validator.go +++ b/x/staking/teststaking/validator.go @@ -7,6 +7,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/types/authz.go b/x/staking/types/authz.go index 104a8b0d..9985c57a 100644 --- a/x/staking/types/authz.go +++ b/x/staking/types/authz.go @@ -2,9 +2,9 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/authz" ) diff --git a/x/staking/types/authz_test.go b/x/staking/types/authz_test.go index 4b0bf723..d480a975 100644 --- a/x/staking/types/authz_test.go +++ b/x/staking/types/authz_test.go @@ -7,6 +7,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" + simapp "github.com/iqlusioninc/liquidity-staking-module/app" stakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/types/commission_test.go b/x/staking/types/commission_test.go index eb393b06..bbc141b5 100644 --- a/x/staking/types/commission_test.go +++ b/x/staking/types/commission_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/types/delegation_test.go b/x/staking/types/delegation_test.go index 4302e4b8..27a365dd 100644 --- a/x/staking/types/delegation_test.go +++ b/x/staking/types/delegation_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/types/historical_info.go b/x/staking/types/historical_info.go index ce6155c4..3aa087cb 100644 --- a/x/staking/types/historical_info.go +++ b/x/staking/types/historical_info.go @@ -3,11 +3,11 @@ package types import ( "sort" - errorsmod "cosmossdk.io/errors" - "github.com/gogo/protobuf/proto" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/staking/types/historical_info_test.go b/x/staking/types/historical_info_test.go index 9325dcfc..9d0f9e78 100644 --- a/x/staking/types/historical_info_test.go +++ b/x/staking/types/historical_info_test.go @@ -5,13 +5,13 @@ import ( "sort" "testing" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/types/keys_test.go b/x/staking/types/keys_test.go index bbedcbe9..6e2cc1fc 100644 --- a/x/staking/types/keys_test.go +++ b/x/staking/types/keys_test.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index 2df43242..b9c3ebb0 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -2,8 +2,8 @@ package types import ( errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/cosmos/cosmos-sdk/codec/legacy" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -72,10 +72,10 @@ func NewMsgCreateValidator( } // Route implements the sdk.Msg interface. -func (msg MsgCreateValidator) Route() string { return RouterKey } +func (MsgCreateValidator) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgCreateValidator) Type() string { return TypeMsgCreateValidator } +func (MsgCreateValidator) Type() string { return TypeMsgCreateValidator } // GetSigners implements the sdk.Msg interface. It returns the address(es) that // must sign over msg.GetSignBytes(). @@ -155,10 +155,10 @@ func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRat } // Route implements the sdk.Msg interface. -func (msg MsgEditValidator) Route() string { return RouterKey } +func (MsgEditValidator) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgEditValidator) Type() string { return TypeMsgEditValidator } +func (MsgEditValidator) Type() string { return TypeMsgEditValidator } // GetSigners implements the sdk.Msg interface. func (msg MsgEditValidator) GetSigners() []sdk.AccAddress { @@ -203,10 +203,10 @@ func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.C } // Route implements the sdk.Msg interface. -func (msg MsgDelegate) Route() string { return RouterKey } +func (MsgDelegate) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgDelegate) Type() string { return TypeMsgDelegate } +func (MsgDelegate) Type() string { return TypeMsgDelegate } // GetSigners implements the sdk.Msg interface. func (msg MsgDelegate) GetSigners() []sdk.AccAddress { @@ -257,10 +257,10 @@ func NewMsgBeginRedelegate( } // Route implements the sdk.Msg interface. -func (msg MsgBeginRedelegate) Route() string { return RouterKey } +func (MsgBeginRedelegate) Route() string { return RouterKey } // Type implements the sdk.Msg interface -func (msg MsgBeginRedelegate) Type() string { return TypeMsgBeginRedelegate } +func (MsgBeginRedelegate) Type() string { return TypeMsgBeginRedelegate } // GetSigners implements the sdk.Msg interface func (msg MsgBeginRedelegate) GetSigners() []sdk.AccAddress { @@ -311,10 +311,10 @@ func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk } // Route implements the sdk.Msg interface. -func (msg MsgUndelegate) Route() string { return RouterKey } +func (MsgUndelegate) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgUndelegate) Type() string { return TypeMsgUndelegate } +func (MsgUndelegate) Type() string { return TypeMsgUndelegate } // GetSigners implements the sdk.Msg interface. func (msg MsgUndelegate) GetSigners() []sdk.AccAddress { diff --git a/x/staking/types/msg_test.go b/x/staking/types/msg_test.go index bd538197..8fffa8ac 100644 --- a/x/staking/types/msg_test.go +++ b/x/staking/types/msg_test.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/types/params_test.go b/x/staking/types/params_test.go index 46e809bb..e642c0ca 100644 --- a/x/staking/types/params_test.go +++ b/x/staking/types/params_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 3dd45533..e0fb31c8 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -7,12 +7,12 @@ import ( "strings" "time" - errorsmod "cosmossdk.io/errors" - abci "github.com/tendermint/tendermint/abci/types" tmprotocrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" "sigs.k8s.io/yaml" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -514,7 +514,7 @@ func (v Validator) GetConsensusPower(r sdk.Int) int64 { func (v Validator) GetCommission() sdk.Dec { return v.Commission.Rate } func (v Validator) GetDelegatorShares() sdk.Dec { return v.DelegatorShares } -func (v Validator) GetMinSelfDelegation() sdk.Int { return sdk.ZeroInt() } +func (Validator) GetMinSelfDelegation() sdk.Int { return sdk.ZeroInt() } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (v Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index a8fa9db4..f8992ff7 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -15,6 +15,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/iqlusioninc/liquidity-staking-module/x/staking/teststaking" "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) From 8dd736684303381d19407ae4067eb35a74fa2761 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 25 Dec 2023 01:30:17 +0700 Subject: [PATCH 3/4] bare returns --- x/distribution/keeper/delegation.go | 2 +- x/distribution/keeper/querier_test.go | 8 ++++---- x/distribution/keeper/store.go | 14 +++++++------- x/distribution/types/keys.go | 6 +++--- x/genutil/genesis.go | 2 +- x/slashing/keeper/params.go | 8 ++++---- x/slashing/keeper/signing_info.go | 4 ++-- x/staking/genesis.go | 2 +- x/staking/keeper/alias_functions.go | 2 +- x/staking/keeper/params.go | 16 ++++++++-------- x/staking/keeper/tokenize_share_record.go | 4 ++-- x/staking/types/msg.go | 22 +++++++++++----------- x/staking/types/params.go | 4 ++-- 13 files changed, 47 insertions(+), 47 deletions(-) diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index e7845735..eed01a1a 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -51,7 +51,7 @@ func (k Keeper) calculateDelegationRewardsBetween(ctx sdk.Context, val sdkstakin } // note: necessary to truncate so we don't allow withdrawing more rewards than owed rewards = difference.MulDecTruncate(stake) - return + return rewards } // calculate the total rewards accrued by a delegation diff --git a/x/distribution/keeper/querier_test.go b/x/distribution/keeper/querier_test.go index 00f4a590..ad66a68d 100644 --- a/x/distribution/keeper/querier_test.go +++ b/x/distribution/keeper/querier_test.go @@ -70,7 +70,7 @@ func getQueriedValidatorSlashes(t *testing.T, ctx sdk.Context, cdc *codec.Legacy require.Nil(t, err) require.Nil(t, cdc.UnmarshalJSON(bz, &slashes)) - return + return slashes } func getQueriedDelegationRewards(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) (rewards sdk.DecCoins) { @@ -83,7 +83,7 @@ func getQueriedDelegationRewards(t *testing.T, ctx sdk.Context, cdc *codec.Legac require.Nil(t, err) require.Nil(t, cdc.UnmarshalJSON(bz, &rewards)) - return + return rewards } func getQueriedDelegatorTotalRewards(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, delegatorAddr sdk.AccAddress) (response types.QueryDelegatorTotalRewardsResponse) { @@ -96,7 +96,7 @@ func getQueriedDelegatorTotalRewards(t *testing.T, ctx sdk.Context, cdc *codec.L require.Nil(t, err) require.Nil(t, cdc.UnmarshalJSON(bz, &response)) - return + return response } func getQueriedCommunityPool(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier) (ptr []byte) { @@ -109,7 +109,7 @@ func getQueriedCommunityPool(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmi require.Nil(t, err) require.Nil(t, cdc.UnmarshalJSON(cp, &ptr)) - return + return ptr } func TestQueries(t *testing.T) { diff --git a/x/distribution/keeper/store.go b/x/distribution/keeper/store.go index cea7ff57..c52a1591 100644 --- a/x/distribution/keeper/store.go +++ b/x/distribution/keeper/store.go @@ -52,7 +52,7 @@ func (k Keeper) GetFeePool(ctx sdk.Context) (feePool types.FeePool) { panic("Stored fee pool should not have been nil") } k.cdc.MustUnmarshal(b, &feePool) - return + return feePool } // set the global fee pool distribution info @@ -88,7 +88,7 @@ func (k Keeper) GetDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, de store := ctx.KVStore(k.storeKey) b := store.Get(types.GetDelegatorStartingInfoKey(val, del)) k.cdc.MustUnmarshal(b, &period) - return + return period } // set the starting info associated with a delegator @@ -130,7 +130,7 @@ func (k Keeper) GetValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddres store := ctx.KVStore(k.storeKey) b := store.Get(types.GetValidatorHistoricalRewardsKey(val, period)) k.cdc.MustUnmarshal(b, &rewards) - return + return rewards } // set historical rewards for a particular period @@ -191,7 +191,7 @@ func (k Keeper) GetValidatorHistoricalReferenceCount(ctx sdk.Context) (count uin k.cdc.MustUnmarshal(iter.Value(), &rewards) count += uint64(rewards.ReferenceCount) } - return + return count } // get current rewards for a validator @@ -199,7 +199,7 @@ func (k Keeper) GetValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress) store := ctx.KVStore(k.storeKey) b := store.Get(types.GetValidatorCurrentRewardsKey(val)) k.cdc.MustUnmarshal(b, &rewards) - return + return rewards } // set current rewards for a validator @@ -238,7 +238,7 @@ func (k Keeper) GetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAd return types.ValidatorAccumulatedCommission{} } k.cdc.MustUnmarshal(b, &commission) - return + return commission } // set accumulated commission for a validator @@ -281,7 +281,7 @@ func (k Keeper) GetValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddre store := ctx.KVStore(k.storeKey) bz := store.Get(types.GetValidatorOutstandingRewardsKey(val)) k.cdc.MustUnmarshal(bz, &rewards) - return + return rewards } // set validator outstanding rewards diff --git a/x/distribution/types/keys.go b/x/distribution/types/keys.go index e0458459..e5ea2ff9 100644 --- a/x/distribution/types/keys.go +++ b/x/distribution/types/keys.go @@ -94,7 +94,7 @@ func GetDelegatorStartingInfoAddresses(key []byte) (valAddr sdk.ValAddress, delA delAddr = sdk.AccAddress(key[3+valAddrLen:]) kv.AssertKeyLength(delAddr.Bytes(), delAddrLen) - return + return valAddr, delAddr } // GetValidatorHistoricalRewardsAddressPeriod creates the address & period from a validator's historical rewards key. @@ -108,7 +108,7 @@ func GetValidatorHistoricalRewardsAddressPeriod(key []byte) (valAddr sdk.ValAddr b := key[2+valAddrLen:] kv.AssertKeyLength(b, 8) period = binary.LittleEndian.Uint64(b) - return + return valAddr, period } // GetValidatorCurrentRewardsAddress creates the address from a validator's current rewards key. @@ -149,7 +149,7 @@ func GetValidatorSlashEventAddressHeight(key []byte) (valAddr sdk.ValAddress, he kv.AssertKeyAtLeastLength(key, startB+9) b := key[startB : startB+8] // the next 8 bytes represent the height height = binary.BigEndian.Uint64(b) - return + return valAddr, height } // GetValidatorOutstandingRewardsKey creates the outstanding rewards key for a validator. diff --git a/x/genutil/genesis.go b/x/genutil/genesis.go index d62cfa2a..78752c14 100644 --- a/x/genutil/genesis.go +++ b/x/genutil/genesis.go @@ -18,5 +18,5 @@ func InitGenesis( if len(genesisState.GenTxs) > 0 { validators, err = DeliverGenTxs(ctx, genesisState.GenTxs, stakingKeeper, deliverTx, txEncodingConfig) } - return + return validators, err } diff --git a/x/slashing/keeper/params.go b/x/slashing/keeper/params.go index 1bd62200..e671a6c7 100644 --- a/x/slashing/keeper/params.go +++ b/x/slashing/keeper/params.go @@ -11,7 +11,7 @@ import ( // SignedBlocksWindow - sliding window for downtime slashing func (k Keeper) SignedBlocksWindow(ctx sdk.Context) (res int64) { k.paramspace.Get(ctx, types.KeySignedBlocksWindow, &res) - return + return res } // MinSignedPerWindow - minimum blocks signed per window @@ -28,19 +28,19 @@ func (k Keeper) MinSignedPerWindow(ctx sdk.Context) int64 { // DowntimeJailDuration - Downtime unbond duration func (k Keeper) DowntimeJailDuration(ctx sdk.Context) (res time.Duration) { k.paramspace.Get(ctx, types.KeyDowntimeJailDuration, &res) - return + return res } // SlashFractionDoubleSign - fraction of power slashed in case of double sign func (k Keeper) SlashFractionDoubleSign(ctx sdk.Context) (res sdk.Dec) { k.paramspace.Get(ctx, types.KeySlashFractionDoubleSign, &res) - return + return res } // SlashFractionDowntime - fraction of power slashed for downtime func (k Keeper) SlashFractionDowntime(ctx sdk.Context) (res sdk.Dec) { k.paramspace.Get(ctx, types.KeySlashFractionDowntime, &res) - return + return res } // GetParams returns the total set of slashing parameters. diff --git a/x/slashing/keeper/signing_info.go b/x/slashing/keeper/signing_info.go index a32e6ac3..13824512 100644 --- a/x/slashing/keeper/signing_info.go +++ b/x/slashing/keeper/signing_info.go @@ -17,11 +17,11 @@ func (k Keeper) GetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress bz := store.Get(types.ValidatorSigningInfoKey(address)) if bz == nil { found = false - return + return info, found } k.cdc.MustUnmarshal(bz, &info) found = true - return + return info, found } // HasValidatorSigningInfo returns if a given validator has signing information diff --git a/x/staking/genesis.go b/x/staking/genesis.go index 0c75ed8c..52de5085 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -35,7 +35,7 @@ func WriteValidators(ctx sdk.Context, keeper keeper.Keeper) (vals []tmtypes.Gene return false }) - return + return vals, nil } // ValidateGenesis validates the provided staking genesis state to ensure the diff --git a/x/staking/keeper/alias_functions.go b/x/staking/keeper/alias_functions.go index 2ea411c7..e9a8e963 100644 --- a/x/staking/keeper/alias_functions.go +++ b/x/staking/keeper/alias_functions.go @@ -148,5 +148,5 @@ func (k Keeper) GetAllSDKDelegations(ctx sdk.Context) (delegations []types.Deleg delegations = append(delegations, delegation) } - return + return delegations } diff --git a/x/staking/keeper/params.go b/x/staking/keeper/params.go index bffce4b6..e13c9b16 100644 --- a/x/staking/keeper/params.go +++ b/x/staking/keeper/params.go @@ -11,27 +11,27 @@ import ( // UnbondingTime func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration) { k.paramstore.Get(ctx, types.KeyUnbondingTime, &res) - return + return res } // MaxValidators - Maximum number of validators func (k Keeper) MaxValidators(ctx sdk.Context) (res uint32) { k.paramstore.Get(ctx, types.KeyMaxValidators, &res) - return + return res } // MaxEntries - Maximum number of simultaneous unbonding // delegations or redelegations (per pair/trio) func (k Keeper) MaxEntries(ctx sdk.Context) (res uint32) { k.paramstore.Get(ctx, types.KeyMaxEntries, &res) - return + return res } // HistoricalEntries = number of historical info entries // to persist in store func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32) { k.paramstore.Get(ctx, types.KeyHistoricalEntries, &res) - return + return res } // BondDenom - Bondable coin denomination @@ -51,25 +51,25 @@ func (Keeper) PowerReduction(_ sdk.Context) sdk.Int { // MinCommissionRate - Minimum validator commission rate func (k Keeper) MinCommissionRate(ctx sdk.Context) (res sdk.Dec) { k.paramstore.Get(ctx, types.KeyMinCommissionRate, &res) - return + return res } // Validator bond factor for all validators func (k Keeper) ValidatorBondFactor(ctx sdk.Context) (res sdk.Dec) { k.paramstore.Get(ctx, types.KeyValidatorBondFactor, &res) - return + return res } // Global liquid staking cap across all liquid staking providers func (k Keeper) GlobalLiquidStakingCap(ctx sdk.Context) (res sdk.Dec) { k.paramstore.Get(ctx, types.KeyGlobalLiquidStakingCap, &res) - return + return res } // Liquid staking cap for each validator func (k Keeper) ValidatorLiquidStakingCap(ctx sdk.Context) (res sdk.Dec) { k.paramstore.Get(ctx, types.KeyValidatorLiquidStakingCap, &res) - return + return res } // Get all parameters as types.Params diff --git a/x/staking/keeper/tokenize_share_record.go b/x/staking/keeper/tokenize_share_record.go index 7e17c1ef..44a76038 100644 --- a/x/staking/keeper/tokenize_share_record.go +++ b/x/staking/keeper/tokenize_share_record.go @@ -54,7 +54,7 @@ func (k Keeper) GetTokenizeShareRecordsByOwner(ctx sdk.Context, owner sdk.AccAdd } tokenizeShareRecords = append(tokenizeShareRecords, tokenizeShareRecord) } - return + return tokenizeShareRecords } func (k Keeper) GetTokenizeShareRecordByDenom(ctx sdk.Context, denom string) (types.TokenizeShareRecord, error) { @@ -82,7 +82,7 @@ func (k Keeper) GetAllTokenizeShareRecords(ctx sdk.Context) (tokenizeShareRecord tokenizeShareRecords = append(tokenizeShareRecords, tokenizeShareRecord) } - return + return tokenizeShareRecords } func (k Keeper) AddTokenizeShareRecord(ctx sdk.Context, tokenizeShareRecord types.TokenizeShareRecord) error { diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index b9c3ebb0..8f1df56b 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -360,10 +360,10 @@ func NewMsgUnbondValidator(valAddr sdk.ValAddress) *MsgUnbondValidator { } // Route implements the sdk.Msg interface. -func (msg MsgUnbondValidator) Route() string { return RouterKey } +func (MsgUnbondValidator) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgUnbondValidator) Type() string { return TypeMsgUnbondValidator } +func (MsgUnbondValidator) Type() string { return TypeMsgUnbondValidator } // GetSigners implements the sdk.Msg interface. func (msg MsgUnbondValidator) GetSigners() []sdk.AccAddress { @@ -390,7 +390,7 @@ func (msg MsgUnbondValidator) ValidateBasic() error { } // Type implements the sdk.Msg interface. -func (msg MsgTokenizeShares) Type() string { return TypeMsgTokenizeShares } +func (MsgTokenizeShares) Type() string { return TypeMsgTokenizeShares } func (msg MsgTokenizeShares) GetSigners() []sdk.AccAddress { delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) @@ -427,7 +427,7 @@ func (msg MsgTokenizeShares) ValidateBasic() error { } // Type implements the sdk.Msg interface. -func (msg MsgRedeemTokensforShares) Type() string { return TypeMsgRedeemTokensforShares } +func (MsgRedeemTokensforShares) Type() string { return TypeMsgRedeemTokensforShares } func (msg MsgRedeemTokensforShares) GetSigners() []sdk.AccAddress { delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) @@ -458,7 +458,7 @@ func (msg MsgRedeemTokensforShares) ValidateBasic() error { } // Type implements the sdk.Msg interface. -func (msg MsgTransferTokenizeShareRecord) Type() string { return TypeMsgTransferTokenizeShareRecord } +func (MsgTransferTokenizeShareRecord) Type() string { return TypeMsgTransferTokenizeShareRecord } func (msg MsgTransferTokenizeShareRecord) GetSigners() []sdk.AccAddress { sender, err := sdk.AccAddressFromBech32(msg.Sender) @@ -485,7 +485,7 @@ func (msg MsgTransferTokenizeShareRecord) ValidateBasic() error { } // Type implements the sdk.Msg interface. -func (msg MsgDisableTokenizeShares) Type() string { return TypeMsgDisableTokenizeShares } +func (MsgDisableTokenizeShares) Type() string { return TypeMsgDisableTokenizeShares } // GetSigners implements the sdk.Msg interface. func (msg MsgDisableTokenizeShares) GetSigners() []sdk.AccAddress { @@ -512,7 +512,7 @@ func (msg MsgDisableTokenizeShares) ValidateBasic() error { } // Type implements the sdk.Msg interface. -func (msg MsgEnableTokenizeShares) Type() string { return TypeMsgEnableTokenizeShares } +func (MsgEnableTokenizeShares) Type() string { return TypeMsgEnableTokenizeShares } // GetSigners implements the sdk.Msg interface. func (msg MsgEnableTokenizeShares) GetSigners() []sdk.AccAddress { @@ -551,10 +551,10 @@ func NewMsgCancelUnbondingDelegation(delAddr sdk.AccAddress, valAddr sdk.ValAddr } // Route implements the sdk.Msg interface. -func (msg MsgCancelUnbondingDelegation) Route() string { return RouterKey } +func (MsgCancelUnbondingDelegation) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgCancelUnbondingDelegation) Type() string { return TypeMsgCancelUnbondingDelegation } +func (MsgCancelUnbondingDelegation) Type() string { return TypeMsgCancelUnbondingDelegation } // GetSigners implements the sdk.Msg interface. func (msg MsgCancelUnbondingDelegation) GetSigners() []sdk.AccAddress { @@ -604,10 +604,10 @@ func NewMsgValidatorBond(delAddr sdk.AccAddress, valAddr sdk.ValAddress) *MsgVal } // Route implements the sdk.Msg interface. -func (msg MsgValidatorBond) Route() string { return RouterKey } +func (MsgValidatorBond) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgValidatorBond) Type() string { return TypeMsgValidatorBond } +func (MsgValidatorBond) Type() string { return TypeMsgValidatorBond } // GetSigners implements the sdk.Msg interface. func (msg MsgValidatorBond) GetSigners() []sdk.AccAddress { diff --git a/x/staking/types/params.go b/x/staking/types/params.go index 19ac4272..eca2c9c1 100644 --- a/x/staking/types/params.go +++ b/x/staking/types/params.go @@ -140,10 +140,10 @@ func MustUnmarshalParams(cdc *codec.LegacyAmino, value []byte) Params { func UnmarshalParams(cdc *codec.LegacyAmino, value []byte) (params Params, err error) { err = cdc.Unmarshal(value, ¶ms) if err != nil { - return + return params, err } - return + return params, nil } // validate a set of params From 07c421f9e44de49c32a9faa7761cdacd731d6a8a Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 25 Dec 2023 01:36:24 +0700 Subject: [PATCH 4/4] thelper --- app/test_helpers.go | 3 +++ x/staking/keeper/liquid_stake_test.go | 2 ++ x/staking/keeper/slash_test.go | 1 + x/staking/keeper/validator_test.go | 19 +++++++++++-------- x/staking/types/validator_test.go | 4 ++-- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/test_helpers.go b/app/test_helpers.go index 5d19039a..3f11f0c1 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -149,6 +149,7 @@ func genesisStateWithValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) GenesisState { + t.Helper() // set genesis accounts authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) @@ -399,6 +400,7 @@ func TestAddr(addr string, bech string) (sdk.AccAddress, error) { // CheckBalance checks the balance of an account. func CheckBalance(t *testing.T, app *SimApp, addr sdk.AccAddress, balances sdk.Coins) { + t.Helper() ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) require.True(t, balances.IsEqual(app.BankKeeper.GetAllBalances(ctxCheck, addr))) } @@ -411,6 +413,7 @@ func SignCheckDeliver( t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg, chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { + t.Helper() tx, err := helpers.GenSignedMockTx( rand.New(rand.NewSource(time.Now().UnixNano())), txCfg, diff --git a/x/staking/keeper/liquid_stake_test.go b/x/staking/keeper/liquid_stake_test.go index c74620c6..79db6f83 100644 --- a/x/staking/keeper/liquid_stake_test.go +++ b/x/staking/keeper/liquid_stake_test.go @@ -93,6 +93,7 @@ func TestAccountIsLiquidStakingProvider(t *testing.T) { // Helper function to clear the Bonded pool balances before a unit test func clearPoolBalance(t *testing.T, app *simapp.SimApp, ctx sdk.Context) { + t.Helper() bondDenom := app.StakingKeeper.BondDenom(ctx) initialBondedBalance := app.BankKeeper.GetBalance(ctx, app.AccountKeeper.GetModuleAddress(types.BondedPoolName), bondDenom) @@ -102,6 +103,7 @@ func clearPoolBalance(t *testing.T, app *simapp.SimApp, ctx sdk.Context) { // Helper function to fund the Bonded pool balances before a unit test func fundPoolBalance(t *testing.T, app *simapp.SimApp, ctx sdk.Context, amount sdk.Int) { + t.Helper() bondDenom := app.StakingKeeper.BondDenom(ctx) bondedPoolCoin := sdk.NewCoin(bondDenom, amount) diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index c986671e..72b17c98 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -20,6 +20,7 @@ import ( // bootstrapSlashTest creates 3 validators and bootstrap the app. func bootstrapSlashTest(t *testing.T, power int64) (*simapp.SimApp, sdk.Context, []sdk.AccAddress, []sdk.ValAddress) { + t.Helper() _, app, ctx := createTestInput(t) addrDels, addrVals := generateAddresses(app, ctx, 100) diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index 4977b2ea..c188a21e 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -22,13 +22,15 @@ import ( "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) -func newMonikerValidator(t testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey, moniker string) types.Validator { +func newMonikerValidator(tb testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey, moniker string) types.Validator { + tb.Helper() v, err := types.NewValidator(operator, pubKey, types.Description{Moniker: moniker}) - require.NoError(t, err) + require.NoError(tb, err) return v } -func bootstrapValidatorTest(t testing.TB, power int64, numAddrs int) (*simapp.SimApp, sdk.Context, []sdk.AccAddress, []sdk.ValAddress) { +func bootstrapValidatorTest(tb testing.TB, power int64, numAddrs int) (*simapp.SimApp, sdk.Context, []sdk.AccAddress, []sdk.ValAddress) { + tb.Helper() _, app, ctx := createTestInput(&testing.T{}) addrDels, addrVals := generateAddresses(app, ctx, numAddrs) @@ -44,11 +46,11 @@ func bootstrapValidatorTest(t testing.TB, power int64, numAddrs int) (*simapp.Si // unbond genesis validator delegations delegations := app.StakingKeeper.GetAllDelegations(ctx) - require.Len(t, delegations, 1) + require.Len(tb, delegations, 1) delegation := delegations[0] _, err := app.StakingKeeper.Undelegate(ctx, delegation.GetDelegatorAddr(), delegation.GetValidatorAddr(), delegation.Shares) - require.NoError(t, err) + require.NoError(tb, err) // end block to unbond genesis validator staking.EndBlocker(ctx, app.StakingKeeper) @@ -56,13 +58,14 @@ func bootstrapValidatorTest(t testing.TB, power int64, numAddrs int) (*simapp.Si return app, ctx, addrDels, addrVals } -func initValidators(t testing.TB, power int64, numAddrs int, powers []int64) (*simapp.SimApp, sdk.Context, []sdk.ValAddress, []types.Validator) { - app, ctx, addrs, valAddrs := bootstrapValidatorTest(t, power, numAddrs) +func initValidators(tb testing.TB, power int64, numAddrs int, powers []int64) (*simapp.SimApp, sdk.Context, []sdk.ValAddress, []types.Validator) { + tb.Helper() + app, ctx, addrs, valAddrs := bootstrapValidatorTest(tb, power, numAddrs) pks := simapp.CreateTestPubKeys(numAddrs) vs := make([]types.Validator, len(powers)) for i, power := range powers { - vs[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), pks[i]) + vs[i] = teststaking.NewValidator(tb, sdk.ValAddress(addrs[i]), pks[i]) tokens := app.StakingKeeper.TokensFromConsensusPower(ctx, power) vs[i], _ = vs[i].AddTokensFromDel(tokens) } diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index f8992ff7..e9e8c1f4 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -344,8 +344,8 @@ func mkValidator(tokens int64, shares sdk.Dec) types.Validator { } // Creates a new validators and asserts the error check. -func newValidator(t *testing.T, operator sdk.ValAddress, pubKey cryptotypes.PubKey) types.Validator { +func newValidator(tb *testing.T, operator sdk.ValAddress, pubKey cryptotypes.PubKey) types.Validator { v, err := types.NewValidator(operator, pubKey, types.Description{}) - require.NoError(t, err) + require.NoError(tb, err) return v }