Skip to content

Commit

Permalink
begin to lint
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Dec 24, 2023
1 parent 3257688 commit e7b5f23
Show file tree
Hide file tree
Showing 182 changed files with 321 additions and 131 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 12 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions app/genesis_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions app/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
3 changes: 2 additions & 1 deletion app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
}
1 change: 1 addition & 0 deletions cmd/liquidstakingd/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions cmd/liquidstakingd/cmd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/liquidstakingd/cmd/genaccounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions cmd/liquidstakingd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/liquidstakingd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions cmd/liquidstakingd/cmd/testnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions cmd/liquidstakingd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit e7b5f23

Please sign in to comment.