Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint #4

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
fix lint by command
  • Loading branch information
neitdung committed Jan 10, 2024
commit d4e854381aae1e044848d58c99dbd159e33d6836
22 changes: 12 additions & 10 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@ import (
"os"
"path/filepath"

"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
multistakingkeeper "github.com/realio-tech/multi-staking-module/x/multi-staking/keeper"
multistakingtypes "github.com/realio-tech/multi-staking-module/x/multi-staking/types"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

_ "github.com/cosmos/cosmos-sdk/client/docs/statik" // this is used for serving docs

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
_ "github.com/cosmos/cosmos-sdk/client/docs/statik" // this is used for serving docs
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
Expand Down Expand Up @@ -80,15 +91,6 @@ import (
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"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
multistakingkeeper "github.com/realio-tech/multi-staking-module/x/multi-staking/keeper"
multistakingtypes "github.com/realio-tech/multi-staking-module/x/multi-staking/types"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

ica "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts"
icacontroller "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller"
Expand Down
3 changes: 2 additions & 1 deletion testing/simapp/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"encoding/json"
"log"

tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)

// ExportAppStateAndValidators exports the state of the application for a genesis
Expand Down
5 changes: 3 additions & 2 deletions testing/simapp/genesis_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ 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"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto"

"github.com/cosmos/ibc-go/v6/testing/simapp"
)
Expand Down
3 changes: 2 additions & 1 deletion testing/simapp/sim_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"os"
"testing"

tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)

// Profile with:
Expand Down
11 changes: 6 additions & 5 deletions testing/simapp/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import (
"os"
"testing"

"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/store"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
Expand All @@ -24,11 +30,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/simulation"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host"
Expand Down
3 changes: 2 additions & 1 deletion testing/simapp/simd/cmd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"errors"
"fmt"

"github.com/spf13/cobra"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand All @@ -16,7 +18,6 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/spf13/cobra"
)

const (
Expand Down
7 changes: 4 additions & 3 deletions testing/simapp/simd/cmd/genaccounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ import (
"fmt"
"testing"

"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/server"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"

"github.com/cosmos/ibc-go/v6/testing/simapp"
simcmd "github.com/cosmos/ibc-go/v6/testing/simapp/simd/cmd"
Expand Down
13 changes: 7 additions & 6 deletions testing/simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import (
"os"
"path/filepath"

"github.com/spf13/cast"
"github.com/spf13/cobra"
tmcfg "github.com/tendermint/tendermint/config"
tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
Expand All @@ -25,12 +32,6 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/spf13/cast"
"github.com/spf13/cobra"
tmcfg "github.com/tendermint/tendermint/config"
tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/ibc-go/v6/testing/simapp"
"github.com/cosmos/ibc-go/v6/testing/simapp/params"
Expand Down
13 changes: 7 additions & 6 deletions testing/simapp/simd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import (
"os"
"path/filepath"

"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"
tmtime "github.com/tendermint/tendermint/types/time"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
Expand All @@ -26,12 +33,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"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"
tmtime "github.com/tendermint/tendermint/types/time"
)

var (
Expand Down
6 changes: 4 additions & 2 deletions testing/simapp/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import (
"os"
"time"

tmjson "github.com/tendermint/tendermint/libs/json"
tmtypes "github.com/tendermint/tendermint/types"

"cosmossdk.io/math"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -17,8 +21,6 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
tmjson "github.com/tendermint/tendermint/libs/json"
tmtypes "github.com/tendermint/tendermint/types"

simappparams "github.com/cosmos/ibc-go/v6/testing/simapp/params"
)
Expand Down
14 changes: 8 additions & 6 deletions testing/simapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

"cosmossdk.io/math"

bam "github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -23,12 +31,6 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/ibc-go/v6/testing/mock"
"github.com/cosmos/ibc-go/v6/testing/simapp/helpers"
Expand Down
3 changes: 2 additions & 1 deletion testing/simapp/types.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package simapp

import (
abci "github.com/tendermint/tendermint/abci/types"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
abci "github.com/tendermint/tendermint/abci/types"
)

// App implements the common methods for a Cosmos SDK-based application
Expand Down
5 changes: 3 additions & 2 deletions testing/simapp/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import (
"fmt"
"os"

"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/ibc-go/v6/testing/simapp/helpers"
)
Expand Down
3 changes: 2 additions & 1 deletion testing/simapp/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/std"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/stretchr/testify/require"
)

func makeCodec(bm module.BasicManager) *codec.LegacyAmino {
Expand Down
6 changes: 3 additions & 3 deletions x/multi-staking/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package keeper
import (
"fmt"

"github.com/realio-tech/multi-staking-module/x/multi-staking/types"

"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"

sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/realio-tech/multi-staking-module/x/multi-staking/types"
)

func (k Keeper) BeginBlocker(ctx sdk.Context) {

}

// need a way to better name this func
Expand Down
5 changes: 3 additions & 2 deletions x/multi-staking/keeper/genesis.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/realio-tech/multi-staking-module/x/multi-staking/types"
abci "github.com/tendermint/tendermint/abci/types"

sdk "github.com/cosmos/cosmos-sdk/types"
)

func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) (res []abci.ValidatorUpdate) {
Expand Down Expand Up @@ -68,6 +69,6 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
MultiStakingUnlocks: multiStakingUnlocks,
MultiStakingCoinInfo: multiStakingCoinInfos,
ValidatorMultiStakingCoins: ValidatorMultiStakingCoinLists,
StakingGenesisState: k.stakingKeeper.ExportGenesis(ctx),
StakingGenesisState: k.stakingKeeper.ExportGenesis(ctx),
}
}
10 changes: 4 additions & 6 deletions x/multi-staking/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package keeper
import (
"context"

"github.com/realio-tech/multi-staking-module/x/multi-staking/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/cosmos/cosmos-sdk/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
"github.com/realio-tech/multi-staking-module/x/multi-staking/types"
)

type queryServer struct {
Expand Down Expand Up @@ -54,8 +54,8 @@ func (k queryServer) MultiStakingLock(c context.Context, req *types.QueryMultiSt
lock, found := k.Keeper.GetMultiStakingLock(ctx, lockId)

return &types.QueryMultiStakingLockResponse{
Lock: &lock,
Found: found,
Lock: &lock,
Found: found,
}, nil
}

Expand All @@ -74,7 +74,6 @@ func (k queryServer) MultiStakingLocks(c context.Context, req *types.QueryMultiS
pageRes, err := query.Paginate(lockStore, req.Pagination, func(key []byte, value []byte) error {
var lock types.MultiStakingLock
err := k.cdc.Unmarshal(value, &lock)

if err != nil {
return err
}
Expand Down Expand Up @@ -120,7 +119,6 @@ func (k queryServer) MultiStakingUnlocks(c context.Context, req *types.QueryMult
pageRes, err := query.Paginate(unlockStore, req.Pagination, func(key []byte, value []byte) error {
var unlock types.MultiStakingUnlock
err := k.cdc.Unmarshal(value, &unlock)

if err != nil {
return err
}
Expand All @@ -147,4 +145,4 @@ func (k queryServer) ValidatorMultiStakingCoin(c context.Context, req *types.Que
return &types.QueryValidatorMultiStakingCoinResponse{
Denom: denom,
}, nil
}
}
Loading