From 3e02c52bb52ea96a205e9afc1c3ff92a1ae5f572 Mon Sep 17 00:00:00 2001 From: Anh Minh <1phamminh0811@gmail.com> Date: Fri, 17 May 2024 12:38:43 +0700 Subject: [PATCH] replace all deprecated types --- custom/auth/ante/expected_keeper.go | 3 ++- custom/auth/client/utils/feeutils.go | 11 ++++---- tests/e2e/configurer/chain/queries.go | 3 ++- x/oracle/keeper/test_utils.go | 3 ++- x/oracle/tally.go | 3 ++- x/oracle/types/expected_keeper.go | 7 ++--- x/oracle/types/test_utils.go | 37 ++++++++++++++++----------- x/treasury/genesis.go | 3 ++- x/treasury/keeper/indicator_test.go | 3 ++- x/treasury/keeper/keeper.go | 17 ++++++------ x/treasury/keeper/keeper_test.go | 3 ++- x/treasury/keeper/querier.go | 3 ++- x/treasury/keeper/test_utils.go | 3 ++- x/treasury/types/exptected_keepers.go | 3 ++- x/treasury/types/keys.go | 4 +-- x/treasury/types/querier.go | 5 ++-- 16 files changed, 66 insertions(+), 45 deletions(-) diff --git a/custom/auth/ante/expected_keeper.go b/custom/auth/ante/expected_keeper.go index 390acd443..1326fb785 100644 --- a/custom/auth/ante/expected_keeper.go +++ b/custom/auth/ante/expected_keeper.go @@ -1,6 +1,7 @@ package ante import ( + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -10,7 +11,7 @@ import ( type TreasuryKeeper interface { RecordEpochTaxProceeds(ctx sdk.Context, delta sdk.Coins) GetTaxRate(ctx sdk.Context) (taxRate sdk.Dec) - GetTaxCap(ctx sdk.Context, denom string) (taxCap sdk.Int) + GetTaxCap(ctx sdk.Context, denom string) (taxCap math.Int) GetBurnSplitRate(ctx sdk.Context) sdk.Dec HasBurnTaxExemptionAddress(ctx sdk.Context, addresses ...string) bool HasBurnTaxExemptionContract(ctx sdk.Context, address string) bool diff --git a/custom/auth/client/utils/feeutils.go b/custom/auth/client/utils/feeutils.go index 9ad060d5b..cd45132ce 100644 --- a/custom/auth/client/utils/feeutils.go +++ b/custom/auth/client/utils/feeutils.go @@ -3,6 +3,7 @@ package utils import ( "context" + "cosmossdk.io/math" "github.com/spf13/pflag" "github.com/cosmos/cosmos-sdk/client" @@ -13,7 +14,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - wasmexported "github.com/CosmWasm/wasmd/x/wasm" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" marketexported "github.com/classic-terra/core/v3/x/market/exported" treasuryexported "github.com/classic-terra/core/v3/x/treasury/exported" ) @@ -143,7 +144,7 @@ func FilterMsgAndComputeTax(clientCtx client.Context, msgs ...sdk.Msg) (taxes sd taxes = taxes.Add(tax...) - case *wasmexported.MsgInstantiateContract: + case *wasmtypes.MsgInstantiateContract: tax, err := computeTax(clientCtx, taxRate, msg.Funds) if err != nil { return nil, err @@ -151,7 +152,7 @@ func FilterMsgAndComputeTax(clientCtx client.Context, msgs ...sdk.Msg) (taxes sd taxes = taxes.Add(tax...) - case *wasmexported.MsgInstantiateContract2: + case *wasmtypes.MsgInstantiateContract2: tax, err := computeTax(clientCtx, taxRate, msg.Funds) if err != nil { return nil, err @@ -159,7 +160,7 @@ func FilterMsgAndComputeTax(clientCtx client.Context, msgs ...sdk.Msg) (taxes sd taxes = taxes.Add(tax...) - case *wasmexported.MsgExecuteContract: + case *wasmtypes.MsgExecuteContract: tax, err := computeTax(clientCtx, taxRate, msg.Funds) if err != nil { return nil, err @@ -208,7 +209,7 @@ func queryTaxRate(clientCtx client.Context) (sdk.Dec, error) { return res.TaxRate, err } -func queryTaxCap(clientCtx client.Context, denom string) (sdk.Int, error) { +func queryTaxCap(clientCtx client.Context, denom string) (math.Int, error) { queryClient := treasuryexported.NewQueryClient(clientCtx) res, err := queryClient.TaxCap(context.Background(), &treasuryexported.QueryTaxCapRequest{Denom: denom}) diff --git a/tests/e2e/configurer/chain/queries.go b/tests/e2e/configurer/chain/queries.go index 8fcb1a627..7929817ab 100644 --- a/tests/e2e/configurer/chain/queries.go +++ b/tests/e2e/configurer/chain/queries.go @@ -9,6 +9,7 @@ import ( "net/http" "time" + "cosmossdk.io/math" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -97,7 +98,7 @@ func (n *NodeConfig) QuerySpecificBalance(addr, denom string) (sdk.Coin, error) return sdk.Coin{}, nil } -func (n *NodeConfig) QuerySupplyOf(denom string) (sdk.Int, error) { +func (n *NodeConfig) QuerySupplyOf(denom string) (math.Int, error) { path := fmt.Sprintf("cosmos/bank/v1beta1/supply/%s", denom) bz, err := n.QueryGRPCGateway(path) require.NoError(n.t, err) diff --git a/x/oracle/keeper/test_utils.go b/x/oracle/keeper/test_utils.go index 8c0568f43..5e3b29655 100644 --- a/x/oracle/keeper/test_utils.go +++ b/x/oracle/keeper/test_utils.go @@ -19,6 +19,7 @@ import ( "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "cosmossdk.io/math" simparams "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -240,7 +241,7 @@ func CreateTestInput(t *testing.T) TestInput { } // NewTestMsgCreateValidator test msg creator -func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt sdk.Int) *stakingtypes.MsgCreateValidator { +func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt math.Int) *stakingtypes.MsgCreateValidator { commission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) msg, _ := stakingtypes.NewMsgCreateValidator( address, pubKey, sdk.NewCoin(core.MicroLunaDenom, amt), diff --git a/x/oracle/tally.go b/x/oracle/tally.go index 99abac38f..aa7261f9d 100644 --- a/x/oracle/tally.go +++ b/x/oracle/tally.go @@ -1,6 +1,7 @@ package oracle import ( + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/classic-terra/core/v3/x/oracle/keeper" @@ -37,7 +38,7 @@ func Tally(pb types.ExchangeRateBallot, rewardBand sdk.Dec, validatorClaimMap ma } // ballot for the asset is passing the threshold amount of voting power -func ballotIsPassing(ballot types.ExchangeRateBallot, thresholdVotes sdk.Int) (sdk.Int, bool) { +func ballotIsPassing(ballot types.ExchangeRateBallot, thresholdVotes math.Int) (math.Int, bool) { ballotPower := sdk.NewInt(ballot.Power()) return ballotPower, !ballotPower.IsZero() && ballotPower.GTE(thresholdVotes) } diff --git a/x/oracle/types/expected_keeper.go b/x/oracle/types/expected_keeper.go index 79d1ab253..838ecfcf8 100644 --- a/x/oracle/types/expected_keeper.go +++ b/x/oracle/types/expected_keeper.go @@ -1,6 +1,7 @@ package types import ( + "cosmossdk.io/math" 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" @@ -10,13 +11,13 @@ import ( // StakingKeeper is expected keeper for staking module type StakingKeeper interface { Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI // get validator by operator address; nil when validator not found - TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set + TotalBondedTokens(sdk.Context) math.Int // total bonded tokens within the validator set // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction - Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdk.Int + Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) math.Int Jail(sdk.Context, sdk.ConsAddress) // jail a validator ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator // an iterator for the current validator power store MaxValidators(sdk.Context) uint32 // MaxValidators returns the maximum amount of bonded validators - PowerReduction(ctx sdk.Context) (res sdk.Int) + PowerReduction(ctx sdk.Context) (res math.Int) } // DistributionKeeper is expected keeper for distribution module diff --git a/x/oracle/types/test_utils.go b/x/oracle/types/test_utils.go index 990260a9a..92c4c194d 100644 --- a/x/oracle/types/test_utils.go +++ b/x/oracle/types/test_utils.go @@ -5,6 +5,7 @@ import ( "math/rand" "time" + sdkmath "cosmossdk.io/math" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -69,11 +70,11 @@ func (sk DummyStakingKeeper) Validator(_ sdk.Context, address sdk.ValAddress) st return nil } -func (DummyStakingKeeper) TotalBondedTokens(sdk.Context) sdk.Int { +func (DummyStakingKeeper) TotalBondedTokens(sdk.Context) sdkmath.Int { return sdk.ZeroInt() } -func (DummyStakingKeeper) Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdk.Int { +func (DummyStakingKeeper) Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdkmath.Int { return sdk.ZeroInt() } @@ -94,7 +95,7 @@ func (DummyStakingKeeper) MaxValidators(sdk.Context) uint32 { } // PowerReduction - is the amount of staking tokens required for 1 unit of consensus-engine power -func (DummyStakingKeeper) PowerReduction(sdk.Context) (res sdk.Int) { +func (DummyStakingKeeper) PowerReduction(sdk.Context) (res sdkmath.Int) { res = sdk.DefaultPowerReduction return } @@ -118,23 +119,29 @@ func (MockValidator) TmConsPublicKey() (tmprotocrypto.PublicKey, error) { return tmprotocrypto.PublicKey{}, nil } func (MockValidator) GetConsAddr() (sdk.ConsAddress, error) { return nil, nil } -func (v MockValidator) GetTokens() sdk.Int { +func (v MockValidator) GetTokens() sdkmath.Int { return sdk.TokensFromConsensusPower(v.power, sdk.DefaultPowerReduction) } -func (v MockValidator) GetBondedTokens() sdk.Int { +func (v MockValidator) GetBondedTokens() sdkmath.Int { return sdk.TokensFromConsensusPower(v.power, sdk.DefaultPowerReduction) } -func (v MockValidator) GetConsensusPower(_ sdk.Int) int64 { return v.power } -func (v *MockValidator) SetConsensusPower(power int64) { v.power = power } -func (v MockValidator) GetCommission() sdk.Dec { return sdk.ZeroDec() } -func (v MockValidator) GetMinSelfDelegation() sdk.Int { return sdk.OneInt() } -func (v MockValidator) GetDelegatorShares() sdk.Dec { return sdk.NewDec(v.power) } -func (v MockValidator) TokensFromShares(sdk.Dec) sdk.Dec { return sdk.ZeroDec() } -func (v MockValidator) TokensFromSharesTruncated(sdk.Dec) sdk.Dec { return sdk.ZeroDec() } -func (v MockValidator) TokensFromSharesRoundUp(sdk.Dec) sdk.Dec { return sdk.ZeroDec() } -func (v MockValidator) SharesFromTokens(_ sdk.Int) (sdk.Dec, error) { return sdk.ZeroDec(), nil } -func (v MockValidator) SharesFromTokensTruncated(_ sdk.Int) (sdk.Dec, error) { +func (v MockValidator) GetConsensusPower(_ sdkmath.Int) int64 { return v.power } +func (v *MockValidator) SetConsensusPower(power int64) { v.power = power } +func (v MockValidator) GetCommission() sdk.Dec { return sdk.ZeroDec() } +func (v MockValidator) GetMinSelfDelegation() sdkmath.Int { return sdk.OneInt() } +func (v MockValidator) GetDelegatorShares() sdk.Dec { return sdk.NewDec(v.power) } +func (v MockValidator) TokensFromShares(sdk.Dec) sdk.Dec { return sdk.ZeroDec() } +func (v MockValidator) TokensFromSharesTruncated(sdk.Dec) sdk.Dec { + return sdk.ZeroDec() +} +func (v MockValidator) TokensFromSharesRoundUp(sdk.Dec) sdk.Dec { + return sdk.ZeroDec() +} +func (v MockValidator) SharesFromTokens(_ sdkmath.Int) (sdk.Dec, error) { + return sdk.ZeroDec(), nil +} +func (v MockValidator) SharesFromTokensTruncated(_ sdkmath.Int) (sdk.Dec, error) { return sdk.ZeroDec(), nil } diff --git a/x/treasury/genesis.go b/x/treasury/genesis.go index 9a1372bf3..ab144350a 100644 --- a/x/treasury/genesis.go +++ b/x/treasury/genesis.go @@ -3,6 +3,7 @@ package treasury import ( "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" core "github.com/classic-terra/core/v3/types" @@ -62,7 +63,7 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) (data *types.GenesisSt epochInitialIssuance := keeper.GetEpochInitialIssuance(ctx) var taxCaps []types.TaxCap - keeper.IterateTaxCap(ctx, func(denom string, taxCap sdk.Int) bool { + keeper.IterateTaxCap(ctx, func(denom string, taxCap math.Int) bool { taxCaps = append(taxCaps, types.TaxCap{ Denom: denom, TaxCap: taxCap, diff --git a/x/treasury/keeper/indicator_test.go b/x/treasury/keeper/indicator_test.go index 9efd0a407..59f9ab1a1 100644 --- a/x/treasury/keeper/indicator_test.go +++ b/x/treasury/keeper/indicator_test.go @@ -3,6 +3,7 @@ package keeper import ( "testing" + "cosmossdk.io/math" core "github.com/classic-terra/core/v3/types" "github.com/stretchr/testify/require" @@ -125,7 +126,7 @@ func TestLoadIndicatorByEpoch(t *testing.T) { input.TreasuryKeeper.SetSR(input.Ctx, int64(epoch), SR) } - TSLArr := []sdk.Int{ + TSLArr := []math.Int{ sdk.NewInt(1000000), sdk.NewInt(2000000), sdk.NewInt(3000000), diff --git a/x/treasury/keeper/keeper.go b/x/treasury/keeper/keeper.go index 800cd11bb..43ede039e 100644 --- a/x/treasury/keeper/keeper.go +++ b/x/treasury/keeper/keeper.go @@ -3,6 +3,7 @@ package keeper import ( "fmt" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -118,21 +119,21 @@ func (k Keeper) GetRewardWeight(ctx sdk.Context) sdk.Dec { } // SetRewardWeight sets the reward weight -func (k Keeper) SetRewardWeight(ctx sdk.Context, rewardWeight sdk.Dec) { +func (k Keeper) SetRewardWeight(ctx sdk.Context, rewardWeight math.LegacyDec) { store := ctx.KVStore(k.storeKey) b := k.cdc.MustMarshal(&sdk.DecProto{Dec: rewardWeight}) store.Set(types.RewardWeightKey, b) } // SetTaxCap sets the tax cap denominated in integer units of the reference {denom} -func (k Keeper) SetTaxCap(ctx sdk.Context, denom string, cap sdk.Int) { +func (k Keeper) SetTaxCap(ctx sdk.Context, denom string, cap math.Int) { store := ctx.KVStore(k.storeKey) bz := k.cdc.MustMarshal(&sdk.IntProto{Int: cap}) store.Set(types.GetTaxCapKey(denom), bz) } // GetTaxCap gets the tax cap denominated in integer units of the reference {denom} -func (k Keeper) GetTaxCap(ctx sdk.Context, denom string) sdk.Int { +func (k Keeper) GetTaxCap(ctx sdk.Context, denom string) math.Int { store := ctx.KVStore(k.storeKey) bz := store.Get(types.GetTaxCapKey(denom)) if bz == nil { @@ -146,7 +147,7 @@ func (k Keeper) GetTaxCap(ctx sdk.Context, denom string) sdk.Int { } // IterateTaxCap iterates all tax cap -func (k Keeper) IterateTaxCap(ctx sdk.Context, handler func(denom string, taxCap sdk.Int) (stop bool)) { +func (k Keeper) IterateTaxCap(ctx sdk.Context, handler func(denom string, taxCap math.Int) (stop bool)) { store := ctx.KVStore(k.storeKey) iter := sdk.KVStorePrefixIterator(store, types.TaxCapKey) @@ -234,7 +235,7 @@ func (k Keeper) GetEpochInitialIssuance(ctx sdk.Context) sdk.Coins { } // PeekEpochSeigniorage returns epoch seigniorage -func (k Keeper) PeekEpochSeigniorage(ctx sdk.Context) sdk.Int { +func (k Keeper) PeekEpochSeigniorage(ctx sdk.Context) math.Int { epochIssuance := k.bankKeeper.GetSupply(ctx, core.MicroLunaDenom).Amount preEpochIssuance := k.GetEpochInitialIssuance(ctx).AmountOf(core.MicroLunaDenom) epochSeigniorage := preEpochIssuance.Sub(epochIssuance) @@ -315,13 +316,13 @@ func (k Keeper) ClearSRs(ctx sdk.Context) { } // GetTSL returns the total staked luna for the epoch -func (k Keeper) GetTSL(ctx sdk.Context, epoch int64) sdk.Int { +func (k Keeper) GetTSL(ctx sdk.Context, epoch int64) math.Int { store := ctx.KVStore(k.storeKey) bz := store.Get(types.GetTSLKey(epoch)) ip := sdk.IntProto{} if bz == nil { - ip.Int = sdk.ZeroInt() + ip.Int = math.ZeroInt() } else { k.cdc.MustUnmarshal(bz, &ip) } @@ -330,7 +331,7 @@ func (k Keeper) GetTSL(ctx sdk.Context, epoch int64) sdk.Int { } // SetTSL stores the total staked luna for the epoch -func (k Keeper) SetTSL(ctx sdk.Context, epoch int64, tsl sdk.Int) { +func (k Keeper) SetTSL(ctx sdk.Context, epoch int64, tsl math.Int) { store := ctx.KVStore(k.storeKey) bz := k.cdc.MustMarshal(&sdk.IntProto{Int: tsl}) diff --git a/x/treasury/keeper/keeper_test.go b/x/treasury/keeper/keeper_test.go index ecc9afba2..33ce21ff8 100644 --- a/x/treasury/keeper/keeper_test.go +++ b/x/treasury/keeper/keeper_test.go @@ -4,6 +4,7 @@ import ( "math/rand" "testing" + "cosmossdk.io/math" "github.com/stretchr/testify/require" "github.com/cometbft/cometbft/crypto/secp256k1" @@ -53,7 +54,7 @@ func TestIterateTaxCap(t *testing.T) { input.TreasuryKeeper.SetTaxCap(input.Ctx, core.MicroUSDDenom, usdCap) input.TreasuryKeeper.SetTaxCap(input.Ctx, core.MicroKRWDenom, krwCap) - input.TreasuryKeeper.IterateTaxCap(input.Ctx, func(denom string, taxCap sdk.Int) bool { + input.TreasuryKeeper.IterateTaxCap(input.Ctx, func(denom string, taxCap math.Int) bool { switch denom { case core.MicroCNYDenom: require.Equal(t, cnyCap, taxCap) diff --git a/x/treasury/keeper/querier.go b/x/treasury/keeper/querier.go index 8ac81c040..6f4c8cc09 100644 --- a/x/treasury/keeper/querier.go +++ b/x/treasury/keeper/querier.go @@ -7,6 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" @@ -59,7 +60,7 @@ func (q querier) TaxCaps(c context.Context, _ *types.QueryTaxCapsRequest) (*type ctx := sdk.UnwrapSDKContext(c) var taxCaps []types.QueryTaxCapsResponseItem - q.IterateTaxCap(ctx, func(denom string, taxCap sdk.Int) bool { + q.IterateTaxCap(ctx, func(denom string, taxCap sdkmath.Int) bool { taxCaps = append(taxCaps, types.QueryTaxCapsResponseItem{ Denom: denom, TaxCap: taxCap, diff --git a/x/treasury/keeper/test_utils.go b/x/treasury/keeper/test_utils.go index 767878a86..4ad7b4796 100644 --- a/x/treasury/keeper/test_utils.go +++ b/x/treasury/keeper/test_utils.go @@ -29,6 +29,7 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "cosmossdk.io/math" simparams "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -323,7 +324,7 @@ func CreateTestInput(t *testing.T) TestInput { } // NewTestMsgCreateValidator test msg creator -func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt sdk.Int) *stakingtypes.MsgCreateValidator { +func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt math.Int) *stakingtypes.MsgCreateValidator { commission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) msg, _ := stakingtypes.NewMsgCreateValidator( address, pubKey, sdk.NewCoin(core.MicroLunaDenom, amt), diff --git a/x/treasury/types/exptected_keepers.go b/x/treasury/types/exptected_keepers.go index 418dda64d..6951f79ba 100644 --- a/x/treasury/types/exptected_keepers.go +++ b/x/treasury/types/exptected_keepers.go @@ -1,6 +1,7 @@ package types import ( + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -30,7 +31,7 @@ type MarketKeeper interface { // StakingKeeper expected keeper for staking module type StakingKeeper interface { - TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set + TotalBondedTokens(sdk.Context) math.Int // total bonded tokens within the validator set } // DistributionKeeper expected keeper for distribution module diff --git a/x/treasury/types/keys.go b/x/treasury/types/keys.go index 2fba31c6d..f53951bd9 100644 --- a/x/treasury/types/keys.go +++ b/x/treasury/types/keys.go @@ -29,7 +29,7 @@ const BurnModuleName = "burn" // // - 0x02: sdk.Dec // -// - 0x03: sdk.Int +// - 0x03: math.Int // // - 0x04: sdk.Coins // @@ -39,7 +39,7 @@ const BurnModuleName = "burn" // // - 0x07: sdk.Dec // -// - 0x08: sdk.Int +// - 0x08: math.Int // // - 0x09: int64 var ( diff --git a/x/treasury/types/querier.go b/x/treasury/types/querier.go index 09a8bd680..001391245 100644 --- a/x/treasury/types/querier.go +++ b/x/treasury/types/querier.go @@ -3,6 +3,7 @@ package types import ( "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -34,8 +35,8 @@ func NewQueryTaxCapParams(denom string) QueryTaxCapParams { // TaxCapsResponseItem query response item of tax caps querier type TaxCapsResponseItem struct { - Denom string `json:"denom"` - TaxCap sdk.Int `json:"tax_cap"` + Denom string `json:"denom"` + TaxCap math.Int `json:"tax_cap"` } // TaxCapsQueryResponse query response body of tax caps querier