Skip to content

Commit

Permalink
minor lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Jan 21, 2024
1 parent 6650315 commit 040399c
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 64 deletions.
13 changes: 1 addition & 12 deletions x/claimsmanager/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"

Expand All @@ -12,10 +11,7 @@ import (
"github.com/quicksilver-zone/quicksilver/v7/third-party-chains/osmosis-types/gamm/pool-models/stableswap"
)

var (
amino = codec.NewLegacyAmino()
ModuleCdc = codec.NewAminoCodec(amino)
)
var ModuleCdc = codec.NewLegacyAmino()

func RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
}
Expand All @@ -32,10 +28,3 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}

func init() {
RegisterLegacyAminoCodec(amino)
cryptocodec.RegisterCrypto(amino)
sdk.RegisterLegacyAminoCodec(amino)
amino.Seal()
}
1 change: 1 addition & 0 deletions x/interchainquery/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func (suite *KeeperTestSuite) TestDataPoints() {
suite.NoError(err)

vals, err := suite.GetSimApp(suite.chainB).StakingKeeper.GetBondedValidatorsByPower(suite.chainB.GetContext())
suite.NoError(err)
qvr := stakingtypes.QueryValidatorsResponse{
Validators: vals,
}
Expand Down
3 changes: 1 addition & 2 deletions x/interchainquery/keeper/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package keeper
import (
"fmt"

"cosmossdk.io/math"
sdkmath "cosmossdk.io/math"
"cosmossdk.io/store/prefix"
storetypes "cosmossdk.io/store/types"
Expand All @@ -27,7 +26,7 @@ func (k Keeper) NewQuery(
chainID,
queryType string,
request []byte,
period math.Int,
period sdkmath.Int,
callbackID string,
ttl uint64,
) *types.Query {
Expand Down
72 changes: 36 additions & 36 deletions x/interchainstaking/keeper/keeper_test.go

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions x/interchainstaking/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"time"

"cosmossdk.io/math"
sdkmath "cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -276,9 +275,9 @@ func (suite *KeeperTestSuite) TestRequestRedemption() {
params.UnbondingEnabled = true
suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetParams(ctx, params)

err := suite.GetQuicksilverApp(suite.chainA).BankKeeper.MintCoins(ctx, icstypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqatom", math.NewInt(10000000))))
err := suite.GetQuicksilverApp(suite.chainA).BankKeeper.MintCoins(ctx, icstypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqatom", sdkmath.NewInt(10000000))))
suite.NoError(err)
err = suite.GetQuicksilverApp(suite.chainA).BankKeeper.SendCoinsFromModuleToAccount(ctx, icstypes.ModuleName, testAccount, sdk.NewCoins(sdk.NewCoin("uqatom", math.NewInt(10000000))))
err = suite.GetQuicksilverApp(suite.chainA).BankKeeper.SendCoinsFromModuleToAccount(ctx, icstypes.ModuleName, testAccount, sdk.NewCoins(sdk.NewCoin("uqatom", sdkmath.NewInt(10000000))))
suite.NoError(err)

// disable LSM
Expand Down Expand Up @@ -315,9 +314,9 @@ func (suite *KeeperTestSuite) TestRequestRedemption() {
params.UnbondingEnabled = true
suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetParams(ctx, params)

err := suite.GetQuicksilverApp(suite.chainA).BankKeeper.MintCoins(ctx, icstypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqatom", math.NewInt(10000000))))
err := suite.GetQuicksilverApp(suite.chainA).BankKeeper.MintCoins(ctx, icstypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqatom", sdkmath.NewInt(10000000))))
suite.NoError(err)
err = suite.GetQuicksilverApp(suite.chainA).BankKeeper.SendCoinsFromModuleToAccount(ctx, icstypes.ModuleName, testAccount, sdk.NewCoins(sdk.NewCoin("uqatom", math.NewInt(10000000))))
err = suite.GetQuicksilverApp(suite.chainA).BankKeeper.SendCoinsFromModuleToAccount(ctx, icstypes.ModuleName, testAccount, sdk.NewCoins(sdk.NewCoin("uqatom", sdkmath.NewInt(10000000))))
suite.NoError(err)

// enable LSM
Expand Down
6 changes: 3 additions & 3 deletions x/interchainstaking/keeper/redemptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

// processRedemptionForLsm will determine based on user intent, the tokens to return to the user, generate Redeem message and send them.
func (k *Keeper) processRedemptionForLsm(ctx sdk.Context, zone *types.Zone, sender sdk.AccAddress, destination string, nativeTokens math.Int, burnAmount sdk.Coin, hash string) error {
func (k *Keeper) processRedemptionForLsm(ctx sdk.Context, zone *types.Zone, sender sdk.AccAddress, destination string, nativeTokens sdkmath.Int, burnAmount sdk.Coin, hash string) error {
intent, found := k.GetDelegatorIntent(ctx, zone, sender.String(), false)
// msgs is slice of MsgTokenizeShares, so we can handle dust allocation later.
msgs := make([]*lsmstakingtypes.MsgTokenizeShares, 0)
Expand Down Expand Up @@ -90,7 +90,7 @@ func (k *Keeper) queueRedemption(
zone *types.Zone,
sender sdk.AccAddress,
destination string,
nativeTokens math.Int,
nativeTokens sdkmath.Int,
burnAmount sdk.Coin,
hash string,
) error { //nolint:unparam // we know that the error is always nil
Expand All @@ -117,7 +117,7 @@ func (k *Keeper) queueRedemption(
// GetUnlockedTokensForZone will iterate over all validators for a zone, summing delegated amounts,
// and then remove the locked tokens (those actively being redelegated), returning a slice of int64
// staking tokens that are unlocked and free to redelegate or unbond.
func (k *Keeper) GetUnlockedTokensForZone(ctx sdk.Context, zone *types.Zone) (map[string]math.Int, math.Int, error) {
func (k *Keeper) GetUnlockedTokensForZone(ctx sdk.Context, zone *types.Zone) (map[string]math.Int, sdkmath.Int, error) {
validators := k.GetValidators(ctx, zone.ChainId)

availablePerValidator := make(map[string]math.Int, len(validators))
Expand Down
8 changes: 4 additions & 4 deletions x/participationrewards/types/submodule_umee.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (upd *UmeeProtocolData) GenerateKey() []byte {
return []byte(upd.Denom)
}

func GetUnderlyingData[V math.Int | sdkmath.LegacyDec](upd *UmeeProtocolData) (V, error) {
func GetUnderlyingData[V sdkmath.Int | sdkmath.LegacyDec](upd *UmeeProtocolData) (V, error) {
var data V
err := json.Unmarshal(upd.Data, &data)
if err != nil {
Expand Down Expand Up @@ -66,15 +66,15 @@ type UmeeUTokenSupplyProtocolData struct {
}

func (upd *UmeeUTokenSupplyProtocolData) GetUTokenSupply() (math.Int, error) {
return GetUnderlyingData[math.Int](&upd.UmeeProtocolData)
return GetUnderlyingData[sdkmath.Int](&upd.UmeeProtocolData)
}

type UmeeLeverageModuleBalanceProtocolData struct {
UmeeProtocolData
}

func (upd *UmeeLeverageModuleBalanceProtocolData) GetModuleBalance() (math.Int, error) {
return GetUnderlyingData[math.Int](&upd.UmeeProtocolData)
func (upd *UmeeLeverageModuleBalanceProtocolData) GetModuleBalance() (sdkmath.Int, error) {
return GetUnderlyingData[sdkmath.Int](&upd.UmeeProtocolData)
}

// -----------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion x/supply/types/expected_keepers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package types // noalias

import (
context "context"
"context"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/keeper/admins.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package keeper

import (
proto "github.com/cosmos/gogoproto/proto"
"github.com/cosmos/gogoproto/proto"

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

Expand Down

0 comments on commit 040399c

Please sign in to comment.