diff --git a/Makefile b/Makefile index 0b5f24011..69d7f440b 100644 --- a/Makefile +++ b/Makefile @@ -94,8 +94,8 @@ endif #$(info $$BUILD_FLAGS is [$(BUILD_FLAGS)]) check_version: -ifneq ($(GO_MINOR_VERSION),20) - @echo "ERROR: Please upgrade Go version to 1.20+" +ifneq ($(GO_MINOR_VERSION),21) + @echo "ERROR: Please upgrade Go version to 1.21+" exit 1 endif @@ -190,7 +190,7 @@ endif ### Protobuf ### ############################################################################### -protoVer=0.13.0 +protoVer=0.14.0 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) diff --git a/app/ante.go b/app/ante.go index b7fa16018..334eb6407 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,6 +1,8 @@ package app import ( + corestoretypes "cosmossdk.io/core/store" + errorsmod "cosmossdk.io/errors" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/comdex-official/comdex/app/decorators" @@ -9,31 +11,31 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC // channel keeper. type HandlerOptions struct { ante.HandlerOptions - wasmConfig wasm.Config - txCounterStoreKey storetypes.StoreKey - IBCChannelKeeper *ibckeeper.Keeper - GovKeeper govkeeper.Keeper - Cdc codec.BinaryCodec + wasmConfig wasm.Config + WasmKeeper *wasmkeeper.Keeper + TXCounterStoreService corestoretypes.KVStoreService + IBCChannelKeeper *ibckeeper.Keeper + GovKeeper govkeeper.Keeper + Cdc codec.BinaryCodec } func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { if options.AccountKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") } if options.BankKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") } if options.SignModeHandler == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") } sigGasConsumer := options.SigGasConsumer @@ -44,7 +46,8 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { anteDecorators := []sdk.AnteDecorator{ ante.NewSetUpContextDecorator(), wasmkeeper.NewLimitSimulationGasDecorator(options.wasmConfig.SimulationGasLimit), - wasmkeeper.NewCountTXDecorator(options.txCounterStoreKey), + wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService), + wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()), decorators.NewGovPreventSpamDecorator(options.Cdc, options.GovKeeper), ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), ante.NewValidateBasicDecorator(), diff --git a/app/app.go b/app/app.go index 36e6405ab..d6acdb23a 100644 --- a/app/app.go +++ b/app/app.go @@ -2,52 +2,62 @@ package app import ( "fmt" + dbm "github.com/cosmos/cosmos-db" "io" "net/http" "os" "path/filepath" "sort" - "strings" paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" "github.com/gorilla/mux" "github.com/spf13/cast" + "github.com/cosmos/cosmos-sdk/runtime" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" - ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7" - ibchookskeeper "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/keeper" - ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types" + ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8" + ibchookskeeper "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/keeper" + ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/types" consensus "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" - packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" + packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" + packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" "github.com/rakyll/statik/fs" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - + ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/evidence" + evidencekeeper "cosmossdk.io/x/evidence/keeper" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + "cosmossdk.io/x/upgrade" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server/api" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" @@ -61,20 +71,12 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -96,23 +98,23 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/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" - ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee" - ibcfeekeeper "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper" - ibcfeetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" - ibctransfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcporttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + "github.com/cosmos/ibc-go/modules/capability" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" + ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcclient "github.com/cosmos/ibc-go/v8/modules/core/02-client" + + // ibcclientclient "github.com/cosmos/ibc-go/v8/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" @@ -121,10 +123,9 @@ import ( liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" - tmdb "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" abcitypes "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" @@ -197,9 +198,9 @@ import ( auctionsV2client "github.com/comdex-official/comdex/x/auctionsV2/client" auctionsV2keeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" - icq "github.com/cosmos/ibc-apps/modules/async-icq/v7" - icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v7/keeper" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" + icq "github.com/cosmos/ibc-apps/modules/async-icq/v8" + icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper" + icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" cwasm "github.com/comdex-official/comdex/app/wasm" @@ -212,23 +213,6 @@ const ( Name = "comdex" ) -// GetWasmEnabledProposals parses the WasmProposalsEnabled / EnableSpecificWasmProposals values to -// produce a list of enabled proposals to pass into wasmd app. -func GetWasmEnabledProposals() []wasm.ProposalType { - if EnableSpecificWasmProposals == "" { - if WasmProposalsEnabled == "true" { - return wasm.EnableAllProposals - } - return wasm.DisableAllProposals - } - chunks := strings.Split(EnableSpecificWasmProposals, ",") - proposals, err := wasm.ConvertToProposals(chunks) - if err != nil { - panic(err) - } - return proposals -} - func GetGovProposalHandlers() []govclient.ProposalHandler { proposalHandlers := []govclient.ProposalHandler{ bandoraclemoduleclient.AddFetchPriceHandler, @@ -244,10 +228,6 @@ func GetGovProposalHandlers() []govclient.ProposalHandler { lendclient.AddDepreciatePoolsHandler, lendclient.AddEModePairsHandler, paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, } proposalHandlers = append(proposalHandlers, assetclient.AddAssetsHandler...) proposalHandlers = append(proposalHandlers, liquidityclient.LiquidityProposalHandler...) @@ -260,13 +240,6 @@ func GetGovProposalHandlers() []govclient.ProposalHandler { var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string - // If EnableSpecificWasmProposals is "", and this is "true", then enable all x/wasm proposals. - // If EnableSpecificWasmProposals is "", and this is not "true", then disable all x/wasm proposals. - WasmProposalsEnabled = "true" - // If set to non-empty string it must be comma-separated list of values that are all a subset - // of "EnableAllProposals" (takes precedence over WasmProposalsEnabled) - // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 - EnableSpecificWasmProposals = "" // use this for clarity in argument list EmptyWasmOpts []wasm.Option // ModuleBasics defines the module BasicManager is in charge of setting up basic, @@ -416,7 +389,7 @@ type App struct { // New returns a reference to an initialized App. func New( logger log.Logger, - db tmdb.DB, + db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, @@ -424,15 +397,14 @@ func New( invCheckPeriod uint, encoding EncodingConfig, appOptions servertypes.AppOptions, - wasmEnabledProposals []wasm.ProposalType, wasmOpts []wasm.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *App { appCodec := encoding.Marshaler var ( - tkeys = sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - mkeys = sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - keys = sdk.NewKVStoreKeys( + tkeys = storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) + mkeys = storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + keys = storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, icahosttypes.StoreKey, upgradetypes.StoreKey, @@ -489,7 +461,7 @@ func New( app.ParamsKeeper.Subspace(liquidationtypes.ModuleName) app.ParamsKeeper.Subspace(lockertypes.ModuleName) app.ParamsKeeper.Subspace(bandoraclemoduletypes.ModuleName) - app.ParamsKeeper.Subspace(wasmtypes.ModuleName).WithKeyTable(wasmtypes.ParamKeyTable()) + app.ParamsKeeper.Subspace(wasmtypes.ModuleName) app.ParamsKeeper.Subspace(auctiontypes.ModuleName) app.ParamsKeeper.Subspace(tokenminttypes.ModuleName) app.ParamsKeeper.Subspace(liquiditytypes.ModuleName) @@ -507,8 +479,8 @@ func New( // WithKeyTable(paramskeeper.ConsensusParamsKeyTable()), // ) govModAddress := authtypes.NewModuleAddress(govtypes.ModuleName).String() - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], govModAddress) - baseApp.SetParamStore(&app.ConsensusParamsKeeper) + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), govModAddress, runtime.EventService{}) + baseApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore) // add capability keeper and ScopeToModule for ibc module app.CapabilityKeeper = capabilitykeeper.NewKeeper( @@ -531,29 +503,33 @@ func New( // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( app.cdc, - app.keys[authtypes.StoreKey], + runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, app.ModuleAccountsPermissions(), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), AccountAddressPrefix, govModAddress, ) app.BankKeeper = bankkeeper.NewBaseKeeper( app.cdc, - app.keys[banktypes.StoreKey], + runtime.NewKVStoreService(keys[banktypes.StoreKey]), app.AccountKeeper, nil, govModAddress, + logger, ) stakingKeeper := stakingkeeper.NewKeeper( app.cdc, - app.keys[stakingtypes.StoreKey], + runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, govModAddress, + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), ) app.MintKeeper = mintkeeper.NewKeeper( app.cdc, - app.keys[minttypes.StoreKey], + runtime.NewKVStoreService(keys[minttypes.StoreKey]), stakingKeeper, app.AccountKeeper, app.BankKeeper, @@ -562,7 +538,7 @@ func New( ) app.DistrKeeper = distrkeeper.NewKeeper( app.cdc, - app.keys[distrtypes.StoreKey], + runtime.NewKVStoreService(keys[distrtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, stakingKeeper, @@ -572,21 +548,22 @@ func New( app.SlashingKeeper = slashingkeeper.NewKeeper( app.cdc, encoding.Amino, - app.keys[slashingtypes.StoreKey], + runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), stakingKeeper, govModAddress, ) app.CrisisKeeper = crisiskeeper.NewKeeper( app.cdc, - app.keys[crisistypes.StoreKey], + runtime.NewKVStoreService(keys[crisistypes.StoreKey]), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, govModAddress, + app.AccountKeeper.AddressCodec(), ) app.AuthzKeeper = authzkeeper.NewKeeper( - keys[authzkeeper.StoreKey], + runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), app.cdc, baseApp.MsgServiceRouter(), app.AccountKeeper, @@ -594,7 +571,7 @@ func New( app.UpgradeKeeper = upgradekeeper.NewKeeper( skipUpgradeHeights, - app.keys[upgradetypes.StoreKey], + runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), app.cdc, homePath, app.BaseApp, @@ -622,6 +599,7 @@ func New( app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, + govModAddress, ) // Configure the hooks keeper @@ -646,7 +624,7 @@ func New( app.keys[ibcfeetypes.StoreKey], app.HooksICS4Wrapper, // replaced with IBC middleware app.IbcKeeper.ChannelKeeper, - &app.IbcKeeper.PortKeeper, + app.IbcKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, ) @@ -654,12 +632,12 @@ func New( app.PacketForwardKeeper = packetforwardkeeper.NewKeeper( appCodec, app.keys[packetforwardtypes.StoreKey], - app.GetSubspace(packetforwardtypes.ModuleName), app.IbcTransferKeeper, // Will be zero-value here. Reference is set later on with SetTransferKeeper. app.IbcKeeper.ChannelKeeper, app.DistrKeeper, app.BankKeeper, app.IbcKeeper.ChannelKeeper, + govModAddress, ) app.IbcTransferKeeper = ibctransferkeeper.NewKeeper( @@ -668,10 +646,11 @@ func New( app.GetSubspace(ibctransfertypes.ModuleName), app.PacketForwardKeeper, app.IbcKeeper.ChannelKeeper, - &app.IbcKeeper.PortKeeper, + app.IbcKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, + govModAddress, ) app.PacketForwardKeeper.SetTransferKeeper(app.IbcTransferKeeper) @@ -681,10 +660,11 @@ func New( app.GetSubspace(icahosttypes.SubModuleName), app.HooksICS4Wrapper, app.IbcKeeper.ChannelKeeper, - &app.IbcKeeper.PortKeeper, + app.IbcKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), + govModAddress, ) app.AssetKeeper = assetkeeper.NewKeeper( @@ -752,7 +732,7 @@ func New( keys[bandoraclemoduletypes.MemStoreKey], app.GetSubspace(bandoraclemoduletypes.ModuleName), app.IbcKeeper.ChannelKeeper, - &app.IbcKeeper.PortKeeper, + app.IbcKeeper.PortKeeper, scopedBandoracleKeeper, &app.MarketKeeper, app.AssetKeeper, @@ -763,7 +743,7 @@ func New( app.AccountKeeper, app.BankKeeper, app.ScopedBandoracleKeeper, - &app.IbcKeeper.PortKeeper, + app.IbcKeeper.PortKeeper, app.IbcKeeper.ChannelKeeper, ) @@ -906,12 +886,12 @@ func New( icqKeeper := icqkeeper.NewKeeper( appCodec, app.keys[icqtypes.StoreKey], - app.GetSubspace(icqtypes.ModuleName), app.IbcKeeper.ChannelKeeper, // may be replaced with middleware app.IbcKeeper.ChannelKeeper, - &app.IbcKeeper.PortKeeper, + app.IbcKeeper.PortKeeper, scopedICQKeeper, app.GRPCQueryRouter(), + govModAddress, // NewQuerierWrapper(baseApp), // in-case of strangelove-ventures icq ) app.ICQKeeper = &icqKeeper @@ -932,14 +912,14 @@ func New( app.WasmKeeper = wasmkeeper.NewKeeper( app.cdc, - keys[wasmtypes.StoreKey], + runtime.NewKVStoreService(keys[wasmtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, app.StakingKeeper, distrkeeper.NewQuerier(app.DistrKeeper), app.IBCFeeKeeper, app.IbcKeeper.ChannelKeeper, - &app.IbcKeeper.PortKeeper, + app.IbcKeeper.PortKeeper, scopedWasmKeeper, app.IbcTransferKeeper, baseApp.MsgServiceRouter(), @@ -959,7 +939,6 @@ func New( govRouter := govtypesv1beta1.NewRouter() govRouter.AddRoute(govtypes.RouterKey, govtypesv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(assettypes.RouterKey, asset.NewUpdateAssetProposalHandler(app.AssetKeeper)). AddRoute(lendtypes.RouterKey, lend.NewLendHandler(app.LendKeeper)). AddRoute(bandoraclemoduletypes.RouterKey, bandoraclemodule.NewFetchPriceHandler(app.BandoracleKeeper)). @@ -969,13 +948,9 @@ func New( AddRoute(liquidationsV2types.RouterKey, liquidationsV2.NewLiquidationsV2Handler(app.NewliqKeeper)). AddRoute(auctionsV2types.RouterKey, auctionsV2.NewAuctionsV2Handler(app.NewaucKeeper)) - if len(wasmEnabledProposals) != 0 { - govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasmEnabledProposals)) - } - govKeeper := govkeeper.NewKeeper( - app.cdc, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, app.MsgServiceRouter(), govtypes.DefaultConfig(), govModAddress, + app.cdc, runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, + app.StakingKeeper, app.DistrKeeper, app.MsgServiceRouter(), govtypes.DefaultConfig(), govModAddress, ) govKeeper.SetLegacyRouter(govRouter) @@ -1021,9 +996,11 @@ func New( // Create evidence Keeper for to register the IBC light client misbehaviour evidence route app.EvidenceKeeper = *evidencekeeper.NewKeeper( app.cdc, - app.keys[evidencetypes.StoreKey], + runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), app.StakingKeeper, app.SlashingKeeper, + app.AccountKeeper.AddressCodec(), + runtime.ProvideCometInfoService(), ) app.EvidenceKeeper.SetRouter(evidenceRouter) @@ -1037,7 +1014,7 @@ func New( // must be passed by reference here. app.mm = module.NewManager( - genutil.NewAppModule(app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, encoding.TxConfig), + genutil.NewAppModule(app.AccountKeeper, app.StakingKeeper, app, encoding.TxConfig), auth.NewAppModule(app.cdc, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), bank.NewAppModule(app.cdc, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), @@ -1045,10 +1022,10 @@ func New( crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), gov.NewAppModule(app.cdc, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(app.cdc, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), // nil -> SDK's default inflation function. - slashing.NewAppModule(app.cdc, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(app.cdc, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), distr.NewAppModule(app.cdc, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), staking.NewAppModule(app.cdc, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - upgrade.NewAppModule(app.UpgradeKeeper), + upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), evidence.NewAppModule(app.EvidenceKeeper), authzmodule.NewAppModule(app.cdc, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), ibc.NewAppModule(app.IbcKeeper), @@ -1075,8 +1052,13 @@ func New( common.NewAppModule(app.cdc, app.CommonKeeper, app.AccountKeeper, app.BankKeeper, app.WasmKeeper), auctionsV2.NewAppModule(app.cdc, app.NewaucKeeper, app.BankKeeper), ibchooks.NewAppModule(app.AccountKeeper), - icq.NewAppModule(*app.ICQKeeper), - packetforward.NewAppModule(app.PacketForwardKeeper), + icq.NewAppModule(*app.ICQKeeper, app.GetSubspace(icqtypes.ModuleName)), + packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)), + ) + + // NOTE: upgrade module is required to be prioritized + app.mm.SetOrderPreBlockers( + upgradetypes.ModuleName, ) // During begin block slashing happens after distr.BeginBlocker so that @@ -1084,7 +1066,6 @@ func New( // CanWithdrawInvariant invariant. // NOTE: staking module is required if HistoricalEntries param > 0 app.mm.SetOrderBeginBlockers( - upgradetypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, @@ -1238,6 +1219,7 @@ func New( // initialize BaseApp app.SetInitChainer(app.InitChainer) + app.SetPreBlocker(app.PreBlocker) app.SetBeginBlocker(app.BeginBlocker) anteHandler, err := NewAnteHandler( HandlerOptions{ @@ -1248,11 +1230,12 @@ func New( SignModeHandler: encoding.TxConfig.SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, - GovKeeper: app.GovKeeper, - wasmConfig: wasmConfig, - txCounterStoreKey: app.GetKey(wasm.StoreKey), - IBCChannelKeeper: app.IbcKeeper, - Cdc: appCodec, + GovKeeper: app.GovKeeper, + wasmConfig: wasmConfig, + WasmKeeper: &app.WasmKeeper, + TXCounterStoreService: runtime.NewKVStoreService(keys[wasmtypes.StoreKey]), + IBCChannelKeeper: app.IbcKeeper, + Cdc: appCodec, }, ) if err != nil { @@ -1303,23 +1286,27 @@ func New( func (a *App) Name() string { return a.BaseApp.Name() } // BeginBlocker application updates every begin block -func (a *App) BeginBlocker(ctx sdk.Context, req abcitypes.RequestBeginBlock) abcitypes.ResponseBeginBlock { - return a.mm.BeginBlock(ctx, req) +func (a *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { + return a.mm.BeginBlock(ctx) } // EndBlocker application updates every end block. -func (a *App) EndBlocker(ctx sdk.Context, req abcitypes.RequestEndBlock) abcitypes.ResponseEndBlock { - return a.mm.EndBlock(ctx, req) +func (a *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + return a.mm.EndBlock(ctx) } // InitChainer application update at chain initialization. -func (a *App) InitChainer(ctx sdk.Context, req abcitypes.RequestInitChain) abcitypes.ResponseInitChain { +func (a *App) InitChainer(ctx sdk.Context, req *abcitypes.RequestInitChain) (*abcitypes.ResponseInitChain, error) { var state GenesisState if err := tmjson.Unmarshal(req.AppStateBytes, &state); err != nil { panic(err) } - a.UpgradeKeeper.SetModuleVersionMap(ctx, a.mm.GetVersionMap()) - return a.mm.InitGenesis(ctx, a.AppCodec(), state) + err := a.UpgradeKeeper.SetModuleVersionMap(ctx, a.mm.GetVersionMap()) + if err != nil { + panic(err) + } + response, err := a.mm.InitGenesis(ctx, a.cdc, state) + return response, err } // LoadHeight loads a particular height. @@ -1400,7 +1387,7 @@ func (a *App) RegisterAPIRoutes(server *api.Server, apiConfig serverconfig.APICo // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(ctx, server.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(ctx, server.GRPCGatewayRouter) + cmtservice.RegisterGRPCGatewayRoutes(ctx, server.GRPCGatewayRouter) // Register legacy and grpc-gateway routes for all modules. ModuleBasics.RegisterGRPCGatewayRoutes(ctx, server.GRPCGatewayRouter) @@ -1431,12 +1418,12 @@ func (a *App) RegisterTxService(ctx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (a *App) RegisterTendermintService(ctx client.Context) { - tmservice.RegisterTendermintService(ctx, a.BaseApp.GRPCQueryRouter(), a.interfaceRegistry, a.Query) + cmtservice.RegisterTendermintService(ctx, a.BaseApp.GRPCQueryRouter(), a.interfaceRegistry, a.Query) } // RegisterNodeService registers the node gRPC Query service. -func (a *App) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, a.GRPCQueryRouter()) +func (a *App) RegisterNodeService(clientCtx client.Context, cfg serverconfig.Config) { + nodeservice.RegisterNodeService(clientCtx, a.GRPCQueryRouter(), cfg) } func (a *App) ModuleAccountsPermissions() map[string][]string { @@ -1480,6 +1467,10 @@ func (a *App) ModuleAccountsPermissions() map[string][]string { } } +func (app *App) PreBlocker(ctx sdk.Context, _ *abcitypes.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return app.mm.PreBlock(ctx) +} + func (a *App) registerUpgradeHandlers() { a.UpgradeKeeper.SetUpgradeHandler( tv14.UpgradeName, diff --git a/app/decorators/gov_filter.go b/app/decorators/gov_filter.go index 0dc94c5de..8e6780243 100644 --- a/app/decorators/gov_filter.go +++ b/app/decorators/gov_filter.go @@ -1,6 +1,8 @@ package decorators import ( + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -9,7 +11,7 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -var MiniumInitialDepositRate = sdk.NewDecWithPrec(25, 2) +var MiniumInitialDepositRate = sdkmath.LegacyNewDecWithPrec(25, 2) type GovPreventSpamDecorator struct { govKeeper govkeeper.Keeper @@ -45,7 +47,7 @@ func (gpsd GovPreventSpamDecorator) checkSpamSubmitProposalMsg(ctx sdk.Context, depositParams := gpsd.govKeeper.GetParams(ctx) miniumInitialDeposit := gpsd.calcMiniumInitialDeposit(depositParams.MinDeposit) if msg.InitialDeposit.IsAllLT(miniumInitialDeposit) { - return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "not enough initial deposit. required: %v", miniumInitialDeposit) + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "not enough initial deposit. required: %v", miniumInitialDeposit) } } return nil @@ -59,7 +61,7 @@ func (gpsd GovPreventSpamDecorator) checkSpamSubmitProposalMsg(ctx sdk.Context, for _, v := range msg.Msgs { err := gpsd.cdc.UnpackAny(v, &innerMsg) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "cannot unmarshal authz exec msgs") + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "cannot unmarshal authz exec msgs") } err = validMsg(innerMsg) diff --git a/app/export.go b/app/export.go index 2598cce96..739e8a8f6 100644 --- a/app/export.go +++ b/app/export.go @@ -1,11 +1,11 @@ package app import ( - "fmt" "encoding/json" + "fmt" "log" - tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" + storetypes "cosmossdk.io/store/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" @@ -18,7 +18,7 @@ import ( func (a *App) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := a.NewContext(true, tmprototypes.Header{Height: a.LastBlockHeight()}) + ctx := a.NewContext(true) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. @@ -28,7 +28,10 @@ func (a *App) ExportAppStateAndValidators( a.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := a.mm.ExportGenesisForModules(ctx, a.cdc, modulesToExport) + genState, err := a.mm.ExportGenesisForModules(ctx, a.cdc, modulesToExport) + if err != nil { + return servertypes.ExportedApp{}, err + } appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -71,13 +74,23 @@ func (a *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []strin /* Handle fee distribution state. */ // withdraw all validator commission - a.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = a.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + err := a.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valBz, err := a.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } + _, _ = a.DistrKeeper.WithdrawValidatorCommission(ctx, valBz) return false }) + if err != nil { + panic(err) + } // withdraw all delegator rewards - dels := a.StakingKeeper.GetAllDelegations(ctx) + dels, err := a.StakingKeeper.GetAllDelegations(ctx) + if err != nil { + panic(err) + } for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -100,18 +113,33 @@ func (a *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []strin ctx = ctx.WithBlockHeight(0) // reinitialize all validators - a.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + err = a.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valBz, err := a.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := a.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := a.DistrKeeper.GetFeePool(ctx) + scraps, err := a.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valBz) + if err != nil { + panic(err) + } + feePool, err := a.DistrKeeper.FeePool.Get(ctx) + if err != nil { + panic(err) + } feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - a.DistrKeeper.SetFeePool(ctx, feePool) + if err := a.DistrKeeper.FeePool.Set(ctx, feePool); err != nil { + panic(err) + } - if err := a.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()); err !=nil { + if err := a.DistrKeeper.Hooks().AfterValidatorCreated(ctx, valBz); err != nil { panic(err) } return false }) + if err != nil { + panic(err) + } // reinitialize all delegations for _, del := range dels { @@ -158,13 +186,13 @@ func (a *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []strin // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. store := ctx.KVStore(a.keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) counter := int16(0) for ; iter.Valid(); iter.Next() { addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) - validator, found := a.StakingKeeper.GetValidator(ctx, addr) - if !found { + validator, err := a.StakingKeeper.GetValidator(ctx, addr) + if err != nil { panic("expected validator, not found") } @@ -182,7 +210,7 @@ func (a *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []strin return } - _, err := a.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err = a.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { log.Fatal(err) } diff --git a/app/querier.go b/app/querier.go index 1cda480f7..fe06dfa61 100644 --- a/app/querier.go +++ b/app/querier.go @@ -4,23 +4,22 @@ package app import ( - abci "github.com/cometbft/cometbft/abci/types" - - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" ) // QuerierWrapper is a local wrapper around BaseApp that exports only the Queryable interface. // This is used to pass the baseApp to Async ICQ without exposing all methods type QuerierWrapper struct { - querier sdk.Queryable + querier storetypes.Queryable } -var _ sdk.Queryable = QuerierWrapper{} +// var _ storetypes.Queryable = QuerierWrapper{} -func NewQuerierWrapper(querier sdk.Queryable) QuerierWrapper { +func NewQuerierWrapper(querier storetypes.Queryable) QuerierWrapper { return QuerierWrapper{querier: querier} } -func (q QuerierWrapper) Query(req abci.RequestQuery) abci.ResponseQuery { - return q.querier.Query(req) +func (q QuerierWrapper) Query(req storetypes.RequestQuery) storetypes.ResponseQuery { + ResponseQuery, _ := q.querier.Query(&req) + return *ResponseQuery } diff --git a/app/test_helpers.go b/app/test_helpers.go index 9e4f2cf00..3cde899a3 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -1,13 +1,16 @@ package app import ( - "cosmossdk.io/math" "encoding/json" - dbm "github.com/cometbft/cometbft-db" + "testing" + "time" + + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -18,8 +21,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" - "testing" - "time" + // simappparams "cosmossdk.io/simapp/params" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) @@ -55,7 +57,7 @@ func MakeTestEncodingConfig() moduletestutil.TestEncodingConfig { func setup(t *testing.T, withGenesis bool) (*App, GenesisState) { db := dbm.NewMemDB() //encCdc := MakeTestEncodingConfig() - app := New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig(), simtestutil.EmptyAppOptions{}, GetWasmEnabledProposals(), EmptyWasmOpts) + app := New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig(), simtestutil.EmptyAppOptions{}, EmptyWasmOpts) if withGenesis { return app, NewDefaultGenesisState(app.AppCodec()) } @@ -79,7 +81,7 @@ func Setup(t *testing.T, isCheckTx bool) *App { acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) balance := banktypes.Balance{ Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin("ucmdx", sdk.NewInt(100000000000000))), + Coins: sdk.NewCoins(sdk.NewCoin("ucmdx", sdkmath.NewInt(100000000000000))), } app := SetupWithGenesisValSet(t, valSet, []authtypes.GenesisAccount{acc}, balance) @@ -97,25 +99,22 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs require.NoError(t, err) // init chain will set the validator set and initialize the genesis accounts - app.InitChain( - abci.RequestInitChain{ - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: DefaultConsensusParams, - AppStateBytes: stateBytes, - Time: time.Now().UTC(), - InitialHeight: 1, - }, - ) + _, err = app.InitChain(&abci.RequestInitChain{ + ChainId: app.ChainID(), + Time: time.Now().UTC(), + Validators: []abci.ValidatorUpdate{}, + ConsensusParams: DefaultConsensusParams, + InitialHeight: app.LastBlockHeight() + 1, + AppStateBytes: stateBytes, + }) + require.NoError(t, err) - // commit genesis changes - app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ValidatorsHash: valSet.Hash(), + Hash: app.LastCommitID().Hash, NextValidatorsHash: valSet.Hash(), - Time: time.Now().UTC(), - }}) + }) + require.NoError(t, err) return app } @@ -147,15 +146,15 @@ func genesisStateWithValSet(t *testing.T, Jailed: false, Status: stakingtypes.Bonded, Tokens: bondAmt, - DelegatorShares: math.LegacyOneDec(), + DelegatorShares: sdkmath.LegacyOneDec(), Description: stakingtypes.Description{}, UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), - MinSelfDelegation: math.ZeroInt(), + Commission: stakingtypes.NewCommission(sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()), + MinSelfDelegation: sdkmath.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), math.LegacyOneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), sdkmath.LegacyOneDec())) } diff --git a/app/test_suite.go b/app/test_suite.go index bf171433e..206741df0 100644 --- a/app/test_suite.go +++ b/app/test_suite.go @@ -1,7 +1,7 @@ package app import ( - "encoding/json" + "cosmossdk.io/store/metrics" "fmt" "testing" "time" @@ -9,31 +9,29 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - dbm "github.com/cometbft/cometbft-db" - abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/log" "github.com/cometbft/cometbft/crypto/ed25519" - "github.com/cometbft/cometbft/libs/log" tmtypes "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" - "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" + "cosmossdk.io/store/rootmulti" + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/store/rootmulti" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/authz" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - // "github.com/comdex-official/comdex/app" ) @@ -50,7 +48,7 @@ type KeeperTestHelper struct { func (s *KeeperTestHelper) Setup() { t := s.T() s.App = Setup(t, true) - s.Ctx = s.App.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: "testing", Time: time.Now().UTC()}) + s.Ctx = s.App.BaseApp.NewContext(false) s.QueryHelper = &baseapp.QueryServiceTestHelper{ GRPCQueryRouter: s.App.GRPCQueryRouter(), Ctx: s.Ctx, @@ -62,9 +60,7 @@ func (s *KeeperTestHelper) SetupTestForInitGenesis() { t := s.T() // Setting to True, leads to init genesis not running s.App = Setup(t, true) - s.Ctx = s.App.BaseApp.NewContext(true, tmtypes.Header{ - ChainID: "testing", - }) + s.Ctx = s.App.BaseApp.NewContext(true) } // CreateTestContext creates a test context. @@ -74,34 +70,30 @@ func (s *KeeperTestHelper) CreateTestContext() sdk.Context { } // CreateTestContextWithMultiStore creates a test context and returns it together with multi store. -func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, sdk.CommitMultiStore) { +func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, storetypes.CommitMultiStore) { db := dbm.NewMemDB() logger := log.NewNopLogger() - ms := rootmulti.NewStore(db, logger) + ms := rootmulti.NewStore(db, logger, metrics.NewNoOpMetrics()) return sdk.NewContext(ms, tmtypes.Header{}, false, logger), ms } // CreateTestContext creates a test context. func (s *KeeperTestHelper) Commit() { - oldHeight := s.Ctx.BlockHeight() - oldHeader := s.Ctx.BlockHeader() s.App.Commit() - newHeader := tmtypes.Header{Height: oldHeight + 1, ChainID: "testing", Time: oldHeader.Time.Add(time.Second)} - s.App.BeginBlock(abci.RequestBeginBlock{Header: newHeader}) - s.Ctx = s.App.NewContext(false, newHeader) + s.Ctx = s.App.NewContext(false) } // FundAcc funds target address with specified amount. func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins) { - err := banktestutil.FundAccount(s.App.BankKeeper, s.Ctx, acc, amounts) + err := banktestutil.FundAccount(s.Ctx, s.App.BankKeeper, acc, amounts) s.Require().NoError(err) } // FundModuleAcc funds target modules with specified amount. func (s *KeeperTestHelper) FundModuleAcc(moduleName string, amounts sdk.Coins) { - err := banktestutil.FundModuleAccount(s.App.BankKeeper, s.Ctx, moduleName, amounts) + err := banktestutil.FundModuleAccount(s.Ctx, s.App.BankKeeper, moduleName, amounts) s.Require().NoError(err) } @@ -114,22 +106,23 @@ func (s *KeeperTestHelper) MintCoins(coins sdk.Coins) { func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress { valPub := secp256k1.GenPrivKey().PubKey() valAddr := sdk.ValAddress(valPub.Address()) - bondDenom := s.App.StakingKeeper.GetParams(s.Ctx).BondDenom - selfBond := sdk.NewCoins(sdk.Coin{Amount: sdk.NewInt(100), Denom: bondDenom}) + params, err := s.App.StakingKeeper.GetParams(s.Ctx) + s.Require().NoError(err) + selfBond := sdk.NewCoins(sdk.Coin{Amount: sdkmath.NewInt(100), Denom: params.BondDenom}) s.FundAcc(sdk.AccAddress(valAddr), selfBond) // stakingHandler := staking.NewHandler(s.App.StakingKeeper) stakingCoin := sdk.NewCoin("ucmdx", selfBond[0].Amount) - ZeroCommission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) - _, err := stakingtypes.NewMsgCreateValidator(valAddr, valPub, stakingCoin, stakingtypes.Description{}, ZeroCommission, sdk.OneInt()) + ZeroCommission := stakingtypes.NewCommissionRates(sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()) + _, err = stakingtypes.NewMsgCreateValidator(valAddr.String(), valPub, stakingCoin, stakingtypes.Description{}, ZeroCommission, sdkmath.OneInt()) s.Require().NoError(err) // res, err := stakingHandler(s.Ctx, msg) // s.Require().NoError(err) // s.Require().NotNil(res) - val, found := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr) - s.Require().True(found) + val, err := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr) + s.Require().NoError(err) val = val.UpdateStatus(bondStatus) s.App.StakingKeeper.SetValidator(s.Ctx, val) @@ -154,16 +147,17 @@ func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sd func (s *KeeperTestHelper) BeginNewBlock() { var valAddr []byte - validators := s.App.StakingKeeper.GetAllValidators(s.Ctx) + validators, err := s.App.StakingKeeper.GetAllValidators(s.Ctx) + s.Require().NoError(err) if len(validators) >= 1 { valAddrFancy, err := validators[0].GetConsAddr() s.Require().NoError(err) - valAddr = valAddrFancy.Bytes() + valAddr = valAddrFancy } else { valAddrFancy := s.SetupValidator(stakingtypes.Bonded) validator, _ := s.App.StakingKeeper.GetValidator(s.Ctx, valAddrFancy) valAddr2, _ := validator.GetConsAddr() - valAddr = valAddr2.Bytes() + valAddr = valAddr2 } s.BeginNewBlockWithProposer(valAddr) @@ -171,51 +165,38 @@ func (s *KeeperTestHelper) BeginNewBlock() { // BeginNewBlockWithProposer begins a new block with a proposer. func (s *KeeperTestHelper) BeginNewBlockWithProposer(proposer sdk.ValAddress) { - validator, found := s.App.StakingKeeper.GetValidator(s.Ctx, proposer) - s.Assert().True(found) - - valConsAddr, err := validator.GetConsAddr() + _, err := s.App.StakingKeeper.GetValidator(s.Ctx, proposer) s.Require().NoError(err) - valAddr := valConsAddr.Bytes() - newBlockTime := s.Ctx.BlockTime().Add(5 * time.Second) - header := tmtypes.Header{Height: s.Ctx.BlockHeight() + 1, Time: newBlockTime} newCtx := s.Ctx.WithBlockTime(newBlockTime).WithBlockHeight(s.Ctx.BlockHeight() + 1) s.Ctx = newCtx - lastCommitInfo := abci.CommitInfo{ - Votes: []abci.VoteInfo{{ - Validator: abci.Validator{Address: valAddr, Power: 1000}, - SignedLastBlock: true, - }}, - Round: 0, - } - reqBeginBlock := abci.RequestBeginBlock{Header: header, LastCommitInfo: lastCommitInfo} fmt.Println("beginning block ", s.Ctx.BlockHeight()) - s.App.BeginBlocker(s.Ctx, reqBeginBlock) + _, err = s.App.BeginBlocker(s.Ctx) + s.Require().NoError(err) } // EndBlock ends the block. func (s *KeeperTestHelper) EndBlock() { - reqEndBlock := abci.RequestEndBlock{Height: s.Ctx.BlockHeight()} - s.App.EndBlocker(s.Ctx, reqEndBlock) + _, err := s.App.EndBlocker(s.Ctx) + s.Require().NoError(err) } // AllocateRewardsToValidator allocates reward tokens to a distribution module then allocates rewards to the validator address. -func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt math.Int) { - validator, found := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr) - s.Require().True(found) +func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt sdkmath.Int) { + validator, err := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr) + s.Require().NoError(err) // allocate reward tokens to distribution module coins := sdk.Coins{sdk.NewCoin("ucmdx", rewardAmt)} - err := banktestutil.FundModuleAccount(s.App.BankKeeper, s.Ctx, distrtypes.ModuleName, coins) + err = banktestutil.FundModuleAccount(s.Ctx, s.App.BankKeeper, distrtypes.ModuleName, coins) s.Require().NoError(err) // allocate rewards to validator s.Ctx = s.Ctx.WithBlockHeight(s.Ctx.BlockHeight() + 1) - decTokens := sdk.DecCoins{{Denom: "ucmdx", Amount: sdk.NewDec(20000)}} + decTokens := sdk.DecCoins{{Denom: "ucmdx", Amount: sdkmath.LegacyNewDec(20000)}} s.App.DistrKeeper.AllocateTokensToValidator(s.Ctx, validator, decTokens) } @@ -245,13 +226,12 @@ func (s *KeeperTestHelper) ConfirmUpgradeSucceeded(upgradeName string, upgradeHe plan := upgradetypes.Plan{Name: upgradeName, Height: upgradeHeight} err := s.App.UpgradeKeeper.ScheduleUpgrade(s.Ctx, plan) s.Require().NoError(err) - _, exists := s.App.UpgradeKeeper.GetUpgradePlan(s.Ctx) - s.Require().True(exists) + _, err = s.App.UpgradeKeeper.GetUpgradePlan(s.Ctx) + s.Require().NoError(err) s.Ctx = s.Ctx.WithBlockHeight(upgradeHeight) s.Require().NotPanics(func() { - beginBlockRequest := abci.RequestBeginBlock{} - s.App.BeginBlocker(s.Ctx, beginBlockRequest) + s.App.BeginBlocker(s.Ctx) }) } @@ -274,9 +254,7 @@ func TestMessageAuthzSerialization(t *testing.T, msg sdk.Msg) { ) var ( - mockMsgGrant authz.MsgGrant - mockMsgRevoke authz.MsgRevoke - mockMsgExec authz.MsgExec + mockMsgExec authz.MsgExec ) // Authz: Grant Msg @@ -286,22 +264,19 @@ func TestMessageAuthzSerialization(t *testing.T, msg sdk.Msg) { require.NoError(t, err) msgGrant := authz.MsgGrant{Granter: mockGranter, Grantee: mockGrantee, Grant: grant} - msgGrantBytes := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgGrant))) - err = authzcodec.ModuleCdc.UnmarshalJSON(msgGrantBytes, &mockMsgGrant) + _, err = cdctypes.NewAnyWithValue(&msgGrant) require.NoError(t, err) // Authz: Revoke Msg msgRevoke := authz.MsgRevoke{Granter: mockGranter, Grantee: mockGrantee, MsgTypeUrl: typeURL} - msgRevokeByte := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgRevoke))) - err = authzcodec.ModuleCdc.UnmarshalJSON(msgRevokeByte, &mockMsgRevoke) + _, err = cdctypes.NewAnyWithValue(&msgRevoke) require.NoError(t, err) // Authz: Exec Msg msgAny, err := cdctypes.NewAnyWithValue(msg) require.NoError(t, err) msgExec := authz.MsgExec{Grantee: mockGrantee, Msgs: []*cdctypes.Any{msgAny}} - execMsgByte := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgExec))) - err = authzcodec.ModuleCdc.UnmarshalJSON(execMsgByte, &mockMsgExec) + _, err = cdctypes.NewAnyWithValue(&msgExec) require.NoError(t, err) require.Equal(t, msgExec.Msgs[0].Value, mockMsgExec.Msgs[0].Value) } diff --git a/app/upgrades/mainnet/v11/failed_rewards.go b/app/upgrades/mainnet/v11/failed_rewards.go index f44c0ef7d..3a8da2418 100644 --- a/app/upgrades/mainnet/v11/failed_rewards.go +++ b/app/upgrades/mainnet/v11/failed_rewards.go @@ -1,6 +1,7 @@ package v11 import ( + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" @@ -124907,7 +124908,7 @@ func DistributeRewards( panic(err) } - totalDistributionAmount := sdk.ZeroInt() + totalDistributionAmount := sdkmath.ZeroInt() for _, item := range rewards { totalDistributionAmount = totalDistributionAmount.Add(item.Reward.Amount) @@ -124938,7 +124939,7 @@ func DistributeRewards( fmt.Println(warning) continue } - epochAmount := gauge.DepositAmount.Amount.Quo(sdk.NewInt(int64(gauge.TotalTriggers))) + epochAmount := gauge.DepositAmount.Amount.Quo(sdkmath.NewInt(int64(gauge.TotalTriggers))) gauge.DistributedAmount.Amount = gauge.DistributedAmount.Amount.Add(epochAmount) rewardsKeeper.SetGauge(ctx, gauge) } diff --git a/app/upgrades/mainnet/v11/upgrades.go b/app/upgrades/mainnet/v11/upgrades.go index 9f20da82d..27270b762 100644 --- a/app/upgrades/mainnet/v11/upgrades.go +++ b/app/upgrades/mainnet/v11/upgrades.go @@ -1,6 +1,9 @@ package v11 import ( + "context" + sdkmath "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auction/types" @@ -20,11 +23,11 @@ import ( distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - // icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + + // icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" ) // An error occurred during the creation of the CMST/STJUNO pair, as it was mistakenly created in the Harbor app (ID-2) instead of the cSwap app (ID-1). @@ -58,7 +61,7 @@ func RefundFeeForAccidentallyCreatedPirToOwner( panic(err.Error()) } - refundAmount := sdk.NewCoin("ucmdx", sdk.NewInt(2000000000)) + refundAmount := sdk.NewCoin("ucmdx", sdkmath.NewInt(2000000000)) feeCollectorAddress := sdk.MustAccAddressFromBech32(liquidityParams.FeeCollectorAddress) feeCollectorCmdxBalance := bankKeeper.GetBalance(ctx, feeCollectorAddress, "ucmdx") @@ -89,7 +92,7 @@ func CreateUpgradeHandlerV11( rewardsKeeper rewardskeeper.Keeper, icahostkeeper icahostkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying main net upgrade - v.11.5.0") // fromVM[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion() diff --git a/app/upgrades/mainnet/v12/upgrades.go b/app/upgrades/mainnet/v12/upgrades.go index 91a06b3bf..572a87709 100644 --- a/app/upgrades/mainnet/v12/upgrades.go +++ b/app/upgrades/mainnet/v12/upgrades.go @@ -1,7 +1,11 @@ package v12 import ( + "context" + sdkmath "cosmossdk.io/math" "fmt" + + upgradetypes "cosmossdk.io/x/upgrade/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" auctionkeeperold "github.com/comdex-official/comdex/x/auction/keeper" @@ -16,9 +20,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v7/keeper" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" + icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper" + icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" ) // An error occurred during the creation of the CMST/STJUNO pair, as it was mistakenly created in the Harbor app (ID-2) instead of the cSwap app (ID-1). @@ -40,7 +43,7 @@ func CreateUpgradeHandlerV12( liquidationKeeperOld liquidationkeeperold.Keeper, assetKeeper assetkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying main net upgrade - v.12.0.0") icqparams := icqtypes.DefaultParams() @@ -59,8 +62,8 @@ func CreateUpgradeHandlerV12( } } -func dec(num string) sdk.Dec { - decVal, _ := sdk.NewDecFromStr(num) +func dec(num string) sdkmath.LegacyDec { + decVal, _ := sdkmath.LegacyNewDecFromStr(num) return decVal } @@ -73,7 +76,7 @@ func UpdateLendParams( cSTATOM := assettypes.Asset{ Name: "CSTATOM", Denom: "ucstatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true, @@ -114,7 +117,7 @@ func UpdateLendParams( cAXLUSDC := assettypes.Asset{ Name: "CAXLUSDC", Denom: "ucaxlusdc", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true, @@ -133,9 +136,9 @@ func InitializeStates( dutchAuctionParams := liquidationtypes.DutchAuctionParam{ Premium: newDec("1.15"), Discount: newDec("0.7"), - DecrementFactor: sdk.NewInt(1), + DecrementFactor: sdkmath.NewInt(1), } - englishAuctionParams := liquidationtypes.EnglishAuctionParam{DecrementFactor: sdk.NewInt(1)} + englishAuctionParams := liquidationtypes.EnglishAuctionParam{DecrementFactor: sdkmath.NewInt(1)} harborParams := liquidationtypes.LiquidationWhiteListing{ AppId: 2, @@ -144,7 +147,7 @@ func InitializeStates( DutchAuctionParam: &dutchAuctionParams, IsEnglishActivated: true, EnglishAuctionParam: &englishAuctionParams, - KeeeperIncentive: sdk.ZeroDec(), + KeeeperIncentive: sdkmath.LegacyZeroDec(), } commodoParams := liquidationtypes.LiquidationWhiteListing{ @@ -154,7 +157,7 @@ func InitializeStates( DutchAuctionParam: &dutchAuctionParams, IsEnglishActivated: false, EnglishAuctionParam: nil, - KeeeperIncentive: sdk.ZeroDec(), + KeeeperIncentive: sdkmath.LegacyZeroDec(), } liquidationKeeper.SetLiquidationWhiteListing(ctx, harborParams) @@ -191,7 +194,7 @@ func InitializeStates( } -func newDec(i string) sdk.Dec { - dec, _ := sdk.NewDecFromStr(i) +func newDec(i string) sdkmath.LegacyDec { + dec, _ := sdkmath.LegacyNewDecFromStr(i) return dec } diff --git a/app/upgrades/mainnet/v13/upgrades.go b/app/upgrades/mainnet/v13/upgrades.go index f21738eed..371a756e9 100644 --- a/app/upgrades/mainnet/v13/upgrades.go +++ b/app/upgrades/mainnet/v13/upgrades.go @@ -1,7 +1,11 @@ package v13 import ( + "context" + sdkmath "cosmossdk.io/math" "fmt" + + upgradetypes "cosmossdk.io/x/upgrade/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" auctionV2keeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" @@ -18,12 +22,11 @@ import ( govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v7/keeper" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" - exported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations" + icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper" + icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" + exported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctmmigrations "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/migrations" ) func CreateUpgradeHandlerV13( @@ -40,7 +43,7 @@ func CreateUpgradeHandlerV13( liquidationV2Keeper liquidationV2keeper.Keeper, auctionV2Keeper auctionV2keeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying main net upgrade - v.13.3.0") logger := ctx.Logger().With("upgrade", UpgradeName) @@ -87,7 +90,7 @@ func CreateUpgradeHandlerV13( // update gov params to use a 20% initial deposit ratio, allowing us to remote the ante handler govParams := GovKeeper.GetParams(ctx) - govParams.MinInitialDepositRatio = sdk.NewDec(20).Quo(sdk.NewDec(100)).String() + govParams.MinInitialDepositRatio = sdkmath.LegacyNewDec(20).Quo(sdkmath.LegacyNewDec(100)).String() if err := GovKeeper.SetParams(ctx, govParams); err != nil { return nil, err } @@ -109,7 +112,7 @@ func UpdateLendParams( cSTATOM := assettypes.Asset{ Name: "CSTATOM", Denom: "ucstatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true, @@ -150,7 +153,7 @@ func UpdateLendParams( cAXLUSDC := assettypes.Asset{ Name: "CAXLUSDC", Denom: "ucaxlusdc", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true, @@ -169,9 +172,9 @@ func InitializeStates( dutchAuctionParams := liquidationV2types.DutchAuctionParam{ Premium: newDec("1.15"), Discount: newDec("0.7"), - DecrementFactor: sdk.NewInt(1), + DecrementFactor: sdkmath.NewInt(1), } - englishAuctionParams := liquidationV2types.EnglishAuctionParam{DecrementFactor: sdk.NewInt(1)} + englishAuctionParams := liquidationV2types.EnglishAuctionParam{DecrementFactor: sdkmath.NewInt(1)} harborParams := liquidationV2types.LiquidationWhiteListing{ AppId: 2, @@ -180,7 +183,7 @@ func InitializeStates( DutchAuctionParam: &dutchAuctionParams, IsEnglishActivated: true, EnglishAuctionParam: &englishAuctionParams, - KeeeperIncentive: sdk.ZeroDec(), + KeeeperIncentive: sdkmath.LegacyZeroDec(), } commodoParams := liquidationV2types.LiquidationWhiteListing{ @@ -190,7 +193,7 @@ func InitializeStates( DutchAuctionParam: &dutchAuctionParams, IsEnglishActivated: false, EnglishAuctionParam: nil, - KeeeperIncentive: sdk.ZeroDec(), + KeeeperIncentive: sdkmath.LegacyZeroDec(), } liquidationKeeper.SetLiquidationWhiteListing(ctx, harborParams) @@ -227,7 +230,7 @@ func InitializeStates( } -func newDec(i string) sdk.Dec { - dec, _ := sdk.NewDecFromStr(i) +func newDec(i string) sdkmath.LegacyDec { + dec, _ := sdkmath.LegacyNewDecFromStr(i) return dec } diff --git a/app/upgrades/mainnet/v5/upgrades.go b/app/upgrades/mainnet/v5/upgrades.go index e0028d2ee..13420711c 100644 --- a/app/upgrades/mainnet/v5/upgrades.go +++ b/app/upgrades/mainnet/v5/upgrades.go @@ -1,6 +1,9 @@ package v5 import ( + "context" + sdkmath "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/comdex-official/comdex/app/wasm/bindings" @@ -21,12 +24,11 @@ import ( distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" ) func InitializeStates( @@ -41,7 +43,7 @@ func InitializeStates( ) { genesisToken := assettypes.MintGenesisToken{ AssetId: 9, - GenesisSupply: sdk.NewIntFromUint64(500000000000000), + GenesisSupply: sdkmath.NewIntFromUint64(500000000000000), IsGovToken: true, Recipient: "comdex1tadhnvwa0sqzwr3m60f7dsjw4ua77qsz3ptcyw", } @@ -49,8 +51,8 @@ func InitializeStates( gToken = append(gToken, genesisToken) apps := []assettypes.AppData{ - {Name: "cswap", ShortName: "cswap", MinGovDeposit: sdk.ZeroInt(), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}}, - {Name: "harbor", ShortName: "hbr", MinGovDeposit: sdk.NewInt(10000000000), GovTimeInSeconds: 259200, GenesisToken: gToken}, + {Name: "cswap", ShortName: "cswap", MinGovDeposit: sdkmath.ZeroInt(), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}}, + {Name: "harbor", ShortName: "hbr", MinGovDeposit: sdkmath.NewInt(10000000000), GovTimeInSeconds: 259200, GenesisToken: gToken}, } for _, app := range apps { err := assetKeeper.AddAppRecords(ctx, app) @@ -61,16 +63,16 @@ func InitializeStates( assetKeeper.SetGenesisTokenForApp(ctx, 2, 9) assets := []assettypes.Asset{ - {Name: "ATOM", Denom: "ibc/961FA3E54F5DCCA639F37A7C45F7BBE41815579EF1513B5AFBEFCFEB8F256352", Decimals: sdk.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false}, - {Name: "CMDX", Denom: "ucmdx", Decimals: sdk.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false}, - {Name: "CMST", Denom: "ucmst", Decimals: sdk.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: true}, - {Name: "OSMO", Denom: "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B", Decimals: sdk.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false}, - {Name: "CATOM", Denom: "ucatom", Decimals: sdk.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true}, - {Name: "CCMDX", Denom: "uccmdx", Decimals: sdk.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true}, - {Name: "CCMST", Denom: "uccmst", Decimals: sdk.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true}, - {Name: "COSMO", Denom: "ucosmo", Decimals: sdk.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true}, - {Name: "HARBOR", Denom: "uharbor", Decimals: sdk.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: false}, - {Name: "AXLUSDC", Denom: "ibc/E1616E7C19EA474C565737709A628D6F8A23FF9D3E9A7A6871306CF5E0A5341E", Decimals: sdk.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false}, + {Name: "ATOM", Denom: "ibc/961FA3E54F5DCCA639F37A7C45F7BBE41815579EF1513B5AFBEFCFEB8F256352", Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false}, + {Name: "CMDX", Denom: "ucmdx", Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false}, + {Name: "CMST", Denom: "ucmst", Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: true}, + {Name: "OSMO", Denom: "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B", Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false}, + {Name: "CATOM", Denom: "ucatom", Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true}, + {Name: "CCMDX", Denom: "uccmdx", Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true}, + {Name: "CCMST", Denom: "uccmst", Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true}, + {Name: "COSMO", Denom: "ucosmo", Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true}, + {Name: "HARBOR", Denom: "uharbor", Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: false}, + {Name: "AXLUSDC", Denom: "ibc/E1616E7C19EA474C565737709A628D6F8A23FF9D3E9A7A6871306CF5E0A5341E", Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false}, } for _, asset := range assets { @@ -97,8 +99,8 @@ func InitializeStates( // add extended pairs extPairs := []*bindings.MsgAddExtendedPairsVault{ { - AppID: 2, PairID: 4, StabilityFee: sdk.ZeroDec(), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.ZeroDec(), - DrawDownFee: sdk.MustNewDecFromStr("0.001"), IsVaultActive: true, DebtCeiling: sdk.NewInt(40000000000000), DebtFloor: sdk.NewInt(1000000), IsStableMintVault: true, MinCr: sdk.MustNewDecFromStr("1"), + AppID: 2, PairID: 4, StabilityFee: sdkmath.LegacyZeroDec(), ClosingFee: sdkmath.LegacyZeroDec(), LiquidationPenalty: sdkmath.LegacyZeroDec(), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.001"), IsVaultActive: true, DebtCeiling: sdkmath.NewInt(40000000000000), DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: true, MinCr: sdkmath.LegacyMustNewDecFromStr("1"), PairName: "AXL-USDC-CMST", AssetOutOraclePrice: false, AssetOutPrice: 1000000, MinUsdValueLeft: 10000000000, }, } @@ -114,12 +116,12 @@ func InitializeStates( AppID: 2, CollectorAssetID: 3, SecondaryAssetID: 9, - SurplusThreshold: sdk.NewInt(50000000000), - DebtThreshold: sdk.NewInt(0), - LockerSavingRate: sdk.MustNewDecFromStr("0.00"), - LotSize: sdk.NewInt(10000000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(1000000000000), + SurplusThreshold: sdkmath.NewInt(50000000000), + DebtThreshold: sdkmath.NewInt(0), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.00"), + LotSize: sdkmath.NewInt(10000000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(1000000000000), } err := collectorKeeper.WasmSetCollectorLookupTable(ctx, &collector) @@ -133,8 +135,8 @@ func InitializeStates( AppID: 2, AuctionDurationSeconds: 21600, BidDurationSeconds: 3600, - Buffer: sdk.MustNewDecFromStr("1.2"), - Cusp: sdk.MustNewDecFromStr("0.75"), + Buffer: sdkmath.LegacyMustNewDecFromStr("1.2"), + Cusp: sdkmath.LegacyMustNewDecFromStr("0.75"), DebtID: 2, DutchID: 3, PriceFunctionType: 1, @@ -232,7 +234,7 @@ func CreateUpgradeHandler( rewardsKeeper rewardskeeper.Keeper, liquidationKeeper liquidationkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // Refs: // - https://docs.cosmos.network/master/building-modules/upgrade.html#registering-migrations // - https://docs.cosmos.network/master/migrations/chain-upgrade-guide-044.html#chain-upgrade diff --git a/app/upgrades/mainnet/v6/upgrades.go b/app/upgrades/mainnet/v6/upgrades.go index 99c1612cb..79a72b10d 100644 --- a/app/upgrades/mainnet/v6/upgrades.go +++ b/app/upgrades/mainnet/v6/upgrades.go @@ -1,17 +1,19 @@ package v6 import ( + "context" + sdkmath "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" "github.com/comdex-official/comdex/x/lend/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -func Dec(s string) sdk.Dec { - dec, err := sdk.NewDecFromStr(s) +func Dec(s string) sdkmath.LegacyDec { + dec, err := sdkmath.LegacyNewDecFromStr(s) if err != nil { panic(err) } @@ -30,7 +32,7 @@ func InitializeLendStates( // Add Lend Asset Pair // Adding Commodo App - app := assettypes.AppData{Name: "commodo", ShortName: "cmdo", MinGovDeposit: sdk.ZeroInt(), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}} + app := assettypes.AppData{Name: "commodo", ShortName: "cmdo", MinGovDeposit: sdkmath.ZeroInt(), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}} err := assetKeeper.AddAppRecords(ctx, app) if err != nil { panic(err) @@ -100,17 +102,17 @@ func InitializeLendStates( assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: 1, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: 2, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: 3, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataCMDXPool = append(assetDataCMDXPool, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -217,7 +219,7 @@ func InitializeLendStates( AuctionDurationSeconds: 21600, Buffer: Dec("1.2"), Cusp: Dec("0.7"), - Step: sdk.NewInt(360), + Step: sdkmath.NewInt(360), PriceFunctionType: 1, DutchId: 3, BidDurationSeconds: 3600, @@ -235,7 +237,7 @@ func CreateUpgradeHandler( assetKeeper assetkeeper.Keeper, lendKeeper lendkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Running revert of tombstoning") ctx.Logger().Info("Running module migrations for v6.0.0...") diff --git a/app/upgrades/mainnet/v7/upgrades.go b/app/upgrades/mainnet/v7/upgrades.go index 22e361ce4..cd9192673 100644 --- a/app/upgrades/mainnet/v7/upgrades.go +++ b/app/upgrades/mainnet/v7/upgrades.go @@ -1,15 +1,17 @@ package v7 import ( + "context" + sdkmath "cosmossdk.io/math" "fmt" + upgradetypes "cosmossdk.io/x/upgrade/types" auctiontypes "github.com/comdex-official/comdex/x/auction/types" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" "github.com/comdex-official/comdex/x/lend/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func ReturnAtomToVaultOwners(ctx sdk.Context, @@ -48,7 +50,7 @@ func ReturnAtomToVaultOwners(ctx sdk.Context, }, } for i := 0; i < 5; i++ { - atomCoins := sdk.NewCoin("ibc/961FA3E54F5DCCA639F37A7C45F7BBE41815579EF1513B5AFBEFCFEB8F256352", sdk.NewInt(auctionData[i].amount)) + atomCoins := sdk.NewCoin("ibc/961FA3E54F5DCCA639F37A7C45F7BBE41815579EF1513B5AFBEFCFEB8F256352", sdkmath.NewInt(auctionData[i].amount)) addr1, err := sdk.AccAddressFromBech32(auctionData[i].address) if err != nil { fmt.Println("error in address", auctionData[i].address, err) @@ -73,45 +75,45 @@ func InitializeLendReservesStates( ) { dataAsset1, found := lendKeeper.GetReserveBuybackAssetData(ctx, 1) if !found { - dataAsset1.BuybackAmount = sdk.NewInt(0) - dataAsset1.ReserveAmount = sdk.NewInt(0) + dataAsset1.BuybackAmount = sdkmath.NewInt(0) + dataAsset1.ReserveAmount = sdkmath.NewInt(0) } dataAsset2, found := lendKeeper.GetReserveBuybackAssetData(ctx, 2) if !found { - dataAsset2.BuybackAmount = sdk.NewInt(0) - dataAsset2.ReserveAmount = sdk.NewInt(0) + dataAsset2.BuybackAmount = sdkmath.NewInt(0) + dataAsset2.ReserveAmount = sdkmath.NewInt(0) } dataAsset3, found := lendKeeper.GetReserveBuybackAssetData(ctx, 3) if !found { - dataAsset3.BuybackAmount = sdk.NewInt(0) - dataAsset3.ReserveAmount = sdk.NewInt(0) + dataAsset3.BuybackAmount = sdkmath.NewInt(0) + dataAsset3.ReserveAmount = sdkmath.NewInt(0) } reserveStat1 := types.AllReserveStats{ AssetID: 1, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), AmountInFromRepayments: dataAsset1.BuybackAmount.Add(dataAsset1.ReserveAmount), - TotalAmountOutToLenders: sdk.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } reserveStat2 := types.AllReserveStats{ AssetID: 2, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), AmountInFromRepayments: dataAsset2.BuybackAmount.Add(dataAsset2.ReserveAmount), - TotalAmountOutToLenders: sdk.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } reserveStat3 := types.AllReserveStats{ AssetID: 3, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), AmountInFromRepayments: dataAsset3.BuybackAmount.Add(dataAsset3.ReserveAmount), - TotalAmountOutToLenders: sdk.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } lendKeeper.SetAllReserveStatsByAssetID(ctx, reserveStat1) lendKeeper.SetAllReserveStatsByAssetID(ctx, reserveStat2) @@ -133,7 +135,7 @@ func CreateUpgradeHandler700( lendKeeper lendkeeper.Keeper, bankKeeper bankkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { newVM, err := mm.RunMigrations(ctx, configurator, fromVM) InitializeLendReservesStates(ctx, lendKeeper) ReturnAtomToVaultOwners(ctx, bankKeeper) diff --git a/app/upgrades/mainnet/v8/upgrades.go b/app/upgrades/mainnet/v8/upgrades.go index 182ce462b..0859bd915 100644 --- a/app/upgrades/mainnet/v8/upgrades.go +++ b/app/upgrades/mainnet/v8/upgrades.go @@ -1,8 +1,11 @@ package v8 import ( + "context" + sdkmath "cosmossdk.io/math" "fmt" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/comdex-official/comdex/app/wasm/bindings" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -11,39 +14,38 @@ import ( "github.com/comdex-official/comdex/x/lend/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func UpdateExtendedPairVaultsAndAsset(ctx sdk.Context, assetKeeper assetkeeper.Keeper) { extPairs := []*bindings.MsgUpdatePairsVault{ { - AppID: 2, ExtPairID: 2, StabilityFee: sdk.MustNewDecFromStr("1"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), - DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(250000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("1.4"), + AppID: 2, ExtPairID: 2, StabilityFee: sdkmath.LegacyMustNewDecFromStr("1"), ClosingFee: sdkmath.LegacyZeroDec(), LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.15"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdkmath.NewInt(250000000000), DebtFloor: sdkmath.NewInt(50000000), MinCr: sdkmath.LegacyMustNewDecFromStr("1.4"), MinUsdValueLeft: 100000, }, { - AppID: 2, ExtPairID: 3, StabilityFee: sdk.MustNewDecFromStr("0.5"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), - DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(350000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("1.7"), + AppID: 2, ExtPairID: 3, StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.5"), ClosingFee: sdkmath.LegacyZeroDec(), LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.15"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdkmath.NewInt(350000000000), DebtFloor: sdkmath.NewInt(50000000), MinCr: sdkmath.LegacyMustNewDecFromStr("1.7"), MinUsdValueLeft: 100000, }, { - AppID: 2, ExtPairID: 4, StabilityFee: sdk.MustNewDecFromStr("0.25"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), - DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(400000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("2"), + AppID: 2, ExtPairID: 4, StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.25"), ClosingFee: sdkmath.LegacyZeroDec(), LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.15"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdkmath.NewInt(400000000000), DebtFloor: sdkmath.NewInt(50000000), MinCr: sdkmath.LegacyMustNewDecFromStr("2"), MinUsdValueLeft: 100000, }, { - AppID: 2, ExtPairID: 5, StabilityFee: sdk.MustNewDecFromStr("1"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), - DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(250000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("1.5"), + AppID: 2, ExtPairID: 5, StabilityFee: sdkmath.LegacyMustNewDecFromStr("1"), ClosingFee: sdkmath.LegacyZeroDec(), LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.15"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdkmath.NewInt(250000000000), DebtFloor: sdkmath.NewInt(50000000), MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), MinUsdValueLeft: 100000, }, { - AppID: 2, ExtPairID: 6, StabilityFee: sdk.MustNewDecFromStr("0.5"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), - DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(350000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("1.8"), + AppID: 2, ExtPairID: 6, StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.5"), ClosingFee: sdkmath.LegacyZeroDec(), LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.15"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdkmath.NewInt(350000000000), DebtFloor: sdkmath.NewInt(50000000), MinCr: sdkmath.LegacyMustNewDecFromStr("1.8"), MinUsdValueLeft: 100000, }, { - AppID: 2, ExtPairID: 7, StabilityFee: sdk.MustNewDecFromStr("0.25"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), - DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(400000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("2.1"), + AppID: 2, ExtPairID: 7, StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.25"), ClosingFee: sdkmath.LegacyZeroDec(), LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.15"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdkmath.NewInt(400000000000), DebtFloor: sdkmath.NewInt(50000000), MinCr: sdkmath.LegacyMustNewDecFromStr("2.1"), MinUsdValueLeft: 100000, }, } @@ -60,8 +62,8 @@ func UpdateExtendedPairVaultsAndAsset(ctx sdk.Context, assetKeeper assetkeeper.K } } -func Dec(s string) sdk.Dec { - dec, err := sdk.NewDecFromStr(s) +func Dec(s string) sdkmath.LegacyDec { + dec, err := sdkmath.LegacyNewDecFromStr(s) if err != nil { panic(err) } @@ -82,7 +84,7 @@ func UpdateAuctionParams( cUSDC := assettypes.Asset{ Name: "CAXLUSDC", Denom: "ucaxlusdc", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true, @@ -95,7 +97,7 @@ func UpdateAuctionParams( cstATOM := assettypes.Asset{ Name: "CSTATOM", Denom: "ucstatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true, @@ -166,7 +168,7 @@ func UpdateAuctionParams( AuctionDurationSeconds: 18000, Buffer: Dec("1.15"), Cusp: Dec("0.7"), - Step: sdk.NewInt(360), + Step: sdkmath.NewInt(360), PriceFunctionType: 1, DutchId: 3, BidDurationSeconds: 3600, @@ -198,7 +200,7 @@ func CreateUpgradeHandler810( mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { newVM, err := mm.RunMigrations(ctx, configurator, fromVM) return newVM, err } @@ -211,7 +213,7 @@ func CreateUpgradeHandler811( lendKeeper lendkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { newVM, err := mm.RunMigrations(ctx, configurator, fromVM) UpdateAuctionParams(ctx, assetKeeper, lendKeeper, auctionKeeper) UpdateExtendedPairVaultsAndAsset(ctx, assetKeeper) diff --git a/app/upgrades/mainnet/v9/upgrades.go b/app/upgrades/mainnet/v9/upgrades.go index 1ea368867..531c1cf99 100644 --- a/app/upgrades/mainnet/v9/upgrades.go +++ b/app/upgrades/mainnet/v9/upgrades.go @@ -1,11 +1,13 @@ package v9 import ( + "context" + sdkmath "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func UpdateDenomAndAddAsset(ctx sdk.Context, assetKeeper assetkeeper.Keeper) { @@ -15,7 +17,7 @@ func UpdateDenomAndAddAsset(ctx sdk.Context, assetKeeper assetkeeper.Keeper) { assetKeeper.SetAsset(ctx, asset) } - assetGDAI := assettypes.Asset{Name: "GDAI", Denom: "ibc/109DD45CF4093BEB472784A0C5B5F4643140900020B74B102B842A4BE2AE45DA", Decimals: sdk.NewInt(1000000000000000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false} + assetGDAI := assettypes.Asset{Name: "GDAI", Denom: "ibc/109DD45CF4093BEB472784A0C5B5F4643140900020B74B102B842A4BE2AE45DA", Decimals: sdkmath.NewInt(1000000000000000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false} err := assetKeeper.AddAssetRecords(ctx, assetGDAI) if err != nil { @@ -60,7 +62,7 @@ func CreateUpgradeHandlerV900( configurator module.Configurator, assetKeeper assetkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { vm, err := mm.RunMigrations(ctx, configurator, fromVM) if err != nil { return nil, err diff --git a/app/upgrades/testnet/v10/upgrades.go b/app/upgrades/testnet/v10/upgrades.go index 6a2db6e3f..c92a258bf 100644 --- a/app/upgrades/testnet/v10/upgrades.go +++ b/app/upgrades/testnet/v10/upgrades.go @@ -1,16 +1,16 @@ package v10 import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func CreateUpgradeHandlerV10( mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { vm, err := mm.RunMigrations(ctx, configurator, fromVM) if err != nil { return vm, err diff --git a/app/upgrades/testnet/v11/upgrades.go b/app/upgrades/testnet/v11/upgrades.go index 66823e134..ca600c812 100644 --- a/app/upgrades/testnet/v11/upgrades.go +++ b/app/upgrades/testnet/v11/upgrades.go @@ -1,16 +1,16 @@ package v11 import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func CreateUpgradeHandlerV11( mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying test net upgrade - v.11.0.0") return mm.RunMigrations(ctx, configurator, fromVM) } diff --git a/app/upgrades/testnet/v11_4/upgrades.go b/app/upgrades/testnet/v11_4/upgrades.go index fbd832328..7ec2e12dc 100644 --- a/app/upgrades/testnet/v11_4/upgrades.go +++ b/app/upgrades/testnet/v11_4/upgrades.go @@ -1,11 +1,11 @@ package v11_4 //nolint:revive,stylecheck import ( + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func CreateUpgradeHandlerV114( @@ -13,7 +13,7 @@ func CreateUpgradeHandlerV114( configurator module.Configurator, assetKeeper assetkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { assetKeeper.SetParams(ctx, assettypes.NewParams()) ctx.Logger().Info("Applying test net upgrade - v.11.4.0") diff --git a/app/upgrades/testnet/v13/upgrades.go b/app/upgrades/testnet/v13/upgrades.go index a76cd8fed..8e29b73a4 100644 --- a/app/upgrades/testnet/v13/upgrades.go +++ b/app/upgrades/testnet/v13/upgrades.go @@ -1,15 +1,19 @@ package v13 import ( + "context" "fmt" + + sdkmath "cosmossdk.io/math" + + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + bandoraclemodulekeeper "github.com/comdex-official/comdex/x/bandoracle/keeper" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" @@ -17,11 +21,10 @@ import ( paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - exported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations" - bandoraclemodulekeeper "github.com/comdex-official/comdex/x/bandoracle/keeper" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + exported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctmmigrations "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/migrations" ) func CreateUpgradeHandlerV13( @@ -40,7 +43,7 @@ func CreateUpgradeHandlerV13( SlashingKeeper slashingkeeper.Keeper, bandoracleKeeper bandoraclemodulekeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying test net upgrade - v.13.1.0") logger := ctx.Logger().With("upgrade", UpgradeName) @@ -84,7 +87,7 @@ func CreateUpgradeHandlerV13( //TODO: confirm the initial deposit // update gov params to use a 20% initial deposit ratio, allowing us to remote the ante handler govParams := GovKeeper.GetParams(ctx) - govParams.MinInitialDepositRatio = sdk.NewDec(20).Quo(sdk.NewDec(100)).String() + govParams.MinInitialDepositRatio = sdkmath.LegacyNewDec(20).Quo(sdkmath.LegacyNewDec(100)).String() if err := GovKeeper.SetParams(ctx, govParams); err != nil { return nil, err } diff --git a/app/upgrades/testnet/v14/upgrades.go b/app/upgrades/testnet/v14/upgrades.go index 3ccf91440..93320367a 100644 --- a/app/upgrades/testnet/v14/upgrades.go +++ b/app/upgrades/testnet/v14/upgrades.go @@ -1,11 +1,11 @@ package v14 import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" commonkeeper "github.com/comdex-official/comdex/x/common/keeper" commontypes "github.com/comdex-official/comdex/x/common/types" + "github.com/cosmos/cosmos-sdk/types/module" ) func CreateUpgradeHandlerV14( @@ -13,7 +13,7 @@ func CreateUpgradeHandlerV14( configurator module.Configurator, commonkeeper commonkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying test net upgrade - v14.0.0") logger := ctx.Logger().With("upgrade", UpgradeName) @@ -24,7 +24,7 @@ func CreateUpgradeHandlerV14( } logger.Info("set common module params") commonkeeper.SetParams(ctx, commontypes.DefaultParams()) - + return vm, err } } diff --git a/app/upgrades/testnet/v1_0_0/upgrades.go b/app/upgrades/testnet/v1_0_0/upgrades.go index ce9202cb9..a3a35dad4 100644 --- a/app/upgrades/testnet/v1_0_0/upgrades.go +++ b/app/upgrades/testnet/v1_0_0/upgrades.go @@ -1,10 +1,10 @@ package v1_0_0 //nolint:revive,stylecheck import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "context" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + upgradetypes "cosmossdk.io/x/upgrade/types" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -16,7 +16,7 @@ func CreateUpgradeHandler( configurator module.Configurator, wasmKeeper wasmkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // Refs: // - https://docs.cosmos.network/master/building-modules/upgrade.html#registering-migrations // - https://docs.cosmos.network/master/migrations/chain-upgrade-guide-044.html#chain-upgrade diff --git a/app/upgrades/testnet/v2_0_0/upgrades.go b/app/upgrades/testnet/v2_0_0/upgrades.go index 1b63a71cd..bfec2b8b6 100644 --- a/app/upgrades/testnet/v2_0_0/upgrades.go +++ b/app/upgrades/testnet/v2_0_0/upgrades.go @@ -1,6 +1,8 @@ package v2_0_0 //nolint:revive,stylecheck import ( + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/authz" @@ -8,11 +10,10 @@ import ( distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" ) // CreateUpgradeHandler creates an SDK upgrade handler for v2_0_0 @@ -20,7 +21,7 @@ func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { newVM, err := mm.RunMigrations(ctx, configurator, fromVM) if err != nil { return newVM, err @@ -33,7 +34,7 @@ func CreateUpgradeHandlerV2( mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // Refs: // - https://docs.cosmos.network/master/building-modules/upgrade.html#registering-migrations // - https://docs.cosmos.network/master/migrations/chain-upgrade-guide-044.html#chain-upgrade diff --git a/app/upgrades/testnet/v3_0_0/upgrades.go b/app/upgrades/testnet/v3_0_0/upgrades.go index 64eadea0c..b5bfaf9af 100644 --- a/app/upgrades/testnet/v3_0_0/upgrades.go +++ b/app/upgrades/testnet/v3_0_0/upgrades.go @@ -1,9 +1,9 @@ package v3_0_0 //nolint:revive,stylecheck import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) // CreateUpgradeHandler creates an SDK upgrade handler for v3_0_0 @@ -11,7 +11,7 @@ func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { newVM, err := mm.RunMigrations(ctx, configurator, fromVM) if err != nil { return newVM, err diff --git a/app/upgrades/testnet/v4_0_0/upgrades.go b/app/upgrades/testnet/v4_0_0/upgrades.go index 3d83355c6..4131d4c23 100644 --- a/app/upgrades/testnet/v4_0_0/upgrades.go +++ b/app/upgrades/testnet/v4_0_0/upgrades.go @@ -1,9 +1,11 @@ package v4_0_0 //nolint:revive,stylecheck import ( + "context" + sdkmath "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -18,7 +20,7 @@ func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // This change is only for testnet upgrade newVM, err := mm.RunMigrations(ctx, configurator, fromVM) @@ -44,7 +46,7 @@ func CreateSwapFeeGauge( ctx.BlockTime(), rewardstypes.LiquidityGaugeTypeID, liquiditytypes.DefaultSwapFeeDistributionDuration, - sdk.NewCoin(params.SwapFeeDistrDenom, sdk.NewInt(0)), + sdk.NewCoin(params.SwapFeeDistrDenom, sdkmath.NewInt(0)), 1, ) newGauge.Kind = &rewardstypes.MsgCreateGauge_LiquidityMetaData{ @@ -64,7 +66,7 @@ func CreateUpgradeHandlerV410( rewardskeeper rewardskeeper.Keeper, liquiditykeeper liquiditykeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // This change is only for testnet upgrade CreateSwapFeeGauge(ctx, rewardskeeper, liquiditykeeper, 1, 1) @@ -111,7 +113,7 @@ func CreateUpgradeHandlerV430( configurator module.Configurator, assetkeeper assetkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // This change is only for testnet upgrade EditAndSetPair(ctx, assetkeeper) diff --git a/app/upgrades/testnet/v5_0_0/off_load_data.go b/app/upgrades/testnet/v5_0_0/off_load_data.go index eabf61965..444fca6f8 100644 --- a/app/upgrades/testnet/v5_0_0/off_load_data.go +++ b/app/upgrades/testnet/v5_0_0/off_load_data.go @@ -1,6 +1,7 @@ package v5_0_0 //nolint:revive,stylecheck import ( + sdkmath "cosmossdk.io/math" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" "github.com/comdex-official/comdex/x/lend/types" liquidationkeeper "github.com/comdex-official/comdex/x/liquidation/keeper" @@ -27,7 +28,7 @@ func SetVaultLengthCounter( func FuncMigrateLiquidatedBorrow(ctx sdk.Context, k lendkeeper.Keeper, liqK liquidationkeeper.Keeper) error { liqBorrow := liqK.GetLockedVaultByApp(ctx, 3) for _, v := range liqBorrow { - if v.AmountIn.GT(sdk.ZeroInt()) && v.AmountOut.GT(sdk.ZeroInt()) { + if v.AmountIn.GT(sdkmath.ZeroInt()) && v.AmountOut.GT(sdkmath.ZeroInt()) { borrowMetaData := v.GetBorrowMetaData() pair, _ := k.GetLendPair(ctx, v.ExtendedPairId) assetIn, _ := k.Asset.GetAsset(ctx, pair.AssetIn) @@ -41,7 +42,7 @@ func FuncMigrateLiquidatedBorrow(ctx sdk.Context, k lendkeeper.Keeper, liqK liqu cpoolName = "OSMO-ATOM-CMST" } - globalIndex, _ := sdk.NewDecFromStr("0.002") + globalIndex, _ := sdkmath.LegacyNewDecFromStr("0.002") newBorrow := types.BorrowAsset{ ID: v.OriginalVaultId, @@ -53,9 +54,9 @@ func FuncMigrateLiquidatedBorrow(ctx sdk.Context, k lendkeeper.Keeper, liqK liqu BridgedAssetAmount: borrowMetaData.BridgedAssetAmount, BorrowingTime: ctx.BlockTime(), StableBorrowRate: borrowMetaData.StableBorrowRate, - InterestAccumulated: sdk.NewDecFromInt(v.InterestAccumulated), + InterestAccumulated: sdkmath.LegacyNewDecFromInt(v.InterestAccumulated), GlobalIndex: globalIndex, - ReserveGlobalIndex: sdk.OneDec(), + ReserveGlobalIndex: sdkmath.LegacyOneDec(), LastInteractionTime: ctx.BlockTime(), CPoolName: cpoolName, IsLiquidated: false, diff --git a/app/upgrades/testnet/v5_0_0/upgrades.go b/app/upgrades/testnet/v5_0_0/upgrades.go index 4608cd6ee..cf7423843 100644 --- a/app/upgrades/testnet/v5_0_0/upgrades.go +++ b/app/upgrades/testnet/v5_0_0/upgrades.go @@ -1,12 +1,12 @@ package v5_0_0 //nolint:revive,stylecheck import ( + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" liquidationkeeper "github.com/comdex-official/comdex/x/liquidation/keeper" vaultkeeper "github.com/comdex-official/comdex/x/vault/keeper" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func CreateUpgradeHandlerV5Beta( @@ -16,7 +16,7 @@ func CreateUpgradeHandlerV5Beta( liqk liquidationkeeper.Keeper, vaultkeeper vaultkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { vm, err := mm.RunMigrations(ctx, configurator, fromVM) if err != nil { return nil, err diff --git a/app/upgrades/testnet/v9_0_0/upgrades.go b/app/upgrades/testnet/v9_0_0/upgrades.go index c55bce4d4..1396ce549 100644 --- a/app/upgrades/testnet/v9_0_0/upgrades.go +++ b/app/upgrades/testnet/v9_0_0/upgrades.go @@ -1,11 +1,13 @@ package v9_0_0 //nolint:revive,stylecheck import ( + "context" + sdkmath "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func UpdateDenomAndAddAsset(ctx sdk.Context, assetKeeper assetkeeper.Keeper) { @@ -15,7 +17,7 @@ func UpdateDenomAndAddAsset(ctx sdk.Context, assetKeeper assetkeeper.Keeper) { assetKeeper.SetAsset(ctx, asset) } - assetGDAI := assettypes.Asset{Name: "GDAI", Denom: "ibc/109DD45CF4093BEB472784A0C5B5F4643140900020B74B102B842A4BE2AE45DA", Decimals: sdk.NewInt(1000000000000000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false} + assetGDAI := assettypes.Asset{Name: "GDAI", Denom: "ibc/109DD45CF4093BEB472784A0C5B5F4643140900020B74B102B842A4BE2AE45DA", Decimals: sdkmath.NewInt(1000000000000000000), IsOnChain: false, IsOraclePriceRequired: true, IsCdpMintable: false} err := assetKeeper.AddAssetRecords(ctx, assetGDAI) if err != nil { @@ -60,7 +62,7 @@ func CreateUpgradeHandlerV900Beta( configurator module.Configurator, assetKeeper assetkeeper.Keeper, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { vm, err := mm.RunMigrations(ctx, configurator, fromVM) if err != nil { return nil, err diff --git a/app/wasm/bindings/msg.go b/app/wasm/bindings/msg.go index 951fe44f7..6aa710ce5 100644 --- a/app/wasm/bindings/msg.go +++ b/app/wasm/bindings/msg.go @@ -1,6 +1,7 @@ package bindings import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -42,33 +43,33 @@ type MsgWhitelistAppIDLockerRewards struct { } type MsgAddExtendedPairsVault struct { - AppID uint64 `json:"app_id"` - PairID uint64 `json:"pair_id"` - StabilityFee sdk.Dec `json:"stability_fee"` - ClosingFee sdk.Dec `json:"closing_fee"` - LiquidationPenalty sdk.Dec `json:"liquidation_penalty"` - DrawDownFee sdk.Dec `json:"draw_down_fee"` - IsVaultActive bool `json:"is_vault_active"` - DebtCeiling sdk.Int `json:"debt_ceiling"` - DebtFloor sdk.Int `json:"debt_floor"` - IsStableMintVault bool `json:"is_stable_mint_vault"` - MinCr sdk.Dec `json:"min_cr"` - PairName string `json:"pair_name"` - AssetOutOraclePrice bool `json:"asset_out_oracle_price"` - AssetOutPrice uint64 `json:"asset_out_price"` - MinUsdValueLeft uint64 `json:"min_usd_value_left"` + AppID uint64 `json:"app_id"` + PairID uint64 `json:"pair_id"` + StabilityFee sdkmath.LegacyDec `json:"stability_fee"` + ClosingFee sdkmath.LegacyDec `json:"closing_fee"` + LiquidationPenalty sdkmath.LegacyDec `json:"liquidation_penalty"` + DrawDownFee sdkmath.LegacyDec `json:"draw_down_fee"` + IsVaultActive bool `json:"is_vault_active"` + DebtCeiling sdkmath.Int `json:"debt_ceiling"` + DebtFloor sdkmath.Int `json:"debt_floor"` + IsStableMintVault bool `json:"is_stable_mint_vault"` + MinCr sdkmath.LegacyDec `json:"min_cr"` + PairName string `json:"pair_name"` + AssetOutOraclePrice bool `json:"asset_out_oracle_price"` + AssetOutPrice uint64 `json:"asset_out_price"` + MinUsdValueLeft uint64 `json:"min_usd_value_left"` } type MsgSetCollectorLookupTable struct { - AppID uint64 `json:"app_id"` - CollectorAssetID uint64 `json:"collector_asset_id"` - SecondaryAssetID uint64 `json:"secondary_asset_id"` - SurplusThreshold sdk.Int `json:"surplus_threshold"` - DebtThreshold sdk.Int `json:"debt_threshold"` - LockerSavingRate sdk.Dec `json:"locker_saving_rate"` - LotSize sdk.Int `json:"lot_size"` - BidFactor sdk.Dec `json:"bid_factor"` - DebtLotSize sdk.Int `json:"debt_lot_size"` + AppID uint64 `json:"app_id"` + CollectorAssetID uint64 `json:"collector_asset_id"` + SecondaryAssetID uint64 `json:"secondary_asset_id"` + SurplusThreshold sdkmath.Int `json:"surplus_threshold"` + DebtThreshold sdkmath.Int `json:"debt_threshold"` + LockerSavingRate sdkmath.LegacyDec `json:"locker_saving_rate"` + LotSize sdkmath.Int `json:"lot_size"` + BidFactor sdkmath.LegacyDec `json:"bid_factor"` + DebtLotSize sdkmath.Int `json:"debt_lot_size"` } type MsgSetAuctionMappingForApp struct { @@ -82,28 +83,28 @@ type MsgSetAuctionMappingForApp struct { } type MsgUpdatePairsVault struct { - AppID uint64 `json:"app_id"` - ExtPairID uint64 `json:"ext_pair_id"` - StabilityFee sdk.Dec `json:"stability_fee"` - ClosingFee sdk.Dec `json:"closing_fee"` - LiquidationPenalty sdk.Dec `json:"liquidation_penalty"` - DrawDownFee sdk.Dec `json:"draw_down_fee"` - IsVaultActive bool `json:"is_vault_active"` - MinCr sdk.Dec `json:"min_cr"` - DebtCeiling sdk.Int `json:"debt_ceiling"` - DebtFloor sdk.Int `json:"debt_floor"` - MinUsdValueLeft uint64 `json:"min_usd_value_left"` + AppID uint64 `json:"app_id"` + ExtPairID uint64 `json:"ext_pair_id"` + StabilityFee sdkmath.LegacyDec `json:"stability_fee"` + ClosingFee sdkmath.LegacyDec `json:"closing_fee"` + LiquidationPenalty sdkmath.LegacyDec `json:"liquidation_penalty"` + DrawDownFee sdkmath.LegacyDec `json:"draw_down_fee"` + IsVaultActive bool `json:"is_vault_active"` + MinCr sdkmath.LegacyDec `json:"min_cr"` + DebtCeiling sdkmath.Int `json:"debt_ceiling"` + DebtFloor sdkmath.Int `json:"debt_floor"` + MinUsdValueLeft uint64 `json:"min_usd_value_left"` } type MsgUpdateCollectorLookupTable struct { - AppID uint64 `json:"app_id"` - AssetID uint64 `json:"asset_id"` - DebtThreshold sdk.Int `json:"debt_threshold"` - SurplusThreshold sdk.Int `json:"surplus_threshold"` - LotSize sdk.Int `json:"lot_size"` - DebtLotSize sdk.Int `json:"debt_lot_size"` - BidFactor sdk.Dec `json:"bid_factor"` - LSR sdk.Dec `json:"lsr"` + AppID uint64 `json:"app_id"` + AssetID uint64 `json:"asset_id"` + DebtThreshold sdkmath.Int `json:"debt_threshold"` + SurplusThreshold sdkmath.Int `json:"surplus_threshold"` + LotSize sdkmath.Int `json:"lot_size"` + DebtLotSize sdkmath.Int `json:"debt_lot_size"` + BidFactor sdkmath.LegacyDec `json:"bid_factor"` + LSR sdkmath.LegacyDec `json:"lsr"` } type MsgRemoveWhitelistAssetLocker struct { @@ -124,16 +125,16 @@ type MsgRemoveWhitelistAppIDLiquidation struct { } type MsgAddAuctionParams struct { - AppID uint64 `json:"app_id"` - AuctionDurationSeconds uint64 `json:"auction_duration_seconds"` - Buffer sdk.Dec `json:"buffer"` - Cusp sdk.Dec `json:"cusp"` - Step uint64 `json:"step"` - PriceFunctionType uint64 `json:"price_function_type"` - SurplusID uint64 `json:"surplus_id"` - DebtID uint64 `json:"debt_id"` - DutchID uint64 `json:"dutch_id"` - BidDurationSeconds uint64 `json:"bid_duration_seconds"` + AppID uint64 `json:"app_id"` + AuctionDurationSeconds uint64 `json:"auction_duration_seconds"` + Buffer sdkmath.LegacyDec `json:"buffer"` + Cusp sdkmath.LegacyDec `json:"cusp"` + Step uint64 `json:"step"` + PriceFunctionType uint64 `json:"price_function_type"` + SurplusID uint64 `json:"surplus_id"` + DebtID uint64 `json:"debt_id"` + DutchID uint64 `json:"dutch_id"` + BidDurationSeconds uint64 `json:"bid_duration_seconds"` } type MsgBurnGovTokensForApp struct { @@ -151,22 +152,22 @@ type MsgAddESMTriggerParams struct { } type MsgEmissionRewards struct { - AppID uint64 `json:"app_id"` - Amount sdk.Int `json:"amount"` - EmissionAmount uint64 `json:"emission_amount"` - ExtendedPair []uint64 `json:"extended_pair"` - VotingRatio []sdk.Int `json:"voting_ratio"` + AppID uint64 `json:"app_id"` + Amount sdkmath.Int `json:"amount"` + EmissionAmount uint64 `json:"emission_amount"` + ExtendedPair []uint64 `json:"extended_pair"` + VotingRatio []sdkmath.Int `json:"voting_ratio"` } type MsgFoundationEmission struct { - AppID uint64 `json:"app_id"` - Amount sdk.Int `json:"amount"` - FoundationAddress []string `json:"foundation_address"` + AppID uint64 `json:"app_id"` + Amount sdkmath.Int `json:"amount"` + FoundationAddress []string `json:"foundation_address"` } type MsgRebaseMint struct { AppID uint64 `json:"app_id"` - Amount sdk.Int `json:"amount"` + Amount sdkmath.Int `json:"amount"` ContractAddr sdk.AccAddress `json:"contract_addr"` } @@ -178,9 +179,9 @@ type MsgGetSurplusFund struct { } type MsgEmissionPoolRewards struct { - AppID uint64 `json:"app_id"` - CswapAppID uint64 `json:"cswap_app_id"` - Amount sdk.Int `json:"amount"` - Pools []uint64 `json:"pools"` - VotingRatio []sdk.Int `json:"voting_ratio"` + AppID uint64 `json:"app_id"` + CswapAppID uint64 `json:"cswap_app_id"` + Amount sdkmath.Int `json:"amount"` + Pools []uint64 `json:"pools"` + VotingRatio []sdkmath.Int `json:"voting_ratio"` } diff --git a/app/wasm/bindings/query.go b/app/wasm/bindings/query.go index 8a6e1061b..657176cc7 100644 --- a/app/wasm/bindings/query.go +++ b/app/wasm/bindings/query.go @@ -1,6 +1,9 @@ package bindings -import sdk "github.com/cosmos/cosmos-sdk/types" +import ( + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" +) type ComdexQuery struct { AppData *AppData `json:"get_app,omitempty"` @@ -132,14 +135,14 @@ type CollectorLookupTableQueryResponse struct { } type ExtendedPairsVaultRecordsQuery struct { - AppID uint64 `json:"app_id"` - PairID uint64 `json:"pair_id"` - StabilityFee sdk.Dec `json:"stability_fee"` - ClosingFee sdk.Dec `json:"closing_fee"` - DrawDownFee sdk.Dec `json:"draw_down_fee"` - DebtCeiling sdk.Int `json:"debt_ceiling"` - DebtFloor sdk.Int `json:"debt_floor"` - PairName string `json:"pair_name"` + AppID uint64 `json:"app_id"` + PairID uint64 `json:"pair_id"` + StabilityFee sdkmath.LegacyDec `json:"stability_fee"` + ClosingFee sdkmath.LegacyDec `json:"closing_fee"` + DrawDownFee sdkmath.LegacyDec `json:"draw_down_fee"` + DebtCeiling sdkmath.Int `json:"debt_ceiling"` + DebtFloor sdkmath.Int `json:"debt_floor"` + PairName string `json:"pair_name"` } type ExtendedPairsVaultRecordsQueryResponse struct { diff --git a/app/wasm/message_plugin.go b/app/wasm/message_plugin.go index 4eeef075d..2156f9f65 100644 --- a/app/wasm/message_plugin.go +++ b/app/wasm/message_plugin.go @@ -3,6 +3,8 @@ package wasm import ( "encoding/json" + errorsmod "cosmossdk.io/errors" + esmkeeper "github.com/comdex-official/comdex/x/esm/keeper" vaultkeeper "github.com/comdex-official/comdex/x/vault/keeper" @@ -71,7 +73,7 @@ func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddre // leave everything else for the wrapped version var comdexMsg bindings.ComdexMessages if err := json.Unmarshal(msg.Custom, &comdexMsg); err != nil { - return nil, nil, sdkerrors.Wrap(err, "comdex msg error") + return nil, nil, errorsmod.Wrap(err, "comdex msg error") } if comdexMsg.MsgWhiteListAssetLocker != nil { return m.whitelistAssetLocker(ctx, contractAddr, comdexMsg.MsgWhiteListAssetLocker) @@ -149,7 +151,7 @@ func (m *CustomMessenger) whitelistAssetLocker(ctx sdk.Context, contractAddr sdk } err := WhiteListAsset(m.lockerKeeper, ctx, contractAddr.String(), whiteListAsset) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "white list asset") + return nil, nil, errorsmod.Wrap(err, "white list asset") } return nil, nil, nil } @@ -182,7 +184,7 @@ func (m *CustomMessenger) whitelistAppIDLockerRewards(ctx sdk.Context, contractA } err := WhitelistAppIDLockerRewards(m.rewardsKeeper, ctx, contractAddr.String(), whiteListAsset) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "white list appId locker rewards") + return nil, nil, errorsmod.Wrap(err, "white list appId locker rewards") } return nil, nil, nil } @@ -215,7 +217,7 @@ func (m *CustomMessenger) whitelistAppIDVaultInterest(ctx sdk.Context, contractA } err := WhitelistAppIDVaultInterest(m.rewardsKeeper, ctx, contractAddr.String(), whiteListAsset) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "white list appId vault Interest") + return nil, nil, errorsmod.Wrap(err, "white list appId vault Interest") } return nil, nil, nil } @@ -247,7 +249,7 @@ func (m *CustomMessenger) AddExtendedPairsVault(ctx sdk.Context, contractAddr sd } err := MsgAddExtendedPairsVault(m.assetKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "AddExtendedPairsVault error") + return nil, nil, errorsmod.Wrap(err, "AddExtendedPairsVault error") } return nil, nil, nil } @@ -274,7 +276,7 @@ func (m *CustomMessenger) SetCollectorLookupTable(ctx sdk.Context, contractAddr } err := MsgSetCollectorLookupTable(m.collectorKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "SetCollectorLookupTable error") + return nil, nil, errorsmod.Wrap(err, "SetCollectorLookupTable error") } return nil, nil, nil } @@ -301,7 +303,7 @@ func (m *CustomMessenger) SetAuctionMappingForApp(ctx sdk.Context, contractAddr } err := MsgSetAuctionMappingForApp(m.collectorKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "SetAuctionMappingForApp error") + return nil, nil, errorsmod.Wrap(err, "SetAuctionMappingForApp error") } return nil, nil, nil } @@ -328,7 +330,7 @@ func (m *CustomMessenger) UpdatePairsVault(ctx sdk.Context, contractAddr sdk.Acc } err := MsgUpdatePairsVault(m.assetKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "UpdatePairsVault error") + return nil, nil, errorsmod.Wrap(err, "UpdatePairsVault error") } return nil, nil, nil } @@ -355,7 +357,7 @@ func (m *CustomMessenger) UpdateCollectorLookupTable(ctx sdk.Context, contractAd } err := MsgUpdateCollectorLookupTable(m.collectorKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "UpdateCollectorLookupTable error") + return nil, nil, errorsmod.Wrap(err, "UpdateCollectorLookupTable error") } return nil, nil, nil } @@ -382,7 +384,7 @@ func (m *CustomMessenger) RemoveWhitelistAssetLocker(ctx sdk.Context, contractAd } err := MsgRemoveWhitelistAssetLocker(m.rewardsKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "RemoveWhitelistAssetRewards error") + return nil, nil, errorsmod.Wrap(err, "RemoveWhitelistAssetRewards error") } return nil, nil, nil } @@ -409,7 +411,7 @@ func (m *CustomMessenger) RemoveWhitelistAppIDVaultInterest(ctx sdk.Context, con } err := MsgRemoveWhitelistAppIDVaultInterest(m.rewardsKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "RemoveWhitelistAppIdVaultInterest error") + return nil, nil, errorsmod.Wrap(err, "RemoveWhitelistAppIdVaultInterest error") } return nil, nil, nil } @@ -436,7 +438,7 @@ func (m *CustomMessenger) WhitelistAppIDLiquidation(ctx sdk.Context, contractAdd } err := MsgWhitelistAppIDLiquidation(m.liquidationKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "WhitelistAppIdLiquidation error") + return nil, nil, errorsmod.Wrap(err, "WhitelistAppIdLiquidation error") } return nil, nil, nil } @@ -463,7 +465,7 @@ func (m *CustomMessenger) RemoveWhitelistAppIDLiquidation(ctx sdk.Context, contr } err := MsgRemoveWhitelistAppIDLiquidation(m.liquidationKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "RemoveWhitelistAppIdLiquidation error") + return nil, nil, errorsmod.Wrap(err, "RemoveWhitelistAppIdLiquidation error") } return nil, nil, nil } @@ -490,7 +492,7 @@ func (m *CustomMessenger) AddAuctionParams(ctx sdk.Context, contractAddr sdk.Acc } err := MsgAddAuctionParams(m.auctionKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "AddAuctionParams error") + return nil, nil, errorsmod.Wrap(err, "AddAuctionParams error") } return nil, nil, nil } @@ -517,7 +519,7 @@ func (m *CustomMessenger) BurnGovTokensForApp(ctx sdk.Context, contractAddr sdk. } err := MsgBurnGovTokensForApp(m.tokenMintKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "BurnGovTokensForApp error") + return nil, nil, errorsmod.Wrap(err, "BurnGovTokensForApp error") } return nil, nil, nil } @@ -544,7 +546,7 @@ func (m *CustomMessenger) AddESMTriggerParams(ctx sdk.Context, contractAddr sdk. } err := MsgAddESMTriggerParams(m.esmKeeper, ctx, contractAddr, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "BurnGovTokensForApp error") + return nil, nil, errorsmod.Wrap(err, "BurnGovTokensForApp error") } return nil, nil, nil } @@ -564,14 +566,14 @@ func (m *CustomMessenger) ExecuteAddEmissionRewards(ctx sdk.Context, contractAdd if contractAddr.String() != comdex1[1] { return nil, nil, sdkerrors.ErrInvalidAddress } - }else if ctx.ChainID() == "comdex-test3" { + } else if ctx.ChainID() == "comdex-test3" { if contractAddr.String() != testnet3[1] { return nil, nil, sdkerrors.ErrInvalidAddress } } err := MsgAddEmissionRewards(m.vaultKeeper, ctx, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "Emission rewards error") + return nil, nil, errorsmod.Wrap(err, "Emission rewards error") } return nil, nil, nil } @@ -588,7 +590,7 @@ func (m *CustomMessenger) ExecuteAddEmissionPoolRewards(ctx sdk.Context, contrac } err := MsgAddEmissionPoolRewards(m.liquiditykeeper, ctx, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "Emission pool rewards error") + return nil, nil, errorsmod.Wrap(err, "Emission pool rewards error") } return nil, nil, nil } @@ -625,7 +627,7 @@ func (m *CustomMessenger) ExecuteFoundationEmission(ctx sdk.Context, contractAdd } err := MsgFoundationEmission(m.tokenMintKeeper, ctx, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "Foundation Emission rewards error") + return nil, nil, errorsmod.Wrap(err, "Foundation Emission rewards error") } return nil, nil, nil } @@ -652,7 +654,7 @@ func (m *CustomMessenger) ExecuteMsgRebaseMint(ctx sdk.Context, contractAddr sdk } err := MsgRebaseMint(m.tokenMintKeeper, ctx, a) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "Foundation Emission rewards error") + return nil, nil, errorsmod.Wrap(err, "Foundation Emission rewards error") } return nil, nil, nil } @@ -679,7 +681,7 @@ func (m *CustomMessenger) ExecuteMsgGetSurplusFund(ctx sdk.Context, contractAddr } err := MsgGetSurplusFund(m.collectorKeeper, ctx, a, contractAddr) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "Execute surplus fund rewards error") + return nil, nil, errorsmod.Wrap(err, "Execute surplus fund rewards error") } return nil, nil, nil } diff --git a/app/wasm/queries.go b/app/wasm/queries.go index cb9de874f..6ae4d0e88 100644 --- a/app/wasm/queries.go +++ b/app/wasm/queries.go @@ -1,6 +1,7 @@ package wasm import ( + sdkmath "cosmossdk.io/math" assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" collectorkeeper "github.com/comdex-official/comdex/x/collector/keeper" esmKeeper "github.com/comdex-official/comdex/x/esm/keeper" @@ -57,7 +58,7 @@ func NewQueryPlugin( } } -func (qp QueryPlugin) GetAppInfo(ctx sdk.Context, appID uint64) (sdk.Int, int64, uint64, error) { +func (qp QueryPlugin) GetAppInfo(ctx sdk.Context, appID uint64) (sdkmath.Int, int64, uint64, error) { MinGovDeposit, GovTimeInSeconds, AssetID, err := qp.assetKeeper.GetAppWasmQuery(ctx, appID) if err != nil { return MinGovDeposit, GovTimeInSeconds, AssetID, nil @@ -109,7 +110,7 @@ func (qp QueryPlugin) CollectorLookupTableQueryCheck(ctx sdk.Context, appID, col return found, err } -func (qp QueryPlugin) ExtendedPairsVaultRecordsQueryCheck(ctx sdk.Context, appID, pairID uint64, StabilityFee, ClosingFee, DrawDownFee sdk.Dec, DebtCeiling, DebtFloor sdk.Int, PairName string) (found bool, err string) { +func (qp QueryPlugin) ExtendedPairsVaultRecordsQueryCheck(ctx sdk.Context, appID, pairID uint64, StabilityFee, ClosingFee, DrawDownFee sdkmath.LegacyDec, DebtCeiling, DebtFloor sdkmath.Int, PairName string) (found bool, err string) { found, err = qp.assetKeeper.WasmAddExtendedPairsVaultRecordsQuery(ctx, appID, pairID, StabilityFee, ClosingFee, DrawDownFee, DebtCeiling, DebtFloor, PairName) return found, err } @@ -209,7 +210,7 @@ func (qp QueryPlugin) WasmGetPools(ctx sdk.Context, appID uint64) (pools []uint6 func (qp QueryPlugin) WasmGetAssetPrice(ctx sdk.Context, assetID uint64) (twa uint64, found bool) { assetTwa, found := qp.marketKeeper.GetTwa(ctx, assetID) - if found && assetTwa.IsPriceActive{ + if found && assetTwa.IsPriceActive { return assetTwa.Twa, true } return 0, false diff --git a/app/wasm/query_plugin.go b/app/wasm/query_plugin.go index 015933e3f..e7f5a28d2 100644 --- a/app/wasm/query_plugin.go +++ b/app/wasm/query_plugin.go @@ -3,9 +3,10 @@ package wasm import ( "encoding/json" + errorsmod "cosmossdk.io/errors" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/comdex-official/comdex/app/wasm/bindings" ) @@ -14,7 +15,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. return func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { var comdexQuery bindings.ComdexQuery if err := json.Unmarshal(request, &comdexQuery); err != nil { - return nil, sdkerrors.Wrap(err, "app query") + return nil, errorsmod.Wrap(err, "app query") } if comdexQuery.AppData != nil { appID := comdexQuery.AppData.AppID @@ -26,7 +27,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "App data query response") + return nil, errorsmod.Wrap(err, "App data query response") } return bz, nil } else if comdexQuery.AssetData != nil { @@ -37,7 +38,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "App data query response") + return nil, errorsmod.Wrap(err, "App data query response") } return bz, nil } else if comdexQuery.MintedToken != nil { @@ -49,7 +50,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "tokenMint query response") + return nil, errorsmod.Wrap(err, "tokenMint query response") } return bz, nil } else if comdexQuery.RemoveWhiteListAssetLocker != nil { @@ -63,7 +64,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "RemoveWhiteListAssetLocker query response") + return nil, errorsmod.Wrap(err, "RemoveWhiteListAssetLocker query response") } return bz, nil } else if comdexQuery.WhitelistAppIDLockerRewards != nil { @@ -77,7 +78,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "WhitelistAppIdLockerRewards query response") + return nil, errorsmod.Wrap(err, "WhitelistAppIdLockerRewards query response") } return bz, nil } else if comdexQuery.WhitelistAppIDVaultInterest != nil { @@ -90,7 +91,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "WhitelistAppIdVaultInterest query response") + return nil, errorsmod.Wrap(err, "WhitelistAppIdVaultInterest query response") } return bz, nil } else if comdexQuery.ExternalLockerRewards != nil { @@ -104,7 +105,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "GetExternalLockerRewardsCheck query response") + return nil, errorsmod.Wrap(err, "GetExternalLockerRewardsCheck query response") } return bz, nil } else if comdexQuery.ExternalVaultRewards != nil { @@ -118,7 +119,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "ExternalVaultRewards query response") + return nil, errorsmod.Wrap(err, "ExternalVaultRewards query response") } return bz, nil } else if comdexQuery.CollectorLookupTableQuery != nil { @@ -132,7 +133,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "ExternalVaultRewards query response") + return nil, errorsmod.Wrap(err, "ExternalVaultRewards query response") } return bz, nil } else if comdexQuery.ExtendedPairsVaultRecordsQuery != nil { @@ -152,7 +153,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "ExternalVaultRewards query response") + return nil, errorsmod.Wrap(err, "ExternalVaultRewards query response") } return bz, nil } else if comdexQuery.AuctionMappingForAppQuery != nil { @@ -164,7 +165,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "AuctionMappingForAppQuery query response") + return nil, errorsmod.Wrap(err, "AuctionMappingForAppQuery query response") } return bz, nil } else if comdexQuery.WhiteListedAssetQuery != nil { @@ -177,7 +178,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "WhiteListedAssetQueryCheck query response") + return nil, errorsmod.Wrap(err, "WhiteListedAssetQueryCheck query response") } return bz, nil } else if comdexQuery.UpdatePairsVaultQuery != nil { @@ -190,7 +191,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "UpdatePairsVaultQuery query response") + return nil, errorsmod.Wrap(err, "UpdatePairsVaultQuery query response") } return bz, nil } else if comdexQuery.UpdateCollectorLookupTableQuery != nil { @@ -203,7 +204,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "UpdatePairsVaultQuery query response") + return nil, errorsmod.Wrap(err, "UpdatePairsVaultQuery query response") } return bz, nil } else if comdexQuery.RemoveWhitelistAppIDVaultInterestQuery != nil { @@ -215,7 +216,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "RemoveWhitelistAppIdVaultInterestQuery query response") + return nil, errorsmod.Wrap(err, "RemoveWhitelistAppIdVaultInterestQuery query response") } return bz, nil } else if comdexQuery.RemoveWhitelistAssetLockerQuery != nil { @@ -229,7 +230,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "RemoveWhitelistAssetLockerQuery query response") + return nil, errorsmod.Wrap(err, "RemoveWhitelistAssetLockerQuery query response") } return bz, nil } else if comdexQuery.WhitelistAppIDLiquidationQuery != nil { @@ -242,7 +243,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "WhitelistAppIDLiquidationQuery query response") + return nil, errorsmod.Wrap(err, "WhitelistAppIDLiquidationQuery query response") } return bz, nil } else if comdexQuery.RemoveWhitelistAppIDLiquidationQuery != nil { @@ -255,7 +256,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "RemoveWhitelistAppIDLiquidationQuery query response") + return nil, errorsmod.Wrap(err, "RemoveWhitelistAppIDLiquidationQuery query response") } return bz, nil } else if comdexQuery.AddESMTriggerParamsForAppQuery != nil { @@ -268,7 +269,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "AddESMTriggerParamsForAppResponse query response") + return nil, errorsmod.Wrap(err, "AddESMTriggerParamsForAppResponse query response") } return bz, nil } else if comdexQuery.ExtendedPairByApp != nil { @@ -280,7 +281,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "ExtendedPairByAppResponse query response") + return nil, errorsmod.Wrap(err, "ExtendedPairByAppResponse query response") } return bz, nil } else if comdexQuery.CheckSurplusReward != nil { @@ -292,7 +293,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "CheckSurplusRewardResponse query response") + return nil, errorsmod.Wrap(err, "CheckSurplusRewardResponse query response") } return bz, nil } else if comdexQuery.CheckWhitelistedAsset != nil { @@ -304,7 +305,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "CheckWhitelistedAssetResponse query response") + return nil, errorsmod.Wrap(err, "CheckWhitelistedAssetResponse query response") } return bz, nil } else if comdexQuery.CheckVaultCreated != nil { @@ -316,7 +317,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "VaultCreatedResponse query response") + return nil, errorsmod.Wrap(err, "VaultCreatedResponse query response") } return bz, nil } else if comdexQuery.CheckBorrowed != nil { @@ -328,7 +329,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "BorrowedResponse query response") + return nil, errorsmod.Wrap(err, "BorrowedResponse query response") } return bz, nil } else if comdexQuery.CheckLiquidityProvided != nil { @@ -341,7 +342,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "LiquidityProvidedResponse query response") + return nil, errorsmod.Wrap(err, "LiquidityProvidedResponse query response") } return bz, nil } else if comdexQuery.GetPoolByApp != nil { @@ -352,7 +353,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "GetPoolByApp query response") + return nil, errorsmod.Wrap(err, "GetPoolByApp query response") } return bz, nil } else if comdexQuery.GetAssetPrice != nil { @@ -363,7 +364,7 @@ func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json. } bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "GetAssetPrice query response") + return nil, errorsmod.Wrap(err, "GetAssetPrice query response") } return bz, nil } diff --git a/app/wasm/test/helpers_test.go b/app/wasm/test/helpers_test.go index 5beec95ad..78cec65a6 100644 --- a/app/wasm/test/helpers_test.go +++ b/app/wasm/test/helpers_test.go @@ -1,9 +1,9 @@ package wasm import ( + sdkmath "cosmossdk.io/math" "fmt" "testing" - "time" "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" @@ -15,7 +15,7 @@ import ( "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/crypto/ed25519" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + // simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -30,13 +30,13 @@ func SetupCustomApp(t *testing.T) (*app.App, *sdk.Context) { func CreateTestInput(t *testing.T) (*app.App, *sdk.Context) { comdex := app.Setup(t, false) - ctx := comdex.BaseApp.NewContext(false, tmproto.Header{Height: 1, ChainID: "comdex-1", Time: time.Now().UTC()}) + ctx := comdex.BaseApp.NewContext(false) return comdex, &ctx } func FundAccount(t *testing.T, ctx sdk.Context, comdex *app.App, acct sdk.AccAddress) { err := FundAccountFunc(comdex.BankKeeper, ctx, acct, sdk.NewCoins( - sdk.NewCoin("ucmdx", sdk.NewInt(10000000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(10000000000)), )) require.NoError(t, err) } @@ -61,11 +61,11 @@ func RandomBech32AccountAddress() string { func AddAppAsset(app *app.App, ctx1 sdk.Context) { assetKeeper, ctx := &app.AssetKeeper, &ctx1 userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" - genesisSupply := sdk.NewIntFromUint64(9000000) + genesisSupply := sdkmath.NewIntFromUint64(9000000) msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -81,7 +81,7 @@ func AddAppAsset(app *app.App, ctx1 sdk.Context) { msg2 := assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -90,7 +90,7 @@ func AddAppAsset(app *app.App, ctx1 sdk.Context) { msg3 := assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -99,7 +99,7 @@ func AddAppAsset(app *app.App, ctx1 sdk.Context) { msg4 := assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -146,12 +146,12 @@ func AddCollectorLookuptable(app *app.App, ctx1 sdk.Context) { AppID: 1, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, }, } { @@ -172,15 +172,15 @@ func AddExtendedPairVault(app *app.App, ctx1 sdk.Context) { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-A", AssetOutOraclePrice: true, AssetOutPrice: 1000000, diff --git a/app/wasm/test/messages_test.go b/app/wasm/test/messages_test.go index dcc1e2f8b..e11251e4b 100644 --- a/app/wasm/test/messages_test.go +++ b/app/wasm/test/messages_test.go @@ -1,6 +1,7 @@ package wasm import ( + sdkmath "cosmossdk.io/math" "testing" "github.com/comdex-official/comdex/app/wasm" @@ -78,15 +79,15 @@ func TestAddMsgAddExtendedPairsVault(t *testing.T) { msg: &bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -137,12 +138,12 @@ func TestMsgSetCollectorLookupTable(t *testing.T) { AppID: 1, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, isErrorExpected: false, }, @@ -239,12 +240,12 @@ func TestMsgUpdateCollectorLookupTable(t *testing.T) { msg: &bindings.MsgUpdateCollectorLookupTable{ AppID: 1, AssetID: 2, - SurplusThreshold: sdk.NewInt(9999), - DebtThreshold: sdk.NewInt(99), - LSR: sdk.MustNewDecFromStr("0.001"), - LotSize: sdk.NewInt(100), - BidFactor: sdk.MustNewDecFromStr("0.00001"), - DebtLotSize: sdk.NewInt(300), + SurplusThreshold: sdkmath.NewInt(9999), + DebtThreshold: sdkmath.NewInt(99), + LSR: sdkmath.LegacyMustNewDecFromStr("0.001"), + LotSize: sdkmath.NewInt(100), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.00001"), + DebtLotSize: sdkmath.NewInt(300), }, isErrorExpected: false, }, @@ -291,13 +292,13 @@ func TestMsgUpdatePairsVault(t *testing.T) { msg: &bindings.MsgUpdatePairsVault{ AppID: 1, ExtPairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.4"), - ClosingFee: sdk.MustNewDecFromStr("233.23"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.56"), - DrawDownFee: sdk.MustNewDecFromStr("0.29"), - DebtCeiling: sdk.NewInt(1000000000), - DebtFloor: sdk.NewInt(1000), - MinCr: sdk.MustNewDecFromStr("1.8"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.4"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("233.23"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.56"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.29"), + DebtCeiling: sdkmath.NewInt(1000000000), + DebtFloor: sdkmath.NewInt(1000), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.8"), MinUsdValueLeft: 100000000, }, isErrorExpected: false, @@ -439,8 +440,8 @@ func TestMsgAddAuctionParams(t *testing.T) { msg: &bindings.MsgAddAuctionParams{ AppID: 1, AuctionDurationSeconds: 300, - Buffer: sdk.MustNewDecFromStr("1.2"), - Cusp: sdk.MustNewDecFromStr("0.6"), + Buffer: sdkmath.LegacyMustNewDecFromStr("1.2"), + Cusp: sdkmath.LegacyMustNewDecFromStr("0.6"), Step: 1, PriceFunctionType: 1, SurplusID: 1, @@ -487,7 +488,7 @@ func TestMsgBurnGovTokensForApp(t *testing.T) { msg: &bindings.MsgBurnGovTokensForApp{ AppID: 1, From: addr, - Amount: sdk.NewCoin("uharbor", sdk.NewInt(100)), + Amount: sdk.NewCoin("uharbor", sdkmath.NewInt(100)), }, isErrorExpected: false, }, diff --git a/cmd/comdex/genaccounts.go b/cmd/comdex/genaccounts.go index fe4afcbce..1e1db6a2f 100644 --- a/cmd/comdex/genaccounts.go +++ b/cmd/comdex/genaccounts.go @@ -99,7 +99,10 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) if !vestingAmt.IsZero() { - baseVestingAccount := authvestingtypes.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + baseVestingAccount, err := authvestingtypes.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + if err !=nil { + return err + } if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { diff --git a/cmd/comdex/main.go b/cmd/comdex/main.go index 4173b50d5..03e62c35d 100644 --- a/cmd/comdex/main.go +++ b/cmd/comdex/main.go @@ -3,7 +3,7 @@ package main import ( "os" - "github.com/cosmos/cosmos-sdk/server" + "cosmossdk.io/log" servercmd "github.com/cosmos/cosmos-sdk/server/cmd" comdex "github.com/comdex-official/comdex/app" @@ -12,13 +12,9 @@ import ( func main() { comdex.SetAccountAddressPrefixes() - root, _ := NewRootCmd() + root, _ := NewRootCmd() //TODO: check wasmd root if err := servercmd.Execute(root, "", comdex.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - default: - os.Exit(1) - } + log.NewLogger(root.OutOrStderr()).Error("failure when running app", "err", err) + os.Exit(1) } } diff --git a/cmd/comdex/migrate.go b/cmd/comdex/migrate.go index 358851928..8b8ce1dc4 100644 --- a/cmd/comdex/migrate.go +++ b/cmd/comdex/migrate.go @@ -4,10 +4,10 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/x/genutil/types" // bump47: uncomment below 1 - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" ) -func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { +func Migrate(appState types.AppMap, clientCtx client.Context) (types.AppMap, error) { // Migrate packetfowardmiddleware. if appState["packetfowardmiddleware"] != nil { // unmarshal relative source genesis application state @@ -22,7 +22,7 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { appState["packetfowardmiddleware"] = clientCtx.Codec.MustMarshalJSON(MigrateJSON(&oldGovState)) } - return appState + return appState, nil } func MigrateJSON(oldState *packetforwardtypes.GenesisState) *packetforwardtypes.GenesisState { diff --git a/cmd/comdex/migration.go b/cmd/comdex/migration.go index 62fbf9dc9..d04a6536f 100644 --- a/cmd/comdex/migration.go +++ b/cmd/comdex/migration.go @@ -71,7 +71,10 @@ $ %s migrate v11.3.0 /path/to/genesis.json --chain-id=test-2 --genesis-time=2019 } // TODO: handler error from migrationFunc call - newGenState := migrationFunc(initialState, clientCtx) + newGenState, err := migrationFunc(initialState, clientCtx) + if err != nil { + return err + } genDoc.AppState, err = json.Marshal(newGenState) if err != nil { diff --git a/cmd/comdex/root.go b/cmd/comdex/root.go index edae184a6..d4328b91e 100644 --- a/cmd/comdex/root.go +++ b/cmd/comdex/root.go @@ -7,16 +7,22 @@ import ( "path/filepath" "time" + storetypes "cosmossdk.io/store/types" + confixcmd "cosmossdk.io/tools/confix/cmd" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/prometheus/client_golang/prometheus" - tmdb "github.com/cometbft/cometbft-db" - tmcfg "github.com/cometbft/cometbft/config" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/snapshots" + snapshottypes "cosmossdk.io/store/snapshots/types" + cmtcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" @@ -28,17 +34,15 @@ import ( "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" authcli "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" - "github.com/cosmos/cosmos-sdk/x/genutil" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/spf13/cast" "github.com/spf13/cobra" @@ -60,9 +64,11 @@ func NewRootCmd() (*cobra.Command, comdex.EncodingConfig) { cobra.EnableCommandSorting = false root := &cobra.Command{ - Use: "comdex", - Short: "Comdex - DeFi Infrastructure layer for the Cosmos ecosystem", + Use: "comdex", + Short: "Comdex - DeFi Infrastructure layer for the Cosmos ecosystem", + SilenceErrors: true, PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + initClientCtx = initClientCtx.WithCmdContext(cmd.Context()) initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) if err != nil { return err @@ -71,6 +77,25 @@ func NewRootCmd() (*cobra.Command, comdex.EncodingConfig) { if err != nil { return err } + // This needs to go after ReadFromClientConfig, as that function + // sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode + // is only available if the client is online. + if !initClientCtx.Offline { + enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) + txConfigOpts := tx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), + } + txConfig, err := tx.NewTxConfigWithOptions( + initClientCtx.Codec, + txConfigOpts, + ) + if err != nil { + return err + } + + initClientCtx = initClientCtx.WithTxConfig(txConfig) + } if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { return err @@ -79,12 +104,12 @@ func NewRootCmd() (*cobra.Command, comdex.EncodingConfig) { timeoutCommit := 2 * time.Second customAppTemplate, customAppConfig := initAppConfig() - customTMConfig := initTendermintConfig(timeoutCommit) + customCMTConfig := initCometBFTConfig(timeoutCommit) // Force faster block times os.Setenv("COMDEX_CONSENSUS_TIMEOUT_COMMIT", cast.ToString(timeoutCommit)) - return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig) + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCMTConfig) }, } @@ -92,8 +117,8 @@ func NewRootCmd() (*cobra.Command, comdex.EncodingConfig) { return root, encodingConfig } -func initTendermintConfig(timeoutCommit time.Duration) *tmcfg.Config { - cfg := tmcfg.DefaultConfig() +func initCometBFTConfig(timeoutCommit time.Duration) *cmtcfg.Config { + cfg := cmtcfg.DefaultConfig() // these values put a higher strain on node memory // cfg.P2P.MaxNumInboundPeers = 100 @@ -131,28 +156,27 @@ func initAppConfig() (string, interface{}) { func initRootCmd(rootCmd *cobra.Command, encoding comdex.EncodingConfig) { cfg := sdk.GetConfig() cfg.Seal() - - gentxModule := comdex.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) + + // gentxModule := comdex.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) rootCmd.AddCommand( genutilcli.InitCmd(comdex.ModuleBasics, comdex.DefaultNodeHome), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, comdex.DefaultNodeHome, gentxModule.GenTxValidator), - genutilcli.GenTxCmd(comdex.ModuleBasics, encoding.TxConfig, banktypes.GenesisBalancesIterator{}, comdex.DefaultNodeHome), + // genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, comdex.DefaultNodeHome, gentxModule.GenTxValidator, txConfig.SigningContext().ValidatorAddressCodec()), + // genutilcli.GenTxCmd(comdex.ModuleBasics, encoding.TxConfig, banktypes.GenesisBalancesIterator{}, comdex.DefaultNodeHome, txConfig.SigningContext().ValidatorAddressCodec()), genutilcli.ValidateGenesisCmd(comdex.ModuleBasics), AddGenesisAccountCmd(comdex.DefaultNodeHome), - // AddGenesisWasmMsgCmd(comdex.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), testnetCmd(comdex.ModuleBasics, banktypes.GenesisBalancesIterator{}), MigrateStoreCmd(), debug.Cmd(), - config.Cmd(), + confixcmd.ConfigCommand(), ) server.AddCommands(rootCmd, comdex.DefaultNodeHome, appCreatorFunc, appExportFunc, addModuleInitFlags) rootCmd.AddCommand( - rpc.StatusCommand(), + server.StatusCommand(), queryCommand(), txCommand(), - keys.Commands(comdex.DefaultNodeHome), + keys.Commands(), ) } @@ -171,11 +195,13 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - authcli.GetAccountCmd(), rpc.ValidatorCommand(), - rpc.BlockCommand(), - authcli.QueryTxsByEventsCmd(), - authcli.QueryTxCmd(), + rpc.QueryEventForTxCmd(), + server.QueryBlockCmd(), + authcmd.QueryTxsByEventsCmd(), + server.QueryBlocksCmd(), + authcmd.QueryTxCmd(), + server.QueryBlockResultsCmd(), ) comdex.ModuleBasics.AddQueryCommands(cmd) @@ -202,6 +228,7 @@ func txCommand() *cobra.Command { authcli.GetBroadcastCommand(), authcli.GetEncodeCommand(), authcli.GetDecodeCommand(), + authcmd.GetSimulateCmd(), ) comdex.ModuleBasics.AddTxCommands(cmd) @@ -210,8 +237,8 @@ func txCommand() *cobra.Command { return cmd } -func appCreatorFunc(logger log.Logger, db tmdb.DB, tracer io.Writer, options servertypes.AppOptions) servertypes.Application { - var cache sdk.MultiStorePersistentCache +func appCreatorFunc(logger log.Logger, db dbm.DB, tracer io.Writer, options servertypes.AppOptions) servertypes.Application { + var cache storetypes.MultiStorePersistentCache if cast.ToBool(options.Get(server.FlagInterBlockCache)) { cache = store.NewCommitKVStoreCacheManager() } @@ -227,7 +254,7 @@ func appCreatorFunc(logger log.Logger, db tmdb.DB, tracer io.Writer, options ser } snapshotDir := filepath.Join(cast.ToString(options.Get(flags.FlagHome)), "data", "snapshots") - snapshotDB, err := tmdb.NewDB("metadata", tmdb.GoLevelDBBackend, snapshotDir) + snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir) if err != nil { panic(err) } @@ -262,7 +289,6 @@ func appCreatorFunc(logger log.Logger, db tmdb.DB, tracer io.Writer, options ser cast.ToUint(options.Get(server.FlagInvCheckPeriod)), comdex.MakeEncodingConfig(), options, - comdex.GetWasmEnabledProposals(), wasmOpts, baseapp.SetPruning(pruningOptions), baseapp.SetMinGasPrices(cast.ToString(options.Get(server.FlagMinGasPrices))), @@ -277,7 +303,7 @@ func appCreatorFunc(logger log.Logger, db tmdb.DB, tracer io.Writer, options ser ) } -func appExportFunc(logger log.Logger, db tmdb.DB, tracer io.Writer, height int64, +func appExportFunc(logger log.Logger, db dbm.DB, tracer io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, options servertypes.AppOptions, modulesToExport []string, ) (servertypes.ExportedApp, error) { config := comdex.MakeEncodingConfig() @@ -289,13 +315,13 @@ func appExportFunc(logger log.Logger, db tmdb.DB, tracer io.Writer, height int64 var emptyWasmOpts []wasm.Option var app *comdex.App if height != -1 { - app = comdex.New(logger, db, tracer, false, map[int64]bool{}, homePath, cast.ToUint(options.Get(server.FlagInvCheckPeriod)), config, options, comdex.GetWasmEnabledProposals(), emptyWasmOpts) + app = comdex.New(logger, db, tracer, false, map[int64]bool{}, homePath, cast.ToUint(options.Get(server.FlagInvCheckPeriod)), config, options, emptyWasmOpts) if err := app.LoadHeight(height); err != nil { return servertypes.ExportedApp{}, err } } else { - app = comdex.New(logger, db, tracer, true, map[int64]bool{}, homePath, cast.ToUint(options.Get(server.FlagInvCheckPeriod)), config, options, comdex.GetWasmEnabledProposals(), emptyWasmOpts) + app = comdex.New(logger, db, tracer, true, map[int64]bool{}, homePath, cast.ToUint(options.Get(server.FlagInvCheckPeriod)), config, options, emptyWasmOpts) } return app.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) diff --git a/cmd/comdex/testnet.go b/cmd/comdex/testnet.go index 52a4740fe..de73c3736 100644 --- a/cmd/comdex/testnet.go +++ b/cmd/comdex/testnet.go @@ -2,23 +2,25 @@ package main import ( "bufio" + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" "net" "os" "path/filepath" - tmconfig "github.com/cometbft/cometbft/config" + "cosmossdk.io/math/unsafe" + cmtconfig "github.com/cometbft/cometbft/config" tmos "github.com/cometbft/cometbft/libs/os" - tmrand "github.com/cometbft/cometbft/libs/rand" tmtypes "github.com/cometbft/cometbft/types" - tmtimetypes "github.com/cometbft/cometbft/types/time" + cmttime "github.com/cometbft/cometbft/types/time" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/cosmos/cosmos-sdk/testutil" @@ -73,7 +75,7 @@ Example: return InitTestnet( clientCtx, cmd, config, mbm, genBalIterator, outputDir, chainID, minGasPrices, - nodeDirPrefix, nodeDaemonHome, startingIPAddress, keyringBackend, algo, numValidators, + nodeDirPrefix, nodeDaemonHome, startingIPAddress, keyringBackend, algo, numValidators, clientCtx.TxConfig.SigningContext().ValidatorAddressCodec(), ) }, } @@ -96,7 +98,7 @@ const nodeDirPerm = 0o755 func InitTestnet( clientCtx client.Context, cmd *cobra.Command, - nodeConfig *tmconfig.Config, + nodeConfig *cmtconfig.Config, mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, outputDir, @@ -108,9 +110,10 @@ func InitTestnet( keyringBackend, algoStr string, numValidators int, + valAddrCodec runtime.ValidatorAddressCodec, ) error { if chainID == "" { - chainID = "chain-" + tmrand.NewRand().Str(6) + chainID = "chain-" + unsafe.NewRand().Str(6) } nodeIDs := make([]string, numValidators) @@ -189,8 +192,8 @@ func InitTestnet( return err } - accTokens := sdk.TokensFromConsensusPower(1000, sdk.NewInt(1)) - accStakingTokens := sdk.TokensFromConsensusPower(500, sdk.NewInt(1)) + accTokens := sdk.TokensFromConsensusPower(1000, sdkmath.NewInt(1)) + accStakingTokens := sdk.TokensFromConsensusPower(500, sdkmath.NewInt(1)) coins := sdk.Coins{ sdk.NewCoin(fmt.Sprintf("%stoken", nodeDirName), accTokens), sdk.NewCoin(sdk.DefaultBondDenom, accStakingTokens), @@ -199,14 +202,19 @@ func InitTestnet( genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: coins.Sort()}) genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0)) - valTokens := sdk.TokensFromConsensusPower(100, sdk.NewInt(1)) + valStr, err := valAddrCodec.BytesToString(sdk.ValAddress(addr)) + if err != nil { + return err + } + + valTokens := sdk.TokensFromConsensusPower(100, sdkmath.NewInt(1)) createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + valStr, valPubKeys[i], sdk.NewCoin(sdk.DefaultBondDenom, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), - stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), - sdk.OneInt(), + stakingtypes.NewCommissionRates(sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec()), + sdkmath.OneInt(), ) if err != nil { return err @@ -226,7 +234,7 @@ func InitTestnet( WithKeybase(kb). WithTxConfig(clientCtx.TxConfig) - if err := tx.Sign(txFactory, nodeDirName, txBuilder, true); err != nil { + if err := tx.Sign(cmd.Context(), txFactory, nodeDirName, txBuilder, true); err != nil { return err } @@ -248,7 +256,7 @@ func InitTestnet( err := collectGenFiles( clientCtx, nodeConfig, chainID, nodeIDs, valPubKeys, numValidators, - outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator, + outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator, valAddrCodec, ) if err != nil { return err @@ -302,12 +310,12 @@ func initGenFiles( } func collectGenFiles( - clientCtx client.Context, nodeConfig *tmconfig.Config, chainID string, + clientCtx client.Context, nodeConfig *cmtconfig.Config, chainID string, nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int, - outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, + outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, valAddrCodec runtime.ValidatorAddressCodec, ) error { var appState json.RawMessage - genTime := tmtimetypes.Now() + genTime := cmttime.Now() for i := 0; i < numValidators; i++ { nodeDirName := fmt.Sprintf("%s%d", nodeDirPrefix, i) @@ -320,12 +328,12 @@ func collectGenFiles( nodeID, valPubKey := nodeIDs[i], valPubKeys[i] initCfg := genutiltypes.NewInitConfig(chainID, gentxsDir, nodeID, valPubKey) - genDoc, err := tmtypes.GenesisDocFromFile(nodeConfig.GenesisFile()) + genDoc, err := genutiltypes.AppGenesisFromFile(nodeConfig.GenesisFile()) if err != nil { return err } - nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator, genutiltypes.DefaultMessageValidator) + nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, genDoc, genBalIterator, genutiltypes.DefaultMessageValidator, valAddrCodec) if err != nil { return err } diff --git a/go.mod b/go.mod index f3fc3105a..298896f33 100644 --- a/go.mod +++ b/go.mod @@ -1,39 +1,49 @@ module github.com/comdex-official/comdex -go 1.20 +go 1.21 + +// toolchain go1.21.0 require ( - cosmossdk.io/api v0.3.1 - cosmossdk.io/errors v1.0.0 - cosmossdk.io/math v1.1.2 - github.com/CosmWasm/wasmd v0.41.0 - github.com/CosmWasm/wasmvm v1.3.0 + cosmossdk.io/api v0.7.2 + cosmossdk.io/core v0.11.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.3.0 + cosmossdk.io/math v1.2.0 + cosmossdk.io/store v1.0.2 + cosmossdk.io/tools/confix v0.1.0 + cosmossdk.io/x/evidence v0.1.0 + cosmossdk.io/x/feegrant v0.1.0 + cosmossdk.io/x/upgrade v0.1.1 + github.com/CosmWasm/wasmd v0.50.0 + github.com/CosmWasm/wasmvm v1.5.1 github.com/bandprotocol/bandchain-packet v0.0.3 - github.com/cometbft/cometbft v0.37.2 - github.com/cometbft/cometbft-db v0.8.0 + github.com/cometbft/cometbft v0.38.2 + github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.47.5 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 - github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79 + github.com/cosmos/cosmos-sdk v0.50.3 + github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0 + github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240116210548-bd2492192d72 + github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/golang/protobuf v1.5.3 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.16.0 + github.com/prometheus/client_golang v1.17.0 github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 - google.golang.org/grpc v1.57.0 - google.golang.org/protobuf v1.31.0 + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f + google.golang.org/grpc v1.60.1 + google.golang.org/protobuf v1.32.0 ) require ( - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.1 - github.com/cosmos/ibc-go/v7 v7.3.1 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.0 + github.com/cosmos/ibc-go/v8 v8.0.0 github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/golangci/golangci-lint v1.51.2 + github.com/golangci/golangci-lint v1.52.0 github.com/rakyll/statik v0.1.7 github.com/spf13/pflag v1.0.5 gopkg.in/yaml.v2 v2.4.0 @@ -43,84 +53,86 @@ require ( require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect - cloud.google.com/go v0.110.4 // indirect - cloud.google.com/go/compute v1.20.1 // indirect + cloud.google.com/go v0.110.10 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.0 // indirect + cloud.google.com/go/iam v1.1.5 // indirect cloud.google.com/go/storage v1.30.1 // indirect - cosmossdk.io/core v0.6.1 // indirect + cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.2.1 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect + cosmossdk.io/x/tx v0.13.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect - github.com/Abirdcfly/dupword v0.0.9 // indirect - github.com/Antonboom/errname v0.1.7 // indirect - github.com/Antonboom/nilnil v0.1.1 // indirect + github.com/Abirdcfly/dupword v0.0.11 // indirect + github.com/Antonboom/errname v0.1.9 // indirect + github.com/Antonboom/nilnil v0.1.3 // indirect github.com/BurntSushi/toml v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/Djarvur/go-err113 v0.1.0 // indirect github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/OpenPeeDeeP/depguard v1.1.1 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect - github.com/armon/go-metrics v0.4.1 // indirect github.com/ashanbrown/forbidigo v1.5.3 // indirect github.com/ashanbrown/makezero v1.1.1 // indirect - github.com/aws/aws-sdk-go v1.44.203 // indirect + github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/bkielbasa/cyclop v1.2.1 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect github.com/bombsimon/wsl/v3 v3.4.0 // indirect - github.com/breml/bidichk v0.2.3 // indirect - github.com/breml/errchkjson v0.3.0 // indirect + github.com/breml/bidichk v0.2.4 // indirect + github.com/breml/errchkjson v0.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/butuzov/ireturn v0.1.1 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/charithe/durationcheck v0.0.9 // indirect + github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.10.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect - github.com/confio/ics23/go v0.9.0 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.20.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect + github.com/cosmos/iavl v1.0.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/daixiang0/gci v0.10.1 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/denis-tingaikin/go-header v0.4.3 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/distribution/reference v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/emicklei/dot v1.6.0 // indirect github.com/esimonov/ifshort v1.0.4 // indirect github.com/ettle/strcase v0.1.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fatih/structtag v1.2.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/firefart/nonamedreturns v1.0.4 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/getsentry/sentry-go v0.25.0 // indirect github.com/gin-gonic/gin v1.9.0 // indirect github.com/go-critic/go-critic v0.8.1 // indirect github.com/go-kit/kit v0.12.0 // indirect @@ -138,8 +150,8 @@ require ( github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/gogo/protobuf v1.3.3 // indirect + github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect @@ -153,37 +165,40 @@ require ( github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/s2a-go v0.1.4 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.11.0 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.4.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-getter v1.7.3 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/orderedmap v0.2.0 // indirect + github.com/iancoleman/orderedmap v0.3.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jgautheron/goconst v1.5.1 // indirect @@ -192,11 +207,11 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/julz/importas v0.1.0 // indirect - github.com/junk1tm/musttag v0.4.5 // indirect + github.com/junk1tm/musttag v0.5.0 // indirect github.com/kisielk/errcheck v1.6.3 // indirect github.com/kisielk/gotool v1.0.0 // indirect - github.com/kkHAIKE/contextcheck v1.1.3 // indirect - github.com/klauspost/compress v1.16.3 // indirect + github.com/kkHAIKE/contextcheck v1.1.4 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kulti/thelper v0.6.3 // indirect @@ -207,7 +222,7 @@ require ( github.com/leonklingele/grouper v1.1.1 // indirect github.com/lib/pq v1.10.9 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect + github.com/linxGnu/grocksdb v1.8.6 // indirect github.com/lufeee/execinquery v1.2.1 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect @@ -215,12 +230,11 @@ require ( github.com/maratori/testpackage v1.1.1 // indirect github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.10 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mbilski/exhaustivestruct v1.2.0 // indirect github.com/mgechev/revive v1.3.2 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -232,15 +246,17 @@ require ( github.com/nishanths/exhaustive v0.11.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.12.1 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polyfloyd/go-errorlint v1.4.2 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/quasilyte/go-ruleguard v0.3.19 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect @@ -249,9 +265,11 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.30.0 // indirect + github.com/rs/zerolog v1.31.0 // indirect github.com/ryancurrah/gomodguard v1.3.0 // indirect github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect + github.com/sagikazarmark/locafero v0.3.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect @@ -263,23 +281,23 @@ require ( github.com/sivchari/nosnakecase v1.7.0 // indirect github.com/sivchari/tenv v1.7.1 // indirect github.com/sonatard/noctx v0.0.2 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/viper v1.16.0 // indirect + github.com/spf13/afero v1.10.0 // indirect + github.com/spf13/viper v1.17.0 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect github.com/stretchr/objx v0.5.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect - github.com/tdakkota/asciicheck v0.1.1 // indirect + github.com/tdakkota/asciicheck v0.2.0 // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tetafro/godot v1.4.11 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e // indirect - github.com/timonwong/loggercheck v0.9.3 // indirect - github.com/tomarrell/wrapcheck/v2 v2.8.0 // indirect + github.com/timonwong/loggercheck v0.9.4 // indirect + github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/ultraware/funlen v0.0.3 // indirect @@ -290,36 +308,37 @@ require ( github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect gitlab.com/bosi/decorder v0.2.3 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.10.0 // indirect + go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.11.0 // indirect - golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect - golang.org/x/exp/typeparams v0.0.0-20230213192124-5e25df0256eb // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.12.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/term v0.10.0 // indirect - golang.org/x/text v0.12.0 // indirect - golang.org/x/tools v0.9.3 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect + golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.15.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.126.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/api v0.149.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect honnef.co/go/tools v0.4.3 // indirect mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect nhooyr.io/websocket v1.8.7 // indirect - pgregory.net/rapid v0.5.5 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) replace ( @@ -328,6 +347,7 @@ replace ( //TODO: to be replaced from comdex fork of bandchain-packet github.com/bandprotocol/bandchain-packet => github.com/InjectiveLabs/bandchain-packet v0.0.4-0.20230327115226-35199d4659d5 // https://github.com/cosmos/cosmos-sdk/blob/v0.47.5/UPGRADING.md#protobuf - // github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + // TODO: this should be removed, revisit + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/go.sum b/go.sum index 937ee83e0..4dbec15d5 100644 --- a/go.sum +++ b/go.sum @@ -14,7 +14,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= @@ -53,8 +52,8 @@ cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRY cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= -cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk= -cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= +cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= @@ -107,7 +106,6 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= @@ -141,8 +139,8 @@ cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARy cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= -cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= @@ -237,8 +235,8 @@ cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQE cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= -cloud.google.com/go/iam v1.1.0 h1:67gSqaPukx7O8WLLHMa0PNs3EBGd2eE4d+psbO/CO94= -cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= @@ -426,7 +424,6 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0= contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw= @@ -436,48 +433,68 @@ contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcig cosmossdk.io/api v0.2.1/go.mod h1:kNpfY0UY7Cz4ZuLJ4hm9auUGfmj23UFpOQ/Bo8IKCFw= cosmossdk.io/api v0.2.5/go.mod h1:vxhlMTeKWgQUaanTHPq7/vR3dkhhJ6pOgXK0EIBrBYw= cosmossdk.io/api v0.3.0/go.mod h1:2HDRQHwVIyklENrrXko0E/waZrRFZWHhPyhcBO4qHq4= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= +cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= +cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= +cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.3.2/go.mod h1:CO7vbe+evrBvHc0setFHL/u7nlY7HJGzdRSBkT/sirc= -cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= -cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk= -cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.0 h1:L0Z0XstClo2kOU4h3V1iDoE5Ji64sg5HLOogzGg67Oo= +cosmossdk.io/log v1.3.0/go.mod h1:HIDyvWLqZe2ovlWabsDN4aPMpY/nUEquAhgfTf2ZzB8= cosmossdk.io/math v1.0.0-beta.3/go.mod h1:3LYasri3Zna4XpbrTNdKsWmD5fHHkaNAod/mNT9XdE4= cosmossdk.io/math v1.0.0-beta.4/go.mod h1:An0MllWJY6PxibUpnwGk8jOm+a/qIxlKmL5Zyp9NnaM= cosmossdk.io/math v1.0.0-beta.6/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/math v1.0.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= -cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= +cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= +cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/tools/confix v0.1.0 h1:2OOZTtQsDT5e7P3FM5xqM0bPfluAxZlAwxqaDmYBE+E= +cosmossdk.io/tools/confix v0.1.0/go.mod h1:TdXKVYs4gEayav5wM+JHT+kTU2J7fozFNqoVaN+8CdY= cosmossdk.io/tools/rosetta v0.2.0/go.mod h1:3mn8QuE2wLUdTi77/gbDXdFqXZdBdiBJhgAWUTSXPv8= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= +cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= +cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= +cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= +cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= +cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= +cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM= +cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g= +cosmossdk.io/x/tx v0.13.0 h1:8lzyOh3zONPpZv2uTcUmsv0WTXy6T1/aCVDCqShmpzU= +cosmossdk.io/x/tx v0.13.0/go.mod h1:CpNQtmoqbXa33/DVxWQNx5Dcnbkv2xGUhL7tYQ5wUsY= +cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= +cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= -git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/Abirdcfly/dupword v0.0.7/go.mod h1:K/4M1kj+Zh39d2aotRwypvasonOyAMH1c/IZJzE0dmk= -github.com/Abirdcfly/dupword v0.0.9 h1:MxprGjKq3yDBICXDgEEsyGirIXfMYXkLNT/agPsE1tk= -github.com/Abirdcfly/dupword v0.0.9/go.mod h1:PzmHVLLZ27MvHSzV7eFmMXSFArWXZPZmfuuziuUrf2g= +github.com/Abirdcfly/dupword v0.0.11 h1:z6v8rMETchZXUIuHxYNmlUAuKuB21PeaSymTed16wgU= +github.com/Abirdcfly/dupword v0.0.11/go.mod h1:wH8mVGuf3CP5fsBTkfWwwwKTjDnVVCxtU8d8rgeVYXA= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= github.com/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8= github.com/Antonboom/errname v0.1.6/go.mod h1:7lz79JAnuoMNDAWE9MeeIr1/c/VpSUWatBv2FH9NYpI= -github.com/Antonboom/errname v0.1.7 h1:mBBDKvEYwPl4WFFNwec1CZO096G6vzK9vvDQzAwkako= github.com/Antonboom/errname v0.1.7/go.mod h1:g0ONh16msHIPgJSGsecu1G/dcF2hlYR/0SddnIAGavU= -github.com/Antonboom/nilnil v0.1.1 h1:PHhrh5ANKFWRBh7TdYmyyq2gyT2lotnvFvvFbylF81Q= +github.com/Antonboom/errname v0.1.9 h1:BZDX4r3l4TBZxZ2o2LNrlGxSHran4d1u4veZdoORTT4= +github.com/Antonboom/errname v0.1.9/go.mod h1:nLTcJzevREuAsgTbG85UsuiWpMpAqbKD1HNZ29OzE58= github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= +github.com/Antonboom/nilnil v0.1.3 h1:6RTbx3d2mcEu3Zwq9TowQpQMVpP75zugwOtqY1RTtcE= +github.com/Antonboom/nilnil v0.1.3/go.mod h1:iOov/7gRcXkeEU+EMGpBu2ORih3iyVEiWjeste1SJm8= github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= @@ -489,17 +506,15 @@ github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= -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/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0= github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -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/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -545,17 +560,17 @@ github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmd v0.41.0 h1:fmwxSbwb50zZDcBaayYFRLIaSFca+EFld1WOaQi49jg= -github.com/CosmWasm/wasmd v0.41.0/go.mod h1:0Sds1q2IsPaTN1gHa3BNOYcUFgtGvxH7CXEXPgoihns= -github.com/CosmWasm/wasmvm v1.3.0 h1:x12X4bKlUPS7TT9QQP45+fJo2sp30GEbiSSgb9jsec8= -github.com/CosmWasm/wasmvm v1.3.0/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/CosmWasm/wasmd v0.50.0 h1:NVaGqCSTRfb9UTDHJwT6nQIWcb6VjlQl88iI+u1+qjE= +github.com/CosmWasm/wasmd v0.50.0/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= +github.com/CosmWasm/wasmvm v1.5.1 h1:2MHN9uFyHP6pxfvpBJ0JW6ujvAIBk9kQk283zyri0Ro= +github.com/CosmWasm/wasmvm v1.5.1/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Djarvur/go-err113 v0.1.0 h1:uCRZZOdMQ0TZPHYTdYpoC0bLYJKPEHPUJ8MeAa51lNU= @@ -630,12 +645,10 @@ github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:H github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= 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/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= @@ -658,8 +671,6 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= @@ -667,7 +678,6 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuW github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ= @@ -682,7 +692,6 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -712,20 +721,12 @@ github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= +github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= @@ -744,6 +745,8 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= @@ -756,8 +759,6 @@ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U= github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg= github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= @@ -766,35 +767,34 @@ github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2 github.com/bombsimon/wsl/v3 v3.4.0 h1:RkSxjT3tmlptwfgEgTgU+KYKLI35p/tviNXNXiL2aNU= github.com/bombsimon/wsl/v3 v3.4.0/go.mod h1:KkIB+TXkqy6MvK9BDZVbZxKNYsE1/oLRJbIFtf14qqo= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/breml/bidichk v0.2.3 h1:qe6ggxpTfA8E75hdjWPZ581sY3a2lnl0IRxLQFelECI= github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= -github.com/breml/errchkjson v0.3.0 h1:YdDqhfqMT+I1vIxPSas44P+9Z9HzJwCeAzjB8PxP1xw= +github.com/breml/bidichk v0.2.4 h1:i3yedFWWQ7YzjdZJHnPo9d/xURinSq3OM+gyM43K4/8= +github.com/breml/bidichk v0.2.4/go.mod h1:7Zk0kRFt1LIZxtQdl9W9JwGAcLTTkOs+tN7wuEYGJ3s= github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= +github.com/breml/errchkjson v0.3.1 h1:hlIeXuspTyt8Y/UmP5qy1JocGNR00KQHgfaNtRAjoxQ= +github.com/breml/errchkjson v0.3.1/go.mod h1:XroxrzKjdiutFyW3nWhw34VGg7kiMsDQox73yWCGI2U= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= -github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd v0.23.0 h1:V2/ZgjfDFIygAX3ZapeigkVBoVUtOJKSwrhZdlpSvaA= github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= -github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= 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.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= -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/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/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= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= @@ -811,7 +811,8 @@ github.com/bufbuild/buf v1.9.0/go.mod h1:1Q+rMHiMVcfgScEF/GOldxmu4o9TrQ2sQQh58K6 github.com/bufbuild/connect-go v0.2.0/go.mod h1:4efZ2eXFENwd4p7tuLaL9m0qtTsCOzuBvrohvRGevDM= github.com/bufbuild/connect-go v1.0.0/go.mod h1:9iNvh/NOsfhNBUH5CtvXeVUskQO1xsrEviH7ZArwZ3I= github.com/bufbuild/protocompile v0.1.0/go.mod h1:ix/MMMdsT3fzxfw91dvbfzKW3fRRnuPCP47kpAm5m/4= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= @@ -822,7 +823,7 @@ github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacM github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bwesterb/go-ristretto v1.2.2/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw= github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -840,15 +841,15 @@ github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charithe/durationcheck v0.0.9 h1:mPP4ucLrf/rKZiIG/a9IPXHGlh8p4CzgpyTy6EEutYk= github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= +github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= +github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.0.0-20220316182200-5cad0b5181d4/go.mod h1:W8EnPSQ8Nv4fUjc/v1/8tHFqhuOJXnRub0dTfuAQktU= github.com/chavacava/garif v0.0.0-20220630083739-93517212f375/go.mod h1:4m1Rv7xfuwWPNKXlThldNuJvutYM6J95wNuuVmn55To= github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 h1:W9o46d2kbNL06lq7UNDPV0zYLzkrde/bjIqO02eoll0= @@ -858,6 +859,7 @@ github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d8 github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= @@ -880,7 +882,6 @@ github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4 github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.1/go.mod h1:+CauBF6R70Jqcyl8N2hC8pAXYbWkGIezuSbuGLtRhnw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= 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= @@ -899,34 +900,32 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG 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 v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= -github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb h1:6Po+YYKT5B5ZXN0wd2rwFBaebM0LufPf8p4zxOd48Kg= +github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb/go.mod h1:acMRUGd/BK8AUmQNK3spUCCGzFLZU2bSST3NMXSq2Kc= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= -github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= -github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= github.com/cometbft/cometbft v0.34.27-alpha.1/go.mod h1:hct3hasQ2hIF3HoD7foVw4RaqTNSSeJ/lgcrVK6uDvs= github.com/cometbft/cometbft v0.37.0/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= -github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= +github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= +github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= -github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= -github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= +github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= +github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/confio/ics23/go v0.7.0/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -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/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= @@ -1068,6 +1067,8 @@ github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= +github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= @@ -1077,8 +1078,8 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960Bvc github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20221207001918-ed5124f932fd/go.mod h1:dmCp0cYz6/S5KWKJ9QzePRwWNEbcSu+jbBTRgnzPnPo= github.com/cosmos/cosmos-sdk v0.47.0-rc2.0.20230220103612-f094a0c33410/go.mod h1:SNeHakoKi9YlfhI53+ijEZZIHp90NrB1By4NgWN0KZ0= github.com/cosmos/cosmos-sdk v0.47.1/go.mod h1:14tO5KQaTrl2q3OxBnDRfue7TRN9zkXS0cLutrSqkOo= -github.com/cosmos/cosmos-sdk v0.47.5 h1:n1+WjP/VM/gAEOx3TqU2/Ny734rj/MX1kpUnn7zVJP8= -github.com/cosmos/cosmos-sdk v0.47.5/go.mod h1:EHwCeN9IXonsjKcjpS12MqeStdZvIdxt3VYXhus3G3c= +github.com/cosmos/cosmos-sdk v0.50.3 h1:zP0AXm54ws2t2qVWvcQhEYVafhOAREU2QL0gnbwjvXw= +github.com/cosmos/cosmos-sdk v0.50.3/go.mod h1:tlrkY1sntOt1q0OX/rqF0zRJtmXNoffAS6VFTcky+w8= github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1.0.20220726092710-f848e4300a8a/go.mod h1:c8IO23vgNxueCCJlSI9awQtcxsvc+buzaeThB85qfBU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= @@ -1090,39 +1091,44 @@ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETR github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= github.com/cosmos/gogoproto v1.4.4/go.mod h1:/yl6/nLwsZcZ2JY3OrqjRqvqCG9InUMcXRfRjQiF9DU= github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= +github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= +github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/iavl v0.20.0-alpha4/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.1 h1:8mK4Ha/56P6jkRcLhIYhg/ipWhEuXBtj5O4I6fAi6vg= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.1/go.mod h1:GGUJN4LnB3J1Luu4kxTklQLbW69So3QXUndSalB003s= -github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 h1:mMHedP3Q+mz5gpOWNz0P+X8hxPdamylrBKc/P2cFakA= -github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0/go.mod h1:/P6l2bWo2AR3rrsfs0DHuFZO3Imzb93sxFD3ihrIgw4= -github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79 h1:pCxyhIxgWTabAQC5UerkITraHG3SwajdLKKMCFDWCv4= -github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79/go.mod h1:JwHFbo1oX/ht4fPpnPvmhZr+dCkYK1Vihw+vZE9umR4= -github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8= -github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= +github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= +github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.0 h1:PqaYuNJDpeqisP3Td5djrvFhuVMnOIWFJeqMJuZPRas= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.0/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= +github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0 h1:nKP2+Rzlz2iyvTosY5mvP+aEBPe06oaDl3G7xLGBpNI= +github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0/go.mod h1:D3Q380FpWRFtmUQWLosPxachi6w24Og2t5u/Tww5wtY= +github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240116210548-bd2492192d72 h1:YWjXTnVK6XzGGn1fyEjFrHSXzdxzsulLuTacQ/uJWEc= +github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240116210548-bd2492192d72/go.mod h1:PHprZxk8AHj4RAMuiI55eFkVusU+WVUKbWThEOhHY28= +github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= +github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= +github.com/cosmos/ibc-go/v8 v8.0.0 h1:QKipnr/NGwc+9L7NZipURvmSIu+nw9jOIWTJuDBqOhg= +github.com/cosmos/ibc-go/v8 v8.0.0/go.mod h1:C6IiJom0F3cIQCD5fKwVPDrDK9j/xTu563AWuOmXois= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cosmos/rosetta-sdk-go v0.9.0/go.mod h1:2v41yXL25xxAXrczVSnbDHcQH9CgildruDlGQGKW/JU= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= 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/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -1133,7 +1139,6 @@ github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2Eoh github.com/curioswitch/go-reassign v0.1.2/go.mod h1:bFJIHgtTM3hRm2sKXSPkbwNjSFyGURQXyn4IXD2qwfQ= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= @@ -1148,22 +1153,21 @@ github.com/daixiang0/gci v0.10.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiE github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= @@ -1176,22 +1180,20 @@ github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdw github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= @@ -1205,12 +1207,9 @@ github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -1234,8 +1233,6 @@ github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -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= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -1245,10 +1242,11 @@ github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/dot v1.6.0 h1:vUzuoVE8ipzS7QkES4UfxdpCwdU2U97m2Pb2tQCoYRY= +github.com/emicklei/dot v1.6.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= @@ -1271,7 +1269,6 @@ github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -1293,12 +1290,12 @@ github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBD github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.1/go.mod h1:D3dpIBojGGNh5UfElmwPu73SwDCm+VKhHYqwlNOk2uQ= github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= @@ -1313,6 +1310,7 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= 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.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= @@ -1325,13 +1323,10 @@ github.com/fzipp/gocyclo v0.5.1/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlya github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.25.0 h1:q6Eo+hS+yoJlTO3uu/azhQadsD8V+jQn2D8VvX1eOyI= +github.com/getsentry/sentry-go v0.25.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -1341,9 +1336,6 @@ github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g= github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ= @@ -1353,6 +1345,7 @@ github.com/go-critic/go-critic v0.6.5/go.mod h1:ezfP/Lh7MA6dBNn4c6ab5ALv3sKnZVLx github.com/go-critic/go-critic v0.8.1 h1:16omCF1gN3gTzt4j4J6fKI/HnRojhEp+Eks6EuKw3vw= github.com/go-critic/go-critic v0.8.1/go.mod h1:kpzXl09SIJX1cr9TB/g/sAG+eFEl7ZS9f9cqvZtyNl0= 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-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.4.0/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= @@ -1387,6 +1380,7 @@ github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= @@ -1408,12 +1402,14 @@ github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/ github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -1421,6 +1417,7 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= @@ -1449,6 +1446,7 @@ github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoM github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= github.com/go-toolsmith/pkgload v1.2.2 h1:0CtmHq/02QhxcF7E9N5LIFcYFsMR5rdovfqTtRKkgIk= +github.com/go-toolsmith/pkgload v1.2.2/go.mod h1:R2hxLNRKuAsiXCo2i5J6ZQPhnPMOVtU+f0arbFPWCus= github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= @@ -1462,13 +1460,16 @@ github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6C github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= +github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= @@ -1481,7 +1482,6 @@ github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQq github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -1492,25 +1492,16 @@ github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4Oe github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -1576,10 +1567,9 @@ github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLj github.com/golangci/golangci-lint v1.46.2/go.mod h1:3DkdHnxn9eoTTrpT2gB0TEv8KSziuoqe9FitgQLHvAY= github.com/golangci/golangci-lint v1.49.0/go.mod h1:+V/7lLv449R6w9mQ3WdV0EKh7Je/jTylMeSwBZcLeWE= github.com/golangci/golangci-lint v1.50.1/go.mod h1:AQjHBopYS//oB8xs0y0M/dtxdKHkdhl0RvmjUct0/4w= -github.com/golangci/golangci-lint v1.51.2 h1:yIcsT1X9ZYHdSpeWXRT1ORC/FPGSqDHbHsu9uk4FK7M= -github.com/golangci/golangci-lint v1.51.2/go.mod h1:KH9Q7/3glwpYSknxUgUyLlAv46A8fsSKo1hH2wDvkr8= +github.com/golangci/golangci-lint v1.52.0 h1:T7w3tuF1goz64qGV+ML4MgysSl/yUfA3UZJK92oE48A= +github.com/golangci/golangci-lint v1.52.0/go.mod h1:wlTh+d/oVlgZC2yCe6nlxrxNAnuhEQC0Zdygoh72Uak= github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= @@ -1605,7 +1595,6 @@ github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl76 github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw= -github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -1622,8 +1611,9 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE= github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= @@ -1636,7 +1626,6 @@ github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSN github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -1665,12 +1654,13 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 h1:CqYfpuYIjnlNxM3msdyPRKabhXZWbKjf3Q8BWROFBso= +github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= @@ -1679,16 +1669,18 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s= github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -1701,8 +1693,8 @@ github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= @@ -1725,13 +1717,15 @@ github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoT github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -1757,15 +1751,15 @@ github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoIS github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gotestyourself/gotestyourself v1.4.0/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= @@ -1782,9 +1776,7 @@ github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok= github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY= @@ -1803,25 +1795,28 @@ github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FK github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.6.2/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA= github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= +github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.2 h1:ErEYO2f//CjKsUDw4SmLzelsK6L3ZmOAR/4P9iS7ruY= +github.com/hashicorp/go-metrics v0.5.2/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= @@ -1829,6 +1824,8 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= @@ -1855,8 +1852,9 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -1873,13 +1871,13 @@ github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.8/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -1889,11 +1887,11 @@ github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbc github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= -github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= -github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= +github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -1910,19 +1908,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/informalsystems/tm-load-test v1.0.0/go.mod h1:WVaSKaQdfZK3v0C74EMzn7//+3aeCZF8wkIKBz2/M74= github.com/informalsystems/tm-load-test v1.3.0/go.mod h1:OQ5AQ9TbT5hKWBNIwsMjn6Bf4O0U4b1kRc+0qZlQJKw= github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= @@ -1930,12 +1917,10 @@ github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwD github.com/ishidawataru/sctp v0.0.0-20210226210310-f2269e66cdee/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= 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= @@ -1951,7 +1936,8 @@ github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuT github.com/jhump/protoreflect v1.12.1-0.20220417024638-438db461d753/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= github.com/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= @@ -1992,7 +1978,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -2000,14 +1985,10 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/junk1tm/musttag v0.4.5 h1:d+mpJ1vn6WFEVKHwkgJiIedis1u/EawKOuUTygAUtCo= -github.com/junk1tm/musttag v0.4.5/go.mod h1:XkcL/9O6RmD88JBXb+I15nYRl9W4ExhgQeCBEhfMC8U= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= +github.com/junk1tm/musttag v0.5.0 h1:bV1DTdi38Hi4pG4OVWa7Kap0hi0o7EczuK6wQt9zPOM= +github.com/junk1tm/musttag v0.5.0/go.mod h1:PcR7BA+oREQYvHwgjIDmw3exJeds5JzRcvEJTfjrA0M= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= @@ -2015,8 +1996,9 @@ github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkHAIKE/contextcheck v1.1.3 h1:l4pNvrb8JSwRd51ojtcOxOeHJzHek+MtOyXbaR0uvmw= github.com/kkHAIKE/contextcheck v1.1.3/go.mod h1:PG/cwd6c0705/LM0KTr1acO2gORUxkSVWyLJOFW5qoo= +github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8= +github.com/kkHAIKE/contextcheck v1.1.4/go.mod h1:1+i/gWqokIa+dm31mqGLZhZJ7Uh44DJGZVmr6QRBNJg= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= @@ -2034,15 +2016,14 @@ github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHU github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -2074,16 +2055,14 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= @@ -2105,10 +2084,9 @@ github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QT github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= +github.com/linxGnu/grocksdb v1.8.6 h1:O7I6SIGPrypf3f/gmrrLUBQDKfO8uOoYdWf4gLS06tc= +github.com/linxGnu/grocksdb v1.8.6/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= @@ -2145,13 +2123,11 @@ github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859 github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -2164,16 +2140,15 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -2184,15 +2159,13 @@ github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= @@ -2212,7 +2185,6 @@ github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WT github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= @@ -2243,7 +2215,6 @@ github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ= @@ -2289,7 +2260,6 @@ github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1: github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -2304,8 +2274,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= @@ -2323,7 +2291,6 @@ github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96d github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/networkplumbing/go-nft v0.2.0/go.mod h1:HnnM+tYvlGAsMU7yoYwXEVLLiDW9gdMmb5HoGcwpuQs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.7.11/go.mod h1:gX+MP7DWMKJmNa1HfMozK+u04hQd3na9i0hyqf3/dOI= @@ -2339,8 +2306,12 @@ github.com/nunnatsa/ginkgolinter v0.12.1/go.mod h1:AK8Ab1PypVrcGUusuKD8RDcl2KgsI github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= @@ -2368,6 +2339,7 @@ github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3 github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE= +github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -2386,6 +2358,7 @@ github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5h github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -2430,7 +2403,6 @@ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= @@ -2453,7 +2425,6 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -2467,22 +2438,20 @@ github.com/pelletier/go-toml/v2 v2.0.0/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZO github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= +github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pjbgf/sha1cd v0.2.3/go.mod h1:HOK9QrgzdHpbc2Kzip0Q1yi3M2MFGPADtR6HjG65m5M= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= @@ -2497,10 +2466,10 @@ github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdL github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pointlander/compress v1.1.1-0.20190518213731-ff44bd196cc3/go.mod h1:q5NXNGzqj5uPnVuhGkZfmgHqNUhf15VLi6L9kW0VEc0= github.com/pointlander/jetset v1.0.1-0.20190518214125-eee7eff80bd4/go.mod h1:RdR1j20Aj5pB6+fw6Y9Ur7lMHpegTEjY1vc19hEZL40= github.com/pointlander/peg v1.0.1/go.mod h1:5hsGDQR2oZI4QoWz0/Kdg3VSVEC31iJw/b7WjqCBGRI= @@ -2530,8 +2499,8 @@ github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrb github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -2539,8 +2508,9 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= @@ -2558,8 +2528,8 @@ github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -2576,8 +2546,8 @@ github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in3v/bX88wUwgt+U8EA= github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= @@ -2611,15 +2581,15 @@ github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= 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/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -2640,8 +2610,8 @@ github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= -github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= -github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= +github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= +github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= @@ -2664,6 +2634,10 @@ github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43 github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= github.com/sagikazarmark/crypt v0.8.0/go.mod h1:TmKwZAo97S4Fy4sfMH/HX/cQP5D+ijra2NyLpNNmttY= +github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= +github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= @@ -2692,9 +2666,6 @@ github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+f github.com/securego/gosec/v2 v2.13.1/go.mod h1:EO1sImBMBWFjOTFzMWfTRrZW6M15gm60ljzrmy/wtHo= github.com/securego/gosec/v2 v2.16.0 h1:Pi0JKoasQQ3NnoRao/ww/N/XdynIB9NRYYZT5CyOs5U= github.com/securego/gosec/v2 v2.16.0/go.mod h1:xvLcVZqUfo4aAQu56TNv7/Ltz6emAOQAEsrZrt7uGlI= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -2702,7 +2673,6 @@ github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= github.com/shirou/gopsutil/v3 v3.22.7/go.mod h1:s648gW4IywYzUfE/KjXxUsqrqx/T2xO5VqOXxONeRfI= github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A= @@ -2744,6 +2714,8 @@ github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4l github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak= github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= @@ -2758,8 +2730,8 @@ github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY52 github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -2778,10 +2750,9 @@ github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -2800,11 +2771,10 @@ github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUs github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= +github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= @@ -2826,7 +2796,6 @@ github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRci github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -2839,15 +2808,14 @@ github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg6KO+IebVyQDedZQ= github.com/sylvia7788/contextcheck v1.0.6/go.mod h1:9XDxwvxyuKD+8N+a7Gs7bfWLityh5t70g/GjdEt2N2M= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -2861,8 +2829,9 @@ github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cb github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tdakkota/asciicheck v0.1.1 h1:PKzG7JUTUmVspQTDqtkX9eSiLGossXTybutHwTXuO0A= github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= +github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= +github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= @@ -2882,30 +2851,24 @@ github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQx github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e h1:MV6KaVu/hzByHP0UvJ4HcMGE/8a6A4Rggc/0wx2AvJo= github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= -github.com/timonwong/loggercheck v0.9.3 h1:ecACo9fNiHxX4/Bc02rW2+kaJIAMAes7qJ7JKxt0EZI= github.com/timonwong/loggercheck v0.9.3/go.mod h1:wUqnk9yAOIKtGA39l1KLE9Iz0QiTocu/YZoOf+OzFdw= +github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= +github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= github.com/timonwong/logrlint v0.1.0/go.mod h1:Zleg4Gw+kRxNej+Ra7o+tEaW5k1qthTaYKU7rSD39LU= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0= github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -2914,8 +2877,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1 github.com/tomarrell/wrapcheck/v2 v2.6.1/go.mod h1:Eo+Opt6pyMW1b6cNllOcDSSoHO0aTJ+iF6BfCUbHltA= github.com/tomarrell/wrapcheck/v2 v2.6.2/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= github.com/tomarrell/wrapcheck/v2 v2.7.0/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= -github.com/tomarrell/wrapcheck/v2 v2.8.0 h1:qDzbir0xmoE+aNxGCPrn+rUSxAX+nG6vREgbbXAR81I= -github.com/tomarrell/wrapcheck/v2 v2.8.0/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= +github.com/tomarrell/wrapcheck/v2 v2.8.1 h1:HxSqDSN0sAt0yJYsrcYVoEeyM4aI9yAm3KQpIXDJRhQ= +github.com/tomarrell/wrapcheck/v2 v2.8.1/go.mod h1:/n2Q3NZ4XFT50ho6Hbxg+RV1uyo2Uow/Vdm9NQcl5SE= github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= @@ -2932,8 +2895,7 @@ github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+l github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= @@ -2941,7 +2903,8 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -2959,7 +2922,6 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= github.com/uudashr/gocognit v1.0.6 h1:2Cgi6MweCsdB6kpcVQp7EW4U23iBFQWfTXiWlyp842Y= @@ -2967,8 +2929,6 @@ github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Usc github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= @@ -2985,10 +2945,7 @@ github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmF github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= @@ -3001,12 +2958,10 @@ github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= -github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= @@ -3038,8 +2993,9 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= @@ -3139,20 +3095,21 @@ go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpK go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= @@ -3162,6 +3119,7 @@ go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -3179,7 +3137,6 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -3190,7 +3147,6 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= @@ -3201,14 +3157,12 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220313003712-b769efc7c000/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -3221,8 +3175,8 @@ golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80 golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -3244,15 +3198,15 @@ golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZ golang.org/x/exp v0.0.0-20230131160201-f062dba9d201/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20230213192124-5e25df0256eb h1:WGs/bGIWYyAY5PVgGGMXqGGCxSJz4fpoUExb/vgqNCU= -golang.org/x/exp/typeparams v0.0.0-20230213192124-5e25df0256eb/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 h1:J74nGeMgeFnYQJN59eFwh06jX/V8g0lB7LWpjSLxtgU= +golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -3288,8 +3242,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -3342,7 +3296,6 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -3350,7 +3303,6 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -3396,8 +3348,8 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -3433,8 +3385,8 @@ golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -3454,8 +3406,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -3489,7 +3441,6 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3508,7 +3459,6 @@ golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3534,7 +3484,6 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3561,12 +3510,10 @@ golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210313202042-bd2e13477e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3641,8 +3588,9 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -3658,8 +3606,8 @@ golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -3676,15 +3624,14 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -3695,7 +3642,6 @@ golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -3747,7 +3693,6 @@ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -3826,8 +3771,8 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= 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= @@ -3838,11 +3783,8 @@ golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNq 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.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= @@ -3916,8 +3858,8 @@ google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4q google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= -google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/api v0.149.0 h1:b2CqT6kG+zqJIVKRQ3ELJVLN1PwHZ6DJ3dW8yl82rgY= +google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -3927,8 +3869,9 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -3944,7 +3887,6 @@ google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -3953,7 +3895,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -3963,6 +3904,7 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -4078,12 +4020,12 @@ google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= -google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 h1:Au6te5hbKUV8pIYWHqOUZ1pva5qK/rwbIhoXEUB9Lu8= -google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= -google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 h1:s5YSX+ZH5b5vS9rnpGymvIyMpLRJizowqDlOuyjXnTk= -google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -4138,8 +4080,8 @@ google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsA google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -4160,8 +4102,8 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230208135220-49eaa78c6c9c/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -4190,15 +4132,12 @@ gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -4219,7 +4158,6 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 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.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= @@ -4227,7 +4165,8 @@ gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -4239,7 +4178,6 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= honnef.co/go/tools v0.3.1/go.mod h1:vlRD9XErLMGT+mDuofSr0mMMquscM/1nQqtRSsh6m70= honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= honnef.co/go/tools v0.4.3 h1:o/n5/K5gXqk8Gozvs2cnL0F2S1/g1vcGCAx2vETjITw= @@ -4346,13 +4284,13 @@ pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= pgregory.net/rapid v0.5.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/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= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= @@ -4366,8 +4304,9 @@ sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZa sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4= diff --git a/proto/amino/amino.proto b/proto/amino/amino.proto new file mode 100644 index 000000000..fb099b8ee --- /dev/null +++ b/proto/amino/amino.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; + +package amino; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; + +extend google.protobuf.MessageOptions { + // name is the string used when registering a concrete + // type into the Amino type registry, via the Amino codec's + // `RegisterConcrete()` method. This string MUST be at most 39 + // characters long, or else the message will be rejected by the + // Ledger hardware device. + string name = 11110001; + + // encoding describes the encoding format used by Amino for the given + // message. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the `encoding` + // one which operates on the field level. + string message_encoding = 11110002; +} + +extend google.protobuf.FieldOptions { + // encoding describes the encoding format used by Amino for + // the given field. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the + // `message_encoding` one which operates on the message level. + string encoding = 11110003; + + // field_name sets a different field name (i.e. key name) in + // the amino JSON object for the given field. + // + // Example: + // + // message Foo { + // string bar = 1 [(amino.field_name) = "baz"]; + // } + // + // Then the Amino encoding of Foo will be: + // `{"baz":"some value"}` + string field_name = 11110004; + + // dont_omitempty sets the field in the JSON object even if + // its value is empty, i.e. equal to the Golang zero value. To learn what + // the zero values are, see https://go.dev/ref/spec#The_zero_value. + // + // Fields default to `omitempty`, which is the default behavior when this + // annotation is unset. When set to true, then the field value in the + // JSON object will be set, i.e. not `undefined`. + // + // Example: + // + // message Foo { + // string bar = 1; + // string baz = 2 [(amino.dont_omitempty) = true]; + // } + // + // f := Foo{}; + // out := AminoJSONEncoder(&f); + // out == {"baz":""} + bool dont_omitempty = 11110005; + + // oneof_name sets the type name for the given field oneof field. This is used + // by the Amino JSON encoder to encode the type of the oneof field, and must be the same string in + // the RegisterConcrete() method usage used to register the concrete type. + string oneof_name = 11110006; +} \ No newline at end of file diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml index 9c8ba0a4b..e3cd0b1ac 100644 --- a/proto/buf.gen.gogo.yaml +++ b/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mcosmos/orm/v1/orm.proto=cosmossdk.io/orm - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/proto/comdex/asset/v1beta1/app.proto b/proto/comdex/asset/v1beta1/app.proto index d04fbad94..2bd43127c 100644 --- a/proto/comdex/asset/v1beta1/app.proto +++ b/proto/comdex/asset/v1beta1/app.proto @@ -13,7 +13,7 @@ message AppData { string short_name = 3 [(gogoproto.moretags) = "yaml:\"short_name\""]; string min_gov_deposit = 4 [ (gogoproto.moretags) = "yaml:\"min_gov_deposit\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; uint64 gov_time_in_seconds = 5 [(gogoproto.moretags) = "yaml:\"gov_time_in_seconds\""]; repeated MintGenesisToken genesis_token = 6 [(gogoproto.moretags) = "yaml:\"genesis_token\"", @@ -22,7 +22,7 @@ message AppData { message MintGenesisToken { uint64 asset_id = 1 [(gogoproto.moretags) = "yaml:\"asset_id\""]; - string genesis_supply = 2[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + string genesis_supply = 2[(gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; bool is_gov_token = 3 [(gogoproto.moretags) = "yaml:\"is_gov_token\""]; string recipient = 4 [(gogoproto.moretags) = "yaml:\"recipient\""]; @@ -33,6 +33,6 @@ message AppAndGovTime { uint64 gov_time_in_seconds = 2 [(gogoproto.moretags) = "yaml:\"gov_time_in_seconds\""]; string min_gov_deposit = 3 [ (gogoproto.moretags) = "yaml:\"min_gov_deposit\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } \ No newline at end of file diff --git a/proto/comdex/asset/v1beta1/asset.proto b/proto/comdex/asset/v1beta1/asset.proto index 3408a5ba4..4933824f6 100644 --- a/proto/comdex/asset/v1beta1/asset.proto +++ b/proto/comdex/asset/v1beta1/asset.proto @@ -13,7 +13,7 @@ message Asset { string denom = 3 [(gogoproto.moretags) = "yaml:\"denom\""]; string decimals = 4 [ (gogoproto.moretags) = "yaml:\"decimals\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; bool is_on_chain = 5 [(gogoproto.moretags) = "yaml:\"is_on_chain\""]; bool is_oracle_price_required = 6 [(gogoproto.moretags) = "yaml:\"is_oracle_price_required\""]; diff --git a/proto/comdex/asset/v1beta1/extendedPairVault.proto b/proto/comdex/asset/v1beta1/extendedPairVault.proto index 38ef39e98..257c13346 100644 --- a/proto/comdex/asset/v1beta1/extendedPairVault.proto +++ b/proto/comdex/asset/v1beta1/extendedPairVault.proto @@ -13,40 +13,40 @@ message ExtendedPairVault { uint64 app_id = 2 [(gogoproto.moretags) = "yaml:\"app_id\""]; uint64 pair_id = 3 [(gogoproto.moretags) = "yaml:\"pair_id\""]; string stability_fee = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stability_fee\"" ]; string closing_fee = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"closing_fee\"" ]; string liquidation_penalty = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_penalty\"" ]; string draw_down_fee = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"draw_down_fee\""]; bool is_vault_active = 8 [(gogoproto.moretags) = "yaml:\"active_flag\""]; string debt_ceiling = 9[ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"debt_ceiling\""]; string debt_floor = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"debt_floor\"" ]; bool is_stable_mint_vault = 11[(gogoproto.moretags) = "yaml:\"is_stable_mint_vault\""]; string min_cr = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"min_cr\"" ]; diff --git a/proto/comdex/asset/v1beta1/pair.proto b/proto/comdex/asset/v1beta1/pair.proto index 53cba04d5..5e30c6daa 100644 --- a/proto/comdex/asset/v1beta1/pair.proto +++ b/proto/comdex/asset/v1beta1/pair.proto @@ -27,7 +27,7 @@ message AssetPair { string denom = 3 [(gogoproto.moretags) = "yaml:\"denom\""]; string decimals = 4 [ (gogoproto.moretags) = "yaml:\"decimals\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; bool is_on_chain = 5 [(gogoproto.moretags) = "yaml:\"is_on_chain\""]; bool is_oracle_price_required = 6 [(gogoproto.moretags) = "yaml:\"is_oracle_price_required\""]; diff --git a/proto/comdex/auction/v1beta1/auction.proto b/proto/comdex/auction/v1beta1/auction.proto index b58736355..dc34994bf 100644 --- a/proto/comdex/auction/v1beta1/auction.proto +++ b/proto/comdex/auction/v1beta1/auction.proto @@ -45,7 +45,7 @@ message SurplusAuction { ]; string bid_factor = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bid_factor\"" ]; @@ -131,7 +131,7 @@ message DebtAuction { (gogoproto.moretags) = "yaml:\"auction_mapping_id\"" ]; string bid_factor = 14 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bid_factor\"" ]; @@ -174,22 +174,22 @@ message DutchAuction { (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; string outflow_token_initial_price = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_initial_price\"" ]; string outflow_token_current_price = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_current_price\"" ]; string outflow_token_end_price = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_end_price\"" ]; string inflow_token_current_price = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"inflow_token_current_price\"" ]; @@ -230,7 +230,7 @@ message DutchAuction { (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" ]; string liquidation_penalty = 20 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidatin_penalty\"" ]; @@ -249,7 +249,7 @@ message ProtocolStatistics { (gogoproto.moretags) = "yaml:\"asset_id\"" ]; string loss = 3[ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"loss\"" ]; @@ -263,17 +263,17 @@ message AuctionParams{ (gogoproto.moretags) = "yaml:\"auction_duration_seconds\"" ]; string buffer = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"buffer\"" ]; string cusp = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"cusp\"" ]; string step = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"step\"" ]; diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 29958468e..fd0f9745d 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -46,18 +46,18 @@ message Auction{ // price indicator only for dutch auctions string collateral_token_auction_price = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_auction_price\"" ]; string collateral_token_oracle_price = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_oracle_price\"" ]; string debt_token_oracle_price = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"inflow_token_oracle_price\"" ]; @@ -91,11 +91,11 @@ message Auction{ string bonus_amount = 17 [ (gogoproto.moretags) = "yaml:\"bonus_amount\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string collateral_token_initial_price = 18 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"collateral_token_initial_price\"" ]; @@ -117,11 +117,11 @@ message LimitBidProtocolData{ string bid_value = 3 [ (gogoproto.moretags) = "yaml:\"bid_value\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string max_discount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"max_discount\"" ]; @@ -137,11 +137,11 @@ message LimitBidProtocolDataForQuery{ string bid_value = 3 [ (gogoproto.moretags) = "yaml:\"bid_value\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string max_discount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"max_discount\"" ]; @@ -163,11 +163,11 @@ message LimitBidProtocolDataWithUserForQuery{ string bid_value = 3 [ (gogoproto.moretags) = "yaml:\"bid_value\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string max_discount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"max_discount\"" ]; @@ -180,6 +180,6 @@ message LimitBidProtocolDataWithUserForQuery{ string user_bid_value = 7 [ (gogoproto.moretags) = "yaml:\"user_bid_value\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } \ No newline at end of file diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 22e820f67..68171a019 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -60,7 +60,7 @@ message LimitOrderBid{ (gogoproto.moretags) = "yaml:\"collateral_token_id\"" ]; string premium_discount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"premium_discount\"" ]; @@ -93,17 +93,17 @@ message AuctionParams{ (gogoproto.moretags) = "yaml:\"auction_duration_seconds\"" ]; string step = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"step\"" ]; string withdrawal_fee = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"withdrawal_fee\"" ]; string closing_fee = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"closing_fee\"" ]; @@ -111,19 +111,19 @@ message AuctionParams{ (gogoproto.moretags) = "yaml:\"min_usd_value_left\"" ]; string bid_factor = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bid_factor\"" ]; //For external apps string liquidation_penalty = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_penalty\"" ]; string auction_bonus = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"auction_bonus\"" ]; @@ -150,7 +150,7 @@ message LimitOrderUserKey{ (gogoproto.moretags) = "yaml:\"collateral_token_id\"" ]; string premium_discount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"premium_discount\"" ]; @@ -163,7 +163,7 @@ message AuctionFeesCollectionFromLimitBidTx{ uint64 asset_id = 1 [ (gogoproto.moretags) = "yaml:\"asset_id\""]; string amount = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"amount\"" ]; diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index 16382ca10..20fc6920a 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -86,7 +86,7 @@ message QueryUserLimitBidsByAssetIDResponse { string total_amount = 2 [ (gogoproto.moretags) = "yaml:\"total_amount\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; repeated LimitOrderBid limit_order_bids = 3 [ (gogoproto.nullable) = false, diff --git a/proto/comdex/auctionsV2/v1beta1/tx.proto b/proto/comdex/auctionsV2/v1beta1/tx.proto index cf9539dae..54ebe6793 100644 --- a/proto/comdex/auctionsV2/v1beta1/tx.proto +++ b/proto/comdex/auctionsV2/v1beta1/tx.proto @@ -25,7 +25,7 @@ message MsgDepositLimitBidRequest { string premium_discount = 3 [ (gogoproto.moretags) = "yaml:\"premium_discount\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string bidder = 4; cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; @@ -39,7 +39,7 @@ message MsgCancelLimitBidRequest { string premium_discount = 3 [ (gogoproto.moretags) = "yaml:\"premium_discount\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string bidder = 4; } @@ -52,7 +52,7 @@ message MsgWithdrawLimitBidRequest { string premium_discount = 3 [ (gogoproto.moretags) = "yaml:\"premium_discount\"", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string bidder = 4; cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; diff --git a/proto/comdex/collector/v1beta1/collector.proto b/proto/comdex/collector/v1beta1/collector.proto index a53f44cbc..125551a25 100644 --- a/proto/comdex/collector/v1beta1/collector.proto +++ b/proto/comdex/collector/v1beta1/collector.proto @@ -11,22 +11,22 @@ message CollectorData { string collected_stability_fee = 1 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"collected_stability_fee\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string collected_closing_fee = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"collected_closing_fee\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string collected_opening_fee = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"collected_opening_fee\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string liquidation_rewards_collected = 4 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_rewards_collected\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } @@ -37,7 +37,7 @@ message AppAssetIdToFeeCollectedData { string net_fees_collected = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"net_fees_collected\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } @@ -53,28 +53,28 @@ message CollectorLookupTableData { uint64 collector_asset_id = 2 [(gogoproto.moretags) = "yaml:\"collector_asset_id\""]; uint64 secondary_asset_id = 3 [(gogoproto.moretags) = "yaml:\"secondary_asset_id\""]; string surplus_threshold = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"surplus_threshold\""]; string debt_threshold = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"debt_threshold\""]; string locker_saving_rate = 6 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"locker_saving_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec"]; string lot_size = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"lot_size\""]; string bid_factor = 8 [ (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.moretags) = "yaml:\"bid_factor\"" ]; string debt_lot_size = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"debt_lot_size\""]; diff --git a/proto/comdex/esm/v1beta1/esm.proto b/proto/comdex/esm/v1beta1/esm.proto index 453d669f0..df7af5560 100644 --- a/proto/comdex/esm/v1beta1/esm.proto +++ b/proto/comdex/esm/v1beta1/esm.proto @@ -112,10 +112,10 @@ message UsersDepositMapping{ message DataAfterCoolOff { uint64 appId = 1 [ (gogoproto.moretags) = "yaml:\"appId\"" ]; string collateral_total_amount = 2 [(gogoproto.moretags) = "yaml:\"collateral_total_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false]; string debt_total_amount = 3 [(gogoproto.moretags) = "yaml:\"debt_total_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false]; } @@ -126,17 +126,17 @@ message AssetToAmount { (gogoproto.moretags) = "yaml:\"asset_id\"" ]; string amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; string share = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"share\"" ]; string debt_token_worth = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.moretags) = "yaml:\"debt_token_worth\"", (gogoproto.nullable) = false ]; diff --git a/proto/comdex/lend/v1beta1/lend.proto b/proto/comdex/lend/v1beta1/lend.proto index c9eca31ee..92a2ad16e 100644 --- a/proto/comdex/lend/v1beta1/lend.proto +++ b/proto/comdex/lend/v1beta1/lend.proto @@ -38,14 +38,14 @@ message LendAsset { string available_to_borrow = 7 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"available_to_borrow\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; uint64 app_id = 8 [(gogoproto.customname) = "AppID", (gogoproto.moretags) = "yaml:\"app_id\""]; string global_index = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"global_index\"" ]; @@ -63,7 +63,7 @@ message LendAsset { string total_rewards = 12 [ (gogoproto.moretags) = "yaml:\"total_rewards\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } @@ -112,7 +112,7 @@ message BorrowAsset { ]; string stable_borrow_rate = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_borrow_rate\"" ]; @@ -120,16 +120,16 @@ message BorrowAsset { string interest_accumulated = 10 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interest_accumulated\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec" ]; string global_index = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"global_index\"" ]; string reserve_global_index = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"reserve_global_index\"" ]; @@ -167,7 +167,7 @@ message Pool { ]; // string reserve_funds = 4 [ - // (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + // (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", // (gogoproto.nullable) = false, // (gogoproto.moretags) = "yaml:\"reserve_funds\"" // ]; @@ -197,7 +197,7 @@ message AssetDataPoolMapping{ (gogoproto.moretags) = "yaml:\"asset_transit_type\"" ]; string supply_cap = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"supply_cap\"" ]; @@ -254,45 +254,45 @@ message PoolAssetLBMapping{//AssetStats string total_borrowed = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"total_borrowed\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string total_stable_borrowed = 6 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"total_stable_borrowed\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string total_lend = 7 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"total_lend\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string total_interest_accumulated = 8 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"total_interest_accumulated\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string lend_apr = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"lend_apr\"" ]; string borrow_apr = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"borrow_apr\"" ]; string stable_borrow_apr = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_borrow_apr\"" ]; string utilisation_ratio = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"utilisation_ratio\"" ]; @@ -304,22 +304,22 @@ message AssetRatesParams{//AssetRatesStats (gogoproto.moretags) = "yaml:\"asset_id\"" ]; string u_optimal = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"u_optimal\"" ]; string base = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"base\"" ]; string slope1 = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"slope1\"" ]; string slope2 = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"slope2\"" ]; @@ -327,42 +327,42 @@ message AssetRatesParams{//AssetRatesStats (gogoproto.moretags) = "yaml:\"enable_stable_borrow\"" ]; string stable_base = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_base\"" ]; string stable_slope1 = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_slope1\"" ]; string stable_slope2 = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_slope2\"" ]; string ltv = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ltv\"" ]; string liquidation_threshold = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_threshold\"" ]; string liquidation_penalty = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_penalty\"" ]; string liquidation_bonus = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_bonus\"" ]; string reserve_factor = 14 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"reserve_factor\"" ]; @@ -374,17 +374,17 @@ message AssetRatesParams{//AssetRatesStats (gogoproto.moretags) = "yaml:\"is_isolated\"" ]; string e_ltv = 17 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"e_ltv\"" ]; string e_liquidation_threshold = 18 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"e_liquidation_threshold\"" ]; string e_liquidation_penalty = 19 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"e_liquidation_penalty\"" ]; @@ -398,12 +398,12 @@ message ReserveBuybackAssetData{// BalanceStats string reserve_amount = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"reserve_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string buyback_amount = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"buyback_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } @@ -415,17 +415,17 @@ message AuctionParams{ (gogoproto.moretags) = "yaml:\"auction_duration_seconds\"" ]; string buffer = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"buffer\"" ]; string cusp = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"cusp\"" ]; string step = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"step\"" ]; @@ -445,7 +445,7 @@ message Borrow_interest_tracker{ (gogoproto.moretags) = "yaml:\"borrowing_id\"" ]; string reserve_pool_interest = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"reserve_pool_interest\"" ]; @@ -456,7 +456,7 @@ message Lend_rewards_tracker{ (gogoproto.moretags) = "yaml:\"lending_id\"" ]; string rewards_accumulated = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interest_accumulated\"" ]; @@ -557,31 +557,31 @@ message AllReserveStats { string amount_out_from_reserve_to_lenders = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"amount_out_from_reserve_to_lenders\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string amount_out_from_reserve_for_auction = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"amount_out_from_reserve_for_auction\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string amount_in_from_liq_penalty = 4 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"amount_in_from_liq_penalty\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string amount_in_from_repayments = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"amount_in_from_repayments\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; string total_amount_out_to_lenders = 6 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"total_amount_out_to_lenders\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } @@ -633,7 +633,7 @@ message PoolInterestData { string lend_interest = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"lend_interest\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } @@ -657,7 +657,7 @@ message PoolInterestDataB { string borrow_interest = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"borrow_interest\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; } @@ -679,22 +679,22 @@ message AssetRatesPoolPairs { (gogoproto.moretags) = "yaml:\"asset_id\"" ]; string u_optimal = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"u_optimal\"" ]; string base = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"base\"" ]; string slope1 = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"slope1\"" ]; string slope2 = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"slope2\"" ]; @@ -702,42 +702,42 @@ message AssetRatesPoolPairs { (gogoproto.moretags) = "yaml:\"enable_stable_borrow\"" ]; string stable_base = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_base\"" ]; string stable_slope1 = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_slope1\"" ]; string stable_slope2 = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_slope2\"" ]; string ltv = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ltv\"" ]; string liquidation_threshold = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_threshold\"" ]; string liquidation_penalty = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_penalty\"" ]; string liquidation_bonus = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_bonus\"" ]; string reserve_factor = 14 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"reserve_factor\"" ]; @@ -798,17 +798,17 @@ message EModePairs { (gogoproto.moretags) = "yaml:\"pair_id\"" ]; string e_ltv = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"e_ltv\"" ]; string e_liquidation_threshold = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"e_liquidation_threshold\"" ]; string e_liquidation_penalty = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"e_liquidation_penalty\"" ]; diff --git a/proto/comdex/liquidation/v1beta1/locked_vault.proto b/proto/comdex/liquidation/v1beta1/locked_vault.proto index 9be02cc8c..c97524706 100644 --- a/proto/comdex/liquidation/v1beta1/locked_vault.proto +++ b/proto/comdex/liquidation/v1beta1/locked_vault.proto @@ -32,13 +32,13 @@ message LockedVault { string amount_in = 6 [ (gogoproto.customname) = "AmountIn", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount_in\"", (gogoproto.nullable) = false]; string amount_out = 7 [ (gogoproto.customname) = "AmountOut", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount_out\"", (gogoproto.nullable) = false]; @@ -46,7 +46,7 @@ message LockedVault { // + closing_fee_accumulated string updated_amount_out = 8 [ (gogoproto.customname) = "UpdatedAmountOut", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"updated_amount_out\"", (gogoproto.nullable) = false]; @@ -64,20 +64,20 @@ message LockedVault { string cr_at_liquidation = 12 [ (gogoproto.customname) = "CrAtLiquidation", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"cr_at_liquidation\""]; string current_collateralisation_ratio = 13 [ (gogoproto.customname) = "CurrentCollaterlisationRatio", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_collateralisation_ratio\""]; string collateral_to_be_auctioned = 14 [ (gogoproto.nullable) = false, (gogoproto.customname) = "CollateralToBeAuctioned", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.moretags) = "yaml:\"collateral_to_be_auctioned\""]; google.protobuf.Timestamp liquidation_timestamp = 15 [ @@ -91,7 +91,7 @@ message LockedVault { (gogoproto.moretags) = "yaml:\"selloff_history\""]; string interest_accumulated = 17[ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"interest_accumulated\"", (gogoproto.nullable) = false]; oneof kind { @@ -103,7 +103,7 @@ message BorrowMetaData { uint64 lending_id = 1; bool is_stable_borrow = 2; string stable_borrow_rate = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"stable_borrow_rate\"" ]; diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 3e4ec5f8e..9cb56aea2 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -43,7 +43,7 @@ message LiquidationWhiteListing { //One thing to keep in mind that somehow it should not happen that a void is created where something at level 2 gets triggerred and it has no data saved a level 1 for lookup and it fails . string keeeper_incentive = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"keeper_incentive\"" ]; @@ -91,17 +91,17 @@ message AssetTxData{ message DutchAuctionParam{ string premium = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"premium\"" ]; string discount = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"discount\"" ]; string decrement_factor = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"decrement_factor\"" ]; @@ -110,7 +110,7 @@ message DutchAuctionParam{ message EnglishAuctionParam{ string decrement_factor = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"decrement_factor\"" ]; @@ -163,7 +163,7 @@ message LockedVault { string current_collateralisation_ratio = 8 [ (gogoproto.customname) = "CurrentCollaterlisationRatio", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_collateralisation_ratio\""]; @@ -204,12 +204,12 @@ message LockedVault { string fee_to_be_collected = 16 [ (gogoproto.customname) = "FeeToBeCollected", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; string bonus_to_be_given = 17 [ (gogoproto.customname) = "BonusToBeGiven", (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"bonus_to_be_given\""]; string initiator_type = 18 [ diff --git a/proto/comdex/liquidity/v1beta1/params.proto b/proto/comdex/liquidity/v1beta1/params.proto index 162fb4477..5223fecd2 100644 --- a/proto/comdex/liquidity/v1beta1/params.proto +++ b/proto/comdex/liquidity/v1beta1/params.proto @@ -45,13 +45,13 @@ message GenericParams { [(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false]; uint64 deposit_extra_gas = 13 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Gas", (gogoproto.nullable) = false]; + [(gogoproto.customtype) = "cosmossdk.io/store.Gas", (gogoproto.nullable) = false]; uint64 withdraw_extra_gas = 14 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Gas", (gogoproto.nullable) = false]; + [(gogoproto.customtype) = "cosmossdk.io/store.Gas", (gogoproto.nullable) = false]; uint64 order_extra_gas = 15 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Gas", (gogoproto.nullable) = false]; + [(gogoproto.customtype) = "cosmossdk.io/store.Gas", (gogoproto.nullable) = false]; string swap_fee_distr_denom = 16; diff --git a/proto/comdex/locker/v1beta1/locker.proto b/proto/comdex/locker/v1beta1/locker.proto index f2c824b43..2ad31dc46 100644 --- a/proto/comdex/locker/v1beta1/locker.proto +++ b/proto/comdex/locker/v1beta1/locker.proto @@ -17,12 +17,12 @@ message Locker { (gogoproto.moretags) = "yaml:\"depositor\"" ]; string returns_accumulated = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"returns_accumulated\"", (gogoproto.nullable) = false ]; string net_balance = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"net_balance\"", (gogoproto.nullable) = false ]; @@ -68,12 +68,12 @@ message UserAppAssetLockerMapping{ message UserTxData{ string tx_type =1 [(gogoproto.moretags) = "yaml:\"tx_type\""]; string amount = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; string balance = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"balance\"", (gogoproto.nullable) = false ]; @@ -92,7 +92,7 @@ message LockerLookupTableData { (gogoproto.moretags) = "yaml:\"addresses\"" ]; string deposited_amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"deposited_amount\"", (gogoproto.nullable) = false ]; @@ -113,7 +113,7 @@ message LockedDepositedAmountDataMap { uint64 asset_id = 1 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ]; string deposited_amount= 2 [ (gogoproto.moretags) = "yaml:\"deposited_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } @@ -121,6 +121,6 @@ message LockerTotalRewardsByAssetAppWise { uint64 app_id = 1 [ (gogoproto.moretags) = "yaml:\"app_id\"" ]; uint64 asset_id = 2 [ (gogoproto.moretags) = "yaml:\"asset_id\"" ]; string total_rewards= 3 [ (gogoproto.moretags) = "yaml:\"total_rewards\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } diff --git a/proto/comdex/locker/v1beta1/tx.proto b/proto/comdex/locker/v1beta1/tx.proto index 86967d1a7..52887c2cd 100644 --- a/proto/comdex/locker/v1beta1/tx.proto +++ b/proto/comdex/locker/v1beta1/tx.proto @@ -22,7 +22,7 @@ message MsgCreateLockerRequest{ string depositor = 1 [(gogoproto.moretags) = "yaml:\"depositor\""]; string amount = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; @@ -62,7 +62,7 @@ message MsgDepositAssetRequest { uint64 locker_id = 2[ (gogoproto.moretags) = "yaml:\"locker_id\""]; string amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false @@ -86,7 +86,7 @@ message MsgWithdrawAssetRequest { [ (gogoproto.moretags) = "yaml:\"locker_id\""]; string amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false diff --git a/proto/comdex/rewards/v1beta1/query.proto b/proto/comdex/rewards/v1beta1/query.proto index eec8b7920..1725ec93e 100644 --- a/proto/comdex/rewards/v1beta1/query.proto +++ b/proto/comdex/rewards/v1beta1/query.proto @@ -234,7 +234,7 @@ message QueryExtLendRewardsAPRRequest { } message QueryExtLendRewardsAPRResponse { string apr = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ext_rewards_lend_apr\"" ]; diff --git a/proto/comdex/rewards/v1beta1/rewards.proto b/proto/comdex/rewards/v1beta1/rewards.proto index bb038332f..587a5f6f2 100644 --- a/proto/comdex/rewards/v1beta1/rewards.proto +++ b/proto/comdex/rewards/v1beta1/rewards.proto @@ -24,7 +24,7 @@ message LockerRewardsTracker{ (gogoproto.moretags) = "yaml:\"app_mapping_id\"" ]; string rewards_accumulated = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards_accumulated\"" ]; @@ -38,7 +38,7 @@ message VaultInterestTracker{ (gogoproto.moretags) = "yaml:\"app_mapping_id\"" ]; string interest_accumulated = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interest_accumulated\"" ]; diff --git a/proto/comdex/tokenmint/v1beta1/mint.proto b/proto/comdex/tokenmint/v1beta1/mint.proto index c94b4af13..9c96db362 100644 --- a/proto/comdex/tokenmint/v1beta1/mint.proto +++ b/proto/comdex/tokenmint/v1beta1/mint.proto @@ -21,7 +21,7 @@ message TokenMint{ message MintedTokens{ uint64 asset_id = 1 [(gogoproto.moretags) = "yaml:\"asset_id\""]; string genesis_supply = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"genesis_supply\"", (gogoproto.nullable) = false ]; @@ -31,7 +31,7 @@ message MintedTokens{ (gogoproto.moretags) = "yaml:\"created_at\"" ]; string current_supply = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"current_supply\"", (gogoproto.nullable) = false ]; diff --git a/proto/comdex/vault/v1beta1/query.proto b/proto/comdex/vault/v1beta1/query.proto index 9e255e093..15acc44a2 100644 --- a/proto/comdex/vault/v1beta1/query.proto +++ b/proto/comdex/vault/v1beta1/query.proto @@ -20,32 +20,32 @@ message VaultInfo{ string collateral = 4 [ (gogoproto.moretags) = "yaml:\"collateral\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string debt = 5 [ (gogoproto.moretags) = "yaml:\"debt\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string collateralization_ratio = 6 [ (gogoproto.moretags) = "yaml:\"collateralization_ratio\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string extended_pair_name = 7 [(gogoproto.moretags) = "yaml:\"extended_pair_name\""]; string interest_rate = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interest_rate\"" ]; string asset_in_denom = 9 [(gogoproto.moretags) = "yaml:\"asset_in_denom\""]; string asset_out_denom = 10 [(gogoproto.moretags) = "yaml:\"asset_out_denom\""]; string min_cr = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"min_cr\"" ]; @@ -182,7 +182,7 @@ message QueryTokenMintedByAppAndExtendedPairRequest { message QueryTokenMintedByAppAndExtendedPairResponse { string token_minted = 1 [ (gogoproto.moretags) = "yaml:\"token_minted\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } @@ -229,7 +229,7 @@ message QueryTotalValueLockedByAppAndExtendedPairRequest { message QueryTotalValueLockedByAppAndExtendedPairResponse { string value_locked = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; + (gogoproto.customtype) = "cosmossdk.io/math.Int"]; } message QueryExtendedPairIDsByAppRequest { @@ -314,7 +314,7 @@ message QueryTVLByAppRequest { message QueryTVLByAppResponse { string collateral_locked = 1 [(gogoproto.moretags) = "yaml:\"collateral_locked\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } @@ -326,19 +326,19 @@ message QueryUserMyPositionByAppRequest { message QueryUserMyPositionByAppResponse { string collateral_locked = 1 [(gogoproto.moretags) = "yaml:\"collateral_locked\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; string total_due = 2 [(gogoproto.moretags) = "yaml:\"total_due\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; string available_to_borrow = 3 [ (gogoproto.moretags) = "yaml:\"available_to_borrow\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string average_cr_ratio = 4 [ (gogoproto.moretags) = "yaml:\"average_cr_ratio\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } diff --git a/proto/comdex/vault/v1beta1/tx.proto b/proto/comdex/vault/v1beta1/tx.proto index c9cdca40f..82d029992 100644 --- a/proto/comdex/vault/v1beta1/tx.proto +++ b/proto/comdex/vault/v1beta1/tx.proto @@ -15,12 +15,12 @@ message MsgCreateRequest { (gogoproto.moretags) = "yaml:\"extended_pair_vault_id\"" ]; string amount_in = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount_in\"", (gogoproto.nullable) = false ]; string amount_out = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount_out\"", (gogoproto.nullable) = false ]; @@ -39,7 +39,7 @@ message MsgDepositRequest { uint64 user_vault_id = 4 [ (gogoproto.moretags) = "yaml:\"user_vault_id\"" ]; string amount = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; @@ -56,7 +56,7 @@ message MsgWithdrawRequest { uint64 user_vault_id = 4 [ (gogoproto.moretags) = "yaml:\"user_vault_id\"" ]; string amount = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; @@ -73,7 +73,7 @@ message MsgDrawRequest { uint64 user_vault_id = 4 [ (gogoproto.moretags) = "yaml:\"user_vault_id\"" ]; string amount = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; @@ -90,7 +90,7 @@ message MsgRepayRequest { uint64 user_vault_id = 4 [ (gogoproto.moretags) = "yaml:\"user_vault_id\"" ]; string amount = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; @@ -119,7 +119,7 @@ message MsgDepositAndDrawRequest { uint64 user_vault_id = 4 [ (gogoproto.moretags) = "yaml:\"user_vault_id\"" ]; string amount = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; @@ -134,7 +134,7 @@ message MsgCreateStableMintRequest { (gogoproto.moretags) = "yaml:\"extended_pair_vault_id\"" ]; string amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"Amount\"", (gogoproto.nullable) = false ]; @@ -150,7 +150,7 @@ message MsgDepositStableMintRequest { (gogoproto.moretags) = "yaml:\"extended_pair_vault_id\"" ]; string amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; @@ -171,7 +171,7 @@ message MsgWithdrawStableMintRequest { (gogoproto.moretags) = "yaml:\"extended_pair_vault_id\"" ]; string amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; diff --git a/proto/comdex/vault/v1beta1/vault.proto b/proto/comdex/vault/v1beta1/vault.proto index 8c6aa850d..f942a9417 100644 --- a/proto/comdex/vault/v1beta1/vault.proto +++ b/proto/comdex/vault/v1beta1/vault.proto @@ -22,12 +22,12 @@ message Vault { string owner = 4 [(gogoproto.moretags) = "yaml:\"owner\""]; string amount_in = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount_in\"", (gogoproto.nullable) = false ]; string amount_out = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount_out\"", (gogoproto.nullable) = false ]; @@ -37,12 +37,12 @@ message Vault { (gogoproto.moretags) = "yaml:\"created_at\"" ]; string interest_accumulated = 8[ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"interest_accumulated\"", (gogoproto.nullable) = false ]; string closing_fee_accumulated = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"interest_accumulated\"", (gogoproto.nullable) = false ]; @@ -75,10 +75,10 @@ message AppExtendedPairVaultMappingData repeated uint64 vault_ids = 3 [(gogoproto.moretags) = "yaml:\"vault_ids\""]; string token_minted_amount = 4[ (gogoproto.moretags) = "yaml:\"token_minted_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; string collateral_locked_amount = 5[(gogoproto.moretags) = "yaml:\"collateral_locked_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } @@ -88,7 +88,7 @@ message TvlLockedDataMap { string asset_denom = 1 [(gogoproto.moretags) = "yaml:\"asset_denom\""]; string collateral_locked_amount = 2 [(gogoproto.moretags) = "yaml:\"collateral_locked_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } @@ -96,7 +96,7 @@ message MintedDataMap { string asset_denom = 1 [(gogoproto.moretags) = "yaml:\"asset_denom\""]; string minted_amount = 2 [(gogoproto.moretags) = "yaml:\"minted_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } @@ -106,12 +106,12 @@ message StableMintVault { (gogoproto.moretags) = "yaml:\"id\"" ]; string amount_in = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount_in\"", (gogoproto.nullable) = false ]; string amount_out = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount_out\"", (gogoproto.nullable) = false ]; @@ -130,11 +130,11 @@ message PairStatisticData { string asset_in_denom = 1 [(gogoproto.moretags) = "yaml:\"asset_in_denom\""]; string asset_out_denom = 2 [(gogoproto.moretags) = "yaml:\"asset_out_denom\""]; string collateral_amount = 3 [(gogoproto.moretags) = "yaml:\"collateral_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; string minted_amount = 4 [(gogoproto.moretags) = "yaml:\"minted_amount\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; uint64 extended_pair_vault_id = 5 [ (gogoproto.customname) = "ExtendedPairVaultID", @@ -156,7 +156,7 @@ message StableMintVaultRewards { ]; string amount = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto index fab75284b..1447d642d 100644 --- a/proto/cosmos/base/v1beta1/coin.proto +++ b/proto/cosmos/base/v1beta1/coin.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package cosmos.base.v1beta1; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/types"; option (gogoproto.goproto_stringer_all) = false; @@ -15,7 +17,12 @@ message Coin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // DecCoin defines a token with a denomination and a decimal amount. @@ -26,15 +33,29 @@ message DecCoin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } // IntProto defines a Protobuf wrapper around an Int object. +// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. message IntProto { - string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string int = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; } // DecProto defines a Protobuf wrapper around a Dec object. +// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. message DecProto { - string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string dec = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } diff --git a/testutil/keeper/auction.go b/testutil/keeper/auction.go index 6a9cff2d5..0720d5384 100644 --- a/testutil/keeper/auction.go +++ b/testutil/keeper/auction.go @@ -8,12 +8,12 @@ package keeper // "github.com/comdex-official/comdex/x/auction/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// "github.com/cosmos/cosmos-sdk/store" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// "cosmossdk.io/store" +// storetypes "cosmossdk.io/core/store" // sdk "github.com/cosmos/cosmos-sdk/types" // typesparams "github.com/cosmos/cosmos-sdk/x/params/types" // "github.com/stretchr/testify/require" -// "github.com/cometbft/cometbft/libs/log" +// "cosmossdk.io/log" // tmproto "github.com/cometbft/cometbft/proto/tendermint/types" // tmdb "github.com/cometbft/cometbft-db" //) diff --git a/testutil/keeper/auctionsV2.go b/testutil/keeper/auctionsV2.go index 0c79fe841..622788a38 100644 --- a/testutil/keeper/auctionsV2.go +++ b/testutil/keeper/auctionsV2.go @@ -7,12 +7,12 @@ package keeper // "github.com/comdex-official/comdex/x/auctions/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// "github.com/cosmos/cosmos-sdk/store" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// "cosmossdk.io/store" +// storetypes "cosmossdk.io/core/store" // sdk "github.com/cosmos/cosmos-sdk/types" // typesparams "github.com/cosmos/cosmos-sdk/x/params/types" // "github.com/stretchr/testify/require" -// "github.com/cometbft/cometbft/libs/log" +// "cosmossdk.io/log" // tmproto "github.com/tendermint/tendermint/proto/tendermint/types" // tmdb "github.com/tendermint/tm-db" //) diff --git a/testutil/keeper/collector.go b/testutil/keeper/collector.go index a747fc400..15868dde8 100644 --- a/testutil/keeper/collector.go +++ b/testutil/keeper/collector.go @@ -8,12 +8,12 @@ package keeper // "github.com/comdex-official/comdex/x/collector/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// "github.com/cosmos/cosmos-sdk/store" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// "cosmossdk.io/store" +// storetypes "cosmossdk.io/core/store" // sdk "github.com/cosmos/cosmos-sdk/types" // typesparams "github.com/cosmos/cosmos-sdk/x/params/types" // "github.com/stretchr/testify/require" -// "github.com/cometbft/cometbft/libs/log" +// "cosmossdk.io/log" // tmproto "github.com/cometbft/cometbft/proto/tendermint/types" // tmdb "github.com/cometbft/cometbft-db" //) diff --git a/testutil/keeper/esm.go b/testutil/keeper/esm.go index 2811be96c..e53d503f7 100644 --- a/testutil/keeper/esm.go +++ b/testutil/keeper/esm.go @@ -7,12 +7,12 @@ package keeper // "github.com/comdex-official/comdex/x/esm/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// "github.com/cosmos/cosmos-sdk/store" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// "cosmossdk.io/store" +// storetypes "cosmossdk.io/core/store" // sdk "github.com/cosmos/cosmos-sdk/types" // typesparams "github.com/cosmos/cosmos-sdk/x/params/types" // "github.com/stretchr/testify/require" -// "github.com/cometbft/cometbft/libs/log" +// "cosmossdk.io/log" // tmproto "github.com/cometbft/cometbft/proto/tendermint/types" // tmdb "github.com/cometbft/cometbft-db" // ) diff --git a/testutil/keeper/liquidationsV2.go b/testutil/keeper/liquidationsV2.go index 10a0a0be9..0dc22ddf5 100644 --- a/testutil/keeper/liquidationsV2.go +++ b/testutil/keeper/liquidationsV2.go @@ -7,12 +7,12 @@ package keeper // "github.com/comdex-official/comdex/x/liquidationsV2/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// "github.com/cosmos/cosmos-sdk/store" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// "cosmossdk.io/store" +// storetypes "cosmossdk.io/core/store" // sdk "github.com/cosmos/cosmos-sdk/types" // typesparams "github.com/cosmos/cosmos-sdk/x/params/types" // "github.com/stretchr/testify/require" -// "github.com/cometbft/cometbft/libs/log" +// "cosmossdk.io/log" // tmproto "github.com/tendermint/tendermint/proto/tendermint/types" // tmdb "github.com/tendermint/tm-db" //) diff --git a/testutil/keeper/rewards.go b/testutil/keeper/rewards.go index fc3981541..4bc6d81b1 100644 --- a/testutil/keeper/rewards.go +++ b/testutil/keeper/rewards.go @@ -8,12 +8,12 @@ package keeper // "github.com/comdex-official/comdex/x/rewards/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// "github.com/cosmos/cosmos-sdk/store" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// "cosmossdk.io/store" +// storetypes "cosmossdk.io/core/store" // sdk "github.com/cosmos/cosmos-sdk/types" // typesparams "github.com/cosmos/cosmos-sdk/x/params/types" // "github.com/stretchr/testify/require" -// "github.com/cometbft/cometbft/libs/log" +// "cosmossdk.io/log" // tmproto "github.com/cometbft/cometbft/proto/tendermint/types" // tmdb "github.com/cometbft/cometbft-db" //) diff --git a/testutil/keeper/tokenmint.go b/testutil/keeper/tokenmint.go index 77fe7eb9e..392ab1019 100644 --- a/testutil/keeper/tokenmint.go +++ b/testutil/keeper/tokenmint.go @@ -8,12 +8,12 @@ package keeper // "github.com/comdex-official/comdex/x/tokenmint/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// "github.com/cosmos/cosmos-sdk/store" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// "cosmossdk.io/store" +// storetypes "cosmossdk.io/core/store" // sdk "github.com/cosmos/cosmos-sdk/types" // typesparams "github.com/cosmos/cosmos-sdk/x/params/types" // "github.com/stretchr/testify/require" -// "github.com/cometbft/cometbft/libs/log" +// "cosmossdk.io/log" // tmproto "github.com/cometbft/cometbft/proto/tendermint/types" // tmdb "github.com/cometbft/cometbft-db" //) diff --git a/testutil/network/network.go b/testutil/network/network.go index cc2897844..56463fdf9 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -1,12 +1,14 @@ package network import ( + sdkmath "cosmossdk.io/math" "fmt" "testing" "time" - tmdb "github.com/cometbft/cometbft-db" + pruningtypes "cosmossdk.io/store/pruning/types" tmrand "github.com/cometbft/cometbft/libs/rand" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -15,14 +17,13 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" comdex "github.com/comdex-official/comdex/app" ) type ( - Network = network.Network - Config = network.Config + Network = network.Network + Config = network.Config Validator = network.Validator ) @@ -38,7 +39,7 @@ func New(t *testing.T, configs ...network.Config) *network.Network { } else { cfg = configs[0] } - net, _ := network.New(t,t.TempDir(), cfg) + net, _ := network.New(t, t.TempDir(), cfg) t.Cleanup(net.Cleanup) return net } @@ -55,10 +56,9 @@ func DefaultConfig() network.Config { AccountRetriever: authtypes.AccountRetriever{}, AppConstructor: func(val network.ValidatorI) servertypes.Application { return comdex.New( - val.GetCtx().Logger, tmdb.NewMemDB(), nil, true, map[int64]bool{}, val.GetCtx().Config.RootDir, 0, + val.GetCtx().Logger, dbm.NewMemDB(), nil, true, map[int64]bool{}, val.GetCtx().Config.RootDir, 0, encoding, simtestutil.EmptyAppOptions{}, - comdex.GetWasmEnabledProposals(), comdex.EmptyWasmOpts, baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), @@ -70,9 +70,9 @@ func DefaultConfig() network.Config { NumValidators: 1, BondDenom: sdk.DefaultBondDenom, MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), - AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.OneInt()), - StakingTokens: sdk.TokensFromConsensusPower(500, sdk.OneInt()), - BondedTokens: sdk.TokensFromConsensusPower(100, sdk.OneInt()), + AccountTokens: sdk.TokensFromConsensusPower(1000, sdkmath.OneInt()), + StakingTokens: sdk.TokensFromConsensusPower(500, sdkmath.OneInt()), + BondedTokens: sdk.TokensFromConsensusPower(100, sdkmath.OneInt()), PruningStrategy: pruningtypes.PruningOptionNothing, CleanupDir: true, SigningAlgo: string(hd.Secp256k1Type), diff --git a/testutil/simapp/simapp.go b/testutil/simapp/simapp.go index c96425a12..f5986bb1d 100644 --- a/testutil/simapp/simapp.go +++ b/testutil/simapp/simapp.go @@ -3,9 +3,9 @@ package simapp import ( "time" - tmdb "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + dbm "github.com/cosmos/cosmos-db" abcitypes "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -16,15 +16,15 @@ import ( // New creates application instance with in-memory database and disabled logging. func New(dir string) *comdex.App { var ( - db = tmdb.NewMemDB() + db = dbm.NewMemDB() logger = log.NewNopLogger() encoding = comdex.MakeEncodingConfig() ) a := comdex.New(logger, db, nil, true, map[int64]bool{}, dir, 0, encoding, - simtestutil.EmptyAppOptions{}, comdex.GetWasmEnabledProposals(), comdex.EmptyWasmOpts) + simtestutil.EmptyAppOptions{}, comdex.EmptyWasmOpts) // InitChain updates deliverState which is required when app.NewContext is called - a.InitChain(abcitypes.RequestInitChain{ + a.InitChain(&abcitypes.RequestInitChain{ ConsensusParams: defaultConsensusParams, AppStateBytes: []byte("{}"), }) diff --git a/types/utils.go b/types/utils.go index 777c06daa..c28e2ec63 100644 --- a/types/utils.go +++ b/types/utils.go @@ -57,12 +57,12 @@ func DateRangeIncludes(startTime, endTime, targetTime time.Time) bool { return endTime.After(targetTime) && !startTime.After(targetTime) } -// ParseDec is a shortcut for sdk.MustNewDecFromStr. +// ParseDec is a shortcut for sdkmath.LegacyMustNewDecFromStr. func ParseDec(s string) sdkmath.LegacyDec { return sdkmath.LegacyMustNewDecFromStr(strings.ReplaceAll(s, "_", "")) } -// ParseDecP is like ParseDec, but it returns a pointer to sdk.Dec. +// ParseDecP is like ParseDec, but it returns a pointer to sdkmath.LegacyDec. func ParseDecP(s string) *sdkmath.LegacyDec { d := ParseDec(s) return &d @@ -157,15 +157,15 @@ func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64 txCtx.SimAccount.PrivKey, ) if err != nil { - return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to generate mock tx"), nil, err + return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to generate mock tx"), nil, err } _, _, err = txCtx.App.SimDeliver(txCtx.TxGen.TxEncoder(), tx) if err != nil { - return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to deliver tx"), nil, err + return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(txCtx.Msg, true, "", txCtx.Cdc), nil, nil + return simtypes.NewOperationMsg(txCtx.Msg, true, ""), nil, nil } // GenAndDeliverTxWithFees generates a transaction with given fee and delivers it. @@ -177,11 +177,11 @@ func GenAndDeliverTxWithFees(txCtx simulation.OperationInput, gas uint64, fees s _, hasNeg := spendable.SafeSub(txCtx.CoinsSpentInMsg...) if hasNeg { - return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "message doesn't leave room for fees"), nil, err + return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "message doesn't leave room for fees"), nil, err } if err != nil { - return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to generate fees"), nil, err + return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to generate fees"), nil, err } return GenAndDeliverTx(txCtx, fees, gas) } diff --git a/types/utils_test.go b/types/utils_test.go index ceb23189d..625ee80f9 100644 --- a/types/utils_test.go +++ b/types/utils_test.go @@ -5,35 +5,35 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" "github.com/comdex-official/comdex/types" ) func TestGetShareValue(t *testing.T) { - require.EqualValues(t, types.GetShareValue(sdk.NewInt(100), sdk.MustNewDecFromStr("0.9")), sdk.NewInt(90)) - require.EqualValues(t, types.GetShareValue(sdk.NewInt(100), sdk.MustNewDecFromStr("1.1")), sdk.NewInt(110)) + require.EqualValues(t, types.GetShareValue(sdkmath.NewInt(100), sdkmath.LegacyMustNewDecFromStr("0.9")), sdkmath.NewInt(90)) + require.EqualValues(t, types.GetShareValue(sdkmath.NewInt(100), sdkmath.LegacyMustNewDecFromStr("1.1")), sdkmath.NewInt(110)) // truncated - require.EqualValues(t, types.GetShareValue(sdk.NewInt(101), sdk.MustNewDecFromStr("0.9")), sdk.NewInt(90)) - require.EqualValues(t, types.GetShareValue(sdk.NewInt(101), sdk.MustNewDecFromStr("1.1")), sdk.NewInt(111)) + require.EqualValues(t, types.GetShareValue(sdkmath.NewInt(101), sdkmath.LegacyMustNewDecFromStr("0.9")), sdkmath.NewInt(90)) + require.EqualValues(t, types.GetShareValue(sdkmath.NewInt(101), sdkmath.LegacyMustNewDecFromStr("1.1")), sdkmath.NewInt(111)) - require.EqualValues(t, types.GetShareValue(sdk.NewInt(100), sdk.MustNewDecFromStr("0")), sdk.NewInt(0)) - require.EqualValues(t, types.GetShareValue(sdk.NewInt(0), sdk.MustNewDecFromStr("1.1")), sdk.NewInt(0)) + require.EqualValues(t, types.GetShareValue(sdkmath.NewInt(100), sdkmath.LegacyMustNewDecFromStr("0")), sdkmath.NewInt(0)) + require.EqualValues(t, types.GetShareValue(sdkmath.NewInt(0), sdkmath.LegacyMustNewDecFromStr("1.1")), sdkmath.NewInt(0)) } func TestAddOrInit(t *testing.T) { strIntMap := make(types.StrIntMap) // Set when the key not existed on the map - strIntMap.AddOrSet("a", sdk.NewInt(1)) - require.Equal(t, strIntMap["a"], sdk.NewInt(1)) + strIntMap.AddOrSet("a", sdkmath.NewInt(1)) + require.Equal(t, strIntMap["a"], sdkmath.NewInt(1)) // Added when the key existed on the map - strIntMap.AddOrSet("a", sdk.NewInt(1)) - require.Equal(t, strIntMap["a"], sdk.NewInt(2)) + strIntMap.AddOrSet("a", sdkmath.NewInt(1)) + require.Equal(t, strIntMap["a"], sdkmath.NewInt(2)) } func TestParseTime(t *testing.T) { @@ -180,7 +180,7 @@ func TestDateRangeIncludes(t *testing.T) { } func TestSafeMath(t *testing.T) { - maxInt, _ := sdk.NewIntFromString("115792089237316195423570985008687907853269984665640564039457584007913129639935") + maxInt, _ := sdkmath.NewIntFromString("115792089237316195423570985008687907853269984665640564039457584007913129639935") for _, tc := range []struct { op func() @@ -188,36 +188,36 @@ func TestSafeMath(t *testing.T) { }{ { func() { - maxInt.Add(sdk.OneInt()) + maxInt.Add(sdkmath.OneInt()) }, true, }, { func() { - maxInt.Sub(sdk.OneInt()) + maxInt.Sub(sdkmath.OneInt()) }, false, }, { func() { i, _ := new(big.Int).SetString("133499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535", 10) - sdk.NewDecFromBigIntWithPrec(i, sdk.Precision) + sdkmath.LegacyNewDecFromBigIntWithPrec(i, sdkmath.LegacyPrecision) }, false, }, { func() { i, _ := new(big.Int).SetString("133499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535", 10) - d := sdk.NewDecFromBigIntWithPrec(i, sdk.Precision) - d.Add(sdk.NewDecWithPrec(1, sdk.Precision)) + d := sdkmath.LegacyNewDecFromBigIntWithPrec(i, sdkmath.LegacyPrecision) + d.Add(sdkmath.LegacyNewDecWithPrec(1, sdkmath.LegacyPrecision)) }, true, }, { func() { i, _ := new(big.Int).SetString("1334991897450568801496888566355970071626690326472907981216901004888887328612900343764351304", 10) - d := sdk.NewDecFromBigIntWithPrec(i, sdk.Precision) - d.Quo(sdk.NewDecWithPrec(1, 10)) + d := sdkmath.LegacyNewDecFromBigIntWithPrec(i, sdkmath.LegacyPrecision) + d.Quo(sdkmath.LegacyNewDecWithPrec(1, 10)) }, true, }, diff --git a/x/asset/abci.go b/x/asset/abci.go deleted file mode 100644 index a856ae6f0..000000000 --- a/x/asset/abci.go +++ /dev/null @@ -1,15 +0,0 @@ -package asset - -import ( - abci "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" - - utils "github.com/comdex-official/comdex/types" - "github.com/comdex-official/comdex/x/asset/keeper" -) - -func BeginBlocker(ctx sdk.Context, _ abci.RequestBeginBlock, k keeper.Keeper) { - _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { - return nil - }) -} diff --git a/x/asset/client/cli/tx.go b/x/asset/client/cli/tx.go index 44c666bed..3eeb19a0e 100644 --- a/x/asset/client/cli/tx.go +++ b/x/asset/client/cli/tx.go @@ -15,6 +15,7 @@ import ( "github.com/spf13/cobra" flag "github.com/spf13/pflag" + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/x/asset/types" ) @@ -103,7 +104,7 @@ func NewCreateMultipleAssets(clientCtx client.Context, txf tx.Factory, fs *flag. newIsOnChain := ParseBoolFromString(isOnChain[i]) newAssetOraclePrice := ParseBoolFromString(assetOraclePrice[i]) newIsCdpMintable := ParseBoolFromString(isCdpMintable[i]) - newDecimals, ok := sdk.NewIntFromString(decimals[i]) + newDecimals, ok := sdkmath.NewIntFromString(decimals[i]) if !ok { return txf, nil, types.ErrorInvalidDecimals } @@ -129,10 +130,6 @@ func NewCreateMultipleAssets(clientCtx client.Context, txf tx.Factory, fs *flag. return txf, nil, err } - if err = msg.ValidateBasic(); err != nil { - return txf, nil, err - } - return txf, msg, nil } @@ -209,7 +206,7 @@ func NewCreateAssets(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet) from := clientCtx.GetFromAddress() - newDecimals, ok := sdk.NewIntFromString(decimals) + newDecimals, ok := sdkmath.NewIntFromString(decimals) if !ok { return txf, nil, types.ErrorInvalidDecimals } @@ -234,10 +231,6 @@ func NewCreateAssets(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet) return txf, nil, err } - if err = msg.ValidateBasic(); err != nil { - return txf, nil, err - } - return txf, msg, nil } @@ -261,7 +254,7 @@ func NewCmdSubmitUpdateAssetProposal() *cobra.Command { denom := args[2] - decimals, ok := sdk.NewIntFromString(args[3]) + decimals, ok := sdkmath.NewIntFromString(args[3]) if !ok { return types.ErrorInvalidDecimals } @@ -305,10 +298,6 @@ func NewCmdSubmitUpdateAssetProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -376,10 +365,6 @@ func NewCmdSubmitAddPairsProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -453,10 +438,6 @@ func NewCmdSubmitUpdatePairProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -528,10 +509,6 @@ func NewCmdSubmitAddMultiplePairsProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -581,7 +558,7 @@ func NewCmdSubmitAddAppProposal() *cobra.Command { var aMap types.AppData var bMap []types.MintGenesisToken - newMinGovDeposit, ok := sdk.NewIntFromString(minGovDeposit) + newMinGovDeposit, ok := sdkmath.NewIntFromString(minGovDeposit) if err != nil { return err @@ -613,10 +590,6 @@ func NewCmdSubmitAddAppProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -651,7 +624,7 @@ func NewCmdSubmitUpdateGovTimeInAppProposal() *cobra.Command { return err } - minGovDeposit, ok := sdk.NewIntFromString(args[2]) + minGovDeposit, ok := sdkmath.NewIntFromString(args[2]) if !ok { return types.ErrorInvalidMinGovSupply } @@ -689,10 +662,6 @@ func NewCmdSubmitUpdateGovTimeInAppProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -786,7 +755,7 @@ func NewCreateAssetInAppMsg(clientCtx client.Context, txf tx.Factory, fs *flag.F } var bMap []types.MintGenesisToken - newGenesisSupply, ok := sdk.NewIntFromString(genesisSupply) + newGenesisSupply, ok := sdkmath.NewIntFromString(genesisSupply) if !ok { return txf, nil, types.ErrorInvalidGenesisSupply } @@ -820,9 +789,6 @@ func NewCreateAssetInAppMsg(clientCtx client.Context, txf tx.Factory, fs *flag.F return txf, nil, err } - if err = msg.ValidateBasic(); err != nil { - return txf, nil, err - } return txf, msg, nil } @@ -918,11 +884,11 @@ func NewCreateMultipleAssetsPairs(clientCtx client.Context, txf tx.Factory, fs * newIsOnChain := ParseBoolFromString(isOnChain[i]) newAssetOraclePrice := ParseBoolFromString(assetOraclePrice[i]) newIsCdpMintable := ParseBoolFromString(isCdpMintable[i]) - newDecimals, ok := sdk.NewIntFromString(decimals[i]) + newDecimals, ok := sdkmath.NewIntFromString(decimals[i]) if !ok { return txf, nil, types.ErrorInvalidDecimals } - newAssetOut, _ := sdk.NewIntFromString(assetOut[i]) + newAssetOut, _ := sdkmath.NewIntFromString(assetOut[i]) assets = append(assets, types.AssetPair{ Name: names[i], @@ -947,10 +913,6 @@ func NewCreateMultipleAssetsPairs(clientCtx client.Context, txf tx.Factory, fs * return txf, nil, err } - if err = msg.ValidateBasic(); err != nil { - return txf, nil, err - } - return txf, msg, nil } diff --git a/x/asset/expected/keeper.go b/x/asset/expected/keeper.go index f076f11b8..dbabca3be 100644 --- a/x/asset/expected/keeper.go +++ b/x/asset/expected/keeper.go @@ -1,28 +1,29 @@ package expected import ( + "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" vaulttypes "github.com/comdex-official/comdex/x/vault/types" ) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(moduleName string) sdk.AccAddress } // BankKeeper is the expected bank keeper. type BankKeeper interface { - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error } type RewardsKeeper interface { GetAppIDByApp(ctx sdk.Context, appID uint64) (uint64, bool) - CalculationOfRewards(ctx sdk.Context, amount sdk.Int, lsr sdk.Dec, bTime int64) (sdk.Dec, error) + CalculationOfRewards(ctx sdk.Context, amount sdkmath.Int, lsr sdkmath.LegacyDec, bTime int64) (sdkmath.LegacyDec, error) GetVaultInterestTracker(ctx sdk.Context, id, appID uint64) (vault rewardstypes.VaultInterestTracker, found bool) SetVaultInterestTracker(ctx sdk.Context, vault rewardstypes.VaultInterestTracker) } diff --git a/x/asset/handler.go b/x/asset/handler.go index 8464c9476..35bac78e2 100644 --- a/x/asset/handler.go +++ b/x/asset/handler.go @@ -3,6 +3,9 @@ package asset //goland:noinspection GoLinter import ( "fmt" + bam "github.com/cosmos/cosmos-sdk/baseapp" + + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -13,7 +16,7 @@ import ( ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { msgServer := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -25,7 +28,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } @@ -55,7 +58,7 @@ func NewUpdateAssetProposalHandler(k keeper.Keeper) govtypes.Handler { return handleMultipleAssetsPairsProposal(ctx, k, c) default: - return sdkerrors.Wrapf(types.ErrorUnknownProposalType, "%T", c) + return errorsmod.Wrapf(types.ErrorUnknownProposalType, "%T", c) } } } diff --git a/x/asset/keeper/app.go b/x/asset/keeper/app.go index d482b7f85..ebd0e316f 100644 --- a/x/asset/keeper/app.go +++ b/x/asset/keeper/app.go @@ -4,9 +4,11 @@ import ( "regexp" "strings" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/x/asset/types" ) @@ -66,7 +68,7 @@ func (k Keeper) GetApp(ctx sdk.Context, id uint64) (app types.AppData, found boo return app, true } -func (k Keeper) GetAppWasmQuery(ctx sdk.Context, id uint64) (sdk.Int, int64, uint64, error) { +func (k Keeper) GetAppWasmQuery(ctx sdk.Context, id uint64) (sdkmath.Int, int64, uint64, error) { appData, _ := k.GetApp(ctx, id) minGovDeposit := appData.MinGovDeposit var assetID uint64 @@ -83,10 +85,10 @@ func (k Keeper) GetAppWasmQuery(ctx sdk.Context, id uint64) (sdk.Int, int64, uin func (k Keeper) GetApps(ctx sdk.Context) (apps []types.AppData, found bool) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AppKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AppKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -236,7 +238,7 @@ func (k Keeper) AddAppRecords(ctx sdk.Context, msg types.AppData) error { } } - if msg.MinGovDeposit.LT(sdk.ZeroInt()) { + if msg.MinGovDeposit.LT(sdkmath.ZeroInt()) { return types.ErrorValueCantBeNegative } @@ -293,7 +295,7 @@ func (k Keeper) AddAssetInAppRecords(ctx sdk.Context, msg types.AppData) error { if err != nil { return types.ErrorInvalidFrom } - if data.GenesisSupply.LTE(sdk.ZeroInt()) { + if data.GenesisSupply.LTE(sdkmath.ZeroInt()) { return types.ErrorInvalidGenesisSupply } hasAsset := k.GetGenesisTokenForApp(ctx, msg.Id) @@ -301,7 +303,7 @@ func (k Keeper) AddAssetInAppRecords(ctx sdk.Context, msg types.AppData) error { return types.ErrorGenesisTokenExistForApp } - if data.IsGovToken && appdata.MinGovDeposit.Equal(sdk.ZeroInt()) { + if data.IsGovToken && appdata.MinGovDeposit.Equal(sdkmath.ZeroInt()) { return types.ErrorMinGovDepositIsZero } diff --git a/x/asset/keeper/asset.go b/x/asset/keeper/asset.go index befc6ffcb..afeed3875 100644 --- a/x/asset/keeper/asset.go +++ b/x/asset/keeper/asset.go @@ -3,11 +3,14 @@ package keeper import ( "regexp" + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" "github.com/comdex-official/comdex/x/asset/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func (k Keeper) SetAssetID(ctx sdk.Context, id uint64) { @@ -83,10 +86,10 @@ func (k Keeper) GetAssetDenom(ctx sdk.Context, id uint64) string { func (k Keeper) GetAssets(ctx sdk.Context) (assets []types.Asset) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AssetKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AssetKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -235,7 +238,7 @@ func (k *Keeper) AddMultipleAssetRecords(ctx sdk.Context, records ...types.Asset func (k *Keeper) AddAsset(ctx sdk.Context, msg *types.MsgAddAsset) error { params := k.GetParams(ctx) if err := k.bank.SendCoinsFromAccountToModule(ctx, msg.GetCreator(), types.ModuleName, sdk.NewCoins(params.AssetRegisrationFee)); err != nil { - return sdkerrors.Wrap(err, "insufficient asset registration fee") + return errorsmod.Wrap(err, "insufficient asset registration fee") } err := k.AddAssetRecords(ctx, msg.Asset) @@ -271,7 +274,7 @@ func (k Keeper) UpdateAssetRecords(ctx sdk.Context, msg types.Asset) error { asset.Denom = msg.Denom k.SetAssetForDenom(ctx, asset.Denom, asset.Id) - if msg.Decimals.GT(sdk.ZeroInt()) { + if msg.Decimals.GT(sdkmath.ZeroInt()) { asset.Decimals = msg.Decimals } asset.IsOraclePriceRequired = msg.IsOraclePriceRequired diff --git a/x/asset/keeper/asset_test.go b/x/asset/keeper/asset_test.go index 61d1d14fa..0b544f510 100644 --- a/x/asset/keeper/asset_test.go +++ b/x/asset/keeper/asset_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" "github.com/comdex-official/comdex/x/asset/keeper" assetTypes "github.com/comdex-official/comdex/x/asset/types" @@ -18,7 +19,7 @@ func (k Keeper) WhitelistAppId(ctx sdk.Context, appMappingId uint64) error func (s *KeeperTestSuite) TestAddApp() { userAddress1 := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" - genesisSupply := sdk.NewIntFromUint64(1000000) + genesisSupply := sdkmath.NewIntFromUint64(1000000) assetKeeper, ctx := &s.assetKeeper, &s.ctx for _, tc := range []struct { @@ -32,7 +33,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -43,7 +44,7 @@ func (s *KeeperTestSuite) TestAddApp() { }, { 2, - sdk.ZeroInt(), + sdkmath.ZeroInt(), true, userAddress1, }, @@ -57,7 +58,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "cswap", ShortName: "werd", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -76,7 +77,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "werd", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -95,7 +96,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "werd", ShortName: "cswap.", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -114,7 +115,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "werd", ShortName: "cswap" + " ", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -133,7 +134,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "werd", ShortName: "cswaps", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -152,7 +153,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "werd", ShortName: "cswappp", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -171,7 +172,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "werdwerdwerd", ShortName: "cswapp", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -190,7 +191,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "werd", ShortName: "Cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -209,7 +210,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 0, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -228,7 +229,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -247,7 +248,7 @@ func (s *KeeperTestSuite) TestAddApp() { assetTypes.AppData{ Name: "harby", ShortName: "harby", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: nil, }, @@ -271,11 +272,11 @@ func (s *KeeperTestSuite) TestAddApp() { s.Require().Equal(res.App.ShortName, tc.msg.ShortName) s.Require().Equal(res.App.GovTimeInSeconds, tc.msg.GovTimeInSeconds) s.Require().Equal(res.App.MinGovDeposit, tc.msg.MinGovDeposit) - err = assetKeeper.UpdateGovTimeInApp(*ctx, assetTypes.AppAndGovTime{AppId: tc.appID, GovTimeInSeconds: 653, MinGovDeposit: sdk.NewIntFromUint64(5000000)}) + err = assetKeeper.UpdateGovTimeInApp(*ctx, assetTypes.AppAndGovTime{AppId: tc.appID, GovTimeInSeconds: 653, MinGovDeposit: sdkmath.NewIntFromUint64(5000000)}) s.Require().NoError(err) //minGovDeposit, govTimeInSeconds, _, err := assetKeeper.GetAppWasmQuery(*ctx, tc.appID) //s.Require().NoError(err) - //s.Require().Equal(minGovDeposit, sdk.NewIntFromUint64(10000000)) + //s.Require().Equal(minGovDeposit, sdkmath.NewIntFromUint64(10000000)) //s.Require().Equal(govTimeInSeconds, int64(653)) } }) @@ -307,7 +308,7 @@ func (s *KeeperTestSuite) TestUpdateAssetRecords() { Id: 11, Name: "CMRT", Denom: "ucmrt", - Decimals: sdk.NewInt(100), + Decimals: sdkmath.NewInt(100), IsOnChain: false, IsOraclePriceRequired: false, }, @@ -321,7 +322,7 @@ func (s *KeeperTestSuite) TestUpdateAssetRecords() { Id: 1, Name: "CMRTCMRTCMRT", Denom: "ucmrt", - Decimals: sdk.NewInt(100), + Decimals: sdkmath.NewInt(100), IsOnChain: false, IsOraclePriceRequired: false, }, @@ -335,7 +336,7 @@ func (s *KeeperTestSuite) TestUpdateAssetRecords() { Id: 1, Name: "CMST", Denom: "ucmrt", - Decimals: sdk.NewInt(100), + Decimals: sdkmath.NewInt(100), IsOnChain: false, IsOraclePriceRequired: false, }, @@ -349,7 +350,7 @@ func (s *KeeperTestSuite) TestUpdateAssetRecords() { Id: 1, Name: "CMKT", Denom: "ucmst", - Decimals: sdk.NewInt(100), + Decimals: sdkmath.NewInt(100), IsOnChain: false, IsOraclePriceRequired: false, }, @@ -363,7 +364,7 @@ func (s *KeeperTestSuite) TestUpdateAssetRecords() { Id: 1, Name: "CMRT", Denom: "ucmrt", - Decimals: sdk.NewInt(100), + Decimals: sdkmath.NewInt(100), IsOnChain: false, IsOraclePriceRequired: false, }, @@ -406,7 +407,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: false, @@ -419,7 +420,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "OSMO", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: false, @@ -432,7 +433,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: true, @@ -445,7 +446,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: false, @@ -458,7 +459,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "CMDO", Denom: "ucmdo", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, IsCdpMintable: false, @@ -471,7 +472,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "SPX", Denom: "uspx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: false, IsCdpMintable: false, @@ -484,7 +485,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "SPX", Denom: "uspx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: false, IsCdpMintable: false, @@ -497,7 +498,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "SPXz", Denom: "uspxz", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: false, IsCdpMintable: false, @@ -510,7 +511,7 @@ func (s *KeeperTestSuite) TestAddAssetRecords() { assetTypes.Asset{ Name: "HUAHUAHUAHUA", Denom: "uspxz", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: false, IsCdpMintable: false, @@ -820,14 +821,14 @@ func (s *KeeperTestSuite) TestWasmUpdatePairsVault() { bindings.MsgUpdatePairsVault{ AppID: 1, ExtPairID: 5, - StabilityFee: sdk.MustNewDecFromStr("0.4"), - ClosingFee: sdk.MustNewDecFromStr("233.23"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.56"), - DrawDownFee: sdk.MustNewDecFromStr("0.29"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.4"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("233.23"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.56"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.29"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000), - DebtFloor: sdk.NewInt(1000), - MinCr: sdk.MustNewDecFromStr("1.8"), + DebtCeiling: sdkmath.NewInt(1000000000), + DebtFloor: sdkmath.NewInt(1000), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.8"), MinUsdValueLeft: 100000000, }, "ucmdx", @@ -842,14 +843,14 @@ func (s *KeeperTestSuite) TestWasmUpdatePairsVault() { bindings.MsgUpdatePairsVault{ AppID: 1, ExtPairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.4"), - ClosingFee: sdk.MustNewDecFromStr("233.23"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.56"), - DrawDownFee: sdk.MustNewDecFromStr("0.29"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.4"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("233.23"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.56"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.29"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000), - DebtFloor: sdk.NewInt(1000), - MinCr: sdk.MustNewDecFromStr("1.8"), + DebtCeiling: sdkmath.NewInt(1000000000), + DebtFloor: sdkmath.NewInt(1000), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.8"), MinUsdValueLeft: 100000000, }, "ucmdx", @@ -903,15 +904,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-A", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -929,15 +930,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 2, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-A", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -956,15 +957,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -982,15 +983,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 11, PairID: 2, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -1008,15 +1009,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 21, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -1034,15 +1035,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 2, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B ", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -1060,15 +1061,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 2, - StabilityFee: sdk.MustNewDecFromStr("2"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("2"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-Y", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -1086,15 +1087,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 2, - StabilityFee: sdk.MustNewDecFromStr("0"), - ClosingFee: sdk.MustNewDecFromStr("2"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("2"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-Y", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -1112,15 +1113,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 2, - StabilityFee: sdk.MustNewDecFromStr("0"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("2.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("2.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-Y", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -1138,15 +1139,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 2, - StabilityFee: sdk.MustNewDecFromStr("0"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(10000000000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(10000000000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-Y", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -1164,15 +1165,15 @@ func (s *KeeperTestSuite) TestAddExtendedPairVault() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 2, - StabilityFee: sdk.MustNewDecFromStr("0"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-Y", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -1238,7 +1239,7 @@ func (s *KeeperTestSuite) TestQueryExtendedPairVaults() { func (s *KeeperTestSuite) TestAddAssetInAppRecords() { userAddress1 := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" - genesisSupply := sdk.NewIntFromUint64(1000000) + genesisSupply := sdkmath.NewIntFromUint64(1000000) assetKeeper, ctx := &s.assetKeeper, &s.ctx s.TestAddApp() s.TestAddAssetRecords() @@ -1256,7 +1257,7 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { Id: 4, Name: "sake", ShortName: "sake", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -1277,7 +1278,7 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { Id: 1, Name: "sake", ShortName: "sake", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -1298,7 +1299,7 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { Id: 1, Name: "sake", ShortName: "sake", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -1319,7 +1320,7 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { Id: 1, Name: "sake", ShortName: "sake", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: nil, }, @@ -1333,7 +1334,7 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { Id: 2, Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -1354,7 +1355,7 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { Id: 2, Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.ZeroInt(), + MinGovDeposit: sdkmath.ZeroInt(), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -1375,7 +1376,7 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { Id: 2, Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -1396,7 +1397,7 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { Id: 3, Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { diff --git a/x/asset/keeper/keeper.go b/x/asset/keeper/keeper.go index 5f586b48b..9c2dd9006 100644 --- a/x/asset/keeper/keeper.go +++ b/x/asset/keeper/keeper.go @@ -7,7 +7,7 @@ import ( assettypes "github.com/comdex-official/comdex/x/asset/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/asset/expected" ) @@ -52,6 +52,6 @@ func NewKeeper( } } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.key) } diff --git a/x/asset/keeper/keeper_test.go b/x/asset/keeper/keeper_test.go index 0cd4b3b1e..76c7ec29b 100644 --- a/x/asset/keeper/keeper_test.go +++ b/x/asset/keeper/keeper_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -40,7 +39,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.vaultKeeper = s.app.VaultKeeper s.liquidationKeeper = s.app.LiquidationKeeper s.assetKeeper = s.app.AssetKeeper diff --git a/x/asset/keeper/pair.go b/x/asset/keeper/pair.go index e94d592ce..77f0b9b28 100644 --- a/x/asset/keeper/pair.go +++ b/x/asset/keeper/pair.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -66,10 +67,10 @@ func (k Keeper) GetPair(ctx sdk.Context, id uint64) (pair types.Pair, found bool func (k Keeper) GetPairs(ctx sdk.Context) (pairs []types.Pair) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.PairKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.PairKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/asset/keeper/pairs_vault.go b/x/asset/keeper/pairs_vault.go index a46730717..89e63d192 100644 --- a/x/asset/keeper/pairs_vault.go +++ b/x/asset/keeper/pairs_vault.go @@ -3,6 +3,9 @@ package keeper import ( "regexp" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -71,10 +74,10 @@ func (k Keeper) GetPairsVault(ctx sdk.Context, id uint64) (pairs types.ExtendedP func (k Keeper) GetPairsVaults(ctx sdk.Context) (apps []types.ExtendedPairVault, found bool) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.PairsVaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.PairsVaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -96,10 +99,10 @@ func (k Keeper) GetPairsVaults(ctx sdk.Context) (apps []types.ExtendedPairVault, func (k Keeper) WasmExtendedPairByAppQuery(ctx sdk.Context, appID uint64) (extID []uint64, found bool) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.PairsVaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.PairsVaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -153,13 +156,13 @@ func (k Keeper) WasmAddExtendedPairsVaultRecords(ctx sdk.Context, pairVaultBindi if DebtFloor.GTE(DebtCeiling) { return types.ErrorDebtFloorIsGreaterThanDebtCeiling } - if !(pairVaultBinding.StabilityFee.GTE(sdk.ZeroDec()) && pairVaultBinding.StabilityFee.LT(sdk.OneDec())) { + if !(pairVaultBinding.StabilityFee.GTE(sdkmath.LegacyZeroDec()) && pairVaultBinding.StabilityFee.LT(sdkmath.LegacyOneDec())) { return types.ErrorFeeShouldNotBeGTOne } - if !(pairVaultBinding.ClosingFee.GTE(sdk.ZeroDec()) && pairVaultBinding.ClosingFee.LT(sdk.OneDec())) { + if !(pairVaultBinding.ClosingFee.GTE(sdkmath.LegacyZeroDec()) && pairVaultBinding.ClosingFee.LT(sdkmath.LegacyOneDec())) { return types.ErrorFeeShouldNotBeGTOne } - if !(pairVaultBinding.DrawDownFee.GTE(sdk.ZeroDec()) && pairVaultBinding.DrawDownFee.LT(sdk.OneDec())) { + if !(pairVaultBinding.DrawDownFee.GTE(sdkmath.LegacyZeroDec()) && pairVaultBinding.DrawDownFee.LT(sdkmath.LegacyOneDec())) { return types.ErrorFeeShouldNotBeGTOne } assetOut, _ := k.GetAsset(ctx, pair.AssetOut) @@ -200,7 +203,7 @@ func (k Keeper) WasmAddExtendedPairsVaultRecords(ctx sdk.Context, pairVaultBindi return nil } -func (k Keeper) WasmAddExtendedPairsVaultRecordsQuery(ctx sdk.Context, appID, pairID uint64, StabilityFee, ClosingFee, DrawDownFee sdk.Dec, debtCeiling, debtFloor sdk.Int, PairName string) (bool, string) { +func (k Keeper) WasmAddExtendedPairsVaultRecordsQuery(ctx sdk.Context, appID, pairID uint64, StabilityFee, ClosingFee, DrawDownFee sdkmath.LegacyDec, debtCeiling, debtFloor sdkmath.Int, PairName string) (bool, string) { DebtCeiling := debtCeiling DebtFloor := debtFloor @@ -224,13 +227,13 @@ func (k Keeper) WasmAddExtendedPairsVaultRecordsQuery(ctx sdk.Context, appID, pa if DebtFloor.GTE(DebtCeiling) { return false, types.ErrorDebtFloorIsGreaterThanDebtCeiling.Error() } - if !(StabilityFee.GTE(sdk.ZeroDec()) && StabilityFee.LT(sdk.OneDec())) { + if !(StabilityFee.GTE(sdkmath.LegacyZeroDec()) && StabilityFee.LT(sdkmath.LegacyOneDec())) { return false, types.ErrorFeeShouldNotBeGTOne.Error() } - if !(ClosingFee.GTE(sdk.ZeroDec()) && ClosingFee.LT(sdk.OneDec())) { + if !(ClosingFee.GTE(sdkmath.LegacyZeroDec()) && ClosingFee.LT(sdkmath.LegacyOneDec())) { return false, types.ErrorFeeShouldNotBeGTOne.Error() } - if !(DrawDownFee.GTE(sdk.ZeroDec()) && DrawDownFee.LT(sdk.OneDec())) { + if !(DrawDownFee.GTE(sdkmath.LegacyZeroDec()) && DrawDownFee.LT(sdkmath.LegacyOneDec())) { return false, types.ErrorFeeShouldNotBeGTOne.Error() } @@ -254,7 +257,7 @@ func (k Keeper) WasmUpdatePairsVault(ctx sdk.Context, updatePairVault *bindings. // do nothing ExtPairVaultData.BlockHeight = ctx.BlockHeight() ExtPairVaultData.BlockTime = ctx.BlockTime() - } else if ExtPairVaultData.StabilityFee.GT(sdk.ZeroDec()) && updatePairVault.StabilityFee.GT(sdk.ZeroDec()) { + } else if ExtPairVaultData.StabilityFee.GT(sdkmath.LegacyZeroDec()) && updatePairVault.StabilityFee.GT(sdkmath.LegacyZeroDec()) { // run script to distribute k.VaultIterateRewards(ctx, ExtPairVaultData.StabilityFee, ExtPairVaultData.BlockHeight, ExtPairVaultData.BlockTime.Unix(), updatePairVault.AppID, ExtPairVaultData.Id, true) ExtPairVaultData.BlockHeight = ctx.BlockHeight() @@ -300,7 +303,7 @@ func (k Keeper) WasmCheckWhitelistedAssetQuery(ctx sdk.Context, denom string) (f return found } -func (k Keeper) VaultIterateRewards(ctx sdk.Context, collectorLsr sdk.Dec, collectorBh, collectorBt int64, appID, pairVaultID uint64, changeTypes bool) { +func (k Keeper) VaultIterateRewards(ctx sdk.Context, collectorLsr sdkmath.LegacyDec, collectorBh, collectorBt int64, appID, pairVaultID uint64, changeTypes bool) { extPairVault, found := k.vault.GetAppExtendedPairVaultMappingData(ctx, appID, pairVaultID) if found { for _, valID := range extPairVault.VaultIds { @@ -308,7 +311,7 @@ func (k Keeper) VaultIterateRewards(ctx sdk.Context, collectorLsr sdk.Dec, colle if !found { continue } - var interest sdk.Dec + var interest sdkmath.LegacyDec var err error if vaultData.BlockHeight == 0 { interest, err = k.rewards.CalculationOfRewards(ctx, vaultData.AmountOut, collectorLsr, collectorBt) @@ -332,9 +335,9 @@ func (k Keeper) VaultIterateRewards(ctx sdk.Context, collectorLsr sdk.Dec, colle } else { vaultInterestTracker.InterestAccumulated = vaultInterestTracker.InterestAccumulated.Add(interest) } - if vaultInterestTracker.InterestAccumulated.GTE(sdk.OneDec()) { + if vaultInterestTracker.InterestAccumulated.GTE(sdkmath.LegacyOneDec()) { newInterest := vaultInterestTracker.InterestAccumulated.TruncateInt() - newInterestDec := sdk.NewDecFromInt(newInterest) + newInterestDec := sdkmath.LegacyNewDecFromInt(newInterest) vaultInterestTracker.InterestAccumulated = vaultInterestTracker.InterestAccumulated.Sub(newInterestDec) // updating user rewards data diff --git a/x/asset/keeper/query_server.go b/x/asset/keeper/query_server.go index 5c7ac06be..a3858b147 100644 --- a/x/asset/keeper/query_server.go +++ b/x/asset/keeper/query_server.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" diff --git a/x/asset/migrations/v5/migrations.go b/x/asset/migrations/v5/migrations.go index 475e5e3d7..3d2bfb69e 100644 --- a/x/asset/migrations/v5/migrations.go +++ b/x/asset/migrations/v5/migrations.go @@ -1,9 +1,10 @@ package v5 import ( + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -20,12 +21,12 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar return err } -func MigrateValueApps(store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateValueApps(store storetypes.KVStore, cdc codec.BinaryCodec) error { app1 := assettypes.AppData{ Id: 1, Name: "CSWAP", ShortName: "cswap", - MinGovDeposit: sdk.ZeroInt(), + MinGovDeposit: sdkmath.ZeroInt(), GovTimeInSeconds: 300, GenesisToken: nil, } @@ -35,7 +36,7 @@ func MigrateValueApps(store sdk.KVStore, cdc codec.BinaryCodec) error { genesisToken := assettypes.MintGenesisToken{ AssetId: 9, - GenesisSupply: sdk.NewIntFromUint64(1000000000000000), + GenesisSupply: sdkmath.NewIntFromUint64(1000000000000000), IsGovToken: true, Recipient: "comdex1unvvj23q89dlgh82rdtk5su7akdl5932reqarg", } @@ -45,7 +46,7 @@ func MigrateValueApps(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 2, Name: "HARBOR", ShortName: "hbr", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 300, GenesisToken: gToken, } @@ -57,7 +58,7 @@ func MigrateValueApps(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 3, Name: "commodo", ShortName: "cmdo", - MinGovDeposit: sdk.ZeroInt(), + MinGovDeposit: sdkmath.ZeroInt(), GovTimeInSeconds: 0, GenesisToken: nil, } @@ -67,12 +68,12 @@ func MigrateValueApps(store sdk.KVStore, cdc codec.BinaryCodec) error { return nil } -func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateValueAsset(store storetypes.KVStore, cdc codec.BinaryCodec) error { asset1 := assettypes.Asset{ Id: 1, Name: "ATOM", Denom: "ibc/2E5D0AC026AC1AFA65A23023BA4F24BB8DDF94F118EDC0BAD6F625BFC557CDED", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, } @@ -84,7 +85,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 2, Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, } @@ -96,7 +97,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 3, Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, } @@ -108,7 +109,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 4, Name: "OSMO", Denom: "ibc/868AF0A32D53849B6093348F5A47BB969A98E71A3F0CD2D3BE406EA25DA7F836", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, } @@ -120,7 +121,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 5, Name: "cATOM", Denom: "ucatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: false, } @@ -132,7 +133,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 6, Name: "cCMDX", Denom: "uccmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: false, } @@ -144,7 +145,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 7, Name: "cCMST", Denom: "uccmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: false, } @@ -156,7 +157,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 8, Name: "cOSMO", Denom: "ucosmo", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: false, } @@ -168,7 +169,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 9, Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: false, } @@ -180,7 +181,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 10, Name: "USDC", Denom: "ibc/EF8A76D0FD3F3F45D8DB7FEBFCF921206DF58CA41493ED16D69BF7B4E061C60C", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: false, IsOraclePriceRequired: true, } @@ -192,7 +193,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { Id: 11, Name: "WETH", Denom: "ibc/A99459944FD67B5711735B4B4D3FE30BA45328E94D437C78E47CA8DEFA781E49", - Decimals: sdk.NewInt(1000000000000000000), + Decimals: sdkmath.NewInt(1000000000000000000), IsOnChain: false, IsOraclePriceRequired: true, } @@ -203,7 +204,7 @@ func MigrateValueAsset(store sdk.KVStore, cdc codec.BinaryCodec) error { return nil } -func SetApp(store sdk.KVStore, cdc codec.BinaryCodec, app assettypes.AppData) { +func SetApp(store storetypes.KVStore, cdc codec.BinaryCodec, app assettypes.AppData) { var ( key = assettypes.AppKey(app.Id) value = cdc.MustMarshal(&app) @@ -212,7 +213,7 @@ func SetApp(store sdk.KVStore, cdc codec.BinaryCodec, app assettypes.AppData) { store.Set(key, value) } -func SetAsset(store sdk.KVStore, cdc codec.BinaryCodec, asset assettypes.Asset) { +func SetAsset(store storetypes.KVStore, cdc codec.BinaryCodec, asset assettypes.Asset) { var ( key = assettypes.AssetKey(asset.Id) value = cdc.MustMarshal(&asset) diff --git a/x/asset/module.go b/x/asset/module.go index 86ee035c8..4d539856f 100644 --- a/x/asset/module.go +++ b/x/asset/module.go @@ -23,7 +23,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} ) type AppModuleBasic struct{ cdc codec.BinaryCodec } @@ -88,6 +87,12 @@ func (a AppModule) ConsensusVersion() uint64 { return 2 } +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + func (a AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, message json.RawMessage) []abcitypes.ValidatorUpdate { var state types.GenesisState cdc.MustUnmarshalJSON(message, &state) @@ -111,11 +116,11 @@ func (a AppModule) RegisterServices(configurator module.Configurator) { types.RegisterQueryServer(configurator.QueryServer(), keeper.NewQueryServer(a.keeper)) } -func (a AppModule) BeginBlock(ctx sdk.Context, req abcitypes.RequestBeginBlock) { - BeginBlocker(ctx, req, a.keeper) +func (a AppModule) BeginBlock(ctx sdk.Context) error{ + return nil } -func (a AppModule) EndBlock(_ sdk.Context, _ abcitypes.RequestEndBlock) []abcitypes.ValidatorUpdate { +func (a AppModule) EndBlock(ctx context.Context) error { return nil } @@ -125,12 +130,6 @@ func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.Weigh return nil } -// func (a AppModule) RandomizedParams(_ *rand.Rand) []simulation.ParamChange { -// return nil -// } - -func (a AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - func (a AppModule) WeightedOperations(_ module.SimulationState) []simulation.WeightedOperation { return nil } diff --git a/x/asset/types/app.pb.go b/x/asset/types/app.pb.go index 721e616b4..734aa48fa 100644 --- a/x/asset/types/app.pb.go +++ b/x/asset/types/app.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -25,12 +25,12 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AppData struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` - ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty" yaml:"short_name"` - MinGovDeposit github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=min_gov_deposit,json=minGovDeposit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_gov_deposit" yaml:"min_gov_deposit"` - GovTimeInSeconds uint64 `protobuf:"varint,5,opt,name=gov_time_in_seconds,json=govTimeInSeconds,proto3" json:"gov_time_in_seconds,omitempty" yaml:"gov_time_in_seconds"` - GenesisToken []MintGenesisToken `protobuf:"bytes,6,rep,name=genesis_token,json=genesisToken,proto3" json:"genesis_token" yaml:"genesis_token"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` + ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty" yaml:"short_name"` + MinGovDeposit cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=min_gov_deposit,json=minGovDeposit,proto3,customtype=cosmossdk.io/math.Int" json:"min_gov_deposit" yaml:"min_gov_deposit"` + GovTimeInSeconds uint64 `protobuf:"varint,5,opt,name=gov_time_in_seconds,json=govTimeInSeconds,proto3" json:"gov_time_in_seconds,omitempty" yaml:"gov_time_in_seconds"` + GenesisToken []MintGenesisToken `protobuf:"bytes,6,rep,name=genesis_token,json=genesisToken,proto3" json:"genesis_token" yaml:"genesis_token"` } func (m *AppData) Reset() { *m = AppData{} } @@ -67,10 +67,10 @@ func (m *AppData) XXX_DiscardUnknown() { var xxx_messageInfo_AppData proto.InternalMessageInfo type MintGenesisToken struct { - AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - GenesisSupply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=genesis_supply,json=genesisSupply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"genesis_supply"` - IsGovToken bool `protobuf:"varint,3,opt,name=is_gov_token,json=isGovToken,proto3" json:"is_gov_token,omitempty" yaml:"is_gov_token"` - Recipient string `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` + AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + GenesisSupply cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=genesis_supply,json=genesisSupply,proto3,customtype=cosmossdk.io/math.Int" json:"genesis_supply"` + IsGovToken bool `protobuf:"varint,3,opt,name=is_gov_token,json=isGovToken,proto3" json:"is_gov_token,omitempty" yaml:"is_gov_token"` + Recipient string `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` } func (m *MintGenesisToken) Reset() { *m = MintGenesisToken{} } @@ -107,9 +107,9 @@ func (m *MintGenesisToken) XXX_DiscardUnknown() { var xxx_messageInfo_MintGenesisToken proto.InternalMessageInfo type AppAndGovTime struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - GovTimeInSeconds uint64 `protobuf:"varint,2,opt,name=gov_time_in_seconds,json=govTimeInSeconds,proto3" json:"gov_time_in_seconds,omitempty" yaml:"gov_time_in_seconds"` - MinGovDeposit github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=min_gov_deposit,json=minGovDeposit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_gov_deposit" yaml:"min_gov_deposit"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + GovTimeInSeconds uint64 `protobuf:"varint,2,opt,name=gov_time_in_seconds,json=govTimeInSeconds,proto3" json:"gov_time_in_seconds,omitempty" yaml:"gov_time_in_seconds"` + MinGovDeposit cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=min_gov_deposit,json=minGovDeposit,proto3,customtype=cosmossdk.io/math.Int" json:"min_gov_deposit" yaml:"min_gov_deposit"` } func (m *AppAndGovTime) Reset() { *m = AppAndGovTime{} } @@ -154,43 +154,43 @@ func init() { func init() { proto.RegisterFile("comdex/asset/v1beta1/app.proto", fileDescriptor_1372b4734b6486fd) } var fileDescriptor_1372b4734b6486fd = []byte{ - // 569 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xbd, 0x6e, 0xdb, 0x3c, - 0x14, 0x95, 0xec, 0xfc, 0x32, 0x71, 0xec, 0xc8, 0xfe, 0xbe, 0x1a, 0x41, 0x21, 0x19, 0x2c, 0x10, - 0x78, 0x89, 0x84, 0xa4, 0x5d, 0xda, 0xcd, 0x42, 0x00, 0xd7, 0x43, 0x0a, 0x54, 0x49, 0x97, 0x2e, - 0x82, 0x2c, 0x31, 0x0a, 0x11, 0x8b, 0x24, 0x4c, 0xc6, 0xa8, 0xdf, 0xa0, 0x63, 0x1f, 0xa1, 0x63, - 0x1f, 0xc5, 0x63, 0xc6, 0xa2, 0x83, 0xd0, 0xda, 0x6f, 0xa0, 0xb1, 0x53, 0x21, 0x52, 0xaa, 0xdd, - 0xc0, 0x1d, 0x5a, 0xa0, 0x93, 0x48, 0x9e, 0xc3, 0x73, 0x74, 0xcf, 0xbd, 0x20, 0x30, 0x43, 0x9a, - 0x44, 0xe8, 0x9d, 0x13, 0x70, 0x8e, 0x84, 0x33, 0x39, 0x1d, 0x22, 0x11, 0x9c, 0x3a, 0x01, 0x63, - 0x36, 0x1b, 0x53, 0x41, 0x8d, 0x96, 0xc2, 0x6d, 0x89, 0xdb, 0x05, 0x7e, 0xd4, 0x8a, 0x69, 0x4c, - 0x25, 0xc1, 0xc9, 0x57, 0x8a, 0x0b, 0x3f, 0x56, 0xc1, 0x76, 0x8f, 0xb1, 0xf3, 0x40, 0x04, 0xc6, - 0x01, 0xa8, 0xe0, 0xa8, 0xad, 0x77, 0xf4, 0xee, 0x86, 0x57, 0xc1, 0x91, 0xf1, 0x04, 0x6c, 0x90, - 0x20, 0x41, 0xed, 0x4a, 0x47, 0xef, 0xee, 0xba, 0xf5, 0x2c, 0xb5, 0xf6, 0xa6, 0x41, 0x32, 0x7a, - 0x01, 0xf3, 0x53, 0xe8, 0x49, 0xd0, 0x78, 0x06, 0x00, 0xbf, 0xa1, 0x63, 0xe1, 0x4b, 0x6a, 0x55, - 0x52, 0xff, 0xcb, 0x52, 0xeb, 0x50, 0x51, 0x97, 0x18, 0xf4, 0x76, 0xe5, 0xe6, 0x55, 0x7e, 0x8b, - 0x81, 0x7a, 0x82, 0x89, 0x1f, 0xd3, 0x89, 0x1f, 0x21, 0x46, 0x39, 0x16, 0xed, 0x0d, 0x79, 0xf5, - 0xe5, 0x2c, 0xb5, 0xb4, 0x2f, 0xa9, 0x75, 0x1c, 0x63, 0x71, 0x73, 0x37, 0xb4, 0x43, 0x9a, 0x38, - 0x21, 0xe5, 0x09, 0xe5, 0xc5, 0xe7, 0x84, 0x47, 0xb7, 0x8e, 0x98, 0x32, 0xc4, 0xed, 0x01, 0x11, - 0x59, 0x6a, 0xfd, 0xaf, 0x8c, 0x1e, 0xc8, 0x41, 0xaf, 0x96, 0x60, 0xd2, 0xa7, 0x93, 0x73, 0xb5, - 0x37, 0x2e, 0x40, 0x33, 0x87, 0x05, 0x4e, 0x90, 0x8f, 0x89, 0xcf, 0x51, 0x48, 0x49, 0xc4, 0xdb, - 0x9b, 0x79, 0xb5, 0xae, 0x99, 0xa5, 0xd6, 0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2b, 0x52, 0x90, - 0xe7, 0xd0, 0xdb, 0x0c, 0x18, 0x1b, 0x44, 0xbf, 0x1b, 0x80, 0xca, 0x5f, 0x0e, 0xc0, 0x9a, 0x09, - 0xae, 0xfe, 0xd3, 0x09, 0x76, 0x5f, 0xcf, 0xbe, 0x99, 0xda, 0xa7, 0xb9, 0xa9, 0xcd, 0xe6, 0xa6, - 0x7e, 0x3f, 0x37, 0xf5, 0xaf, 0x73, 0x53, 0xff, 0xb0, 0x30, 0xb5, 0xfb, 0x85, 0xa9, 0x7d, 0x5e, - 0x98, 0xda, 0x5b, 0xe7, 0x17, 0xcb, 0x7c, 0x0e, 0x4f, 0xe8, 0xf5, 0x35, 0x0e, 0x71, 0x30, 0x2a, - 0xf6, 0x4e, 0xf9, 0x6a, 0x48, 0xff, 0xe1, 0x96, 0x7c, 0x04, 0x9e, 0xfe, 0x08, 0x00, 0x00, 0xff, - 0xff, 0xf0, 0xde, 0x5d, 0x41, 0x52, 0x04, 0x00, 0x00, + // 564 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x41, 0x6f, 0xda, 0x4c, + 0x10, 0xb5, 0x81, 0x90, 0xb0, 0x09, 0x81, 0x18, 0xf2, 0x7d, 0x28, 0x6a, 0x6d, 0xb4, 0x95, 0x2a, + 0x2e, 0xb5, 0x95, 0xb4, 0x52, 0xd5, 0xde, 0xb0, 0x90, 0x10, 0x87, 0x54, 0xaa, 0x93, 0x53, 0x2f, + 0x96, 0xc1, 0x1b, 0xb3, 0x0a, 0xde, 0x5d, 0xb1, 0x1b, 0x54, 0x7e, 0x45, 0xfb, 0x33, 0xfa, 0x53, + 0x38, 0xe6, 0x58, 0xf5, 0x60, 0xb5, 0x70, 0xea, 0xd5, 0x97, 0x5e, 0x2b, 0xef, 0xe2, 0x82, 0x22, + 0xda, 0x43, 0xd5, 0xdb, 0xce, 0xbc, 0x37, 0x33, 0xbc, 0x79, 0x83, 0x81, 0x39, 0xa2, 0x71, 0x88, + 0xde, 0x3b, 0x01, 0xe7, 0x48, 0x38, 0xb3, 0xf3, 0x21, 0x12, 0xc1, 0xb9, 0x13, 0x30, 0x66, 0xb3, + 0x29, 0x15, 0xd4, 0x68, 0x2a, 0xdc, 0x96, 0xb8, 0xbd, 0xc6, 0xcf, 0x9a, 0x11, 0x8d, 0xa8, 0x24, + 0x38, 0xd9, 0x4b, 0x71, 0xe1, 0x87, 0x22, 0xd8, 0xef, 0x32, 0xd6, 0x0b, 0x44, 0x60, 0x1c, 0x83, + 0x02, 0x0e, 0x5b, 0x7a, 0x5b, 0xef, 0x94, 0xbc, 0x02, 0x0e, 0x8d, 0x27, 0xa0, 0x44, 0x82, 0x18, + 0xb5, 0x0a, 0x6d, 0xbd, 0x53, 0x71, 0x6b, 0x69, 0x62, 0x1d, 0xce, 0x83, 0x78, 0xf2, 0x1a, 0x66, + 0x59, 0xe8, 0x49, 0xd0, 0x78, 0x01, 0x00, 0x1f, 0xd3, 0xa9, 0xf0, 0x25, 0xb5, 0x28, 0xa9, 0xa7, + 0x69, 0x62, 0x9d, 0x28, 0xea, 0x06, 0x83, 0x5e, 0x45, 0x06, 0x6f, 0xb2, 0x2a, 0x1f, 0xd4, 0x62, + 0x4c, 0xfc, 0x88, 0xce, 0xfc, 0x10, 0x31, 0xca, 0xb1, 0x68, 0x95, 0x64, 0xe9, 0xcb, 0x45, 0x62, + 0x69, 0x5f, 0x12, 0xeb, 0x74, 0x44, 0x79, 0x4c, 0x39, 0x0f, 0x6f, 0x6d, 0x4c, 0x9d, 0x38, 0x10, + 0x63, 0x7b, 0x40, 0x44, 0x9a, 0x58, 0xff, 0xa9, 0xbe, 0x0f, 0xaa, 0xa1, 0x57, 0x8d, 0x31, 0xe9, + 0xd3, 0x59, 0x4f, 0xc5, 0xc6, 0x25, 0x68, 0x64, 0xb0, 0xc0, 0x31, 0xf2, 0x31, 0xf1, 0x39, 0x1a, + 0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xa3, 0x03, 0xca, 0x01, 0x63, 0x1b, 0xd1, 0x27, 0x69, 0x62, + 0x55, 0xd7, 0xa2, 0x65, 0x1e, 0x7a, 0x7b, 0x01, 0x63, 0x83, 0xf0, 0x77, 0x7e, 0x17, 0xfe, 0xd2, + 0xef, 0x1d, 0xf7, 0x59, 0xfc, 0x97, 0xf7, 0xe9, 0xbe, 0x5d, 0x7c, 0x33, 0xb5, 0x4f, 0x4b, 0x53, + 0x5b, 0x2c, 0x4d, 0xfd, 0x7e, 0x69, 0xea, 0x5f, 0x97, 0xa6, 0xfe, 0x71, 0x65, 0x6a, 0xf7, 0x2b, + 0x53, 0xfb, 0xbc, 0x32, 0xb5, 0x77, 0x4e, 0x84, 0xc5, 0xf8, 0x6e, 0x98, 0x5d, 0x98, 0xa3, 0xae, + 0xec, 0x19, 0xbd, 0xb9, 0xc1, 0x23, 0x1c, 0x4c, 0xd6, 0xb1, 0x93, 0x7f, 0x02, 0xc4, 0x9c, 0x21, + 0x3e, 0x2c, 0xcb, 0x7f, 0xf4, 0xf3, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x01, 0xb9, 0x89, 0x78, + 0x1f, 0x04, 0x00, 0x00, } func (m *AppData) Marshal() (dAtA []byte, err error) { diff --git a/x/asset/types/asset.go b/x/asset/types/asset.go index 44a366e81..5925416ad 100644 --- a/x/asset/types/asset.go +++ b/x/asset/types/asset.go @@ -1,10 +1,11 @@ package types import ( + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -19,9 +20,9 @@ func (m *Asset) Validate() error { return fmt.Errorf("name length cannot be greater than %d", MaxAssetNameLength) } if err := sdk.ValidateDenom(m.Denom); err != nil { - return errors.Wrapf(err, "invalid denom %s", m.Denom) + return errorsmod.Wrapf(err, "invalid denom %s", m.Denom) } - if m.Decimals.LTE(sdk.ZeroInt()) { + if m.Decimals.LTE(sdkmath.ZeroInt()) { return fmt.Errorf("decimals cannot be less than or equal to zero") } @@ -36,9 +37,9 @@ func (m *AssetPair) Validate() error { return fmt.Errorf("name length cannot be greater than %d", MaxAssetNameLength) } if err := sdk.ValidateDenom(m.Denom); err != nil { - return errors.Wrapf(err, "invalid denom %s", m.Denom) + return errorsmod.Wrapf(err, "invalid denom %s", m.Denom) } - if m.Decimals.LTE(sdk.ZeroInt()) { + if m.Decimals.LTE(sdkmath.ZeroInt()) { return fmt.Errorf("decimals cannot be less than or equal to zero") } diff --git a/x/asset/types/asset.pb.go b/x/asset/types/asset.pb.go index 2188b3963..7540821f5 100644 --- a/x/asset/types/asset.pb.go +++ b/x/asset/types/asset.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -25,13 +25,13 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Asset struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` - Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` - Decimals github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=decimals,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decimals" yaml:"decimals"` - IsOnChain bool `protobuf:"varint,5,opt,name=is_on_chain,json=isOnChain,proto3" json:"is_on_chain,omitempty" yaml:"is_on_chain"` - IsOraclePriceRequired bool `protobuf:"varint,6,opt,name=is_oracle_price_required,json=isOraclePriceRequired,proto3" json:"is_oracle_price_required,omitempty" yaml:"is_oracle_price_required"` - IsCdpMintable bool `protobuf:"varint,7,opt,name=is_cdp_mintable,json=isCdpMintable,proto3" json:"is_cdp_mintable,omitempty" yaml:"is_cdp_mintable"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Decimals cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=decimals,proto3,customtype=cosmossdk.io/math.Int" json:"decimals" yaml:"decimals"` + IsOnChain bool `protobuf:"varint,5,opt,name=is_on_chain,json=isOnChain,proto3" json:"is_on_chain,omitempty" yaml:"is_on_chain"` + IsOraclePriceRequired bool `protobuf:"varint,6,opt,name=is_oracle_price_required,json=isOraclePriceRequired,proto3" json:"is_oracle_price_required,omitempty" yaml:"is_oracle_price_required"` + IsCdpMintable bool `protobuf:"varint,7,opt,name=is_cdp_mintable,json=isCdpMintable,proto3" json:"is_cdp_mintable,omitempty" yaml:"is_cdp_mintable"` } func (m *Asset) Reset() { *m = Asset{} } @@ -74,33 +74,33 @@ func init() { func init() { proto.RegisterFile("comdex/asset/v1beta1/asset.proto", fileDescriptor_67277aee9bd3eed4) } var fileDescriptor_67277aee9bd3eed4 = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xb1, 0x6e, 0xd4, 0x30, - 0x18, 0xc7, 0x93, 0xeb, 0x5d, 0x69, 0x5d, 0xe0, 0x90, 0x55, 0xaa, 0xa8, 0x83, 0x7d, 0x72, 0xa5, - 0xea, 0x96, 0x5e, 0x54, 0x21, 0x31, 0xb0, 0xf5, 0x3a, 0x31, 0xa0, 0x82, 0x47, 0x04, 0x8a, 0x7c, - 0xb6, 0x7b, 0xb5, 0x88, 0xe3, 0x10, 0xa7, 0x88, 0xbe, 0x05, 0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xc2, 0x97, 0x60, 0x4f, 0xd9, 0xcc, 0x14, 0x19, 0xbf, 0x62, 0xaa, 0x48, 0x46, 0x93, 0x78, 0xba, - 0x33, 0x3f, 0x68, 0x1d, 0x86, 0xe1, 0x9f, 0x8d, 0x92, 0xd0, 0x5d, 0x65, 0x2f, 0x8a, 0xf3, 0xee, - 0x0c, 0x3f, 0x80, 0xa4, 0xab, 0x2a, 0xc6, 0x73, 0x99, 0x95, 0x95, 0xe2, 0x32, 0xab, 0xe4, 0xe7, - 0x6b, 0x55, 0x49, 0x91, 0x6c, 0x7b, 0xc9, 0x51, 0xeb, 0x30, 0xfe, 0x27, 0x79, 0x88, 0x24, 0xf4, - 0xb9, 0xb2, 0x17, 0xbe, 0x79, 0xdb, 0x15, 0xb4, 0xcf, 0xe1, 0x1c, 0x8c, 0x95, 0xcd, 0xb8, 0x28, - 0x33, 0xad, 0x8a, 0x9a, 0x2d, 0x72, 0x99, 0x3c, 0xf2, 0xd2, 0xc3, 0xd6, 0xe1, 0x83, 0x7b, 0xe9, - 0x26, 0x40, 0xe8, 0x13, 0x65, 0xcf, 0x45, 0xf9, 0xa6, 0x9f, 0xe7, 0xef, 0x56, 0x7f, 0x50, 0xf4, - 0xa3, 0x41, 0xd1, 0xaa, 0x41, 0xf1, 0x6d, 0x83, 0xe2, 0xdf, 0x0d, 0x8a, 0xbf, 0xad, 0x51, 0x74, - 0xbb, 0x46, 0xd1, 0xcf, 0x35, 0x8a, 0xde, 0xa7, 0xff, 0x5d, 0x60, 0xb7, 0xf8, 0x13, 0x73, 0x79, - 0xa9, 0xb8, 0x62, 0x79, 0x3f, 0xa7, 0x77, 0x8f, 0xc5, 0xdf, 0xe6, 0x62, 0xdb, 0x6f, 0xfe, 0xc5, - 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x38, 0x2d, 0x65, 0x49, 0x02, 0x00, 0x00, + // 411 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 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5e, 0xcd, 0x53, 0xa6, 0x64, 0xe6, 0xef, 0xfc, 0x4c, 0x5d, 0x5e, 0x02, 0x03, 0x5a, 0xf6, + 0x73, 0x76, 0xfb, 0x37, 0xcc, 0x75, 0x2d, 0xf4, 0x7c, 0xd7, 0x1d, 0xfa, 0xc5, 0xbf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x85, 0x74, 0x21, 0x5f, 0x38, 0x02, 0x00, 0x00, } func (m *Asset) Marshal() (dAtA []byte, err error) { diff --git a/x/asset/types/codec.go b/x/asset/types/codec.go index ad69e6880..a94cef52f 100644 --- a/x/asset/types/codec.go +++ b/x/asset/types/codec.go @@ -7,7 +7,6 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -59,7 +58,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - RegisterLegacyAminoCodec(authzcodec.Amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/asset/types/errors.go b/x/asset/types/errors.go index a83a56c79..c5b01c348 100644 --- a/x/asset/types/errors.go +++ b/x/asset/types/errors.go @@ -1,45 +1,45 @@ package types import ( - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrorInvalidDecimals = errors.Register(ModuleName, 101, "invalid decimals") - ErrorInvalidDenom = errors.Register(ModuleName, 102, "invalid denom") - ErrorInvalidFrom = errors.Register(ModuleName, 103, "invalid from") - ErrorInvalidRecipient = errors.Register(ModuleName, 104, "invalid recipient address") - ErrorInvalidID = errors.Register(ModuleName, 105, "invalid id") - ErrorInvalidName = errors.Register(ModuleName, 106, "invalid name") - ErrorInvalidGenesisSupply = errors.Register(ModuleName, 107, "invalid Genesis Supply") - ErrorInvalidMinGovSupply = errors.Register(ModuleName, 108, "invalid min gov supply") - ErrorAssetDoesNotExist = errors.Register(ModuleName, 109, "asset does not exist") - ErrorDuplicateAsset = errors.Register(ModuleName, 110, "duplicate asset") - ErrorPairDoesNotExist = errors.Register(ModuleName, 111, "pair does not exist") - ErrorDuplicatePair = errors.Register(ModuleName, 112, "duplicate pair") - ErrorDuplicateApp = errors.Register(ModuleName, 113, "duplicate app") - ErrorPairNameForID = errors.Register(ModuleName, 114, "already has pair name for id in this app") - AppIdsDoesntExist = errors.Register(ModuleName, 115, "app ids does not exist") - ErrorAssetAlreadyExistingApp = errors.Register(ModuleName, 116, "asset already exist in App") - ErrorAssetIsOffChain = errors.Register(ModuleName, 117, "asset has been marked off chain") - ErrorDebtFloorIsGreaterThanDebtCeiling = errors.Register(ModuleName, 118, "Debt Floor Is Greater Than Debt Ceiling") - ErrorGenesisTokenExistForApp = errors.Register(ModuleName, 119, "Genesis Token already Exist For App") - ErrorFeeShouldNotBeGTOne = errors.Register(ModuleName, 120, "Fee Should Not Be Greater than One and less than zero") - ErrorExtendedPairDoesNotExistForTheApp = errors.Register(ModuleName, 121, "extended pair does not exist for the app") - ErrorMinGovDepositIsZero = errors.Register(ModuleName, 122, "min gov deposit is zero") - ErrorShortNameDidNotMeetCriterion = errors.Register(ModuleName, 123, "App ShortName didn't meet the criterion") - ErrorNameDidNotMeetCriterion = errors.Register(ModuleName, 124, "Asset Name didn't meet the criterion") - ErrorReversePairAlreadyExist = errors.Register(ModuleName, 125, "Reverse pair already exists") - ErrorValueCantBeNegative = errors.Register(ModuleName, 126, "Value can't be negative") - ErrorAppNameDidNotMeetCriterion = errors.Register(ModuleName, 127, "App Name didn't meet the criterion") - ErrorPairNameDidNotMeetCriterion = errors.Register(ModuleName, 128, "Pair Name didn't meet the criterion") - ErrorDuplicateShortNameForApp = errors.Register(ModuleName, 129, "duplicate short name for app") - ErrorIsCDPMintableDisabled = errors.Register(ModuleName, 130, "can not use asset out for which cdp mintable is false") - ErrorMinGovDepositShouldBeZero = errors.Register(ModuleName, 131, "min gov deposit should be zero if token not used for governance") - ErrorOffChainAssetCannotBeMintable = errors.Register(ModuleName, 132, "Off Chain Asset Can not Be Mintable") - ErrorUnknownProposalType = errors.Register(ModuleName, 133, "unknown proposal type") - ErrorEmptyProposalAssets = errors.Register(ModuleName, 134, "empty assets in proposal") - ErrorUnknownAppType = errors.Register(ModuleName, 135, "unknown app type") - ErrorProposalTitleMissing = errors.Register(ModuleName, 136, "proposal title missing") - ErrorProposalDescriptionMissing = errors.Register(ModuleName, 137, "proposal description missing") + ErrorInvalidDecimals = errorsmod.Register(ModuleName, 101, "invalid decimals") + ErrorInvalidDenom = errorsmod.Register(ModuleName, 102, "invalid denom") + ErrorInvalidFrom = errorsmod.Register(ModuleName, 103, "invalid from") + ErrorInvalidRecipient = errorsmod.Register(ModuleName, 104, "invalid recipient address") + ErrorInvalidID = errorsmod.Register(ModuleName, 105, "invalid id") + ErrorInvalidName = errorsmod.Register(ModuleName, 106, "invalid name") + ErrorInvalidGenesisSupply = errorsmod.Register(ModuleName, 107, "invalid Genesis Supply") + ErrorInvalidMinGovSupply = errorsmod.Register(ModuleName, 108, "invalid min gov supply") + ErrorAssetDoesNotExist = errorsmod.Register(ModuleName, 109, "asset does not exist") + ErrorDuplicateAsset = errorsmod.Register(ModuleName, 110, "duplicate asset") + ErrorPairDoesNotExist = errorsmod.Register(ModuleName, 111, "pair does not exist") + ErrorDuplicatePair = errorsmod.Register(ModuleName, 112, "duplicate pair") + ErrorDuplicateApp = errorsmod.Register(ModuleName, 113, "duplicate app") + ErrorPairNameForID = errorsmod.Register(ModuleName, 114, "already has pair name for id in this app") + AppIdsDoesntExist = errorsmod.Register(ModuleName, 115, "app ids does not exist") + ErrorAssetAlreadyExistingApp = errorsmod.Register(ModuleName, 116, "asset already exist in App") + ErrorAssetIsOffChain = errorsmod.Register(ModuleName, 117, "asset has been marked off chain") + ErrorDebtFloorIsGreaterThanDebtCeiling = errorsmod.Register(ModuleName, 118, "Debt Floor Is Greater Than Debt Ceiling") + ErrorGenesisTokenExistForApp = errorsmod.Register(ModuleName, 119, "Genesis Token already Exist For App") + ErrorFeeShouldNotBeGTOne = errorsmod.Register(ModuleName, 120, "Fee Should Not Be Greater than One and less than zero") + ErrorExtendedPairDoesNotExistForTheApp = errorsmod.Register(ModuleName, 121, "extended pair does not exist for the app") + ErrorMinGovDepositIsZero = errorsmod.Register(ModuleName, 122, "min gov deposit is zero") + ErrorShortNameDidNotMeetCriterion = errorsmod.Register(ModuleName, 123, "App ShortName didn't meet the criterion") + ErrorNameDidNotMeetCriterion = errorsmod.Register(ModuleName, 124, "Asset Name didn't meet the criterion") + ErrorReversePairAlreadyExist = errorsmod.Register(ModuleName, 125, "Reverse pair already exists") + ErrorValueCantBeNegative = errorsmod.Register(ModuleName, 126, "Value can't be negative") + ErrorAppNameDidNotMeetCriterion = errorsmod.Register(ModuleName, 127, "App Name didn't meet the criterion") + ErrorPairNameDidNotMeetCriterion = errorsmod.Register(ModuleName, 128, "Pair Name didn't meet the criterion") + ErrorDuplicateShortNameForApp = errorsmod.Register(ModuleName, 129, "duplicate short name for app") + ErrorIsCDPMintableDisabled = errorsmod.Register(ModuleName, 130, "can not use asset out for which cdp mintable is false") + ErrorMinGovDepositShouldBeZero = errorsmod.Register(ModuleName, 131, "min gov deposit should be zero if token not used for governance") + ErrorOffChainAssetCannotBeMintable = errorsmod.Register(ModuleName, 132, "Off Chain Asset Can not Be Mintable") + ErrorUnknownProposalType = errorsmod.Register(ModuleName, 133, "unknown proposal type") + ErrorEmptyProposalAssets = errorsmod.Register(ModuleName, 134, "empty assets in proposal") + ErrorUnknownAppType = errorsmod.Register(ModuleName, 135, "unknown app type") + ErrorProposalTitleMissing = errorsmod.Register(ModuleName, 136, "proposal title missing") + ErrorProposalDescriptionMissing = errorsmod.Register(ModuleName, 137, "proposal description missing") ) diff --git a/x/asset/types/extendedPairVault.pb.go b/x/asset/types/extendedPairVault.pb.go index 031e27fe1..a240a60ce 100644 --- a/x/asset/types/extendedPairVault.pb.go +++ b/x/asset/types/extendedPairVault.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" @@ -29,24 +29,24 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ExtendedPairVault struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - PairId uint64 `protobuf:"varint,3,opt,name=pair_id,json=pairId,proto3" json:"pair_id,omitempty" yaml:"pair_id"` - StabilityFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stability_fee,json=stabilityFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stability_fee" yaml:"stability_fee"` - ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` - LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidation_penalty"` - DrawDownFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=draw_down_fee,json=drawDownFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"draw_down_fee" yaml:"draw_down_fee"` - IsVaultActive bool `protobuf:"varint,8,opt,name=is_vault_active,json=isVaultActive,proto3" json:"is_vault_active,omitempty" yaml:"active_flag"` - DebtCeiling github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=debt_ceiling,json=debtCeiling,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_ceiling" yaml:"debt_ceiling"` - DebtFloor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=debt_floor,json=debtFloor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_floor" yaml:"debt_floor"` - IsStableMintVault bool `protobuf:"varint,11,opt,name=is_stable_mint_vault,json=isStableMintVault,proto3" json:"is_stable_mint_vault,omitempty" yaml:"is_stable_mint_vault"` - MinCr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=min_cr,json=minCr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_cr" yaml:"min_cr"` - PairName string `protobuf:"bytes,13,opt,name=pair_name,json=pairName,proto3" json:"pair_name,omitempty" yaml:"pair_name"` - AssetOutOraclePrice bool `protobuf:"varint,14,opt,name=asset_out_oracle_price,json=assetOutOraclePrice,proto3" json:"asset_out_oracle_price,omitempty" yaml:"asset_out_oracle_price"` - AssetOutPrice uint64 `protobuf:"varint,15,opt,name=asset_out_price,json=assetOutPrice,proto3" json:"asset_out_price,omitempty" yaml:"asset_out_price"` - MinUsdValueLeft uint64 `protobuf:"varint,16,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` - BlockHeight int64 `protobuf:"varint,17,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` - BlockTime time.Time `protobuf:"bytes,18,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + PairId uint64 `protobuf:"varint,3,opt,name=pair_id,json=pairId,proto3" json:"pair_id,omitempty" yaml:"pair_id"` + StabilityFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=stability_fee,json=stabilityFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stability_fee" yaml:"stability_fee"` + ClosingFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=closing_fee,json=closingFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"closing_fee" yaml:"closing_fee"` + LiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_penalty" yaml:"liquidation_penalty"` + DrawDownFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=draw_down_fee,json=drawDownFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"draw_down_fee" yaml:"draw_down_fee"` + IsVaultActive bool `protobuf:"varint,8,opt,name=is_vault_active,json=isVaultActive,proto3" json:"is_vault_active,omitempty" yaml:"active_flag"` + DebtCeiling cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=debt_ceiling,json=debtCeiling,proto3,customtype=cosmossdk.io/math.Int" json:"debt_ceiling" yaml:"debt_ceiling"` + DebtFloor cosmossdk_io_math.Int `protobuf:"bytes,10,opt,name=debt_floor,json=debtFloor,proto3,customtype=cosmossdk.io/math.Int" json:"debt_floor" yaml:"debt_floor"` + IsStableMintVault bool `protobuf:"varint,11,opt,name=is_stable_mint_vault,json=isStableMintVault,proto3" json:"is_stable_mint_vault,omitempty" yaml:"is_stable_mint_vault"` + MinCr cosmossdk_io_math.LegacyDec `protobuf:"bytes,12,opt,name=min_cr,json=minCr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_cr" yaml:"min_cr"` + PairName string `protobuf:"bytes,13,opt,name=pair_name,json=pairName,proto3" json:"pair_name,omitempty" yaml:"pair_name"` + AssetOutOraclePrice bool `protobuf:"varint,14,opt,name=asset_out_oracle_price,json=assetOutOraclePrice,proto3" json:"asset_out_oracle_price,omitempty" yaml:"asset_out_oracle_price"` + AssetOutPrice uint64 `protobuf:"varint,15,opt,name=asset_out_price,json=assetOutPrice,proto3" json:"asset_out_price,omitempty" yaml:"asset_out_price"` + MinUsdValueLeft uint64 `protobuf:"varint,16,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` + BlockHeight int64 `protobuf:"varint,17,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` + BlockTime time.Time `protobuf:"bytes,18,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` } func (m *ExtendedPairVault) Reset() { *m = ExtendedPairVault{} } @@ -91,59 +91,59 @@ func init() { } var fileDescriptor_23dd38fcddb231cd = []byte{ - // 820 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xc1, 0x72, 0xe3, 0x34, - 0x18, 0x8e, 0xbb, 0xdb, 0x6c, 0xa3, 0x34, 0xed, 0x46, 0xcd, 0x14, 0x13, 0xa6, 0x71, 0xd0, 0x81, - 0xc9, 0x0c, 0x6c, 0x3c, 0x85, 0xdb, 0x1e, 0x60, 0x48, 0xbb, 0x1d, 0xca, 0x2c, 0x6c, 0x11, 0xd0, - 0x61, 0xb8, 0x68, 0x64, 0x5b, 0x71, 0x45, 0x65, 0xcb, 0xd8, 0x4a, 0xbb, 0x3d, 0xf0, 0x0e, 0xfb, - 0x0c, 0x9c, 0x78, 0x94, 0x1e, 0xf7, 0xc8, 0x70, 0x30, 0xd0, 0xbe,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xe8, 0xb3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x98, 0x15, 0x0f, - 0x7b, 0x06, 0x00, 0x00, + // 824 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x51, 0x73, 0xdb, 0x44, + 0x10, 0xb6, 0xd2, 0xc6, 0x8d, 0xcf, 0x71, 0x52, 0x5f, 0x4c, 0x10, 0xee, 0xc4, 0x32, 0xf7, 0xe4, + 0x19, 0x40, 0x9a, 0x14, 0x5e, 0x28, 0x33, 0xcc, 0xd4, 0x2d, 0x1d, 0x02, 0x85, 0xa6, 0x07, 0x04, + 0xa6, 0x2f, 0xc7, 0x59, 0x3a, 0x2b, 0x37, 0x3d, 0xe9, 0x84, 0x74, 0x4a, 0xea, 0x7f, 0xd1, 0x9f, + 0xc1, 0x4f, 0x09, 0x6f, 0x7d, 0x64, 0x78, 0x10, 0x90, 0xfc, 0x03, 0xfd, 0x02, 0xe6, 0xee, 0x14, + 0xec, 0x94, 0xcc, 0xb4, 0xc3, 0xdb, 0xed, 0xb7, 0xdf, 0x7e, 0xb7, 0xab, 0xdb, 0x5d, 0x81, 0x0f, + 0x43, 0x99, 0x44, 0xec, 0x45, 0x40, 0x8b, 0x82, 0xa9, 0xe0, 0x64, 0x7f, 0xc6, 0x14, 0xdd, 0x0f, + 0xd8, 0x0b, 0xc5, 0xd2, 0x88, 0x45, 0x87, 0x94, 0xe7, 0x47, 0xb4, 0x14, 0xca, 0xcf, 0x72, 0xa9, + 0x24, 0x1c, 0x58, 0xb6, 0x6f, 0xd8, 0x7e, 0xc3, 0x1e, 0x0e, 0x62, 0x19, 0x4b, 0x43, 0x08, 0xf4, + 0xc9, 0x72, 0x87, 0x5e, 0x2c, 0x65, 0x2c, 0x58, 0x60, 0xac, 0x59, 0x39, 0x0f, 0x14, 0x4f, 0x58, + 0xa1, 0x68, 0x92, 0x59, 0x02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xc7, 0xce, 0xa4, 0x7b, 0x77, 0xe8, 0xdb, 0x3d, 0xe9, 0x5f, + 0xee, 0x49, 0xff, 0xfb, 0xcb, 0x3d, 0x39, 0xdd, 0xd3, 0x6f, 0xb8, 0xec, 0xa5, 0x65, 0x2c, 0x7a, + 0xf9, 0xa7, 0xe7, 0xe0, 0x8e, 0x01, 0x34, 0x7d, 0xfa, 0xf4, 0xec, 0xef, 0x51, 0xeb, 0xd7, 0xf3, + 0x51, 0xeb, 0xec, 0x7c, 0xe4, 0xbc, 0x3a, 0x1f, 0x39, 0x7f, 0x9d, 0x8f, 0x9c, 0x97, 0x17, 0xa3, + 0xd6, 0xab, 0x8b, 0x51, 0xeb, 0xf7, 0x8b, 0x51, 0xeb, 0x59, 0x10, 0x73, 0x75, 0x5c, 0xce, 0xfc, + 0x50, 0x26, 0x81, 0xdd, 0xe2, 0x1f, 0xc9, 0xf9, 0x9c, 0x87, 0x9c, 0x8a, 0xc6, 0x0e, 0x2e, 0xff, + 0x02, 0x6a, 0x91, 0xb1, 0x62, 0xd6, 0x36, 0x09, 0x7d, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xaa, 0x0d, 0x8b, 0x6c, 0x22, 0x06, 0x00, 0x00, } func (m *ExtendedPairVault) Marshal() (dAtA []byte, err error) { diff --git a/x/asset/types/msgs.go b/x/asset/types/msgs.go index bb90db4f2..4ae5558b6 100644 --- a/x/asset/types/msgs.go +++ b/x/asset/types/msgs.go @@ -1,6 +1,8 @@ package types import ( + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -27,7 +29,7 @@ func NewMsgAddAsset( Asset: Asset{ Name: name, Denom: denom, - Decimals: sdk.NewIntFromUint64(decimals), + Decimals: sdkmath.NewIntFromUint64(decimals), IsOnChain: isOnChain, IsOraclePriceRequired: isOraclePriceRequired, IsCdpMintable: isCdpMintable, @@ -45,7 +47,7 @@ func (msg MsgAddAsset) ValidateBasic() error { } if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address: %v", err) } return nil } diff --git a/x/asset/types/pair.pb.go b/x/asset/types/pair.pb.go index 4d4a60c1a..2721b0549 100644 --- a/x/asset/types/pair.pb.go +++ b/x/asset/types/pair.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -105,14 +105,14 @@ func (m *PairInfo) XXX_DiscardUnknown() { var xxx_messageInfo_PairInfo proto.InternalMessageInfo type AssetPair struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` - Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` - Decimals github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=decimals,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decimals" yaml:"decimals"` - IsOnChain bool `protobuf:"varint,5,opt,name=is_on_chain,json=isOnChain,proto3" json:"is_on_chain,omitempty" yaml:"is_on_chain"` - IsOraclePriceRequired bool `protobuf:"varint,6,opt,name=is_oracle_price_required,json=isOraclePriceRequired,proto3" json:"is_oracle_price_required,omitempty" yaml:"is_oracle_price_required"` - IsCdpMintable bool `protobuf:"varint,7,opt,name=is_cdp_mintable,json=isCdpMintable,proto3" json:"is_cdp_mintable,omitempty" yaml:"is_cdp_mintable"` - AssetOut uint64 `protobuf:"varint,8,opt,name=asset_out,json=assetOut,proto3" json:"asset_out,omitempty" yaml:"asset_out"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Decimals cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=decimals,proto3,customtype=cosmossdk.io/math.Int" json:"decimals" yaml:"decimals"` + IsOnChain bool `protobuf:"varint,5,opt,name=is_on_chain,json=isOnChain,proto3" json:"is_on_chain,omitempty" yaml:"is_on_chain"` + IsOraclePriceRequired bool `protobuf:"varint,6,opt,name=is_oracle_price_required,json=isOraclePriceRequired,proto3" json:"is_oracle_price_required,omitempty" yaml:"is_oracle_price_required"` + IsCdpMintable bool `protobuf:"varint,7,opt,name=is_cdp_mintable,json=isCdpMintable,proto3" json:"is_cdp_mintable,omitempty" yaml:"is_cdp_mintable"` + AssetOut uint64 `protobuf:"varint,8,opt,name=asset_out,json=assetOut,proto3" json:"asset_out,omitempty" yaml:"asset_out"` } func (m *AssetPair) Reset() { *m = AssetPair{} } @@ -157,40 +157,40 @@ func init() { func init() { proto.RegisterFile("comdex/asset/v1beta1/pair.proto", fileDescriptor_65bd24918e5ac160) } var fileDescriptor_65bd24918e5ac160 = []byte{ - // 517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xcf, 0x6e, 0xd3, 0x30, - 0x18, 0x4f, 0xb6, 0x6e, 0x6d, 0x3c, 0xa0, 0x93, 0x29, 0x53, 0xb4, 0x43, 0x8c, 0x32, 0x69, 0x42, - 0x42, 0x4d, 0x54, 0x21, 0x71, 0xe0, 0xb6, 0xec, 0xd4, 0x03, 0xea, 0xc8, 0x11, 0x81, 0x22, 0x37, - 0x71, 0x3b, 0x8b, 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 0x4e, - 0x99, 0xc4, 0xe3, 0x19, 0x71, 0xdb, 0xda, 0xf4, 0xb8, 0xae, 0xd0, 0xd1, 0x5f, 0xd3, 0x6d, 0x82, - 0x1f, 0x3f, 0xa4, 0xe2, 0x3c, 0x2b, 0x5e, 0x37, 0xeb, 0x9b, 0xb7, 0xa0, 0x73, 0x9f, 0x5b, 0x10, - 0xbd, 0x59, 0xfe, 0xf6, 0xac, 0xaf, 0x2b, 0xcf, 0x5a, 0xae, 0x3c, 0xfb, 0x6a, 0xe5, 0xd9, 0xbf, - 0x56, 0x9e, 0xfd, 0x65, 0xed, 0x59, 0x57, 0x6b, 0xcf, 0xfa, 0xbe, 0xf6, 0xac, 0xb7, 0xe1, 0x8d, - 0x33, 0x57, 0xcf, 0xb0, 0xcf, 0x27, 0x13, 0x9a, 0x52, 0x3c, 0x6b, 0xd6, 0xe1, 0xe6, 0xe5, 0xea, - 0x1f, 0x30, 0xde, 0xd7, 0xef, 0xf0, 0xc5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xbe, 0x85, - 0x72, 0xd6, 0x03, 0x00, 0x00, + // 516 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x4f, 0x6f, 0xd3, 0x3c, + 0x18, 0x4f, 0xba, 0x6e, 0x6d, 0xbc, 0xf7, 0xa5, 0x93, 0xe9, 0xa6, 0x68, 0x87, 0x18, 0x65, 0x12, + 0x42, 0x42, 0x4b, 0xa8, 0x90, 0x38, 0x70, 0x23, 0x3b, 0x55, 0x02, 0x75, 0xe4, 0x88, 0x90, 0x22, + 0x37, 0x71, 0x5b, 0x8b, 0xc6, 0x0e, 0xb1, 0x83, 0xe8, 0xb7, 0xe0, 0x63, 0xf0, 0x3d, 0xb8, 0xf4, + 0xb8, 0x23, 0x70, 0x88, 0xa0, 0xfd, 0x06, 0xf9, 0x04, 0xc8, 0x76, 0x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8f, 0x5e, 0x2f, 0x7f, 0x7a, 0xd6, 0xe7, 0x95, 0x67, + 0x2d, 0x57, 0x9e, 0x7d, 0xb5, 0xf2, 0xec, 0x1f, 0x2b, 0xcf, 0xfe, 0xb4, 0xf6, 0xac, 0xab, 0xb5, + 0x67, 0x7d, 0x5d, 0x7b, 0xd6, 0x9b, 0x70, 0x4a, 0xe5, 0xac, 0x1a, 0x07, 0x29, 0xcf, 0x43, 0xf3, + 0xea, 0xce, 0xf9, 0x64, 0x42, 0x53, 0x8a, 0xe7, 0x9b, 0xff, 0x70, 0xfb, 0x50, 0xe5, 0xa2, 0x20, + 0x62, 0x7c, 0xa0, 0x9f, 0xdd, 0xd3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x81, 0x40, 0xde, 0xdb, + 0xc5, 0x03, 0x00, 0x00, } func (m *Pair) Marshal() (dAtA []byte, err error) { diff --git a/x/asset/types/params.go b/x/asset/types/params.go index 3ea6d37ab..c47f290a6 100644 --- a/x/asset/types/params.go +++ b/x/asset/types/params.go @@ -1,13 +1,14 @@ package types import ( + sdkmath "cosmossdk.io/math" fmt "fmt" sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" ) -var DefaultAssetRegistrationFee = sdk.NewCoin("ucmdx", sdk.NewInt(100_000_000)) +var DefaultAssetRegistrationFee = sdk.NewCoin("ucmdx", sdkmath.NewInt(100_000_000)) var KeyAssetRegistrationFee = []byte("AssetRegistrationFee") diff --git a/x/auction/expected/keeper.go b/x/auction/expected/keeper.go index 16f75bad6..e8d1d362b 100644 --- a/x/auction/expected/keeper.go +++ b/x/auction/expected/keeper.go @@ -1,9 +1,10 @@ package expected import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + sdkmath "cosmossdk.io/math" assettypes "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auction/types" "github.com/comdex-official/comdex/x/collector/types" @@ -15,21 +16,21 @@ import ( ) type AccountKeeper interface { - GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI + GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI GetModuleAddress(name string) sdk.AccAddress } type BankKeeper interface { - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderModule string, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } type MarketKeeper interface { - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) } @@ -55,42 +56,42 @@ type AssetKeeper interface { type VaultKeeper interface { GetAppExtendedPairVaultMappingData(ctx sdk.Context, appMappingID uint64, pairVaultsID uint64) (appExtendedPairVaultData vaulttypes.AppExtendedPairVaultMappingData, found bool) SetAppExtendedPairVaultMappingData(ctx sdk.Context, appExtendedPairVaultData vaulttypes.AppExtendedPairVaultMappingData) - UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) DeleteUserVaultExtendedPairMapping(ctx sdk.Context, from string, appMapping uint64, extendedPairVault uint64) - CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) error + CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdkmath.Int, AmountOut sdkmath.Int) error GetUserAppExtendedPairMappingData(ctx sdk.Context, from string, appMapping uint64, extendedPairVault uint64) (userVaultAssetData vaulttypes.OwnerAppExtendedPairVaultMappingData, found bool) GetUserAppMappingData(ctx sdk.Context, from string, appMapping uint64) (userVaultAssetData []vaulttypes.OwnerAppExtendedPairVaultMappingData, found bool) // CheckUserAppToExtendedPairMapping(ctx sdk.Context, userVaultAssetData vaulttypes.UserVaultAssetMapping, extendedPairVaultID uint64, appMappingID uint64) (vaultID uint64, found bool) SetVault(ctx sdk.Context, vault vaulttypes.Vault) GetVault(ctx sdk.Context, id uint64) (vault vaulttypes.Vault, found bool) - GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) + GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdkmath.LegacyDec, amt1 sdkmath.Int, id2 uint64, rate2 sdkmath.LegacyDec) (sdkmath.LegacyDec, sdkmath.Int, error) GetLengthOfVault(ctx sdk.Context) uint64 SetLengthOfVault(ctx sdk.Context, length uint64) } type CollectorKeeper interface { GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData types.AppToAssetIdCollectorMapping, found bool) - UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdk.Int) error + UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdkmath.Int) error // SetCollectorLookupTable(ctx sdk.Context, records ...types.CollectorLookupTable) error GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup types.CollectorLookupTableData, found bool) GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable types.AppAssetIdToAuctionLookupTable, found bool) GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData types.AppAssetIdToFeeCollectedData, found bool) - GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) - SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error + GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdkmath.Int) (sdkmath.Int, error) + SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdkmath.Int) error SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) } type TokenMintKeeper interface { - MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdk.Int) error - BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error + MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdkmath.Int) error + BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdkmath.Int) error } type EsmKeeper interface { GetKillSwitchData(ctx sdk.Context, appID uint64) (esmtypes.KillSwitchParams, bool) GetESMStatus(ctx sdk.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) - CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdk.Int, decimals sdk.Int) (price sdk.Dec) + CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdkmath.Int, decimals sdkmath.Int) (price sdkmath.LegacyDec) SetAssetToAmount(ctx sdk.Context, assetToAmount esmtypes.AssetToAmount) GetDataAfterCoolOff(ctx sdk.Context, id uint64) (esmDataAfterCoolOff esmtypes.DataAfterCoolOff, found bool) SetDataAfterCoolOff(ctx sdk.Context, esmDataAfterCoolOff esmtypes.DataAfterCoolOff) @@ -101,12 +102,12 @@ type LendKeeper interface { GetBorrow(ctx sdk.Context, id uint64) (borrow lendtypes.BorrowAsset, found bool) GetLendPair(ctx sdk.Context, id uint64) (pair lendtypes.Extended_Pair, found bool) GetAssetRatesParams(ctx sdk.Context, assetID uint64) (assetRatesStats lendtypes.AssetRatesParams, found bool) - VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset, liquidationThreshold sdk.Dec) error - CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset) (sdk.Dec, error) + VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdkmath.Int, assetIn assettypes.Asset, amountOut sdkmath.Int, assetOut assettypes.Asset, liquidationThreshold sdkmath.LegacyDec) error + CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdkmath.Int, assetIn assettypes.Asset, amountOut sdkmath.Int, assetOut assettypes.Asset) (sdkmath.LegacyDec, error) GetLend(ctx sdk.Context, id uint64) (lend lendtypes.LendAsset, found bool) GetPool(ctx sdk.Context, id uint64) (pool lendtypes.Pool, found bool) GetAddAuctionParamsData(ctx sdk.Context, appID uint64) (auctionParams lendtypes.AuctionParams, found bool) - ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdk.Int + ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdkmath.Int UpdateReserveBalances(ctx sdk.Context, assetID uint64, moduleName string, payment sdk.Coin, inc bool) error SetLend(ctx sdk.Context, lend lendtypes.LendAsset) SetAllReserveStatsByAssetID(ctx sdk.Context, allReserveStats lendtypes.AllReserveStats) diff --git a/x/auction/handler.go b/x/auction/handler.go index 148ee9339..2d2d405c4 100644 --- a/x/auction/handler.go +++ b/x/auction/handler.go @@ -1,14 +1,15 @@ package auction import ( + errorsmod "cosmossdk.io/errors" + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/comdex-official/comdex/x/auction/keeper" "github.com/comdex-official/comdex/x/auction/types" ) -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServiceServer(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -32,7 +33,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) + return nil, errorsmod.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } } } diff --git a/x/auction/keeper/auction.go b/x/auction/keeper/auction.go index f87c1e14f..f20721900 100644 --- a/x/auction/keeper/auction.go +++ b/x/auction/keeper/auction.go @@ -3,23 +3,24 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" assettypes "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auction/types" ) -func (k Keeper) GetUUSDFromUSD(ctx sdk.Context, price sdk.Dec) sdk.Dec { - usdInUUSD := sdk.MustNewDecFromStr("1000000") +func (k Keeper) GetUUSDFromUSD(ctx sdk.Context, price sdkmath.LegacyDec) sdkmath.LegacyDec { + usdInUUSD := sdkmath.LegacyMustNewDecFromStr("1000000") return price.Mul(usdInUUSD) } -func (k Keeper) GetModuleAccountBalance(ctx sdk.Context, moduleName string, denom string) sdk.Int { +func (k Keeper) GetModuleAccountBalance(ctx sdk.Context, moduleName string, denom string) sdkmath.Int { address := k.account.GetModuleAddress(moduleName) return k.bank.GetBalance(ctx, address, denom).Amount } func (k Keeper) FundModule(ctx sdk.Context, moduleName string, denom string, amt uint64) error { - err := k.bank.MintCoins(ctx, moduleName, sdk.NewCoins(sdk.NewCoin(denom, sdk.NewIntFromUint64(amt)))) + err := k.bank.MintCoins(ctx, moduleName, sdk.NewCoins(sdk.NewCoin(denom, sdkmath.NewIntFromUint64(amt)))) if err != nil { return err } @@ -27,7 +28,7 @@ func (k Keeper) FundModule(ctx sdk.Context, moduleName string, denom string, amt } func (k Keeper) AddAuctionParams(ctx sdk.Context, auctionParamsBinding *bindings.MsgAddAuctionParams) error { - newStep := sdk.NewIntFromUint64(auctionParamsBinding.Step) + newStep := sdkmath.NewIntFromUint64(auctionParamsBinding.Step) auctionParams := auctiontypes.AuctionParams{ AppId: auctionParamsBinding.AppID, AuctionDurationSeconds: auctionParamsBinding.AuctionDurationSeconds, @@ -60,13 +61,13 @@ func (k Keeper) makeFalseForFlags(ctx sdk.Context, appID, assetID uint64) error return nil } -func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, id uint64, rate sdk.Dec, amt sdk.Int) (price sdk.Dec, err error) { +func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, id uint64, rate sdkmath.LegacyDec, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) { asset, found := k.asset.GetAsset(ctx, id) if !found { - return sdk.ZeroDec(), assettypes.ErrorAssetDoesNotExist + return sdkmath.LegacyZeroDec(), assettypes.ErrorAssetDoesNotExist } - numerator := sdk.NewDecFromInt(amt).Mul(rate) - denominator := sdk.NewDecFromInt(asset.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amt).Mul(rate) + denominator := sdkmath.LegacyNewDecFromInt(asset.Decimals) return numerator.Quo(denominator), nil } diff --git a/x/auction/keeper/debt.go b/x/auction/keeper/debt.go index b98a0b4da..ea2ac0732 100644 --- a/x/auction/keeper/debt.go +++ b/x/auction/keeper/debt.go @@ -3,11 +3,14 @@ package keeper import ( "time" + errorsmod "cosmossdk.io/errors" + esmtypes "github.com/comdex-official/comdex/x/esm/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkmath "cosmossdk.io/math" auctiontypes "github.com/comdex-official/comdex/x/auction/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" ) @@ -86,8 +89,8 @@ func (k Keeper) checkStatusOfNetFeesCollectedAndStartDebtAuction(ctx sdk.Context return auctiontypes.NoAuction, nil } -func (k Keeper) getDebtSellTokenAmount(ctx sdk.Context, appID, AssetInID, AssetOutID uint64, lotSize sdk.Int) (status uint64, sellToken, buyToken sdk.Coin) { - emptyCoin := sdk.NewCoin("empty", sdk.NewIntFromUint64(1)) +func (k Keeper) getDebtSellTokenAmount(ctx sdk.Context, appID, AssetInID, AssetOutID uint64, lotSize sdkmath.Int) (status uint64, sellToken, buyToken sdk.Coin) { + emptyCoin := sdk.NewCoin("empty", sdkmath.NewIntFromUint64(1)) sellAsset, found1 := k.asset.GetAsset(ctx, AssetOutID) buyAsset, found2 := k.asset.GetAsset(ctx, AssetInID) if !found1 || !found2 { @@ -106,7 +109,7 @@ func (k Keeper) StartDebtAuction( ctx sdk.Context, auctionToken sdk.Coin, // sell token expectedUserToken sdk.Coin, // buy token - bidFactor sdk.Dec, + bidFactor sdkmath.LegacyDec, appID, assetID uint64, assetInID, assetOutID uint64, ) error { @@ -122,7 +125,7 @@ func (k Keeper) StartDebtAuction( Bidder: nil, EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), BidEndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), - CurrentBidAmount: sdk.NewCoin(auctionToken.Denom, sdk.NewInt(0)), + CurrentBidAmount: sdk.NewCoin(auctionToken.Denom, sdkmath.NewInt(0)), AuctionStatus: auctiontypes.AuctionStartNoBids, AppId: appID, AssetId: assetID, @@ -293,7 +296,7 @@ func (k Keeper) PlaceDebtAuctionBid(ctx sdk.Context, appID, auctionMappingID, au change := auction.BidFactor.MulInt(auction.ExpectedMintedToken.Amount).Ceil().TruncateInt() maxBidAmount := auction.ExpectedMintedToken.Amount.Sub(change) if bid.Amount.GT(maxBidAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", maxBidAmount.Uint64()) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", maxBidAmount.Uint64()) } } else { if bid.Amount.GT(auction.AuctionedToken.Amount) { diff --git a/x/auction/keeper/debt_test.go b/x/auction/keeper/debt_test.go index 1e3fe28d3..9b8811ea0 100644 --- a/x/auction/keeper/debt_test.go +++ b/x/auction/keeper/debt_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "time" "github.com/comdex-official/comdex/x/auction" @@ -30,12 +31,12 @@ func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForSurplus AppID: 1, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(200000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(200000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, }, } { @@ -103,12 +104,12 @@ func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForDebt() AppID: 1, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(200000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(200000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, }, } { @@ -167,7 +168,7 @@ func (s *KeeperTestSuite) TestDebtActivatorBetweenThreshholdAndLotsize() { s.AddPairAndExtendedPairVault1() s.AddAuctionParams() s.WasmSetCollectorLookupTableAndAuctionControlForDebt() - s.WasmUpdateCollectorLookupTable(sdk.NewInt(30000), sdk.NewInt(20500), sdk.NewInt(800), sdk.NewInt(501)) + s.WasmUpdateCollectorLookupTable(sdkmath.NewInt(30000), sdkmath.NewInt(20500), sdkmath.NewInt(800), sdkmath.NewInt(501)) k, ctx := &s.keeper, &s.ctx @@ -208,7 +209,7 @@ func (s *KeeperTestSuite) TestDebtActivator() { AppId: 1, BreakerEnable: false, } - err := collectorKeeper.SetNetFeeCollectedData(*ctx, uint64(1), 2, sdk.NewIntFromUint64(4700000)) + err := collectorKeeper.SetNetFeeCollectedData(*ctx, uint64(1), 2, sdkmath.NewIntFromUint64(4700000)) s.Require().NoError(err) err1 := k.DebtActivator(*ctx, auctionMapData, klswData, false) s.Require().NoError(err1) @@ -356,8 +357,8 @@ func (s *KeeperTestSuite) TestDebtBid() { beforeCmstBalance, err := s.getBalance(tc.msg.Bidder, "ucmst") s.Require().NoError(err) previousUserAddress := "" - mintedToken := sdk.NewCoin("zero", sdk.NewIntFromUint64(10)) - beforeCmstBalance2 := sdk.NewCoin("zero", sdk.NewIntFromUint64(10)) + mintedToken := sdk.NewCoin("zero", sdkmath.NewIntFromUint64(10)) + beforeCmstBalance2 := sdk.NewCoin("zero", sdkmath.NewIntFromUint64(10)) if tc.bidID != uint64(1) { previousUserAddress = beforeAuction.Bidder.String() beforeCmstBalance2, err = s.getBalance(previousUserAddress, "ucmst") @@ -400,7 +401,7 @@ func (s *KeeperTestSuite) TestDebtBid() { s.Require().Equal(afterAuction.BiddingIds[tc.bidID-uint64(1)].BidId, tc.bidID) s.Require().Equal(afterAuction.BiddingIds[tc.bidID-uint64(1)].BidOwner, tc.msg.Bidder) if tc.bidID != uint64(1) { - s.Require().True(afterAuction.ExpectedMintedToken.Amount.LTE(sdk.NewDecFromInt(beforeAuction.ExpectedMintedToken.Amount).Mul(sdk.MustNewDecFromStr("1").Sub(beforeAuction.BidFactor)).TruncateInt())) + s.Require().True(afterAuction.ExpectedMintedToken.Amount.LTE(sdkmath.LegacyNewDecFromInt(beforeAuction.ExpectedMintedToken.Amount).Mul(sdkmath.LegacyMustNewDecFromStr("1").Sub(beforeAuction.BidFactor)).TruncateInt())) } s.Require().Equal(beforeHarborBalance, afterHarborBalance) s.Require().Equal(beforeCmstBalance.Sub(expectedUserToken), afterCmstBalance) diff --git a/x/auction/keeper/dutch.go b/x/auction/keeper/dutch.go index ce12d1de4..9de5d1d8f 100644 --- a/x/auction/keeper/dutch.go +++ b/x/auction/keeper/dutch.go @@ -5,6 +5,9 @@ import ( "strconv" "time" + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -32,7 +35,7 @@ func (k Keeper) DutchActivator(ctx sdk.Context, lockedVault liquidationtypes.Loc assetOut, _ := k.asset.GetAsset(ctx, pair.AssetOut) // debt(cmst) outflowToken := sdk.NewCoin(assetIn.Denom, lockedVault.AmountIn) // cmdx - inflowToken := sdk.NewCoin(assetOut.Denom, sdk.ZeroInt()) // cmst + inflowToken := sdk.NewCoin(assetOut.Denom, sdkmath.ZeroInt()) // cmst liquidationPenalty := extendedPair.LiquidationPenalty @@ -53,7 +56,7 @@ func (k Keeper) StartDutchAuction( assetOutID uint64, // cmdx lockedVaultID uint64, lockedVaultOwner string, - liquidationPenalty sdk.Dec, + liquidationPenalty sdkmath.LegacyDec, ) error { var ( inFlowTokenPrice uint64 @@ -89,7 +92,7 @@ func (k Keeper) StartDutchAuction( if !found { return auctiontypes.ErrorInvalidAuctionParams } - if outFlowToken.Amount.GT(sdk.ZeroInt()) { + if outFlowToken.Amount.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, vaulttypes.ModuleName, auctiontypes.ModuleName, sdk.NewCoins(outFlowToken)) if err != nil { return err @@ -102,18 +105,18 @@ func (k Keeper) StartDutchAuction( outFlowTokenPrice = twaData.Twa // set target amount for debt inFlowTokenTargetAmount := lockedVault.AmountOut - mulfactor := sdk.NewDecFromInt(inFlowTokenTargetAmount).Mul(liquidationPenalty) + mulfactor := sdkmath.LegacyNewDecFromInt(inFlowTokenTargetAmount).Mul(liquidationPenalty) inFlowTokenTargetAmount = inFlowTokenTargetAmount.Add(mulfactor.TruncateInt()).Add(lockedVault.InterestAccumulated) inFlowTokenTarget := sdk.NewCoin(inFlowToken.Denom, inFlowTokenTargetAmount) // These prices are in uusd - outFlowTokenInitialPrice := k.getOutflowTokenInitialPrice(sdk.NewIntFromUint64(outFlowTokenPrice), auctionParams.Buffer) + outFlowTokenInitialPrice := k.getOutflowTokenInitialPrice(sdkmath.NewIntFromUint64(outFlowTokenPrice), auctionParams.Buffer) outFlowTokenEndPrice := k.getOutflowTokenEndPrice(outFlowTokenInitialPrice, auctionParams.Cusp) vaultOwner, err := sdk.AccAddressFromBech32(lockedVaultOwner) if err != nil { return err } timeNow := ctx.BlockTime() - inFlowTokenCurrentAmount := sdk.NewCoin(inFlowToken.Denom, sdk.NewIntFromUint64(0)) + inFlowTokenCurrentAmount := sdk.NewCoin(inFlowToken.Denom, sdkmath.NewIntFromUint64(0)) auction := auctiontypes.DutchAuction{ OutflowTokenInitAmount: outFlowToken, OutflowTokenCurrentAmount: outFlowToken, @@ -122,7 +125,7 @@ func (k Keeper) StartDutchAuction( OutflowTokenInitialPrice: outFlowTokenInitialPrice, OutflowTokenCurrentPrice: outFlowTokenInitialPrice, OutflowTokenEndPrice: outFlowTokenEndPrice, - InflowTokenCurrentPrice: sdk.NewDecFromInt(sdk.NewIntFromUint64(inFlowTokenPrice)), + InflowTokenCurrentPrice: sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(inFlowTokenPrice)), StartTime: timeNow, EndTime: timeNow.Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), AuctionStatus: auctiontypes.AuctionStartNoBids, @@ -162,18 +165,18 @@ func (k Keeper) StartDutchAuction( } func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin) error { - if bid.Amount.Equal(sdk.ZeroInt()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid amount can't be Zero") + if bid.Amount.Equal(sdkmath.ZeroInt()) { + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid amount can't be Zero") } auction, err := k.GetDutchAuction(ctx, appID, auctionMappingID, auctionID) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction id %d not found", auctionID) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "auction id %d not found", auctionID) } if bid.Denom != auction.OutflowTokenCurrentAmount.Denom { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid denom %s not found", bid.Denom) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid denom %s not found", bid.Denom) } if bid.Amount.GT(auction.OutflowTokenCurrentAmount.Amount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid amount can't be greater than collateral available") + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid amount can't be greater than collateral available") } // slice tells amount of collateral user should be given @@ -193,8 +196,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, a if err != nil { return err } - if inFlowTokenAmount.LTE(sdk.ZeroInt()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Calculated Auction Amount is Zero") + if inFlowTokenAmount.LTE(sdkmath.ZeroInt()) { + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "Calculated Auction Amount is Zero") } TargetReachedFlag := false @@ -222,7 +225,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, a } // dust is in usd * 10*-6 (uusd) - dust := sdk.NewIntFromUint64(ExtendedPairVault.MinUsdValueLeft) + dust := sdkmath.NewIntFromUint64(ExtendedPairVault.MinUsdValueLeft) // here subtracting current amount and slice to get amount left in auction and also converting it to usd * 10**-12 outLeft, err := k.CalcDollarValueForToken(ctx, auction.AssetOutId, outFlowTokenCurrentPrice, auction.OutflowTokenCurrentAmount.Amount) if err != nil { @@ -244,27 +247,27 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, a // As tab is the amount calculated from difference of target and current inflow token we will be using same as inflow token // Dust check for collateral - if amountLeftInPUSD.LT(sdk.NewDecFromInt(dust)) && !amountLeftInPUSD.Equal(sdk.ZeroDec()) && !TargetReachedFlag { + if amountLeftInPUSD.LT(sdkmath.LegacyNewDecFromInt(dust)) && !amountLeftInPUSD.Equal(sdkmath.LegacyZeroDec()) && !TargetReachedFlag { coll := auction.OutflowTokenCurrentAmount.Amount.Uint64() dust := dust.Uint64() - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Either bid all the collateral amount %d (UTOKEN) or bid amount by leaving dust greater than %d USD", coll, dust) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "Either bid all the collateral amount %d (UTOKEN) or bid amount by leaving dust greater than %d USD", coll, dust) } // Dust check for debt - if amountLeftInPUSDforDebt.LT(sdk.NewDecFromInt(dust)) && !amountLeftInPUSDforDebt.Equal(sdk.ZeroDec()) && !amountLeftInPUSD.Equal(sdk.ZeroDec()) { + if amountLeftInPUSDforDebt.LT(sdkmath.LegacyNewDecFromInt(dust)) && !amountLeftInPUSDforDebt.Equal(sdkmath.LegacyZeroDec()) && !amountLeftInPUSD.Equal(sdkmath.LegacyZeroDec()) { dust := dust.Uint64() - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Minimum amount left to be recovered should not be less than %d ", dust) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "Minimum amount left to be recovered should not be less than %d ", dust) } outFlowTokenCoin := sdk.NewCoin(auction.OutflowTokenInitAmount.Denom, slice) - if inFlowTokenCoin.Amount.GT(sdk.ZeroInt()) { + if inFlowTokenCoin.Amount.GT(sdkmath.ZeroInt()) { err = k.bank.SendCoinsFromAccountToModule(ctx, bidder, auctiontypes.ModuleName, sdk.NewCoins(inFlowTokenCoin)) if err != nil { return err } } - if outFlowTokenCoin.Amount.GT(sdk.ZeroInt()) { + if outFlowTokenCoin.Amount.GT(sdkmath.ZeroInt()) { err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidder, sdk.NewCoins(outFlowTokenCoin)) if err != nil { return err @@ -294,7 +297,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, a } total := auction.OutflowTokenCurrentAmount - if total.Amount.GT(sdk.ZeroInt()) { + if total.Amount.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, vaultHolder, sdk.NewCoins(total)) if err != nil { return err @@ -393,14 +396,14 @@ func (k Keeper) CloseDutchAuction( return auctiontypes.ErrorVaultNotFound } // calculate penalty - penaltyCoin := sdk.NewCoin(dutchAuction.InflowTokenCurrentAmount.Denom, sdk.ZeroInt()) + penaltyCoin := sdk.NewCoin(dutchAuction.InflowTokenCurrentAmount.Denom, sdkmath.ZeroInt()) // burn and send target CMST to collector - burnToken := sdk.NewCoin(dutchAuction.InflowTokenCurrentAmount.Denom, sdk.ZeroInt()) + burnToken := sdk.NewCoin(dutchAuction.InflowTokenCurrentAmount.Denom, sdkmath.ZeroInt()) burnToken.Amount = lockedVault.AmountOut penaltyCoin.Amount = dutchAuction.InflowTokenTargetAmount.Amount.Sub(burnToken.Amount) // burning - if burnToken.Amount.GT(sdk.ZeroInt()) { + if burnToken.Amount.GT(sdkmath.ZeroInt()) { err := k.bank.BurnCoins(ctx, auctiontypes.ModuleName, sdk.NewCoins(burnToken)) if err != nil { return err @@ -408,7 +411,7 @@ func (k Keeper) CloseDutchAuction( } // send penalty - if penaltyCoin.Amount.GT(sdk.ZeroInt()) { + if penaltyCoin.Amount.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, collectortypes.ModuleName, sdk.NewCoins(penaltyCoin)) if err != nil { return err @@ -492,14 +495,14 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, appID uint64) error { // If oracle Price is not required for the assetOut inFlowTokenCurrentPrice = ExtendedPairVault.AssetOutPrice } - tnume := dutchAuction.OutflowTokenInitialPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) + tnume := dutchAuction.OutflowTokenInitialPrice.Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) tdeno := dutchAuction.OutflowTokenInitialPrice.Sub(dutchAuction.OutflowTokenEndPrice) ntau := tnume.Quo(tdeno) - tau := sdk.NewInt(ntau.TruncateInt64()) + tau := sdkmath.NewInt(ntau.TruncateInt64()) dur := ctx.BlockTime().Sub(dutchAuction.StartTime) - seconds := sdk.NewInt(int64(dur.Seconds())) + seconds := sdkmath.NewInt(int64(dur.Seconds())) outFlowTokenCurrentPrice := k.getPriceFromLinearDecreaseFunction(dutchAuction.OutflowTokenInitialPrice, tau, seconds) - dutchAuction.InflowTokenCurrentPrice = sdk.NewDec(int64(inFlowTokenCurrentPrice)) + dutchAuction.InflowTokenCurrentPrice = sdkmath.LegacyNewDec(int64(inFlowTokenCurrentPrice)) dutchAuction.OutflowTokenCurrentPrice = outFlowTokenCurrentPrice err := k.SetDutchAuction(ctx, dutchAuction) if err != nil { @@ -524,16 +527,16 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, appID uint64) error { if dutchAuction.InflowTokenCurrentAmount.Amount.GTE(lockedVault.AmountOut) { flag = true } - penaltyCoin := sdk.NewCoin(dutchAuction.InflowTokenCurrentAmount.Denom, sdk.ZeroInt()) + penaltyCoin := sdk.NewCoin(dutchAuction.InflowTokenCurrentAmount.Denom, sdkmath.ZeroInt()) // burn and send target CMST to collector - burnToken := sdk.NewCoin(dutchAuction.InflowTokenCurrentAmount.Denom, sdk.ZeroInt()) + burnToken := sdk.NewCoin(dutchAuction.InflowTokenCurrentAmount.Denom, sdkmath.ZeroInt()) burnToken.Amount = lockedVault.AmountOut penaltyCoin.Amount = dutchAuction.InflowTokenCurrentAmount.Amount.Sub(burnToken.Amount) vaultID, userExists := k.vault.GetUserAppExtendedPairMappingData(ctx, dutchAuction.VaultOwner.String(), dutchAuction.AppId, lockedVault.ExtendedPairId) if !flag { if userExists { vaultData, _ := k.vault.GetVault(ctx, vaultID.VaultId) - if dutchAuction.OutflowTokenCurrentAmount.Amount.GT(sdk.ZeroInt()) { + if dutchAuction.OutflowTokenCurrentAmount.Amount.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, vaulttypes.ModuleName, sdk.NewCoins(dutchAuction.OutflowTokenCurrentAmount)) if err != nil { return err @@ -544,7 +547,7 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, appID uint64) error { vaultData.AmountOut = vaultData.AmountOut.Add(inflowLeft).Sub(penaltyAmt) k.vault.SetVault(ctx, vaultData) } else { - if dutchAuction.OutflowTokenCurrentAmount.Amount.GT(sdk.ZeroInt()) { + if dutchAuction.OutflowTokenCurrentAmount.Amount.GT(sdkmath.ZeroInt()) { err1 := k.bank.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, vaulttypes.ModuleName, sdk.NewCoins(dutchAuction.OutflowTokenCurrentAmount)) if err1 != nil { return err1 @@ -561,7 +564,7 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, appID uint64) error { burnToken.Amount = dutchAuction.InflowTokenCurrentAmount.Amount } // burning - if burnToken.Amount.GT(sdk.ZeroInt()) { + if burnToken.Amount.GT(sdkmath.ZeroInt()) { err := k.bank.BurnCoins(ctx, auctiontypes.ModuleName, sdk.NewCoins(burnToken)) if err != nil { return err @@ -569,7 +572,7 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, appID uint64) error { } if flag { // send penalty - if penaltyCoin.Amount.GT(sdk.ZeroInt()) { + if penaltyCoin.Amount.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, collectortypes.ModuleName, sdk.NewCoins(penaltyCoin)) if err != nil { return err @@ -593,8 +596,8 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, appID uint64) error { itemc.Amount = dutchAuction.OutflowTokenCurrentAmount.Amount itemc.IsCollateral = true coolOffData.CollateralTotalAmount = k.esm.CalcDollarValueOfToken(ctx, rateIn, itemc.Amount, assetData.Decimals) - coolOffData.DebtTotalAmount = sdk.ZeroDec() - itemc.Share = sdk.OneDec() + coolOffData.DebtTotalAmount = sdkmath.LegacyZeroDec() + itemc.Share = sdkmath.LegacyOneDec() err := k.bank.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, esmtypes.ModuleName, sdk.NewCoins(sdk.NewCoin(dutchAuction.OutflowTokenCurrentAmount.Denom, itemc.Amount))) if err != nil { return err @@ -644,7 +647,7 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, appID uint64) error { timeNow := ctx.BlockTime() dutchAuction.StartTime = timeNow dutchAuction.EndTime = timeNow.Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) - outFlowTokenInitialPrice := k.getOutflowTokenInitialPrice(sdk.NewIntFromUint64(OutFlowTokenCurrentPrice), auctionParams.Buffer) + outFlowTokenInitialPrice := k.getOutflowTokenInitialPrice(sdkmath.NewIntFromUint64(OutFlowTokenCurrentPrice), auctionParams.Buffer) outFlowTokenEndPrice := k.getOutflowTokenEndPrice(outFlowTokenInitialPrice, auctionParams.Cusp) dutchAuction.OutflowTokenInitialPrice = outFlowTokenInitialPrice dutchAuction.OutflowTokenEndPrice = outFlowTokenEndPrice diff --git a/x/auction/keeper/dutch_lend.go b/x/auction/keeper/dutch_lend.go index 383974392..2eb9bc6cb 100644 --- a/x/auction/keeper/dutch_lend.go +++ b/x/auction/keeper/dutch_lend.go @@ -4,6 +4,9 @@ import ( "strconv" "time" + errorsmod "cosmossdk.io/errors" + + sdkmath "cosmossdk.io/math" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" lendtypes "github.com/comdex-official/comdex/x/lend/types" @@ -26,11 +29,11 @@ func (k Keeper) LendDutchActivator(ctx sdk.Context, lockedVault liquidationtypes assetIn, _ := k.asset.GetAsset(ctx, extendedPair.AssetIn) // collateral assetOut, _ := k.asset.GetAsset(ctx, extendedPair.AssetOut) // debt - AssetInPrice, err := k.market.CalcAssetPrice(ctx, assetIn.Id, sdk.OneInt()) + AssetInPrice, err := k.market.CalcAssetPrice(ctx, assetIn.Id, sdkmath.OneInt()) if err != nil { return auctiontypes.ErrorPrices } - AssetOutPrice, err := k.market.CalcAssetPrice(ctx, assetOut.Id, sdk.OneInt()) + AssetOutPrice, err := k.market.CalcAssetPrice(ctx, assetOut.Id, sdkmath.OneInt()) if err != nil { return auctiontypes.ErrorPrices } @@ -60,7 +63,7 @@ func (k Keeper) StartLendDutchAuction( inFlowToken sdk.Coin, lockedVault liquidationtypes.LockedVault, assetInID, assetOutID uint64, // debt, collateral - liquidationPenalty sdk.Dec, + liquidationPenalty sdkmath.LegacyDec, ) error { // If oracle Price required for the assetOut twaInData, found := k.market.GetTwa(ctx, assetInID) @@ -79,7 +82,7 @@ func (k Keeper) StartLendDutchAuction( return auctiontypes.ErrorPrices } - outFlowTokenInitialPrice := k.getOutflowTokenInitialPrice(sdk.NewIntFromUint64(twaData.Twa), auctionParams.Buffer) + outFlowTokenInitialPrice := k.getOutflowTokenInitialPrice(sdkmath.NewIntFromUint64(twaData.Twa), auctionParams.Buffer) outFlowTokenEndPrice := k.getOutflowTokenEndPrice(outFlowTokenInitialPrice, auctionParams.Cusp) borrowOwner, err := sdk.AccAddressFromBech32(lockedVault.Owner) if err != nil { @@ -90,11 +93,11 @@ func (k Keeper) StartLendDutchAuction( OutflowTokenInitAmount: outFlowToken, OutflowTokenCurrentAmount: outFlowToken, InflowTokenTargetAmount: inFlowToken, - InflowTokenCurrentAmount: sdk.NewCoin(inFlowToken.Denom, sdk.NewIntFromUint64(0)), + InflowTokenCurrentAmount: sdk.NewCoin(inFlowToken.Denom, sdkmath.NewIntFromUint64(0)), OutflowTokenInitialPrice: outFlowTokenInitialPrice, OutflowTokenCurrentPrice: outFlowTokenInitialPrice, OutflowTokenEndPrice: outFlowTokenEndPrice, - InflowTokenCurrentPrice: sdk.NewDecFromInt(sdk.NewIntFromUint64(inFlowTokenPrice)), + InflowTokenCurrentPrice: sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(inFlowTokenPrice)), StartTime: ctx.BlockTime(), EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), AuctionStatus: auctiontypes.AuctionStartNoBids, @@ -134,18 +137,18 @@ func (k Keeper) StartLendDutchAuction( } func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin) error { - if bid.Amount.Equal(sdk.ZeroInt()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid amount can't be Zero") + if bid.Amount.Equal(sdkmath.ZeroInt()) { + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid amount can't be Zero") } auction, err := k.GetDutchLendAuction(ctx, appID, auctionMappingID, auctionID) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction id %d not found", auctionID) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "auction id %d not found", auctionID) } if bid.Denom != auction.OutflowTokenCurrentAmount.Denom { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid denom %s not found", bid.Denom) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid denom %s not found", bid.Denom) } if bid.Amount.GT(auction.OutflowTokenCurrentAmount.Amount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid amount can't be greater than collateral available") + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid amount can't be greater than collateral available") } // slice tells amount of collateral user should be given @@ -163,8 +166,8 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI if err != nil { return err } - if inFlowTokenAmount.LTE(sdk.ZeroInt()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Calculated Auction Amount is Zero") + if inFlowTokenAmount.LTE(sdkmath.ZeroInt()) { + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "Calculated Auction Amount is Zero") } TargetReachedFlag := false @@ -192,7 +195,7 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI assetStats, _ := k.lend.GetAssetRatesParams(ctx, ExtendedPairVault.AssetIn) assetOutPool, _ := k.lend.GetPool(ctx, ExtendedPairVault.AssetOutPoolID) // dust is in usd * 10*-6 (uusd) - dust := sdk.NewIntFromUint64(ExtendedPairVault.MinUsdValueLeft) + dust := sdkmath.NewIntFromUint64(ExtendedPairVault.MinUsdValueLeft) // here subtracting current amount and slice to get amount left in auction and also converting it to usd * 10**-12 outLeft, err := k.CalcDollarValueForToken(ctx, auction.AssetInId, outFlowTokenCurrentPrice, auction.OutflowTokenCurrentAmount.Amount) if err != nil { @@ -214,14 +217,14 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI // As tab is the amount calculated from difference of target and current inflow token we will be using same as inflow token // Dust check for collateral - if amountLeftInPUSD.LT(sdk.NewDecFromInt(dust)) && !amountLeftInPUSD.Equal(sdk.ZeroDec()) && !TargetReachedFlag { + if amountLeftInPUSD.LT(sdkmath.LegacyNewDecFromInt(dust)) && !amountLeftInPUSD.Equal(sdkmath.LegacyZeroDec()) && !TargetReachedFlag { coll := auction.OutflowTokenCurrentAmount.Amount.Uint64() - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Either bid all the collateral amount %d (UTOKEN) or bid amount by leaving dust greater than %d USD", coll, dust) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "Either bid all the collateral amount %d (UTOKEN) or bid amount by leaving dust greater than %d USD", coll, dust) } // Dust check for debt - if amountLeftInPUSDforDebt.LT(sdk.NewDecFromInt(dust)) && !amountLeftInPUSDforDebt.Equal(sdk.ZeroDec()) && !amountLeftInPUSD.Equal(sdk.ZeroDec()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Minimum amount left to be recovered should not be less than %d ", dust) + if amountLeftInPUSDforDebt.LT(sdkmath.LegacyNewDecFromInt(dust)) && !amountLeftInPUSDforDebt.Equal(sdkmath.LegacyZeroDec()) && !amountLeftInPUSD.Equal(sdkmath.LegacyZeroDec()) { + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "Minimum amount left to be recovered should not be less than %d ", dust) } outFlowTokenCoin := sdk.NewCoin(auction.OutflowTokenInitAmount.Denom, slice) @@ -238,7 +241,7 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI // calculating additional auction bonus to the bidder - auctionBonus := sdk.NewDecFromInt(slice).Mul(assetStats.LiquidationBonus) + auctionBonus := sdkmath.LegacyNewDecFromInt(slice).Mul(assetStats.LiquidationBonus) totalAmountToBidder := sdk.NewCoin(auction.OutflowTokenInitAmount.Denom, slice.Add(auctionBonus.TruncateInt())) biddingID, err := k.CreateNewDutchLendBid(ctx, appID, auctionMappingID, auctionID, bidder.String(), inFlowTokenCoin, outFlowTokenCoin) @@ -263,7 +266,7 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI if err != nil { panic(err) } - if total.Amount.GT(sdk.ZeroInt()) { + if total.Amount.GT(sdkmath.ZeroInt()) { err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, vaultHolder, sdk.NewCoins(total)) if err != nil { return err @@ -288,7 +291,7 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI // get reserve balance if the requiredAmount is available in the reserves or not modBal := k.lend.ModuleBalance(ctx, lendtypes.ModuleName, requiredAmount.Denom) if modBal.LT(requiredAmount.Amount) { - return sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "Reserve pool having insufficient balance for this bid") + return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "Reserve pool having insufficient balance for this bid") } // reduce the qty from reserve pool @@ -313,11 +316,11 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI if !found { allReserveStats = lendtypes.AllReserveStats{ AssetID: inFlowTokenAssetID, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), - AmountInFromRepayments: sdk.ZeroInt(), - TotalAmountOutToLenders: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), + AmountInFromRepayments: sdkmath.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } } allReserveStats.AmountOutFromReserveForAuction = allReserveStats.AmountOutFromReserveForAuction.Add(requiredAmount.Amount) @@ -401,11 +404,11 @@ func (k Keeper) CloseDutchLendAuction( lockedVault.AmountOut = lockedVault.AmountOut.Sub(dutchAuction.InflowTokenTargetAmount.Amount) lockedVault.UpdatedAmountOut = lockedVault.UpdatedAmountOut.Sub(dutchAuction.InflowTokenTargetAmount.Amount) - if lockedVault.AmountOut.LTE(sdk.ZeroInt()) { - lockedVault.AmountOut = sdk.ZeroInt() + if lockedVault.AmountOut.LTE(sdkmath.ZeroInt()) { + lockedVault.AmountOut = sdkmath.ZeroInt() } - if lockedVault.UpdatedAmountOut.LTE(sdk.ZeroInt()) { - lockedVault.UpdatedAmountOut = sdk.ZeroInt() + if lockedVault.UpdatedAmountOut.LTE(sdkmath.ZeroInt()) { + lockedVault.UpdatedAmountOut = sdkmath.ZeroInt() } k.liquidation.SetLockedVault(ctx, lockedVault) dutchAuction.AuctionStatus = auctiontypes.AuctionEnded @@ -455,16 +458,16 @@ func (k Keeper) RestartDutchLendAuctions(ctx sdk.Context, appID uint64) error { } inFlowTokenCurrentPrice := twaData.Twa - // inFlowTokenCurrentPrice := sdk.MustNewDecFromStr("1") - // tau := sdk.NewInt(int64(auctionParams.AuctionDurationSeconds)) - tnume := dutchAuction.OutflowTokenInitialPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) + // inFlowTokenCurrentPrice := sdkmath.LegacyMustNewDecFromStr("1") + // tau := sdkmath.NewInt(int64(auctionParams.AuctionDurationSeconds)) + tnume := dutchAuction.OutflowTokenInitialPrice.Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) tdeno := dutchAuction.OutflowTokenInitialPrice.Sub(dutchAuction.OutflowTokenEndPrice) ntau := tnume.Quo(tdeno) - tau := sdk.NewInt(ntau.TruncateInt64()) + tau := sdkmath.NewInt(ntau.TruncateInt64()) dur := ctx.BlockTime().Sub(dutchAuction.StartTime) - seconds := sdk.NewInt(int64(dur.Seconds())) + seconds := sdkmath.NewInt(int64(dur.Seconds())) outFlowTokenCurrentPrice := k.getPriceFromLinearDecreaseFunction(dutchAuction.OutflowTokenInitialPrice, tau, seconds) - dutchAuction.InflowTokenCurrentPrice = sdk.NewDec(int64(inFlowTokenCurrentPrice)) + dutchAuction.InflowTokenCurrentPrice = sdkmath.LegacyNewDec(int64(inFlowTokenCurrentPrice)) dutchAuction.OutflowTokenCurrentPrice = outFlowTokenCurrentPrice err := k.SetDutchLendAuction(ctx, dutchAuction) if err != nil { @@ -479,7 +482,7 @@ func (k Keeper) RestartDutchLendAuctions(ctx sdk.Context, appID uint64) error { OutFlowTokenCurrentPrice := twaData.Twa dutchAuction.StartTime = ctx.BlockTime() dutchAuction.EndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) - outFlowTokenInitialPrice := k.getOutflowTokenInitialPrice(sdk.NewIntFromUint64(OutFlowTokenCurrentPrice), auctionParams.Buffer) + outFlowTokenInitialPrice := k.getOutflowTokenInitialPrice(sdkmath.NewIntFromUint64(OutFlowTokenCurrentPrice), auctionParams.Buffer) outFlowTokenEndPrice := k.getOutflowTokenEndPrice(outFlowTokenInitialPrice, auctionParams.Cusp) dutchAuction.OutflowTokenInitialPrice = outFlowTokenInitialPrice dutchAuction.OutflowTokenEndPrice = outFlowTokenEndPrice diff --git a/x/auction/keeper/dutch_lend_test.go b/x/auction/keeper/dutch_lend_test.go index a8c6b9983..e1cc685ba 100644 --- a/x/auction/keeper/dutch_lend_test.go +++ b/x/auction/keeper/dutch_lend_test.go @@ -1,7 +1,9 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "fmt" + assetTypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/auction" auctionKeeper "github.com/comdex-official/comdex/x/auction/keeper" @@ -13,8 +15,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func Dec(s string) sdk.Dec { - dec, err := sdk.NewDecFromStr(s) +func Dec(s string) sdkmath.LegacyDec { + dec, err := sdkmath.LegacyNewDecFromStr(s) if err != nil { panic(err) } @@ -27,7 +29,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err := assetKeeper.AddAppRecords(*ctx, msg1) @@ -36,7 +38,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg2 := assetTypes.AppData{ Name: "harbor", ShortName: "harbor", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg2) @@ -44,7 +46,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg3 := assetTypes.AppData{ Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg3) @@ -53,7 +55,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg4 := assetTypes.Asset{ //1 Name: "ATOM", Denom: "uatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -75,7 +77,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg5 := assetTypes.Asset{ //2 Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -97,7 +99,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg6 := assetTypes.Asset{ //3 Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -119,7 +121,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg13a := assetTypes.Asset{ //4 Name: "OSMO", Denom: "uosmo", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg13a) @@ -139,7 +141,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg11 := assetTypes.Asset{ //5 Name: "CATOM", Denom: "ucatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg11) @@ -148,7 +150,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg12 := assetTypes.Asset{ //6 Name: "CCMDX", Denom: "uccmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg12) @@ -157,7 +159,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg13 := assetTypes.Asset{ //7 Name: "CCMST", Denom: "uccmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg13) @@ -166,7 +168,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg13b := assetTypes.Asset{ //8 Name: "COSMO", Denom: "ucosmo", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg13b) @@ -254,33 +256,33 @@ func (s *KeeperTestSuite) AddAppAssetLend() { assetDataPoolOneAssetOne := &lendtypes.AssetDataPoolMapping{ AssetID: 1, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataPoolOneAssetTwo := &lendtypes.AssetDataPoolMapping{ AssetID: 2, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000), } assetDataPoolOneAssetThree := &lendtypes.AssetDataPoolMapping{ AssetID: 3, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataPoolTwoAssetOne := &lendtypes.AssetDataPoolMapping{ AssetID: 1, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataPoolTwoAssetTwo := &lendtypes.AssetDataPoolMapping{ AssetID: 4, AssetTransitType: 1, - SupplyCap: sdk.NewDec(2000000000000), + SupplyCap: sdkmath.LegacyNewDec(2000000000000), } assetDataPoolTwoAssetThree := &lendtypes.AssetDataPoolMapping{ AssetID: 3, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataCMDXPool = append(assetDataCMDXPool, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -514,7 +516,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { AuctionDurationSeconds: 21600, Buffer: Dec("1.2"), Cusp: Dec("0.7"), - Step: sdk.NewInt(360), + Step: sdkmath.NewInt(360), PriceFunctionType: 1, DutchId: 3, BidDurationSeconds: 3600, @@ -526,28 +528,28 @@ func (s *KeeperTestSuite) AddAppAssetLend() { userAddr := "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t" userAddress, _ := sdk.AccAddressFromBech32(userAddr) - s.fundAddr(userAddress, sdk.NewCoin("uatom", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 1, userAddr, sdk.NewCoin("uatom", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 1, userAddr, sdk.NewCoin("uatom", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(100000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 2, userAddr, sdk.NewCoin("ucmdx", sdk.NewInt(1000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 2, userAddr, sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdk.NewIntFromUint64(100000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdkmath.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 3, userAddr, sdk.NewCoin("ucmst", sdk.NewInt(100000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 3, userAddr, sdk.NewCoin("ucmst", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("uosmo", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 2, 4, userAddr, sdk.NewCoin("uosmo", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uosmo", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 2, 4, userAddr, sdk.NewCoin("uosmo", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 2, 3, userAddr, sdk.NewCoin("ucmst", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 2, 3, userAddr, sdk.NewCoin("ucmst", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("uatom", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 2, 1, userAddr, sdk.NewCoin("uatom", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 2, 1, userAddr, sdk.NewCoin("uatom", sdkmath.NewInt(100000000000))) s.Require().NoError(err) lendKeeper, ctx = &s.lendKeeper, &s.ctx @@ -557,28 +559,28 @@ func (s *KeeperTestSuite) AddAppAssetLend() { Lender: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", AssetId: 1, PoolId: 1, - AmountIn: sdk.NewCoin("uatom", sdk.NewInt(100000000000)), + AmountIn: sdk.NewCoin("uatom", sdkmath.NewInt(100000000000)), PairId: 3, IsStableBorrow: false, - AmountOut: sdk.NewCoin("ucmdx", sdk.NewInt(70000000000)), + AmountOut: sdk.NewCoin("ucmdx", sdkmath.NewInt(70000000000)), AppId: 3, } - s.fundAddr(userAddress, sdk.NewCoin("uatom", sdk.NewIntFromUint64(1000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(1000000000000))) _, err = server.BorrowAlternate(sdk.WrapSDKContext(*ctx), &msg20) s.Require().NoError(err) msg30 := lendtypes.MsgBorrowAlternate{ Lender: "cosmos1kwtdrjkwu6y87vlylaeatzmc5p4jhvn7qwqnkp", AssetId: 1, PoolId: 1, - AmountIn: sdk.NewCoin("uatom", sdk.NewInt(100000000000)), + AmountIn: sdk.NewCoin("uatom", sdkmath.NewInt(100000000000)), PairId: 3, IsStableBorrow: false, - AmountOut: sdk.NewCoin("ucmdx", sdk.NewInt(70000000000)), + AmountOut: sdk.NewCoin("ucmdx", sdkmath.NewInt(70000000000)), AppId: 3, } userAddr2, _ := sdk.AccAddressFromBech32("cosmos1kwtdrjkwu6y87vlylaeatzmc5p4jhvn7qwqnkp") - s.fundAddr(userAddr2, sdk.NewCoin("uatom", sdk.NewIntFromUint64(1000000000000))) + s.fundAddr(userAddr2, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(1000000000000))) _, err = server.BorrowAlternate(sdk.WrapSDKContext(*ctx), &msg30) s.Require().NoError(err) @@ -586,14 +588,14 @@ func (s *KeeperTestSuite) AddAppAssetLend() { Lender: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", AssetId: 2, PoolId: 1, - AmountIn: sdk.NewCoin("ucmdx", sdk.NewInt(100000000000)), + AmountIn: sdk.NewCoin("ucmdx", sdkmath.NewInt(100000000000)), PairId: 13, IsStableBorrow: false, - AmountOut: sdk.NewCoin("uosmo", sdk.NewInt(32500000000)), + AmountOut: sdk.NewCoin("uosmo", sdkmath.NewInt(32500000000)), AppId: 3, } - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(1000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(1000000000000))) _, err = server.BorrowAlternate(sdk.WrapSDKContext(*ctx), &msg40) s.Require().NoError(err) } @@ -667,7 +669,7 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { updatedPrice := price.Sub(price.Mul(Dec("0.09090909090"))) s.Require().Equal(lockedVault[0].CollateralToBeAuctioned.TruncateInt(), updatedPrice.TruncateInt()) - s.Require().Equal(lockedVault[0].CrAtLiquidation, sdk.NewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)).Quo(sdk.NewDecFromInt(beforeAmtIn).Mul(s.GetAssetPrice(1)))) + s.Require().Equal(lockedVault[0].CrAtLiquidation, sdkmath.LegacyNewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)).Quo(sdkmath.LegacyNewDecFromInt(beforeAmtIn).Mul(s.GetAssetPrice(1)))) } func (s *KeeperTestSuite) TestDutchActivatorLend() { @@ -690,7 +692,7 @@ func (s *KeeperTestSuite) TestDutchActivatorLend() { s.Require().Equal(dutchAuction.AppId, lockedVault.AppId) s.Require().Equal(dutchAuction.AuctionId, auctionId) s.Require().Equal(dutchAuction.AuctionMappingId, auctionMappingId) - s.Require().Equal(dutchAuction.InflowTokenCurrentAmount.Amount, sdk.ZeroInt()) + s.Require().Equal(dutchAuction.InflowTokenCurrentAmount.Amount, sdkmath.ZeroInt()) s.Require().Equal(dutchAuction.VaultOwner, addr1) s.Require().Equal(dutchAuction.AuctionStatus, auctionTypes.AuctionStartNoBids) @@ -698,9 +700,9 @@ func (s *KeeperTestSuite) TestDutchActivatorLend() { s.Require().True(found) assetInPrice, found := s.marketKeeper.GetTwa(*ctx, dutchAuction.AssetInId) s.Require().True(found) - s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, sdk.NewDecFromInt(sdk.NewIntFromUint64(assetOutPrice.Twa)).Mul(sdk.MustNewDecFromStr("1.2"))) - s.Require().Equal(dutchAuction.OutflowTokenEndPrice, dutchAuction.OutflowTokenInitialPrice.Mul(sdk.MustNewDecFromStr("0.7"))) - s.Require().Equal(dutchAuction.InflowTokenCurrentPrice, sdk.NewDecFromInt(sdk.NewIntFromUint64(assetInPrice.Twa))) + s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(assetOutPrice.Twa)).Mul(sdkmath.LegacyMustNewDecFromStr("1.2"))) + s.Require().Equal(dutchAuction.OutflowTokenEndPrice, dutchAuction.OutflowTokenInitialPrice.Mul(sdkmath.LegacyMustNewDecFromStr("0.7"))) + s.Require().Equal(dutchAuction.InflowTokenCurrentPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(assetInPrice.Twa))) } func (s *KeeperTestSuite) TestLendDutchBid() { @@ -808,14 +810,14 @@ func (s *KeeperTestSuite) TestLendDutchBid() { s.Require().NoError(err) userBid, err := k.GetDutchLendUserBidding(*ctx, userAddress1, appID, biddingID) - userReceivableAmount := sdk.NewDecFromInt(tc.msg.Amount.Amount).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() - auctionBonus := sdk.NewDecFromInt(userReceivableAmount).Mul(Dec("0.005")) + userReceivableAmount := sdkmath.LegacyNewDecFromInt(tc.msg.Amount.Amount).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() + auctionBonus := sdkmath.LegacyNewDecFromInt(userReceivableAmount).Mul(Dec("0.005")) userOutflowCoin := sdk.NewCoin("ucmdx", userReceivableAmount) userOutflowCoinFinal := sdk.NewCoin("ucmdx", userReceivableAmount.Add(auctionBonus.TruncateInt())) userInflowCoin := tc.msg.Amount s.Require().Equal(beforeAuction.OutflowTokenCurrentAmount.Sub(userInflowCoin), afterAuction.OutflowTokenCurrentAmount) s.Require().Equal(beforeAuction.InflowTokenCurrentAmount.Add(userOutflowCoin), afterAuction.InflowTokenCurrentAmount) - s.Require().Equal(beforeCmdxBalance.Add(userInflowCoin).Add(sdk.NewCoin("uatom", sdk.NewInt(50))), afterCmdxBalance) + s.Require().Equal(beforeCmdxBalance.Add(userInflowCoin).Add(sdk.NewCoin("uatom", sdkmath.NewInt(50))), afterCmdxBalance) s.Require().Equal(beforeCmstBalance.Sub(userOutflowCoin), afterCmstBalance) s.Require().Equal(userBid.BiddingId, biddingID) s.Require().Equal(userBid.AppId, appID) @@ -937,14 +939,14 @@ func (s *KeeperTestSuite) TestLendDutchBid3() { s.Require().NoError(err) userBid, err := k.GetDutchLendUserBidding(*ctx, userAddress1, appID, biddingID) - userReceivableAmount := sdk.NewDecFromInt(tc.msg.Amount.Amount).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() - auctionBonus := sdk.NewDecFromInt(userReceivableAmount).Mul(Dec("0.005")) + userReceivableAmount := sdkmath.LegacyNewDecFromInt(tc.msg.Amount.Amount).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() + auctionBonus := sdkmath.LegacyNewDecFromInt(userReceivableAmount).Mul(Dec("0.005")) userOutflowCoin := sdk.NewCoin("uosmo", userReceivableAmount) userOutflowCoinFinal := sdk.NewCoin("uosmo", userReceivableAmount.Add(auctionBonus.TruncateInt())) userInflowCoin := tc.msg.Amount s.Require().Equal(beforeAuction.OutflowTokenCurrentAmount.Sub(userInflowCoin), afterAuction.OutflowTokenCurrentAmount) s.Require().Equal(beforeAuction.InflowTokenCurrentAmount.Add(userOutflowCoin), afterAuction.InflowTokenCurrentAmount) - s.Require().Equal(beforeCmdxBalance.Add(userInflowCoin).Add(sdk.NewCoin("ucmdx", sdk.NewInt(50))), afterCmdxBalance) + s.Require().Equal(beforeCmdxBalance.Add(userInflowCoin).Add(sdk.NewCoin("ucmdx", sdkmath.NewInt(50))), afterCmdxBalance) s.Require().Equal(beforeCmstBalance.Sub(userOutflowCoin), afterCmstBalance) s.Require().Equal(userBid.BiddingId, biddingID) s.Require().Equal(userBid.AppId, appID) @@ -1070,7 +1072,7 @@ func (s *KeeperTestSuite) TestCloseDutchLendAuctionWithProtocolLoss() { err1 := k.FundModule(*ctx, auctionTypes.ModuleName, "ucmdx", 5072463519) s.Require().NoError(err1) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(*ctx, auctionTypes.ModuleName, lendtypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmdx", sdk.NewInt(5072463519)))) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(*ctx, auctionTypes.ModuleName, lendtypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmdx", sdkmath.NewInt(5072463519)))) s.Require().NoError(err) _, err = server.MsgPlaceDutchLendBid(sdk.WrapSDKContext(*ctx), @@ -1115,7 +1117,7 @@ func (s *KeeperTestSuite) TestRestartDutchLendAuction() { _, err = k.GetDutchLendAuction(*ctx, appId, auctionMappingId, auctionId) s.Require().NoError(err) - //s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, startPrice.Mul(sdk.MustNewDecFromStr("0.7"))) + //s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, startPrice.Mul(sdkmath.LegacyMustNewDecFromStr("0.7"))) // full the auction duration RESTART s.advanceseconds(1) @@ -1156,5 +1158,5 @@ func (s *KeeperTestSuite) TestRestartDutchLendAuction() { _, err = k.GetDutchLendAuction(*ctx, appId, auctionMappingId, auctionId) s.Require().NoError(err) - //s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, startPrice.Mul(sdk.MustNewDecFromStr("0.85"))) + //s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, startPrice.Mul(sdkmath.LegacyMustNewDecFromStr("0.85"))) } diff --git a/x/auction/keeper/dutch_test.go b/x/auction/keeper/dutch_test.go index 3098e2f1d..768bb265a 100644 --- a/x/auction/keeper/dutch_test.go +++ b/x/auction/keeper/dutch_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/auction" @@ -33,15 +34,15 @@ func (s *KeeperTestSuite) AddPairAndExtendedPairVault1() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -103,8 +104,8 @@ func (s *KeeperTestSuite) CreateVault() { From: userAddress1, AppId: 1, ExtendedPairVaultId: 1, - AmountIn: sdk.NewIntFromUint64(1000000), - AmountOut: sdk.NewIntFromUint64(1000000), + AmountIn: sdkmath.NewIntFromUint64(1000000), + AmountOut: sdkmath.NewIntFromUint64(1000000), }, }, { @@ -113,8 +114,8 @@ func (s *KeeperTestSuite) CreateVault() { From: userAddress2, AppId: 1, ExtendedPairVaultId: 1, - AmountIn: sdk.NewIntFromUint64(1000000), - AmountOut: sdk.NewIntFromUint64(1000000), + AmountIn: sdkmath.NewIntFromUint64(1000000), + AmountOut: sdkmath.NewIntFromUint64(1000000), }, }, } { @@ -143,11 +144,11 @@ func (s *KeeperTestSuite) GetVaultCountForExtendedPairIDbyAppID(appID, extID uin return len(res.VaultIds) } -func (s *KeeperTestSuite) GetAssetPrice(id uint64) sdk.Dec { +func (s *KeeperTestSuite) GetAssetPrice(id uint64) sdkmath.LegacyDec { marketKeeper, ctx := &s.marketKeeper, &s.ctx price, found := marketKeeper.GetTwa(*ctx, id) s.Require().True(found) - price1 := sdk.NewDecFromInt(sdk.NewIntFromUint64(price.Twa)) + price1 := sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(price.Twa)) return price1 } @@ -158,12 +159,12 @@ func (s *KeeperTestSuite) AddAppAsset() { s.Require().NoError(err) addr2, err := sdk.AccAddressFromBech32(userAddress2) s.Require().NoError(err) - genesisSupply := sdk.NewIntFromUint64(1000000) + genesisSupply := sdkmath.NewIntFromUint64(1000000) assetKeeper, ctx := &s.assetKeeper, &s.ctx msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -192,7 +193,7 @@ func (s *KeeperTestSuite) AddAppAsset() { assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, }, @@ -202,7 +203,7 @@ func (s *KeeperTestSuite) AddAppAsset() { assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, }, @@ -212,7 +213,7 @@ func (s *KeeperTestSuite) AddAppAsset() { assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, }, @@ -221,8 +222,8 @@ func (s *KeeperTestSuite) AddAppAsset() { s.Run(tc.name, func() { err := assetKeeper.AddAssetRecords(*ctx, tc.msg) s.Require().NoError(err) - s.fundAddr(addr, sdk.NewCoin(tc.msg.Denom, sdk.NewInt(1000000))) - s.fundAddr(addr2, sdk.NewCoin(tc.msg.Denom, sdk.NewInt(1000000))) + s.fundAddr(addr, sdk.NewCoin(tc.msg.Denom, sdkmath.NewInt(1000000))) + s.fundAddr(addr2, sdk.NewCoin(tc.msg.Denom, sdkmath.NewInt(1000000))) }) } } @@ -259,7 +260,7 @@ func (s *KeeperTestSuite) LiquidateVaults1() { s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) s.Require().Equal(lockedVault[0].AmountIn, beforeVault.AmountIn) s.Require().Equal(lockedVault[0].AmountOut, beforeVault.AmountOut) - s.Require().Equal(lockedVault[0].UpdatedAmountOut, sdk.ZeroInt()) + s.Require().Equal(lockedVault[0].UpdatedAmountOut, sdkmath.ZeroInt()) s.Require().Equal(lockedVault[0].Initiator, liquidationTypes.ModuleName) s.Require().Equal(lockedVault[0].IsAuctionInProgress, true) s.Require().Equal(lockedVault[0].IsAuctionComplete, false) @@ -267,7 +268,7 @@ func (s *KeeperTestSuite) LiquidateVaults1() { price, err := s.app.MarketKeeper.CalcAssetPrice(*ctx, uint64(1), beforeVault.AmountIn) s.Require().NoError(err) s.Require().Equal(lockedVault[0].CollateralToBeAuctioned, price) - s.Require().Equal(lockedVault[0].CrAtLiquidation, sdk.NewDecFromInt(lockedVault[0].AmountIn).Mul(s.GetAssetPrice(1)).Quo(sdk.NewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)))) + s.Require().Equal(lockedVault[0].CrAtLiquidation, sdkmath.LegacyNewDecFromInt(lockedVault[0].AmountIn).Mul(s.GetAssetPrice(1)).Quo(sdkmath.LegacyNewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)))) } func (s *KeeperTestSuite) AddAuctionParams() { @@ -275,9 +276,9 @@ func (s *KeeperTestSuite) AddAuctionParams() { auctionParams := auctionTypes.AuctionParams{ AppId: 1, AuctionDurationSeconds: 300, - Buffer: sdk.MustNewDecFromStr("1.2"), - Cusp: sdk.MustNewDecFromStr("0.6"), - Step: sdk.NewIntFromUint64(1), + Buffer: sdkmath.LegacyMustNewDecFromStr("1.2"), + Cusp: sdkmath.LegacyMustNewDecFromStr("0.6"), + Step: sdkmath.NewIntFromUint64(1), PriceFunctionType: 1, SurplusId: 1, DebtId: 2, @@ -314,10 +315,10 @@ func (s *KeeperTestSuite) TestDutchActivator() { s.Require().Equal(dutchAuction.AuctionMappingId, auctionMappingId) s.Require().Equal(dutchAuction.OutflowTokenInitAmount.Amount, lockedVault.AmountIn) s.Require().Equal(dutchAuction.OutflowTokenCurrentAmount.Amount, lockedVault.AmountIn) - s.Require().Equal(dutchAuction.InflowTokenCurrentAmount.Amount, sdk.ZeroInt()) + s.Require().Equal(dutchAuction.InflowTokenCurrentAmount.Amount, sdkmath.ZeroInt()) inFlowTokenTargetAmount := lockedVault.AmountOut - mulfactor := sdk.NewDecFromInt(inFlowTokenTargetAmount).Mul(dutchAuction.LiquidationPenalty) + mulfactor := sdkmath.LegacyNewDecFromInt(inFlowTokenTargetAmount).Mul(dutchAuction.LiquidationPenalty) inFlowTokenTargetAmount = inFlowTokenTargetAmount.Add(mulfactor.TruncateInt()).Add(lockedVault.InterestAccumulated) s.Require().Equal(dutchAuction.InflowTokenTargetAmount.Amount, inFlowTokenTargetAmount) @@ -329,9 +330,9 @@ func (s *KeeperTestSuite) TestDutchActivator() { s.Require().True(found) assetInPrice, found := s.marketKeeper.GetTwa(*ctx, dutchAuction.AssetInId) s.Require().True(found) - s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, sdk.NewDecFromInt(sdk.NewIntFromUint64(assetOutPrice.Twa)).Mul(sdk.MustNewDecFromStr("1.2"))) - s.Require().Equal(dutchAuction.OutflowTokenEndPrice, dutchAuction.OutflowTokenInitialPrice.Mul(sdk.MustNewDecFromStr("0.6"))) - s.Require().Equal(dutchAuction.InflowTokenCurrentPrice, sdk.NewDecFromInt(sdk.NewIntFromUint64(assetInPrice.Twa))) + s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(assetOutPrice.Twa)).Mul(sdkmath.LegacyMustNewDecFromStr("1.2"))) + s.Require().Equal(dutchAuction.OutflowTokenEndPrice, dutchAuction.OutflowTokenInitialPrice.Mul(sdkmath.LegacyMustNewDecFromStr("0.6"))) + s.Require().Equal(dutchAuction.InflowTokenCurrentPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(assetInPrice.Twa))) } func (s *KeeperTestSuite) TestDutchBid() { @@ -439,7 +440,7 @@ func (s *KeeperTestSuite) TestDutchBid() { s.Require().NoError(err) userBid, err := k.GetDutchUserBidding(*ctx, userAddress1, appID, biddingID) - userReceivableAmount := sdk.NewDecFromInt(tc.msg.Amount.Amount).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() + userReceivableAmount := sdkmath.LegacyNewDecFromInt(tc.msg.Amount.Amount).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() userOutflowCoin := sdk.NewCoin("ucmst", userReceivableAmount) userInflowCoin := tc.msg.Amount s.Require().Equal(beforeAuction.OutflowTokenCurrentAmount.Sub(userInflowCoin), afterAuction.OutflowTokenCurrentAmount) @@ -527,10 +528,10 @@ func (s *KeeperTestSuite) TestCloseDutchAuctionWithProtocolLoss() { err1 := k.FundModule(*ctx, auctionTypes.ModuleName, "ucmst", 10000000) s.Require().NoError(err1) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(*ctx, auctionTypes.ModuleName, collectorTypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmst", sdk.NewInt(10000000)))) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(*ctx, auctionTypes.ModuleName, collectorTypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmst", sdkmath.NewInt(10000000)))) s.Require().NoError(err) - err = s.app.CollectorKeeper.SetNetFeeCollectedData(*ctx, 1, 2, sdk.NewInt(10000000)) + err = s.app.CollectorKeeper.SetNetFeeCollectedData(*ctx, 1, 2, sdkmath.NewInt(10000000)) s.Require().NoError(err) _, err = server.MsgPlaceDutchBid(sdk.WrapSDKContext(*ctx), @@ -558,7 +559,7 @@ func (s *KeeperTestSuite) TestCloseDutchAuctionWithProtocolLoss() { // verify loss stats, found := k.GetProtocolStat(*ctx, appId, 2) s.Require().True(found) - loss := sdk.NewDecFromInt(afterAuction.InflowTokenTargetAmount.Sub(afterAuction.InflowTokenCurrentAmount).Amount) + loss := sdkmath.LegacyNewDecFromInt(afterAuction.InflowTokenTargetAmount.Sub(afterAuction.InflowTokenCurrentAmount).Amount) s.Require().Equal(loss, stats.Loss) } @@ -580,7 +581,7 @@ func (s *KeeperTestSuite) TestRestartDutchAuction() { dutchAuction, err = k.GetDutchAuction(*ctx, appId, auctionMappingId, auctionId) s.Require().NoError(err) - s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, startPrice.Mul(sdk.MustNewDecFromStr("0.6"))) + s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, startPrice.Mul(sdkmath.LegacyMustNewDecFromStr("0.6"))) // full the auction duration RESTART s.advanceseconds(1) @@ -621,5 +622,5 @@ func (s *KeeperTestSuite) TestRestartDutchAuction() { dutchAuction, err = k.GetDutchAuction(*ctx, appId, auctionMappingId, auctionId) s.Require().NoError(err) - s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, startPrice.Mul(sdk.MustNewDecFromStr("0.8"))) + s.Require().Equal(dutchAuction.OutflowTokenCurrentPrice, startPrice.Mul(sdkmath.LegacyMustNewDecFromStr("0.8"))) } diff --git a/x/auction/keeper/genesis_store.go b/x/auction/keeper/genesis_store.go index fa4ff3312..8c11db9dc 100644 --- a/x/auction/keeper/genesis_store.go +++ b/x/auction/keeper/genesis_store.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" auctiontypes "github.com/comdex-official/comdex/x/auction/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -33,7 +34,7 @@ func (k Keeper) SetGenDutchAuction(ctx sdk.Context, auction auctiontypes.DutchAu store.Set(key, value) } -func (k Keeper) SetGenProtocolStatistics(ctx sdk.Context, appID, assetID uint64, amount sdk.Dec) { +func (k Keeper) SetGenProtocolStatistics(ctx sdk.Context, appID, assetID uint64, amount sdkmath.LegacyDec) { var ( store = k.Store(ctx) key = auctiontypes.ProtocolStatisticsKey(appID, assetID) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 6a65b5110..a06c46ef8 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -3,10 +3,10 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -76,6 +76,6 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.storeKey) } diff --git a/x/auction/keeper/keeper_test.go b/x/auction/keeper/keeper_test.go index 542197c91..f073b6ff4 100644 --- a/x/auction/keeper/keeper_test.go +++ b/x/auction/keeper/keeper_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -51,7 +50,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.vaultKeeper = s.app.VaultKeeper s.liquidationKeeper = s.app.LiquidationKeeper s.assetKeeper = s.app.AssetKeeper diff --git a/x/auction/keeper/math.go b/x/auction/keeper/math.go index a90f35f3d..7056a8e7e 100644 --- a/x/auction/keeper/math.go +++ b/x/auction/keeper/math.go @@ -1,26 +1,26 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" ) -func Multiply(a, b sdk.Dec) sdk.Dec { +func Multiply(a, b sdkmath.LegacyDec) sdkmath.LegacyDec { return a.Mul(b) } -func (k Keeper) getOutflowTokenInitialPrice(price sdk.Int, buffer sdk.Dec) sdk.Dec { - result := buffer.Mul(sdk.NewDecFromInt(price)) +func (k Keeper) getOutflowTokenInitialPrice(price sdkmath.Int, buffer sdkmath.LegacyDec) sdkmath.LegacyDec { + result := buffer.Mul(sdkmath.LegacyNewDecFromInt(price)) return result } -func (k Keeper) getOutflowTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { +func (k Keeper) getOutflowTokenEndPrice(price, cusp sdkmath.LegacyDec) sdkmath.LegacyDec { result := Multiply(price, cusp) return result } -func (k Keeper) getPriceFromLinearDecreaseFunction(top sdk.Dec, tau, dur sdk.Int) sdk.Dec { +func (k Keeper) getPriceFromLinearDecreaseFunction(top sdkmath.LegacyDec, tau, dur sdkmath.Int) sdkmath.LegacyDec { result1 := tau.Sub(dur) - result2 := top.Mul(sdk.NewDecFromInt(result1)) - result3 := result2.Quo(sdk.NewDecFromInt(tau)) + result2 := top.Mul(sdkmath.LegacyNewDecFromInt(result1)) + result3 := result2.Quo(sdkmath.LegacyNewDecFromInt(tau)) return result3 } diff --git a/x/auction/keeper/math_test.go b/x/auction/keeper/math_test.go index 825ac8ef6..e1876ee8f 100644 --- a/x/auction/keeper/math_test.go +++ b/x/auction/keeper/math_test.go @@ -4,25 +4,25 @@ import ( "fmt" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" ) -func getBurnAmount(amount sdk.Int, liqPenalty sdk.Dec) sdk.Int { - liqPenalty = liqPenalty.Add(sdk.NewDec(1)) - result := sdk.NewDecFromInt(amount).Quo(liqPenalty).Ceil().TruncateInt() +func getBurnAmount(amount sdkmath.Int, liqPenalty sdkmath.LegacyDec) sdkmath.Int { + liqPenalty = liqPenalty.Add(sdkmath.LegacyNewDec(1)) + result := sdkmath.LegacyNewDecFromInt(amount).Quo(liqPenalty).Ceil().TruncateInt() return result } func TestRed(t *testing.T) { - amount := sdk.NewInt(100) - liq := sdk.MustNewDecFromStr("0.15") + amount := sdkmath.NewInt(100) + liq := sdkmath.LegacyMustNewDecFromStr("0.15") fmt.Println(getBurnAmount(amount, liq)) } func TestAdd(t *testing.T) { - a := sdk.ZeroInt() - b := sdk.NewIntFromUint64(300) - c := sdk.NewIntFromUint64(100) + a := sdkmath.ZeroInt() + b := sdkmath.NewIntFromUint64(300) + c := sdkmath.NewIntFromUint64(100) d := b.Add(a.Sub(c)) fmt.Println(d) } diff --git a/x/auction/keeper/query_server.go b/x/auction/keeper/query_server.go index 7e7285a03..9764c0180 100644 --- a/x/auction/keeper/query_server.go +++ b/x/auction/keeper/query_server.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" diff --git a/x/auction/keeper/store.go b/x/auction/keeper/store.go index 0e902ca62..f6943c860 100644 --- a/x/auction/keeper/store.go +++ b/x/auction/keeper/store.go @@ -1,29 +1,32 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protobuftypes "github.com/cosmos/gogoproto/types" + sdkmath "cosmossdk.io/math" auctiontypes "github.com/comdex-official/comdex/x/auction/types" ) // Generic for all auctions. -func (k Keeper) SetProtocolStatistics(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) { +func (k Keeper) SetProtocolStatistics(ctx sdk.Context, appID, assetID uint64, amount sdkmath.Int) { var ( store = k.Store(ctx) key = auctiontypes.ProtocolStatisticsKey(appID, assetID) ) stat, found := k.GetProtocolStat(ctx, appID, assetID) if found { - stat.Loss = stat.Loss.Add(sdk.NewDecFromInt(amount)) + stat.Loss = stat.Loss.Add(sdkmath.LegacyNewDecFromInt(amount)) value := k.cdc.MustMarshal(&stat) store.Set(key, value) } else { var stats auctiontypes.ProtocolStatistics stats.AppId = appID stats.AssetId = assetID - stats.Loss = sdk.NewDecFromInt(amount) + stats.Loss = sdkmath.LegacyNewDecFromInt(amount) value := k.cdc.MustMarshal(&stats) store.Set(key, value) } @@ -45,10 +48,10 @@ func (k Keeper) GetProtocolStat(ctx sdk.Context, appID, assetID uint64) (stats a func (k Keeper) GetAllProtocolStat(ctx sdk.Context) (protocolStatistics []auctiontypes.ProtocolStatistics) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, auctiontypes.ProtocolStatisticsPrefixKey) + iter = storetypes.KVStorePrefixIterator(store, auctiontypes.ProtocolStatisticsPrefixKey) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -135,7 +138,7 @@ func (k Keeper) GetAuctionType(ctx sdk.Context, auctionTypeID uint64, appID uint return auctiontypes.DutchString, nil } - return "", sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction mapping id %d not found", auctionTypeID) + return "", errorsmod.Wrapf(sdkerrors.ErrNotFound, "auction mapping id %d not found", auctionTypeID) } func (k Keeper) GetLendAuctionType(ctx sdk.Context, auctionTypeID uint64, appID uint64) (string, error) { @@ -149,16 +152,16 @@ func (k Keeper) GetLendAuctionType(ctx sdk.Context, auctionTypeID uint64, appID return auctiontypes.DutchString, nil } - return "", sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction mapping id %d not found", auctionTypeID) + return "", errorsmod.Wrapf(sdkerrors.ErrNotFound, "auction mapping id %d not found", auctionTypeID) } func (k Keeper) GetAllAuctions(ctx sdk.Context) (auctions []auctiontypes.SurplusAuction) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, auctiontypes.AuctionKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, auctiontypes.AuctionKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -266,10 +269,10 @@ func (k Keeper) GetSurplusAuctions(ctx sdk.Context, appID uint64) (auctions []au var ( store = k.Store(ctx) key = auctiontypes.AuctionTypeKey(appID, auctiontypes.SurplusString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -289,10 +292,10 @@ func (k Keeper) GetHistorySurplusAuctions(ctx sdk.Context, appID uint64) (auctio var ( store = k.Store(ctx) key = auctiontypes.HistoryAuctionTypeKey(appID, auctiontypes.SurplusString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -383,10 +386,10 @@ func (k Keeper) GetSurplusUserBiddings(ctx sdk.Context, bidder string, appID uin var ( store = k.Store(ctx) key = auctiontypes.UserAuctionTypeKey(bidder, appID, auctiontypes.SurplusString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -405,10 +408,10 @@ func (k Keeper) GetSurplusUserBiddings(ctx sdk.Context, bidder string, appID uin func (k Keeper) GetAllSurplusUserBiddings(ctx sdk.Context) (surplusBiddings []auctiontypes.SurplusBiddings) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, auctiontypes.UserKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, auctiontypes.UserKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -427,10 +430,10 @@ func (k Keeper) GetHistorySurplusUserBiddings(ctx sdk.Context, bidder string, ap var ( store = k.Store(ctx) key = auctiontypes.HistoryUserAuctionTypeKey(bidder, appID, auctiontypes.SurplusString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -526,10 +529,10 @@ func (k Keeper) GetDebtAuctions(ctx sdk.Context, appID uint64) (auctions []aucti var ( store = k.Store(ctx) key = auctiontypes.AuctionTypeKey(appID, auctiontypes.DebtString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -559,10 +562,10 @@ func (k Keeper) GetHistoryDebtAuctions(ctx sdk.Context, appID uint64) (auctions var ( store = k.Store(ctx) key = auctiontypes.HistoryAuctionTypeKey(appID, auctiontypes.DebtString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -635,10 +638,10 @@ func (k Keeper) GetDebtUserBidding(ctx sdk.Context, bidder string, appID, biddin func (k Keeper) GetAllDebtUserBidding(ctx sdk.Context) (debtBiddings []auctiontypes.DebtBiddings) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, auctiontypes.UserKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, auctiontypes.UserKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -670,10 +673,10 @@ func (k Keeper) GetDebtUserBiddings(ctx sdk.Context, bidder string, appID uint64 var ( store = k.Store(ctx) key = auctiontypes.UserAuctionTypeKey(bidder, appID, auctiontypes.DebtString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -693,10 +696,10 @@ func (k Keeper) GetHistoryDebtUserBiddings(ctx sdk.Context, bidder string, appID var ( store = k.Store(ctx) key = auctiontypes.HistoryUserAuctionTypeKey(bidder, appID, auctiontypes.DebtString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -796,10 +799,10 @@ func (k Keeper) GetDutchAuctions(ctx sdk.Context, appID uint64) (auctions []auct var ( store = k.Store(ctx) key = auctiontypes.AuctionTypeKey(appID, auctiontypes.DutchString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -829,10 +832,10 @@ func (k Keeper) GetHistoryDutchAuctions(ctx sdk.Context, appID uint64) (auctions var ( store = k.Store(ctx) key = auctiontypes.HistoryAuctionTypeKey(appID, auctiontypes.DutchString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -925,10 +928,10 @@ func (k Keeper) GetDutchUserBiddings(ctx sdk.Context, bidder string, appID uint6 var ( store = k.Store(ctx) key = auctiontypes.UserAuctionTypeKey(bidder, appID, auctiontypes.DutchString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -947,10 +950,10 @@ func (k Keeper) GetDutchUserBiddings(ctx sdk.Context, bidder string, appID uint6 func (k Keeper) GetAllDutchUserBiddings(ctx sdk.Context) (dutchBiddings []auctiontypes.DutchBiddings) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, auctiontypes.UserKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, auctiontypes.UserKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -969,10 +972,10 @@ func (k Keeper) GetHistoryDutchUserBiddings(ctx sdk.Context, bidder string, appI var ( store = k.Store(ctx) key = auctiontypes.HistoryUserAuctionTypeKey(bidder, appID, auctiontypes.DutchString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -1018,10 +1021,10 @@ func (k Keeper) GetAuctionParams(ctx sdk.Context, AppID uint64) (asset auctionty func (k Keeper) GetAllAuctionParams(ctx sdk.Context) (auctionParams []auctiontypes.AuctionParams) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, auctiontypes.AuctionParamsKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, auctiontypes.AuctionParamsKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -1148,10 +1151,10 @@ func (k Keeper) GetDutchLendAuctions(ctx sdk.Context, appID uint64) (auctions [] var ( store = k.Store(ctx) key = auctiontypes.LendAuctionTypeKey(appID, auctiontypes.DutchString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -1171,10 +1174,10 @@ func (k Keeper) GetHistoryDutchLendAuctions(ctx sdk.Context, appID uint64) (auct var ( store = k.Store(ctx) key = auctiontypes.HistoryLendAuctionTypeKey(appID, auctiontypes.DutchString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -1267,10 +1270,10 @@ func (k Keeper) GetDutchLendUserBiddings(ctx sdk.Context, bidder string, appID u var ( store = k.Store(ctx) key = auctiontypes.LendUserAuctionTypeKey(bidder, appID, auctiontypes.DutchString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -1290,10 +1293,10 @@ func (k Keeper) GetHistoryDutchLendUserBiddings(ctx sdk.Context, bidder string, var ( store = k.Store(ctx) key = auctiontypes.HistoryLendUserAuctionTypeKey(bidder, appID, auctiontypes.DutchString) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/auction/keeper/surplus.go b/x/auction/keeper/surplus.go index ce39efd46..266253632 100644 --- a/x/auction/keeper/surplus.go +++ b/x/auction/keeper/surplus.go @@ -3,11 +3,14 @@ package keeper import ( "time" + errorsmod "cosmossdk.io/errors" + esmtypes "github.com/comdex-official/comdex/x/esm/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkmath "cosmossdk.io/math" auctiontypes "github.com/comdex-official/comdex/x/auction/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" tokenminttypes "github.com/comdex-official/comdex/x/tokenmint/types" @@ -93,8 +96,8 @@ func (k Keeper) checkStatusOfNetFeesCollectedAndStartSurplusAuction(ctx sdk.Cont return auctiontypes.NoAuction, nil } -func (k Keeper) getSurplusBuyTokenAmount(ctx sdk.Context, AssetBuyID, AssetSellID uint64, lotSize sdk.Int) (status uint64, sellToken, buyToken sdk.Coin) { - emptyCoin := sdk.NewCoin("empty", sdk.NewIntFromUint64(1)) +func (k Keeper) getSurplusBuyTokenAmount(ctx sdk.Context, AssetBuyID, AssetSellID uint64, lotSize sdkmath.Int) (status uint64, sellToken, buyToken sdk.Coin) { + emptyCoin := sdk.NewCoin("empty", sdkmath.NewIntFromUint64(1)) sellingAsset, found1 := k.asset.GetAsset(ctx, AssetSellID) buyingAsset, found2 := k.asset.GetAsset(ctx, AssetBuyID) if !found1 || !found2 { @@ -103,7 +106,7 @@ func (k Keeper) getSurplusBuyTokenAmount(ctx sdk.Context, AssetBuyID, AssetSellI // outflow token will be of lot size sellToken = sdk.NewCoin(sellingAsset.Denom, lotSize) - buyToken = sdk.NewCoin(buyingAsset.Denom, sdk.ZeroInt()) + buyToken = sdk.NewCoin(buyingAsset.Denom, sdkmath.ZeroInt()) return 5, sellToken, buyToken } @@ -111,7 +114,7 @@ func (k Keeper) StartSurplusAuction( ctx sdk.Context, sellToken sdk.Coin, buyToken sdk.Coin, - bidFactor sdk.Dec, + bidFactor sdkmath.LegacyDec, appID, assetID uint64, assetInID, assetOutID uint64, ) error { @@ -298,7 +301,7 @@ func (k Keeper) PlaceSurplusAuctionBid(ctx sdk.Context, appID, auctionMappingID, change := auction.BidFactor.MulInt(auction.Bid.Amount).Ceil().TruncateInt() minBidAmount := auction.Bid.Amount.Add(change) if bid.Amount.LT(minBidAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", minBidAmount) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", minBidAmount) } } else { if bid.Amount.LTE(auction.Bid.Amount) { diff --git a/x/auction/keeper/surplus_test.go b/x/auction/keeper/surplus_test.go index a9636f2f4..e4dd0a3d4 100644 --- a/x/auction/keeper/surplus_test.go +++ b/x/auction/keeper/surplus_test.go @@ -5,6 +5,7 @@ import ( "github.com/comdex-official/comdex/x/auction" + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" auctionKeeper "github.com/comdex-official/comdex/x/auction/keeper" auctionTypes "github.com/comdex-official/comdex/x/auction/types" @@ -15,7 +16,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (s *KeeperTestSuite) WasmUpdateCollectorLookupTable(surplusThreshhold, debtThreshhold, lotsize, debtlotsize sdk.Int) { +func (s *KeeperTestSuite) WasmUpdateCollectorLookupTable(surplusThreshhold, debtThreshhold, lotsize, debtlotsize sdkmath.Int) { collectorKeeper, ctx := &s.collectorKeeper, &s.ctx msg1 := bindings.MsgUpdateCollectorLookupTable{ @@ -23,9 +24,9 @@ func (s *KeeperTestSuite) WasmUpdateCollectorLookupTable(surplusThreshhold, debt AssetID: 2, SurplusThreshold: surplusThreshhold, DebtThreshold: debtThreshhold, - LSR: sdk.MustNewDecFromStr("0.001"), + LSR: sdkmath.LegacyMustNewDecFromStr("0.001"), LotSize: lotsize, - BidFactor: sdk.MustNewDecFromStr("0.01"), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), DebtLotSize: debtlotsize, } err := collectorKeeper.WasmUpdateCollectorLookupTable(*ctx, &msg1) @@ -37,7 +38,7 @@ func (s *KeeperTestSuite) TestSurplusActivatorBetweenThreshholdAndLotsize() { s.AddPairAndExtendedPairVault1() s.AddAuctionParams() s.WasmSetCollectorLookupTableAndAuctionControlForSurplus() - s.WasmUpdateCollectorLookupTable(sdk.NewInt(19500), sdk.NewInt(1000), sdk.NewInt(501), sdk.NewInt(300)) + s.WasmUpdateCollectorLookupTable(sdkmath.NewInt(19500), sdkmath.NewInt(1000), sdkmath.NewInt(501), sdkmath.NewInt(300)) k, ctx := &s.keeper, &s.ctx @@ -65,7 +66,7 @@ func (s *KeeperTestSuite) TestSurplusActivator() { auctionMappingId := uint64(1) auctionId := uint64(1) - err := collectorKeeper.SetNetFeeCollectedData(*ctx, uint64(1), 2, sdk.NewIntFromUint64(100000000)) + err := collectorKeeper.SetNetFeeCollectedData(*ctx, uint64(1), 2, sdkmath.NewIntFromUint64(100000000)) s.Require().NoError(err) collectorLookUp, found := collectorKeeper.GetCollectorLookupTable(*ctx, 1, 2) s.Require().True(found) @@ -77,7 +78,7 @@ func (s *KeeperTestSuite) TestSurplusActivator() { } err2 := k.FundModule(*ctx, auctionTypes.ModuleName, "ucmst", 1000000000) s.Require().NoError(err2) - err3 := s.app.BankKeeper.SendCoinsFromModuleToModule(*ctx, auctionTypes.ModuleName, collectorTypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmst", sdk.NewIntFromUint64(1000000000)))) + err3 := s.app.BankKeeper.SendCoinsFromModuleToModule(*ctx, auctionTypes.ModuleName, collectorTypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmst", sdkmath.NewIntFromUint64(1000000000)))) s.Require().NoError(err3) err1 := k.SurplusActivator(*ctx, auctionMapData, klswData, false) s.Require().NoError(err1) @@ -208,8 +209,8 @@ func (s *KeeperTestSuite) TestSurplusBid() { beforeCmstBalance, err := s.getBalance(tc.msg.Bidder, "ucmst") s.Require().NoError(err) previousUserAddress := "" - bidToken := sdk.NewCoin("zero", sdk.NewIntFromUint64(10)) - beforeHarborBalance2 := sdk.NewCoin("zero", sdk.NewIntFromUint64(10)) + bidToken := sdk.NewCoin("zero", sdkmath.NewIntFromUint64(10)) + beforeHarborBalance2 := sdk.NewCoin("zero", sdkmath.NewIntFromUint64(10)) if tc.bidID != uint64(1) { previousUserAddress = beforeAuction.Bidder.String() beforeHarborBalance2, err = s.getBalance(previousUserAddress, "uharbor") @@ -250,7 +251,7 @@ func (s *KeeperTestSuite) TestSurplusBid() { s.Require().Equal(afterAuction.BiddingIds[tc.bidID-uint64(1)].BidId, tc.bidID) s.Require().Equal(afterAuction.BiddingIds[tc.bidID-uint64(1)].BidOwner, tc.msg.Bidder) if tc.bidID != uint64(1) { - s.Require().True(afterAuction.Bid.Amount.GTE(sdk.NewDecFromInt(beforeAuction.Bid.Amount).Mul(sdk.MustNewDecFromStr("1").Sub(beforeAuction.BidFactor)).TruncateInt())) + s.Require().True(afterAuction.Bid.Amount.GTE(sdkmath.LegacyNewDecFromInt(beforeAuction.Bid.Amount).Mul(sdkmath.LegacyMustNewDecFromStr("1").Sub(beforeAuction.BidFactor)).TruncateInt())) } s.Require().Equal(beforeCmstBalance, afterCmstBalance) s.Require().Equal(beforeHarborBalance.Sub(bid), afterHarborBalance) diff --git a/x/auction/module.go b/x/auction/module.go index be8e9039d..0e101f1dc 100644 --- a/x/auction/module.go +++ b/x/auction/module.go @@ -142,6 +142,12 @@ func (am AppModule) RegisterServices(configurator module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -164,12 +170,11 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context) error { //BeginBlocker(ctx, am.keeper, am.assetKeeper, am.collectKeeper, am.esmKeeper) + return nil } -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/auction/types/auction.pb.go b/x/auction/types/auction.pb.go index 982fc72cc..e5dfe6c76 100644 --- a/x/auction/types/auction.pb.go +++ b/x/auction/types/auction.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -37,7 +38,7 @@ type SurplusAuction struct { Bidder github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=bidder,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"bidder,omitempty" yaml:"bidder"` Bid github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=bid,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bid" yaml:"bid"` EndTime time.Time `protobuf:"bytes,7,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + BidFactor cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"bid_factor" yaml:"bid_factor"` BiddingIds []*BidOwnerMapping `protobuf:"bytes,9,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` AuctionStatus uint64 `protobuf:"varint,10,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` AppId uint64 `protobuf:"varint,11,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` @@ -95,7 +96,7 @@ type DebtAuction struct { AssetId uint64 `protobuf:"varint,11,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` BiddingIds []*BidOwnerMapping `protobuf:"bytes,12,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` AuctionMappingId uint64 `protobuf:"varint,13,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,14,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + BidFactor cosmossdk_io_math.LegacyDec `protobuf:"bytes,14,opt,name=bid_factor,json=bidFactor,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"bid_factor" yaml:"bid_factor"` AssetInId uint64 `protobuf:"varint,15,opt,name=asset_in_id,json=assetInId,proto3" json:"asset_in_id,omitempty" yaml:"asset_in_id"` AssetOutId uint64 `protobuf:"varint,16,opt,name=asset_out_id,json=assetOutId,proto3" json:"asset_out_id,omitempty" yaml:"asset_out_id"` BidEndTime time.Time `protobuf:"bytes,17,opt,name=bid_end_time,json=bidEndTime,proto3,stdtime" json:"bid_end_time" yaml:"bid_end_time"` @@ -140,10 +141,10 @@ type DutchAuction struct { OutflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=outflow_token_current_amount,json=outflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_current_amount" yaml:"outflow_token_current_amount"` InflowTokenTargetAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=inflow_token_target_amount,json=inflowTokenTargetAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_target_amount" yaml:"inflow_token_target_amount"` InflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_current_amount,json=inflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_current_amount" yaml:"inflow_token_current_amount"` - OutflowTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=outflow_token_initial_price,json=outflowTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_initial_price" yaml:"outflow_token_initial_price"` - OutflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=outflow_token_current_price,json=outflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_current_price" yaml:"outflow_token_current_price"` - OutflowTokenEndPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=outflow_token_end_price,json=outflowTokenEndPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_end_price" yaml:"outflow_token_end_price"` - InflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=inflow_token_current_price,json=inflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflow_token_current_price" yaml:"inflow_token_current_price"` + OutflowTokenInitialPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=outflow_token_initial_price,json=outflowTokenInitialPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"outflow_token_initial_price" yaml:"outflow_token_initial_price"` + OutflowTokenCurrentPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=outflow_token_current_price,json=outflowTokenCurrentPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"outflow_token_current_price" yaml:"outflow_token_current_price"` + OutflowTokenEndPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=outflow_token_end_price,json=outflowTokenEndPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"outflow_token_end_price" yaml:"outflow_token_end_price"` + InflowTokenCurrentPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=inflow_token_current_price,json=inflowTokenCurrentPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflow_token_current_price" yaml:"inflow_token_current_price"` EndTime time.Time `protobuf:"bytes,10,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` AuctionStatus uint64 `protobuf:"varint,11,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` StartTime time.Time `protobuf:"bytes,12,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` @@ -154,7 +155,7 @@ type DutchAuction struct { AssetOutId uint64 `protobuf:"varint,17,opt,name=asset_out_id,json=assetOutId,proto3" json:"asset_out_id,omitempty" yaml:"asset_out_id"` LockedVaultId uint64 `protobuf:"varint,18,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` VaultOwner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,19,opt,name=vault_owner,json=vaultOwner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"vault_owner,omitempty" yaml:"vault_owner"` - LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,20,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidatin_penalty"` + LiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,20,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_penalty" yaml:"liquidatin_penalty"` } func (m *DutchAuction) Reset() { *m = DutchAuction{} } @@ -229,9 +230,9 @@ func (m *BidOwnerMapping) XXX_DiscardUnknown() { var xxx_messageInfo_BidOwnerMapping proto.InternalMessageInfo type ProtocolStatistics struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - Loss github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=loss,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"loss" yaml:"loss"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + Loss cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=loss,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"loss" yaml:"loss"` } func (m *ProtocolStatistics) Reset() { *m = ProtocolStatistics{} } @@ -268,16 +269,16 @@ func (m *ProtocolStatistics) XXX_DiscardUnknown() { var xxx_messageInfo_ProtocolStatistics proto.InternalMessageInfo type AuctionParams struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AuctionDurationSeconds uint64 `protobuf:"varint,2,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` - Buffer github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=buffer,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"buffer" yaml:"buffer"` - Cusp github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=cusp,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cusp" yaml:"cusp"` - Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` - PriceFunctionType uint64 `protobuf:"varint,6,opt,name=price_function_type,json=priceFunctionType,proto3" json:"price_function_type,omitempty" yaml:"price_function_type"` - SurplusId uint64 `protobuf:"varint,7,opt,name=surplus_id,json=surplusId,proto3" json:"surplus_id,omitempty" yaml:"surplus_id"` - DebtId uint64 `protobuf:"varint,8,opt,name=debt_id,json=debtId,proto3" json:"debt_id,omitempty" yaml:"debt_id"` - DutchId uint64 `protobuf:"varint,9,opt,name=dutch_id,json=dutchId,proto3" json:"dutch_id,omitempty" yaml:"dutch_id"` - BidDurationSeconds uint64 `protobuf:"varint,10,opt,name=bid_duration_seconds,json=bidDurationSeconds,proto3" json:"bid_duration_seconds,omitempty" yaml:"bid_duration_seconds"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionDurationSeconds uint64 `protobuf:"varint,2,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` + Buffer cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=buffer,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"buffer" yaml:"buffer"` + Cusp cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=cusp,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"cusp" yaml:"cusp"` + Step cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=step,proto3,customtype=cosmossdk.io/math.Int" json:"step" yaml:"step"` + PriceFunctionType uint64 `protobuf:"varint,6,opt,name=price_function_type,json=priceFunctionType,proto3" json:"price_function_type,omitempty" yaml:"price_function_type"` + SurplusId uint64 `protobuf:"varint,7,opt,name=surplus_id,json=surplusId,proto3" json:"surplus_id,omitempty" yaml:"surplus_id"` + DebtId uint64 `protobuf:"varint,8,opt,name=debt_id,json=debtId,proto3" json:"debt_id,omitempty" yaml:"debt_id"` + DutchId uint64 `protobuf:"varint,9,opt,name=dutch_id,json=dutchId,proto3" json:"dutch_id,omitempty" yaml:"dutch_id"` + BidDurationSeconds uint64 `protobuf:"varint,10,opt,name=bid_duration_seconds,json=bidDurationSeconds,proto3" json:"bid_duration_seconds,omitempty" yaml:"bid_duration_seconds"` } func (m *AuctionParams) Reset() { *m = AuctionParams{} } @@ -327,113 +328,114 @@ func init() { } var fileDescriptor_4bb9aead25d5fe6c = []byte{ - // 1687 bytes of a gzipped FileDescriptorProto + // 1704 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x1b, 0x45, - 0x1b, 0xcf, 0xb6, 0x49, 0x1c, 0x8f, 0x93, 0x38, 0xde, 0x7c, 0x39, 0x49, 0xeb, 0x4d, 0xa7, 0xaf, - 0xde, 0x46, 0x7a, 0x55, 0x5b, 0xed, 0xfb, 0xea, 0x95, 0x40, 0x42, 0x10, 0x37, 0x2d, 0x58, 0xa5, - 0x34, 0x6c, 0xd2, 0x82, 0x2a, 0x55, 0x66, 0x77, 0x67, 0xec, 0x0e, 0x5d, 0xef, 0x2e, 0xbb, 0xb3, - 0x6d, 0x23, 0x10, 0x57, 0x4e, 0x48, 0x95, 0x10, 0x12, 0x27, 0x0e, 0x9c, 0x00, 0x21, 0x21, 0x71, - 0xe1, 0xcc, 0xad, 0x17, 0xa4, 0x1e, 0x11, 0x07, 0x03, 0xe9, 0x7f, 0xe0, 0x23, 0x27, 0x34, 0x1f, - 0xbb, 0x6b, 0x6f, 0xdc, 0x3a, 0x9b, 0x04, 0x4e, 0xf1, 0xce, 0x33, 0xcf, 0xef, 0xf9, 0xed, 0x33, - 0xcf, 0xd7, 0x6c, 0xc0, 0xbf, 0x2c, 0xb7, 0x83, 0xf0, 0xa3, 0x9a, 0x11, 0x5a, 0x94, 0xb8, 0x4e, - 0xed, 0xc1, 0x25, 0x13, 0x53, 0xe3, 0x52, 0xf4, 0x5c, 0xf5, 0x7c, 0x97, 0xba, 0xea, 0x92, 0xd8, - 0x55, 0x8d, 0x56, 0xe5, 0xae, 0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0xa7, 0x37, 0x0a, 0x97, 0x2f, 0x54, 0x87, 0x27, 0x65, 0xd5, 0x24, 0xe8, 0xe6, 0x43, 0x07, - 0xfb, 0x37, 0x0c, 0xcf, 0x23, 0x4e, 0xbb, 0xbe, 0xd4, 0xeb, 0x6a, 0x6a, 0x72, 0x5a, 0x12, 0x05, - 0xea, 0xc0, 0x8c, 0x0e, 0x38, 0x50, 0x5f, 0x03, 0xb3, 0x51, 0x0a, 0x05, 0xd4, 0xa0, 0x61, 0x50, - 0x06, 0x3c, 0x50, 0x56, 0x7a, 0x5d, 0x6d, 0x71, 0x30, 0xc5, 0x84, 0x1c, 0xea, 0x33, 0x72, 0x61, - 0x87, 0x3f, 0xab, 0x1b, 0x60, 0xd2, 0xf0, 0x3c, 0x16, 0x62, 0x05, 0xae, 0x59, 0x4a, 0x62, 0x44, - 0xac, 0x43, 0x7d, 0xc2, 0xf0, 0xbc, 0x06, 0x52, 0xab, 0x60, 0xca, 0x08, 0x02, 0x4c, 0xd9, 0xde, - 0x69, 0xbe, 0x77, 0x3e, 0xf1, 0x72, 0x24, 0x81, 0x7a, 0x8e, 0xff, 0x6c, 0x20, 0xf5, 0x3a, 0x50, - 0x23, 0xdb, 0x1d, 0xf1, 0x4a, 0x4c, 0x73, 0x86, 0x6b, 0x9e, 0xed, 0x75, 0xb5, 0x95, 0x41, 0x7e, - 0xc9, 0x1e, 0xa8, 0xcf, 0xc9, 0x45, 0xe9, 0x8a, 0x06, 0x52, 0xff, 0x0f, 0x0a, 0xd2, 0x04, 0x2f, - 0x24, 0xb3, 0x1c, 0xa5, 0xcf, 0x43, 0x7d, 0x42, 0x56, 0x49, 0x38, 0x05, 0x56, 0x49, 0x5e, 0x02, - 0xd3, 0x42, 0xe4, 0x86, 0x9c, 0x78, 0x91, 0x2b, 0x2e, 0xf7, 0xba, 0xda, 0x7c, 0xbf, 0xa2, 0x90, - 0x42, 0x1d, 0xf0, 0xc7, 0x9b, 0x21, 0xe3, 0x7f, 0x17, 0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3, 0x50, 0x9b, + 0x90, 0x95, 0x0f, 0x4e, 0x81, 0x95, 0x8f, 0xb7, 0xc0, 0xa4, 0x10, 0xd9, 0x01, 0x27, 0x9e, 0xe5, + 0xc0, 0xa5, 0x56, 0x53, 0x9d, 0x6b, 0x07, 0x0a, 0x29, 0xd2, 0x00, 0x5f, 0xde, 0x0e, 0x18, 0xff, + 0xfb, 0x60, 0x92, 0xdd, 0x6b, 0x14, 0x6e, 0x33, 0x7d, 0xc3, 0x4d, 0x95, 0xe1, 0x36, 0x17, 0x47, + 0x45, 0x67, 0xc8, 0xb1, 0xab, 0xdb, 0x12, 0x51, 0x87, 0xbe, 0x99, 0x04, 0x99, 0x4d, 0x62, 0xf8, + 0xc7, 0x2b, 0x8f, 0x5f, 0x29, 0x20, 0x2b, 0x57, 0x04, 0x0f, 0x5a, 0x24, 0xcb, 0x92, 0xe7, 0x62, + 0x87, 0xea, 0x10, 0x3f, 0x54, 0x52, 0x4e, 0x47, 0x60, 0x51, 0xb1, 0xbe, 0x55, 0xc0, 0x1c, 0x79, + 0xec, 0x10, 0xd3, 0x27, 0xb8, 0x12, 0x78, 0xc4, 0x1d, 0xb4, 0x72, 0xde, 0x92, 0x9c, 0x56, 0x64, + 0xaa, 0x76, 0xeb, 0x18, 0x8a, 0xd7, 0x6c, 0xa8, 0xe0, 0x8e, 0x47, 0x5c, 0x41, 0xed, 0x3b, 0x05, + 0x2c, 0x44, 0x6a, 0x1b, 0xd4, 0xf2, 0x23, 0x87, 0x8d, 0xf6, 0x23, 0x77, 0x5b, 0x92, 0x3b, 0x93, + 0x20, 0xd7, 0xae, 0x65, 0x28, 0x7a, 0x91, 0x8f, 0x6e, 0x71, 0x0d, 0x82, 0x60, 0x7b, 0x6d, 0x1b, + 0x3b, 0xa1, 0xda, 0xd6, 0xb3, 0x83, 0x8c, 0x1f, 0xaf, 0x83, 0xa4, 0x4e, 0xbc, 0x83, 0x7c, 0xad, + 0x00, 0x68, 0x06, 0xae, 0x4b, 0x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x80, 0x48, 0x01, 0xd2, 0xc6, + 0xd9, 0x93, 0x88, 0x4e, 0xcc, 0xc6, 0x74, 0x76, 0x3a, 0x9d, 0x8c, 0xce, 0x50, 0x82, 0xb4, 0x14, + 0x7f, 0x2c, 0x63, 0xf8, 0x01, 0x98, 0x67, 0xb9, 0xd2, 0x15, 0x15, 0xe2, 0xcb, 0x50, 0x6d, 0x35, + 0xd5, 0xd5, 0xf8, 0xf3, 0xa0, 0x3b, 0x22, 0xa0, 0x41, 0x71, 0x22, 0x1a, 0x4a, 0x3b, 0x4f, 0xff, + 0xce, 0x8f, 0xfc, 0x78, 0x98, 0x1f, 0x79, 0x7a, 0x98, 0x57, 0x9e, 0x1d, 0xe6, 0x95, 0xbf, 0x0e, + 0xf3, 0xca, 0x93, 0xe7, 0xf9, 0x91, 0x67, 0xcf, 0xf3, 0x23, 0xbf, 0x3f, 0xcf, 0x8f, 0xdc, 0xbb, + 0xd4, 0x51, 0x78, 0x58, 0xb3, 0xb8, 0x68, 0x57, 0xab, 0xd4, 0xa4, 0x7a, 0x5d, 0xae, 0x8b, 0xf1, + 0xbf, 0x0e, 0x78, 0x1d, 0x32, 0xc6, 0x79, 0xa3, 0x7a, 0xfd, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x7e, 0xbc, 0x5d, 0x1d, 0x59, 0x18, 0x00, 0x00, } func (m *SurplusAuction) Marshal() (dAtA []byte, err error) { diff --git a/x/auction/types/errors.go b/x/auction/types/errors.go index 8ac9b04fc..5612d179e 100644 --- a/x/auction/types/errors.go +++ b/x/auction/types/errors.go @@ -3,29 +3,29 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrorInvalidSurplusAuctionID = sdkerrors.Register(ModuleName, 201, "surplus auction does not exist with given id") - ErrorInvalidBiddingDenom = sdkerrors.Register(ModuleName, 202, "given asset type is not accepted for bidding") - ErrorLowBidAmount = sdkerrors.Register(ModuleName, 203, "bidding amount is lower than expected") - ErrorMaxBidAmount = sdkerrors.Register(ModuleName, 204, "bidding amount is greater than maximum bidding amount") - ErrorInvalidAddress = sdkerrors.Register(ModuleName, 205, "invalid source address") - ErrorInvalidDebtAuctionID = sdkerrors.Register(ModuleName, 206, "debt auction does not exist with given id") - ErrorInvalidDebtUserExpectedDenom = sdkerrors.Register(ModuleName, 207, "given asset type is not accepted for debt auction user expected token") - ErrorDebtExpectedUserAmount = sdkerrors.Register(ModuleName, 208, "invalid user amount") - ErrorInvalidDebtMintedDenom = sdkerrors.Register(ModuleName, 209, "given asset type is not accepted for debt auction user mint token") - ErrorInvalidDutchPrice = sdkerrors.Register(ModuleName, 210, "user max price cannot be less than collateral token price") - ErrorPrices = sdkerrors.Register(ModuleName, 211, "unable to get fetches prices for asset from oracle") - ErrorVaultNotFound = sdkerrors.Register(ModuleName, 212, "vault not found for given id") - ErrorInvalidLockedVault = sdkerrors.Register(ModuleName, 213, "locked vault not found for given id") - ErrorUnableToMakeFlagsFalse = sdkerrors.Register(ModuleName, 214, "Unable To Make Flags False after auction closed") - ErrorUnableToSetNetFees = sdkerrors.Register(ModuleName, 215, "Unable To set net fees collected after auction closed") - ErrorInvalidPair = sdkerrors.Register(ModuleName, 216, "pair not found for extended pair id") - ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 217, "unknown message type") - ErrorInvalidExtendedPairVault = sdkerrors.Register(ModuleName, 218, "extended pair vault not found for given id") - ErrorInvalidAuctionParams = sdkerrors.Register(ModuleName, 219, "auction params not found for given app id") - ErrorInStartDutchAuction = sdkerrors.Register(ModuleName, 220, "error in start dutch auction for locked vault id") - ErrorAssetRates = sdkerrors.Register(ModuleName, 221, "error in asset rates") + ErrorInvalidSurplusAuctionID = errorsmod.Register(ModuleName, 201, "surplus auction does not exist with given id") + ErrorInvalidBiddingDenom = errorsmod.Register(ModuleName, 202, "given asset type is not accepted for bidding") + ErrorLowBidAmount = errorsmod.Register(ModuleName, 203, "bidding amount is lower than expected") + ErrorMaxBidAmount = errorsmod.Register(ModuleName, 204, "bidding amount is greater than maximum bidding amount") + ErrorInvalidAddress = errorsmod.Register(ModuleName, 205, "invalid source address") + ErrorInvalidDebtAuctionID = errorsmod.Register(ModuleName, 206, "debt auction does not exist with given id") + ErrorInvalidDebtUserExpectedDenom = errorsmod.Register(ModuleName, 207, "given asset type is not accepted for debt auction user expected token") + ErrorDebtExpectedUserAmount = errorsmod.Register(ModuleName, 208, "invalid user amount") + ErrorInvalidDebtMintedDenom = errorsmod.Register(ModuleName, 209, "given asset type is not accepted for debt auction user mint token") + ErrorInvalidDutchPrice = errorsmod.Register(ModuleName, 210, "user max price cannot be less than collateral token price") + ErrorPrices = errorsmod.Register(ModuleName, 211, "unable to get fetches prices for asset from oracle") + ErrorVaultNotFound = errorsmod.Register(ModuleName, 212, "vault not found for given id") + ErrorInvalidLockedVault = errorsmod.Register(ModuleName, 213, "locked vault not found for given id") + ErrorUnableToMakeFlagsFalse = errorsmod.Register(ModuleName, 214, "Unable To Make Flags False after auction closed") + ErrorUnableToSetNetFees = errorsmod.Register(ModuleName, 215, "Unable To set net fees collected after auction closed") + ErrorInvalidPair = errorsmod.Register(ModuleName, 216, "pair not found for extended pair id") + ErrorUnknownMsgType = errorsmod.Register(ModuleName, 217, "unknown message type") + ErrorInvalidExtendedPairVault = errorsmod.Register(ModuleName, 218, "extended pair vault not found for given id") + ErrorInvalidAuctionParams = errorsmod.Register(ModuleName, 219, "auction params not found for given app id") + ErrorInStartDutchAuction = errorsmod.Register(ModuleName, 220, "error in start dutch auction for locked vault id") + ErrorAssetRates = errorsmod.Register(ModuleName, 221, "error in asset rates") ) diff --git a/x/auction/types/msg.go b/x/auction/types/msg.go index a67619abc..66a194e43 100644 --- a/x/auction/types/msg.go +++ b/x/auction/types/msg.go @@ -3,6 +3,8 @@ package types import ( "errors" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -40,10 +42,10 @@ func (m MsgPlaceSurplusBidRequest) ValidateBasic() error { } _, err := sdk.AccAddressFromBech32(m.Bidder) if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "--from address cannot be empty or invalid") + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "--from address cannot be empty or invalid") } if !m.Amount.IsValid() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "bid amount %s", m.Amount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidCoins, "bid amount %s", m.Amount) } return nil } @@ -81,7 +83,7 @@ func (m MsgPlaceDebtBidRequest) ValidateBasic() error { } _, err := sdk.AccAddressFromBech32(m.Bidder) if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "--from address cannot be empty or invalid") + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "--from address cannot be empty or invalid") } return nil } @@ -118,7 +120,7 @@ func (m MsgPlaceDutchBidRequest) ValidateBasic() error { } _, err := sdk.AccAddressFromBech32(m.Bidder) if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "--from address cannot be empty or invalid") + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "--from address cannot be empty or invalid") } return nil } @@ -155,7 +157,7 @@ func (m MsgPlaceDutchLendBidRequest) ValidateBasic() error { } _, err := sdk.AccAddressFromBech32(m.Bidder) if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "--from address cannot be empty or invalid") + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "--from address cannot be empty or invalid") } return nil } diff --git a/x/auction/types/params.go b/x/auction/types/params.go index d4011c2ca..b360b736f 100644 --- a/x/auction/types/params.go +++ b/x/auction/types/params.go @@ -1,17 +1,17 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = (*Params)(nil) const ( - DutchBidGas = sdk.Gas(31183) - DebtBidGas = sdk.Gas(27580) - DutchLendBidGas = sdk.Gas(31183) - SurplusBidGas = sdk.Gas(27580) + DutchBidGas = storetypes.Gas(31183) + DebtBidGas = storetypes.Gas(27580) + DutchLendBidGas = storetypes.Gas(31183) + SurplusBidGas = storetypes.Gas(27580) ) // ParamKeyTable the param key table for launch module. diff --git a/x/auctionsV2/client/cli/tx.go b/x/auctionsV2/client/cli/tx.go index 6eab6d149..1d7745a1e 100644 --- a/x/auctionsV2/client/cli/tx.go +++ b/x/auctionsV2/client/cli/tx.go @@ -1,15 +1,17 @@ package cli import ( + sdkmath "cosmossdk.io/math" "fmt" + "strconv" + "time" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" flag "github.com/spf13/pflag" - "strconv" - "time" "github.com/spf13/cobra" @@ -100,7 +102,7 @@ func txDepositLimitDutchBid() *cobra.Command { return fmt.Errorf("debtTokenID '%s' not a valid uint", args[1]) } - premiumDiscount, ok := sdk.NewIntFromString(args[2]) + premiumDiscount, ok := sdkmath.NewIntFromString(args[2]) if !ok { return fmt.Errorf("premiumDiscount '%s' not a valid int", args[2]) } @@ -142,7 +144,7 @@ func txCancelLimitDutchBid() *cobra.Command { return fmt.Errorf("debtTokenID '%s' not a valid uint", args[1]) } - premiumDiscount, ok := sdk.NewIntFromString(args[2]) + premiumDiscount, ok := sdkmath.NewIntFromString(args[2]) if !ok { return fmt.Errorf("premiumDiscount '%s' not a valid int", args[2]) } @@ -179,7 +181,7 @@ func txWithdrawLimitDutchBid() *cobra.Command { return fmt.Errorf("debtTokenID '%s' not a valid uint", args[1]) } - premiumDiscount, ok := sdk.NewIntFromString(args[2]) + premiumDiscount, ok := sdkmath.NewIntFromString(args[2]) if !ok { return fmt.Errorf("premiumDiscount '%s' not a valid int", args[2]) } @@ -246,17 +248,17 @@ func AddAuctionParams(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet return txf, nil, fmt.Errorf("failed to parse appId: %w", err) } - step, err := sdk.NewDecFromStr(auctionParams.Step) + step, err := sdkmath.LegacyNewDecFromStr(auctionParams.Step) if err != nil { return txf, nil, err } - withdrawalFee, err := sdk.NewDecFromStr(auctionParams.WithdrawalFee) + withdrawalFee, err := sdkmath.LegacyNewDecFromStr(auctionParams.WithdrawalFee) if err != nil { return txf, nil, err } - closingFee, err := sdk.NewDecFromStr(auctionParams.ClosingFee) + closingFee, err := sdkmath.LegacyNewDecFromStr(auctionParams.ClosingFee) if err != nil { return txf, nil, err } @@ -266,17 +268,17 @@ func AddAuctionParams(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet return txf, nil, fmt.Errorf("failed to parse appId: %w", err) } - bidFactor, err := sdk.NewDecFromStr(auctionParams.BidFactor) + bidFactor, err := sdkmath.LegacyNewDecFromStr(auctionParams.BidFactor) if err != nil { return txf, nil, err } - liquidationPenalty, err := sdk.NewDecFromStr(auctionParams.LiquidationPenalty) + liquidationPenalty, err := sdkmath.LegacyNewDecFromStr(auctionParams.LiquidationPenalty) if err != nil { return txf, nil, err } - auctionBonus, err := sdk.NewDecFromStr(auctionParams.AuctionBonus) + auctionBonus, err := sdkmath.LegacyNewDecFromStr(auctionParams.AuctionBonus) if err != nil { return txf, nil, err } @@ -304,9 +306,5 @@ func AddAuctionParams(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet return txf, nil, err } - if err = msg.ValidateBasic(); err != nil { - return txf, nil, err - } - return txf, msg, nil } diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 625e26421..ebf3ad20c 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -1,6 +1,7 @@ package expected import ( + "context" assettypes "github.com/comdex-official/comdex/x/asset/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/comdex-official/comdex/x/collector/types" @@ -9,6 +10,7 @@ import ( markettypes "github.com/comdex-official/comdex/x/market/types" // vaulttypes "github.com/comdex-official/comdex/x/vault/types" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -21,7 +23,7 @@ type LiquidationsV2Keeper interface { } type MarketKeeper interface { - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) } @@ -37,7 +39,7 @@ type AssetKeeper interface { type EsmKeeper interface { GetKillSwitchData(ctx sdk.Context, appID uint64) (esmtypes.KillSwitchParams, bool) GetESMStatus(ctx sdk.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) - CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdk.Int, decimals sdk.Int) (price sdk.Dec) + CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdkmath.Int, decimals sdkmath.Int) (price sdkmath.LegacyDec) SetAssetToAmount(ctx sdk.Context, assetToAmount esmtypes.AssetToAmount) GetDataAfterCoolOff(ctx sdk.Context, id uint64) (esmDataAfterCoolOff esmtypes.DataAfterCoolOff, found bool) SetDataAfterCoolOff(ctx sdk.Context, esmDataAfterCoolOff esmtypes.DataAfterCoolOff) @@ -45,26 +47,26 @@ type EsmKeeper interface { } type BankKeeper interface { - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderModule string, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } type VaultKeeper interface { - GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) - UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) error + GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdkmath.LegacyDec, amt1 sdkmath.Int, id2 uint64, rate2 sdkmath.LegacyDec) (sdkmath.LegacyDec, sdkmath.Int, error) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) + CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdkmath.Int, AmountOut sdkmath.Int) error } type CollectorKeeper interface { - SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error + SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdkmath.Int) error GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable types.AppAssetIdToAuctionLookupTable, found bool) SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error } type TokenMintKeeper interface { - MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdk.Int) error - BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error + MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdkmath.Int) error + BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdkmath.Int) error } diff --git a/x/auctionsV2/handler.go b/x/auctionsV2/handler.go index b9a519b5f..9159cb4ee 100644 --- a/x/auctionsV2/handler.go +++ b/x/auctionsV2/handler.go @@ -1,14 +1,16 @@ package auctionsV2 import ( + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/auctionsV2/keeper" "github.com/comdex-official/comdex/x/auctionsV2/types" + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -32,7 +34,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "%T", msg) + return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "%T", msg) } } } @@ -43,7 +45,7 @@ func NewAuctionsV2Handler(k keeper.Keeper) govtypes.Handler { case *types.DutchAutoBidParamsProposal: return handleAddAuctionParamsProposal(ctx, k, c) default: - return sdkerrors.Wrapf(types.ErrorUnknownProposalType, "%T", c) + return errorsmod.Wrapf(types.ErrorUnknownProposalType, "%T", c) } } } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index c835f0be9..851a50423 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,9 +1,11 @@ package keeper import ( - tokenminttypes "github.com/comdex-official/comdex/x/tokenmint/types" + sdkmath "cosmossdk.io/math" "time" + tokenminttypes "github.com/comdex-official/comdex/x/tokenmint/types" + utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/auctionsV2/types" @@ -68,7 +70,7 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati //Premium : Initial Price i.e price of the collateral at which the auction will start //Discount: Final Price , i.e less than the oracle price of the collateral asset and at this , auction would end //Decrement Factor: Linear decrease in the price of the collateral every block is governed by this. - CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) + CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdkmath.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) // CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dutchAuctionParams.Cusp) auctionParams, _ := k.GetAuctionParams(ctx) @@ -79,8 +81,8 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati CollateralToken: liquidationData.CollateralToken, DebtToken: liquidationData.TargetDebt, CollateralTokenAuctionPrice: CollateralTokenInitialPrice, - CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), - DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), + CollateralTokenOraclePrice: sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(twaDataCollateral.Twa))), + DebtTokenOraclePrice: sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(twaDataDebt.Twa))), LockedVaultId: liquidationData.LockedVaultId, StartTime: ctx.BlockTime(), EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), @@ -122,8 +124,8 @@ func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquida CollateralToken: liquidationData.CollateralToken, DebtToken: liquidationData.TargetDebt, // CollateralTokenAuctionPrice: CollateralTokenInitialPrice, - // CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), - // DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), + // CollateralTokenOraclePrice: sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(twaDataCollateral.Twa))), + // DebtTokenOraclePrice: sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(twaDataDebt.Twa))), LockedVaultId: liquidationData.LockedVaultId, StartTime: ctx.BlockTime(), EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), @@ -263,7 +265,7 @@ func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auction) //Premium : Initial Price i.e price of the collateral at which the auction will start //Discount: Final Price , i.e less than the oracle price of the collateral asset and at this , auction would end //Decrement Factor: Linear decrease in the price of the collateral every block is governed by this. - CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) + CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdkmath.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) // CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dutchAuctionParams.Cusp) //Saving liquidation data to the auction struct @@ -271,8 +273,8 @@ func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auction) dutchAuction.CollateralTokenAuctionPrice = CollateralTokenInitialPrice dutchAuction.CollateralTokenInitialPrice = CollateralTokenInitialPrice - dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) - dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) + dutchAuction.CollateralTokenOraclePrice = sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(twaDataCollateral.Twa))) + dutchAuction.DebtTokenOraclePrice = sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(twaDataDebt.Twa))) dutchAuction.StartTime = ctx.BlockTime() dutchAuction.EndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) @@ -305,10 +307,10 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auction) } //Now calculating the auction price of the Collateral Token - dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) - dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) + dutchAuction.CollateralTokenOraclePrice = sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(twaDataCollateral.Twa))) + dutchAuction.DebtTokenOraclePrice = sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(twaDataDebt.Twa))) - numerator := dutchAuction.CollateralTokenInitialPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx + numerator := dutchAuction.CollateralTokenInitialPrice.Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx CollateralTokenAuctionEndPrice := k.GetCollateralTokenEndPrice(dutchAuction.CollateralTokenInitialPrice, dutchAuctionParams.Discount) denominator := dutchAuction.CollateralTokenInitialPrice.Sub(CollateralTokenAuctionEndPrice) timeToReachZeroPrice := numerator.Quo(denominator) @@ -324,7 +326,7 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auction) // timeDifference = 33.3- 0 = 33.3 // resultantPrice = 1.2 *33.3 // currentPrice = 1.2*33.3/33.3 = 1.2 unit - collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenInitialPrice, sdk.NewInt(timeToReachZeroPrice.TruncateInt64()), sdk.NewInt(int64(timeElapsed.Seconds()))) + collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenInitialPrice, sdkmath.NewInt(timeToReachZeroPrice.TruncateInt64()), sdkmath.NewInt(int64(timeElapsed.Seconds()))) dutchAuction.CollateralTokenAuctionPrice = collateralTokenAuctionPrice err := k.SetAuction(ctx, dutchAuction) @@ -496,7 +498,7 @@ func (k Keeper) TriggerEsm(ctx sdk.Context, auctionData types.Auction, liquidati tokensToTransfer = sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) //burning rest collected tokens tokensToBurn := debtCollected.Amount.Sub(liquidationData.FeeToBeCollected) - if tokensToBurn.GT(sdk.ZeroInt()) { + if tokensToBurn.GT(sdkmath.ZeroInt()) { err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, tokensToBurn))) if err != nil { return err @@ -541,7 +543,7 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { if auction.CollateralTokenOraclePrice.GT(auction.CollateralTokenAuctionPrice) { premium := (auction.CollateralTokenOraclePrice.Sub(auction.CollateralTokenAuctionPrice)).Quo(auction.CollateralTokenOraclePrice) - premiumPerc := premium.Mul(sdk.NewDecFromInt(sdk.NewInt(100))) + premiumPerc := premium.Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(100))) biddingData, found := k.GetUserLimitBidDataByPremium(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) if !found { return nil @@ -580,7 +582,7 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { return err } debtAmount := individualBids.DebtToken.Amount - individualBids.DebtToken.Amount = sdk.ZeroInt() + individualBids.DebtToken.Amount = sdkmath.ZeroInt() individualBids.BiddingId = append(individualBids.BiddingId, biddingId) k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) // delete limit order bid diff --git a/x/auctionsV2/keeper/auctions_test.go b/x/auctionsV2/keeper/auctions_test.go index 91d7caff6..88197f1d3 100644 --- a/x/auctionsV2/keeper/auctions_test.go +++ b/x/auctionsV2/keeper/auctions_test.go @@ -1,8 +1,8 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" - sdk "github.com/cosmos/cosmos-sdk/types" ) func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForSurplus() { @@ -19,12 +19,12 @@ func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForSurplus AppID: 2, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(200000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(200000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, }, } { @@ -91,12 +91,12 @@ func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForDebt() AppID: 2, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(200000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(200000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, }, } { diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index c8294ce95..5da2249a4 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -1,6 +1,9 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/auctionsV2/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" @@ -13,7 +16,7 @@ import ( func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId uint64, err error) { auctionParams, _ := k.GetAuctionParams(ctx) - if bid.Amount.Equal(sdk.ZeroInt()) { + if bid.Amount.Equal(sdkmath.ZeroInt()) { return bidId, types.ErrBidCannotBeZero } @@ -30,10 +33,10 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } //Price data of the token from market module debtToken, _ := k.market.GetTwa(ctx, auctionData.DebtAssetId) - debtPrice := sdk.NewDecFromInt(sdk.NewInt(int64(debtToken.Twa))) + debtPrice := sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(debtToken.Twa))) //only if debt token is CMST , we consider it as $1 if liquidationData.IsDebtCmst { - debtPrice = sdk.NewDecFromInt(sdk.NewInt(int64(1000000))) + debtPrice = sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(int64(1000000))) } //Check to update bid.Amount fullBid := false @@ -70,7 +73,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Take Debt Token from user , if !isAutoBid { - if bid.Amount.GT(sdk.ZeroInt()) { + if bid.Amount.GT(sdkmath.ZeroInt()) { err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) if err != nil { return bidId, err @@ -80,7 +83,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } //Send Collateral To bidder - if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { + if totalCollateralTokenQuanitity.GT(sdkmath.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidderAddr, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { return bidId, err @@ -91,7 +94,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s var tokensToBurn sdk.Coin if liquidationData.InitiatorType == "vault" { tokensToBurn = liquidationData.TargetDebt.Sub(liquidationPenalty) - if tokensToBurn.Amount.GT(sdk.ZeroInt()) { + if tokensToBurn.Amount.GT(sdkmath.ZeroInt()) { err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) if err != nil { return bidId, err @@ -102,7 +105,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Send rest tokens to the user OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) - if OwnerLeftOverCapital.GT(sdk.ZeroInt()) { + if OwnerLeftOverCapital.GT(sdkmath.ZeroInt()) { ownerAddr, _ := sdk.AccAddressFromBech32(liquidationData.Owner) err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, ownerAddr, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) if err != nil { @@ -123,8 +126,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Send Liquidation penalty to the comdex protocol -- create a kv store like SetAuctionLimitBidFeeData with name SetAuctionExternalFeeData //Send debt to the initiator address of the auction finalDebtToInitiator := liquidationData.TargetDebt.Sub(liquidationPenalty) - keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() - if keeperIncentive.GT(sdk.ZeroInt()) { + keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdkmath.LegacyNewDecFromInt(liquidationPenalty.Amount))).TruncateInt() + if keeperIncentive.GT(sdkmath.ZeroInt()) { liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) addr, _ := sdk.AccAddressFromBech32(liquidationData.InternalKeeperAddress) err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, addr, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) @@ -162,8 +165,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Check if they are initiated through a keeper, if so they will be incentivised if liquidationData.IsInternalKeeper { - keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() - if keeperIncentive.GT(sdk.ZeroInt()) { + keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdkmath.LegacyNewDecFromInt(liquidationPenalty.Amount))).TruncateInt() + if keeperIncentive.GT(sdkmath.ZeroInt()) { liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) addr, _ := sdk.AccAddressFromBech32(liquidationData.InternalKeeperAddress) err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, addr, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) @@ -173,7 +176,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } } //Send Liquidation Penalty to the Collector Module - if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { + if liquidationPenalty.Amount.GT(sdkmath.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) if err != nil { return bidId, err @@ -237,7 +240,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s _, collateralTokenQuantity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) debtLeft := auctionData.DebtToken.Amount.Sub(bid.Amount) debtuDollar, _ := k.CalcDollarValueForToken(ctx, auctionData.DebtAssetId, debtPrice, debtLeft) - if !(debtuDollar).GT(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.MinUsdValueLeft))) { + if !(debtuDollar).GT(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(auctionParams.MinUsdValueLeft))) { return bidId, types.ErrCannotLeaveDebtLessThanDust } @@ -255,7 +258,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s _, collateralTokenQuantityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, expectedBonusShareForCurrentBid, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) totalCollateralTokenQuantity := collateralTokenQuantity.Add(collateralTokenQuantityForBonus) if !isAutoBid { - if bid.Amount.GT(sdk.ZeroInt()) { + if bid.Amount.GT(sdkmath.ZeroInt()) { err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) if err != nil { return bidId, err @@ -263,7 +266,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } } //Send Collateral To bidder - if totalCollateralTokenQuantity.GT(sdk.ZeroInt()) { + if totalCollateralTokenQuantity.GT(sdkmath.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidderAddr, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuantity))) if err != nil { return bidId, err @@ -320,7 +323,7 @@ func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress strin func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction) error { auctionParams, _ := k.GetAuctionParams(ctx) - if bid.Amount.Equal(sdk.ZeroInt()) { + if bid.Amount.Equal(sdkmath.ZeroInt()) { return types.ErrBidCannotBeZero } bidderAddr, _ := sdk.AccAddressFromBech32(bidder) @@ -351,11 +354,11 @@ func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder if liquidationData.InitiatorType == "debt" { bidAmount = tokenLastBid.Amount.Sub(change) if bid.Amount.GT(bidAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", bidAmount.Uint64()) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", bidAmount.Uint64()) } } else { if bid.Amount.LT(bidAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", bidAmount.Uint64()) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", bidAmount.Uint64()) } } } else { @@ -433,7 +436,7 @@ func (k Keeper) GetLimitAuctionBidID(ctx sdk.Context) uint64 { return id.GetValue() } -func (k Keeper) SetUserLimitBidData(ctx sdk.Context, userLimitBidData types.LimitOrderBid, debtTokenID, collateralTokenID uint64, premium sdk.Int) { +func (k Keeper) SetUserLimitBidData(ctx sdk.Context, userLimitBidData types.LimitOrderBid, debtTokenID, collateralTokenID uint64, premium sdkmath.Int) { var ( store = k.Store(ctx) key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, userLimitBidData.BidderAddress) @@ -443,7 +446,7 @@ func (k Keeper) SetUserLimitBidData(ctx sdk.Context, userLimitBidData types.Limi store.Set(key, value) } -func (k Keeper) GetUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdk.Int, address string) (mappingData types.LimitOrderBid, found bool) { +func (k Keeper) GetUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdkmath.Int, address string) (mappingData types.LimitOrderBid, found bool) { var ( store = k.Store(ctx) key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, address) @@ -458,7 +461,7 @@ func (k Keeper) GetUserLimitBidData(ctx sdk.Context, debtTokenID, collateralToke return mappingData, true } -func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdk.Int, address string) { +func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdkmath.Int, address string) { var ( store = k.Store(ctx) key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, address) @@ -467,14 +470,14 @@ func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralT store.Delete(key) } -func (k Keeper) GetUserLimitBidDataByPremium(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdk.Int) (biddingData []types.LimitOrderBid, found bool) { +func (k Keeper) GetUserLimitBidDataByPremium(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdkmath.Int) (biddingData []types.LimitOrderBid, found bool) { var ( store = k.Store(ctx) key = types.UserLimitBidKeyForPremium(debtTokenID, collateralTokenID, premium) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -493,14 +496,14 @@ func (k Keeper) GetUserLimitBidDataByPremium(ctx sdk.Context, debtTokenID, colla return biddingData, true } -func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount sdk.Int, amount sdk.Coin) error { +func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount sdkmath.Int, amount sdk.Coin) error { id := k.GetLimitAuctionBidID(ctx) bidderAddr, err := sdk.AccAddressFromBech32(bidder) if err != nil { return nil } - if PremiumDiscount.GT(sdk.NewIntFromUint64(types.MaxPremiumDiscount)) { + if PremiumDiscount.GT(sdkmath.NewIntFromUint64(types.MaxPremiumDiscount)) { return types.ErrorDiscountGreaterThanMaxDiscount } @@ -536,7 +539,7 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera } // send tokens from user to the auction module - if amount.Amount.GT(sdk.ZeroInt()) { + if amount.Amount.GT(sdkmath.ZeroInt()) { err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, types.ModuleName, sdk.NewCoins(amount)) if err != nil { return err @@ -553,7 +556,7 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera CollateralAssetId: CollateralTokenId, DebtAssetId: DebtTokenId, BidValue: amount.Amount, - MaxDiscount: sdk.NewDecFromInt(sdk.NewIntFromUint64(types.MaxPremiumDiscount)), + MaxDiscount: sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(types.MaxPremiumDiscount)), } } else { protocolData.BidValue = protocolData.BidValue.Add(amount.Amount) @@ -566,7 +569,7 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera return nil } -func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenId, CollateralTokenId uint64, PremiumDiscount sdk.Int) error { +func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenId, CollateralTokenId uint64, PremiumDiscount sdkmath.Int) error { userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) if !found { // return err not found @@ -580,8 +583,8 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI return err } // return all the tokens back to the user - if userLimitBid.DebtToken.Amount.GT(sdk.ZeroInt()) { - feesToBeCollected := auctionParams.ClosingFee.Mul(sdk.NewDecFromInt(userLimitBid.DebtToken.Amount)).TruncateInt() + if userLimitBid.DebtToken.Amount.GT(sdkmath.ZeroInt()) { + feesToBeCollected := auctionParams.ClosingFee.Mul(sdkmath.LegacyNewDecFromInt(userLimitBid.DebtToken.Amount)).TruncateInt() userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(feesToBeCollected) err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(userLimitBid.DebtToken)) @@ -617,7 +620,7 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI return nil } -func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount sdk.Int, amount sdk.Coin) error { +func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount sdkmath.Int, amount sdk.Coin) error { userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) if !found { return types.ErrBidNotFound @@ -638,8 +641,8 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater } // return all the tokens back to the user - if userLimitBid.DebtToken.Amount.GT(sdk.ZeroInt()) { - feesToBeCollected := auctionParams.WithdrawalFee.Mul(sdk.NewDecFromInt(amount.Amount)).TruncateInt() + if userLimitBid.DebtToken.Amount.GT(sdkmath.ZeroInt()) { + feesToBeCollected := auctionParams.WithdrawalFee.Mul(sdkmath.LegacyNewDecFromInt(amount.Amount)).TruncateInt() updatedAmount := amount.Amount.Sub(feesToBeCollected) err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(sdk.NewCoin(amount.Denom, updatedAmount))) @@ -674,10 +677,10 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater return nil } -func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, id uint64, rate sdk.Dec, amt sdk.Int) (price sdk.Dec, err error) { +func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, id uint64, rate sdkmath.LegacyDec, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) { asset, _ := k.asset.GetAsset(ctx, id) - numerator := sdk.NewDecFromInt(amt).Mul(rate) - denominator := sdk.NewDecFromInt(asset.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amt).Mul(rate) + denominator := sdkmath.LegacyNewDecFromInt(asset.Decimals) return numerator.Quo(denominator), nil } @@ -734,15 +737,15 @@ func (k Keeper) GetUserLimitBidDataByAddress(ctx sdk.Context, address string) (m return mappingData, true } -func (k Keeper) GetUserLimitBidsByAssetID(ctx sdk.Context, address string, debtAssetId, collateralAssetId uint64) (sdk.Int, bool) { +func (k Keeper) GetUserLimitBidsByAssetID(ctx sdk.Context, address string, debtAssetId, collateralAssetId uint64) (sdkmath.Int, bool) { var ( store = k.Store(ctx) key = types.LimitBidKeyForAssetID(debtAssetId, collateralAssetId) - iter = sdk.KVStorePrefixIterator(store, key) - amount = sdk.ZeroInt() + iter = storetypes.KVStorePrefixIterator(store, key) + amount = sdkmath.ZeroInt() ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/auctionsV2/keeper/genesis.go b/x/auctionsV2/keeper/genesis.go index 8ac84fee6..e210b749d 100644 --- a/x/auctionsV2/keeper/genesis.go +++ b/x/auctionsV2/keeper/genesis.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -30,10 +31,10 @@ func (k Keeper) SetGenAuctionLimitBidFeeData(ctx sdk.Context, feeData types.Auct func (k Keeper) GetGenAuctionLimitBidFeeData(ctx sdk.Context) (auctionFeesCollectionFromLimitBidTx []types.AuctionFeesCollectionFromLimitBidTx) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AuctionLimitBidFeeKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AuctionLimitBidFeeKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index a73917637..a6eec64d4 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -1,9 +1,11 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "context" + + "cosmossdk.io/store/prefix" "github.com/comdex-official/comdex/x/auctionsV2/types" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" @@ -187,7 +189,7 @@ func (q QueryServer) UserLimitBidsByAssetID(c context.Context, req *types.QueryU items []types.LimitOrderBid ctx = sdk.UnwrapSDKContext(c) key []byte - amount = sdk.NewInt(0) + amount = sdkmath.NewInt(0) ) key = types.LimitBidKeyForAssetID(req.DebtTokenId, req.CollateralTokenId) @@ -374,7 +376,7 @@ func (q QueryServer) LimitBidProtocolDataWithUser(c context.Context, req *types. debtAsset, _ := q.asset.GetAsset(ctx, item.DebtAssetId) userBidValue, found := q.GetUserLimitBidsByAssetID(ctx, req.Bidder, item.DebtAssetId, item.CollateralAssetId) if !found { - userBidValue = sdk.ZeroInt() + userBidValue = sdkmath.ZeroInt() } data = types.LimitBidProtocolDataWithUserForQuery{ CollateralAssetId: item.CollateralAssetId, diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 4e27f16f4..7cc21b456 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -3,12 +3,12 @@ package keeper import ( "fmt" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/auctionsV2/expected" "github.com/comdex-official/comdex/x/auctionsV2/types" - "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -68,7 +68,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.storeKey) } diff --git a/x/auctionsV2/keeper/keeper_test.go b/x/auctionsV2/keeper/keeper_test.go index 15e4978c9..8bacaa484 100644 --- a/x/auctionsV2/keeper/keeper_test.go +++ b/x/auctionsV2/keeper/keeper_test.go @@ -1,6 +1,9 @@ package keeper_test import ( + "testing" + + sdkmath "cosmossdk.io/math" chain "github.com/comdex-official/comdex/app" assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -17,10 +20,8 @@ import ( tokenmintKeeper "github.com/comdex-official/comdex/x/tokenmint/keeper" vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" vaultTypes "github.com/comdex-official/comdex/x/vault/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "testing" ) type KeeperTestSuite struct { @@ -50,7 +51,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.vaultKeeper = s.app.VaultKeeper s.liquidationKeeper = s.app.NewliqKeeper s.assetKeeper = s.app.AssetKeeper @@ -79,7 +80,7 @@ func (s *KeeperTestSuite) CreateNewAsset(name, denom string, twa uint64) uint64 err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: true, @@ -109,16 +110,16 @@ func (s *KeeperTestSuite) CreateNewAsset(name, denom string, twa uint64) uint64 return assetID } -func newInt(i int64) sdk.Int { - return sdk.NewInt(i) +func newInt(i int64) sdkmath.Int { + return sdkmath.NewInt(i) } -func newDec(i string) sdk.Dec { - dec, _ := sdk.NewDecFromStr(i) +func newDec(i string) sdkmath.LegacyDec { + dec, _ := sdkmath.LegacyNewDecFromStr(i) return dec } -func (s *KeeperTestSuite) AddAssetRatesStats(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64) uint64 { +func (s *KeeperTestSuite) AddAssetRatesStats(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdkmath.LegacyDec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdkmath.LegacyDec, CAssetID uint64) uint64 { err := s.app.LendKeeper.AddAssetRatesParams(s.ctx, lendtypes.AssetRatesParams{ AssetID: AssetID, UOptimal: UOptimal, @@ -144,7 +145,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName, shortName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: shortName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -165,7 +166,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName, shortName string) uint64 { return appID } -func (s *KeeperTestSuite) AddAssetRatesPoolPairs(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64, moduleName, cPoolName string, assetData []*lendtypes.AssetDataPoolMapping, MinUsdValueLeft uint64, IsIsolated bool) uint64 { +func (s *KeeperTestSuite) AddAssetRatesPoolPairs(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdkmath.LegacyDec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdkmath.LegacyDec, CAssetID uint64, moduleName, cPoolName string, assetData []*lendtypes.AssetDataPoolMapping, MinUsdValueLeft uint64, IsIsolated bool) uint64 { err := s.app.LendKeeper.AddAssetRatesPoolPairs(s.ctx, lendtypes.AssetRatesPoolPairs{ AssetID: AssetID, UOptimal: UOptimal, diff --git a/x/auctionsV2/keeper/maths.go b/x/auctionsV2/keeper/maths.go index dd8a7a21c..8a2f3ddc4 100644 --- a/x/auctionsV2/keeper/maths.go +++ b/x/auctionsV2/keeper/maths.go @@ -1,24 +1,26 @@ package keeper -import sdk "github.com/cosmos/cosmos-sdk/types" +import ( + sdkmath "cosmossdk.io/math" +) -func Multiply(a, b sdk.Dec) sdk.Dec { +func Multiply(a, b sdkmath.LegacyDec) sdkmath.LegacyDec { return a.Mul(b) } -func (k Keeper) GetCollalteralTokenInitialPrice(price sdk.Int, premium sdk.Dec) sdk.Dec { - result := premium.Mul(sdk.NewDecFromInt(price)) +func (k Keeper) GetCollalteralTokenInitialPrice(price sdkmath.Int, premium sdkmath.LegacyDec) sdkmath.LegacyDec { + result := premium.Mul(sdkmath.LegacyNewDecFromInt(price)) return result } -func (k Keeper) GetPriceFromLinearDecreaseFunction(CollateralTokenAuctionPrice sdk.Dec, timeToReachZeroPrice, timeElapsed sdk.Int) sdk.Dec { +func (k Keeper) GetPriceFromLinearDecreaseFunction(CollateralTokenAuctionPrice sdkmath.LegacyDec, timeToReachZeroPrice, timeElapsed sdkmath.Int) sdkmath.LegacyDec { timeDifference := timeToReachZeroPrice.Sub(timeElapsed) - resultantPrice := CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(timeDifference)) - currentPrice := resultantPrice.Quo(sdk.NewDecFromInt(timeToReachZeroPrice)) + resultantPrice := CollateralTokenAuctionPrice.Mul(sdkmath.LegacyNewDecFromInt(timeDifference)) + currentPrice := resultantPrice.Quo(sdkmath.LegacyNewDecFromInt(timeToReachZeroPrice)) return currentPrice } -func (k Keeper) GetCollateralTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { +func (k Keeper) GetCollateralTokenEndPrice(price, cusp sdkmath.LegacyDec) sdkmath.LegacyDec { result := Multiply(price, cusp) return result } diff --git a/x/auctionsV2/keeper/msg_server_test.go b/x/auctionsV2/keeper/msg_server_test.go index 754ef58e1..4b534ea7c 100644 --- a/x/auctionsV2/keeper/msg_server_test.go +++ b/x/auctionsV2/keeper/msg_server_test.go @@ -1,7 +1,9 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "fmt" + "github.com/comdex-official/comdex/app/wasm/bindings" utils "github.com/comdex-official/comdex/types" assetTypes "github.com/comdex-official/comdex/x/asset/types" @@ -36,22 +38,22 @@ func (s *KeeperTestSuite) AddAppAssets() { assetDataPoolOneAssetOne := &lendtypes.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &lendtypes.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &lendtypes.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &lendtypes.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -108,15 +110,15 @@ func (s *KeeperTestSuite) AddAppAssets() { extendedPairVault := bindings.MsgAddExtendedPairsVault{ AppID: 2, PairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -134,9 +136,9 @@ func (s *KeeperTestSuite) AddAppAssets() { dutchAuctionParams := types.DutchAuctionParam{ Premium: newDec("1.2"), Discount: newDec("0.7"), - DecrementFactor: sdk.NewInt(1), + DecrementFactor: sdkmath.NewInt(1), } - englishAuctionParams := types.EnglishAuctionParam{DecrementFactor: sdk.NewInt(1)} + englishAuctionParams := types.EnglishAuctionParam{DecrementFactor: sdkmath.NewInt(1)} liqWhitelistingHbr := types.LiquidationWhiteListing{ AppId: 2, @@ -192,8 +194,8 @@ func (s *KeeperTestSuite) CreateVault() { From: userAddress1, AppId: 2, ExtendedPairVaultId: 1, - AmountIn: sdk.NewIntFromUint64(1000000), - AmountOut: sdk.NewIntFromUint64(1000000), + AmountIn: sdkmath.NewIntFromUint64(1000000), + AmountOut: sdkmath.NewIntFromUint64(1000000), }, }, { @@ -202,8 +204,8 @@ func (s *KeeperTestSuite) CreateVault() { From: userAddress2, AppId: 2, ExtendedPairVaultId: 1, - AmountIn: sdk.NewIntFromUint64(1000000), - AmountOut: sdk.NewIntFromUint64(1000000), + AmountIn: sdkmath.NewIntFromUint64(1000000), + AmountOut: sdkmath.NewIntFromUint64(1000000), }, }, } { @@ -289,8 +291,8 @@ func (s *KeeperTestSuite) TestLiquidateVaults() { s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeVault.AmountIn) s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeVault.AmountOut) - s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdk.NewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt()) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdkmath.LegacyNewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, sdkmath.LegacyNewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt()) s.Require().Equal(lockedVault[0].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) @@ -312,7 +314,7 @@ func (s *KeeperTestSuite) TestLiquidateVaults() { twaDataCollateral, _ := s.app.MarketKeeper.GetTwa(s.ctx, lockedVault[0].CollateralAssetId) liquidationWhitelistingAppData, _ := s.app.NewliqKeeper.GetLiquidationWhiteListing(s.ctx, lockedVault[0].AppId) - CollateralTokenInitialPrice := s.app.NewaucKeeper.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), liquidationWhitelistingAppData.DutchAuctionParam.Premium) + CollateralTokenInitialPrice := s.app.NewaucKeeper.GetCollalteralTokenInitialPrice(sdkmath.NewIntFromUint64(twaDataCollateral.Twa), liquidationWhitelistingAppData.DutchAuctionParam.Premium) s.Require().Equal(auctions[0].CollateralTokenAuctionPrice, CollateralTokenInitialPrice) } @@ -338,14 +340,14 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { assetStatsLend, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) - s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdkmath.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdkmath.NewInt(13000000000)) assetStatsBorrow, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) - s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(770000000)) - s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdkmath.NewInt(770000000)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdkmath.NewInt(10000000000)) modBalInitial, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) @@ -363,8 +365,8 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { s.Require().Equal(lockedVault[0].Owner, beforeLend.Owner) s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeBorrow.AmountIn.Amount) s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeBorrow.AmountOut.Amount) - s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdk.NewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt()) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdkmath.LegacyNewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, sdkmath.LegacyNewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt()) s.Require().Equal(lockedVault[0].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) @@ -373,21 +375,21 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { assetStatsLend, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) - s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(11900000000)) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdkmath.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdkmath.NewInt(11900000000)) assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) - s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdkmath.NewInt(0)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdkmath.NewInt(10000000000)) afterBorrow, found := s.lendKeeper.GetBorrow(*ctx, 1) s.Require().True(found) s.Require().Equal(afterBorrow.IsLiquidated, true) modBalFinal, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) - s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdk.NewInt(1100000000)) + s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdkmath.NewInt(1100000000)) // get auctions and tally them auctions := s.app.NewaucKeeper.GetAuctions(s.ctx) @@ -403,7 +405,7 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { twaDataCollateral, _ := s.app.MarketKeeper.GetTwa(s.ctx, lockedVault[0].CollateralAssetId) liquidationWhitelistingAppData, _ := s.app.NewliqKeeper.GetLiquidationWhiteListing(s.ctx, lockedVault[0].AppId) - CollateralTokenInitialPrice := s.app.NewaucKeeper.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), liquidationWhitelistingAppData.DutchAuctionParam.Premium) + CollateralTokenInitialPrice := s.app.NewaucKeeper.GetCollalteralTokenInitialPrice(sdkmath.NewIntFromUint64(twaDataCollateral.Twa), liquidationWhitelistingAppData.DutchAuctionParam.Premium) s.Require().Equal(auctions[0].CollateralTokenAuctionPrice, CollateralTokenInitialPrice) } @@ -419,25 +421,25 @@ func (s *KeeperTestSuite) TestPlaceMarketBidForVaults() { }{ { Name: "auction does not exist", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdk.NewInt(100000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdkmath.NewInt(100000))), ExpErr: sdkerrors.ErrNotFound, ExpResp: nil, }, { Name: "dust amount", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(1110000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(1110000))), ExpErr: auctionsV2types.ErrCannotLeaveDebtLessThanDust, ExpResp: nil, }, { Name: "success valid case partial", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(100000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(100000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, }, { Name: "success valid case full", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(1020000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(1020000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, }, @@ -474,25 +476,25 @@ func (s *KeeperTestSuite) TestPlaceMarketBidForBorrows() { }{ { Name: "auction does not exist", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdk.NewInt(100000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdkmath.NewInt(100000))), ExpErr: sdkerrors.ErrNotFound, ExpResp: nil, }, { Name: "dust amount", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(73450000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdkmath.NewInt(73450000))), ExpErr: auctionsV2types.ErrCannotLeaveDebtLessThanDust, ExpResp: nil, }, { Name: "success valid case partial", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(53000000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdkmath.NewInt(53000000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, }, { Name: "success valid case full", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(20500000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdkmath.NewInt(20500000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, }, @@ -531,25 +533,25 @@ func (s *KeeperTestSuite) TestDepositLimitBid() { }{ { Name: "asset does not exist", - Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 10, 2, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(1000000))), + Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 10, 2, sdkmath.NewInt(2), sdk.NewCoin("uasset2", sdkmath.NewInt(1000000))), ExpErr: assetTypes.ErrorAssetDoesNotExist, ExpResp: nil, }, { Name: "asset does not exist", - Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 20, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(1000000))), + Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 20, sdkmath.NewInt(2), sdk.NewCoin("uasset2", sdkmath.NewInt(1000000))), ExpErr: assetTypes.ErrorAssetDoesNotExist, ExpResp: nil, }, { Name: "asset denom does not exist", - Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 2, sdk.NewInt(2), sdk.NewCoin("uasset1", sdk.NewInt(1000000))), + Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 2, sdkmath.NewInt(2), sdk.NewCoin("uasset1", sdkmath.NewInt(1000000))), ExpErr: auctionsV2types.ErrorUnknownDebtToken, ExpResp: nil, }, { Name: "success valid case", - Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 2, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(1000000))), + Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 2, sdkmath.NewInt(2), sdk.NewCoin("uasset2", sdkmath.NewInt(1000000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgDepositLimitBidResponse{}, }, @@ -569,9 +571,9 @@ func (s *KeeperTestSuite) TestDepositLimitBid() { s.Require().NotNil(resp) s.Require().Equal(tc.ExpResp, resp) - userLimitAuctionBid, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + userLimitAuctionBid, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdkmath.NewInt(2), bidder) s.Require().Equal(found, true) - userLimitAuctionBidByPremium, found := auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdk.NewInt(2)) + userLimitAuctionBidByPremium, found := auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdkmath.NewInt(2)) s.Require().Equal(found, true) s.Require().Equal(userLimitAuctionBid, userLimitAuctionBidByPremium[0]) @@ -589,7 +591,7 @@ func (s *KeeperTestSuite) TestCancelLimitBid() { auctionKeeper := &s.keeper id := auctionKeeper.GetLimitAuctionBidID(s.ctx) s.Require().Equal(id, uint64(1)) - _, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + _, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdkmath.NewInt(2), bidder) s.Require().Equal(found, true) testCases := []struct { @@ -600,13 +602,13 @@ func (s *KeeperTestSuite) TestCancelLimitBid() { }{ { Name: "asset does not exist", - Msg: *auctionsV2types.NewMsgCancelLimitBid(bidder, 10, 2, sdk.NewInt(2)), + Msg: *auctionsV2types.NewMsgCancelLimitBid(bidder, 10, 2, sdkmath.NewInt(2)), ExpErr: auctionsV2types.ErrBidNotFound, ExpResp: nil, }, { Name: "success valid case", - Msg: *auctionsV2types.NewMsgCancelLimitBid(bidder, 1, 2, sdk.NewInt(2)), + Msg: *auctionsV2types.NewMsgCancelLimitBid(bidder, 1, 2, sdkmath.NewInt(2)), ExpErr: nil, ExpResp: &auctionsV2types.MsgCancelLimitBidResponse{}, }, @@ -626,9 +628,9 @@ func (s *KeeperTestSuite) TestCancelLimitBid() { s.Require().NotNil(resp) s.Require().Equal(tc.ExpResp, resp) - _, found = auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + _, found = auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdkmath.NewInt(2), bidder) s.Require().Equal(found, false) - _, found = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdk.NewInt(2)) + _, found = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdkmath.NewInt(2)) s.Require().Equal(found, false) } }) @@ -643,7 +645,7 @@ func (s *KeeperTestSuite) TestWithdrawLimitBid() { auctionKeeper := &s.keeper id := auctionKeeper.GetLimitAuctionBidID(s.ctx) s.Require().Equal(id, uint64(1)) - _, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + _, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdkmath.NewInt(2), bidder) s.Require().Equal(found, true) testCases := []struct { @@ -654,13 +656,13 @@ func (s *KeeperTestSuite) TestWithdrawLimitBid() { }{ { Name: "asset does not exist", - Msg: *auctionsV2types.NewMsgWithdrawLimitBid(bidder, 10, 2, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(500000))), + Msg: *auctionsV2types.NewMsgWithdrawLimitBid(bidder, 10, 2, sdkmath.NewInt(2), sdk.NewCoin("uasset2", sdkmath.NewInt(500000))), ExpErr: auctionsV2types.ErrBidNotFound, ExpResp: nil, }, { Name: "success valid case", - Msg: *auctionsV2types.NewMsgWithdrawLimitBid(bidder, 1, 2, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(500000))), + Msg: *auctionsV2types.NewMsgWithdrawLimitBid(bidder, 1, 2, sdkmath.NewInt(2), sdk.NewCoin("uasset2", sdkmath.NewInt(500000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgWithdrawLimitBidResponse{}, }, @@ -680,11 +682,11 @@ func (s *KeeperTestSuite) TestWithdrawLimitBid() { s.Require().NotNil(resp) s.Require().Equal(tc.ExpResp, resp) - GetUserLimitBidData, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + GetUserLimitBidData, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdkmath.NewInt(2), bidder) s.Require().Equal(found, true) - s.Require().Equal(GetUserLimitBidData.DebtToken.Amount, sdk.NewInt(500000)) + s.Require().Equal(GetUserLimitBidData.DebtToken.Amount, sdkmath.NewInt(500000)) - _, found = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdk.NewInt(2)) + _, found = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdkmath.NewInt(2)) s.Require().Equal(found, true) } }) @@ -697,7 +699,7 @@ func (s *KeeperTestSuite) TestDebtActivator() { s.AddAppAssets() s.WasmSetCollectorLookupTableAndAuctionControlForDebt() - err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(4700000)) + err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdkmath.NewIntFromUint64(4700000)) s.Require().NoError(err) k, ctx := &s.liquidationKeeper, &s.ctx err = k.Liquidate(*ctx) @@ -717,12 +719,12 @@ func (s *KeeperTestSuite) TestSurplusActivator() { liquidationKeeper := &s.liquidationKeeper s.AddAppAssets() s.WasmSetCollectorLookupTableAndAuctionControlForSurplus() - err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdkmath.NewInt(10000000)))) s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdkmath.NewInt(10000000)))) s.Require().NoError(err) - err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(100000000)) + err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdkmath.NewIntFromUint64(100000000)) s.Require().NoError(err) k, ctx := &s.liquidationKeeper, &s.ctx err = k.Liquidate(*ctx) @@ -748,31 +750,31 @@ func (s *KeeperTestSuite) TestDebtAuctionBid() { }{ { Name: "auction does not exist", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdk.NewInt(100000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdkmath.NewInt(100000))), ExpErr: sdkerrors.ErrNotFound, ExpResp: nil, }, { Name: "bidding amount is greater than maximum bidding amount", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(53000000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(53000000))), ExpErr: auctionsV2types.ErrorMaxBidAmount, ExpResp: nil, }, { Name: "success valid case", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(200000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(200000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, }, { Name: "bid should be less than or equal to 180000", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(200000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(200000))), ExpErr: fmt.Errorf("bid should be less than or equal to 180000 : not found"), ExpResp: nil, }, { Name: "success valid case 2", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(180000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(180000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, }, @@ -831,25 +833,25 @@ func (s *KeeperTestSuite) TestSurplusAuctionBid() { }{ { Name: "auction does not exist", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset3", sdk.NewInt(100000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset3", sdkmath.NewInt(100000))), ExpErr: sdkerrors.ErrNotFound, ExpResp: nil, }, { Name: "success valid case", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(200000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(200000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, }, { Name: "bid should be greater than or equal to 220000", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(200000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(200000))), ExpErr: fmt.Errorf("bid should be greater than or equal to 220000 : not found"), ExpResp: nil, }, { Name: "success valid case 2", - Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(220000))), + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdkmath.NewInt(220000))), ExpErr: nil, ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, }, @@ -883,31 +885,31 @@ func (s *KeeperTestSuite) TestAuctionIterator() { // debt auction collectorKeeper := &s.collectorKeeper s.WasmSetCollectorLookupTableAndAuctionControlForDebt() - err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(4700000)) + err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdkmath.NewIntFromUint64(4700000)) s.Require().NoError(err) k := &s.liquidationKeeper err = k.Liquidate(s.ctx) s.Require().NoError(err) auction, _ := s.keeper.GetAuction(s.ctx, 1) - s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(1200000))) // update auction price s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:30:00Z")) auctionsV2.BeginBlocker(s.ctx, s.keeper) auction, _ = s.keeper.GetAuction(s.ctx, 1) - s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1020000))) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(1020000))) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:59:59Z")) auctionsV2.BeginBlocker(s.ctx, s.keeper) auction, _ = s.keeper.GetAuction(s.ctx, 1) - s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(840100))) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(840100))) // restart auction s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T13:30:00Z")) auctionsV2.BeginBlocker(s.ctx, s.keeper) auction, _ = s.keeper.GetAuction(s.ctx, 1) - s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(1200000))) } func (s *KeeperTestSuite) TestAuctionIteratorSurplus() { @@ -930,18 +932,18 @@ func (s *KeeperTestSuite) TestAuctionIteratorSurplus() { //s.Require().NoError(err) s.WasmSetCollectorLookupTableAndAuctionControlForSurplus() - err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdkmath.NewInt(10000000)))) s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdkmath.NewInt(10000000)))) s.Require().NoError(err) - err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(100000000)) + err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdkmath.NewIntFromUint64(100000000)) s.Require().NoError(err) k, ctx := &s.liquidationKeeper, &s.ctx err = k.Liquidate(*ctx) s.Require().NoError(err) auction, _ := s.keeper.GetAuction(s.ctx, 1) - s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(1200000))) // update auction price and bid for english auction @@ -951,7 +953,7 @@ func (s *KeeperTestSuite) TestAuctionIteratorSurplus() { msg := auctionsV2types.MsgPlaceMarketBidRequest{ AuctionId: 3, Bidder: "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", - Amount: sdk.NewCoin("uasset3", sdk.NewInt(220000)), + Amount: sdk.NewCoin("uasset3", sdkmath.NewInt(220000)), } _, err = s.auctionMsgServer.MsgPlaceMarketBid(sdk.WrapSDKContext(s.ctx), &msg) s.Require().NoError(err) @@ -960,7 +962,7 @@ func (s *KeeperTestSuite) TestAuctionIteratorSurplus() { s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T13:30:00Z")) auctionsV2.BeginBlocker(s.ctx, s.keeper) auction, _ = s.keeper.GetAuction(s.ctx, 1) - s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(1200000))) } func (s *KeeperTestSuite) TestLimitBid() { @@ -973,19 +975,19 @@ func (s *KeeperTestSuite) TestLimitBid() { auctionKeeper := &s.keeper liquidationKeeper := &s.liquidationKeeper - err := liquidationKeeper.MsgAppReserveFundsFn(s.ctx, bidder, 2, 3, sdk.NewCoin("uasset3", sdk.NewInt(5990000))) + err := liquidationKeeper.MsgAppReserveFundsFn(s.ctx, bidder, 2, 3, sdk.NewCoin("uasset3", sdkmath.NewInt(5990000))) s.Require().NoError(err) - err = auctionKeeper.DepositLimitAuctionBid(s.ctx, bidder, 2, 3, sdk.NewInt(9), sdk.NewCoin("uasset3", sdk.NewInt(7000000))) + err = auctionKeeper.DepositLimitAuctionBid(s.ctx, bidder, 2, 3, sdkmath.NewInt(9), sdk.NewCoin("uasset3", sdkmath.NewInt(7000000))) s.Require().NoError(err) - a, _ := auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 3, 2, sdk.NewInt(9)) + a, _ := auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 3, 2, sdkmath.NewInt(9)) s.Require().Equal(len(a), 1) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:49:00Z")) auctionsV2.BeginBlocker(s.ctx, s.keeper) - a, _ = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 3, 2, sdk.NewInt(9)) + a, _ = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 3, 2, sdkmath.NewInt(9)) s.Require().Equal(len(a), 1) auctions = s.app.NewaucKeeper.GetAuctions(s.ctx) diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index a4f3bca69..bb12e3895 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -222,10 +223,10 @@ func (k Keeper) GetAuctionHistorical(ctx sdk.Context, auctionID uint64) (auction func (k Keeper) GetAuctions(ctx sdk.Context) (auctions []types.Auction) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AuctionKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AuctionKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -244,10 +245,10 @@ func (k Keeper) GetAuctions(ctx sdk.Context) (auctions []types.Auction) { func (k Keeper) GetAuctionHistoricals(ctx sdk.Context) (auctions []types.AuctionHistorical) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AuctionHistoricalKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AuctionHistoricalKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -266,10 +267,10 @@ func (k Keeper) GetAuctionHistoricals(ctx sdk.Context) (auctions []types.Auction func (k Keeper) GetUserBids(ctx sdk.Context) (userBids []types.Bid) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.UserBidKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.UserBidKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -327,10 +328,10 @@ func (k Keeper) SetLimitBidProtocolData(ctx sdk.Context, data types.LimitBidProt func (k Keeper) GetAllLimitBidProtocolData(ctx sdk.Context) (bidData []types.LimitBidProtocolData) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.MarketBidProtocolKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.MarketBidProtocolKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/auctionsV2/module.go b/x/auctionsV2/module.go index 8ba4e5e62..981a87474 100644 --- a/x/auctionsV2/module.go +++ b/x/auctionsV2/module.go @@ -131,6 +131,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -153,12 +159,10 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context) { BeginBlocker(ctx, am.keeper) } -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/auctionsV2/module_simulation.go b/x/auctionsV2/module_simulation.go index bda25b1ea..4f6cd8943 100644 --- a/x/auctionsV2/module_simulation.go +++ b/x/auctionsV2/module_simulation.go @@ -6,7 +6,6 @@ import ( "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -43,15 +42,6 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP return nil } -// RandomizedParams creates randomized param changes for the simulator -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { - -// return []simtypes.ParamChange{} -// } - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 8e172c909..e79513690 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" types "github.com/comdex-official/comdex/x/liquidationsV2/types" _ "github.com/cosmos/cosmos-sdk/types" @@ -97,18 +98,18 @@ type Auction struct { ActiveBiddingId uint64 `protobuf:"varint,4,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` BiddingIds []*BidOwnerMapping `protobuf:"bytes,5,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` // price indicator only for dutch auctions - CollateralTokenAuctionPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=collateral_token_auction_price,json=collateralTokenAuctionPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_auction_price" yaml:"outflow_token_auction_price"` - CollateralTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=collateral_token_oracle_price,json=collateralTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_oracle_price" yaml:"outflow_token_oracle_price"` - DebtTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=debt_token_oracle_price,json=debtTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"debt_token_oracle_price" yaml:"inflow_token_oracle_price"` - LockedVaultId uint64 `protobuf:"varint,10,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` - StartTime time.Time `protobuf:"bytes,11,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` - EndTime time.Time `protobuf:"bytes,12,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - AppId uint64 `protobuf:"varint,13,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AuctionType bool `protobuf:"varint,14,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` - CollateralAssetId uint64 `protobuf:"varint,15,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` - DebtAssetId uint64 `protobuf:"varint,16,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` - BonusAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,17,opt,name=bonus_amount,json=bonusAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonus_amount" yaml:"bonus_amount"` - CollateralTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,18,opt,name=collateral_token_initial_price,json=collateralTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_initial_price" yaml:"collateral_token_initial_price"` + CollateralTokenAuctionPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=collateral_token_auction_price,json=collateralTokenAuctionPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"collateral_token_auction_price" yaml:"outflow_token_auction_price"` + CollateralTokenOraclePrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=collateral_token_oracle_price,json=collateralTokenOraclePrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"collateral_token_oracle_price" yaml:"outflow_token_oracle_price"` + DebtTokenOraclePrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=debt_token_oracle_price,json=debtTokenOraclePrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"debt_token_oracle_price" yaml:"inflow_token_oracle_price"` + LockedVaultId uint64 `protobuf:"varint,10,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` + StartTime time.Time `protobuf:"bytes,11,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` + EndTime time.Time `protobuf:"bytes,12,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` + AppId uint64 `protobuf:"varint,13,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionType bool `protobuf:"varint,14,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + CollateralAssetId uint64 `protobuf:"varint,15,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,16,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + BonusAmount cosmossdk_io_math.Int `protobuf:"bytes,17,opt,name=bonus_amount,json=bonusAmount,proto3,customtype=cosmossdk.io/math.Int" json:"bonus_amount" yaml:"bonus_amount"` + CollateralTokenInitialPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,18,opt,name=collateral_token_initial_price,json=collateralTokenInitialPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"collateral_token_initial_price" yaml:"collateral_token_initial_price"` } func (m *Auction) Reset() { *m = Auction{} } @@ -281,10 +282,10 @@ func (m *BidOwnerMapping) GetBidOwner() string { } type LimitBidProtocolData struct { - CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` - DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` - BidValue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bid_value" yaml:"bid_value"` - MaxDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_discount" yaml:"max_discount"` + CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + BidValue cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=cosmossdk.io/math.Int" json:"bid_value" yaml:"bid_value"` + MaxDiscount cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_discount" yaml:"max_discount"` } func (m *LimitBidProtocolData) Reset() { *m = LimitBidProtocolData{} } @@ -335,12 +336,12 @@ func (m *LimitBidProtocolData) GetDebtAssetId() uint64 { } type LimitBidProtocolDataForQuery struct { - CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` - DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` - BidValue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bid_value" yaml:"bid_value"` - MaxDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_discount" yaml:"max_discount"` - CollateralAssetDenom string `protobuf:"bytes,5,opt,name=collateral_asset_denom,json=collateralAssetDenom,proto3" json:"collateral_asset_denom,omitempty" yaml:"collateral_asset_denom"` - DebtAssetDenom string `protobuf:"bytes,6,opt,name=debt_asset_denom,json=debtAssetDenom,proto3" json:"debt_asset_denom,omitempty" yaml:"debt_asset_denom"` + CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + BidValue cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=cosmossdk.io/math.Int" json:"bid_value" yaml:"bid_value"` + MaxDiscount cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_discount" yaml:"max_discount"` + CollateralAssetDenom string `protobuf:"bytes,5,opt,name=collateral_asset_denom,json=collateralAssetDenom,proto3" json:"collateral_asset_denom,omitempty" yaml:"collateral_asset_denom"` + DebtAssetDenom string `protobuf:"bytes,6,opt,name=debt_asset_denom,json=debtAssetDenom,proto3" json:"debt_asset_denom,omitempty" yaml:"debt_asset_denom"` } func (m *LimitBidProtocolDataForQuery) Reset() { *m = LimitBidProtocolDataForQuery{} } @@ -405,13 +406,13 @@ func (m *LimitBidProtocolDataForQuery) GetDebtAssetDenom() string { } type LimitBidProtocolDataWithUserForQuery struct { - CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` - DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` - BidValue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bid_value" yaml:"bid_value"` - MaxDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_discount" yaml:"max_discount"` - CollateralAssetDenom string `protobuf:"bytes,5,opt,name=collateral_asset_denom,json=collateralAssetDenom,proto3" json:"collateral_asset_denom,omitempty" yaml:"collateral_asset_denom"` - DebtAssetDenom string `protobuf:"bytes,6,opt,name=debt_asset_denom,json=debtAssetDenom,proto3" json:"debt_asset_denom,omitempty" yaml:"debt_asset_denom"` - UserBidValue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=user_bid_value,json=userBidValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"user_bid_value" yaml:"user_bid_value"` + CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + BidValue cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=cosmossdk.io/math.Int" json:"bid_value" yaml:"bid_value"` + MaxDiscount cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_discount" yaml:"max_discount"` + CollateralAssetDenom string `protobuf:"bytes,5,opt,name=collateral_asset_denom,json=collateralAssetDenom,proto3" json:"collateral_asset_denom,omitempty" yaml:"collateral_asset_denom"` + DebtAssetDenom string `protobuf:"bytes,6,opt,name=debt_asset_denom,json=debtAssetDenom,proto3" json:"debt_asset_denom,omitempty" yaml:"debt_asset_denom"` + UserBidValue cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=user_bid_value,json=userBidValue,proto3,customtype=cosmossdk.io/math.Int" json:"user_bid_value" yaml:"user_bid_value"` } func (m *LimitBidProtocolDataWithUserForQuery) Reset() { *m = LimitBidProtocolDataWithUserForQuery{} } @@ -489,81 +490,83 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 1180 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0x8e, 0xd3, 0x24, 0xcd, 0xce, 0x26, 0xdd, 0xac, 0x9b, 0x26, 0x9b, 0x4d, 0xb3, 0xde, 0x8c, - 0xa0, 0x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, 0xb5, 0x79, 0x41, 0xed, 0x8b, 0x89, 0xa9, 0x6d, 0x8e, 0xa3, 0x96, 0x47, - 0x86, 0x56, 0x75, 0x88, 0xd9, 0x33, 0xb1, 0x2b, 0x89, 0x7d, 0xab, 0x81, 0xd5, 0xcc, 0x74, 0x83, - 0x94, 0x0a, 0x82, 0x92, 0x35, 0x31, 0xa5, 0xfa, 0x18, 0x43, 0x0e, 0x32, 0x5a, 0xee, 0x9b, 0x2c, - 0xcf, 0xc5, 0x04, 0xa5, 0xfc, 0x3b, 0xcf, 0xdd, 0x06, 0x84, 0xdb, 0xaa, 0x49, 0x6c, 0xac, 0x8c, - 0x0e, 0x05, 0xe1, 0xb5, 0xc5, 0xdc, 0x5c, 0x68, 0xb9, 0xfa, 0x57, 0x00, 0x44, 0x0c, 0x85, 0xac, - 0xcd, 0xe7, 0x74, 0xa5, 0x28, 0xde, 0xa1, 0x6a, 0x43, 0x0e, 0xf1, 0x46, 0x3a, 0xc4, 0x1b, 0xfb, - 0xe9, 0x10, 0x37, 0x37, 0xd4, 0x4b, 0xa4, 0xa6, 0x45, 0x76, 0x16, 0x5e, 0xfc, 0x66, 0x68, 0x56, - 0x41, 0x04, 0x78, 0xba, 0x6e, 0x81, 0x79, 0xec, 0xbb, 0x12, 0x77, 0xe1, 0x8d, 0xb8, 0xeb, 0x0a, - 0xb7, 0x24, 0x71, 0xd3, 0x93, 0x12, 0xf5, 0x26, 0xf6, 0x5d, 0x81, 0xb9, 0x05, 0xe6, 0x50, 0x10, - 0xf0, 0x07, 0x5d, 0x14, 0x0f, 0x5a, 0x4e, 0x62, 0x63, 0x51, 0xbd, 0x56, 0x22, 0x0e, 0xad, 0x59, - 0x14, 0x04, 0x2d, 0x57, 0x6f, 0x81, 0x85, 0xd4, 0x6f, 0x5c, 0xea, 0xca, 0xad, 0xba, 0xb6, 0x35, - 0x6f, 0xde, 0xbb, 0x8c, 0x8d, 0xa2, 0x32, 0xda, 0xfe, 0x79, 0x80, 0xb3, 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 0xaf, 0xaf, 0x6a, 0x53, 0xbf, - 0x5c, 0xd5, 0xa6, 0xbe, 0x7e, 0x34, 0x50, 0x88, 0x7f, 0x96, 0x6f, 0xd3, 0xa3, 0x23, 0xe2, 0x10, - 0xe4, 0xa9, 0x75, 0x73, 0xe0, 0xdf, 0x6b, 0x51, 0xda, 0x9e, 0x13, 0x5f, 0x3e, 0xef, 0xff, 0x15, - 0x00, 0x00, 0xff, 0xff, 0xf2, 0xe9, 0x68, 0x5d, 0x80, 0x0f, 0x00, 0x00, + // 1202 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4d, 0x6f, 0xdc, 0x44, + 0x18, 0x8e, 0xf3, 0xd5, 0xec, 0xec, 0xa6, 0x9b, 0x75, 0x93, 0x76, 0xbb, 0x69, 0xd6, 0xdb, 0x11, + 0xd0, 0x08, 0xa9, 0x5e, 0xb5, 0x54, 0x1c, 0x2a, 0x2e, 0x35, 0x29, 0x74, 0x51, 0x68, 0x8b, 0x15, + 0x5a, 0x84, 0x40, 0xab, 0xb1, 0x3d, 0xd9, 0x8c, 0xe2, 0xf5, 0x18, 0x7b, 0x36, 0x4d, 0x2e, 0xfc, + 0x01, 0x24, 0x14, 0xc4, 0x4f, 0xe0, 0xcf, 0xf4, 0x58, 0x89, 0x0b, 0xe2, 0x60, 0x20, 0xf9, 0x07, + 0x3e, 0xc2, 0x05, 0xcd, 0x87, 0xd7, 0xde, 0x8f, 0x28, 0x29, 0x70, 0xa3, 0xa7, 0xec, 0xcc, 0xbc, + 0xef, 0xf3, 0x3e, 0xf3, 0xcc, 0x33, 0xaf, 0x27, 0xe0, 0x96, 0x4b, 0xfb, 0x1e, 0x3e, 0x6c, 0xa3, + 0x81, 0xcb, 0x08, 0x0d, 0xe2, 0x67, 0x77, 0xdb, 0x07, 0x77, 0x1c, 0xcc, 0xd0, 0x9d, 0x6c, 0xca, + 0x0c, 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 0xe8, 0xe2, 0xe1, 0x80, 0xf6, 0xeb, 0x0b, 0xa2, 0xd0, 0xcd, 0x34, 0x31, 0x36, 0xce, 0xd0, + 0x4f, 0xc4, 0x41, 0x7b, 0x75, 0x4c, 0xc2, 0x2d, 0x3e, 0xad, 0x3f, 0x04, 0x2b, 0x05, 0x99, 0x24, + 0xe4, 0xa2, 0x80, 0x5c, 0xcf, 0xdf, 0x61, 0xe3, 0x11, 0xd0, 0xbe, 0x3c, 0xd4, 0x52, 0xc0, 0xc0, + 0x3f, 0xe6, 0xc1, 0x5b, 0xd3, 0x4e, 0xff, 0x39, 0x61, 0x7b, 0x9f, 0xc7, 0x38, 0x7a, 0xe3, 0x82, + 0xff, 0x81, 0x0b, 0xf4, 0xaf, 0xc0, 0xe5, 0x41, 0x8c, 0xa3, 0x6e, 0xae, 0xa9, 0x7c, 0x10, 0xbe, + 0x7f, 0x9e, 0xa6, 0x6b, 0xb2, 0xc2, 0x68, 0x32, 0xb4, 0x2b, 0x7c, 0xc2, 0x52, 0xe2, 0x5a, 0x8f, + 0x5f, 0x9e, 0x34, 0xb5, 0x57, 0x27, 0x4d, 0xed, 0xf7, 0x93, 0xa6, 0x76, 0x7c, 0xda, 0x9c, 0x79, + 0x75, 0xda, 0x9c, 0xf9, 0xe5, 0xb4, 0x39, 0xf3, 0xe5, 0xbd, 0x91, 0xc7, 0x37, 0x7f, 0xf3, 0xde, + 0xa6, 0xbb, 0xbb, 0xc4, 0x25, 0xc8, 0x57, 0xe3, 0xf6, 0xc8, 0xff, 0xae, 0xe2, 0x39, 0xee, 0x2c, + 0x8a, 0x87, 0xc7, 0x7b, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x49, 0x8f, 0xd6, 0xe2, 0xdd, 0x0e, + 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 35fa4a2a4..54249759d 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -133,7 +134,7 @@ type LimitOrderBid struct { LimitOrderBiddingId uint64 `protobuf:"varint,1,opt,name=limit_order_bidding_id,json=limitOrderBiddingId,proto3" json:"limit_order_bidding_id,omitempty" yaml:"limit_order_bidding_id"` BidderAddress string `protobuf:"bytes,2,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` CollateralTokenId uint64 `protobuf:"varint,3,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty" yaml:"collateral_token_id"` - PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` + PremiumDiscount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=cosmossdk.io/math.Int" json:"premium_discount" yaml:"premium_discount"` DebtTokenId uint64 `protobuf:"varint,5,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty" yaml:"debt_token_id"` DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"debt_token"` BiddingId []uint64 `protobuf:"varint,7,rep,packed,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` @@ -215,15 +216,15 @@ func (m *LimitOrderBid) GetBiddingId() []uint64 { } type AuctionParams struct { - AuctionDurationSeconds uint64 `protobuf:"varint,1,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` - Step github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"step" yaml:"step"` - WithdrawalFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=withdrawal_fee,json=withdrawalFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"withdrawal_fee" yaml:"withdrawal_fee"` - ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` - MinUsdValueLeft uint64 `protobuf:"varint,5,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + AuctionDurationSeconds uint64 `protobuf:"varint,1,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` + Step cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=step,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"step" yaml:"step"` + WithdrawalFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=withdrawal_fee,json=withdrawalFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"withdrawal_fee" yaml:"withdrawal_fee"` + ClosingFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=closing_fee,json=closingFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"closing_fee" yaml:"closing_fee"` + MinUsdValueLeft uint64 `protobuf:"varint,5,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` + BidFactor cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=bid_factor,json=bidFactor,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"bid_factor" yaml:"bid_factor"` // For external apps - LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidation_penalty"` - AuctionBonus github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=auction_bonus,json=auctionBonus,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"auction_bonus" yaml:"auction_bonus"` + LiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_penalty" yaml:"liquidation_penalty"` + AuctionBonus cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=auction_bonus,json=auctionBonus,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"auction_bonus" yaml:"auction_bonus"` } func (m *AuctionParams) Reset() { *m = AuctionParams{} } @@ -326,10 +327,10 @@ func (m *LimitOrderBidsForUser) GetLimitOrderBidKey() []LimitOrderUserKey { } type LimitOrderUserKey struct { - DebtTokenId uint64 `protobuf:"varint,1,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty" yaml:"debt_token_id"` - CollateralTokenId uint64 `protobuf:"varint,2,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty" yaml:"collateral_token_id"` - PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` - LimitOrderBiddingId uint64 `protobuf:"varint,4,opt,name=limit_order_bidding_id,json=limitOrderBiddingId,proto3" json:"limit_order_bidding_id,omitempty" yaml:"limit_order_bidding_id"` + DebtTokenId uint64 `protobuf:"varint,1,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty" yaml:"debt_token_id"` + CollateralTokenId uint64 `protobuf:"varint,2,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty" yaml:"collateral_token_id"` + PremiumDiscount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=cosmossdk.io/math.Int" json:"premium_discount" yaml:"premium_discount"` + LimitOrderBiddingId uint64 `protobuf:"varint,4,opt,name=limit_order_bidding_id,json=limitOrderBiddingId,proto3" json:"limit_order_bidding_id,omitempty" yaml:"limit_order_bidding_id"` } func (m *LimitOrderUserKey) Reset() { *m = LimitOrderUserKey{} } @@ -387,8 +388,8 @@ func (m *LimitOrderUserKey) GetLimitOrderBiddingId() uint64 { } type AuctionFeesCollectionFromLimitBidTx struct { - AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` + AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` } func (m *AuctionFeesCollectionFromLimitBidTx) Reset() { *m = AuctionFeesCollectionFromLimitBidTx{} } @@ -445,77 +446,78 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 1117 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0xae, 0xdb, 0xb4, 0xdd, 0x4c, 0xc9, 0xb6, 0x71, 0xdb, 0xdd, 0xb4, 0x68, 0xe3, 0x32, 0x45, - 0xd0, 0x03, 0xeb, 0x68, 0xcb, 0x1e, 0x10, 0x02, 0xa1, 0xba, 0x55, 0x50, 0xd8, 0x52, 0x16, 0xd3, - 0x2d, 0x12, 0x12, 0xb2, 0x6c, 0xcf, 0x24, 0x3b, 0xaa, 0xed, 0x09, 0x9e, 0xf1, 0x76, 0x73, 0x00, - 0xfe, 0xc2, 0x1e, 0xf8, 0x03, 0xfc, 0x01, 0xb8, 0xf0, 0x23, 0xf6, 0xb8, 0xe2, 0x84, 0x40, 0x32, - 0xa8, 0xfd, 0x01, 0x48, 0x39, 0x72, 0x42, 0x9e, 0x99, 0xc4, 0x71, 0xd2, 0x42, 0xa3, 0x85, 0x53, - 0x66, 0xde, 0x7b, 0xf3, 0xbd, 0xe7, 0x37, 0xdf, 0x7c, 0x33, 0x01, 0xdb, 0x3e, 0x0d, 0x11, 0x7e, - 0xda, 0x70, 0x13, 0x9f, 0x13, 0x1a, 0xb1, 0x93, 0xdd, 0xc6, 0x93, 0x7b, 0x1e, 0xe6, 0xee, 0xbd, - 0x86, 0x47, 0x90, 0xd9, 0x8d, 0x29, 0xa7, 0xfa, 0x86, 0x0c, 0x32, 0xf3, 0x20, 0x53, 0x05, 0x6d, - 0xae, 0x75, 0x68, 0x87, 0x8a, 0xa8, 0x46, 0x36, 0x92, 0x0b, 0x36, 0x8d, 0x0e, 0xa5, 0x9d, 0x00, - 0x37, 0xc4, 0xcc, 0x4b, 0xda, 0x0d, 0x4e, 0x42, 0xcc, 0xb8, 0x1b, 0x76, 0x55, 0x40, 0xdd, 0xa7, - 0x2c, 0xa4, 0xac, 0xe1, 0xb9, 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d, 0x1b, 0x85, 0x3f, 0x03, 0x22, 0x99, 0xb7, 0x20, 0x9e, 0x60, 0x6f, 0xff, - 0x1d, 0x00, 0x00, 0xff, 0xff, 0x24, 0x38, 0x09, 0x3e, 0x2e, 0x0c, 0x00, 0x00, + // 1128 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6e, 0xdb, 0x36, + 0x18, 0x8f, 0x12, 0x27, 0xa9, 0x99, 0xb9, 0x89, 0x95, 0xa4, 0x75, 0x52, 0xd4, 0xca, 0x98, 0x01, + 0xcb, 0x61, 0x95, 0xd1, 0xac, 0x87, 0x6e, 0xeb, 0x25, 0x6a, 0x60, 0xc0, 0x6b, 0x96, 0x15, 0x5a, + 0x9a, 0x01, 0x05, 0x06, 0x8d, 0x16, 0x69, 0x87, 0x88, 0x24, 0x7a, 0x22, 0xdd, 0xd4, 0x97, 0xed, + 0x15, 0x7a, 0xd8, 0x75, 0x87, 0x3d, 0xc1, 0x5e, 0xa3, 0xd8, 0xa9, 0xd8, 0x69, 0xd8, 0x41, 0x1b, + 0x92, 0x37, 0xf0, 0x71, 0xa7, 0x41, 0x24, 0x6d, 0x59, 0x76, 0xb2, 0xb8, 0x68, 0x4f, 0x26, 0xbf, + 0x3f, 0xbf, 0xef, 0xd3, 0xc7, 0x9f, 0x7f, 0x24, 0xd8, 0xf6, 0x59, 0x88, 0xc9, 0xcb, 0x1a, 0xea, + 0xfa, 0x82, 0xb2, 0x88, 0x1f, 0xef, 0xd6, 0x5e, 0xdc, 0x6f, 0x12, 0x81, 0xee, 0xd7, 0x9a, 0x14, + 0xdb, 0x9d, 0x98, 0x09, 0x66, 0x6e, 0xa8, 0x20, 0x3b, 0x0b, 0xb2, 0x75, 0xd0, 0xe6, 0x5a, 0x9b, + 0xb5, 0x99, 0x8c, 0xaa, 0xa5, 0x2b, 0x95, 0xb0, 0x69, 0xb5, 0x19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x35, 0xde, 0x9c, 0x57, 0x8d, 0x7f, + 0xce, 0xab, 0xc6, 0xab, 0x8b, 0xea, 0xcc, 0x9b, 0x8b, 0xea, 0xcc, 0x9f, 0x17, 0xd5, 0x99, 0xe7, + 0x0f, 0x72, 0xd7, 0x49, 0x4a, 0xc4, 0x7b, 0xac, 0xd5, 0xa2, 0x3e, 0x45, 0x81, 0xde, 0xd7, 0x72, + 0xef, 0x72, 0x79, 0xc1, 0x34, 0x17, 0xe4, 0x6b, 0xe8, 0xd3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x38, 0x2c, 0x7b, 0xbc, 0xb9, 0x0b, 0x00, 0x00, } func (m *Bid) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 6bc42a077..7e9dc1f4d 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -3,25 +3,25 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/auctions module sentinel errors var ( - ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") - ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") - ErrCannotLeaveDebtLessThanDust = sdkerrors.Register(ModuleName, 703, "You need to leave debt atleast equal to dust value or greater. Try making a full bid, or a smaller bid. Your current bid is just short of the dust value , hence it fails.") - ErrorPriceNotFound = sdkerrors.Register(ModuleName, 704, "price not found") - ErrBidCannotBeZero = sdkerrors.Register(ModuleName, 705, "Bid amount can't be Zero") - ErrorLowBidAmount = sdkerrors.Register(ModuleName, 706, "bidding amount is lower than expected") - ErrorMaxBidAmount = sdkerrors.Register(ModuleName, 707, "bidding amount is greater than maximum bidding amount") - ErrLiquidationNotFound = sdkerrors.Register(ModuleName, 708, "Liquidation data not found for the auction") - ErrBidNotFound = sdkerrors.Register(ModuleName, 709, "There exists no active bid for the user with given params") - ErrAuctionParamsNotFound = sdkerrors.Register(ModuleName, 710, "There exists no auction params") - ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 711, "unknown proposal type") - ErrorUnknownDebtToken = sdkerrors.Register(ModuleName, 712, "Bid token is not the debt token") - ErrorDiscountGreaterThanMaxDiscount = sdkerrors.Register(ModuleName, 713, "Premium discount entered is greater than max discount") - ErrAuctionLookupTableNotFound = sdkerrors.Register(ModuleName, 714, "auctionLookupTable not found") - ErrorUnableToSetNetFees = sdkerrors.Register(ModuleName, 715, "Unable To set net fees collected after auction closed") - ErrorInGettingLockedVault = sdkerrors.Register(ModuleName, 716, "error in bid dutch auction - locked vault not found") + ErrDutchAuctionDisabled = errorsmod.Register(ModuleName, 701, "Dutch auction not enabled for the app") + ErrEnglishAuctionDisabled = errorsmod.Register(ModuleName, 702, "English auction not enabled for the app") + ErrCannotLeaveDebtLessThanDust = errorsmod.Register(ModuleName, 703, "You need to leave debt atleast equal to dust value or greater. Try making a full bid, or a smaller bid. Your current bid is just short of the dust value , hence it fails.") + ErrorPriceNotFound = errorsmod.Register(ModuleName, 704, "price not found") + ErrBidCannotBeZero = errorsmod.Register(ModuleName, 705, "Bid amount can't be Zero") + ErrorLowBidAmount = errorsmod.Register(ModuleName, 706, "bidding amount is lower than expected") + ErrorMaxBidAmount = errorsmod.Register(ModuleName, 707, "bidding amount is greater than maximum bidding amount") + ErrLiquidationNotFound = errorsmod.Register(ModuleName, 708, "Liquidation data not found for the auction") + ErrBidNotFound = errorsmod.Register(ModuleName, 709, "There exists no active bid for the user with given params") + ErrAuctionParamsNotFound = errorsmod.Register(ModuleName, 710, "There exists no auction params") + ErrorUnknownProposalType = errorsmod.Register(ModuleName, 711, "unknown proposal type") + ErrorUnknownDebtToken = errorsmod.Register(ModuleName, 712, "Bid token is not the debt token") + ErrorDiscountGreaterThanMaxDiscount = errorsmod.Register(ModuleName, 713, "Premium discount entered is greater than max discount") + ErrAuctionLookupTableNotFound = errorsmod.Register(ModuleName, 714, "auctionLookupTable not found") + ErrorUnableToSetNetFees = errorsmod.Register(ModuleName, 715, "Unable To set net fees collected after auction closed") + ErrorInGettingLockedVault = errorsmod.Register(ModuleName, 716, "error in bid dutch auction - locked vault not found") ) diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index e93dd6b33..7a0092b9c 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -1,6 +1,7 @@ package types import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -75,7 +76,7 @@ func GetUserBidHistoricalKey(address string) []byte { return append(UserBidHistoricalKeyPrefix, address...) } -func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium sdk.Int, address string) []byte { +func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium sdkmath.Int, address string) []byte { return append(append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian((premium.Uint64()))...), address...) } @@ -83,7 +84,7 @@ func MarketBidProtocolKey(debtTokenID, collateralTokenID uint64) []byte { return append(append(MarketBidProtocolKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...) } -func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium sdk.Int) []byte { +func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium sdkmath.Int) []byte { return append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian((premium.Uint64()))...) } diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 9cc3cb233..4da8f5840 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -596,10 +596,10 @@ func (m *QueryUserLimitBidsByAssetIDRequest) GetPagination() *query.PageRequest } type QueryUserLimitBidsByAssetIDResponse struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - TotalAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=total_amount,json=totalAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_amount" yaml:"total_amount"` - LimitOrderBids []LimitOrderBid `protobuf:"bytes,3,rep,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` - Pagination *query.PageResponse `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + TotalAmount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=total_amount,json=totalAmount,proto3,customtype=cosmossdk.io/math.Int" json:"total_amount" yaml:"total_amount"` + LimitOrderBids []LimitOrderBid `protobuf:"bytes,3,rep,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` + Pagination *query.PageResponse `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } func (m *QueryUserLimitBidsByAssetIDResponse) Reset() { *m = QueryUserLimitBidsByAssetIDResponse{} } @@ -1342,107 +1342,107 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1597 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 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f0, 0x0f, 0x31, 0xf8, 0xff, 0xa7, 0x62, 0x48, 0x84, 0xf1, 0x66, - 0x81, 0xfe, 0x45, 0xa0, 0x2f, 0xb8, 0xa5, 0xa6, 0x67, 0xa3, 0x66, 0x0f, 0xbd, 0x7c, 0x10, 0x66, - 0x9e, 0x76, 0x38, 0xb2, 0xb8, 0xc5, 0x58, 0xdc, 0xa4, 0xd7, 0x83, 0x58, 0x38, 0xdb, 0x36, 0xdb, - 0xb3, 0x59, 0x13, 0xe5, 0x93, 0x24, 0xa0, 0xf9, 0x5c, 0x93, 0x56, 0x3d, 0x2d, 0xe6, 0x1a, 0xfd, - 0x86, 0x40, 0x47, 0x79, 0x76, 0x1a, 0x99, 0xc6, 0xfe, 0x26, 0x57, 0x98, 0xaa, 0x63, 0x04, 0x32, - 0xba, 0xc6, 0x18, 0x5d, 0xa1, 0x97, 0x83, 0x18, 0xf9, 0xd9, 0xc4, 0x22, 0xf1, 0x1d, 0x81, 0xde, - 0xa0, 0x23, 0x11, 0x3d, 0x13, 0x17, 0x5d, 0x40, 0xdf, 0x27, 0xbc, 0xf8, 0x74, 0x83, 0x91, 0xe5, - 0x51, 0xc6, 0x72, 0x82, 0x1e, 0xae, 0xc9, 0x72, 0xeb, 0x59, 0x8c, 0xfe, 0x4d, 0x60, 0x30, 0xf0, - 0x60, 0xcf, 0xd8, 0x5c, 0x89, 0x59, 0x07, 0x31, 0x5a, 0x24, 0xe1, 0x95, 0x86, 0xf8, 0x42, 0xae, - 0x97, 0x18, 0xd7, 0x73, 0xf4, 0x6c, 0x58, 0xa5, 0x45, 0x76, 0x1d, 0xf4, 0x4f, 0x02, 0x43, 0x61, - 0x27, 0x5b, 0x7a, 0xe1, 0x69, 0x14, 0xf1, 0x35, 0x0a, 0xc2, 0xc5, 0x7f, 0xe7, 0x04, 0x29, 0xcf, - 0x32, 0xca, 0x2f, 0xd1, 0x99, 0x3a, 0xe4, 0xad, 0x1c, 0xb5, 0xcb, 0x55, 0xea, 0x74, 0x04, 0x50, - 0x39, 0x28, 0xd2, 0xa9, 0x38, 0x0b, 0xb4, 0xe7, 0x6c, 0x2c, 0x4c, 0xd7, 0x33, 0x24, 0x8e, 0x60, - 0x4e, 0xe1, 0x65, 0x16, 0xd8, 0x80, 0x88, 0x05, 0xfe, 0x6b, 0x02, 0xbb, 0x7c, 0x67, 0x2a, 0x7a, - 0x22, 0xee, 0x4e, 0xe8, 0x3d, 0x26, 0x0a, 0x27, 0xeb, 0x1e, 0x87, 0x5c, 0xce, 0x30, 0x2e, 0xc7, - 0xe9, 0xd1, 0xb0, 0x8d, 0x34, 0x83, 0x98, 0x7d, 0x1b, 0x6a, 0xfa, 0xea, 0xc3, 0x47, 0x49, 0xb2, - 0xfe, 0x28, 0x49, 0x7e, 0x7e, 0x94, 0x24, 0xf7, 0x1f, 0x27, 0x9b, 0xd6, 0x1f, 0x27, 0x9b, 0x7e, - 0x7c, 0x9c, 0x6c, 0x7a, 0xe3, 0x98, 0xe7, 0xe2, 0xd3, 0x71, 0x3c, 0x61, 0x2e, 0x2c, 0xe8, 0x39, - 0x5d, 0x31, 0xdc, 0x89, 0x3c, 0xff, 0xa8, 0x63, 0x57, 0xa1, 0xd9, 0x56, 0x26, 0xf8, 0xd1, 0x7f, - 0x02, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xc0, 0x24, 0x17, 0xbd, 0x1c, 0x00, 0x00, + // 1590 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4b, 0x6c, 0xdc, 0x54, + 0x17, 0xce, 0x9d, 0xe4, 0xcf, 0xe3, 0xa4, 0x69, 0x9b, 0x9b, 0xb7, 0x9b, 0x4e, 0x12, 0xf7, 0xff, + 0xdb, 0xf4, 0x35, 0x4e, 0xd2, 0xf4, 0xa1, 0xf6, 0x6f, 0x4a, 0xa7, 0x25, 0x34, 0x05, 0x95, 0x62, + 0xa5, 0x8d, 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, + 0x23, 0xdd, 0x1c, 0x6e, 0x25, 0x86, 0x28, 0x57, 0x05, 0x14, 0x37, 0x08, 0xf4, 0xf9, 0x40, 0x63, + 0x91, 0x16, 0xa0, 0xdd, 0xad, 0xc6, 0x20, 0x19, 0x6d, 0x8e, 0x59, 0xa5, 0x01, 0xac, 0xd2, 0x1e, + 0x4f, 0x95, 0x2c, 0x51, 0x2e, 0x07, 0xa3, 0x6f, 0x78, 0x18, 0x25, 0x18, 0xa3, 0x43, 0x91, 0x8c, + 0x38, 0xaa, 0x38, 0x94, 0xbe, 0x20, 0xb0, 0x97, 0x51, 0x4a, 0xeb, 0x6a, 0x59, 0x83, 0x7e, 0x68, + 0xcd, 0xea, 0xaa, 0xaa, 0x95, 0x58, 0xf5, 0x3b, 0x64, 0x7c, 0xa2, 0x43, 0xd0, 0x9e, 0xd5, 0x55, + 0xae, 0x4b, 0x82, 0xe9, 0xd2, 0x96, 0xd5, 0x55, 0xbf, 0x26, 0xcd, 0x61, 0x9a, 0xb4, 0x34, 0x5a, + 0x93, 0x5f, 0x09, 0x74, 0x57, 0x11, 0x40, 0x3d, 0x0e, 0x7b, 0x19, 0xa4, 0xbb, 0xb7, 0x36, 0x47, + 0xba, 0x78, 0x20, 0xfe, 0x5e, 0x2c, 0x93, 0x7a, 0x09, 0x5a, 0xb2, 0xba, 0x6a, 0x0d, 0x26, 0x98, + 0x6c, 0xc9, 0x10, 0xd9, 0xd2, 0xba, 0x9a, 0xee, 0x41, 0xc9, 0x3a, 0xcb, 0xc1, 0x2c, 0x51, 0x66, + 0x01, 0x7c, 0x52, 0x35, 0x37, 0x5c, 0xaa, 0x7d, 0x30, 0x54, 0xdd, 0x7c, 0xde, 0x5d, 0xe6, 0x5d, + 0x02, 0x42, 0xd0, 0xaf, 0x58, 0x8f, 0x02, 0xec, 0x76, 0x57, 0x95, 0x67, 0xd7, 0x19, 0x8f, 0xee, + 0x52, 0xdc, 0x7c, 0xf6, 0x23, 0xf1, 0x3e, 0x4f,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x22, 0xec, 0x20, 0xcd, 0x20, 0x66, 0xdf, 0x81, 0x9a, 0xbe, + 0xf6, 0xf0, 0x51, 0x92, 0x6c, 0x3c, 0x4a, 0x92, 0x1f, 0x1f, 0x25, 0xc9, 0xfd, 0xc7, 0xc9, 0xa6, + 0x8d, 0xc7, 0xc9, 0xa6, 0xef, 0x1f, 0x27, 0x9b, 0x5e, 0x9f, 0x5e, 0xd2, 0xed, 0xe5, 0x95, 0xac, + 0x83, 0x0a, 0x03, 0x1f, 0x37, 0x17, 0x17, 0xf5, 0x9c, 0xae, 0x18, 0x6e, 0x22, 0xcf, 0xff, 0xe5, + 0x9c, 0x78, 0x56, 0xb6, 0x95, 0x09, 0x7e, 0xe2, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe2, 0xf4, + 0x34, 0x84, 0xac, 0x1c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/auctionsV2/types/tx.go b/x/auctionsV2/types/tx.go index d70502f3b..7b03be4c9 100644 --- a/x/auctionsV2/types/tx.go +++ b/x/auctionsV2/types/tx.go @@ -2,6 +2,8 @@ package types import ( "fmt" + + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -41,7 +43,7 @@ func (msg *MsgPlaceMarketBidRequest) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -func NewMsgDepositLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount sdk.Int, amount sdk.Coin) *MsgDepositLimitBidRequest { +func NewMsgDepositLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount sdkmath.Int, amount sdk.Coin) *MsgDepositLimitBidRequest { return &MsgDepositLimitBidRequest{ CollateralTokenId: collateralTokenId, DebtTokenId: debtTokenId, @@ -79,7 +81,7 @@ func (msg *MsgDepositLimitBidRequest) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -func NewMsgCancelLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount sdk.Int) *MsgCancelLimitBidRequest { +func NewMsgCancelLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount sdkmath.Int) *MsgCancelLimitBidRequest { return &MsgCancelLimitBidRequest{ CollateralTokenId: collateralTokenId, DebtTokenId: debtTokenId, @@ -113,7 +115,7 @@ func (msg *MsgCancelLimitBidRequest) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -func NewMsgWithdrawLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount sdk.Int, amount sdk.Coin) *MsgWithdrawLimitBidRequest { +func NewMsgWithdrawLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount sdkmath.Int, amount sdk.Coin) *MsgWithdrawLimitBidRequest { return &MsgWithdrawLimitBidRequest{ CollateralTokenId: collateralTokenId, DebtTokenId: debtTokenId, diff --git a/x/auctionsV2/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go index b2d9b7ac0..0ec4f3988 100644 --- a/x/auctionsV2/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -106,11 +106,11 @@ func (m *MsgPlaceMarketBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgPlaceMarketBidResponse proto.InternalMessageInfo type MsgDepositLimitBidRequest struct { - CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` - DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` - PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` - Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` - Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=cosmossdk.io/math.Int" json:"premium_discount" yaml:"premium_discount"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` } func (m *MsgDepositLimitBidRequest) Reset() { *m = MsgDepositLimitBidRequest{} } @@ -183,10 +183,10 @@ func (m *MsgDepositLimitBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositLimitBidResponse proto.InternalMessageInfo type MsgCancelLimitBidRequest struct { - CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` - DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` - PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` - Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=cosmossdk.io/math.Int" json:"premium_discount" yaml:"premium_discount"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` } func (m *MsgCancelLimitBidRequest) Reset() { *m = MsgCancelLimitBidRequest{} } @@ -259,11 +259,11 @@ func (m *MsgCancelLimitBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCancelLimitBidResponse proto.InternalMessageInfo type MsgWithdrawLimitBidRequest struct { - CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` - DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` - PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` - Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` - Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=cosmossdk.io/math.Int" json:"premium_discount" yaml:"premium_discount"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` } func (m *MsgWithdrawLimitBidRequest) Reset() { *m = MsgWithdrawLimitBidRequest{} } @@ -351,43 +351,43 @@ func init() { } var fileDescriptor_2c216a24ef98c1b4 = []byte{ - // 568 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0x93, 0xae, 0x54, 0xaa, 0x27, 0x04, 0xf3, 0x10, 0xb4, 0x19, 0x4b, 0xab, 0x1c, 0x50, - 0x2f, 0x73, 0xb4, 0x6e, 0x80, 0xc4, 0xb1, 0xdb, 0xa5, 0x12, 0x95, 0x50, 0x85, 0x86, 0xc4, 0xa5, - 0x72, 0x62, 0xaf, 0xb3, 0x9a, 0xc4, 0x25, 0x76, 0x61, 0xbb, 0x20, 0x21, 0x71, 0xe2, 0xb4, 0x8f, - 0xc1, 0x27, 0x80, 0xaf, 0xd0, 0xe3, 0x8e, 0x88, 0x43, 0x05, 0xed, 0x37, 0xe0, 0xcc, 0x01, 0x25, - 0xf6, 0xd6, 0x76, 0x4b, 0x55, 0x7a, 0x86, 0x53, 0x9b, 0xf7, 0xfe, 0xcf, 0xf9, 0xfb, 0x97, 0xf7, - 0x6c, 0xe0, 0xf8, 0x3c, 0x24, 0xf4, 0xd4, 0xc5, 0x03, 0x5f, 0x32, 0x1e, 0x89, 0xa3, 0xba, 0xfb, - 0x76, 0xd7, 0xa3, 0x12, 0xef, 0xba, 0xf2, 0x14, 0xf5, 0x63, 0x2e, 0x39, 0x2c, 0x2b, 0x0d, 0x9a, - 0x6a, 0x90, 0xd6, 0x58, 0xf7, 0xba, 0xbc, 0xcb, 0x53, 0x95, 0x9b, 0xfc, 0x53, 0x05, 0x96, 0xed, - 0x73, 0x11, 0x72, 0xe1, 0x7a, 0x58, 0xd0, 0xab, 0xe5, 0x7c, 0xce, 0x22, 0x95, 0x77, 0x3e, 0x99, - 0xa0, 0xd4, 0x12, 0xdd, 0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d, - 0xd7, 0xfb, 0x73, 0x8d, 0x9f, 0xbc, 0x63, 0x87, 0x1f, 0x1f, 0x33, 0x9f, 0xe1, 0x40, 0x3f, 0xbb, - 0x73, 0x97, 0x67, 0x3a, 0x0a, 0x5e, 0x21, 0xbd, 0xe7, 0xf6, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, - 0xba, 0xe5, 0xa9, 0x6c, 0x5e, 0x07, 0x00, 0x00, + // 564 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0xcf, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x93, 0xae, 0x54, 0xaa, 0x27, 0x04, 0xf3, 0xf8, 0xd1, 0x66, 0x2c, 0xad, 0x72, 0xea, + 0x05, 0x47, 0xeb, 0xc6, 0x0f, 0x71, 0xec, 0x76, 0xa9, 0x44, 0x25, 0x54, 0xa1, 0x21, 0x71, 0xa9, + 0x9c, 0xd8, 0x6b, 0xad, 0x26, 0x71, 0x89, 0x5d, 0xd8, 0x2e, 0x48, 0x48, 0x9c, 0x38, 0xed, 0x9f, + 0x00, 0xf1, 0xa7, 0xf4, 0xb8, 0x23, 0xe2, 0x50, 0x41, 0x7b, 0xe4, 0xc6, 0x5f, 0x80, 0x52, 0x7b, + 0x6b, 0xb7, 0x25, 0xaa, 0x7a, 0x45, 0xbb, 0x25, 0xef, 0x7d, 0x9f, 0xf3, 0x7d, 0x9f, 0x3c, 0xdb, + 0xc0, 0xf1, 0x79, 0x48, 0xe8, 0xb1, 0x8b, 0x87, 0xbe, 0x64, 0x3c, 0x12, 0x87, 0x75, 0xf7, 0xfd, + 0x8e, 0x47, 0x25, 0xde, 0x71, 0xe5, 0x31, 0x1a, 0xc4, 0x5c, 0x72, 0x58, 0x56, 0x1a, 0x34, 0xd7, + 0x20, 0xad, 0xb1, 0xee, 0x75, 0x79, 0x97, 0xcf, 0x54, 0x6e, 0xf2, 0x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b, 0xbf, 0x26, 0xb6, 0x79, 0x3a, 0xb5, 0x8d, 0xb3, 0xa9, + 0x6d, 0xfc, 0x98, 0xda, 0xc6, 0xdb, 0xbd, 0x2e, 0x93, 0xbd, 0xa1, 0x97, 0xac, 0xef, 0xaa, 0x6f, + 0x3c, 0xe6, 0x47, 0x47, 0xcc, 0x67, 0x38, 0xd0, 0xef, 0xee, 0xa5, 0x9b, 0x50, 0x9e, 0x0c, 0xa8, + 0xf0, 0x0a, 0xb3, 0x4b, 0x6b, 0xf7, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xda, 0x01, 0x31, 0x2d, + 0x2b, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/bandoracle/abci.go b/x/bandoracle/abci.go index 270093bc0..4b3075cf6 100644 --- a/x/bandoracle/abci.go +++ b/x/bandoracle/abci.go @@ -1,7 +1,6 @@ package bandoracle import ( - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -9,7 +8,7 @@ import ( "github.com/comdex-official/comdex/x/bandoracle/types" ) -func BeginBlocker(ctx sdk.Context, _ abci.RequestBeginBlock, k keeper.Keeper) { +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) block := k.GetLastBlockHeight(ctx) diff --git a/x/bandoracle/client/cli/tx.go b/x/bandoracle/client/cli/tx.go index 9a956401a..ce67d57d9 100644 --- a/x/bandoracle/client/cli/tx.go +++ b/x/bandoracle/client/cli/tx.go @@ -139,10 +139,6 @@ func NewCmdSubmitFetchPriceProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } diff --git a/x/bandoracle/expected/keeper.go b/x/bandoracle/expected/keeper.go index 183ad9c7d..0c258b70c 100644 --- a/x/bandoracle/expected/keeper.go +++ b/x/bandoracle/expected/keeper.go @@ -2,10 +2,10 @@ package expected import ( sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - // ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + // ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" assettypes "github.com/comdex-official/comdex/x/asset/types" marketttypes "github.com/comdex-official/comdex/x/market/types" diff --git a/x/bandoracle/handler.go b/x/bandoracle/handler.go index 7b0ea5d40..4d423a8c3 100644 --- a/x/bandoracle/handler.go +++ b/x/bandoracle/handler.go @@ -3,6 +3,10 @@ package bandoracle import ( "fmt" + bam "github.com/cosmos/cosmos-sdk/baseapp" + + errorsmod "cosmossdk.io/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/pkg/errors" @@ -14,12 +18,12 @@ import ( ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { switch msg := msg.(type) { default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } diff --git a/x/bandoracle/keeper/keeper.go b/x/bandoracle/keeper/keeper.go index f1811c423..fcb964b27 100644 --- a/x/bandoracle/keeper/keeper.go +++ b/x/bandoracle/keeper/keeper.go @@ -3,16 +3,16 @@ package keeper import ( "fmt" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" "github.com/comdex-official/comdex/x/bandoracle/expected" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" diff --git a/x/bandoracle/keeper/oracle.go b/x/bandoracle/keeper/oracle.go index a04e3b666..f265866ec 100644 --- a/x/bandoracle/keeper/oracle.go +++ b/x/bandoracle/keeper/oracle.go @@ -3,15 +3,16 @@ package keeper import ( "time" + errorsmod "cosmossdk.io/errors" + "github.com/bandprotocol/bandchain-packet/obi" "github.com/bandprotocol/bandchain-packet/packet" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - // channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + // channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" protobuftypes "github.com/cosmos/gogoproto/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" "github.com/comdex-official/comdex/x/bandoracle/types" ) @@ -25,7 +26,7 @@ func (k Keeper) SetFetchPriceResult(ctx sdk.Context, requestID types.OracleReque func (k Keeper) GetFetchPriceResult(ctx sdk.Context, id types.OracleRequestID) (types.FetchPriceResult, error) { bz := ctx.KVStore(k.storeKey).Get(types.FetchPriceResultStoreKey(id)) if bz == nil { - return types.FetchPriceResult{}, sdkerrors.Wrapf(types.ErrRequestIDNotAvailable, + return types.FetchPriceResult{}, errorsmod.Wrapf(types.ErrRequestIDNotAvailable, "GetResult: Result for request ID %d is not available.", id, ) } diff --git a/x/bandoracle/module.go b/x/bandoracle/module.go index 3173cb7a2..52490c137 100644 --- a/x/bandoracle/module.go +++ b/x/bandoracle/module.go @@ -18,7 +18,7 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" "github.com/comdex-official/comdex/x/bandoracle/client/cli" "github.com/comdex-official/comdex/x/bandoracle/keeper" @@ -159,6 +159,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -181,12 +187,10 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - BeginBlocker(ctx, req, am.keeper) +func (am AppModule) BeginBlock(ctx sdk.Context) { + BeginBlocker(ctx, am.keeper) } -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/bandoracle/module_ibc.go b/x/bandoracle/module_ibc.go index 5092fccc7..f0637df5b 100644 --- a/x/bandoracle/module_ibc.go +++ b/x/bandoracle/module_ibc.go @@ -1,14 +1,14 @@ package bandoracle import ( - + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" "github.com/comdex-official/comdex/x/bandoracle/types" ) @@ -26,11 +26,11 @@ func (im IBCModule) OnChanOpenInit( ) (string, error) { // Require portID is the portID module is bound to boundPort := im.keeper.GetPort(ctx) if boundPort != portID { - return "", sdkerrors.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) + return "", errorsmod.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) } if version != types.Version { - return "", sdkerrors.Wrapf(types.ErrInvalidVersion, "got %s, expected %s", version, types.Version) + return "", errorsmod.Wrapf(types.ErrInvalidVersion, "got %s, expected %s", version, types.Version) } // Claim channel capability passed back by IBC module @@ -54,11 +54,11 @@ func (im IBCModule) OnChanOpenTry( ) (string, error) { // Require portID is the portID module is bound to boundPort := im.keeper.GetPort(ctx) if boundPort != portID { - return "", sdkerrors.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) + return "", errorsmod.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) } if counterpartyVersion != types.Version { - return "", sdkerrors.Wrapf(types.ErrInvalidVersion, "invalid counterparty version: got: %s, expected %s", counterpartyVersion, types.Version) + return "", errorsmod.Wrapf(types.ErrInvalidVersion, "invalid counterparty version: got: %s, expected %s", counterpartyVersion, types.Version) } // Module may have already claimed capability in OnChanOpenInit in the case of crossing hellos @@ -84,7 +84,7 @@ func (im IBCModule) OnChanOpenAck( counterpartyVersion string, ) error { if counterpartyVersion != types.Version { - return sdkerrors.Wrapf(types.ErrInvalidVersion, "invalid counterparty version: %s, expected %s", counterpartyVersion, types.Version) + return errorsmod.Wrapf(types.ErrInvalidVersion, "invalid counterparty version: %s, expected %s", counterpartyVersion, types.Version) } return nil } @@ -105,7 +105,7 @@ func (im IBCModule) OnChanCloseInit( channelID string, ) error { // Disallow user-initiated channel closing for channels. - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") } // OnChanCloseConfirm implements the IBCModule interface. @@ -126,7 +126,7 @@ func (im IBCModule) OnRecvPacket( var ack channeltypes.Acknowledgement oracleAck, err := im.handleOraclePacket(ctx, modulePacket) if err != nil { - return channeltypes.NewErrorAcknowledgement(sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet data: "+err.Error())) + return channeltypes.NewErrorAcknowledgement(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet data: "+err.Error())) } else if ack != oracleAck { return oracleAck } @@ -134,13 +134,13 @@ func (im IBCModule) OnRecvPacket( //TODO: review commented code // var modulePacketData types.BandoraclePacketData // if err := modulePacketData.Unmarshal(modulePacket.GetData()); err != nil { - // return channeltypes.NewErrorAcknowledgement(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet data: %s", err.Error())) + // return channeltypes.NewErrorAcknowledgement(errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet data: %s", err.Error())) // } // // Dispatch packet // switch packet := modulePacketData.Packet.(type) { // default: - // return channeltypes.NewErrorAcknowledgement(sdkerrors.Wrapf(types.ErrUnrecognisedPacket, "unrecognized %s packet type: %T", types.ModuleName, packet)) + // return channeltypes.NewErrorAcknowledgement(errorsmod.Wrapf(types.ErrUnrecognisedPacket, "unrecognized %s packet type: %T", types.ModuleName, packet)) // } return nil @@ -156,7 +156,7 @@ func (im IBCModule) OnAcknowledgementPacket( ) error { var ack channeltypes.Acknowledgement if err := types.ModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet acknowledgement: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet acknowledgement: %v", err) } _, err := im.handleOracleAcknowledgment(ctx, ack, modulePacket) @@ -172,7 +172,7 @@ func (im IBCModule) OnAcknowledgementPacket( // var modulePacketData types.BandoraclePacketData // if err := modulePacketData.Unmarshal(modulePacket.GetData()); err != nil { // fmt.Println("err in OnAcknowledgementPacket------------------") - // return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet data: %s", err.Error()) + // return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet data: %s", err.Error()) // } // fmt.Println("OnAcknowledgementPacket data", modulePacketData) // fmt.Println("OnAcknowledgementPacket------------------ end") @@ -181,7 +181,7 @@ func (im IBCModule) OnAcknowledgementPacket( // switch packet := modulePacketData.Packet.(type) { // default: // errMsg := fmt.Sprintf("unrecognized %s packet type: %T", types.ModuleName, packet) - // return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + // return errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) // } return nil } @@ -196,14 +196,14 @@ func (im IBCModule) OnTimeoutPacket( // fmt.Println("modulePacket.GetData(on timout reaal data)", modulePacket) // var modulePacketData types.BandoraclePacketData // if err := modulePacketData.Unmarshal(modulePacket.GetData()); err != nil { - // return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet data: %s", err.Error()) + // return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal packet data: %s", err.Error()) // } // // Dispatch packet // switch packet := modulePacketData.Packet.(type) { // default: // errMsg := fmt.Sprintf("unrecognized %s packet type: %T", types.ModuleName, packet) - // return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + // return errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) // } return nil } diff --git a/x/bandoracle/module_simulation.go b/x/bandoracle/module_simulation.go index 49f1c9df2..0e4ac9e7a 100644 --- a/x/bandoracle/module_simulation.go +++ b/x/bandoracle/module_simulation.go @@ -3,7 +3,6 @@ package bandoracle import ( "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -37,14 +36,6 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP return nil } -// RandomizedParams creates randomized param changes for the simulator. -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// return []simtypes.ParamChange{} -// } - -// RegisterStoreDecoder registers a decoder. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/bandoracle/oracle.go b/x/bandoracle/oracle.go index 3d1e91766..3f06dde5a 100644 --- a/x/bandoracle/oracle.go +++ b/x/bandoracle/oracle.go @@ -1,11 +1,12 @@ package bandoracle import ( + errorsmod "cosmossdk.io/errors" "github.com/bandprotocol/bandchain-packet/obi" "github.com/bandprotocol/bandchain-packet/packet" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" "github.com/comdex-official/comdex/x/bandoracle/types" ) @@ -18,7 +19,7 @@ func (im IBCModule) handleOraclePacket( var modulePacketData packet.OracleResponsePacketData fetchPriceMsg := im.keeper.GetFetchPriceMsg(ctx) if modulePacket.DestinationChannel != fetchPriceMsg.SourceChannel { - return channeltypes.Acknowledgement{}, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, + return channeltypes.Acknowledgement{}, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "Module packet destination channel and source channel mismatch") } if err := types.ModuleCdc.UnmarshalJSON(modulePacket.GetData(), &modulePacketData); err != nil { @@ -30,14 +31,14 @@ func (im IBCModule) handleOraclePacket( var fetchPriceResult types.FetchPriceResult if err := obi.Decode(modulePacketData.Result, &fetchPriceResult); err != nil { ack = channeltypes.NewErrorAcknowledgement(err) - return ack, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, + return ack, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "cannot decode the fetchPrice received packet") } im.keeper.SetFetchPriceResult(ctx, types.OracleRequestID(modulePacketData.RequestID), fetchPriceResult) // TODO: FetchPrice market data reception logic //nolint:godox default: - err := sdkerrors.Wrapf(sdkerrors.ErrJSONUnmarshal, + err := errorsmod.Wrapf(sdkerrors.ErrJSONUnmarshal, "market received packet not found: %s", modulePacketData.GetClientID()) ack = channeltypes.NewErrorAcknowledgement(err) return ack, err @@ -73,14 +74,14 @@ func (im IBCModule) handleOracleAcknowledgment( case types.FetchPriceClientIDKey: var fetchPriceData types.FetchPriceCallData if err = obi.Decode(data.GetCalldata(), &fetchPriceData); err != nil { - return nil, sdkerrors.Wrap(err, + return nil, errorsmod.Wrap(err, "cannot decode the fetchPrice market acknowledgment packet") } im.keeper.SetLastFetchPriceID(ctx, requestID) return &sdk.Result{}, nil default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrJSONUnmarshal, + return nil, errorsmod.Wrapf(sdkerrors.ErrJSONUnmarshal, "market acknowledgment packet not found: %s", data.GetClientID()) } } diff --git a/x/bandoracle/types/errors.go b/x/bandoracle/types/errors.go index 9381a06f8..7525312a2 100644 --- a/x/bandoracle/types/errors.go +++ b/x/bandoracle/types/errors.go @@ -2,12 +2,12 @@ package types // DONTCOVER import ( - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrorUnknownProposalType = errors.Register(ModuleName, 301, "unknown proposal type") - ErrRequestIDNotAvailable = errors.Register(ModuleName, 302, "Request ID not available") - ErrInvalidVersion = errors.Register(ModuleName, 303, "invalid version") - ErrUnrecognisedPacket = errors.Register(ModuleName, 304, "Unrecognised packet") + ErrorUnknownProposalType = errorsmod.Register(ModuleName, 301, "unknown proposal type") + ErrRequestIDNotAvailable = errorsmod.Register(ModuleName, 302, "Request ID not available") + ErrInvalidVersion = errorsmod.Register(ModuleName, 303, "invalid version") + ErrUnrecognisedPacket = errorsmod.Register(ModuleName, 304, "Unrecognised packet") ) diff --git a/x/bandoracle/types/expected_keepers.go b/x/bandoracle/types/expected_keepers.go index cbc3a5589..914960c30 100644 --- a/x/bandoracle/types/expected_keepers.go +++ b/x/bandoracle/types/expected_keepers.go @@ -1,18 +1,18 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias). type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } diff --git a/x/bandoracle/types/fetch_price.go b/x/bandoracle/types/fetch_price.go index 28f67de40..d9d400698 100644 --- a/x/bandoracle/types/fetch_price.go +++ b/x/bandoracle/types/fetch_price.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -85,16 +86,16 @@ func (m *MsgFetchPriceData) GetSignBytes() []byte { func (m *MsgFetchPriceData) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } if m.SourceChannel == "" { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid source channel") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid source channel") } if m.TwaBatchSize == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid batch size") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid batch size") } if m.AcceptedHeightDiff <= 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid height") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid height") } return nil } diff --git a/x/bandoracle/types/genesis.go b/x/bandoracle/types/genesis.go index 285ad85fe..6673b80ae 100644 --- a/x/bandoracle/types/genesis.go +++ b/x/bandoracle/types/genesis.go @@ -1,7 +1,7 @@ package types import ( - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" ) // DefaultIndex is the default capability global index. diff --git a/x/bandoracle/types/gov.go b/x/bandoracle/types/gov.go index ed382cc83..9178af6fc 100644 --- a/x/bandoracle/types/gov.go +++ b/x/bandoracle/types/gov.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -30,7 +31,7 @@ func (p *FetchPriceProposal) ProposalType() string { return ProposalFetchPrice } func (p *FetchPriceProposal) ValidateBasic() error { err := govtypes.ValidateAbstract(p) if p.FetchPrice.TwaBatchSize == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid batch size") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid batch size") } if err != nil { return err diff --git a/x/collector/expected/keeper.go b/x/collector/expected/keeper.go index b88c6f13e..a94a68a3c 100644 --- a/x/collector/expected/keeper.go +++ b/x/collector/expected/keeper.go @@ -1,8 +1,10 @@ package expected import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auction/types" lockertypes "github.com/comdex-official/comdex/x/locker/types" @@ -10,11 +12,11 @@ import ( ) type BankKeeper interface { - SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, address sdk.AccAddress, name string, coins sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } type AssetKeeper interface { @@ -41,7 +43,7 @@ type LockerKeeper interface { type RewardsKeeper interface { GetReward(ctx sdk.Context, appID, assetID uint64) (rewards rewardstypes.InternalRewards, found bool) - CalculationOfRewards(ctx sdk.Context, amount sdk.Int, lsr sdk.Dec, bTime int64) (sdk.Dec, error) + CalculationOfRewards(ctx sdk.Context, amount sdkmath.Int, lsr sdkmath.LegacyDec, bTime int64) (sdkmath.LegacyDec, error) SetLockerRewardTracker(ctx sdk.Context, rewards rewardstypes.LockerRewardsTracker) GetLockerRewardTracker(ctx sdk.Context, id, appID uint64) (rewards rewardstypes.LockerRewardsTracker, found bool) } diff --git a/x/collector/genesis_test.go b/x/collector/genesis_test.go index 6126c75cd..03d825122 100644 --- a/x/collector/genesis_test.go +++ b/x/collector/genesis_test.go @@ -3,7 +3,6 @@ package collector_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" app "github.com/comdex-official/comdex/app" "github.com/comdex-official/comdex/x/collector" @@ -13,7 +12,7 @@ import ( func TestGenesis(t *testing.T) { comdexApp := app.Setup(t, false) - ctx := comdexApp.BaseApp.NewContext(false, tmproto.Header{}) + ctx := comdexApp.BaseApp.NewContext(false) genesisState := types.GenesisState{ Params: types.DefaultParams(), } diff --git a/x/collector/handler.go b/x/collector/handler.go index 88e5514b8..cdf33c971 100644 --- a/x/collector/handler.go +++ b/x/collector/handler.go @@ -2,6 +2,10 @@ package collector import ( "fmt" + + bam "github.com/cosmos/cosmos-sdk/baseapp" + + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/collector/keeper" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,7 +15,7 @@ import ( ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -23,7 +27,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } diff --git a/x/collector/keeper/collector.go b/x/collector/keeper/collector.go index 564e217be..1fa494513 100644 --- a/x/collector/keeper/collector.go +++ b/x/collector/keeper/collector.go @@ -1,8 +1,10 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" auctiontypes "github.com/comdex-official/comdex/x/auction/types" "github.com/comdex-official/comdex/x/collector/types" @@ -11,9 +13,9 @@ import ( ) // GetAmountFromCollector returns amount from the collector. -func (k Keeper) GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) { +func (k Keeper) GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdkmath.Int) (sdkmath.Int, error) { netFeeData, found := k.GetNetFeeCollectedData(ctx, appID, assetID) - var returnedFee sdk.Int + var returnedFee sdkmath.Int if !found { return returnedFee, types.ErrorDataDoesNotExists } @@ -21,7 +23,7 @@ func (k Keeper) GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, a return returnedFee, types.ErrorAmountCanNotBeNegative } - if !(netFeeData.NetFeesCollected.Sub(amount).GT(sdk.ZeroInt())) { + if !(netFeeData.NetFeesCollected.Sub(amount).GT(sdkmath.ZeroInt())) { return returnedFee, types.ErrorRequestedAmtExceedsCollectedFee } asset, _ := k.asset.GetAsset(ctx, assetID) @@ -31,14 +33,14 @@ func (k Keeper) GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, a } err = k.DecreaseNetFeeCollectedData(ctx, appID, assetID, amount) if err != nil { - return sdk.Int{}, err + return sdkmath.Int{}, err } returnedFee = amount return returnedFee, nil } -func (k Keeper) DecreaseNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) error { +func (k Keeper) DecreaseNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, amount sdkmath.Int) error { netFeeData, found := k.GetNetFeeCollectedData(ctx, appID, assetID) if !found { return types.ErrorDataDoesNotExists @@ -61,7 +63,7 @@ func (k Keeper) DecreaseNetFeeCollectedData(ctx sdk.Context, appID, assetID uint } // UpdateCollector update collector store. -func (k Keeper) UpdateCollector(ctx sdk.Context, appID, assetID uint64, collectedStabilityFee, collectedClosingFee, collectedOpeningFee, liquidationRewardsCollected sdk.Int) error { +func (k Keeper) UpdateCollector(ctx sdk.Context, appID, assetID uint64, collectedStabilityFee, collectedClosingFee, collectedOpeningFee, liquidationRewardsCollected sdkmath.Int) error { if !k.asset.HasAsset(ctx, assetID) { return types.ErrorAssetDoesNotExist } @@ -140,10 +142,10 @@ func (k Keeper) GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID func (k Keeper) GetAllAppidToAssetCollectorMapping(ctx sdk.Context) (appIDToAssetCollectorMapping []types.AppToAssetIdCollectorMapping) { var ( store = ctx.KVStore(k.storeKey) - iter = sdk.KVStorePrefixIterator(store, types.AppIDToAssetCollectorMappingPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AppIDToAssetCollectorMappingPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -255,10 +257,10 @@ func (k Keeper) GetCollectorLookupTableByApp(ctx sdk.Context, appID uint64) (col var ( store = ctx.KVStore(k.storeKey) key = types.CollectorLookupTableMappingByAppKey(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -279,10 +281,10 @@ func (k Keeper) GetCollectorLookupTableByApp(ctx sdk.Context, appID uint64) (col func (k Keeper) GetAllCollectorLookupTable(ctx sdk.Context) (collectorLookup []types.CollectorLookupTableData) { var ( store = ctx.KVStore(k.storeKey) - iter = sdk.KVStorePrefixIterator(store, types.AddCollectorLookupKey) + iter = storetypes.KVStorePrefixIterator(store, types.AddCollectorLookupKey) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -328,10 +330,10 @@ func (k Keeper) GetAppToDenomsMapping(ctx sdk.Context, appID uint64) (appToDenom func (k Keeper) GetAllAppToDenomsMapping(ctx sdk.Context) (appToDenomsMapping []types.AppToDenomsMapping) { var ( store = ctx.KVStore(k.storeKey) - iter = sdk.KVStorePrefixIterator(store, types.CollectorForDenomKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.CollectorForDenomKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -420,10 +422,10 @@ func (k Keeper) GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) func (k Keeper) GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) { var ( store = ctx.KVStore(k.storeKey) - iter = sdk.KVStorePrefixIterator(store, types.AppIDToAuctionMappingPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AppIDToAuctionMappingPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -442,7 +444,7 @@ func (k Keeper) GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLoo return collectorAuctionLookupTable, true } -func (k Keeper) SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error { +func (k Keeper) SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdkmath.Int) error { if fee.IsNegative() { return types.ErrorNetFeesCanNotBeNegative } @@ -493,10 +495,10 @@ func (k Keeper) GetAppNetFeeCollectedData(ctx sdk.Context, appID uint64) (netFee var ( store = ctx.KVStore(k.storeKey) key = types.AppNetFeeCollectedDataKey(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -517,10 +519,10 @@ func (k Keeper) GetAppNetFeeCollectedData(ctx sdk.Context, appID uint64) (netFee func (k Keeper) GetAllNetFeeCollectedData(ctx sdk.Context) (netFeeCollectedData []types.AppAssetIdToFeeCollectedData) { var ( store = ctx.KVStore(k.storeKey) - iter = sdk.KVStorePrefixIterator(store, types.NetFeeCollectedDataPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.NetFeeCollectedDataPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -688,7 +690,7 @@ func (k Keeper) WasmUpdateCollectorLookupTable(ctx sdk.Context, updateColBinding // do nothing Collector.BlockHeight = ctx.BlockHeight() Collector.BlockTime = ctx.BlockTime() - } else if Collector.LockerSavingRate.GT(sdk.ZeroDec()) && updateColBinding.LSR.GT(sdk.ZeroDec()) { + } else if Collector.LockerSavingRate.GT(sdkmath.LegacyZeroDec()) && updateColBinding.LSR.GT(sdkmath.LegacyZeroDec()) { // run script to distribute k.LockerIterateRewards(ctx, Collector.LockerSavingRate, Collector.BlockHeight, Collector.BlockTime.Unix(), updateColBinding.AppID, updateColBinding.AssetID, true) Collector.BlockHeight = ctx.BlockHeight() @@ -713,12 +715,12 @@ func (k Keeper) WasmUpdateCollectorLookupTable(ctx sdk.Context, updateColBinding return nil } -func (k Keeper) LockerIterateRewards(ctx sdk.Context, collectorLsr sdk.Dec, collectorBh, collectorBt int64, appID, assetID uint64, changeTypes bool) { +func (k Keeper) LockerIterateRewards(ctx sdk.Context, collectorLsr sdkmath.LegacyDec, collectorBh, collectorBt int64, appID, assetID uint64, changeTypes bool) { lockers, found := k.locker.GetLockerLookupTable(ctx, appID, assetID) if found { for _, lockID := range lockers.LockerIds { lockerData, _ := k.locker.GetLocker(ctx, lockID) - var rewards sdk.Dec + var rewards sdkmath.LegacyDec var err error if lockerData.BlockHeight == 0 { rewards, err = k.rewards.CalculationOfRewards(ctx, lockerData.NetBalance, collectorLsr, collectorBt) @@ -743,10 +745,10 @@ func (k Keeper) LockerIterateRewards(ctx sdk.Context, collectorLsr sdk.Dec, coll lockerRewardsTracker.RewardsAccumulated = lockerRewardsTracker.RewardsAccumulated.Add(rewards) } - if lockerRewardsTracker.RewardsAccumulated.GTE(sdk.OneDec()) { + if lockerRewardsTracker.RewardsAccumulated.GTE(sdkmath.LegacyOneDec()) { // send rewards newReward := lockerRewardsTracker.RewardsAccumulated.TruncateInt() - newRewardDec := sdk.NewDecFromInt(newReward) + newRewardDec := sdkmath.LegacyNewDecFromInt(newReward) lockerRewardsTracker.RewardsAccumulated = lockerRewardsTracker.RewardsAccumulated.Sub(newRewardDec) k.rewards.SetLockerRewardTracker(ctx, lockerRewardsTracker) err = k.DecreaseNetFeeCollectedData(ctx, appID, lockerData.AssetDepositId, newReward) @@ -755,7 +757,7 @@ func (k Keeper) LockerIterateRewards(ctx sdk.Context, collectorLsr sdk.Dec, coll } assetData, _ := k.asset.GetAsset(ctx, assetID) - if newReward.GT(sdk.ZeroInt()) { + if newReward.GT(sdkmath.ZeroInt()) { err = k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, lockertypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetData.Denom, newReward))) if err != nil { continue @@ -825,7 +827,7 @@ func (k Keeper) WasmCheckSurplusRewardQuery(ctx sdk.Context, appID, assetID uint finalAmount := netFeeCollectedData.NetFeesCollected.Sub(collectorLookup.SurplusThreshold) return sdk.NewCoin(asset.Denom, finalAmount) } - return sdk.NewCoin(asset.Denom, sdk.NewInt(0)) + return sdk.NewCoin(asset.Denom, sdkmath.NewInt(0)) } func (k Keeper) WasmMsgGetSurplusFund(ctx sdk.Context, appID, assetID uint64, addr sdk.AccAddress, amount sdk.Coin) error { diff --git a/x/collector/keeper/collector_test.go b/x/collector/keeper/collector_test.go index 5d13e5e18..e6751406e 100644 --- a/x/collector/keeper/collector_test.go +++ b/x/collector/keeper/collector_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" auctionTypes "github.com/comdex-official/comdex/x/auction/types" @@ -10,12 +11,12 @@ import ( func (s *KeeperTestSuite) AddAppAsset() { userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" - genesisSupply := sdk.NewIntFromUint64(1000000) + genesisSupply := sdkmath.NewIntFromUint64(1000000) assetKeeper, ctx := &s.assetKeeper, &s.ctx msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -35,7 +36,7 @@ func (s *KeeperTestSuite) AddAppAsset() { // { // Name: "commodo", // ShortName: "commodo", - // MinGovDeposit: sdk.NewIntFromUint64(10000000), + // MinGovDeposit: sdkmath.NewIntFromUint64(10000000), // GovTimeInSeconds: 900, // GenesisToken: []assetTypes.MintGenesisToken{ // { @@ -52,7 +53,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg2 := assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg2) @@ -60,7 +61,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg3 := assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg3) @@ -68,7 +69,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg4 := assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg4) @@ -81,9 +82,9 @@ func (s *KeeperTestSuite) AddAuctionParams() { auctionParams := auctionTypes.AuctionParams{ AppId: 1, AuctionDurationSeconds: 300, - Buffer: sdk.MustNewDecFromStr("1.2"), - Cusp: sdk.MustNewDecFromStr("0.6"), - Step: sdk.NewIntFromUint64(1), + Buffer: sdkmath.LegacyMustNewDecFromStr("1.2"), + Cusp: sdkmath.LegacyMustNewDecFromStr("0.6"), + Step: sdkmath.NewIntFromUint64(1), PriceFunctionType: 1, SurplusId: 1, DebtId: 2, @@ -105,12 +106,12 @@ func (s *KeeperTestSuite) TestWasmUpdateCollectorLookupTable() { bindings.MsgUpdateCollectorLookupTable{ AppID: 1, AssetID: 2, - SurplusThreshold: sdk.NewInt(9999), - DebtThreshold: sdk.NewInt(99), - LSR: sdk.MustNewDecFromStr("0.001"), - LotSize: sdk.NewInt(100), - BidFactor: sdk.MustNewDecFromStr("0.00001"), - DebtLotSize: sdk.NewInt(300), + SurplusThreshold: sdkmath.NewInt(9999), + DebtThreshold: sdkmath.NewInt(99), + LSR: sdkmath.LegacyMustNewDecFromStr("0.001"), + LotSize: sdkmath.NewInt(100), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.00001"), + DebtLotSize: sdkmath.NewInt(300), }, }, } { @@ -146,12 +147,12 @@ func (s *KeeperTestSuite) TestWasmSetCollectorLookupTableAndAuctionControl() { AppID: 1, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, }, { @@ -160,12 +161,12 @@ func (s *KeeperTestSuite) TestWasmSetCollectorLookupTableAndAuctionControl() { AppID: 1, CollectorAssetID: 3, SecondaryAssetID: 2, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, }, } { @@ -234,19 +235,19 @@ func (s *KeeperTestSuite) TestWasmSetCollectorLookupTableAndAuctionControl() { func (s *KeeperTestSuite) TestSetNetFeesCollected() { collectorKeeper, ctx := &s.collectorKeeper, &s.ctx s.TestWasmSetCollectorLookupTableAndAuctionControl() - negNumber, _ := sdk.NewIntFromString("-100") + negNumber, _ := sdkmath.NewIntFromString("-100") for _, tc := range []struct { name string appID uint64 assetID uint64 - fee sdk.Int + fee sdkmath.Int errorExpected bool }{ { "Set net fees collected : AppID 1 AssetID 2", 1, 2, - sdk.NewIntFromUint64(100), + sdkmath.NewIntFromUint64(100), false, }, { @@ -276,19 +277,19 @@ func (s *KeeperTestSuite) TestSetNetFeesCollected() { func (s *KeeperTestSuite) TestAddNetFeesCollected() { collectorKeeper, ctx := &s.collectorKeeper, &s.ctx s.TestSetNetFeesCollected() - negNumber, _ := sdk.NewIntFromString("-100") + negNumber, _ := sdkmath.NewIntFromString("-100") for _, tc := range []struct { name string appID uint64 assetID uint64 - fee sdk.Int + fee sdkmath.Int errorExpected bool }{ { "Add net fees collected : AppID 1 AssetID 2", 1, 2, - sdk.NewIntFromUint64(974), + sdkmath.NewIntFromUint64(974), false, }, { @@ -324,21 +325,21 @@ func (s *KeeperTestSuite) TestDecreaseNetFeesCollected() { name string appID uint64 assetID uint64 - fee sdk.Int + fee sdkmath.Int errorExpected bool }{ { "Decrease net fees collected : AppID 1 AssetID 2", 1, 2, - sdk.NewIntFromUint64(52), + sdkmath.NewIntFromUint64(52), false, }, { "Decrease net fees collected : Net fees cannot be negative AppID 1 AssetID 2", 1, 2, - sdk.NewIntFromUint64(102), + sdkmath.NewIntFromUint64(102), true, }, } { @@ -367,7 +368,7 @@ func (s *KeeperTestSuite) TestGetAmountFromCollector() { name string appID uint64 assetID uint64 - GetAmount sdk.Int + GetAmount sdkmath.Int FundAmount uint64 denom string errorExpected bool @@ -376,7 +377,7 @@ func (s *KeeperTestSuite) TestGetAmountFromCollector() { "Get Amount From Collector : AppID 1 AssetID 2", 1, 2, - sdk.NewIntFromUint64(52), + sdkmath.NewIntFromUint64(52), 100, "ucmst", false, @@ -385,7 +386,7 @@ func (s *KeeperTestSuite) TestGetAmountFromCollector() { "Get Amount From Collector : Insufficient Balance AppID 1 AssetID 2", 1, 2, - sdk.NewIntFromUint64(101), + sdkmath.NewIntFromUint64(101), 100, "ucmst", true, @@ -394,7 +395,7 @@ func (s *KeeperTestSuite) TestGetAmountFromCollector() { s.Run(tc.name, func() { err := auctionKeeper.FundModule(*ctx, "auctionV1", tc.denom, tc.FundAmount) s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(*ctx, "auctionV1", "collectorV1", sdk.NewCoins(sdk.NewCoin(tc.denom, sdk.NewIntFromUint64(tc.FundAmount)))) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(*ctx, "auctionV1", "collectorV1", sdk.NewCoins(sdk.NewCoin(tc.denom, sdkmath.NewIntFromUint64(tc.FundAmount)))) s.Require().NoError(err) beforeCollectorBalance := auctionKeeper.GetModuleAccountBalance(*ctx, "collectorV1", tc.denom) returnAmount, err := collectorKeeper.GetAmountFromCollector(*ctx, tc.appID, tc.assetID, tc.GetAmount) @@ -427,10 +428,10 @@ func (s *KeeperTestSuite) TestUpdateCollector() { appID: 1, assetID: 2, collectorData: collectorTypes.CollectorData{ - CollectedStabilityFee: sdk.NewIntFromUint64(100), - CollectedClosingFee: sdk.NewIntFromUint64(200), - CollectedOpeningFee: sdk.NewIntFromUint64(300), - LiquidationRewardsCollected: sdk.NewIntFromUint64(400), + CollectedStabilityFee: sdkmath.NewIntFromUint64(100), + CollectedClosingFee: sdkmath.NewIntFromUint64(200), + CollectedOpeningFee: sdkmath.NewIntFromUint64(300), + LiquidationRewardsCollected: sdkmath.NewIntFromUint64(400), }, errorExpected: false, }, @@ -439,10 +440,10 @@ func (s *KeeperTestSuite) TestUpdateCollector() { appID: 1, assetID: 3, collectorData: collectorTypes.CollectorData{ - CollectedStabilityFee: sdk.NewIntFromUint64(100), - CollectedClosingFee: sdk.NewIntFromUint64(200), - CollectedOpeningFee: sdk.NewIntFromUint64(300), - LiquidationRewardsCollected: sdk.NewIntFromUint64(500), + CollectedStabilityFee: sdkmath.NewIntFromUint64(100), + CollectedClosingFee: sdkmath.NewIntFromUint64(200), + CollectedOpeningFee: sdkmath.NewIntFromUint64(300), + LiquidationRewardsCollected: sdkmath.NewIntFromUint64(500), }, errorExpected: false, }, @@ -482,10 +483,10 @@ func (s *KeeperTestSuite) TestAddUpdateCollector() { appID: 1, assetID: 2, collectorData: collectorTypes.CollectorData{ - CollectedStabilityFee: sdk.NewIntFromUint64(100), - CollectedClosingFee: sdk.NewIntFromUint64(200), - CollectedOpeningFee: sdk.NewIntFromUint64(300), - LiquidationRewardsCollected: sdk.NewIntFromUint64(400), + CollectedStabilityFee: sdkmath.NewIntFromUint64(100), + CollectedClosingFee: sdkmath.NewIntFromUint64(200), + CollectedOpeningFee: sdkmath.NewIntFromUint64(300), + LiquidationRewardsCollected: sdkmath.NewIntFromUint64(400), }, errorExpected: false, }, diff --git a/x/collector/keeper/grpc_query_params_test.go b/x/collector/keeper/grpc_query_params_test.go index 12a4b8ea1..37814101c 100644 --- a/x/collector/keeper/grpc_query_params_test.go +++ b/x/collector/keeper/grpc_query_params_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/comdex-official/comdex/app" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/comdex-official/comdex/x/collector/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -13,7 +12,7 @@ import ( func TestParamsQuery(t *testing.T) { comdexApp := app.Setup(t, false) - ctx := comdexApp.BaseApp.NewContext(false, tmproto.Header{}) + ctx := comdexApp.BaseApp.NewContext(false) wctx := sdk.WrapSDKContext(ctx) params := types.DefaultParams() diff --git a/x/collector/keeper/keeper.go b/x/collector/keeper/keeper.go index 840095675..591593476 100644 --- a/x/collector/keeper/keeper.go +++ b/x/collector/keeper/keeper.go @@ -3,16 +3,17 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/collector/expected" "github.com/comdex-official/comdex/x/collector/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" ) type ( @@ -62,6 +63,6 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdk.Int { +func (k Keeper) ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdkmath.Int { return k.bank.GetBalance(ctx, authtypes.NewModuleAddress(moduleName), denom).Amount } diff --git a/x/collector/keeper/keeper_test.go b/x/collector/keeper/keeper_test.go index 6513b371a..60c21bfe8 100644 --- a/x/collector/keeper/keeper_test.go +++ b/x/collector/keeper/keeper_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -34,7 +33,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.collectorKeeper = s.app.CollectorKeeper s.assetKeeper = s.app.AssetKeeper s.auctionKeeper = s.app.AuctionKeeper diff --git a/x/collector/keeper/refund.go b/x/collector/keeper/refund.go index 3beccf913..25dff215b 100644 --- a/x/collector/keeper/refund.go +++ b/x/collector/keeper/refund.go @@ -1,7 +1,9 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "fmt" + "github.com/comdex-official/comdex/x/collector/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -105,7 +107,7 @@ func (k Keeper) Refund(ctx sdk.Context) error { return types.ErrorInsufficientBalance } else { for i := 0; i < len(refundData); i++ { - cmstCoins := sdk.NewCoin("ucmst", sdk.NewInt(refundData[i].amount)) + cmstCoins := sdk.NewCoin("ucmst", sdkmath.NewInt(refundData[i].amount)) vaultOwner1, err := sdk.AccAddressFromBech32(refundData[i].vaultOwner) if err != nil { @@ -121,7 +123,7 @@ func (k Keeper) Refund(ctx sdk.Context) error { } // decrease net fee collected - err := k.DecreaseNetFeeCollectedData(ctx, 2, 3, sdk.NewInt(20163520000)) + err := k.DecreaseNetFeeCollectedData(ctx, 2, 3, sdkmath.NewInt(20163520000)) if err != nil { return err } diff --git a/x/collector/module.go b/x/collector/module.go index 29035288e..84df41a61 100644 --- a/x/collector/module.go +++ b/x/collector/module.go @@ -133,6 +133,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -155,10 +161,10 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ sdk.Context) error { + return nil +} -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/collector/module_simulation.go b/x/collector/module_simulation.go index bdce5430b..39dbf46f5 100644 --- a/x/collector/module_simulation.go +++ b/x/collector/module_simulation.go @@ -4,7 +4,6 @@ package collector import ( "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -40,14 +39,6 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP return nil } -// RandomizedParams creates randomized param changes for the simulator. -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// return []simtypes.ParamChange{} -// } - -// RegisterStoreDecoder registers a decoder. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/collector/types/collector.pb.go b/x/collector/types/collector.pb.go index 109021a32..305efd0a8 100644 --- a/x/collector/types/collector.pb.go +++ b/x/collector/types/collector.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" @@ -29,10 +29,10 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type CollectorData struct { - CollectedStabilityFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=collected_stability_fee,json=collectedStabilityFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collected_stability_fee" yaml:"collected_stability_fee"` - CollectedClosingFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=collected_closing_fee,json=collectedClosingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collected_closing_fee" yaml:"collected_closing_fee"` - CollectedOpeningFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=collected_opening_fee,json=collectedOpeningFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collected_opening_fee" yaml:"collected_opening_fee"` - LiquidationRewardsCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=liquidation_rewards_collected,json=liquidationRewardsCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"liquidation_rewards_collected" yaml:"liquidation_rewards_collected"` + CollectedStabilityFee cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=collected_stability_fee,json=collectedStabilityFee,proto3,customtype=cosmossdk.io/math.Int" json:"collected_stability_fee" yaml:"collected_stability_fee"` + CollectedClosingFee cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=collected_closing_fee,json=collectedClosingFee,proto3,customtype=cosmossdk.io/math.Int" json:"collected_closing_fee" yaml:"collected_closing_fee"` + CollectedOpeningFee cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=collected_opening_fee,json=collectedOpeningFee,proto3,customtype=cosmossdk.io/math.Int" json:"collected_opening_fee" yaml:"collected_opening_fee"` + LiquidationRewardsCollected cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=liquidation_rewards_collected,json=liquidationRewardsCollected,proto3,customtype=cosmossdk.io/math.Int" json:"liquidation_rewards_collected" yaml:"liquidation_rewards_collected"` } func (m *CollectorData) Reset() { *m = CollectorData{} } @@ -69,9 +69,9 @@ func (m *CollectorData) XXX_DiscardUnknown() { var xxx_messageInfo_CollectorData proto.InternalMessageInfo type AppAssetIdToFeeCollectedData struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - NetFeesCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=net_fees_collected,json=netFeesCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"net_fees_collected" yaml:"net_fees_collected"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + NetFeesCollected cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=net_fees_collected,json=netFeesCollected,proto3,customtype=cosmossdk.io/math.Int" json:"net_fees_collected" yaml:"net_fees_collected"` } func (m *AppAssetIdToFeeCollectedData) Reset() { *m = AppAssetIdToFeeCollectedData{} } @@ -182,17 +182,17 @@ func (m *AppToAssetIdCollectorMapping) GetCollector() *CollectorData { } type CollectorLookupTableData struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - CollectorAssetId uint64 `protobuf:"varint,2,opt,name=collector_asset_id,json=collectorAssetId,proto3" json:"collector_asset_id,omitempty" yaml:"collector_asset_id"` - SecondaryAssetId uint64 `protobuf:"varint,3,opt,name=secondary_asset_id,json=secondaryAssetId,proto3" json:"secondary_asset_id,omitempty" yaml:"secondary_asset_id"` - SurplusThreshold github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=surplus_threshold,json=surplusThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"surplus_threshold" yaml:"surplus_threshold"` - DebtThreshold github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=debt_threshold,json=debtThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_threshold" yaml:"debt_threshold"` - LockerSavingRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=locker_saving_rate,json=lockerSavingRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"locker_saving_rate" yaml:"locker_saving_rate"` - LotSize github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=lot_size,json=lotSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"lot_size" yaml:"lot_size"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` - DebtLotSize github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=debt_lot_size,json=debtLotSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_lot_size" yaml:"debt_lot_size"` - BlockHeight int64 `protobuf:"varint,10,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"debt_lot_size"` - BlockTime time.Time `protobuf:"bytes,11,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + CollectorAssetId uint64 `protobuf:"varint,2,opt,name=collector_asset_id,json=collectorAssetId,proto3" json:"collector_asset_id,omitempty" yaml:"collector_asset_id"` + SecondaryAssetId uint64 `protobuf:"varint,3,opt,name=secondary_asset_id,json=secondaryAssetId,proto3" json:"secondary_asset_id,omitempty" yaml:"secondary_asset_id"` + SurplusThreshold cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=surplus_threshold,json=surplusThreshold,proto3,customtype=cosmossdk.io/math.Int" json:"surplus_threshold" yaml:"surplus_threshold"` + DebtThreshold cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=debt_threshold,json=debtThreshold,proto3,customtype=cosmossdk.io/math.Int" json:"debt_threshold" yaml:"debt_threshold"` + LockerSavingRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=locker_saving_rate,json=lockerSavingRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"locker_saving_rate" yaml:"locker_saving_rate"` + LotSize cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=lot_size,json=lotSize,proto3,customtype=cosmossdk.io/math.Int" json:"lot_size" yaml:"lot_size"` + BidFactor cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"bid_factor" yaml:"bid_factor"` + DebtLotSize cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=debt_lot_size,json=debtLotSize,proto3,customtype=cosmossdk.io/math.Int" json:"debt_lot_size" yaml:"debt_lot_size"` + BlockHeight int64 `protobuf:"varint,10,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"debt_lot_size"` + BlockTime time.Time `protobuf:"bytes,11,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` } func (m *CollectorLookupTableData) Reset() { *m = CollectorLookupTableData{} } @@ -429,73 +429,73 @@ func init() { } var fileDescriptor_f18765a8dff2a43b = []byte{ - // 1049 bytes of a gzipped FileDescriptorProto + // 1051 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xce, 0x26, 0x4e, 0x62, 0x4f, 0x48, 0xe3, 0x6c, 0xd2, 0xb2, 0x0d, 0x89, 0x1d, 0x46, 0x08, - 0x72, 0xe9, 0x5a, 0xa1, 0x37, 0xb8, 0x10, 0x27, 0x0a, 0x0d, 0x69, 0x49, 0x35, 0x89, 0x2a, 0x04, - 0x48, 0xab, 0xd9, 0xdd, 0x89, 0x33, 0x64, 0xbd, 0xb3, 0xdd, 0x99, 0x4d, 0x71, 0x8f, 0x5c, 0xe0, - 0xd8, 0x33, 0x7f, 0x83, 0x5f, 0xc0, 0xad, 0xc7, 0x5e, 0x90, 0x10, 0x07, 0x83, 0x92, 0x7f, 0x60, - 0xfe, 0x00, 0x9a, 0x99, 0xfd, 0xb2, 0xad, 0x20, 0xad, 0xd4, 0x9e, 0xbc, 0xf3, 0xbc, 0xcf, 0x3c, - 0xef, 0xc7, 0xcc, 0xfb, 0x8e, 0xc1, 0x8e, 0xc7, 0xfa, 0x3e, 0xf9, 0xb1, 0xe3, 0xb1, 0x20, 0x20, - 0x9e, 0x60, 0x71, 0xe7, 0x6a, 0xd7, 0x25, 0x02, 0xef, 0x16, 0x88, 0x1d, 0xc5, 0x4c, 0x30, 0xd3, - 0xd2, 0x4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 0x19, - 0x76, 0x03, 0x52, 0xf1, 0x24, 0x8f, 0x81, 0x99, 0x6b, 0x3a, 0x13, 0xd9, 0x6d, 0x15, 0xb5, 0x9e, - 0xe6, 0x40, 0xd4, 0xcc, 0xc1, 0xb4, 0xb4, 0x52, 0x8c, 0x13, 0x8f, 0x85, 0x3e, 0x8e, 0x07, 0x85, - 0xd8, 0xdc, 0xa4, 0xd8, 0x34, 0x07, 0xa2, 0x66, 0x0e, 0x66, 0x62, 0x2f, 0xc0, 0x2a, 0x4f, 0xe2, - 0x28, 0x48, 0xb8, 0x23, 0x2e, 0x62, 0xc2, 0x2f, 0x58, 0x90, 0xb5, 0xcf, 0x57, 0x95, 0xaf, 0x8c, - 0x95, 0x7a, 0x9e, 0x14, 0x94, 0x8e, 0x35, 0x76, 0x96, 0x41, 0x66, 0x08, 0xee, 0xf8, 0xc4, 0x15, - 0x25, 0xaf, 0xf3, 0xca, 0xeb, 0x97, 0x95, 0xbd, 0xde, 0xd5, 0x5e, 0xc7, 0xd5, 0x20, 0x5a, 0x96, - 0x40, 0xe1, 0x6f, 0x00, 0xcc, 0x80, 0x79, 0x97, 0x24, 0x76, 0x38, 0xbe, 0x92, 0xf3, 0x25, 0xc6, - 0x82, 0x58, 0x0b, 0x95, 0x9b, 0xe3, 0x80, 0x78, 0x45, 0x8d, 0xa7, 0x15, 0x21, 0x6a, 0x6a, 0xf0, - 0x54, 0x61, 0x08, 0x0b, 0x62, 0x7e, 0x0f, 0xea, 0x01, 0x13, 0x0e, 0xa7, 0x2f, 0x89, 0xb5, 0xa8, - 0x1c, 0xee, 0x55, 0x4e, 0x72, 0x25, 0x73, 0xa8, 0x75, 0x20, 0x5a, 0x0c, 0x98, 0x38, 0xa5, 0x2f, - 0x89, 0xe9, 0x02, 0xe0, 0x52, 0xdf, 0x39, 0xc7, 0xaa, 0x01, 0xea, 0x4a, 0x7f, 0xbf, 0x72, 0x42, - 0xab, 0x5a, 0xbf, 0x50, 0x82, 0xa8, 0xe1,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0x0d, 0xee, 0xe9, 0x92, 0xb1, 0x44, 0x38, + 0x2c, 0xc6, 0x5e, 0x40, 0x9c, 0x28, 0xa6, 0x9e, 0x6e, 0xd9, 0x6a, 0xeb, 0x9d, 0xe1, 0xc0, 0xda, + 0x2c, 0x97, 0x76, 0x94, 0x07, 0xd1, 0x8a, 0x0a, 0x9c, 0x24, 0xe2, 0x44, 0xc1, 0x5f, 0x49, 0x54, + 0xd6, 0xa9, 0xe0, 0x6b, 0xc1, 0xaa, 0x3a, 0xab, 0x52, 0x9d, 0x46, 0x08, 0x10, 0x2d, 0x66, 0x4a, + 0x4a, 0xa3, 0xf5, 0xf4, 0xe5, 0x55, 0xa3, 0xf2, 0xea, 0xaa, 0x51, 0xf9, 0xeb, 0xaa, 0x51, 0x79, + 0x71, 0xdd, 0x98, 0x7a, 0x75, 0xdd, 0x98, 0xfa, 0xfd, 0xba, 0x31, 0xf5, 0xfd, 0xc3, 0x0e, 0x15, + 0xdd, 0xc4, 0x95, 0x4f, 0x58, 0x53, 0x3f, 0x63, 0xef, 0xb3, 0x76, 0x9b, 0x7a, 0x14, 0x07, 0xe9, + 0x77, 0xb3, 0xfc, 0x27, 0x56, 0xf4, 0x23, 0xc2, 0xdd, 0x39, 0xd5, 0x35, 0x0f, 0xff, 0x09, 0x00, + 0x00, 0xff, 0xff, 0x53, 0x67, 0x91, 0x5d, 0xe5, 0x0a, 0x00, 0x00, } func (m *CollectorData) Marshal() (dAtA []byte, err error) { diff --git a/x/collector/types/errors.go b/x/collector/types/errors.go index d772ef513..a3b896852 100644 --- a/x/collector/types/errors.go +++ b/x/collector/types/errors.go @@ -3,24 +3,24 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 401, "unknown proposal type") - ErrorAssetDoesNotExist = sdkerrors.Register(ModuleName, 403, "asset does not exist") - ErrorDuplicateCollectorDenomForApp = sdkerrors.Register(ModuleName, 404, "Collector Duplicate Denom For App") - ErrorDuplicateAssetDenoms = sdkerrors.Register(ModuleName, 405, "Duplicate Asset Denoms") - ErrorDataDoesNotExists = sdkerrors.Register(ModuleName, 406, "Data does not exists") - ErrorRequestedAmtExceedsCollectedFee = sdkerrors.Register(ModuleName, 407, "Requested Amt Exceeds CollectedFee") - ErrorAppDoesNotExist = sdkerrors.Register(ModuleName, 408, "app does not exist") - ErrorAssetNotAddedForGenesisMinting = sdkerrors.Register(ModuleName, 409, "Asset Not Added For Genesis Minting") - ErrorAuctionParamsNotSet = sdkerrors.Register(ModuleName, 410, "Auction Params Not Set") - ErrorAmountCanNotBeNegative = sdkerrors.Register(ModuleName, 411, "amount cannot be negative") - ErrorNetFeesCanNotBeNegative = sdkerrors.Register(ModuleName, 412, "NetFees cannot be negative") - SendCoinFromModuleToModuleIsZero = sdkerrors.Register(ModuleName, 413, "Send coin from module to module is zero") - ErrorSurplusDistributerCantbeTrue = sdkerrors.Register(ModuleName, 414, "Surplus and distributer can't be true at same time") - ErrorSurplusDebtrCantbeTrueSameTime = sdkerrors.Register(ModuleName, 415, "Surplus and debt can't be true at same time") - ErrorInsufficientBalance = sdkerrors.Register(ModuleName, 416, "collector module account does not have enough balance to refund") - ErrorRefundCompleted = sdkerrors.Register(ModuleName, 417, "refund already processed") + ErrorUnknownProposalType = errorsmod.Register(ModuleName, 401, "unknown proposal type") + ErrorAssetDoesNotExist = errorsmod.Register(ModuleName, 403, "asset does not exist") + ErrorDuplicateCollectorDenomForApp = errorsmod.Register(ModuleName, 404, "Collector Duplicate Denom For App") + ErrorDuplicateAssetDenoms = errorsmod.Register(ModuleName, 405, "Duplicate Asset Denoms") + ErrorDataDoesNotExists = errorsmod.Register(ModuleName, 406, "Data does not exists") + ErrorRequestedAmtExceedsCollectedFee = errorsmod.Register(ModuleName, 407, "Requested Amt Exceeds CollectedFee") + ErrorAppDoesNotExist = errorsmod.Register(ModuleName, 408, "app does not exist") + ErrorAssetNotAddedForGenesisMinting = errorsmod.Register(ModuleName, 409, "Asset Not Added For Genesis Minting") + ErrorAuctionParamsNotSet = errorsmod.Register(ModuleName, 410, "Auction Params Not Set") + ErrorAmountCanNotBeNegative = errorsmod.Register(ModuleName, 411, "amount cannot be negative") + ErrorNetFeesCanNotBeNegative = errorsmod.Register(ModuleName, 412, "NetFees cannot be negative") + SendCoinFromModuleToModuleIsZero = errorsmod.Register(ModuleName, 413, "Send coin from module to module is zero") + ErrorSurplusDistributerCantbeTrue = errorsmod.Register(ModuleName, 414, "Surplus and distributer can't be true at same time") + ErrorSurplusDebtrCantbeTrueSameTime = errorsmod.Register(ModuleName, 415, "Surplus and debt can't be true at same time") + ErrorInsufficientBalance = errorsmod.Register(ModuleName, 416, "collector module account does not have enough balance to refund") + ErrorRefundCompleted = errorsmod.Register(ModuleName, 417, "refund already processed") ) diff --git a/x/collector/types/expected_keepers.go b/x/collector/types/expected_keepers.go index 6aa6e9778..9d195200f 100644 --- a/x/collector/types/expected_keepers.go +++ b/x/collector/types/expected_keepers.go @@ -1,18 +1,18 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } diff --git a/x/common/expected/keeper.go b/x/common/expected/keeper.go index 57bc99ede..10dba2a2a 100644 --- a/x/common/expected/keeper.go +++ b/x/common/expected/keeper.go @@ -1,6 +1,7 @@ package expected import ( + "context" wasmvmtypes "github.com/CosmWasm/wasmd/x/wasm/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -8,6 +9,6 @@ import ( // ContractOpsKeeper contains mutable operations on a contract. type ContractOpsKeeper interface { // Sudo allows to call privileged entry point of a contract. - Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error) - GetContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) *wasmvmtypes.ContractInfo + Sudo(ctx context.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error) + GetContractInfo(ctx context.Context, contractAddress sdk.AccAddress) *wasmvmtypes.ContractInfo } \ No newline at end of file diff --git a/x/common/handler.go b/x/common/handler.go index 115600027..3eb421e2b 100644 --- a/x/common/handler.go +++ b/x/common/handler.go @@ -3,14 +3,18 @@ package common import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + bam "github.com/cosmos/cosmos-sdk/baseapp" + + errorsmod "cosmossdk.io/errors" + "github.com/comdex-official/comdex/x/common/keeper" "github.com/comdex-official/comdex/x/common/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { // this line is used by starport scaffolding # handler/msgServer server := keeper.NewMsgServerImpl(k) @@ -28,7 +32,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { // this line is used by starport scaffolding # 1 default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } diff --git a/x/common/keeper/grpc_query.go b/x/common/keeper/grpc_query.go index 101c4dcca..681dc0c72 100644 --- a/x/common/keeper/grpc_query.go +++ b/x/common/keeper/grpc_query.go @@ -3,8 +3,8 @@ package keeper import ( "context" + "cosmossdk.io/store/prefix" "github.com/comdex-official/comdex/x/common/types" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" diff --git a/x/common/keeper/keeper.go b/x/common/keeper/keeper.go index 6ed7e70b4..869c84b94 100644 --- a/x/common/keeper/keeper.go +++ b/x/common/keeper/keeper.go @@ -3,14 +3,16 @@ package keeper import ( "fmt" + errorsmod "cosmossdk.io/errors" + "encoding/hex" - "github.com/cometbft/cometbft/libs/log" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "cosmossdk.io/log" + + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/common/expected" "github.com/comdex-official/comdex/x/common/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -63,7 +65,7 @@ func (k Keeper) SudoContractCall(ctx sdk.Context, contractAddress string, p []by contractAddr, err := sdk.AccAddressFromBech32(contractAddress) if err != nil { - return sdkerrors.Wrapf(err, "contract") + return errorsmod.Wrapf(err, "contract") } data, err := k.conOps.Sudo(ctx, contractAddr, p) if err != nil { @@ -87,6 +89,6 @@ func (k Keeper) CheckSecurityAddress(ctx sdk.Context, from string) bool { return false } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.storeKey) } diff --git a/x/common/keeper/msg_server.go b/x/common/keeper/msg_server.go index d023d53af..11a73eed5 100644 --- a/x/common/keeper/msg_server.go +++ b/x/common/keeper/msg_server.go @@ -4,11 +4,13 @@ import ( "context" "fmt" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/common/types" sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) type msgServer struct { @@ -47,16 +49,16 @@ func (k msgServer) RegisterContract(goCtx context.Context, msg *types.MsgRegiste allContracts := k.GetAllContract(ctx) for _, data := range allContracts { - if data.ContractAddress == msg.ContractAddress{ - return &types.MsgRegisterContractResponse{}, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "contract already registered") + if data.ContractAddress == msg.ContractAddress { + return &types.MsgRegisterContractResponse{}, errorsmod.Wrapf(sdkerrors.ErrNotFound, "contract already registered") } } gameID := k.GetGameID(ctx) - contract := types.WhitelistedContract { - GameId: gameID+1, + contract := types.WhitelistedContract{ + GameId: gameID + 1, SecurityAddress: msg.SecurityAddress, - ContractAdmin: contractInfo.Admin, - GameName: msg.GameName, + ContractAdmin: contractInfo.Admin, + GameName: msg.GameName, ContractAddress: msg.ContractAddress, } @@ -66,7 +68,7 @@ func (k msgServer) RegisterContract(goCtx context.Context, msg *types.MsgRegiste return &types.MsgRegisterContractResponse{}, err } k.SetGameID(ctx, gameID+1) - + return &types.MsgRegisterContractResponse{}, nil } @@ -81,7 +83,7 @@ func (k msgServer) DeRegisterContract(goCtx context.Context, msg *types.MsgDeReg // Get Game info from Game Id gameInfo, found := k.GetContract(ctx, msg.GameId) if !found { - return &types.MsgDeRegisterContractResponse{}, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "no contract found for this game ID") + return &types.MsgDeRegisterContractResponse{}, errorsmod.Wrapf(sdkerrors.ErrNotFound, "no contract found for this game ID") } // Validation such that only the user who instantiated the contract can register contract @@ -93,12 +95,12 @@ func (k msgServer) DeRegisterContract(goCtx context.Context, msg *types.MsgDeReg // check if sender is authorized exists := k.CheckSecurityAddress(ctx, msg.SecurityAddress) - if !exists && contractInfo.Admin != msg.SecurityAddress{ + if !exists && contractInfo.Admin != msg.SecurityAddress { return &types.MsgDeRegisterContractResponse{}, sdkerrors.ErrUnauthorized } k.DeleteContract(ctx, msg.GameId) - + return &types.MsgDeRegisterContractResponse{}, nil } @@ -113,4 +115,4 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam } return &types.MsgUpdateParamsResponse{}, nil -} \ No newline at end of file +} diff --git a/x/common/keeper/store.go b/x/common/keeper/store.go index e7484be8b..ab15f9f52 100644 --- a/x/common/keeper/store.go +++ b/x/common/keeper/store.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/common/types" + sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" ) @@ -75,10 +76,10 @@ func (k Keeper) DeleteContract(ctx sdk.Context, gameID uint64) { func (k Keeper) GetAllContract(ctx sdk.Context) (contracts []types.WhitelistedContract) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.SetContractKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.SetContractKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -91,4 +92,4 @@ func (k Keeper) GetAllContract(ctx sdk.Context) (contracts []types.WhitelistedCo contracts = append(contracts, contract) } return contracts -} \ No newline at end of file +} diff --git a/x/common/module.go b/x/common/module.go index 0c43682cb..d2128b8d6 100644 --- a/x/common/module.go +++ b/x/common/module.go @@ -137,6 +137,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -159,12 +165,10 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context) { BeginBlocker(ctx, am.keeper) } -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/common/types/codec.go b/x/common/types/codec.go index 30033969e..c50d2f96e 100644 --- a/x/common/types/codec.go +++ b/x/common/types/codec.go @@ -8,7 +8,6 @@ import ( // this line is used by starport scaffolding # 1 sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" ) func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { @@ -41,6 +40,5 @@ var ( func init() { RegisterLegacyAminoCodec(Amino) cryptocodec.RegisterCrypto(Amino) - RegisterLegacyAminoCodec(authzcodec.Amino) Amino.Seal() } diff --git a/x/common/types/errors.go b/x/common/types/errors.go index ff0dee22a..ded2b23a6 100644 --- a/x/common/types/errors.go +++ b/x/common/types/errors.go @@ -3,11 +3,11 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/common module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrSample = errorsmod.Register(ModuleName, 1100, "sample error") ) diff --git a/x/common/types/expected_keepers.go b/x/common/types/expected_keepers.go index 04a3b5acd..2a3d354e2 100644 --- a/x/common/types/expected_keepers.go +++ b/x/common/types/expected_keepers.go @@ -1,20 +1,20 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } \ No newline at end of file diff --git a/x/common/types/message_de_register_contract.go b/x/common/types/message_de_register_contract.go index 43ff3f664..cfc26fc2e 100644 --- a/x/common/types/message_de_register_contract.go +++ b/x/common/types/message_de_register_contract.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -15,7 +16,7 @@ func NewMsgDeRegisterContract( ) *MsgDeRegisterContract { return &MsgDeRegisterContract{ SecurityAddress: securityAddress, - GameId: gameID, + GameId: gameID, } } @@ -43,7 +44,7 @@ func (msg *MsgDeRegisterContract) GetSignBytes() []byte { func (msg *MsgDeRegisterContract) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.SecurityAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } return nil diff --git a/x/common/types/message_register_contract.go b/x/common/types/message_register_contract.go index 394b65842..92bad9f7e 100644 --- a/x/common/types/message_register_contract.go +++ b/x/common/types/message_register_contract.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -16,7 +17,7 @@ func NewMsgRegisterContract( ) *MsgRegisterContract { return &MsgRegisterContract{ SecurityAddress: securityAddress, - GameName: gameName, + GameName: gameName, ContractAddress: contractAddress, } } @@ -45,12 +46,12 @@ func (msg *MsgRegisterContract) GetSignBytes() []byte { func (msg *MsgRegisterContract) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.SecurityAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } _, err = sdk.AccAddressFromBech32(msg.ContractAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract address (%s)", err) } return nil diff --git a/x/esm/abci.go b/x/esm/abci.go index 00b5ab9fa..b378b89eb 100644 --- a/x/esm/abci.go +++ b/x/esm/abci.go @@ -3,7 +3,6 @@ package esm import ( assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/esm/expected" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +11,7 @@ import ( "github.com/comdex-official/comdex/x/esm/types" ) -func BeginBlocker(ctx sdk.Context, _ abci.RequestBeginBlock, k keeper.Keeper, assetKeeper expected.AssetKeeper) { +func BeginBlocker(ctx sdk.Context, k keeper.Keeper, assetKeeper expected.AssetKeeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { diff --git a/x/esm/expected/keeper.go b/x/esm/expected/keeper.go index cfea34359..e875249ac 100644 --- a/x/esm/expected/keeper.go +++ b/x/esm/expected/keeper.go @@ -1,8 +1,10 @@ package expected import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" assettypes "github.com/comdex-official/comdex/x/asset/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" markettypes "github.com/comdex-official/comdex/x/market/types" @@ -24,25 +26,25 @@ type VaultKeeper interface { DeleteVault(ctx sdk.Context, id uint64) DeleteAddressFromAppExtendedPairVaultMapping(ctx sdk.Context, extendedPairID uint64, userVaultID uint64, appMappingID uint64) GetStableMintVaults(ctx sdk.Context) (stableVaults []vaulttypes.StableMintVault) - UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) DeleteUserVaultExtendedPairMapping(ctx sdk.Context, address string, appID uint64, pairVaultID uint64) GetLengthOfVault(ctx sdk.Context) uint64 SetLengthOfVault(ctx sdk.Context, length uint64) } type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error - SpendableCoins(ctx sdk.Context, address sdk.AccAddress) sdk.Coins - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, address sdk.AccAddress, name string, coins sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + SpendableCoins(ctx context.Context, address sdk.AccAddress) sdk.Coins + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToModule( - ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins, + ctx context.Context, senderModule, recipientModule string, amt sdk.Coins, ) error - SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } type MarketKeeper interface { @@ -50,11 +52,11 @@ type MarketKeeper interface { } type Tokenmint interface { - BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error + BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdkmath.Int) error } type Collector interface { GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData collectortypes.AppAssetIdToFeeCollectedData, found bool) GetAppNetFeeCollectedData(ctx sdk.Context, appID uint64) (netFeeData []collectortypes.AppAssetIdToFeeCollectedData, found bool) - DecreaseNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) error + DecreaseNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, amount sdkmath.Int) error } diff --git a/x/esm/handler.go b/x/esm/handler.go index 9c3ec1987..a50e0a9e3 100644 --- a/x/esm/handler.go +++ b/x/esm/handler.go @@ -3,6 +3,10 @@ package esm import ( "fmt" + bam "github.com/cosmos/cosmos-sdk/baseapp" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -10,7 +14,7 @@ import ( "github.com/comdex-official/comdex/x/esm/types" ) -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServer(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -35,7 +39,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } diff --git a/x/esm/keeper/esm.go b/x/esm/keeper/esm.go index 099fe250d..d0f29d346 100644 --- a/x/esm/keeper/esm.go +++ b/x/esm/keeper/esm.go @@ -1,9 +1,11 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" assettypes "github.com/comdex-official/comdex/x/asset/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" @@ -38,10 +40,10 @@ func (k Keeper) GetESMTriggerParams(ctx sdk.Context, id uint64) (esmTriggerParam func (k Keeper) GetAllESMTriggerParams(ctx sdk.Context) (eSMTriggerParams []types.ESMTriggerParams) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.ESMTriggerParamsKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.ESMTriggerParamsKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -84,10 +86,10 @@ func (k Keeper) GetCurrentDepositStats(ctx sdk.Context, id uint64) (depositStats func (k Keeper) GetAllCurrentDepositStats(ctx sdk.Context) (currentDepositStats []types.CurrentDepositStats) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.CurrentDepositStatsPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.CurrentDepositStatsPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -130,10 +132,10 @@ func (k Keeper) GetESMStatus(ctx sdk.Context, id uint64) (esmStatus types.ESMSta func (k Keeper) GetAllESMStatus(ctx sdk.Context) (eSMStatus []types.ESMStatus) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.ESMStatusPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.ESMStatusPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -174,10 +176,10 @@ func (k Keeper) SetUserDepositByApp(ctx sdk.Context, userDeposits types.UsersDep func (k Keeper) GetAllUserDepositByApp(ctx sdk.Context) (usersDepositMapping []types.UsersDepositMapping) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.UserDepositByAppPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.UserDepositByAppPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -246,10 +248,10 @@ func (k Keeper) GetDataAfterCoolOff(ctx sdk.Context, id uint64) (esmDataAfterCoo func (k Keeper) GetAllDataAfterCoolOff(ctx sdk.Context) (dataAfterCoolOff []types.DataAfterCoolOff) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.ESMDataAfterCoolOffPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.ESMDataAfterCoolOffPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -341,9 +343,9 @@ func (k Keeper) SetUpShareCalculation(ctx sdk.Context, appID uint64) error { } else { amt.Share = amtDValue.Quo(coolOffData.DebtTotalAmount) debtDValue := amt.Share.Mul(coolOffData.CollateralTotalAmount) - // amt.DebtTokenWorth = debtDValue.Quo(sdk.Dec(amt.Amount)) - denominator := sdk.NewDecFromInt(assetData.Decimals) - numerator := sdk.NewDecFromInt(amt.Amount).Quo(denominator) + // amt.DebtTokenWorth = debtDValue.Quo(sdkmath.LegacyDec(amt.Amount)) + denominator := sdkmath.LegacyNewDecFromInt(assetData.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amt.Amount).Quo(denominator) amt.DebtTokenWorth = debtDValue.Quo(numerator) } k.SetAssetToAmount(ctx, amt) @@ -402,7 +404,7 @@ func (k Keeper) SetUpCollateralRedemptionForVault(ctx sdk.Context, appID uint64, itemc.Amount = data.AmountIn itemc.IsCollateral = true coolOffData.CollateralTotalAmount = k.CalcDollarValueOfToken(ctx, rateIn, data.AmountIn, assetInData.Decimals) - itemc.Share = sdk.OneDec() + itemc.Share = sdkmath.LegacyOneDec() err := k.bank.SendCoinsFromModuleToModule(ctx, vaulttypes.ModuleName, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetInData.Denom, data.AmountIn))) if err != nil { @@ -415,7 +417,7 @@ func (k Keeper) SetUpCollateralRedemptionForVault(ctx sdk.Context, appID uint64, itemd.Amount = data.AmountOut itemd.IsCollateral = false coolOffData.DebtTotalAmount = k.CalcDollarValueOfToken(ctx, rateOut, data.AmountOut, assetOutData.Decimals) - itemd.Share = sdk.OneDec() + itemd.Share = sdkmath.LegacyOneDec() k.SetAssetToAmount(ctx, itemd) k.SetDataAfterCoolOff(ctx, coolOffData) } else { @@ -515,7 +517,7 @@ func (k Keeper) SetUpCollateralRedemptionForStableVault(ctx sdk.Context, appID u itemc.Amount = data.AmountIn itemc.IsCollateral = true coolOffData.CollateralTotalAmount = k.CalcDollarValueOfToken(ctx, rateIn, data.AmountIn, assetInData.Decimals) - itemc.Share = sdk.OneDec() + itemc.Share = sdkmath.LegacyOneDec() err := k.bank.SendCoinsFromModuleToModule(ctx, vaulttypes.ModuleName, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetInData.Denom, data.AmountIn))) if err != nil { @@ -528,11 +530,11 @@ func (k Keeper) SetUpCollateralRedemptionForStableVault(ctx sdk.Context, appID u itemd.Amount = data.AmountOut itemd.IsCollateral = false coolOffData.DebtTotalAmount = k.CalcDollarValueOfToken(ctx, rateOut, data.AmountOut, assetOutData.Decimals) - itemd.Share = sdk.OneDec() + itemd.Share = sdkmath.LegacyOneDec() k.SetAssetToAmount(ctx, itemd) // debt token worth ???? - // itemd.DebtTokenWorth = coolOffData.CollateralTotalAmount.Mul(itemd.Share).Quo(sdk.NewDecFromInt(itemd.Amount)) + // itemd.DebtTokenWorth = coolOffData.CollateralTotalAmount.Mul(itemd.Share).Quo(sdkmath.LegacyNewDecFromInt(itemd.Amount)) k.SetDataAfterCoolOff(ctx, coolOffData) } else { @@ -658,10 +660,10 @@ func (k Keeper) GetAllAssetToAmount(ctx sdk.Context, appID uint64) (assetToAmoun var ( store = k.Store(ctx) key = types.AppAssetToAmountKey(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -676,9 +678,9 @@ func (k Keeper) GetAllAssetToAmount(ctx sdk.Context, appID uint64) (assetToAmoun return assetToAmount } -func (k Keeper) CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdk.Int, decimals sdk.Int) (price sdk.Dec) { - numerator := sdk.NewDecFromInt(amt).Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(rate))) - denominator := sdk.NewDecFromInt(decimals) +func (k Keeper) CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdkmath.Int, decimals sdkmath.Int) (price sdkmath.LegacyDec) { + numerator := sdkmath.LegacyNewDecFromInt(amt).Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(rate))) + denominator := sdkmath.LegacyNewDecFromInt(decimals) return numerator.Quo(denominator) } diff --git a/x/esm/keeper/keeper.go b/x/esm/keeper/keeper.go index c639f2959..fab538d49 100644 --- a/x/esm/keeper/keeper.go +++ b/x/esm/keeper/keeper.go @@ -4,18 +4,20 @@ import ( "fmt" "time" + sdkmath "cosmossdk.io/math" + "github.com/comdex-official/comdex/x/esm/expected" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + storetypes "cosmossdk.io/store/types" assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/esm/types" tokenminttypes "github.com/comdex-official/comdex/x/tokenmint/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" ) type ( @@ -71,7 +73,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.storeKey) } @@ -230,8 +232,8 @@ func (k Keeper) CalculateCollateral(ctx sdk.Context, appID uint64, amount sdk.Co } tokenShare := totalDebtAssetWorth.Mul(tokenData.Share) //$CMST Multiplied with Share of collateral give $share of collateral // To calculate quantity of collateral token from the $share of tokenShare - collateralQuantity := tokenShare.Quo(sdk.NewDecFromInt(sdk.NewIntFromUint64(unitRate))) - collateralQuantity = collateralQuantity.Mul(sdk.NewDecFromInt(assetData.Decimals)) + collateralQuantity := tokenShare.Quo(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(unitRate))) + collateralQuantity = collateralQuantity.Mul(sdkmath.LegacyNewDecFromInt(assetData.Decimals)) err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, userAddress, sdk.NewCoins(sdk.NewCoin(assetData.Denom, collateralQuantity.TruncateInt()))) if err != nil { return err diff --git a/x/esm/keeper/keeper_test.go b/x/esm/keeper/keeper_test.go index b3e5346f9..21a24718d 100644 --- a/x/esm/keeper/keeper_test.go +++ b/x/esm/keeper/keeper_test.go @@ -5,7 +5,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -29,7 +28,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.keeper = s.app.EsmKeeper s.querier = keeper.QueryServer{Keeper: s.keeper} s.msgServer = keeper.NewMsgServer(s.keeper) diff --git a/x/esm/keeper/klsw.go b/x/esm/keeper/klsw.go index 8f265949a..daef48e7f 100644 --- a/x/esm/keeper/klsw.go +++ b/x/esm/keeper/klsw.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/esm/types" @@ -41,10 +42,10 @@ func (k Keeper) GetKillSwitchData(ctx sdk.Context, appID uint64) (switchParams t func (k Keeper) GetAllKillSwitchData(ctx sdk.Context) (killSwitchParams []types.KillSwitchParams) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.KillSwitchDataKey) + iter = storetypes.KVStorePrefixIterator(store, types.KillSwitchDataKey) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/esm/module.go b/x/esm/module.go index f40b057a5..0d7f82739 100644 --- a/x/esm/module.go +++ b/x/esm/module.go @@ -141,6 +141,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -163,12 +169,10 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - BeginBlocker(ctx, req, am.keeper, am.assetKeeper) +func (am AppModule) BeginBlock(ctx sdk.Context) { + BeginBlocker(ctx, am.keeper, am.assetKeeper) } -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/esm/module_simulation.go b/x/esm/module_simulation.go index aefef1735..68160917a 100644 --- a/x/esm/module_simulation.go +++ b/x/esm/module_simulation.go @@ -3,7 +3,6 @@ package esm import ( "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -37,14 +36,6 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP return nil } -// RandomizedParams creates randomized param changes for the simulator -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// return []simtypes.ParamChange{} -// } - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/esm/types/codec.go b/x/esm/types/codec.go index f83fdb9fa..373b2aa2d 100644 --- a/x/esm/types/codec.go +++ b/x/esm/types/codec.go @@ -6,7 +6,6 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -44,7 +43,5 @@ var ( func init() { RegisterCodec(Amino) cryptocodec.RegisterCrypto(Amino) - RegisterCodec(authzcodec.Amino) - // sdk.RegisterLegacyAminoCodec(Amino) Amino.Seal() } diff --git a/x/esm/types/errors.go b/x/esm/types/errors.go index b58ce3516..8c38c91d3 100644 --- a/x/esm/types/errors.go +++ b/x/esm/types/errors.go @@ -3,30 +3,30 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/esm module sentinel errors var ( - ErrInvalidAsset = sdkerrors.Register(ModuleName, 501, "invalid asset") - ErrorDuplicateESMTriggerParams = sdkerrors.Register(ModuleName, 502, "Duplicate ESM Trigger Params for AppID") - ErrAppDataNotFound = sdkerrors.Register(ModuleName, 503, "App Data Not Found") - ErrBadOfferCoinType = sdkerrors.Register(ModuleName, 504, "Bad Offer Coin Type") - ErrESMTriggerParamsNotFound = sdkerrors.Register(ModuleName, 505, "ESM Trigger Params Not Found") - ErrAmtExceedsTargetValue = sdkerrors.Register(ModuleName, 506, "Amount Exceeds Target Value") - ErrDepositForAppReached = sdkerrors.Register(ModuleName, 507, "Deposit For AppID Reached") - ErrESMAlreadyExecuted = sdkerrors.Register(ModuleName, 508, "ESM Already Executed") - ErrCircuitBreakerEnabled = sdkerrors.Register(ModuleName, 509, "Circuit breaker is triggered") - ErrorUnauthorized = sdkerrors.Register(ModuleName, 510, "Unauthorized") - ErrorAppDoesNotExists = sdkerrors.Register(ModuleName, 511, "App Does Not Exists") - ErrAppIDDoesNotExists = sdkerrors.Register(ModuleName, 512, "App Id Does Not exist") - ErrCoolOffPeriodPassed = sdkerrors.Register(ModuleName, 513, "Cool off period has passed") - ErrCurrentDepositNotReached = sdkerrors.Register(ModuleName, 514, "Current Deposit Not Reached for App") - ErrMarketDataNotFound = sdkerrors.Register(ModuleName, 515, "MarketData not found for App") - ErrCoolOffPeriodRemains = sdkerrors.Register(ModuleName, 516, "Cool off period remaining") - ErrorInvalidAmount = sdkerrors.Register(ModuleName, 517, "invalid amount") - ErrorInvalidFrom = sdkerrors.Register(ModuleName, 518, "invalid from") - ErrESMParamsNotFound = sdkerrors.Register(ModuleName, 519, "ESM Params Not Found") - ErrDepositForAppNotFound = sdkerrors.Register(ModuleName, 520, "Deposit For AppID not found") - ErrPriceNotFound = sdkerrors.Register(ModuleName, 521, "Price not found") + ErrInvalidAsset = errorsmod.Register(ModuleName, 501, "invalid asset") + ErrorDuplicateESMTriggerParams = errorsmod.Register(ModuleName, 502, "Duplicate ESM Trigger Params for AppID") + ErrAppDataNotFound = errorsmod.Register(ModuleName, 503, "App Data Not Found") + ErrBadOfferCoinType = errorsmod.Register(ModuleName, 504, "Bad Offer Coin Type") + ErrESMTriggerParamsNotFound = errorsmod.Register(ModuleName, 505, "ESM Trigger Params Not Found") + ErrAmtExceedsTargetValue = errorsmod.Register(ModuleName, 506, "Amount Exceeds Target Value") + ErrDepositForAppReached = errorsmod.Register(ModuleName, 507, "Deposit For AppID Reached") + ErrESMAlreadyExecuted = errorsmod.Register(ModuleName, 508, "ESM Already Executed") + ErrCircuitBreakerEnabled = errorsmod.Register(ModuleName, 509, "Circuit breaker is triggered") + ErrorUnauthorized = errorsmod.Register(ModuleName, 510, "Unauthorized") + ErrorAppDoesNotExists = errorsmod.Register(ModuleName, 511, "App Does Not Exists") + ErrAppIDDoesNotExists = errorsmod.Register(ModuleName, 512, "App Id Does Not exist") + ErrCoolOffPeriodPassed = errorsmod.Register(ModuleName, 513, "Cool off period has passed") + ErrCurrentDepositNotReached = errorsmod.Register(ModuleName, 514, "Current Deposit Not Reached for App") + ErrMarketDataNotFound = errorsmod.Register(ModuleName, 515, "MarketData not found for App") + ErrCoolOffPeriodRemains = errorsmod.Register(ModuleName, 516, "Cool off period remaining") + ErrorInvalidAmount = errorsmod.Register(ModuleName, 517, "invalid amount") + ErrorInvalidFrom = errorsmod.Register(ModuleName, 518, "invalid from") + ErrESMParamsNotFound = errorsmod.Register(ModuleName, 519, "ESM Params Not Found") + ErrDepositForAppNotFound = errorsmod.Register(ModuleName, 520, "Deposit For AppID not found") + ErrPriceNotFound = errorsmod.Register(ModuleName, 521, "Price not found") ) diff --git a/x/esm/types/esm.pb.go b/x/esm/types/esm.pb.go index f18472c8b..43866fb51 100644 --- a/x/esm/types/esm.pb.go +++ b/x/esm/types/esm.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -378,9 +379,9 @@ func (m *UsersDepositMapping) GetDeposits() github_com_cosmos_cosmos_sdk_types.C } type DataAfterCoolOff struct { - AppId uint64 `protobuf:"varint,1,opt,name=appId,proto3" json:"appId,omitempty" yaml:"appId"` - CollateralTotalAmount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=collateral_total_amount,json=collateralTotalAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_total_amount" yaml:"collateral_total_amount"` - DebtTotalAmount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=debt_total_amount,json=debtTotalAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"debt_total_amount" yaml:"debt_total_amount"` + AppId uint64 `protobuf:"varint,1,opt,name=appId,proto3" json:"appId,omitempty" yaml:"appId"` + CollateralTotalAmount cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=collateral_total_amount,json=collateralTotalAmount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"collateral_total_amount" yaml:"collateral_total_amount"` + DebtTotalAmount cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=debt_total_amount,json=debtTotalAmount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"debt_total_amount" yaml:"debt_total_amount"` } func (m *DataAfterCoolOff) Reset() { *m = DataAfterCoolOff{} } @@ -424,12 +425,12 @@ func (m *DataAfterCoolOff) GetAppId() uint64 { } type AssetToAmount struct { - AppId uint64 `protobuf:"varint,1,opt,name=appId,proto3" json:"appId,omitempty" yaml:"appId"` - AssetID uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` - Share github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=share,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"share" yaml:"share"` - DebtTokenWorth github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=debt_token_worth,json=debtTokenWorth,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"debt_token_worth" yaml:"debt_token_worth"` - IsCollateral bool `protobuf:"varint,6,opt,name=is_collateral,json=isCollateral,proto3" json:"is_collateral,omitempty" yaml:"is_collateral"` + AppId uint64 `protobuf:"varint,1,opt,name=appId,proto3" json:"appId,omitempty" yaml:"appId"` + AssetID uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` + Share cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=share,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"share" yaml:"share"` + DebtTokenWorth cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=debt_token_worth,json=debtTokenWorth,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"debt_token_worth" yaml:"debt_token_worth"` + IsCollateral bool `protobuf:"varint,6,opt,name=is_collateral,json=isCollateral,proto3" json:"is_collateral,omitempty" yaml:"is_collateral"` } func (m *AssetToAmount) Reset() { *m = AssetToAmount{} } @@ -552,78 +553,80 @@ func init() { func init() { proto.RegisterFile("comdex/esm/v1beta1/esm.proto", fileDescriptor_e7f9b0ecd3a9e62a) } var fileDescriptor_e7f9b0ecd3a9e62a = []byte{ - // 1135 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x4f, 0xe3, 0x46, - 0x14, 0x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75, 0x69, 0x2f, 0x14, 0x1e, 0x0b, 0x6c, 0x9d, 0xe9, 0x9c, 0xcc, 0x14, - 0x25, 0x31, 0xac, 0x29, 0x8a, 0x5b, 0x80, 0x08, 0xaf, 0x4b, 0x0d, 0xce, 0x15, 0xba, 0x29, 0x16, - 0x58, 0xe2, 0x01, 0x09, 0xf9, 0x19, 0x13, 0x4a, 0x52, 0x9d, 0x97, 0x94, 0x9b, 0xc3, 0xb9, 0xc8, - 0xf4, 0x39, 0xd5, 0x0d, 0x0b, 0x33, 0x00, 0x35, 0x2e, 0x48, 0xdb, 0xa7, 0xf6, 0x6d, 0x61, 0x16, - 0x25, 0xe7, 0xa3, 0x24, 0x86, 0xef, 0xe5, 0x15, 0x7c, 0x0b, 0x1e, 0xe1, 0x07, 0x0a, 0xf0, 0xf4, - 0x8d, 0x31, 0x3f, 0x01, 0xeb, 0x0e, 0xf3, 0x7d, 0xea, 0x08, 0x16, 0xd9, 0x22, 0x22, 0x01, 0x27, - 0x4e, 0xaa, 0xae, 0x96, 0xa4, 0x9b, 0xed, 0x24, 0x86, 0x5b, 0xd9, 0x48, 0xbf, 0x01, 0x86, 0xf0, - 0x5a, 0x2e, 0x6f, 0x0d, 0xc5, 0x66, 0x13, 0xac, 0xf0, 0x33, 0x12, 0x51, 0xdb, 0x21, 0xbe, 0xd3, - 0xf7, 0x89, 0xa4, 0x04, 0x92, 0x72, 0x2b, 0x89, 0x61, 0x55, 0x47, 0x7e, 0x13, 0x82, 0x70, 0x45, - 0xca, 0x0e, 0x46, 0x44, 0x3f, 0x80, 0xca, 0x37, 0x9e, 0xef, 0x9f, 0xbe, 0xf0, 0x84, 0x73, 0xa6, - 0x37, 0xe9, 0x43, 0xa0, 0x2e, 0xb6, 0xbe, 0xfd, 0x95, 0x24, 0x86, 0x8b, 0x7a, 0x01, 0xa4, 0xe2, - 0xfc, 0xde, 0x7f, 0x01, 0x96, 0xda, 0x11, 0x25, 0xe7, 0x34, 0xb2, 0x69, 0x90, 0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 0x5f, 0x59, 0x9a, 0xf6, 0x9c, 0xfc, 0x48, 0x7e, - 0xf4, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x12, 0x39, 0xe5, 0x15, 0x0b, 0x00, 0x00, + // 1154 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xdd, 0x4e, 0xe3, 0xc6, + 0x17, 0x27, 0x40, 0x20, 0x19, 0x08, 0x04, 0x03, 0x4b, 0x16, 0xf8, 0xc7, 0x68, 0xfe, 0x6a, 0xcb, + 0xb6, 0xc2, 0xd1, 0xb2, 0x57, 0xad, 0xd4, 0x0f, 0x0c, 0x6c, 0x15, 0xb5, 0xa8, 0xab, 0x81, 0xdd, + 0x56, 0x7b, 0x63, 0x4d, 0xec, 0x49, 0x62, 0xc5, 0xf1, 0xb8, 0x9e, 0x09, 0xbb, 0x48, 0xed, 0x5d, + 0x1f, 0x80, 0xa7, 0xe8, 0x65, 0x9f, 0xa0, 0x0f, 0xb0, 0x97, 0x7b, 0x59, 0xf5, 0xc2, 0xad, 0xc2, + 0x1b, 0xb8, 0x52, 0x2f, 0x7a, 0x55, 0x79, 0x66, 0x6c, 0x27, 0xec, 0xb2, 0x4d, 0xae, 0x92, 0x39, + 0xe7, 0x77, 0x7e, 0xe7, 0x6b, 0xce, 0xf1, 0x80, 0x5d, 0x9b, 0xf6, 0x1d, 0xf2, 0xb2, 0x41, 0x58, + 0xbf, 0x71, 0xf9, 0xb0, 0x45, 0x38, 0x7e, 0x98, 0xfc, 0x37, 0x82, 0x90, 0x72, 0xaa, 0x69, 0x52, + 0x6b, 0x24, 0x12, 0xa5, 0xdd, 0xde, 0xe8, 0xd0, 0x0e, 0x15, 0xea, 0x46, 0xf2, 0x4f, 0x22, 0xb7, + 0xf5, 0x0e, 0xa5, 0x1d, 0x8f, 0x34, 0xc4, 0xa9, 0x35, 0x68, 0x37, 0xb8,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, 0xd6, 0x8b, + 0x62, 0xac, 0x13, 0x85, 0xe9, 0x3a, 0xb1, 0x01, 0x8a, 0xe2, 0xa9, 0x21, 0x3b, 0x88, 0xe4, 0xc1, + 0xfc, 0xf2, 0xd5, 0xb0, 0x5e, 0x78, 0x3d, 0xac, 0x17, 0xfe, 0x1c, 0xd6, 0x0b, 0xd7, 0x37, 0xf5, + 0x99, 0xd7, 0x37, 0xf5, 0x99, 0xdf, 0x6e, 0xea, 0x33, 0xcf, 0x0f, 0xc6, 0x46, 0x31, 0x79, 0xeb, + 0x1c, 0xd0, 0x76, 0xdb, 0xb5, 0x5d, 0xec, 0xa9, 0x73, 0x43, 0x3e, 0x5e, 0xc5, 0x54, 0xb6, 0x16, + 0xc4, 0x67, 0xee, 0xd1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x5c, 0xec, 0x63, 0xd7, 0x0a, + 0x00, 0x00, } func (m *ESMTriggerParams) Marshal() (dAtA []byte, err error) { diff --git a/x/esm/types/expected_keepers.go b/x/esm/types/expected_keepers.go index 6aa6e9778..9d195200f 100644 --- a/x/esm/types/expected_keepers.go +++ b/x/esm/types/expected_keepers.go @@ -1,18 +1,18 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } diff --git a/x/esm/types/klsw.go b/x/esm/types/klsw.go index 1916e89ba..d020f9c69 100644 --- a/x/esm/types/klsw.go +++ b/x/esm/types/klsw.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -16,7 +17,7 @@ func NewMsgKillRequest(from sdk.AccAddress, switchParams KillSwitchParams) *MsgK func (m *MsgKillRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(errors.ErrInvalidAddress, "from cannot be empty") + return errorsmod.Wrap(errors.ErrInvalidAddress, "from cannot be empty") } return nil diff --git a/x/esm/types/params.go b/x/esm/types/params.go index 712dab3b9..6ee26864f 100644 --- a/x/esm/types/params.go +++ b/x/esm/types/params.go @@ -1,10 +1,11 @@ package types import ( + storetypes "cosmossdk.io/store/types" + errorsmod "cosmossdk.io/errors" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -16,10 +17,10 @@ var ( ) const ( - DepositESMGas = sdk.Gas(36329) - ExecuteESMGas = sdk.Gas(23554) - MsgKillSwitchGas = sdk.Gas(76473) - MsgCollateralRedemptionGas = sdk.Gas(37559) + DepositESMGas = storetypes.Gas(36329) + ExecuteESMGas = storetypes.Gas(23554) + MsgKillSwitchGas = storetypes.Gas(76473) + MsgCollateralRedemptionGas = storetypes.Gas(37559) ) func NewParams(admin []string) Params { @@ -52,7 +53,7 @@ func (k Params) Validate() error { } for _, addr := range k.Admin { if _, err := sdk.AccAddressFromBech32(addr); err != nil { - return errors.Wrapf(err, "invalid admin %s", addr) + return errorsmod.Wrapf(err, "invalid admin %s", addr) } } diff --git a/x/esm/types/tx.go b/x/esm/types/tx.go index d0e2a4b54..947df4ac4 100644 --- a/x/esm/types/tx.go +++ b/x/esm/types/tx.go @@ -1,8 +1,8 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func NewMsgDeposit(depositor string, appID uint64, amount sdk.Coin) *MsgDepositESM { @@ -22,7 +22,7 @@ func (msg *MsgDepositESM) ValidateBasic() error { } if asset := msg.GetAmount(); !asset.IsValid() { - return sdkerrors.Wrap(ErrInvalidAsset, asset.String()) + return errorsmod.Wrap(ErrInvalidAsset, asset.String()) } return nil @@ -80,19 +80,19 @@ func (msg MsgCollateralRedemptionRequest) Route() string { return ModuleName } func (msg *MsgCollateralRedemptionRequest) ValidateBasic() error { if msg.From == "" { - return sdkerrors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(msg.From); err != nil { - return sdkerrors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if msg.Amount.IsNil() { - return sdkerrors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if msg.Amount.IsNegative() { - return sdkerrors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if msg.Amount.IsZero() { - return sdkerrors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil } diff --git a/x/lend/abci.go b/x/lend/abci.go index 45971e350..565ef1f07 100644 --- a/x/lend/abci.go +++ b/x/lend/abci.go @@ -4,12 +4,11 @@ import ( utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/lend/keeper" "github.com/comdex-official/comdex/x/lend/types" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" ) -func BeginBlocker(ctx sdk.Context, _ abci.RequestBeginBlock, k keeper.Keeper) { +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { diff --git a/x/lend/client/cli/flags.go b/x/lend/client/cli/flags.go index 281b344ed..cdfaeef18 100644 --- a/x/lend/client/cli/flags.go +++ b/x/lend/client/cli/flags.go @@ -1,11 +1,10 @@ package cli import ( + sdkmath "cosmossdk.io/math" "strconv" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" - flag "github.com/spf13/pflag" ) @@ -34,16 +33,16 @@ func ParseUint64SliceFromString(s string, separator string) ([]uint64, error) { return parsedInt, nil } -func ParseDecSliceFromString(s string, separator string) ([]sdk.Dec, error) { - var newParsedDec []sdk.Dec +func ParseDecSliceFromString(s string, separator string) ([]sdkmath.LegacyDec, error) { + var newParsedDec []sdkmath.LegacyDec for _, s := range strings.Split(s, separator) { s = strings.TrimSpace(s) parsed, err := strconv.ParseInt(s, 10, 64) if err != nil { - return []sdk.Dec{}, err + return []sdkmath.LegacyDec{}, err } - parsedDec := sdk.NewDec(parsed) + parsedDec := sdkmath.LegacyNewDec(parsed) newParsedDec = append(newParsedDec, parsedDec) } return newParsedDec, nil @@ -114,14 +113,14 @@ func FlagAddEModePairs() *flag.FlagSet { return fs } -func ParseDecSliceFromStringForDec(s string, separator string) ([]sdk.Dec, error) { - var newParsedDec []sdk.Dec +func ParseDecSliceFromStringForDec(s string, separator string) ([]sdkmath.LegacyDec, error) { + var newParsedDec []sdkmath.LegacyDec for _, s := range strings.Split(s, separator) { s = strings.TrimSpace(s) - parsed, err := sdk.NewDecFromStr(s) + parsed, err := sdkmath.LegacyNewDecFromStr(s) if err != nil { - return []sdk.Dec{}, err + return []sdkmath.LegacyDec{}, err } newParsedDec = append(newParsedDec, parsed) } diff --git a/x/lend/client/cli/tx.go b/x/lend/client/cli/tx.go index 034be0a5e..c7d139d9f 100644 --- a/x/lend/client/cli/tx.go +++ b/x/lend/client/cli/tx.go @@ -1,6 +1,7 @@ package cli import ( + sdkmath "cosmossdk.io/math" "fmt" "strconv" @@ -630,9 +631,6 @@ func NewCreateNewMultipleLendPairs(clientCtx client.Context, txf tx.Factory, fs return txf, nil, err } - if err = msg.ValidateBasic(); err != nil { - return txf, nil, err - } return txf, msg, nil } @@ -943,19 +941,19 @@ func NewCreateassetRatesParams(clientCtx client.Context, txf tx.Factory, fs *fla return txf, nil, err } - newUOptimal, _ := sdk.NewDecFromStr(uOptimal) - newBase, _ := sdk.NewDecFromStr(base) - newSlope1, _ := sdk.NewDecFromStr(slope1) - newSlope2, _ := sdk.NewDecFromStr(slope2) + newUOptimal, _ := sdkmath.LegacyNewDecFromStr(uOptimal) + newBase, _ := sdkmath.LegacyNewDecFromStr(base) + newSlope1, _ := sdkmath.LegacyNewDecFromStr(slope1) + newSlope2, _ := sdkmath.LegacyNewDecFromStr(slope2) newEnableStableBorrow := ParseBoolFromString(enableStableBorrow) - newStableBase, _ := sdk.NewDecFromStr(stableBase) - newStableSlope1, _ := sdk.NewDecFromStr(stableSlope1) - newStableSlope2, _ := sdk.NewDecFromStr(stableSlope2) - newLTV, _ := sdk.NewDecFromStr(ltv) - newLiquidationThreshold, _ := sdk.NewDecFromStr(liquidationThreshold) - newLiquidationPenalty, _ := sdk.NewDecFromStr(liquidationPenalty) - newLiquidationBonus, _ := sdk.NewDecFromStr(liquidationBonus) - newReserveFactor, _ := sdk.NewDecFromStr(reserveFactor) + newStableBase, _ := sdkmath.LegacyNewDecFromStr(stableBase) + newStableSlope1, _ := sdkmath.LegacyNewDecFromStr(stableSlope1) + newStableSlope2, _ := sdkmath.LegacyNewDecFromStr(stableSlope2) + newLTV, _ := sdkmath.LegacyNewDecFromStr(ltv) + newLiquidationThreshold, _ := sdkmath.LegacyNewDecFromStr(liquidationThreshold) + newLiquidationPenalty, _ := sdkmath.LegacyNewDecFromStr(liquidationPenalty) + newLiquidationBonus, _ := sdkmath.LegacyNewDecFromStr(liquidationBonus) + newReserveFactor, _ := sdkmath.LegacyNewDecFromStr(reserveFactor) assetRatesParams := types.AssetRatesParams{ AssetID: assetID, @@ -1037,11 +1035,11 @@ func NewAddAuctionParams(clientCtx client.Context, txf tx.Factory, fs *flag.Flag if err != nil { return txf, nil, err } - buffer, _ := sdk.NewDecFromStr(auctionParamsInput.Buffer) + buffer, _ := sdkmath.LegacyNewDecFromStr(auctionParamsInput.Buffer) - cusp, _ := sdk.NewDecFromStr(auctionParamsInput.Cusp) + cusp, _ := sdkmath.LegacyNewDecFromStr(auctionParamsInput.Cusp) - step, _ := sdk.NewIntFromString(auctionParamsInput.Step) + step, _ := sdkmath.NewIntFromString(auctionParamsInput.Step) priceFunctionType, err := strconv.ParseUint(auctionParamsInput.PriceFunctionType, 10, 64) if err != nil { @@ -1306,19 +1304,19 @@ func NewCreateAssetRatesPoolPairs(clientCtx client.Context, txf tx.Factory, fs * if err != nil { return txf, nil, err } - newUOptimal, _ := sdk.NewDecFromStr(uOptimal) - newBase, _ := sdk.NewDecFromStr(base) - newSlope1, _ := sdk.NewDecFromStr(slope1) - newSlope2, _ := sdk.NewDecFromStr(slope2) + newUOptimal, _ := sdkmath.LegacyNewDecFromStr(uOptimal) + newBase, _ := sdkmath.LegacyNewDecFromStr(base) + newSlope1, _ := sdkmath.LegacyNewDecFromStr(slope1) + newSlope2, _ := sdkmath.LegacyNewDecFromStr(slope2) newEnableStableBorrow := ParseBoolFromString(enableStableBorrow) - newStableBase, _ := sdk.NewDecFromStr(stableBase) - newStableSlope1, _ := sdk.NewDecFromStr(stableSlope1) - newStableSlope2, _ := sdk.NewDecFromStr(stableSlope2) - newLTV, _ := sdk.NewDecFromStr(ltv) - newLiquidationThreshold, _ := sdk.NewDecFromStr(liquidationThreshold) - newLiquidationPenalty, _ := sdk.NewDecFromStr(liquidationPenalty) - newLiquidationBonus, _ := sdk.NewDecFromStr(liquidationBonus) - newReserveFactor, _ := sdk.NewDecFromStr(reserveFactor) + newStableBase, _ := sdkmath.LegacyNewDecFromStr(stableBase) + newStableSlope1, _ := sdkmath.LegacyNewDecFromStr(stableSlope1) + newStableSlope2, _ := sdkmath.LegacyNewDecFromStr(stableSlope2) + newLTV, _ := sdkmath.LegacyNewDecFromStr(ltv) + newLiquidationThreshold, _ := sdkmath.LegacyNewDecFromStr(liquidationThreshold) + newLiquidationPenalty, _ := sdkmath.LegacyNewDecFromStr(liquidationPenalty) + newLiquidationBonus, _ := sdkmath.LegacyNewDecFromStr(liquidationBonus) + newReserveFactor, _ := sdkmath.LegacyNewDecFromStr(reserveFactor) newIsIsolated := ParseBoolFromString(isIsolated) moduleName := assetRatesPoolPairs.ModuleName @@ -1406,7 +1404,7 @@ func CmdDepreciatePoolsProposal() *cobra.Command { if err != nil { return err } - txf =txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) txf, msg, err := NewDepreciatePools(clientCtx, txf, cmd.Flags()) if err != nil { @@ -1468,7 +1466,7 @@ func CmdAddEModePairsProposal() *cobra.Command { if err != nil { return err } - txf =txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) txf, msg, err := NewAddEModePairs(clientCtx, txf, cmd.Flags()) if err != nil { diff --git a/x/lend/expected/keeper.go b/x/lend/expected/keeper.go index b375eb935..063a0920d 100644 --- a/x/lend/expected/keeper.go +++ b/x/lend/expected/keeper.go @@ -1,38 +1,39 @@ package expected import ( + "context" auctiontypes "github.com/comdex-official/comdex/x/auction/types" "github.com/comdex-official/comdex/x/liquidation/types" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + sdkmath "cosmossdk.io/math" assettypes "github.com/comdex-official/comdex/x/asset/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" markettypes "github.com/comdex-official/comdex/x/market/types" ) type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error - SpendableCoins(ctx sdk.Context, address sdk.AccAddress) sdk.Coins - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + SpendableCoins(ctx context.Context, address sdk.AccAddress) sdk.Coins + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToModule( - ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins, + ctx context.Context, senderModule, recipientModule string, amt sdk.Coins, ) error - SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI } type MarketKeeper interface { GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) } type BandOracleKeeper interface { diff --git a/x/lend/handler.go b/x/lend/handler.go index b55c5831b..a7a71cb2e 100644 --- a/x/lend/handler.go +++ b/x/lend/handler.go @@ -3,6 +3,10 @@ package lend import ( "fmt" + bam "github.com/cosmos/cosmos-sdk/baseapp" + + errorsmod "cosmossdk.io/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/pkg/errors" @@ -14,7 +18,7 @@ import ( ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -78,7 +82,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } diff --git a/x/lend/keeper/borrow.go b/x/lend/keeper/borrow.go index c9b6ab97e..9c1eb8dc8 100644 --- a/x/lend/keeper/borrow.go +++ b/x/lend/keeper/borrow.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -65,10 +66,10 @@ func (k Keeper) GetBorrow(ctx sdk.Context, ID uint64) (borrow types.BorrowAsset, func (k Keeper) GetAllBorrow(ctx sdk.Context) (borrowAsset []types.BorrowAsset) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.BorrowPairKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.BorrowPairKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -108,10 +109,10 @@ func (k Keeper) HasBorrowForAddressByPair(ctx sdk.Context, address string, pairI func (k Keeper) GetBorrows(ctx sdk.Context) (borrowIds []uint64, found bool) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AssetStatsByPoolIDAndAssetIDKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AssetStatsByPoolIDAndAssetIDKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -154,10 +155,10 @@ func (k Keeper) GetBorrowInterestTracker(ctx sdk.Context, ID uint64) (interest t func (k Keeper) GetAllBorrowInterestTracker(ctx sdk.Context) (interest []types.BorrowInterestTracker) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.BorrowInterestTrackerKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.BorrowInterestTrackerKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/lend/keeper/funds.go b/x/lend/keeper/funds.go index 23717550e..fe7ce0985 100644 --- a/x/lend/keeper/funds.go +++ b/x/lend/keeper/funds.go @@ -1,18 +1,19 @@ package keeper import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/lend/types" ) func (k Keeper) UpdateReserveBalances(ctx sdk.Context, assetID uint64, moduleName string, payment sdk.Coin, inc bool) error { - newAmount := payment.Amount.Quo(sdk.NewIntFromUint64(types.Uint64Two)) + newAmount := payment.Amount.Quo(sdkmath.NewIntFromUint64(types.Uint64Two)) reserve, found := k.GetReserveBuybackAssetData(ctx, assetID) if !found { reserve.AssetID = assetID - reserve.BuybackAmount = sdk.ZeroInt() - reserve.ReserveAmount = sdk.ZeroInt() + reserve.BuybackAmount = sdkmath.ZeroInt() + reserve.ReserveAmount = sdkmath.ZeroInt() } if inc { @@ -32,7 +33,7 @@ func (k Keeper) UpdateReserveBalances(ctx sdk.Context, assetID uint64, moduleNam return nil } -func (k Keeper) UpdateLendStats(ctx sdk.Context, AssetID, PoolID uint64, amount sdk.Int, inc bool) { +func (k Keeper) UpdateLendStats(ctx sdk.Context, AssetID, PoolID uint64, amount sdkmath.Int, inc bool) { assetStats, _ := k.GetAssetStatsByPoolIDAndAssetID(ctx, PoolID, AssetID) if inc { assetStats.TotalLend = assetStats.TotalLend.Add(amount) @@ -42,7 +43,7 @@ func (k Keeper) UpdateLendStats(ctx sdk.Context, AssetID, PoolID uint64, amount k.SetAssetStatsByPoolIDAndAssetID(ctx, assetStats) } -func (k Keeper) UpdateBorrowStats(ctx sdk.Context, pair types.Extended_Pair, isStableBorrow bool, amount sdk.Int, inc bool) { +func (k Keeper) UpdateBorrowStats(ctx sdk.Context, pair types.Extended_Pair, isStableBorrow bool, amount sdkmath.Int, inc bool) { assetStats, _ := k.GetAssetStatsByPoolIDAndAssetID(ctx, pair.AssetOutPoolID, pair.AssetOut) if inc { if isStableBorrow { diff --git a/x/lend/keeper/grpc_query.go b/x/lend/keeper/grpc_query.go index ae36f68bd..5b274673d 100644 --- a/x/lend/keeper/grpc_query.go +++ b/x/lend/keeper/grpc_query.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" diff --git a/x/lend/keeper/iter.go b/x/lend/keeper/iter.go index fe0d709ae..048220b3a 100644 --- a/x/lend/keeper/iter.go +++ b/x/lend/keeper/iter.go @@ -1,16 +1,18 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "fmt" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/comdex-official/comdex/x/lend/types" ) // IterateLends To calculate pending rewards from last interaction -func (k Keeper) IterateLends(ctx sdk.Context, ID uint64) (sdk.Dec, error) { +func (k Keeper) IterateLends(ctx sdk.Context, ID uint64) (sdkmath.LegacyDec, error) { // to calculate lend rewards on the amount lent // check if the interest accumulated is sufficient for that assetID and poolID // send the cTokens to the lenders address if less than interest accumulated @@ -25,7 +27,7 @@ func (k Keeper) IterateLends(ctx sdk.Context, ID uint64) (sdk.Dec, error) { if !found { lendRewardsTracker = types.LendRewardsTracker{ LendingId: lend.ID, - RewardsAccumulated: sdk.ZeroDec(), + RewardsAccumulated: sdkmath.LegacyZeroDec(), } } @@ -33,37 +35,37 @@ func (k Keeper) IterateLends(ctx sdk.Context, ID uint64) (sdk.Dec, error) { lendRewardsTracker.RewardsAccumulated = lendRewardsTracker.RewardsAccumulated.Add(interestPerBlock) // initializing new variable newInterestPerBlock - newInterestPerInteraction := sdk.ZeroInt() + newInterestPerInteraction := sdkmath.ZeroInt() // checking if the rewards accumulated is greater than equal to 1 - if lendRewardsTracker.RewardsAccumulated.GTE(sdk.OneDec()) { + if lendRewardsTracker.RewardsAccumulated.GTE(sdkmath.LegacyOneDec()) { newInterestPerInteraction = lendRewardsTracker.RewardsAccumulated.TruncateInt() - newRewardDec := sdk.NewDecFromInt(newInterestPerInteraction) + newRewardDec := sdkmath.LegacyNewDecFromInt(newInterestPerInteraction) lendRewardsTracker.RewardsAccumulated = lendRewardsTracker.RewardsAccumulated.Sub(newRewardDec) // not losing decimal precision } k.SetLendRewardTracker(ctx, lendRewardsTracker) // setting the remaining decimal part pool, _ := k.GetPool(ctx, lend.PoolID) asset, _ := k.Asset.GetAsset(ctx, lend.AssetID) poolAssetLBMappingData, _ := k.GetAssetStatsByPoolIDAndAssetID(ctx, lend.PoolID, lend.AssetID) - if newInterestPerInteraction.GT(sdk.ZeroInt()) { + if newInterestPerInteraction.GT(sdkmath.ZeroInt()) { allReserveStats, found := k.GetAllReserveStatsByAssetID(ctx, lend.AssetID) if !found { allReserveStats = types.AllReserveStats{ AssetID: lend.AssetID, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), - AmountInFromRepayments: sdk.ZeroInt(), - TotalAmountOutToLenders: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), + AmountInFromRepayments: sdkmath.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } } if newInterestPerInteraction.GT(poolAssetLBMappingData.TotalInterestAccumulated) { modBal := k.ModuleBalance(ctx, types.ModuleName, asset.Denom) if modBal.LT(newInterestPerInteraction) { - return sdk.Dec{}, types.ErrorInsufficientCTokensForRewards + return sdkmath.LegacyDec{}, types.ErrorInsufficientCTokensForRewards } - // return sdk.Dec{}, types.ErrorInsufficientCTokensForRewards + // return sdkmath.LegacyDec{}, types.ErrorInsufficientCTokensForRewards // check reserve moduleBalance // from reserve to pool and mint cToken // give cToken to user @@ -80,16 +82,16 @@ func (k Keeper) IterateLends(ctx sdk.Context, ID uint64) (sdk.Dec, error) { // taking amount from reserve and minting cTokens err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, pool.ModuleName, sdk.NewCoins(Amount)) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } err = k.bank.MintCoins(ctx, pool.ModuleName, sdk.NewCoins(cToken)) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } err = k.bank.SendCoinsFromModuleToAccount(ctx, pool.ModuleName, addr, sdk.NewCoins(cToken)) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } lend.TotalRewards = lend.TotalRewards.Add(cToken.Amount) poolAssetLBMappingData.TotalLend = poolAssetLBMappingData.TotalLend.Add(cToken.Amount) @@ -97,12 +99,12 @@ func (k Keeper) IterateLends(ctx sdk.Context, ID uint64) (sdk.Dec, error) { k.SetLend(ctx, lend) // updating reserve - newAmount := newInterestPerInteraction.Quo(sdk.NewIntFromUint64(types.Uint64Two)) + newAmount := newInterestPerInteraction.Quo(sdkmath.NewIntFromUint64(types.Uint64Two)) reserve, found := k.GetReserveBuybackAssetData(ctx, lend.AssetID) if !found { reserve.AssetID = lend.AssetID - reserve.BuybackAmount = sdk.ZeroInt() - reserve.ReserveAmount = sdk.ZeroInt() + reserve.BuybackAmount = sdkmath.ZeroInt() + reserve.ReserveAmount = sdkmath.ZeroInt() } reserve.BuybackAmount = reserve.BuybackAmount.Sub(newAmount) @@ -125,7 +127,7 @@ func (k Keeper) IterateLends(ctx sdk.Context, ID uint64) (sdk.Dec, error) { addr, _ := sdk.AccAddressFromBech32(lend.Owner) err := k.bank.SendCoinsFromModuleToAccount(ctx, pool.ModuleName, addr, sdk.NewCoins(cToken)) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } lend.TotalRewards = lend.TotalRewards.Add(cToken.Amount) // subtracting newInterestPerInteraction from global lend and interest accumulated @@ -141,7 +143,7 @@ func (k Keeper) IterateLends(ctx sdk.Context, ID uint64) (sdk.Dec, error) { return indexGlobalCurrent, nil } -func (k Keeper) IterateBorrow(ctx sdk.Context, ID uint64) (sdk.Dec, sdk.Dec, error) { +func (k Keeper) IterateBorrow(ctx sdk.Context, ID uint64) (sdkmath.LegacyDec, sdkmath.LegacyDec, error) { // to calculate borrow interest on existing borrow positions // also calculate the amount going to reserve pool for that borrow position @@ -149,12 +151,12 @@ func (k Keeper) IterateBorrow(ctx sdk.Context, ID uint64) (sdk.Dec, sdk.Dec, err pair, _ := k.GetLendPair(ctx, borrow.PairID) reserveRates, err := k.GetReserveRate(ctx, pair.AssetOutPoolID, pair.AssetOut) if err != nil { - return sdk.ZeroDec(), sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err } currBorrowAPR, _ := k.GetBorrowAPRByAssetID(ctx, pair.AssetOutPoolID, pair.AssetOut, borrow.IsStableBorrow) interestPerInteraction, indexGlobalCurrent, reservePoolAmountPerInteraction, reserveGlobalIndex, err := k.CalculateBorrowInterest(ctx, borrow.AmountOut.Amount.String(), currBorrowAPR, reserveRates, borrow) if err != nil { - return sdk.ZeroDec(), sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err } if !borrow.IsStableBorrow { @@ -162,7 +164,7 @@ func (k Keeper) IterateBorrow(ctx sdk.Context, ID uint64) (sdk.Dec, sdk.Dec, err } else { stableInterestPerBlock, err := k.CalculateStableInterest(ctx, borrow.AmountOut.Amount.String(), borrow) if err != nil { - return sdk.ZeroDec(), sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err } borrow.InterestAccumulated = borrow.InterestAccumulated.Add(stableInterestPerBlock) } @@ -172,10 +174,10 @@ func (k Keeper) IterateBorrow(ctx sdk.Context, ID uint64) (sdk.Dec, sdk.Dec, err if !found { reservePoolRecords = types.BorrowInterestTracker{ BorrowingId: borrow.ID, - ReservePoolInterest: sdk.ZeroDec(), + ReservePoolInterest: sdkmath.LegacyZeroDec(), } } - if reservePoolAmountPerInteraction.GT(sdk.ZeroDec()) { + if reservePoolAmountPerInteraction.GT(sdkmath.LegacyZeroDec()) { reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Add(reservePoolAmountPerInteraction) } k.SetBorrowInterestTracker(ctx, reservePoolRecords) @@ -183,7 +185,7 @@ func (k Keeper) IterateBorrow(ctx sdk.Context, ID uint64) (sdk.Dec, sdk.Dec, err return indexGlobalCurrent, reserveGlobalIndex, nil } -func (k Keeper) CalculateStableInterest(ctx sdk.Context, amount string, borrow types.BorrowAsset) (sdk.Dec, error) { +func (k Keeper) CalculateStableInterest(ctx sdk.Context, amount string, borrow types.BorrowAsset) (sdkmath.LegacyDec, error) { currentTime := ctx.BlockTime().Unix() prevInterestTime := borrow.LastInteractionTime.Unix() @@ -192,16 +194,16 @@ func (k Keeper) CalculateStableInterest(ctx sdk.Context, amount string, borrow t } secondsElapsed := currentTime - prevInterestTime if secondsElapsed < int64(types.Uint64Zero) { - return sdk.ZeroDec(), sdkerrors.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) + return sdkmath.LegacyZeroDec(), errorsmod.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) } - yearsElapsed := sdk.NewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) - amt, _ := sdk.NewDecFromStr(amount) + yearsElapsed := sdkmath.LegacyNewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) + amt, _ := sdkmath.LegacyNewDecFromStr(amount) perc := borrow.StableBorrowRate newAmount := amt.Mul(perc).Mul(yearsElapsed) return newAmount, nil } -func (k Keeper) CalculateLendReward(ctx sdk.Context, amount string, rate sdk.Dec, lend types.LendAsset) (sdk.Dec, sdk.Dec, error) { +func (k Keeper) CalculateLendReward(ctx sdk.Context, amount string, rate sdkmath.LegacyDec, lend types.LendAsset) (sdkmath.LegacyDec, sdkmath.LegacyDec, error) { currentTime := ctx.BlockTime().Unix() lastInteraction := lend.LastInteractionTime globalIndex := lend.GlobalIndex @@ -211,13 +213,13 @@ func (k Keeper) CalculateLendReward(ctx sdk.Context, amount string, rate sdk.Dec } secondsElapsed := currentTime - prevInterestTime if secondsElapsed < int64(types.Uint64Zero) { - return sdk.ZeroDec(), sdk.ZeroDec(), sdkerrors.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) + return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), errorsmod.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) } - yearsElapsed := sdk.NewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) - amt, _ := sdk.NewDecFromStr(amount) + yearsElapsed := sdkmath.LegacyNewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) + amt, _ := sdkmath.LegacyNewDecFromStr(amount) effectiveRate := rate.Mul(yearsElapsed) - factor1 := sdk.OneDec().Add(effectiveRate) + factor1 := sdkmath.LegacyOneDec().Add(effectiveRate) indexGlobalCurrent := globalIndex.Mul(factor1) factor2 := indexGlobalCurrent.Quo(globalIndex) liabilityCurrent := amt.Mul(factor2) @@ -226,7 +228,7 @@ func (k Keeper) CalculateLendReward(ctx sdk.Context, amount string, rate sdk.Dec return newAmount, indexGlobalCurrent, nil } -func (k Keeper) CalculateBorrowInterest(ctx sdk.Context, amount string, rate, reserveRate sdk.Dec, borrow types.BorrowAsset) (sdk.Dec, sdk.Dec, sdk.Dec, sdk.Dec, error) { +func (k Keeper) CalculateBorrowInterest(ctx sdk.Context, amount string, rate, reserveRate sdkmath.LegacyDec, borrow types.BorrowAsset) (sdkmath.LegacyDec, sdkmath.LegacyDec, sdkmath.LegacyDec, sdkmath.LegacyDec, error) { currentTime := ctx.BlockTime().Unix() lastInteraction := borrow.LastInteractionTime globalIndex := borrow.GlobalIndex @@ -237,14 +239,14 @@ func (k Keeper) CalculateBorrowInterest(ctx sdk.Context, amount string, rate, re } secondsElapsed := currentTime - prevInterestTime if secondsElapsed < int64(types.Uint64Zero) { - return sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdkerrors.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) + return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), errorsmod.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) } - yearsElapsed := sdk.NewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) - amt, _ := sdk.NewDecFromStr(amount) + yearsElapsed := sdkmath.LegacyNewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) + amt, _ := sdkmath.LegacyNewDecFromStr(amount) // for calculating interest accrued per interaction effectiveRate := rate.Mul(yearsElapsed) - factor1 := sdk.OneDec().Add(effectiveRate) + factor1 := sdkmath.LegacyOneDec().Add(effectiveRate) indexGlobalCurrent := globalIndex.Mul(factor1) factor2 := indexGlobalCurrent.Quo(globalIndex) liabilityCurrent := amt.Mul(factor2) @@ -253,7 +255,7 @@ func (k Keeper) CalculateBorrowInterest(ctx sdk.Context, amount string, rate, re // for calculating amount to reserve pool accrued per interaction reserveEffectiveRate := reserveRate.Mul(yearsElapsed) - reserveFactor1 := sdk.OneDec().Add(reserveEffectiveRate) + reserveFactor1 := sdkmath.LegacyOneDec().Add(reserveEffectiveRate) reserveIndexGlobalCurrent := reserveGlobalIndex.Mul(reserveFactor1) reserveFactor2 := reserveIndexGlobalCurrent.Quo(reserveGlobalIndex) reserveLiabilityCurrent := amt.Mul(reserveFactor2) @@ -276,8 +278,8 @@ func (k Keeper) ReBalanceStableRates(ctx sdk.Context, borrowPos types.BorrowAsse if err != nil { return borrowPos, err } - perc1, _ := sdk.NewDecFromStr(types.Perc1) // 20% - perc2, _ := sdk.NewDecFromStr(types.Perc2) // 90% + perc1, _ := sdkmath.LegacyNewDecFromStr(types.Perc1) // 20% + perc2, _ := sdkmath.LegacyNewDecFromStr(types.Perc2) // 90% if borrowPos.StableBorrowRate.GTE(assetStats.StableBorrowApr.Add(perc1)) { // condition 1, 𝑆 ≥ 𝑆𝑡 + 20%, S is the rate at which you borrowed, and St is the current stable rate in the system. borrowPos.StableBorrowRate = assetStats.StableBorrowApr } else if (borrowPos.StableBorrowRate.Add(perc1)).LTE(assetStats.StableBorrowApr) || utilizationRatio.GTE(perc2) { // condition 2, 𝑆 + 20% ≤ 𝑆𝑡 ∨ 𝑢𝑡𝑖𝑙𝑖𝑧𝑎𝑡𝑖𝑜𝑛 ≥ 90% @@ -300,7 +302,7 @@ func (k Keeper) IterateLendsForQuery(ctx sdk.Context) ([]types.PoolInterest, err poolInterest.PoolID = pool.PoolID for _, data := range pool.AssetData { lbMap, _ := k.GetAssetStatsByPoolIDAndAssetID(ctx, pool.PoolID, data.AssetID) - totalInt := sdk.ZeroDec() + totalInt := sdkmath.LegacyZeroDec() for _, ID := range lbMap.LendIds { lend, _ := k.GetLend(ctx, ID) lendAPR, _ := k.GetLendAPRByAssetIDAndPoolID(ctx, lend.PoolID, lend.AssetID) @@ -331,7 +333,7 @@ func (k Keeper) IterateBorrowsForQuery(ctx sdk.Context) ([]types.PoolInterestB, poolInterest.PoolID = pool.PoolID for _, data := range pool.AssetData { lbMap, _ := k.GetAssetStatsByPoolIDAndAssetID(ctx, pool.PoolID, data.AssetID) - totalInt := sdk.ZeroDec() + totalInt := sdkmath.LegacyZeroDec() for _, ID := range lbMap.BorrowIds { borrow, _ := k.GetBorrow(ctx, ID) pair, _ := k.GetLendPair(ctx, borrow.PairID) diff --git a/x/lend/keeper/keeper.go b/x/lend/keeper/keeper.go index 13dd05578..4a3917310 100644 --- a/x/lend/keeper/keeper.go +++ b/x/lend/keeper/keeper.go @@ -2,22 +2,26 @@ package keeper import ( "fmt" - auctiontypes "github.com/comdex-official/comdex/x/auction/types" "strconv" + errorsmod "cosmossdk.io/errors" + + sdkmath "cosmossdk.io/math" + + auctiontypes "github.com/comdex-official/comdex/x/auction/types" + + "cosmossdk.io/log" liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" - "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + storetypes "cosmossdk.io/store/types" assettypes "github.com/comdex-official/comdex/x/asset/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" "github.com/comdex-official/comdex/x/lend/expected" "github.com/comdex-official/comdex/x/lend/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" // liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" ) @@ -74,7 +78,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdk.Int { +func (k Keeper) ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdkmath.Int { return k.bank.GetBalance(ctx, authtypes.NewModuleAddress(moduleName), denom).Amount } @@ -87,9 +91,9 @@ func uint64InAssetData(a uint64, list []*types.AssetDataPoolMapping) bool { return false } -func (k Keeper) CheckSupplyCap(ctx sdk.Context, assetID, poolID uint64, amt sdk.Int) (bool, error) { +func (k Keeper) CheckSupplyCap(ctx sdk.Context, assetID, poolID uint64, amt sdkmath.Int) (bool, error) { // this fn checks if while depositing the supply cap of a specific lend asset doesn't exceed specified value - var supplyCap sdk.Dec + var supplyCap sdkmath.LegacyDec assetStats, _ := k.GetAssetStatsByPoolIDAndAssetID(ctx, poolID, assetID) currentSupply, err := k.Market.CalcAssetPrice(ctx, assetID, assetStats.TotalLend.Add(amt)) @@ -161,12 +165,12 @@ func (k Keeper) LendAsset(ctx sdk.Context, lenderAddr string, AssetID uint64, Am } if Amount.Denom != asset.Denom { - return sdkerrors.Wrap(types.ErrBadOfferCoinAmount, Amount.Denom) + return errorsmod.Wrap(types.ErrBadOfferCoinAmount, Amount.Denom) } found = uint64InAssetData(AssetID, pool.AssetData) if !found { - return sdkerrors.Wrap(types.ErrInvalidAssetIDForPool, strconv.FormatUint(AssetID, 10)) + return errorsmod.Wrap(types.ErrInvalidAssetIDForPool, strconv.FormatUint(AssetID, 10)) } found, err := k.CheckSupplyCap(ctx, AssetID, PoolID, Amount.Amount) @@ -201,7 +205,7 @@ func (k Keeper) LendAsset(ctx sdk.Context, lenderAddr string, AssetID uint64, Am assetRatesStat, found := k.GetAssetRatesParams(ctx, AssetID) if !found { - return sdkerrors.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(AssetID, 10)) + return errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(AssetID, 10)) } cAsset, found := k.Asset.GetAsset(ctx, assetRatesStat.CAssetID) if !found { @@ -222,10 +226,10 @@ func (k Keeper) LendAsset(ctx sdk.Context, lenderAddr string, AssetID uint64, Am return err } - var globalIndex sdk.Dec + var globalIndex sdkmath.LegacyDec assetStats, _ := k.AssetStatsByPoolIDAndAssetID(ctx, PoolID, AssetID) if assetStats.LendApr.IsZero() { - globalIndex = sdk.OneDec() + globalIndex = sdkmath.LegacyOneDec() } else { globalIndex = assetStats.LendApr } @@ -242,7 +246,7 @@ func (k Keeper) LendAsset(ctx sdk.Context, lenderAddr string, AssetID uint64, Am GlobalIndex: globalIndex, LastInteractionTime: ctx.BlockTime(), CPoolName: pool.CPoolName, - TotalRewards: sdk.ZeroInt(), + TotalRewards: sdkmath.ZeroInt(), } k.UpdateLendStats(ctx, AssetID, PoolID, Amount.Amount, true) // update global lend data in poolAssetLBMappingData k.SetUserLendIDCounter(ctx, lendPos.ID) @@ -314,18 +318,18 @@ func (k Keeper) WithdrawAsset(ctx sdk.Context, addr string, lendID uint64, withd } if withdrawal.Denom != getAsset.Denom { - return sdkerrors.Wrap(types.ErrBadOfferCoinAmount, withdrawal.Denom) + return errorsmod.Wrap(types.ErrBadOfferCoinAmount, withdrawal.Denom) } availableAmount := k.ModuleBalance(ctx, pool.ModuleName, withdrawal.Denom) if withdrawal.Amount.GT(availableAmount) { - return sdkerrors.Wrap(types.ErrLendingPoolInsufficient, withdrawal.String()) + return errorsmod.Wrap(types.ErrLendingPoolInsufficient, withdrawal.String()) } assetRatesStat, found := k.GetAssetRatesParams(ctx, lendPos.AssetID) if !found { - return sdkerrors.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(lendPos.AssetID, 10)) + return errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(lendPos.AssetID, 10)) } cAsset, _ := k.Asset.GetAsset(ctx, assetRatesStat.CAssetID) @@ -367,7 +371,7 @@ func (k Keeper) WithdrawAsset(ctx sdk.Context, addr string, lendID uint64, withd k.UpdateLendStats(ctx, lendPos.AssetID, lendPos.PoolID, withdrawal.Amount, false) lendPos.AvailableToBorrow = lendPos.AvailableToBorrow.Sub(withdrawal.Amount) - lendPos.AmountIn.Amount = sdk.ZeroInt() + lendPos.AmountIn.Amount = sdkmath.ZeroInt() k.SetLend(ctx, lendPos) } return nil @@ -406,7 +410,7 @@ func (k Keeper) DepositAsset(ctx sdk.Context, addr string, lendID uint64, deposi getAsset, _ := k.Asset.GetAsset(ctx, lendPos.AssetID) if deposit.Denom != getAsset.Denom { - return sdkerrors.Wrap(types.ErrBadOfferCoinAmount, deposit.Denom) + return errorsmod.Wrap(types.ErrBadOfferCoinAmount, deposit.Denom) } pool, _ := k.GetPool(ctx, lendPos.PoolID) @@ -421,7 +425,7 @@ func (k Keeper) DepositAsset(ctx sdk.Context, addr string, lendID uint64, deposi assetRatesStat, found := k.GetAssetRatesParams(ctx, lendPos.AssetID) if !found { - return sdkerrors.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(lendPos.AssetID, 10)) + return errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(lendPos.AssetID, 10)) } cAsset, _ := k.Asset.GetAsset(ctx, assetRatesStat.CAssetID) @@ -482,12 +486,12 @@ func (k Keeper) CloseLend(ctx sdk.Context, addr string, lendID uint64) error { availableAmount := k.ModuleBalance(ctx, pool.ModuleName, lendPos.AmountIn.Denom) if lendPos.AvailableToBorrow.GT(availableAmount) { - return sdkerrors.Wrap(types.ErrLendingPoolInsufficient, lendPos.AvailableToBorrow.String()) + return errorsmod.Wrap(types.ErrLendingPoolInsufficient, lendPos.AvailableToBorrow.String()) } assetRatesStat, found := k.GetAssetRatesParams(ctx, lendPos.AssetID) if !found { - return sdkerrors.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(lendPos.AssetID, 10)) + return errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(lendPos.AssetID, 10)) } cAsset, _ := k.Asset.GetAsset(ctx, assetRatesStat.CAssetID) @@ -577,7 +581,7 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, return types.ErrBadOfferCoinType } - minUSDVal, _ := sdk.NewDecFromStr(types.DollarOneValue) + minUSDVal, _ := sdkmath.LegacyNewDecFromStr(types.DollarOneValue) loanValue, err := k.Market.CalcAssetPrice(ctx, pair.AssetOut, loan.Amount) if loanValue.LT(minUSDVal) || err != nil { return types.ErrBorrowLessThanMinAmount @@ -623,7 +627,7 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, } if IsStableBorrow && !assetInRatesStats.EnableStableBorrow { - return sdkerrors.Wrap(types.ErrStableBorrowDisabled, loan.String()) + return errorsmod.Wrap(types.ErrStableBorrowDisabled, loan.String()) } err = k.VerifyCollateralizationRatio(ctx, AmountIn.Amount, assetIn, loan.Amount, assetOut, assetInRatesStatsLtv) @@ -635,12 +639,12 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, availableAmount := k.ModuleBalance(ctx, AssetOutPool.ModuleName, loan.Denom) // check sufficient amt in pool to borrow if loan.Amount.GT(availableAmount) { - return sdkerrors.Wrap(types.ErrBorrowingPoolInsufficient, loan.String()) + return errorsmod.Wrap(types.ErrBorrowingPoolInsufficient, loan.String()) } assetStats, _ := k.AssetStatsByPoolIDAndAssetID(ctx, pair.AssetOutPoolID, pair.AssetOut) reserveGlobalIndex, err := k.GetReserveRate(ctx, pair.AssetOutPoolID, pair.AssetOut) if err != nil { - reserveGlobalIndex = sdk.OneDec() + reserveGlobalIndex = sdkmath.LegacyOneDec() } globalIndex := assetStats.BorrowApr // There are 3 possible cases of borrowing @@ -658,14 +662,14 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, return err } - var StableBorrowRate sdk.Dec + var StableBorrowRate sdkmath.LegacyDec if assetInRatesStats.EnableStableBorrow && IsStableBorrow { StableBorrowRate, err = k.GetBorrowAPRByAssetID(ctx, AssetOutPool.PoolID, pair.AssetOut, IsStableBorrow) if err != nil { return err } } else { - StableBorrowRate = sdk.ZeroDec() + StableBorrowRate = sdkmath.LegacyZeroDec() } borrowPos := types.BorrowAsset{ @@ -674,11 +678,11 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, PairID: pairID, AmountIn: AmountIn, AmountOut: loan, - BridgedAssetAmount: sdk.NewCoin(loan.Denom, sdk.NewInt(0)), + BridgedAssetAmount: sdk.NewCoin(loan.Denom, sdkmath.NewInt(0)), IsStableBorrow: IsStableBorrow, StableBorrowRate: StableBorrowRate, BorrowingTime: ctx.BlockTime(), - InterestAccumulated: sdk.ZeroDec(), + InterestAccumulated: sdkmath.LegacyZeroDec(), GlobalIndex: globalIndex, ReserveGlobalIndex: reserveGlobalIndex, LastInteractionTime: ctx.BlockTime(), @@ -700,7 +704,7 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, mappingData.BorrowId = append(mappingData.BorrowId, borrowPos.ID) k.SetUserLendBorrowMapping(ctx, mappingData) } else { - updatedAmtIn := sdk.NewDecFromInt(AmountIn.Amount).Mul(assetInRatesStatsLtv) + updatedAmtIn := sdkmath.LegacyNewDecFromInt(AmountIn.Amount).Mul(assetInRatesStatsLtv) updatedAmtInPrice, err := k.Market.CalcAssetPrice(ctx, lendPos.AssetID, updatedAmtIn.TruncateInt()) if err != nil { return err @@ -717,11 +721,11 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, firstTransitAsset, _ := k.Asset.GetAsset(ctx, firstTransitAssetID) secondTransitAsset, _ := k.Asset.GetAsset(ctx, secondTransitAssetID) - unitAmountFirstTransitAsset, err := k.Market.CalcAssetPrice(ctx, firstTransitAssetID, sdk.OneInt()) + unitAmountFirstTransitAsset, err := k.Market.CalcAssetPrice(ctx, firstTransitAssetID, sdkmath.OneInt()) if err != nil { return err } - unitAmountSecondTransitAsset, err := k.Market.CalcAssetPrice(ctx, secondTransitAssetID, sdk.OneInt()) + unitAmountSecondTransitAsset, err := k.Market.CalcAssetPrice(ctx, secondTransitAssetID, sdkmath.OneInt()) if err != nil { return err } @@ -741,7 +745,7 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, if !found { return types.ErrAssetStatsNotFound } - if firstBridgedAssetQty.LT(sdk.NewDecFromInt(firstBridgedAssetBal)) { + if firstBridgedAssetQty.LT(sdkmath.LegacyNewDecFromInt(firstBridgedAssetBal)) { err = k.VerifyCollateralizationRatio(ctx, firstBridgedAssetQty.TruncateInt(), firstTransitAsset, loan.Amount, assetOut, firstBridgedAssetRatesStats.Ltv) if err != nil { return err @@ -758,14 +762,14 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, return err } - var StableBorrowRate sdk.Dec + var StableBorrowRate sdkmath.LegacyDec if assetInRatesStats.EnableStableBorrow && IsStableBorrow { StableBorrowRate, err = k.GetBorrowAPRByAssetID(ctx, AssetOutPool.PoolID, pair.AssetOut, IsStableBorrow) if err != nil { return err } } else { - StableBorrowRate = sdk.ZeroDec() + StableBorrowRate = sdkmath.LegacyZeroDec() } borrowPos := types.BorrowAsset{ @@ -778,7 +782,7 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, IsStableBorrow: IsStableBorrow, StableBorrowRate: StableBorrowRate, BorrowingTime: ctx.BlockTime(), - InterestAccumulated: sdk.ZeroDec(), + InterestAccumulated: sdkmath.LegacyZeroDec(), GlobalIndex: globalIndex, ReserveGlobalIndex: reserveGlobalIndex, LastInteractionTime: ctx.BlockTime(), @@ -798,7 +802,7 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, k.SetUserLendBorrowMapping(ctx, mappingData) k.SetUserBorrowIDCounter(ctx, borrowPos.ID) k.SetBorrow(ctx, borrowPos) - } else if secondBridgedAssetQty.LT(sdk.NewDecFromInt(secondBridgedAssetBal)) { + } else if secondBridgedAssetQty.LT(sdkmath.LegacyNewDecFromInt(secondBridgedAssetBal)) { err = k.VerifyCollateralizationRatio(ctx, secondBridgedAssetQty.TruncateInt(), secondTransitAsset, loan.Amount, assetOut, secondBridgedAssetRatesStats.Ltv) if err != nil { return err @@ -815,14 +819,14 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, return err } - var StableBorrowRate sdk.Dec + var StableBorrowRate sdkmath.LegacyDec if assetInRatesStats.EnableStableBorrow && IsStableBorrow { StableBorrowRate, err = k.GetBorrowAPRByAssetID(ctx, AssetOutPool.PoolID, pair.AssetOut, IsStableBorrow) if err != nil { return err } } else { - StableBorrowRate = sdk.ZeroDec() + StableBorrowRate = sdkmath.LegacyZeroDec() } borrowPos := types.BorrowAsset{ @@ -835,7 +839,7 @@ func (k Keeper) BorrowAsset(ctx sdk.Context, addr string, lendID, pairID uint64, IsStableBorrow: IsStableBorrow, StableBorrowRate: StableBorrowRate, BorrowingTime: ctx.BlockTime(), - InterestAccumulated: sdk.ZeroDec(), + InterestAccumulated: sdkmath.LegacyZeroDec(), GlobalIndex: globalIndex, ReserveGlobalIndex: reserveGlobalIndex, LastInteractionTime: ctx.BlockTime(), @@ -940,8 +944,8 @@ func (k Keeper) RepayAsset(ctx sdk.Context, borrowID uint64, borrowerAddr string if err = k.bank.SendCoinsFromAccountToModule(ctx, addr, pool.ModuleName, sdk.NewCoins(payment)); err != nil { return err } - reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Sub(sdk.NewDecFromInt(payment.Amount)) - borrowPos.InterestAccumulated = borrowPos.InterestAccumulated.Sub(sdk.NewDecFromInt(payment.Amount)) + reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Sub(sdkmath.LegacyNewDecFromInt(payment.Amount)) + borrowPos.InterestAccumulated = borrowPos.InterestAccumulated.Sub(sdkmath.LegacyNewDecFromInt(payment.Amount)) err = k.UpdateReserveBalances(ctx, pair.AssetOut, pool.ModuleName, payment, true) // this functions sends the amount to reserve pool from the cPool if err != nil { return err @@ -967,10 +971,10 @@ func (k Keeper) RepayAsset(ctx sdk.Context, borrowID uint64, borrowerAddr string // calculation for tokens to be minted and updated in global lend and interest accumulated parameter cTokensAmount := payment.Amount.Sub(amtToReservePool.TruncateInt()) - if cTokensAmount.LT(sdk.ZeroInt()) { + if cTokensAmount.LT(sdkmath.ZeroInt()) { return types.ErrReserveRatesNotFound } - if cTokensAmount.GT(sdk.ZeroInt()) { + if cTokensAmount.GT(sdkmath.ZeroInt()) { err = k.bank.MintCoins(ctx, pool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, cTokensAmount))) if err != nil { return err @@ -980,8 +984,8 @@ func (k Keeper) RepayAsset(ctx sdk.Context, borrowID uint64, borrowerAddr string k.SetAssetStatsByPoolIDAndAssetID(ctx, poolAssetLBMappingData) } - reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Sub(sdk.NewDecFromInt(amtToReservePool.TruncateInt())) // the decimal precision is maintained - borrowPos.InterestAccumulated = borrowPos.InterestAccumulated.Sub(sdk.NewDecFromInt(payment.Amount)) + reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Sub(sdkmath.LegacyNewDecFromInt(amtToReservePool.TruncateInt())) // the decimal precision is maintained + borrowPos.InterestAccumulated = borrowPos.InterestAccumulated.Sub(sdkmath.LegacyNewDecFromInt(payment.Amount)) } else { // if payment amt greater than borrowPos.InterestAccumulated // from reservePoolRecords amount send tokens to reserve pool // mint (interest Accumulated - reservePoolRecords) amount cTokens and send to pool @@ -1005,10 +1009,10 @@ func (k Keeper) RepayAsset(ctx sdk.Context, borrowID uint64, borrowerAddr string // calculation for tokens to be minted and updated in global lend and interest accumulated parameter cTokensAmount := borrowPos.InterestAccumulated.Sub(reservePoolRecords.ReservePoolInterest).TruncateInt() - if cTokensAmount.LT(sdk.ZeroInt()) { + if cTokensAmount.LT(sdkmath.ZeroInt()) { return types.ErrReserveRatesNotFound } - if cTokensAmount.GT(sdk.ZeroInt()) { + if cTokensAmount.GT(sdkmath.ZeroInt()) { err = k.bank.MintCoins(ctx, pool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, cTokensAmount))) if err != nil { return err @@ -1017,10 +1021,10 @@ func (k Keeper) RepayAsset(ctx sdk.Context, borrowID uint64, borrowerAddr string // poolAssetLBMappingData.TotalLend = poolAssetLBMappingData.TotalLend.Add(cTokensAmount) k.SetAssetStatsByPoolIDAndAssetID(ctx, poolAssetLBMappingData) } - reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Sub(sdk.NewDecFromInt(amtToReservePool.TruncateInt())) // the decimal precision is maintained + reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Sub(sdkmath.LegacyNewDecFromInt(amtToReservePool.TruncateInt())) // the decimal precision is maintained amtToSubFromBorrowPos := payment.Amount.Sub(borrowPos.InterestAccumulated.TruncateInt()) borrowPos.AmountOut.Amount = borrowPos.AmountOut.Amount.Sub(amtToSubFromBorrowPos) - borrowPos.InterestAccumulated = borrowPos.InterestAccumulated.Sub(sdk.NewDecFromInt(borrowPos.InterestAccumulated.TruncateInt())) + borrowPos.InterestAccumulated = borrowPos.InterestAccumulated.Sub(sdkmath.LegacyNewDecFromInt(borrowPos.InterestAccumulated.TruncateInt())) k.UpdateBorrowStats(ctx, pair, borrowPos.IsStableBorrow, amtToSubFromBorrowPos, false) } @@ -1073,14 +1077,14 @@ func (k Keeper) DepositBorrowAsset(ctx sdk.Context, borrowID uint64, addr string borrowPos.LastInteractionTime = ctx.BlockTime() assetRatesStat, found := k.GetAssetRatesParams(ctx, lendPos.AssetID) if !found { - return sdkerrors.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(lendPos.AssetID, 10)) + return errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(lendPos.AssetID, 10)) } cAsset, found := k.Asset.GetAsset(ctx, assetRatesStat.CAssetID) if !found { return assettypes.ErrorAssetDoesNotExist } if AmountIn.Denom != cAsset.Denom { - return sdkerrors.Wrap(types.ErrBadOfferCoinAmount, AmountIn.Denom) + return errorsmod.Wrap(types.ErrBadOfferCoinAmount, AmountIn.Denom) } if AmountIn.Amount.GT(lendPos.AvailableToBorrow) { return types.ErrAvailableToBorrowInsufficient @@ -1107,7 +1111,7 @@ func (k Keeper) DepositBorrowAsset(ctx sdk.Context, borrowID uint64, addr string borrowPos.AmountIn = borrowPos.AmountIn.Add(AmountIn) k.SetBorrow(ctx, borrowPos) } else { - amtIn, err := k.Market.CalcAssetPrice(ctx, pair.AssetIn, (sdk.NewDecFromInt(AmountIn.Amount).Mul(assetRatesStat.Ltv)).TruncateInt()) + amtIn, err := k.Market.CalcAssetPrice(ctx, pair.AssetIn, (sdkmath.LegacyNewDecFromInt(AmountIn.Amount).Mul(assetRatesStat.Ltv)).TruncateInt()) if err != nil { return err } @@ -1124,11 +1128,11 @@ func (k Keeper) DepositBorrowAsset(ctx sdk.Context, borrowID uint64, addr string firstTransitAsset, _ := k.Asset.GetAsset(ctx, firstTransitAssetID) secondTransitAsset, _ := k.Asset.GetAsset(ctx, secondTransitAssetID) - unitAmountFirstTransitAsset, err := k.Market.CalcAssetPrice(ctx, firstTransitAssetID, sdk.OneInt()) + unitAmountFirstTransitAsset, err := k.Market.CalcAssetPrice(ctx, firstTransitAssetID, sdkmath.OneInt()) if err != nil { return err } - unitAmountSecondTransitAsset, err := k.Market.CalcAssetPrice(ctx, secondTransitAssetID, sdk.OneInt()) + unitAmountSecondTransitAsset, err := k.Market.CalcAssetPrice(ctx, secondTransitAssetID, sdkmath.OneInt()) if err != nil { return err } @@ -1142,7 +1146,7 @@ func (k Keeper) DepositBorrowAsset(ctx sdk.Context, borrowID uint64, addr string // qty of first and second bridged asset to be sent over different pool according to the borrow Pool - if borrowPos.BridgedAssetAmount.Denom == firstTransitAsset.Denom && firstBridgedAssetQty.LT(sdk.NewDecFromInt(firstBridgedAssetBal)) { + if borrowPos.BridgedAssetAmount.Denom == firstTransitAsset.Denom && firstBridgedAssetQty.LT(sdkmath.LegacyNewDecFromInt(firstBridgedAssetBal)) { // take c/Tokens from the user if err = k.bank.SendCoinsFromAccountToModule(ctx, lenderAddr, AssetInPool.ModuleName, sdk.NewCoins(AmountIn)); err != nil { return err @@ -1156,7 +1160,7 @@ func (k Keeper) DepositBorrowAsset(ctx sdk.Context, borrowID uint64, addr string borrowPos.AmountIn = borrowPos.AmountIn.Add(AmountIn) borrowPos.BridgedAssetAmount.Amount = borrowPos.BridgedAssetAmount.Amount.Add(firstBridgedAssetQty.TruncateInt()) k.SetBorrow(ctx, borrowPos) - } else if secondBridgedAssetQty.LT(sdk.NewDecFromInt(secondBridgedAssetBal)) { + } else if secondBridgedAssetQty.LT(sdkmath.LegacyNewDecFromInt(secondBridgedAssetBal)) { // take c/Tokens from the user if err = k.bank.SendCoinsFromAccountToModule(ctx, lenderAddr, AssetInPool.ModuleName, sdk.NewCoins(AmountIn)); err != nil { return err @@ -1338,10 +1342,10 @@ func (k Keeper) CloseBorrow(ctx sdk.Context, borrowerAddr string, borrowID uint6 reservePoolRecords, _ := k.GetBorrowInterestTracker(ctx, borrowID) amtToReservePool := reservePoolRecords.ReservePoolInterest - if amtToReservePool.TruncateInt().LT(sdk.ZeroInt()) { + if amtToReservePool.TruncateInt().LT(sdkmath.ZeroInt()) { return types.ErrReserveRatesNotFound } - if amtToReservePool.TruncateInt().GT(sdk.ZeroInt()) { + if amtToReservePool.TruncateInt().GT(sdkmath.ZeroInt()) { amount := sdk.NewCoin(assetOut.Denom, amtToReservePool.TruncateInt()) err = k.UpdateReserveBalances(ctx, pair.AssetOut, pool.ModuleName, amount, true) if err != nil { @@ -1350,7 +1354,7 @@ func (k Keeper) CloseBorrow(ctx sdk.Context, borrowerAddr string, borrowID uint6 k.UpdateReserveAmtFromRepayments(ctx, pair.AssetOut, amount.Amount) } amtToMint := (borrowPos.InterestAccumulated.Sub(amtToReservePool)).TruncateInt() - if amtToMint.GT(sdk.ZeroInt()) { + if amtToMint.GT(sdkmath.ZeroInt()) { err = k.bank.MintCoins(ctx, pool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, amtToMint))) if err != nil { return err @@ -1404,12 +1408,12 @@ func (k Keeper) BorrowAlternate(ctx sdk.Context, lenderAddr string, AssetID, Poo } if AmountIn.Denom != asset.Denom { - return sdkerrors.Wrap(types.ErrBadOfferCoinAmount, AmountIn.Denom) + return errorsmod.Wrap(types.ErrBadOfferCoinAmount, AmountIn.Denom) } found = uint64InAssetData(AssetID, pool.AssetData) if !found { - return sdkerrors.Wrap(types.ErrInvalidAssetIDForPool, strconv.FormatUint(AssetID, 10)) + return errorsmod.Wrap(types.ErrInvalidAssetIDForPool, strconv.FormatUint(AssetID, 10)) } found, err := k.CheckSupplyCap(ctx, AssetID, PoolID, AmountIn.Amount) @@ -1424,7 +1428,7 @@ func (k Keeper) BorrowAlternate(ctx sdk.Context, lenderAddr string, AssetID, Poo assetRatesStat, found := k.GetAssetRatesParams(ctx, AssetID) if !found { - return sdkerrors.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(AssetID, 10)) + return errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(AssetID, 10)) } cAsset, _ := k.Asset.GetAsset(ctx, assetRatesStat.CAssetID) @@ -1465,10 +1469,10 @@ func (k Keeper) BorrowAlternate(ctx sdk.Context, lenderAddr string, AssetID, Poo lendID := k.GetUserLendIDCounter(ctx) - var globalIndex sdk.Dec + var globalIndex sdkmath.LegacyDec assetStats, _ := k.AssetStatsByPoolIDAndAssetID(ctx, PoolID, AssetID) if assetStats.LendApr.IsZero() { - globalIndex = sdk.OneDec() + globalIndex = sdkmath.LegacyOneDec() } else { globalIndex = assetStats.LendApr } @@ -1531,7 +1535,7 @@ func (k Keeper) FundModAcc(ctx sdk.Context, poolID, assetID uint64, lender strin assetRatesStat, found := k.GetAssetRatesParams(ctx, assetID) if !found { - return sdkerrors.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(assetID, 10)) + return errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, strconv.FormatUint(assetID, 10)) } cAsset, found := k.Asset.GetAsset(ctx, assetRatesStat.CAssetID) if !found { @@ -1585,12 +1589,12 @@ func (k Keeper) FundReserveAcc(ctx sdk.Context, assetID uint64, lender string, p return err } - newAmount := payment.Amount.Quo(sdk.NewIntFromUint64(types.Uint64Two)) + newAmount := payment.Amount.Quo(sdkmath.NewIntFromUint64(types.Uint64Two)) reserve, found := k.GetReserveBuybackAssetData(ctx, assetID) if !found { reserve.AssetID = assetID - reserve.BuybackAmount = sdk.ZeroInt() - reserve.ReserveAmount = sdk.ZeroInt() + reserve.BuybackAmount = sdkmath.ZeroInt() + reserve.ReserveAmount = sdkmath.ZeroInt() } reserve.BuybackAmount = reserve.BuybackAmount.Add(newAmount) @@ -1666,7 +1670,7 @@ func (k Keeper) RemoveFaultyAuctions(ctx sdk.Context) error { return nil } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.storeKey) } @@ -1698,16 +1702,16 @@ func (k Keeper) CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.Locke } // Adjusting bridged asset qty after auctions - if !kind.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { - amtIn, _ := k.Market.CalcAssetPrice(ctx, pair.AssetIn, sdk.NewDecFromInt(borrowPos.AmountIn.Amount).Mul(assetInRatesStats.Ltv).TruncateInt()) - priceFirstBridgedAsset, _ := k.Market.CalcAssetPrice(ctx, firstTransitAssetID, sdk.OneInt()) - priceSecondBridgedAsset, _ := k.Market.CalcAssetPrice(ctx, secondTransitAssetID, sdk.OneInt()) + if !kind.BridgedAssetAmount.Amount.Equal(sdkmath.ZeroInt()) { + amtIn, _ := k.Market.CalcAssetPrice(ctx, pair.AssetIn, sdkmath.LegacyNewDecFromInt(borrowPos.AmountIn.Amount).Mul(assetInRatesStats.Ltv).TruncateInt()) + priceFirstBridgedAsset, _ := k.Market.CalcAssetPrice(ctx, firstTransitAssetID, sdkmath.OneInt()) + priceSecondBridgedAsset, _ := k.Market.CalcAssetPrice(ctx, secondTransitAssetID, sdkmath.OneInt()) firstBridgedAsset, _ := k.Asset.GetAsset(ctx, firstTransitAssetID) if kind.BridgedAssetAmount.Denom == firstBridgedAsset.Denom { firstBridgedAssetQty := amtIn.Quo(priceFirstBridgedAsset) diff := borrowPos.BridgedAssetAmount.Amount.Sub(firstBridgedAssetQty.TruncateInt()) - if diff.GT(sdk.ZeroInt()) { + if diff.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, AssetOutPool.ModuleName, AssetInPool.ModuleName, sdk.NewCoins(sdk.NewCoin(borrowPos.BridgedAssetAmount.Denom, diff))) if err != nil { return @@ -1715,7 +1719,7 @@ func (k Keeper) CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.Locke borrowPos.BridgedAssetAmount.Amount = firstBridgedAssetQty.TruncateInt() } else { newDiff := firstBridgedAssetQty.TruncateInt().Sub(borrowPos.BridgedAssetAmount.Amount) - if newDiff.GT(sdk.ZeroInt()) { + if newDiff.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, AssetInPool.ModuleName, AssetOutPool.ModuleName, sdk.NewCoins(sdk.NewCoin(borrowPos.BridgedAssetAmount.Denom, newDiff))) if err != nil { return @@ -1726,7 +1730,7 @@ func (k Keeper) CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.Locke } else { secondBridgedAssetQty := amtIn.Quo(priceSecondBridgedAsset) diff := borrowPos.BridgedAssetAmount.Amount.Sub(secondBridgedAssetQty.TruncateInt()) - if diff.GT(sdk.ZeroInt()) { + if diff.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, AssetOutPool.ModuleName, AssetInPool.ModuleName, sdk.NewCoins(sdk.NewCoin(borrowPos.BridgedAssetAmount.Denom, diff))) if err != nil { return @@ -1734,7 +1738,7 @@ func (k Keeper) CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.Locke borrowPos.BridgedAssetAmount.Amount = secondBridgedAssetQty.TruncateInt() } else { newDiff := secondBridgedAssetQty.TruncateInt().Sub(borrowPos.BridgedAssetAmount.Amount) - if newDiff.GT(sdk.ZeroInt()) { + if newDiff.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, AssetInPool.ModuleName, AssetOutPool.ModuleName, sdk.NewCoins(sdk.NewCoin(borrowPos.BridgedAssetAmount.Denom, newDiff))) if err != nil { return @@ -1900,25 +1904,25 @@ func (k Keeper) MsgCalculateInterestAndRewards(ctx sdk.Context, addr string) err return nil } -func (k Keeper) UpdateReserveAmtFromRepayments(ctx sdk.Context, id uint64, amt sdk.Int) { +func (k Keeper) UpdateReserveAmtFromRepayments(ctx sdk.Context, id uint64, amt sdkmath.Int) { allReserveStats, found := k.GetAllReserveStatsByAssetID(ctx, id) if !found { allReserveStats = types.AllReserveStats{ AssetID: id, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), - AmountInFromRepayments: sdk.ZeroInt(), - TotalAmountOutToLenders: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), + AmountInFromRepayments: sdkmath.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } } allReserveStats.AmountInFromRepayments = allReserveStats.AmountInFromRepayments.Add(amt) k.SetAllReserveStatsByAssetID(ctx, allReserveStats) } -func (k Keeper) UserAssetLends(ctx sdk.Context, addr string, assetID uint64) (sdk.Int, bool) { +func (k Keeper) UserAssetLends(ctx sdk.Context, addr string, assetID uint64) (sdkmath.Int, bool) { var lendIDs []uint64 - amount := sdk.ZeroInt() + amount := sdkmath.ZeroInt() mappingData := k.GetUserTotalMappingData(ctx, addr) for _, data := range mappingData { diff --git a/x/lend/keeper/keeper_test.go b/x/lend/keeper/keeper_test.go index 4501279d0..e60bb6962 100644 --- a/x/lend/keeper/keeper_test.go +++ b/x/lend/keeper/keeper_test.go @@ -4,12 +4,12 @@ import ( "encoding/binary" "testing" + sdkmath "cosmossdk.io/math" + "github.com/comdex-official/comdex/x/lend" - abci "github.com/cometbft/cometbft/abci/types" assettypes "github.com/comdex-official/comdex/x/asset/types" markettypes "github.com/comdex-official/comdex/x/market/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" chain "github.com/comdex-official/comdex/app" @@ -34,7 +34,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.keeper = s.app.LendKeeper s.querier = keeper.QueryServer{Keeper: s.keeper} s.msgServer = keeper.NewMsgServerImpl(s.keeper) @@ -69,12 +69,12 @@ func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, amt sdk.Coins) { s.Require().NoError(err) } -func newInt(i int64) sdk.Int { - return sdk.NewInt(i) +func newInt(i int64) sdkmath.Int { + return sdkmath.NewInt(i) } -func newDec(i string) sdk.Dec { - dec, _ := sdk.NewDecFromStr(i) +func newDec(i string) sdkmath.LegacyDec { + dec, _ := sdkmath.LegacyNewDecFromStr(i) return dec } @@ -95,7 +95,7 @@ func (s *KeeperTestSuite) CreateNewAsset(name, denom string, _ uint64) uint64 { err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, }) @@ -180,7 +180,7 @@ func (s *KeeperTestSuite) CreateNewPool(moduleName, cPoolName string, assetData return poolID } -func (s *KeeperTestSuite) AddAssetRatesStats(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64) uint64 { +func (s *KeeperTestSuite) AddAssetRatesStats(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdkmath.LegacyDec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdkmath.LegacyDec, CAssetID uint64) uint64 { err := s.app.LendKeeper.AddAssetRatesParams(s.ctx, types.AssetRatesParams{ AssetID: AssetID, UOptimal: UOptimal, @@ -236,7 +236,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName, shortName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: shortName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -257,7 +257,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName, shortName string) uint64 { return appID } -func (s *KeeperTestSuite) AddAssetRatesPoolPairs(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64, moduleName, cPoolName string, assetData []*types.AssetDataPoolMapping, MinUsdValueLeft uint64, IsIsolated bool) uint64 { +func (s *KeeperTestSuite) AddAssetRatesPoolPairs(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdkmath.LegacyDec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdkmath.LegacyDec, CAssetID uint64, moduleName, cPoolName string, assetData []*types.AssetDataPoolMapping, MinUsdValueLeft uint64, IsIsolated bool) uint64 { err := s.app.LendKeeper.AddAssetRatesPoolPairs(s.ctx, types.AssetRatesPoolPairs{ AssetID: AssetID, UOptimal: UOptimal, @@ -295,11 +295,6 @@ func (s *KeeperTestSuite) PoolDepreciate(individualPool []types.IndividualPoolDe } func (s *KeeperTestSuite) nextBlock() { - lend.BeginBlocker(s.ctx, abci.RequestBeginBlock{ - Hash: nil, - Header: tmproto.Header{}, - LastCommitInfo: abci.CommitInfo{}, - ByzantineValidators: nil, - }, s.keeper) + lend.BeginBlocker(s.ctx, s.keeper) } diff --git a/x/lend/keeper/lend.go b/x/lend/keeper/lend.go index f8af87eb7..d78b3fcb3 100644 --- a/x/lend/keeper/lend.go +++ b/x/lend/keeper/lend.go @@ -3,6 +3,8 @@ package keeper import ( "sort" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -67,10 +69,10 @@ func (k Keeper) GetLend(ctx sdk.Context, id uint64) (lend types.LendAsset, found func (k Keeper) GetAllLend(ctx sdk.Context) (lendAsset []types.LendAsset) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LendUserPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LendUserPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -161,10 +163,10 @@ func (k Keeper) DeletePool(ctx sdk.Context, id uint64) { func (k Keeper) GetPools(ctx sdk.Context) (pools []types.Pool) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.PoolKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.PoolKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -208,10 +210,10 @@ func (k Keeper) GetAssetToPair(ctx sdk.Context, assetID, poolID uint64) (assetTo func (k Keeper) GetAllAssetToPair(ctx sdk.Context) (assetToPairMapping []types.AssetToPairMapping) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AssetToPairMappingKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AssetToPairMappingKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -254,10 +256,10 @@ func (k Keeper) GetAssetStatsByPoolIDAndAssetID(ctx sdk.Context, poolID, assetID func (k Keeper) GetAllAssetStatsByPoolIDAndAssetID(ctx sdk.Context) (assetStats []types.PoolAssetLBMapping) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AssetStatsByPoolIDAndAssetIDKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AssetStatsByPoolIDAndAssetIDKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -308,10 +310,10 @@ func (k Keeper) GetLendRewardTracker(ctx sdk.Context, id uint64) (rewards types. func (k Keeper) GetAllLendRewardTracker(ctx sdk.Context) (rewards []types.LendRewardsTracker) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LendRewardsTrackerKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LendRewardsTrackerKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -355,10 +357,10 @@ func (k Keeper) GetUserTotalMappingData(ctx sdk.Context, address string) (mappin var ( store = k.Store(ctx) key = types.UserLendBorrowKey(address) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -378,10 +380,10 @@ func (k Keeper) GetAllUserTotalMappingData(ctx sdk.Context) (mappingData []types var ( store = k.Store(ctx) key = types.UserLendBorrowMappingKeyPrefix - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -470,10 +472,10 @@ func (k Keeper) GetReserveBuybackAssetData(ctx sdk.Context, id uint64) (reserve func (k Keeper) GetAllReserveBuybackAssetData(ctx sdk.Context) (reserve []types.ReserveBuybackAssetData) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.ReserveBuybackAssetDataKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.ReserveBuybackAssetDataKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -558,10 +560,10 @@ func (k Keeper) GetFundModBal(ctx sdk.Context) (modBal types.ModBal, found bool) func (k Keeper) GetAllFundModBal(ctx sdk.Context) (modBal types.ModBal) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.KeyFundModBal) + iter = storetypes.KVStorePrefixIterator(store, types.KeyFundModBal) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -600,10 +602,10 @@ func (k Keeper) GetFundReserveBal(ctx sdk.Context) (resBal types.ReserveBal, fou func (k Keeper) GetAllFundReserveBal(ctx sdk.Context) (resBal types.ReserveBal) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.KeyFundReserveBal) + iter = storetypes.KVStorePrefixIterator(store, types.KeyFundReserveBal) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -642,10 +644,10 @@ func (k Keeper) GetAllReserveStatsByAssetID(ctx sdk.Context, id uint64) (allRese func (k Keeper) GetTotalReserveStatsByAssetID(ctx sdk.Context) (reserve []types.AllReserveStats) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AllReserveStatsPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AllReserveStatsPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/lend/keeper/maths.go b/x/lend/keeper/maths.go index db8edfe84..e5553db45 100644 --- a/x/lend/keeper/maths.go +++ b/x/lend/keeper/maths.go @@ -1,34 +1,35 @@ package keeper import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/lend/types" ) -func (k Keeper) GetUtilisationRatioByPoolIDAndAssetID(ctx sdk.Context, poolID, assetID uint64) (sdk.Dec, error) { +func (k Keeper) GetUtilisationRatioByPoolIDAndAssetID(ctx sdk.Context, poolID, assetID uint64) (sdkmath.LegacyDec, error) { pool, _ := k.GetPool(ctx, poolID) asset, _ := k.Asset.GetAsset(ctx, assetID) moduleBalance := k.ModuleBalance(ctx, pool.ModuleName, asset.Denom) assetStats, found := k.GetAssetStatsByPoolIDAndAssetID(ctx, poolID, assetID) if !found { - return sdk.ZeroDec(), types.ErrAssetStatsNotFound + return sdkmath.LegacyZeroDec(), types.ErrAssetStatsNotFound } - if sdk.NewDecFromInt(moduleBalance).Add(sdk.NewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed))).IsZero() { - return sdk.ZeroDec(), nil + if sdkmath.LegacyNewDecFromInt(moduleBalance).Add(sdkmath.LegacyNewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed))).IsZero() { + return sdkmath.LegacyZeroDec(), nil } - utilizationRatio := (sdk.NewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed))).Quo(sdk.NewDecFromInt(moduleBalance).Add(sdk.NewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed)))) + utilizationRatio := (sdkmath.LegacyNewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed))).Quo(sdkmath.LegacyNewDecFromInt(moduleBalance).Add(sdkmath.LegacyNewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed)))) return utilizationRatio, nil } -func (k Keeper) GetBorrowAPRByAssetID(ctx sdk.Context, poolID, assetID uint64, IsStableBorrow bool) (borrowAPY sdk.Dec, err error) { +func (k Keeper) GetBorrowAPRByAssetID(ctx sdk.Context, poolID, assetID uint64, IsStableBorrow bool) (borrowAPY sdkmath.LegacyDec, err error) { assetRatesStats, found := k.GetAssetRatesParams(ctx, assetID) if !found { - return sdk.ZeroDec(), types.ErrorAssetStatsNotFound + return sdkmath.LegacyZeroDec(), types.ErrorAssetStatsNotFound } currentUtilisationRatio, err := k.GetUtilisationRatioByPoolIDAndAssetID(ctx, poolID, assetID) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } // for normal borrow if !IsStableBorrow { @@ -39,7 +40,7 @@ func (k Keeper) GetBorrowAPRByAssetID(ctx sdk.Context, poolID, assetID uint64, I return borrowAPY, nil } utilisationNumerator := currentUtilisationRatio.Sub(assetRatesStats.UOptimal) - utilisationDenominator := sdk.OneDec().Sub(assetRatesStats.UOptimal) + utilisationDenominator := sdkmath.LegacyOneDec().Sub(assetRatesStats.UOptimal) utilisationRatio := utilisationNumerator.Quo(utilisationDenominator) multiplicationFactor := utilisationRatio.Mul(assetRatesStats.Slope2) borrowAPY = assetRatesStats.Base.Add(assetRatesStats.Slope1).Add(multiplicationFactor) @@ -52,78 +53,78 @@ func (k Keeper) GetBorrowAPRByAssetID(ctx sdk.Context, poolID, assetID uint64, I return borrowAPY, nil } utilisationNumerator := currentUtilisationRatio.Sub(assetRatesStats.UOptimal) - utilisationDenominator := sdk.OneDec().Sub(assetRatesStats.UOptimal) + utilisationDenominator := sdkmath.LegacyOneDec().Sub(assetRatesStats.UOptimal) utilisationRatio := utilisationNumerator.Quo(utilisationDenominator) multiplicationFactor := utilisationRatio.Mul(assetRatesStats.StableSlope2) borrowAPY = assetRatesStats.StableBase.Add(assetRatesStats.StableSlope1).Add(multiplicationFactor) return borrowAPY, nil } -func (k Keeper) GetLendAPRByAssetIDAndPoolID(ctx sdk.Context, poolID, assetID uint64) (lendAPY sdk.Dec, err error) { +func (k Keeper) GetLendAPRByAssetIDAndPoolID(ctx sdk.Context, poolID, assetID uint64) (lendAPY sdkmath.LegacyDec, err error) { assetRatesStats, found := k.GetAssetRatesParams(ctx, assetID) if !found { - return sdk.ZeroDec(), types.ErrorAssetStatsNotFound + return sdkmath.LegacyZeroDec(), types.ErrorAssetStatsNotFound } borrowAPY, err := k.GetBorrowAPRByAssetID(ctx, poolID, assetID, false) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } currentUtilisationRatio, err := k.GetUtilisationRatioByPoolIDAndAssetID(ctx, poolID, assetID) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } - mulFactor := sdk.OneDec().Sub(assetRatesStats.ReserveFactor) + mulFactor := sdkmath.LegacyOneDec().Sub(assetRatesStats.ReserveFactor) lendAPY = borrowAPY.Mul(currentUtilisationRatio).Mul(mulFactor) return lendAPY, nil } -func (k Keeper) GetAverageBorrowRate(ctx sdk.Context, poolID, assetID uint64) (sdk.Dec, error) { +func (k Keeper) GetAverageBorrowRate(ctx sdk.Context, poolID, assetID uint64) (sdkmath.LegacyDec, error) { assetStats, _ := k.UpdateAPR(ctx, poolID, assetID) - factor1 := assetStats.BorrowApr.Mul(sdk.NewDecFromInt(assetStats.TotalBorrowed)) - factor2 := assetStats.StableBorrowApr.Mul(sdk.NewDecFromInt(assetStats.TotalStableBorrowed)) + factor1 := assetStats.BorrowApr.Mul(sdkmath.LegacyNewDecFromInt(assetStats.TotalBorrowed)) + factor2 := assetStats.StableBorrowApr.Mul(sdkmath.LegacyNewDecFromInt(assetStats.TotalStableBorrowed)) numerator := factor1.Add(factor2) - denominator := sdk.NewDecFromInt(assetStats.TotalStableBorrowed.Add(assetStats.TotalBorrowed)) + denominator := sdkmath.LegacyNewDecFromInt(assetStats.TotalStableBorrowed.Add(assetStats.TotalBorrowed)) - if denominator.LTE(sdk.ZeroDec()) { - return sdk.ZeroDec(), types.ErrAverageBorrowRate + if denominator.LTE(sdkmath.LegacyZeroDec()) { + return sdkmath.LegacyZeroDec(), types.ErrAverageBorrowRate } averageBorrowRate := numerator.Quo(denominator) return averageBorrowRate, nil } -func (k Keeper) GetSavingRate(ctx sdk.Context, poolID, assetID uint64) (savingRate sdk.Dec, err error) { +func (k Keeper) GetSavingRate(ctx sdk.Context, poolID, assetID uint64) (savingRate sdkmath.LegacyDec, err error) { assetRatesStats, found := k.GetAssetRatesParams(ctx, assetID) if !found { - return sdk.ZeroDec(), types.ErrorAssetRatesParamsNotFound + return sdkmath.LegacyZeroDec(), types.ErrorAssetRatesParamsNotFound } averageBorrowRate, err := k.GetAverageBorrowRate(ctx, poolID, assetID) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } utilizationRatio, err := k.GetUtilisationRatioByPoolIDAndAssetID(ctx, poolID, assetID) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } - factor1 := sdk.OneDec().Sub(assetRatesStats.ReserveFactor) + factor1 := sdkmath.LegacyOneDec().Sub(assetRatesStats.ReserveFactor) savingRate = averageBorrowRate.Mul(utilizationRatio).Mul(factor1) return savingRate, nil } -func (k Keeper) GetReserveRate(ctx sdk.Context, poolID, assetID uint64) (reserveRate sdk.Dec, err error) { +func (k Keeper) GetReserveRate(ctx sdk.Context, poolID, assetID uint64) (reserveRate sdkmath.LegacyDec, err error) { averageBorrowRate, err := k.GetAverageBorrowRate(ctx, poolID, assetID) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } savingRate, err := k.GetSavingRate(ctx, poolID, assetID) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } - if averageBorrowRate != sdk.ZeroDec() { + if averageBorrowRate != sdkmath.LegacyZeroDec() { reserveRate = averageBorrowRate.Sub(savingRate) return reserveRate, nil } - return sdk.ZeroDec(), nil + return sdkmath.LegacyZeroDec(), nil } func (k Keeper) UpdateAPR(ctx sdk.Context, poolID, assetID uint64) (PoolAssetLBData types.PoolAssetLBMapping, found bool) { diff --git a/x/lend/keeper/migrate.go b/x/lend/keeper/migrate.go index 5f8699578..fdef3182d 100644 --- a/x/lend/keeper/migrate.go +++ b/x/lend/keeper/migrate.go @@ -1,10 +1,11 @@ package keeper import ( + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" migrationtypes "github.com/comdex-official/comdex/x/lend/migrations/v2/types" "github.com/comdex-official/comdex/x/lend/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -47,7 +48,7 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar return err } -func MigrateModBal(store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateModBal(store storetypes.KVStore, cdc codec.BinaryCodec) error { key := types.KeyFundModBal value := store.Get(key) var modBal types.ModBal @@ -59,7 +60,7 @@ func MigrateModBal(store sdk.KVStore, cdc codec.BinaryCodec) error { return nil } -func SetModBal(store sdk.KVStore, cdc codec.BinaryCodec, modBal types.ModBal) { +func SetModBal(store storetypes.KVStore, cdc codec.BinaryCodec, modBal types.ModBal) { var ( key = types.KeyFundModBal value = cdc.MustMarshal(&modBal) @@ -68,7 +69,7 @@ func SetModBal(store sdk.KVStore, cdc codec.BinaryCodec, modBal types.ModBal) { store.Set(key, value) } -func MigrateResBal(store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateResBal(store storetypes.KVStore, cdc codec.BinaryCodec) error { key := types.KeyFundReserveBal value := store.Get(key) var resBal types.ReserveBal @@ -80,7 +81,7 @@ func MigrateResBal(store sdk.KVStore, cdc codec.BinaryCodec) error { return nil } -func SetResBal(store sdk.KVStore, cdc codec.BinaryCodec, resBal types.ReserveBal) { +func SetResBal(store storetypes.KVStore, cdc codec.BinaryCodec, resBal types.ReserveBal) { var ( key = types.KeyFundReserveBal value = cdc.MustMarshal(&resBal) @@ -89,7 +90,7 @@ func SetResBal(store sdk.KVStore, cdc codec.BinaryCodec, resBal types.ReserveBal store.Set(key, value) } -func MigrateResStats(store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateResStats(store storetypes.KVStore, cdc codec.BinaryCodec) error { key1 := types.AllReserveStatsKey(1) value1 := store.Get(key1) var allReserveStats1 types.AllReserveStats @@ -114,7 +115,7 @@ func MigrateResStats(store sdk.KVStore, cdc codec.BinaryCodec) error { return nil } -func SetResStats(store sdk.KVStore, cdc codec.BinaryCodec, allReserveStats types.AllReserveStats) { +func SetResStats(store storetypes.KVStore, cdc codec.BinaryCodec, allReserveStats types.AllReserveStats) { var ( key = types.AllReserveStatsKey(allReserveStats.AssetID) value = cdc.MustMarshal(&allReserveStats) @@ -146,9 +147,9 @@ func MigrateStoreV2(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Bin return err } -func MigrateLendPairs(store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateLendPairs(store storetypes.KVStore, cdc codec.BinaryCodec) error { - iterator := store.Iterator(types.LendPairKeyPrefix, sdk.PrefixEndBytes(types.LendPairKeyPrefix)) + iterator := store.Iterator(types.LendPairKeyPrefix, storetypes.PrefixEndBytes(types.LendPairKeyPrefix)) defer func(iterator storetypes.Iterator) { err := iterator.Close() if err != nil { @@ -171,7 +172,7 @@ func MigrateLendPairs(store sdk.KVStore, cdc codec.BinaryCodec) error { return nil } -func SetLendPairs(store sdk.KVStore, cdc codec.BinaryCodec, pair migrationtypes.Extended_Pair_Old) { +func SetLendPairs(store storetypes.KVStore, cdc codec.BinaryCodec, pair migrationtypes.Extended_Pair_Old) { newPair := types.Extended_Pair{ Id: pair.Id, AssetIn: pair.AssetIn, @@ -190,9 +191,9 @@ func SetLendPairs(store sdk.KVStore, cdc codec.BinaryCodec, pair migrationtypes. store.Set(key, value) } -func MigrateAssetRatesParams(store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateAssetRatesParams(store storetypes.KVStore, cdc codec.BinaryCodec) error { - iterator := store.Iterator(types.AssetRatesParamsKeyPrefix, sdk.PrefixEndBytes(types.AssetRatesParamsKeyPrefix)) + iterator := store.Iterator(types.AssetRatesParamsKeyPrefix, storetypes.PrefixEndBytes(types.AssetRatesParamsKeyPrefix)) defer func(iterator storetypes.Iterator) { err := iterator.Close() if err != nil { @@ -215,7 +216,7 @@ func MigrateAssetRatesParams(store sdk.KVStore, cdc codec.BinaryCodec) error { return nil } -func SetAssetRatesParams(store sdk.KVStore, cdc codec.BinaryCodec, assetRatesParams migrationtypes.AssetRatesParams_Old) { +func SetAssetRatesParams(store storetypes.KVStore, cdc codec.BinaryCodec, assetRatesParams migrationtypes.AssetRatesParams_Old) { newAssetRatesParams := types.AssetRatesParams{ AssetID: assetRatesParams.AssetID, UOptimal: assetRatesParams.UOptimal, @@ -233,9 +234,9 @@ func SetAssetRatesParams(store sdk.KVStore, cdc codec.BinaryCodec, assetRatesPar ReserveFactor: assetRatesParams.ReserveFactor, CAssetID: assetRatesParams.CAssetID, IsIsolated: false, - ELtv: sdk.NewDec(0), - ELiquidationThreshold: sdk.NewDec(0), - ELiquidationPenalty: sdk.NewDec(0), + ELtv: sdkmath.LegacyNewDec(0), + ELiquidationThreshold: sdkmath.LegacyNewDec(0), + ELiquidationPenalty: sdkmath.LegacyNewDec(0), } var ( diff --git a/x/lend/keeper/msg_server_test.go b/x/lend/keeper/msg_server_test.go index cd0e7fe63..a14b08662 100644 --- a/x/lend/keeper/msg_server_test.go +++ b/x/lend/keeper/msg_server_test.go @@ -2,14 +2,17 @@ package keeper_test import ( "fmt" + "time" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + utils "github.com/comdex-official/comdex/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/pkg/errors" - "time" "github.com/comdex-official/comdex/x/lend/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func (s *KeeperTestSuite) TestMsgLend() { @@ -29,22 +32,22 @@ func (s *KeeperTestSuite) TestMsgLend() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) assetDataPoolTwo = append(assetDataPoolTwo, assetDataPoolTwoAssetFour, assetDataPoolOneAssetOne, assetDataPoolOneAssetThree) @@ -122,7 +125,7 @@ func (s *KeeperTestSuite) TestMsgLend() { }{ { Name: "asset does not exist", - Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 10, sdk.NewCoin("uasset1", sdk.NewInt(100)), poolOneID, 1), + Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 10, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), poolOneID, 1), ExpErr: types.ErrorAssetDoesNotExist, ExpResp: nil, QueryResponseIndex: 0, @@ -131,7 +134,7 @@ func (s *KeeperTestSuite) TestMsgLend() { }, { Name: "Pool Not Found", - Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), 3, 1), + Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), 3, 1), ExpErr: types.ErrPoolNotFound, ExpResp: nil, QueryResponseIndex: 0, @@ -140,7 +143,7 @@ func (s *KeeperTestSuite) TestMsgLend() { }, { Name: "App Mapping Id does not exists", - Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), poolOneID, 10), + Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), poolOneID, 10), ExpErr: types.ErrorAppMappingDoesNotExist, ExpResp: nil, QueryResponseIndex: 0, @@ -149,7 +152,7 @@ func (s *KeeperTestSuite) TestMsgLend() { }, { Name: "App Mapping Id mismatch, use the correct App Mapping ID in request", - Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), poolOneID, appTwoID), + Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), poolOneID, appTwoID), ExpErr: types.ErrorAppMappingIDMismatch, ExpResp: nil, QueryResponseIndex: 0, @@ -158,8 +161,8 @@ func (s *KeeperTestSuite) TestMsgLend() { }, { Name: "invalid offer coin amount", - Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset2", sdk.NewInt(100)), poolOneID, appOneID), - ExpErr: sdkerrors.Wrapf(types.ErrBadOfferCoinAmount, "uasset2"), + Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset2", sdkmath.NewInt(100)), poolOneID, appOneID), + ExpErr: errorsmod.Wrapf(types.ErrBadOfferCoinAmount, "uasset2"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -167,8 +170,8 @@ func (s *KeeperTestSuite) TestMsgLend() { }, { Name: "Asset Id not defined in the pool", - Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetFourID, sdk.NewCoin("uasset4", sdk.NewInt(100)), poolOneID, appOneID), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAssetIDForPool, "4"), + Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetFourID, sdk.NewCoin("uasset4", sdkmath.NewInt(100)), poolOneID, appOneID), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAssetIDForPool, "4"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -176,8 +179,8 @@ func (s *KeeperTestSuite) TestMsgLend() { }, { Name: "Asset Rates Stats not found", - Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetFourID, sdk.NewCoin("uasset4", sdk.NewInt(100)), poolTwoID, appOneID), - ExpErr: sdkerrors.Wrapf(types.ErrorAssetRatesParamsNotFound, "4"), + Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetFourID, sdk.NewCoin("uasset4", sdkmath.NewInt(100)), poolTwoID, appOneID), + ExpErr: errorsmod.Wrapf(types.ErrorAssetRatesParamsNotFound, "4"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -185,7 +188,7 @@ func (s *KeeperTestSuite) TestMsgLend() { }, { Name: "success valid case", - Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), poolTwoID, appOneID), + Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), poolTwoID, appOneID), ExpErr: nil, ExpResp: &types.MsgLendResponse{}, QueryResponseIndex: 0, @@ -194,9 +197,9 @@ func (s *KeeperTestSuite) TestMsgLend() { AssetID: assetOneID, PoolID: poolTwoID, Owner: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - AmountIn: sdk.NewCoin("uasset1", sdk.NewInt(100)), + AmountIn: sdk.NewCoin("uasset1", sdkmath.NewInt(100)), LendingTime: time.Time{}, - AvailableToBorrow: sdk.NewInt(100), + AvailableToBorrow: sdkmath.NewInt(100), AppID: appOneID, CPoolName: "OSMO-ATOM-CMST", }, @@ -204,7 +207,7 @@ func (s *KeeperTestSuite) TestMsgLend() { }, { Name: "success valid case", - Msg: *types.NewMsgLend("cosmos14edpcw6ptcqd2vct9rkjf7lgyvrlwdtd0rqrtx", assetTwoID, sdk.NewCoin("uasset2", sdk.NewInt(100)), poolOneID, appOneID), + Msg: *types.NewMsgLend("cosmos14edpcw6ptcqd2vct9rkjf7lgyvrlwdtd0rqrtx", assetTwoID, sdk.NewCoin("uasset2", sdkmath.NewInt(100)), poolOneID, appOneID), ExpErr: nil, ExpResp: &types.MsgLendResponse{}, QueryResponseIndex: 0, @@ -213,9 +216,9 @@ func (s *KeeperTestSuite) TestMsgLend() { AssetID: assetOneID, PoolID: poolOneID, Owner: "cosmos14edpcw6ptcqd2vct9rkjf7lgyvrlwdtd0rqrtx", - AmountIn: sdk.NewCoin("uasset1", sdk.NewInt(100)), + AmountIn: sdk.NewCoin("uasset1", sdkmath.NewInt(100)), LendingTime: time.Time{}, - AvailableToBorrow: sdk.NewInt(100), + AvailableToBorrow: sdkmath.NewInt(100), AppID: appOneID, CPoolName: "OSMO-ATOM-CMST", }, @@ -223,7 +226,7 @@ func (s *KeeperTestSuite) TestMsgLend() { }, //{ // Name: "Duplicate lend Position", - // Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), poolOneID, appOneID), + // Msg: *types.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), poolOneID, appOneID), // ExpErr: types.ErrorDuplicateLend, // ExpResp: nil, // QueryResponseIndex: 0, @@ -274,22 +277,22 @@ func (s *KeeperTestSuite) TestMsgWithdraw() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -350,7 +353,7 @@ func (s *KeeperTestSuite) TestMsgWithdraw() { }{ { Name: "Lend Position not found", - Msg: *types.NewMsgWithdraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 3, sdk.NewCoin("uasset1", sdk.NewInt(100))), + Msg: *types.NewMsgWithdraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 3, sdk.NewCoin("uasset1", sdkmath.NewInt(100))), ExpErr: types.ErrLendNotFound, ExpResp: nil, QueryResponseIndex: 0, @@ -358,15 +361,15 @@ func (s *KeeperTestSuite) TestMsgWithdraw() { }, { Name: "invalid offer coin amount", - Msg: *types.NewMsgWithdraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset2", sdk.NewInt(10))), - ExpErr: sdkerrors.Wrap(types.ErrBadOfferCoinAmount, "uasset2"), + Msg: *types.NewMsgWithdraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset2", sdkmath.NewInt(10))), + ExpErr: errorsmod.Wrap(types.ErrBadOfferCoinAmount, "uasset2"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, }, { Name: "Withdraw Amount Limit Exceeded", - Msg: *types.NewMsgWithdraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset1", sdk.NewInt(101))), + Msg: *types.NewMsgWithdraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset1", sdkmath.NewInt(101))), ExpErr: types.ErrWithdrawAmountLimitExceeds, ExpResp: nil, QueryResponseIndex: 0, @@ -374,14 +377,14 @@ func (s *KeeperTestSuite) TestMsgWithdraw() { }, { Name: "success valid case", - Msg: *types.NewMsgWithdraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset1", sdk.NewInt(10))), + Msg: *types.NewMsgWithdraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset1", sdkmath.NewInt(10))), ExpErr: nil, ExpResp: &types.MsgWithdrawResponse{}, QueryResponseIndex: 0, QueryResponse: &types.MsgWithdraw{ Lender: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", LendId: 1, - Amount: sdk.NewCoin("uasset1", sdk.NewInt(10)), + Amount: sdk.NewCoin("uasset1", sdkmath.NewInt(10)), }, AvailableBalance: sdk.NewCoins(sdk.NewCoin("uasset1", newInt(10)), sdk.NewCoin("ucasset1", newInt(90)), sdk.NewCoin("ucasset2", newInt(100))), }, @@ -406,7 +409,7 @@ func (s *KeeperTestSuite) TestMsgWithdraw() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Lender)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) } }) } @@ -429,22 +432,22 @@ func (s *KeeperTestSuite) TestMsgDeposit() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -502,7 +505,7 @@ func (s *KeeperTestSuite) TestMsgDeposit() { }{ { Name: "Lend Position not found", - Msg: *types.NewMsgDeposit("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 2, sdk.NewCoin("uasset1", sdk.NewInt(100))), + Msg: *types.NewMsgDeposit("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 2, sdk.NewCoin("uasset1", sdkmath.NewInt(100))), ExpErr: types.ErrLendNotFound, ExpResp: nil, QueryResponseIndex: 0, @@ -511,8 +514,8 @@ func (s *KeeperTestSuite) TestMsgDeposit() { }, { Name: "invalid offer coin amount", - Msg: *types.NewMsgDeposit("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset2", sdk.NewInt(100))), - ExpErr: sdkerrors.Wrap(types.ErrBadOfferCoinAmount, "uasset2"), + Msg: *types.NewMsgDeposit("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset2", sdkmath.NewInt(100))), + ExpErr: errorsmod.Wrap(types.ErrBadOfferCoinAmount, "uasset2"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -520,14 +523,14 @@ func (s *KeeperTestSuite) TestMsgDeposit() { }, { Name: "success valid case", - Msg: *types.NewMsgDeposit("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset1", sdk.NewInt(10))), + Msg: *types.NewMsgDeposit("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset1", sdkmath.NewInt(10))), ExpErr: nil, ExpResp: &types.MsgDepositResponse{}, QueryResponseIndex: 0, QueryResponse: &types.MsgDeposit{ Lender: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", LendId: 1, - Amount: sdk.NewCoin("uasset2", sdk.NewInt(10)), + Amount: sdk.NewCoin("uasset2", sdkmath.NewInt(10)), }, // AvailableBalance: sdk.NewCoins(sdk.NewCoin("ucasset1", newInt(90))), }, @@ -575,22 +578,22 @@ func (s *KeeperTestSuite) TestMsgCloseLend() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -673,7 +676,7 @@ func (s *KeeperTestSuite) TestMsgCloseLend() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Lender), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(100)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Lender), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(100)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -711,22 +714,22 @@ func (s *KeeperTestSuite) TestMsgBorrow() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -851,7 +854,7 @@ func (s *KeeperTestSuite) TestMsgBorrow() { { Name: "Stable Borrow Rate Not Enabled for This Asset", Msg: *types.NewMsgBorrow("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 4, true, sdk.NewCoin("ucasset1", newInt(100)), sdk.NewCoin("uasset3", newInt(10))), - ExpErr: sdkerrors.Wrap(types.ErrStableBorrowDisabled, "10uasset3"), + ExpErr: errorsmod.Wrap(types.ErrStableBorrowDisabled, "10uasset3"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -945,8 +948,8 @@ func (s *KeeperTestSuite) TestMsgBorrow() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -984,22 +987,22 @@ func (s *KeeperTestSuite) TestMsgRepay() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) assetDataPoolTwo = append(assetDataPoolOne, assetDataPoolTwoAssetFour, assetDataPoolOneAssetOne, assetDataPoolOneAssetThree) @@ -1143,8 +1146,8 @@ func (s *KeeperTestSuite) TestMsgRepay() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -1182,22 +1185,22 @@ func (s *KeeperTestSuite) TestMsgDepositBorrow() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) assetDataPoolTwo = append(assetDataPoolOne, assetDataPoolTwoAssetFour, assetDataPoolOneAssetOne, assetDataPoolOneAssetThree) @@ -1288,7 +1291,7 @@ func (s *KeeperTestSuite) TestMsgDepositBorrow() { { Name: "invalid offer coin amount", Msg: *types.NewMsgDepositBorrow("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset3", newInt(100))), - ExpErr: sdkerrors.Wrap(types.ErrBadOfferCoinAmount, "uasset3"), + ExpErr: errorsmod.Wrap(types.ErrBadOfferCoinAmount, "uasset3"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -1335,8 +1338,8 @@ func (s *KeeperTestSuite) TestMsgDepositBorrow() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -1374,22 +1377,22 @@ func (s *KeeperTestSuite) TestMsgDraw() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -1512,8 +1515,8 @@ func (s *KeeperTestSuite) TestMsgDraw() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -1551,22 +1554,22 @@ func (s *KeeperTestSuite) TestMsgCloseBorrow() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -1693,8 +1696,8 @@ func (s *KeeperTestSuite) TestMsgCloseBorrow() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -1732,22 +1735,22 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -1822,7 +1825,7 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { }{ { Name: "asset does not exist", - Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 10, poolOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), pairOneID, false, sdk.NewCoin("uasset1", sdk.NewInt(100)), appOneID), + Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 10, poolOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), pairOneID, false, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), appOneID), ExpErr: types.ErrorAssetDoesNotExist, ExpResp: nil, QueryResponseIndex: 0, @@ -1831,7 +1834,7 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { }, { Name: "Pool Not Found", - Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, 3, sdk.NewCoin("uasset1", sdk.NewInt(100)), pairOneID, false, sdk.NewCoin("uasset1", sdk.NewInt(100)), appOneID), + Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, 3, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), pairOneID, false, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), appOneID), ExpErr: types.ErrPoolNotFound, ExpResp: nil, QueryResponseIndex: 0, @@ -1840,7 +1843,7 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { }, { Name: "App Mapping Id does not exists", - Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, poolOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), pairOneID, false, sdk.NewCoin("uasset1", sdk.NewInt(100)), 3), + Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, poolOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), pairOneID, false, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), 3), ExpErr: types.ErrorAppMappingDoesNotExist, ExpResp: nil, QueryResponseIndex: 0, @@ -1849,7 +1852,7 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { }, { Name: "App Mapping Id mismatch, use the correct App Mapping ID in request", - Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, poolOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), pairThreeID, false, sdk.NewCoin("uasset2", sdk.NewInt(10)), appTwoID), + Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, poolOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), pairThreeID, false, sdk.NewCoin("uasset2", sdkmath.NewInt(10)), appTwoID), ExpErr: types.ErrorAppMappingIDMismatch, ExpResp: nil, QueryResponseIndex: 0, @@ -1858,8 +1861,8 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { }, { Name: "invalid offer coin amount", - Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, poolOneID, sdk.NewCoin("uasset2", sdk.NewInt(100)), pairThreeID, false, sdk.NewCoin("uasset2", sdk.NewInt(10)), appOneID), - ExpErr: sdkerrors.Wrapf(types.ErrBadOfferCoinAmount, "uasset2"), + Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, poolOneID, sdk.NewCoin("uasset2", sdkmath.NewInt(100)), pairThreeID, false, sdk.NewCoin("uasset2", sdkmath.NewInt(10)), appOneID), + ExpErr: errorsmod.Wrapf(types.ErrBadOfferCoinAmount, "uasset2"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -1867,7 +1870,7 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { }, //{ // Name: "Duplicate lend Position", - // Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetThreeID, poolOneID, sdk.NewCoin("uasset3", sdk.NewInt(100)), pairFiveID, false, sdk.NewCoin("uasset2", sdk.NewInt(10)), appOneID), + // Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetThreeID, poolOneID, sdk.NewCoin("uasset3", sdkmath.NewInt(100)), pairFiveID, false, sdk.NewCoin("uasset2", sdkmath.NewInt(10)), appOneID), // ExpErr: types.ErrorDuplicateLend, // ExpResp: nil, // QueryResponseIndex: 0, @@ -1876,8 +1879,8 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { //}, { Name: "Asset Id not defined in the pool", - Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetFourID, poolOneID, sdk.NewCoin("uasset4", sdk.NewInt(100)), pairSevenID, false, sdk.NewCoin("uasset3", sdk.NewInt(10)), appOneID), - ExpErr: sdkerrors.Wrap(types.ErrInvalidAssetIDForPool, "4"), + Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetFourID, poolOneID, sdk.NewCoin("uasset4", sdkmath.NewInt(100)), pairSevenID, false, sdk.NewCoin("uasset3", sdkmath.NewInt(10)), appOneID), + ExpErr: errorsmod.Wrap(types.ErrInvalidAssetIDForPool, "4"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -1885,8 +1888,8 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { }, { Name: "Asset Rates Stats not found", - Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetFourID, poolTwoID, sdk.NewCoin("uasset4", sdk.NewInt(100)), pairSevenID, false, sdk.NewCoin("uasset3", sdk.NewInt(10)), appOneID), - ExpErr: sdkerrors.Wrap(types.ErrorAssetRatesParamsNotFound, "4"), + Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetFourID, poolTwoID, sdk.NewCoin("uasset4", sdkmath.NewInt(100)), pairSevenID, false, sdk.NewCoin("uasset3", sdkmath.NewInt(10)), appOneID), + ExpErr: errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, "4"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -1894,7 +1897,7 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { }, { Name: "success valid case", - Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, poolOneID, sdk.NewCoin("uasset1", sdk.NewInt(100)), pairThreeID, false, sdk.NewCoin("uasset2", sdk.NewInt(10)), appOneID), + Msg: *types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, poolOneID, sdk.NewCoin("uasset1", sdkmath.NewInt(100)), pairThreeID, false, sdk.NewCoin("uasset2", sdkmath.NewInt(10)), appOneID), ExpErr: nil, ExpResp: &types.MsgBorrowAlternateResponse{}, QueryResponseIndex: 0, @@ -1902,10 +1905,10 @@ func (s *KeeperTestSuite) TestMsgBorrowAlternate() { Lender: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", AssetId: assetOneID, PoolId: poolOneID, - AmountIn: sdk.NewCoin("uasset1", sdk.NewInt(100)), + AmountIn: sdk.NewCoin("uasset1", sdkmath.NewInt(100)), PairId: pairThreeID, IsStableBorrow: false, - AmountOut: sdk.NewCoin("uasset2", sdk.NewInt(10)), + AmountOut: sdk.NewCoin("uasset2", sdkmath.NewInt(10)), AppId: appOneID, }, // AvailableBalance: sdk.NewCoins(sdk.NewCoin("uasset2", newInt(90000000010))), @@ -1951,22 +1954,22 @@ func (s *KeeperTestSuite) TestMsgInitializeLend() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -2042,7 +2045,7 @@ func (s *KeeperTestSuite) TestMsgInitializeLend() { func (s *KeeperTestSuite) TestMsgCalculateInterestAndRewards() { s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-01T12:00:00Z")) s.TestMsgInitializeLend() - msg := types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, sdk.NewCoin("uasset1", sdk.NewInt(100000000)), 3, false, sdk.NewCoin("uasset2", sdk.NewInt(10000000)), 1) + msg := types.NewMsgBorrowAlternate("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, sdk.NewCoin("uasset1", sdkmath.NewInt(100000000)), 3, false, sdk.NewCoin("uasset2", sdkmath.NewInt(10000000)), 1) _, err := s.msgServer.BorrowAlternate(sdk.WrapSDKContext(s.ctx), msg) s.Require().NoError(err) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-03-01T12:00:00Z")) @@ -2082,7 +2085,7 @@ func (s *KeeperTestSuite) TestMsgCalculateInterestAndRewards() { s.Require().NotNil(resp) s.Require().Equal(tc.ExpResp, resp) borrowPos, _ := s.keeper.GetBorrow(s.ctx, 1) - if borrowPos.InterestAccumulated == sdk.ZeroDec() { + if borrowPos.InterestAccumulated == sdkmath.LegacyZeroDec() { s.Error(errors.Wrap(err, "Interest Not Calculated")) } } @@ -2107,22 +2110,22 @@ func (s *KeeperTestSuite) TestMsgBorrowForIsolatedMode() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -2215,8 +2218,8 @@ func (s *KeeperTestSuite) TestMsgBorrowForIsolatedMode() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -2251,22 +2254,22 @@ func (s *KeeperTestSuite) TestMsgBorrowForEMode() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -2353,8 +2356,8 @@ func (s *KeeperTestSuite) TestMsgBorrowForEMode() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -2389,22 +2392,22 @@ func (s *KeeperTestSuite) TestMsgRepayWithdraw() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -2473,8 +2476,8 @@ func (s *KeeperTestSuite) TestMsgRepayWithdraw() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) @@ -2488,7 +2491,7 @@ func (s *KeeperTestSuite) TestMsgRepayWithdraw() { s.Require().NotNil(resp) s.Require().Equal(tc.ExpResp, resp) lend, _ := s.keeper.GetLend(s.ctx, 1) - s.Require().Equal(lend.AmountIn.Amount, sdk.NewInt(200)) + s.Require().Equal(lend.AmountIn.Amount, sdkmath.NewInt(200)) _, found := s.keeper.GetBorrow(s.ctx, 1) s.Require().Equal(found, false) } @@ -2513,22 +2516,22 @@ func (s *KeeperTestSuite) TestMsgPoolDepreciate() { assetDataPoolOneAssetOne := &types.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &types.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &types.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &types.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -2572,7 +2575,7 @@ func (s *KeeperTestSuite) TestMsgPoolDepreciate() { }) s.PoolDepreciate(individualPool) s.AddAssetRatesPoolPairs(assetFourID, newDec("0.65"), newDec("0.002"), newDec("0.08"), newDec("1.5"), false, newDec("0.0"), newDec("0.0"), newDec("0.0"), newDec("0.6"), newDec("0.65"), newDec("0.05"), newDec("0.05"), newDec("0.2"), cAssetFourID, "osmo", "OSMO-ATOM-CMST", assetDataPoolTwo, 1000000, false) - msgDeposit := types.NewMsgDeposit("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset1", sdk.NewInt(100))) + msgDeposit := types.NewMsgDeposit("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, sdk.NewCoin("uasset1", sdkmath.NewInt(100))) msgDraw := types.NewMsgDraw("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 2, sdk.NewCoin("uasset1", newInt(1))) testCases := []struct { Name string @@ -2596,8 +2599,8 @@ func (s *KeeperTestSuite) TestMsgPoolDepreciate() { s.Run(tc.Name, func() { // add funds to acount for valid case if tc.ExpErr == nil { - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdk.NewIntFromUint64(300)))) - s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdk.NewIntFromUint64(1000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("uasset1", sdkmath.NewIntFromUint64(300)))) + s.fundAddr(sdk.MustAccAddressFromBech32(tc.Msg.Borrower), sdk.NewCoins(sdk.NewCoin("ucasset2", sdkmath.NewIntFromUint64(1000000000)))) } ctx := sdk.WrapSDKContext(s.ctx) diff --git a/x/lend/keeper/pair.go b/x/lend/keeper/pair.go index b5dedbdde..55c9d6a4a 100644 --- a/x/lend/keeper/pair.go +++ b/x/lend/keeper/pair.go @@ -1,6 +1,8 @@ package keeper import ( + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -55,25 +57,25 @@ func (k Keeper) AddPoolRecords(ctx sdk.Context, pool types.Pool) error { var assetStats types.PoolAssetLBMapping assetStats.PoolID = newPool.PoolID assetStats.AssetID = v.AssetID - assetStats.TotalBorrowed = sdk.ZeroInt() - assetStats.TotalStableBorrowed = sdk.ZeroInt() - assetStats.TotalLend = sdk.ZeroInt() - assetStats.TotalInterestAccumulated = sdk.ZeroInt() + assetStats.TotalBorrowed = sdkmath.ZeroInt() + assetStats.TotalStableBorrowed = sdkmath.ZeroInt() + assetStats.TotalLend = sdkmath.ZeroInt() + assetStats.TotalInterestAccumulated = sdkmath.ZeroInt() k.SetAssetStatsByPoolIDAndAssetID(ctx, assetStats) k.UpdateAPR(ctx, newPool.PoolID, v.AssetID) reserveBuybackStats, found := k.GetReserveBuybackAssetData(ctx, v.AssetID) if !found { reserveBuybackStats.AssetID = v.AssetID - reserveBuybackStats.ReserveAmount = sdk.ZeroInt() - reserveBuybackStats.BuybackAmount = sdk.ZeroInt() + reserveBuybackStats.ReserveAmount = sdkmath.ZeroInt() + reserveBuybackStats.BuybackAmount = sdkmath.ZeroInt() k.SetReserveBuybackAssetData(ctx, reserveBuybackStats) reserveStat := types.AllReserveStats{ AssetID: v.AssetID, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), AmountInFromRepayments: reserveBuybackStats.BuybackAmount.Add(reserveBuybackStats.ReserveAmount), - TotalAmountOutToLenders: sdk.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } k.SetAllReserveStatsByAssetID(ctx, reserveStat) } @@ -105,25 +107,25 @@ func (k Keeper) AddPoolsPairsRecords(ctx sdk.Context, pool types.PoolPairs) erro var assetStats types.PoolAssetLBMapping assetStats.PoolID = newPool.PoolID assetStats.AssetID = v.AssetID - assetStats.TotalBorrowed = sdk.ZeroInt() - assetStats.TotalStableBorrowed = sdk.ZeroInt() - assetStats.TotalLend = sdk.ZeroInt() - assetStats.TotalInterestAccumulated = sdk.ZeroInt() + assetStats.TotalBorrowed = sdkmath.ZeroInt() + assetStats.TotalStableBorrowed = sdkmath.ZeroInt() + assetStats.TotalLend = sdkmath.ZeroInt() + assetStats.TotalInterestAccumulated = sdkmath.ZeroInt() k.SetAssetStatsByPoolIDAndAssetID(ctx, assetStats) k.UpdateAPR(ctx, newPool.PoolID, v.AssetID) reserveBuybackStats, found := k.GetReserveBuybackAssetData(ctx, v.AssetID) if !found { reserveBuybackStats.AssetID = v.AssetID - reserveBuybackStats.ReserveAmount = sdk.ZeroInt() - reserveBuybackStats.BuybackAmount = sdk.ZeroInt() + reserveBuybackStats.ReserveAmount = sdkmath.ZeroInt() + reserveBuybackStats.BuybackAmount = sdkmath.ZeroInt() k.SetReserveBuybackAssetData(ctx, reserveBuybackStats) reserveStat := types.AllReserveStats{ AssetID: v.AssetID, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), AmountInFromRepayments: reserveBuybackStats.BuybackAmount.Add(reserveBuybackStats.ReserveAmount), - TotalAmountOutToLenders: sdk.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } k.SetAllReserveStatsByAssetID(ctx, reserveStat) } @@ -354,10 +356,10 @@ func (k Keeper) GetLendPair(ctx sdk.Context, id uint64) (pair types.Extended_Pai func (k Keeper) GetLendPairs(ctx sdk.Context) (pairs []types.Extended_Pair) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LendPairKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LendPairKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -445,10 +447,10 @@ func (k Keeper) GetAddAuctionParamsData(ctx sdk.Context, appID uint64) (auctionP func (k Keeper) GetAllAddAuctionParamsData(ctx sdk.Context) (auctionParams []types.AuctionParams) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AuctionParamPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AuctionParamPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -491,10 +493,10 @@ func (k Keeper) GetAssetRatesParams(ctx sdk.Context, assetID uint64) (assetRates func (k Keeper) GetAllAssetRatesParams(ctx sdk.Context) (assetRatesParams []types.AssetRatesParams) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AssetRatesParamsKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AssetRatesParamsKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/lend/keeper/rates.go b/x/lend/keeper/rates.go index e4dfc8b05..45cfc3ea5 100644 --- a/x/lend/keeper/rates.go +++ b/x/lend/keeper/rates.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -9,11 +10,11 @@ import ( func (k Keeper) VerifyCollateralizationRatio( ctx sdk.Context, - amountIn sdk.Int, + amountIn sdkmath.Int, assetIn assettypes.Asset, - amountOut sdk.Int, + amountOut sdkmath.Int, assetOut assettypes.Asset, - liquidationThreshold sdk.Dec, + liquidationThreshold sdkmath.LegacyDec, ) error { collateralizationRatio, err := k.CalculateCollateralizationRatio(ctx, amountIn, assetIn, amountOut, assetOut) if err != nil { @@ -29,18 +30,18 @@ func (k Keeper) VerifyCollateralizationRatio( func (k Keeper) CalculateCollateralizationRatio( ctx sdk.Context, - amountIn sdk.Int, + amountIn sdkmath.Int, assetIn assettypes.Asset, - amountOut sdk.Int, + amountOut sdkmath.Int, assetOut assettypes.Asset, -) (sdk.Dec, error) { +) (sdkmath.LegacyDec, error) { totalIn, err := k.Market.CalcAssetPrice(ctx, assetIn.Id, amountIn) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } totalOut, err := k.Market.CalcAssetPrice(ctx, assetOut.Id, amountOut) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } return totalOut.Quo(totalIn), nil diff --git a/x/lend/module.go b/x/lend/module.go index 0c6c1243c..963d7b819 100644 --- a/x/lend/module.go +++ b/x/lend/module.go @@ -143,6 +143,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -165,12 +171,10 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 3 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - BeginBlocker(ctx, req, am.keeper) +func (am AppModule) BeginBlock(ctx sdk.Context) { + BeginBlocker(ctx, am.keeper) } -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/lend/module_simulation.go b/x/lend/module_simulation.go index c3e147163..4e9caf602 100644 --- a/x/lend/module_simulation.go +++ b/x/lend/module_simulation.go @@ -3,7 +3,6 @@ package lend import ( "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -37,14 +36,6 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP return nil } -// RandomizedParams creates randomized param changes for the simulator. -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// return []simtypes.ParamChange{} -// } - -// RegisterStoreDecoder registers a decoder. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/lend/types/errors.go b/x/lend/types/errors.go index 965b76aef..7527aa564 100644 --- a/x/lend/types/errors.go +++ b/x/lend/types/errors.go @@ -3,52 +3,52 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrInvalidAsset = sdkerrors.Register(ModuleName, 601, "invalid asset") - ErrLendingPoolInsufficient = sdkerrors.Register(ModuleName, 602, "lending pool insufficient") - ErrInvalidRepayment = sdkerrors.Register(ModuleName, 603, "invalid repayment") - ErrNegativeTimeElapsed = sdkerrors.Register(ModuleName, 604, "negative time elapsed since last interest time") - ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 605, "unknown proposal type") - ErrorAssetDoesNotExist = sdkerrors.Register(ModuleName, 606, "asset does not exist") - ErrorPairDoesNotExist = sdkerrors.Register(ModuleName, 607, "pair does not exist") - ErrBadOfferCoinAmount = sdkerrors.Register(ModuleName, 608, "invalid offer coin amount") - ErrorDuplicateLendPair = sdkerrors.Register(ModuleName, 609, "Duplicate lend Pair") - ErrLendNotFound = sdkerrors.Register(ModuleName, 610, "Lend Position not found") - ErrLendAccessUnauthorized = sdkerrors.Register(ModuleName, 611, "Unauthorized user for the tx") - ErrorPairNotFound = sdkerrors.Register(ModuleName, 612, "Pair Not Found") - ErrorInvalidCollateralizationRatio = sdkerrors.Register(ModuleName, 613, "Error Invalid Collateralization Ratio") - ErrorDuplicateBorrow = sdkerrors.Register(ModuleName, 614, "Duplicate borrow Position") - ErrBorrowingPoolInsufficient = sdkerrors.Register(ModuleName, 615, "borrowing pool insufficient") - ErrBorrowNotFound = sdkerrors.Register(ModuleName, 616, "Borrow Position not found") - ErrBorrowingPositionOpen = sdkerrors.Register(ModuleName, 617, "borrowing position open") - ErrAssetStatsNotFound = sdkerrors.Register(ModuleName, 618, "Asset Stats Not Found") - ErrorAssetStatsNotFound = sdkerrors.Register(ModuleName, 619, "Asset Stats Not Found") - ErrInvalidAssetIDForPool = sdkerrors.Register(ModuleName, 620, "Asset Id not defined in the pool") - ErrorAssetRatesParamsNotFound = sdkerrors.Register(ModuleName, 621, "Asset Rates Params not found") - ErrPoolNotFound = sdkerrors.Register(ModuleName, 622, "Pool Not Found") - ErrAvailableToBorrowInsufficient = sdkerrors.Register(ModuleName, 623, "Available To Borrow Insufficient") - ErrStableBorrowDisabled = sdkerrors.Register(ModuleName, 624, "Stable Borrow Rate Not Enabled for This Asset") - ErrBadOfferCoinType = sdkerrors.Register(ModuleName, 625, "invalid offer coin Type") - ErrInvalidLengthCPoolName = sdkerrors.Register(ModuleName, 626, "invalid length found during unmarshaling") - ErrReserveRatesNotFound = sdkerrors.Register(ModuleName, 627, "Reserve Rates Not found") - ErrWithdrawAmountLimitExceeds = sdkerrors.Register(ModuleName, 628, "Withdraw Amount Limit Exceeded") - ErrorAppMappingDoesNotExist = sdkerrors.Register(ModuleName, 629, "App Mapping Id does not exists") - ErrBridgeAssetQtyInsufficient = sdkerrors.Register(ModuleName, 630, "Bridge Asset Qty Insufficient") - ErrAverageBorrowRate = sdkerrors.Register(ModuleName, 631, "Average Borrow Rate Error") - ErrInsufficientFunds = sdkerrors.Register(ModuleName, 632, "Insufficient Funds") - ErrorAppMappingIDMismatch = sdkerrors.Register(ModuleName, 633, "App Mapping Id mismatch, use the correct App Mapping ID in request") - ErrorAssetsCanNotBeSame = sdkerrors.Register(ModuleName, 634, "asset ID of assetIn and assetOut can not be same") - ErrorSupplyCapExceeds = sdkerrors.Register(ModuleName, 635, "Supply cap exceeds") - ErrorBorrowPosLiquidated = sdkerrors.Register(ModuleName, 636, "Borrow Position Liquidated") - ErrorInsufficientCTokensForRewards = sdkerrors.Register(ModuleName, 637, "Insufficient CTokens For Rewards in the cPool") - ErrorAssetRatesParamsAlreadyExists = sdkerrors.Register(ModuleName, 638, "Asset Rates Params already exists") - ErrorLBMappingNotFound = sdkerrors.Register(ModuleName, 639, "Asset LB Mapping Not found") - ErrInsufficientFundsInPool = sdkerrors.Register(ModuleName, 640, "Insufficient Funds in Pool") - ErrBorrowLessThanMinAmount = sdkerrors.Register(ModuleName, 641, "The Borrow amount requested is less than the min borrow limit of 1$") - ErrorEmptyProposalAssets = sdkerrors.Register(ModuleName, 642, "Empty proposal for asset") - ErrorPoolDepreciated = sdkerrors.Register(ModuleName, 643, "Pool is depreciated, lending and borrowing are restricted, users can repay and withdraw their funds") - ErrorIsolatedModeActivated = sdkerrors.Register(ModuleName, 644, "Isolated-Mode Activated for the asset, multiple borrow positions are restricted") + ErrInvalidAsset = errorsmod.Register(ModuleName, 601, "invalid asset") + ErrLendingPoolInsufficient = errorsmod.Register(ModuleName, 602, "lending pool insufficient") + ErrInvalidRepayment = errorsmod.Register(ModuleName, 603, "invalid repayment") + ErrNegativeTimeElapsed = errorsmod.Register(ModuleName, 604, "negative time elapsed since last interest time") + ErrorUnknownProposalType = errorsmod.Register(ModuleName, 605, "unknown proposal type") + ErrorAssetDoesNotExist = errorsmod.Register(ModuleName, 606, "asset does not exist") + ErrorPairDoesNotExist = errorsmod.Register(ModuleName, 607, "pair does not exist") + ErrBadOfferCoinAmount = errorsmod.Register(ModuleName, 608, "invalid offer coin amount") + ErrorDuplicateLendPair = errorsmod.Register(ModuleName, 609, "Duplicate lend Pair") + ErrLendNotFound = errorsmod.Register(ModuleName, 610, "Lend Position not found") + ErrLendAccessUnauthorized = errorsmod.Register(ModuleName, 611, "Unauthorized user for the tx") + ErrorPairNotFound = errorsmod.Register(ModuleName, 612, "Pair Not Found") + ErrorInvalidCollateralizationRatio = errorsmod.Register(ModuleName, 613, "Error Invalid Collateralization Ratio") + ErrorDuplicateBorrow = errorsmod.Register(ModuleName, 614, "Duplicate borrow Position") + ErrBorrowingPoolInsufficient = errorsmod.Register(ModuleName, 615, "borrowing pool insufficient") + ErrBorrowNotFound = errorsmod.Register(ModuleName, 616, "Borrow Position not found") + ErrBorrowingPositionOpen = errorsmod.Register(ModuleName, 617, "borrowing position open") + ErrAssetStatsNotFound = errorsmod.Register(ModuleName, 618, "Asset Stats Not Found") + ErrorAssetStatsNotFound = errorsmod.Register(ModuleName, 619, "Asset Stats Not Found") + ErrInvalidAssetIDForPool = errorsmod.Register(ModuleName, 620, "Asset Id not defined in the pool") + ErrorAssetRatesParamsNotFound = errorsmod.Register(ModuleName, 621, "Asset Rates Params not found") + ErrPoolNotFound = errorsmod.Register(ModuleName, 622, "Pool Not Found") + ErrAvailableToBorrowInsufficient = errorsmod.Register(ModuleName, 623, "Available To Borrow Insufficient") + ErrStableBorrowDisabled = errorsmod.Register(ModuleName, 624, "Stable Borrow Rate Not Enabled for This Asset") + ErrBadOfferCoinType = errorsmod.Register(ModuleName, 625, "invalid offer coin Type") + ErrInvalidLengthCPoolName = errorsmod.Register(ModuleName, 626, "invalid length found during unmarshaling") + ErrReserveRatesNotFound = errorsmod.Register(ModuleName, 627, "Reserve Rates Not found") + ErrWithdrawAmountLimitExceeds = errorsmod.Register(ModuleName, 628, "Withdraw Amount Limit Exceeded") + ErrorAppMappingDoesNotExist = errorsmod.Register(ModuleName, 629, "App Mapping Id does not exists") + ErrBridgeAssetQtyInsufficient = errorsmod.Register(ModuleName, 630, "Bridge Asset Qty Insufficient") + ErrAverageBorrowRate = errorsmod.Register(ModuleName, 631, "Average Borrow Rate Error") + ErrInsufficientFunds = errorsmod.Register(ModuleName, 632, "Insufficient Funds") + ErrorAppMappingIDMismatch = errorsmod.Register(ModuleName, 633, "App Mapping Id mismatch, use the correct App Mapping ID in request") + ErrorAssetsCanNotBeSame = errorsmod.Register(ModuleName, 634, "asset ID of assetIn and assetOut can not be same") + ErrorSupplyCapExceeds = errorsmod.Register(ModuleName, 635, "Supply cap exceeds") + ErrorBorrowPosLiquidated = errorsmod.Register(ModuleName, 636, "Borrow Position Liquidated") + ErrorInsufficientCTokensForRewards = errorsmod.Register(ModuleName, 637, "Insufficient CTokens For Rewards in the cPool") + ErrorAssetRatesParamsAlreadyExists = errorsmod.Register(ModuleName, 638, "Asset Rates Params already exists") + ErrorLBMappingNotFound = errorsmod.Register(ModuleName, 639, "Asset LB Mapping Not found") + ErrInsufficientFundsInPool = errorsmod.Register(ModuleName, 640, "Insufficient Funds in Pool") + ErrBorrowLessThanMinAmount = errorsmod.Register(ModuleName, 641, "The Borrow amount requested is less than the min borrow limit of 1$") + ErrorEmptyProposalAssets = errorsmod.Register(ModuleName, 642, "Empty proposal for asset") + ErrorPoolDepreciated = errorsmod.Register(ModuleName, 643, "Pool is depreciated, lending and borrowing are restricted, users can repay and withdraw their funds") + ErrorIsolatedModeActivated = errorsmod.Register(ModuleName, 644, "Isolated-Mode Activated for the asset, multiple borrow positions are restricted") ) diff --git a/x/lend/types/expected_keepers.go b/x/lend/types/expected_keepers.go index cbc3a5589..914960c30 100644 --- a/x/lend/types/expected_keepers.go +++ b/x/lend/types/expected_keepers.go @@ -1,18 +1,18 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias). type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } diff --git a/x/lend/types/lend.pb.go b/x/lend/types/lend.pb.go index 8e515e71d..c46ddac49 100644 --- a/x/lend/types/lend.pb.go +++ b/x/lend/types/lend.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -36,12 +37,12 @@ type LendAsset struct { Owner string `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` AmountIn github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=amount_in,json=amountIn,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"amount_in" yaml:"amount_in"` LendingTime time.Time `protobuf:"bytes,6,opt,name=lending_time,json=lendingTime,proto3,stdtime" json:"lending_time" yaml:"lending_time"` - AvailableToBorrow github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=available_to_borrow,json=availableToBorrow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"available_to_borrow" yaml:"available_to_borrow"` + AvailableToBorrow cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=available_to_borrow,json=availableToBorrow,proto3,customtype=cosmossdk.io/math.Int" json:"available_to_borrow" yaml:"available_to_borrow"` AppID uint64 `protobuf:"varint,8,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - GlobalIndex github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=global_index,json=globalIndex,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"global_index" yaml:"global_index"` + GlobalIndex cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=global_index,json=globalIndex,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"global_index" yaml:"global_index"` LastInteractionTime time.Time `protobuf:"bytes,10,opt,name=last_interaction_time,json=lastInteractionTime,proto3,stdtime" json:"last_interaction_time" yaml:"last_interaction_time"` CPoolName string `protobuf:"bytes,11,opt,name=cpool_name,json=cpoolName,proto3" json:"cpool_name,omitempty" yaml:"cpool_name"` - TotalRewards github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,12,opt,name=total_rewards,json=totalRewards,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_rewards" yaml:"total_rewards"` + TotalRewards cosmossdk_io_math.Int `protobuf:"bytes,12,opt,name=total_rewards,json=totalRewards,proto3,customtype=cosmossdk.io/math.Int" json:"total_rewards" yaml:"total_rewards"` } func (m *LendAsset) Reset() { *m = LendAsset{} } @@ -149,10 +150,10 @@ type BorrowAsset struct { AmountOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=amount_out,json=amountOut,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"amount_out" yaml:"amount_out"` BridgedAssetAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,7,opt,name=bridged_asset_amount,json=bridgedAssetAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bridged_asset_amount" yaml:"bridged_asset_amount"` BorrowingTime time.Time `protobuf:"bytes,8,opt,name=borrowing_time,json=borrowingTime,proto3,stdtime" json:"borrowing_time" yaml:"borrowing_time"` - StableBorrowRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=stable_borrow_rate,json=stableBorrowRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_borrow_rate" yaml:"stable_borrow_rate"` - InterestAccumulated github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=interest_accumulated,json=interestAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_accumulated" yaml:"interest_accumulated"` - GlobalIndex github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=global_index,json=globalIndex,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"global_index" yaml:"global_index"` - ReserveGlobalIndex github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=reserve_global_index,json=reserveGlobalIndex,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reserve_global_index" yaml:"reserve_global_index"` + StableBorrowRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=stable_borrow_rate,json=stableBorrowRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_borrow_rate" yaml:"stable_borrow_rate"` + InterestAccumulated cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=interest_accumulated,json=interestAccumulated,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"interest_accumulated" yaml:"interest_accumulated"` + GlobalIndex cosmossdk_io_math.LegacyDec `protobuf:"bytes,11,opt,name=global_index,json=globalIndex,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"global_index" yaml:"global_index"` + ReserveGlobalIndex cosmossdk_io_math.LegacyDec `protobuf:"bytes,12,opt,name=reserve_global_index,json=reserveGlobalIndex,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reserve_global_index" yaml:"reserve_global_index"` LastInteractionTime time.Time `protobuf:"bytes,13,opt,name=last_interaction_time,json=lastInteractionTime,proto3,stdtime" json:"last_interaction_time" yaml:"last_interaction_time"` CPoolName string `protobuf:"bytes,14,opt,name=cpool_name,json=cpoolName,proto3" json:"cpool_name,omitempty" yaml:"cpool_name"` IsLiquidated bool `protobuf:"varint,15,opt,name=is_liquidated,json=isLiquidated,proto3" json:"is_liquidated,omitempty" yaml:"is_liquidated"` @@ -408,8 +409,8 @@ func (m *UserAssetLendBorrowMapping) GetBorrowId() []uint64 { type AssetDataPoolMapping struct { AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` // 1 for main_asset, 2 for 1st transit_asset, 3 for 2nd transit_asset - AssetTransitType uint64 `protobuf:"varint,2,opt,name=asset_transit_type,json=assetTransitType,proto3" json:"asset_transit_type,omitempty" yaml:"asset_transit_type"` - SupplyCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=supply_cap,json=supplyCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"supply_cap" yaml:"supply_cap"` + AssetTransitType uint64 `protobuf:"varint,2,opt,name=asset_transit_type,json=assetTransitType,proto3" json:"asset_transit_type,omitempty" yaml:"asset_transit_type"` + SupplyCap cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=supply_cap,json=supplyCap,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"supply_cap" yaml:"supply_cap"` } func (m *AssetDataPoolMapping) Reset() { *m = AssetDataPoolMapping{} } @@ -612,18 +613,18 @@ func (m *AssetToPairMapping) GetPairID() []uint64 { } type PoolAssetLBMapping struct { - PoolID uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - AssetID uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - LendIds []uint64 `protobuf:"varint,3,rep,packed,name=lend_ids,json=lendIds,proto3" json:"lend_ids,omitempty" yaml:"lend_ids"` - BorrowIds []uint64 `protobuf:"varint,4,rep,packed,name=borrow_ids,json=borrowIds,proto3" json:"borrow_ids,omitempty" yaml:"borrow_ids"` - TotalBorrowed github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=total_borrowed,json=totalBorrowed,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_borrowed" yaml:"total_borrowed"` - TotalStableBorrowed github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=total_stable_borrowed,json=totalStableBorrowed,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_stable_borrowed" yaml:"total_stable_borrowed"` - TotalLend github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=total_lend,json=totalLend,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_lend" yaml:"total_lend"` - TotalInterestAccumulated github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=total_interest_accumulated,json=totalInterestAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_interest_accumulated" yaml:"total_interest_accumulated"` - LendApr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=lend_apr,json=lendApr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"lend_apr" yaml:"lend_apr"` - BorrowApr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=borrow_apr,json=borrowApr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"borrow_apr" yaml:"borrow_apr"` - StableBorrowApr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=stable_borrow_apr,json=stableBorrowApr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_borrow_apr" yaml:"stable_borrow_apr"` - UtilisationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=utilisation_ratio,json=utilisationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"utilisation_ratio" yaml:"utilisation_ratio"` + PoolID uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` + AssetID uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + LendIds []uint64 `protobuf:"varint,3,rep,packed,name=lend_ids,json=lendIds,proto3" json:"lend_ids,omitempty" yaml:"lend_ids"` + BorrowIds []uint64 `protobuf:"varint,4,rep,packed,name=borrow_ids,json=borrowIds,proto3" json:"borrow_ids,omitempty" yaml:"borrow_ids"` + TotalBorrowed cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=total_borrowed,json=totalBorrowed,proto3,customtype=cosmossdk.io/math.Int" json:"total_borrowed" yaml:"total_borrowed"` + TotalStableBorrowed cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=total_stable_borrowed,json=totalStableBorrowed,proto3,customtype=cosmossdk.io/math.Int" json:"total_stable_borrowed" yaml:"total_stable_borrowed"` + TotalLend cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=total_lend,json=totalLend,proto3,customtype=cosmossdk.io/math.Int" json:"total_lend" yaml:"total_lend"` + TotalInterestAccumulated cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=total_interest_accumulated,json=totalInterestAccumulated,proto3,customtype=cosmossdk.io/math.Int" json:"total_interest_accumulated" yaml:"total_interest_accumulated"` + LendApr cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=lend_apr,json=lendApr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"lend_apr" yaml:"lend_apr"` + BorrowApr cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=borrow_apr,json=borrowApr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"borrow_apr" yaml:"borrow_apr"` + StableBorrowApr cosmossdk_io_math.LegacyDec `protobuf:"bytes,11,opt,name=stable_borrow_apr,json=stableBorrowApr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_borrow_apr" yaml:"stable_borrow_apr"` + UtilisationRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,12,opt,name=utilisation_ratio,json=utilisationRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"utilisation_ratio" yaml:"utilisation_ratio"` } func (m *PoolAssetLBMapping) Reset() { *m = PoolAssetLBMapping{} } @@ -688,25 +689,25 @@ func (m *PoolAssetLBMapping) GetBorrowIds() []uint64 { } type AssetRatesParams struct { - AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - UOptimal github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=u_optimal,json=uOptimal,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"u_optimal" yaml:"u_optimal"` - Base github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=base,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base" yaml:"base"` - Slope1 github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slope1,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slope1" yaml:"slope1"` - Slope2 github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slope2,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slope2" yaml:"slope2"` - EnableStableBorrow bool `protobuf:"varint,6,opt,name=enable_stable_borrow,json=enableStableBorrow,proto3" json:"enable_stable_borrow,omitempty" yaml:"enable_stable_borrow"` - StableBase github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=stable_base,json=stableBase,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_base" yaml:"stable_base"` - StableSlope1 github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=stable_slope1,json=stableSlope1,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_slope1" yaml:"stable_slope1"` - StableSlope2 github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=stable_slope2,json=stableSlope2,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_slope2" yaml:"stable_slope2"` - Ltv github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=ltv,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"ltv" yaml:"ltv"` - LiquidationThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=liquidation_threshold,json=liquidationThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_threshold" yaml:"liquidation_threshold"` - LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidation_penalty"` - LiquidationBonus github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=liquidation_bonus,json=liquidationBonus,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_bonus" yaml:"liquidation_bonus"` - ReserveFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,14,opt,name=reserve_factor,json=reserveFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reserve_factor" yaml:"reserve_factor"` - CAssetID uint64 `protobuf:"varint,15,opt,name=c_asset_id,json=cAssetId,proto3" json:"c_asset_id,omitempty" yaml:"c_asset_id"` - IsIsolated bool `protobuf:"varint,16,opt,name=is_isolated,json=isIsolated,proto3" json:"is_isolated,omitempty" yaml:"is_isolated"` - ELtv github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,17,opt,name=e_ltv,json=eLtv,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"e_ltv" yaml:"e_ltv"` - ELiquidationThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,18,opt,name=e_liquidation_threshold,json=eLiquidationThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"e_liquidation_threshold" yaml:"e_liquidation_threshold"` - ELiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,19,opt,name=e_liquidation_penalty,json=eLiquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"e_liquidation_penalty" yaml:"e_liquidation_penalty"` + AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + UOptimal cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=u_optimal,json=uOptimal,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"u_optimal" yaml:"u_optimal"` + Base cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=base,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base" yaml:"base"` + Slope1 cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=slope1,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slope1" yaml:"slope1"` + Slope2 cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=slope2,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slope2" yaml:"slope2"` + EnableStableBorrow bool `protobuf:"varint,6,opt,name=enable_stable_borrow,json=enableStableBorrow,proto3" json:"enable_stable_borrow,omitempty" yaml:"enable_stable_borrow"` + StableBase cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=stable_base,json=stableBase,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_base" yaml:"stable_base"` + StableSlope1 cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=stable_slope1,json=stableSlope1,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_slope1" yaml:"stable_slope1"` + StableSlope2 cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=stable_slope2,json=stableSlope2,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_slope2" yaml:"stable_slope2"` + Ltv cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=ltv,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"ltv" yaml:"ltv"` + LiquidationThreshold cosmossdk_io_math.LegacyDec `protobuf:"bytes,11,opt,name=liquidation_threshold,json=liquidationThreshold,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_threshold" yaml:"liquidation_threshold"` + LiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,12,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_penalty" yaml:"liquidation_penalty"` + LiquidationBonus cosmossdk_io_math.LegacyDec `protobuf:"bytes,13,opt,name=liquidation_bonus,json=liquidationBonus,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_bonus" yaml:"liquidation_bonus"` + ReserveFactor cosmossdk_io_math.LegacyDec `protobuf:"bytes,14,opt,name=reserve_factor,json=reserveFactor,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reserve_factor" yaml:"reserve_factor"` + CAssetID uint64 `protobuf:"varint,15,opt,name=c_asset_id,json=cAssetId,proto3" json:"c_asset_id,omitempty" yaml:"c_asset_id"` + IsIsolated bool `protobuf:"varint,16,opt,name=is_isolated,json=isIsolated,proto3" json:"is_isolated,omitempty" yaml:"is_isolated"` + ELtv cosmossdk_io_math.LegacyDec `protobuf:"bytes,17,opt,name=e_ltv,json=eLtv,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"e_ltv" yaml:"e_ltv"` + ELiquidationThreshold cosmossdk_io_math.LegacyDec `protobuf:"bytes,18,opt,name=e_liquidation_threshold,json=eLiquidationThreshold,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"e_liquidation_threshold" yaml:"e_liquidation_threshold"` + ELiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,19,opt,name=e_liquidation_penalty,json=eLiquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"e_liquidation_penalty" yaml:"e_liquidation_penalty"` } func (m *AssetRatesParams) Reset() { *m = AssetRatesParams{} } @@ -771,9 +772,9 @@ func (m *AssetRatesParams) GetIsIsolated() bool { } type ReserveBuybackAssetData struct { - AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - ReserveAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=reserve_amount,json=reserveAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"reserve_amount" yaml:"reserve_amount"` - BuybackAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=buyback_amount,json=buybackAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"buyback_amount" yaml:"buyback_amount"` + AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + ReserveAmount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=reserve_amount,json=reserveAmount,proto3,customtype=cosmossdk.io/math.Int" json:"reserve_amount" yaml:"reserve_amount"` + BuybackAmount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=buyback_amount,json=buybackAmount,proto3,customtype=cosmossdk.io/math.Int" json:"buyback_amount" yaml:"buyback_amount"` } func (m *ReserveBuybackAssetData) Reset() { *m = ReserveBuybackAssetData{} } @@ -817,14 +818,14 @@ func (m *ReserveBuybackAssetData) GetAssetID() uint64 { } type AuctionParams struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AuctionDurationSeconds uint64 `protobuf:"varint,2,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` - Buffer github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=buffer,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"buffer" yaml:"buffer"` - Cusp github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=cusp,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cusp" yaml:"cusp"` - Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` - PriceFunctionType uint64 `protobuf:"varint,6,opt,name=price_function_type,json=priceFunctionType,proto3" json:"price_function_type,omitempty" yaml:"price_function_type"` - DutchId uint64 `protobuf:"varint,7,opt,name=dutch_id,json=dutchId,proto3" json:"dutch_id,omitempty" yaml:"dutch_id"` - BidDurationSeconds uint64 `protobuf:"varint,8,opt,name=bid_duration_seconds,json=bidDurationSeconds,proto3" json:"bid_duration_seconds,omitempty" yaml:"bid_duration_seconds"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionDurationSeconds uint64 `protobuf:"varint,2,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` + Buffer cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=buffer,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"buffer" yaml:"buffer"` + Cusp cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=cusp,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"cusp" yaml:"cusp"` + Step cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=step,proto3,customtype=cosmossdk.io/math.Int" json:"step" yaml:"step"` + PriceFunctionType uint64 `protobuf:"varint,6,opt,name=price_function_type,json=priceFunctionType,proto3" json:"price_function_type,omitempty" yaml:"price_function_type"` + DutchId uint64 `protobuf:"varint,7,opt,name=dutch_id,json=dutchId,proto3" json:"dutch_id,omitempty" yaml:"dutch_id"` + BidDurationSeconds uint64 `protobuf:"varint,8,opt,name=bid_duration_seconds,json=bidDurationSeconds,proto3" json:"bid_duration_seconds,omitempty" yaml:"bid_duration_seconds"` } func (m *AuctionParams) Reset() { *m = AuctionParams{} } @@ -896,8 +897,8 @@ func (m *AuctionParams) GetBidDurationSeconds() uint64 { } type BorrowInterestTracker struct { - BorrowingId uint64 `protobuf:"varint,1,opt,name=borrowing_id,json=borrowingId,proto3" json:"borrowing_id,omitempty" yaml:"borrowing_id"` - ReservePoolInterest github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=reserve_pool_interest,json=reservePoolInterest,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reserve_pool_interest" yaml:"reserve_pool_interest"` + BorrowingId uint64 `protobuf:"varint,1,opt,name=borrowing_id,json=borrowingId,proto3" json:"borrowing_id,omitempty" yaml:"borrowing_id"` + ReservePoolInterest cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=reserve_pool_interest,json=reservePoolInterest,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reserve_pool_interest" yaml:"reserve_pool_interest"` } func (m *BorrowInterestTracker) Reset() { *m = BorrowInterestTracker{} } @@ -941,8 +942,8 @@ func (m *BorrowInterestTracker) GetBorrowingId() uint64 { } type LendRewardsTracker struct { - LendingId uint64 `protobuf:"varint,1,opt,name=lending_id,json=lendingId,proto3" json:"lending_id,omitempty" yaml:"lending_id"` - RewardsAccumulated github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rewards_accumulated,json=rewardsAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rewards_accumulated" yaml:"interest_accumulated"` + LendingId uint64 `protobuf:"varint,1,opt,name=lending_id,json=lendingId,proto3" json:"lending_id,omitempty" yaml:"lending_id"` + RewardsAccumulated cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=rewards_accumulated,json=rewardsAccumulated,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rewards_accumulated" yaml:"interest_accumulated"` } func (m *LendRewardsTracker) Reset() { *m = LendRewardsTracker{} } @@ -1322,12 +1323,12 @@ func (m *FundReserveBal) GetFunder() string { } type AllReserveStats struct { - AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - AmountOutFromReserveToLenders github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount_out_from_reserve_to_lenders,json=amountOutFromReserveToLenders,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out_from_reserve_to_lenders" yaml:"amount_out_from_reserve_to_lenders"` - AmountOutFromReserveForAuction github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount_out_from_reserve_for_auction,json=amountOutFromReserveForAuction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out_from_reserve_for_auction" yaml:"amount_out_from_reserve_for_auction"` - AmountInFromLiqPenalty github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount_in_from_liq_penalty,json=amountInFromLiqPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in_from_liq_penalty" yaml:"amount_in_from_liq_penalty"` - AmountInFromRepayments github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount_in_from_repayments,json=amountInFromRepayments,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in_from_repayments" yaml:"amount_in_from_repayments"` - TotalAmountOutToLenders github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=total_amount_out_to_lenders,json=totalAmountOutToLenders,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_amount_out_to_lenders" yaml:"total_amount_out_to_lenders"` + AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + AmountOutFromReserveToLenders cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount_out_from_reserve_to_lenders,json=amountOutFromReserveToLenders,proto3,customtype=cosmossdk.io/math.Int" json:"amount_out_from_reserve_to_lenders" yaml:"amount_out_from_reserve_to_lenders"` + AmountOutFromReserveForAuction cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount_out_from_reserve_for_auction,json=amountOutFromReserveForAuction,proto3,customtype=cosmossdk.io/math.Int" json:"amount_out_from_reserve_for_auction" yaml:"amount_out_from_reserve_for_auction"` + AmountInFromLiqPenalty cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=amount_in_from_liq_penalty,json=amountInFromLiqPenalty,proto3,customtype=cosmossdk.io/math.Int" json:"amount_in_from_liq_penalty" yaml:"amount_in_from_liq_penalty"` + AmountInFromRepayments cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount_in_from_repayments,json=amountInFromRepayments,proto3,customtype=cosmossdk.io/math.Int" json:"amount_in_from_repayments" yaml:"amount_in_from_repayments"` + TotalAmountOutToLenders cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=total_amount_out_to_lenders,json=totalAmountOutToLenders,proto3,customtype=cosmossdk.io/math.Int" json:"total_amount_out_to_lenders" yaml:"total_amount_out_to_lenders"` } func (m *AllReserveStats) Reset() { *m = AllReserveStats{} } @@ -1507,8 +1508,8 @@ func (m *PoolPairs) GetMinUsdValueLeft() uint64 { } type PoolInterestData struct { - AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - LendInterest github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=lend_interest,json=lendInterest,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"lend_interest" yaml:"lend_interest"` + AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + LendInterest cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=lend_interest,json=lendInterest,proto3,customtype=cosmossdk.io/math.Int" json:"lend_interest" yaml:"lend_interest"` } func (m *PoolInterestData) Reset() { *m = PoolInterestData{} } @@ -1604,8 +1605,8 @@ func (m *PoolInterest) GetPoolInterestData() []PoolInterestData { } type PoolInterestDataB struct { - AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - BorrowInterest github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=borrow_interest,json=borrowInterest,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"borrow_interest" yaml:"borrow_interest"` + AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + BorrowInterest cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=borrow_interest,json=borrowInterest,proto3,customtype=cosmossdk.io/math.Int" json:"borrow_interest" yaml:"borrow_interest"` } func (m *PoolInterestDataB) Reset() { *m = PoolInterestDataB{} } @@ -1701,26 +1702,26 @@ func (m *PoolInterestB) GetPoolInterestData() []PoolInterestDataB { } type AssetRatesPoolPairs struct { - AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - UOptimal github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=u_optimal,json=uOptimal,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"u_optimal" yaml:"u_optimal"` - Base github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=base,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base" yaml:"base"` - Slope1 github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slope1,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slope1" yaml:"slope1"` - Slope2 github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slope2,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slope2" yaml:"slope2"` - EnableStableBorrow bool `protobuf:"varint,6,opt,name=enable_stable_borrow,json=enableStableBorrow,proto3" json:"enable_stable_borrow,omitempty" yaml:"enable_stable_borrow"` - StableBase github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=stable_base,json=stableBase,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_base" yaml:"stable_base"` - StableSlope1 github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=stable_slope1,json=stableSlope1,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_slope1" yaml:"stable_slope1"` - StableSlope2 github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=stable_slope2,json=stableSlope2,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_slope2" yaml:"stable_slope2"` - Ltv github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=ltv,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"ltv" yaml:"ltv"` - LiquidationThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=liquidation_threshold,json=liquidationThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_threshold" yaml:"liquidation_threshold"` - LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidation_penalty"` - LiquidationBonus github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=liquidation_bonus,json=liquidationBonus,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_bonus" yaml:"liquidation_bonus"` - ReserveFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,14,opt,name=reserve_factor,json=reserveFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reserve_factor" yaml:"reserve_factor"` - CAssetID uint64 `protobuf:"varint,15,opt,name=c_asset_id,json=cAssetId,proto3" json:"c_asset_id,omitempty" yaml:"c_asset_id"` - ModuleName string `protobuf:"bytes,16,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty" yaml:"module_name"` - CPoolName string `protobuf:"bytes,17,opt,name=cpool_name,json=cpoolName,proto3" json:"cpool_name,omitempty" yaml:"cpool_name"` - AssetData []*AssetDataPoolMapping `protobuf:"bytes,18,rep,name=asset_data,json=assetData,proto3" json:"asset_data,omitempty" yaml:"asset_data"` - MinUsdValueLeft uint64 `protobuf:"varint,19,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` - IsIsolated bool `protobuf:"varint,20,opt,name=is_isolated,json=isIsolated,proto3" json:"is_isolated,omitempty" yaml:"is_isolated"` + AssetID uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + UOptimal cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=u_optimal,json=uOptimal,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"u_optimal" yaml:"u_optimal"` + Base cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=base,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base" yaml:"base"` + Slope1 cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=slope1,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slope1" yaml:"slope1"` + Slope2 cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=slope2,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slope2" yaml:"slope2"` + EnableStableBorrow bool `protobuf:"varint,6,opt,name=enable_stable_borrow,json=enableStableBorrow,proto3" json:"enable_stable_borrow,omitempty" yaml:"enable_stable_borrow"` + StableBase cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=stable_base,json=stableBase,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_base" yaml:"stable_base"` + StableSlope1 cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=stable_slope1,json=stableSlope1,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_slope1" yaml:"stable_slope1"` + StableSlope2 cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=stable_slope2,json=stableSlope2,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_slope2" yaml:"stable_slope2"` + Ltv cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=ltv,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"ltv" yaml:"ltv"` + LiquidationThreshold cosmossdk_io_math.LegacyDec `protobuf:"bytes,11,opt,name=liquidation_threshold,json=liquidationThreshold,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_threshold" yaml:"liquidation_threshold"` + LiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,12,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_penalty" yaml:"liquidation_penalty"` + LiquidationBonus cosmossdk_io_math.LegacyDec `protobuf:"bytes,13,opt,name=liquidation_bonus,json=liquidationBonus,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_bonus" yaml:"liquidation_bonus"` + ReserveFactor cosmossdk_io_math.LegacyDec `protobuf:"bytes,14,opt,name=reserve_factor,json=reserveFactor,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reserve_factor" yaml:"reserve_factor"` + CAssetID uint64 `protobuf:"varint,15,opt,name=c_asset_id,json=cAssetId,proto3" json:"c_asset_id,omitempty" yaml:"c_asset_id"` + ModuleName string `protobuf:"bytes,16,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty" yaml:"module_name"` + CPoolName string `protobuf:"bytes,17,opt,name=cpool_name,json=cpoolName,proto3" json:"cpool_name,omitempty" yaml:"cpool_name"` + AssetData []*AssetDataPoolMapping `protobuf:"bytes,18,rep,name=asset_data,json=assetData,proto3" json:"asset_data,omitempty" yaml:"asset_data"` + MinUsdValueLeft uint64 `protobuf:"varint,19,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` + IsIsolated bool `protobuf:"varint,20,opt,name=is_isolated,json=isIsolated,proto3" json:"is_isolated,omitempty" yaml:"is_isolated"` } func (m *AssetRatesPoolPairs) Reset() { *m = AssetRatesPoolPairs{} } @@ -1953,10 +1954,10 @@ func (m *EModePairsForProposal) GetEModePairs() []EModePairs { } type EModePairs struct { - PairID uint64 `protobuf:"varint,1,opt,name=pair_id,json=pairId,proto3" json:"pair_id,omitempty" yaml:"pair_id"` - ELtv github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=e_ltv,json=eLtv,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"e_ltv" yaml:"e_ltv"` - ELiquidationThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=e_liquidation_threshold,json=eLiquidationThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"e_liquidation_threshold" yaml:"e_liquidation_threshold"` - ELiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=e_liquidation_penalty,json=eLiquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"e_liquidation_penalty" yaml:"e_liquidation_penalty"` + PairID uint64 `protobuf:"varint,1,opt,name=pair_id,json=pairId,proto3" json:"pair_id,omitempty" yaml:"pair_id"` + ELtv cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=e_ltv,json=eLtv,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"e_ltv" yaml:"e_ltv"` + ELiquidationThreshold cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=e_liquidation_threshold,json=eLiquidationThreshold,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"e_liquidation_threshold" yaml:"e_liquidation_threshold"` + ELiquidationPenalty cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=e_liquidation_penalty,json=eLiquidationPenalty,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"e_liquidation_penalty" yaml:"e_liquidation_penalty"` } func (m *EModePairs) Reset() { *m = EModePairs{} } @@ -2036,213 +2037,213 @@ func init() { func init() { proto.RegisterFile("comdex/lend/v1beta1/lend.proto", fileDescriptor_b87bb4bef8334ddd) } var fileDescriptor_b87bb4bef8334ddd = []byte{ - // 3293 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0x4d, 0x6c, 0x1c, 0xc7, - 0x95, 0x56, 0x93, 0x14, 0x39, 0xf3, 0x86, 0xa4, 0xc8, 0x1a, 0xd2, 0x1a, 0x53, 0x32, 0x47, 0x2e, - 0xed, 0xda, 0xd4, 0x2e, 0x3c, 0x84, 0xb8, 0x36, 0x16, 0x6b, 0xd8, 0xeb, 0xe5, 0xe8, 0xcf, 0x63, - 0x53, 0xb2, 0x5c, 0xa2, 0x77, 0xb1, 0xbb, 0xde, 0x6d, 0xf4, 0x4c, 0x17, 0xa9, 0x86, 0x7a, 0xba, - 0x5b, 0xdd, 0x3d, 0x94, 0x98, 0xc4, 0x4e, 0x60, 0x23, 0x81, 0x91, 0x1f, 0xc4, 0xc9, 0x35, 0xa7, - 0x5c, 0x82, 0xe4, 0x16, 0x04, 0xc9, 0x25, 0x40, 0x0e, 0x41, 0x10, 0xc7, 0x87, 0x1c, 0x9c, 0x9f, - 0x83, 0xe1, 0xc3, 0x24, 0xa0, 0x73, 0xca, 0x51, 0x87, 0x1c, 0x72, 0x0a, 0xaa, 0xea, 0xf5, 0xdf, - 0x4c, 0x93, 0x52, 0x73, 0x6c, 0xc9, 0x01, 0x74, 0xe2, 0xf4, 0xab, 0xaa, 0xef, 0xbd, 0x7a, 0xef, - 0xd5, 0xab, 0xf7, 0xaa,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x86, 0x9f, 0x7f, 0xa9, 0x40, 0x45, 0x59, 0x54, 0xc5, 0x81, 0xff, - 0x80, 0x69, 0x65, 0xf4, 0x4c, 0x24, 0x78, 0x2c, 0x8e, 0x04, 0xa8, 0xfb, 0x74, 0x1f, 0xca, 0x2a, - 0xf1, 0x67, 0xcb, 0x14, 0x1a, 0x48, 0x45, 0x12, 0x15, 0x0f, 0xa4, 0x06, 0x36, 0x30, 0x60, 0xdc, - 0x3d, 0xa0, 0x5c, 0x80, 0x39, 0x2b, 0xd0, 0x83, 0x50, 0xba, 0x21, 0xba, 0xb5, 0x08, 0x0f, 0xa5, - 0xe6, 0x89, 0x3b, 0xfd, 0xfa, 0x71, 0x35, 0x76, 0xb0, 0x07, 0x65, 0xb3, 0x56, 0x70, 0x4d, 0x52, - 0xd0, 0x45, 0x45, 0x70, 0x31, 0x2c, 0x5f, 0x88, 0x31, 0x91, 0x0a, 0x2e, 0x86, 0xe5, 0x67, 0x82, - 0x8b, 0xea, 0x22, 0x82, 0x8b, 0x68, 0x31, 0x1f, 0x6c, 0xd0, 0x78, 0x13, 0x00, 0x21, 0xdc, 0x5e, - 0x88, 0x21, 0xe3, 0x00, 0xee, 0xe7, 0x91, 0xfb, 0x7c, 0x86, 0xbb, 0xdb, 0x0b, 0x0b, 0xb1, 0xc7, - 0xf9, 0xbe, 0xd2, 0x0b, 0xc9, 0x77, 0x34, 0x58, 0x68, 0xfb, 0x96, 0xb9, 0xcd, 0x4d, 0x5d, 0xc5, - 0x6b, 0xd5, 0x26, 0xc3, 0xca, 0x81, 0xa2, 0x5c, 0x41, 0x51, 0x4e, 0xa0, 0x87, 0xe4, 0x80, 0x14, - 0x12, 0x8a, 0x20, 0x82, 0xf4, 0xcb, 0x75, 0x39, 0x9e, 0x98, 0x30, 0x9b, 0x78, 0x9e, 0x5c, 0xd0, - 0xa5, 0xbb, 0x2e, 0xe8, 0xc7, 0x51, 0xae, 0xc5, 0x41, 0xcf, 0x4d, 0x56, 0xf2, 0x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, 0x07, 0x7b, 0xcb, - 0xda, 0x1f, 0xf7, 0x96, 0xb5, 0x77, 0x3f, 0x5e, 0x3e, 0xf2, 0xc1, 0xc7, 0xcb, 0x47, 0x3e, 0xfc, - 0x78, 0xf9, 0xc8, 0xff, 0x34, 0x32, 0x6c, 0x85, 0x9b, 0x3c, 0xe5, 0x6e, 0x6d, 0x59, 0x1d, 0xcb, - 0xb0, 0xf1, 0x7b, 0x15, 0xff, 0x8d, 0x55, 0x8a, 0xd0, 0x9e, 0x94, 0xa7, 0x8e, 0xff, 0xf2, 0xb7, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x01, 0x45, 0x2c, 0xe2, 0x3a, 0x00, 0x00, + // 3291 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x1b, 0x4d, 0x6f, 0x1b, 0xc7, + 0xd5, 0x2b, 0xc9, 0x12, 0xf9, 0x28, 0xca, 0xe2, 0x90, 0x8a, 0x19, 0xd9, 0x11, 0x9d, 0x71, 0x9b, + 0xc8, 0x6d, 0x43, 0xc1, 0xca, 0x57, 0xe3, 0x26, 0x48, 0x44, 0xdb, 0x4a, 0x98, 0xc8, 0x8e, 0x33, + 0x56, 0x5a, 0xd4, 0x80, 0xbb, 0x19, 0x72, 0x47, 0xf2, 0xc2, 0xcb, 0xdd, 0xf5, 0xee, 0x52, 0xb6, + 0xda, 0x26, 0x68, 0x0e, 0x29, 0x8a, 0xf6, 0x12, 0x14, 0x28, 0x50, 0x20, 0xa7, 0x1e, 0x7b, 0x0b, + 0x0a, 0xf4, 0xd6, 0x1e, 0x82, 0xa0, 0x6d, 0x7a, 0x29, 0xd2, 0x0f, 0x14, 0x45, 0x0f, 0x6c, 0xa1, + 0xfc, 0x03, 0x5f, 0x0a, 0xf4, 0x54, 0xcc, 0xc7, 0x7e, 0x91, 0x2b, 0x89, 0x94, 0x9c, 0xb8, 0x07, + 0x9f,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5, 0x0c, 0x91, 0x27, 0xe4, 0x1a, + 0x27, 0xe3, 0x45, 0x0d, 0xa0, 0x88, 0x44, 0xed, 0xe2, 0x25, 0xc7, 0x60, 0x17, 0x15, 0xe0, 0xb7, + 0x1a, 0x20, 0xb1, 0xa7, 0x75, 0x87, 0x1b, 0x2c, 0x74, 0xd5, 0x03, 0x86, 0xb1, 0x43, 0x56, 0x98, + 0x2a, 0x63, 0x1c, 0x17, 0xc7, 0x6c, 0xa8, 0x8c, 0x11, 0x7f, 0x90, 0x03, 0xc4, 0x97, 0x25, 0x03, + 0x48, 0xe3, 0xfe, 0xad, 0xbf, 0x0e, 0x39, 0x15, 0x69, 0x7c, 0xb5, 0x81, 0x84, 0x67, 0x87, 0x33, + 0x98, 0x4c, 0xc9, 0x20, 0xe4, 0xa3, 0xa7, 0x00, 0xa2, 0xe8, 0xe1, 0xab, 0xc8, 0x32, 0x17, 0x9f, + 0xb0, 0x78, 0x0e, 0x93, 0x7c, 0x18, 0x5a, 0x7c, 0x74, 0x1d, 0x66, 0x64, 0x4d, 0x21, 0x41, 0x4c, + 0xfa, 0x66, 0xbe, 0xf1, 0xcc, 0x7e, 0x05, 0xc9, 0x5c, 0xb2, 0x20, 0x09, 0x89, 0x31, 0x91, 0xd5, + 0x4d, 0x43, 0x8d, 0xd1, 0x2d, 0x98, 0x93, 0x18, 0xa9, 0xec, 0x89, 0x19, 0xc2, 0x4b, 0xf3, 0x8d, + 0x17, 0xf6, 0x93, 0x72, 0x32, 0x29, 0xa5, 0x8f, 0x07, 0x26, 0x65, 0x01, 0x4f, 0xd6, 0x09, 0xcc, + 0x40, 0x6f, 0x00, 0x48, 0x74, 0xae, 0x18, 0x55, 0x14, 0x2f, 0xef, 0x27, 0xa7, 0x94, 0x94, 0xc3, + 0x09, 0x31, 0xc9, 0x8b, 0x01, 0xbf, 0x42, 0xd0, 0x0f, 0x34, 0x98, 0x97, 0x53, 0x99, 0xb9, 0x5d, + 0x2e, 0x95, 0x05, 0xed,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, 0x7e, 0x3f, 0x3b, 0xa1, 0x13, + 0x9f, 0x6f, 0x27, 0xb4, 0xf1, 0xca, 0x27, 0x3b, 0x0b, 0xda, 0xa7, 0x3b, 0x0b, 0xda, 0xbf, 0x77, + 0x16, 0xb4, 0xf7, 0x3f, 0x5b, 0x38, 0xf2, 0xe9, 0x67, 0x0b, 0x47, 0xfe, 0xf1, 0xd9, 0xc2, 0x91, + 0x6b, 0xf5, 0xd4, 0xab, 0x1b, 0xf7, 0x81, 0x27, 0x9c, 0x8d, 0x0d, 0xb3, 0x6d, 0x52, 0x4b, 0x8d, + 0x97, 0xd4, 0xff, 0xf1, 0x89, 0x17, 0xb8, 0xd6, 0xa4, 0x78, 0x54, 0x7b, 0xf2, 0x7f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x6d, 0x71, 0x20, 0xa3, 0xe3, 0x37, 0x00, 0x00, } func (m *LendAsset) Marshal() (dAtA []byte, err error) { diff --git a/x/lend/types/pair.go b/x/lend/types/pair.go index beb83cf65..cffbab538 100644 --- a/x/lend/types/pair.go +++ b/x/lend/types/pair.go @@ -1,9 +1,8 @@ package types import ( + sdkmath "cosmossdk.io/math" "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" ) func (m *Extended_Pair) Validate() error { @@ -60,40 +59,40 @@ func (m *AssetRatesParams) Validate() error { if m.AssetID == 0 { return fmt.Errorf("assetID cannot be zero") } - if m.UOptimal.LTE(sdk.ZeroDec()) { + if m.UOptimal.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("UOptimal cannot be zero") } - if m.Base.LTE(sdk.ZeroDec()) { + if m.Base.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("base cannot be zero") } - if m.Slope1.LTE(sdk.ZeroDec()) { + if m.Slope1.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("slope1 cannot be zero") } - if m.Slope2.LTE(sdk.ZeroDec()) { + if m.Slope2.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("slope2 cannot be zero") } - if m.StableBase.LT(sdk.ZeroDec()) { + if m.StableBase.LT(sdkmath.LegacyZeroDec()) { return fmt.Errorf("StableBase cannot be less than zero") } - if m.StableSlope1.LT(sdk.ZeroDec()) { + if m.StableSlope1.LT(sdkmath.LegacyZeroDec()) { return fmt.Errorf("StableSlope1 cannot be less than zero") } - if m.StableSlope2.LT(sdk.ZeroDec()) { + if m.StableSlope2.LT(sdkmath.LegacyZeroDec()) { return fmt.Errorf("StableSlope2 cannot be less than zero") } - if m.LiquidationThreshold.LTE(sdk.ZeroDec()) { + if m.LiquidationThreshold.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("LiquidationThreshold cannot be zero") } - if m.LiquidationBonus.LTE(sdk.ZeroDec()) { + if m.LiquidationBonus.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("LiquidationBonus cannot be zero") } - if m.LiquidationPenalty.LTE(sdk.ZeroDec()) { + if m.LiquidationPenalty.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("LiquidationPenalty cannot be zero") } - if m.Ltv.LTE(sdk.ZeroDec()) { + if m.Ltv.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("ltv cannot be zero") } - if m.ReserveFactor.LTE(sdk.ZeroDec()) { + if m.ReserveFactor.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("ReserveFactor cannot be zero") } if m.CAssetID == 0 { @@ -116,40 +115,40 @@ func (m *AssetRatesPoolPairs) Validate() error { if m.AssetID == 0 { return fmt.Errorf("assetID cannot be zero") } - if m.UOptimal.LTE(sdk.ZeroDec()) { + if m.UOptimal.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("UOptimal cannot be zero") } - if m.Base.LTE(sdk.ZeroDec()) { + if m.Base.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("base cannot be zero") } - if m.Slope1.LTE(sdk.ZeroDec()) { + if m.Slope1.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("slope1 cannot be zero") } - if m.Slope2.LTE(sdk.ZeroDec()) { + if m.Slope2.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("slope2 cannot be zero") } - if m.StableBase.LT(sdk.ZeroDec()) { + if m.StableBase.LT(sdkmath.LegacyZeroDec()) { return fmt.Errorf("StableBase cannot be less than zero") } - if m.StableSlope1.LT(sdk.ZeroDec()) { + if m.StableSlope1.LT(sdkmath.LegacyZeroDec()) { return fmt.Errorf("StableSlope1 cannot be less than zero") } - if m.StableSlope2.LT(sdk.ZeroDec()) { + if m.StableSlope2.LT(sdkmath.LegacyZeroDec()) { return fmt.Errorf("StableSlope2 cannot be less than zero") } - if m.LiquidationThreshold.LTE(sdk.ZeroDec()) { + if m.LiquidationThreshold.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("LiquidationThreshold cannot be zero") } - if m.LiquidationBonus.LTE(sdk.ZeroDec()) { + if m.LiquidationBonus.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("LiquidationBonus cannot be zero") } - if m.LiquidationPenalty.LTE(sdk.ZeroDec()) { + if m.LiquidationPenalty.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("LiquidationPenalty cannot be zero") } - if m.Ltv.LTE(sdk.ZeroDec()) { + if m.Ltv.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("ltv cannot be zero") } - if m.ReserveFactor.LTE(sdk.ZeroDec()) { + if m.ReserveFactor.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("ReserveFactor cannot be zero") } if m.CAssetID == 0 { diff --git a/x/lend/types/params.go b/x/lend/types/params.go index 02646a5d7..45c904669 100644 --- a/x/lend/types/params.go +++ b/x/lend/types/params.go @@ -1,7 +1,7 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" ) @@ -9,18 +9,18 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) const ( - LendGas = sdk.Gas(32763) - WithdrawGas = sdk.Gas(22763) - DepositGas = sdk.Gas(22763) - CloseLendGas = sdk.Gas(22763) - BorrowAssetGas = sdk.Gas(22763) - DrawAssetGas = sdk.Gas(22763) - RepayAssetGas = sdk.Gas(22763) - DepositBorrowAssetGas = sdk.Gas(22763) - CloseBorrowAssetGas = sdk.Gas(22763) - BorrowAssetAlternateGas = sdk.Gas(22763) - CalculateInterestAndRewardGas = sdk.Gas(22763) - RepayWithdrawGas = sdk.Gas(22763) + LendGas = storetypes.Gas(32763) + WithdrawGas = storetypes.Gas(22763) + DepositGas = storetypes.Gas(22763) + CloseLendGas = storetypes.Gas(22763) + BorrowAssetGas = storetypes.Gas(22763) + DrawAssetGas = storetypes.Gas(22763) + RepayAssetGas = storetypes.Gas(22763) + DepositBorrowAssetGas = storetypes.Gas(22763) + CloseBorrowAssetGas = storetypes.Gas(22763) + BorrowAssetAlternateGas = storetypes.Gas(22763) + CalculateInterestAndRewardGas = storetypes.Gas(22763) + RepayWithdrawGas = storetypes.Gas(22763) ) const ( diff --git a/x/lend/types/tx_test.go b/x/lend/types/tx_test.go index 7c543ae7d..7b5f6293b 100644 --- a/x/lend/types/tx_test.go +++ b/x/lend/types/tx_test.go @@ -1,6 +1,7 @@ package types_test import ( + sdkmath "cosmossdk.io/math" "testing" "github.com/comdex-official/comdex/x/lend/types" @@ -16,7 +17,7 @@ func TestNewMsgLend(t *testing.T) { }{ { name: "empty from", - msg: types.NewMsgLend("", 1, sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), 1, 1), + msg: types.NewMsgLend("", 1, sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, 1), isErrExp: true, }, { @@ -24,7 +25,7 @@ func TestNewMsgLend(t *testing.T) { msg: types.NewMsgLend( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(0)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), 1, 1, ), @@ -35,7 +36,7 @@ func TestNewMsgLend(t *testing.T) { msg: types.NewMsgLend( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 0, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, 1, ), @@ -46,7 +47,7 @@ func TestNewMsgLend(t *testing.T) { msg: types.NewMsgLend( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 0, 1, ), @@ -57,7 +58,7 @@ func TestNewMsgLend(t *testing.T) { msg: types.NewMsgLend( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, 0, ), @@ -68,7 +69,7 @@ func TestNewMsgLend(t *testing.T) { msg: types.NewMsgLend( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, 1, ), @@ -104,7 +105,7 @@ func TestNewMsgWithdraw(t *testing.T) { msg: types.NewMsgWithdraw( "", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -113,7 +114,7 @@ func TestNewMsgWithdraw(t *testing.T) { msg: types.NewMsgWithdraw( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 0, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -122,7 +123,7 @@ func TestNewMsgWithdraw(t *testing.T) { msg: types.NewMsgWithdraw( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 0, - sdk.NewCoin("ucmdx", sdk.NewInt(0)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), ), isErrExp: true, }, @@ -131,7 +132,7 @@ func TestNewMsgWithdraw(t *testing.T) { msg: types.NewMsgWithdraw( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: false, }, @@ -165,7 +166,7 @@ func TestNewMsgDeposit(t *testing.T) { msg: types.NewMsgDeposit( "", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -174,7 +175,7 @@ func TestNewMsgDeposit(t *testing.T) { msg: types.NewMsgDeposit( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 0, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -183,7 +184,7 @@ func TestNewMsgDeposit(t *testing.T) { msg: types.NewMsgDeposit( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 0, - sdk.NewCoin("ucmdx", sdk.NewInt(0)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), ), isErrExp: true, }, @@ -192,7 +193,7 @@ func TestNewMsgDeposit(t *testing.T) { msg: types.NewMsgDeposit( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: false, }, @@ -277,8 +278,8 @@ func TestNewMsgBorrow(t *testing.T) { 1, 1, false, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -289,8 +290,8 @@ func TestNewMsgBorrow(t *testing.T) { 1, 1, false, - sdk.NewCoin("ucmdx", sdk.NewInt(0)), - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -301,8 +302,8 @@ func TestNewMsgBorrow(t *testing.T) { 1, 1, false, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), - sdk.NewCoin("ucmdx", sdk.NewInt(0)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), ), isErrExp: true, }, @@ -313,8 +314,8 @@ func TestNewMsgBorrow(t *testing.T) { 0, 1, false, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -325,8 +326,8 @@ func TestNewMsgBorrow(t *testing.T) { 1, 0, false, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -337,8 +338,8 @@ func TestNewMsgBorrow(t *testing.T) { 1, 1, false, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: false, }, @@ -349,8 +350,8 @@ func TestNewMsgBorrow(t *testing.T) { 1, 1, true, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: false, }, @@ -384,7 +385,7 @@ func TestNewMsgRepay(t *testing.T) { msg: types.NewMsgRepay( "", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -393,7 +394,7 @@ func TestNewMsgRepay(t *testing.T) { msg: types.NewMsgRepay( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 0, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, @@ -402,7 +403,7 @@ func TestNewMsgRepay(t *testing.T) { msg: types.NewMsgRepay( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(0)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), ), isErrExp: true, }, @@ -411,7 +412,7 @@ func TestNewMsgRepay(t *testing.T) { msg: types.NewMsgRepay( "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: false, }, @@ -445,7 +446,7 @@ func TestNewMsgDraw(t *testing.T) { msg: &types.MsgDraw{ Borrower: "", BorrowId: 1, - Amount: sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + Amount: sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), }, isErrExp: true, }, @@ -454,7 +455,7 @@ func TestNewMsgDraw(t *testing.T) { msg: &types.MsgDraw{ Borrower: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", BorrowId: 0, - Amount: sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + Amount: sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), }, isErrExp: true, }, @@ -463,7 +464,7 @@ func TestNewMsgDraw(t *testing.T) { msg: &types.MsgDraw{ Borrower: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", BorrowId: 1, - Amount: sdk.NewCoin("ucmdx", sdk.NewInt(0)), + Amount: sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), }, isErrExp: true, }, @@ -472,7 +473,7 @@ func TestNewMsgDraw(t *testing.T) { msg: &types.MsgDraw{ Borrower: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", BorrowId: 1, - Amount: sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + Amount: sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), }, isErrExp: false, }, @@ -506,7 +507,7 @@ func TestNewMsgDepositBorrow(t *testing.T) { msg: &types.MsgDepositBorrow{ Borrower: "", BorrowId: 1, - Amount: sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + Amount: sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), }, isErrExp: true, }, @@ -515,7 +516,7 @@ func TestNewMsgDepositBorrow(t *testing.T) { msg: &types.MsgDepositBorrow{ Borrower: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", BorrowId: 0, - Amount: sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + Amount: sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), }, isErrExp: true, }, @@ -524,7 +525,7 @@ func TestNewMsgDepositBorrow(t *testing.T) { msg: &types.MsgDepositBorrow{ Borrower: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", BorrowId: 1, - Amount: sdk.NewCoin("ucmdx", sdk.NewInt(0)), + Amount: sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), }, isErrExp: true, }, @@ -533,7 +534,7 @@ func TestNewMsgDepositBorrow(t *testing.T) { msg: &types.MsgDepositBorrow{ Borrower: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", BorrowId: 1, - Amount: sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + Amount: sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), }, isErrExp: false, }, @@ -617,10 +618,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "", 1, 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, false, - sdk.NewCoin("uatom", sdk.NewInt(1000000)), + sdk.NewCoin("uatom", sdkmath.NewInt(1000000)), 1, ), isErrExp: true, @@ -631,10 +632,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 0, 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, false, - sdk.NewCoin("uatom", sdk.NewInt(1000000)), + sdk.NewCoin("uatom", sdkmath.NewInt(1000000)), 1, ), isErrExp: true, @@ -645,10 +646,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 0, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, false, - sdk.NewCoin("uatom", sdk.NewInt(1000000)), + sdk.NewCoin("uatom", sdkmath.NewInt(1000000)), 1, ), isErrExp: true, @@ -659,10 +660,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 0, false, - sdk.NewCoin("uatom", sdk.NewInt(1000000)), + sdk.NewCoin("uatom", sdkmath.NewInt(1000000)), 1, ), isErrExp: true, @@ -673,10 +674,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, false, - sdk.NewCoin("uatom", sdk.NewInt(1000000)), + sdk.NewCoin("uatom", sdkmath.NewInt(1000000)), 0, ), isErrExp: true, @@ -687,10 +688,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, - sdk.NewCoin("ucmdx", sdk.NewInt(0)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), 1, false, - sdk.NewCoin("uatom", sdk.NewInt(1000000)), + sdk.NewCoin("uatom", sdkmath.NewInt(1000000)), 1, ), isErrExp: true, @@ -701,10 +702,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, false, - sdk.NewCoin("uatom", sdk.NewInt(0)), + sdk.NewCoin("uatom", sdkmath.NewInt(0)), 1, ), isErrExp: true, @@ -715,10 +716,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, false, - sdk.NewCoin("uatom", sdk.NewInt(1000000)), + sdk.NewCoin("uatom", sdkmath.NewInt(1000000)), 1, ), isErrExp: false, @@ -729,10 +730,10 @@ func TestNewMsgBorrowAlternate(t *testing.T) { "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), 1, true, - sdk.NewCoin("uatom", sdk.NewInt(1000000)), + sdk.NewCoin("uatom", sdkmath.NewInt(1000000)), 1, ), isErrExp: false, @@ -768,17 +769,17 @@ func TestNewMsgFundModuleAccounts(t *testing.T) { 1, 1, "", - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, }, /*{ name: "empty moduleName", msg: types.NewMsgFundModuleAccounts( - sdk.NewInt(), + sdkmath.NewInt(), 1, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: true, },*/ @@ -788,7 +789,7 @@ func TestNewMsgFundModuleAccounts(t *testing.T) { 3, 1, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - sdk.NewCoin("ucmdx", sdk.NewInt(0)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(0)), ), isErrExp: true, }, @@ -798,7 +799,7 @@ func TestNewMsgFundModuleAccounts(t *testing.T) { 1, 1, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - sdk.NewCoin("ucmdx", sdk.NewInt(1000000)), + sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000)), ), isErrExp: false, }, diff --git a/x/liquidation/abci.go b/x/liquidation/abci.go index d7bd48b89..ec50f406c 100644 --- a/x/liquidation/abci.go +++ b/x/liquidation/abci.go @@ -3,7 +3,6 @@ package liquidation import ( "fmt" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,7 +10,7 @@ import ( "github.com/comdex-official/comdex/x/liquidation/types" ) -func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper) { +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) err := k.LiquidateVaults(ctx) diff --git a/x/liquidation/expected/keeper.go b/x/liquidation/expected/keeper.go index 06cf1960e..55ce32804 100644 --- a/x/liquidation/expected/keeper.go +++ b/x/liquidation/expected/keeper.go @@ -1,8 +1,9 @@ package expected import ( + "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" assettypes "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auction/types" @@ -15,15 +16,15 @@ import ( ) type AccountKeeper interface { - GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI + GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI } type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderModule string, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error } type AssetKeeper interface { @@ -35,7 +36,7 @@ type AssetKeeper interface { type VaultKeeper interface { GetAppMappingData(ctx sdk.Context, appMappingID uint64) (appExtendedPairVaultData []types.AppExtendedPairVaultMappingData, found bool) - CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdk.Int, amountOut sdk.Int) (sdk.Dec, error) + CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdkmath.Int, amountOut sdkmath.Int) (sdkmath.LegacyDec, error) GetVault(ctx sdk.Context, id uint64) (vault types.Vault, found bool) GetVaults(ctx sdk.Context) (vaults []types.Vault) GetIDForVault(ctx sdk.Context) uint64 @@ -43,15 +44,15 @@ type VaultKeeper interface { GetLengthOfVault(ctx sdk.Context) uint64 SetLengthOfVault(ctx sdk.Context, length uint64) UpdateAppExtendedPairVaultMappingDataOnMsgCreate(ctx sdk.Context, vaultData types.Vault) - UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) DeleteUserVaultExtendedPairMapping(ctx sdk.Context, address string, appID uint64, pairVaultID uint64) DeleteAddressFromAppExtendedPairVaultMapping(ctx sdk.Context, extendedPairID uint64, userVaultID uint64, appMappingID uint64) SetVault(ctx sdk.Context, vault types.Vault) } type MarketKeeper interface { - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) } @@ -71,8 +72,8 @@ type LendKeeper interface { GetBorrow(ctx sdk.Context, id uint64) (borrow lendtypes.BorrowAsset, found bool) GetLendPair(ctx sdk.Context, id uint64) (pair lendtypes.Extended_Pair, found bool) GetAssetRatesParams(ctx sdk.Context, assetID uint64) (assetRatesStats lendtypes.AssetRatesParams, found bool) - VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset, liquidationThreshold sdk.Dec) error - CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset) (sdk.Dec, error) + VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdkmath.Int, assetIn assettypes.Asset, amountOut sdkmath.Int, assetOut assettypes.Asset, liquidationThreshold sdkmath.LegacyDec) error + CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdkmath.Int, assetIn assettypes.Asset, amountOut sdkmath.Int, assetOut assettypes.Asset) (sdkmath.LegacyDec, error) GetLend(ctx sdk.Context, id uint64) (lend lendtypes.LendAsset, found bool) CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.LockedVault) GetPool(ctx sdk.Context, id uint64) (pool lendtypes.Pool, found bool) @@ -88,7 +89,7 @@ type LendKeeper interface { DeleteIDFromAssetStatsMapping(ctx sdk.Context, poolID, assetID, id uint64, typeOfID bool) DeleteBorrowIDFromUserMapping(ctx sdk.Context, owner string, lendID, borrowID uint64) DeleteBorrowInterestTracker(ctx sdk.Context, ID uint64) - UpdateBorrowStats(ctx sdk.Context, pair lendtypes.Extended_Pair, isStableBorrow bool, amount sdk.Int, inc bool) + UpdateBorrowStats(ctx sdk.Context, pair lendtypes.Extended_Pair, isStableBorrow bool, amount sdkmath.Int, inc bool) GetBorrowInterestTracker(ctx sdk.Context, ID uint64) (interest lendtypes.BorrowInterestTracker, found bool) SetBorrowInterestTracker(ctx sdk.Context, interest lendtypes.BorrowInterestTracker) SetAllReserveStatsByAssetID(ctx sdk.Context, allReserveStats lendtypes.AllReserveStats) @@ -97,6 +98,6 @@ type LendKeeper interface { } type RewardsKeeper interface { - CalculateVaultInterest(ctx sdk.Context, appID, assetID, lockerID uint64, NetBalance sdk.Int, blockHeight int64, lockerBlockTime int64) error + CalculateVaultInterest(ctx sdk.Context, appID, assetID, lockerID uint64, NetBalance sdkmath.Int, blockHeight int64, lockerBlockTime int64) error DeleteVaultInterestTracker(ctx sdk.Context, vault rewardstypes.VaultInterestTracker) } diff --git a/x/liquidation/handler.go b/x/liquidation/handler.go index b0c878234..f0db0b275 100644 --- a/x/liquidation/handler.go +++ b/x/liquidation/handler.go @@ -1,15 +1,16 @@ package liquidation import ( + errorsmod "cosmossdk.io/errors" + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/comdex-official/comdex/x/liquidation/keeper" "github.com/comdex-official/comdex/x/liquidation/types" ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServer(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -23,7 +24,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := server.MsgLiquidateBorrow(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) + return nil, errorsmod.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } } } diff --git a/x/liquidation/keeper/keeper.go b/x/liquidation/keeper/keeper.go index 8ca65772c..b3f0d058e 100644 --- a/x/liquidation/keeper/keeper.go +++ b/x/liquidation/keeper/keeper.go @@ -3,15 +3,15 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/liquidation/expected" "github.com/comdex-official/comdex/x/liquidation/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" ) type Keeper struct { @@ -71,7 +71,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.storeKey) } diff --git a/x/liquidation/keeper/keeper_test.go b/x/liquidation/keeper/keeper_test.go index 32e15a725..c075a01e4 100644 --- a/x/liquidation/keeper/keeper_test.go +++ b/x/liquidation/keeper/keeper_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "testing" "time" @@ -8,7 +9,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -45,7 +45,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.vaultKeeper = s.app.VaultKeeper s.liquidationKeeper = s.app.LiquidationKeeper s.assetKeeper = s.app.AssetKeeper @@ -113,9 +113,9 @@ func (s *KeeperTestSuite) AddAuctionParams() { auctionParams := auctionTypes.AuctionParams{ AppId: 1, AuctionDurationSeconds: 300, - Buffer: sdk.MustNewDecFromStr("1.2"), - Cusp: sdk.MustNewDecFromStr("0.6"), - Step: sdk.NewIntFromUint64(1), + Buffer: sdkmath.LegacyMustNewDecFromStr("1.2"), + Cusp: sdkmath.LegacyMustNewDecFromStr("0.6"), + Step: sdkmath.NewIntFromUint64(1), PriceFunctionType: 1, SurplusId: 1, DebtId: 2, diff --git a/x/liquidation/keeper/liquidate_borrow.go b/x/liquidation/keeper/liquidate_borrow.go index f42e45a54..bc2e71517 100644 --- a/x/liquidation/keeper/liquidate_borrow.go +++ b/x/liquidation/keeper/liquidate_borrow.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" @@ -53,7 +54,7 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { if err != nil { return fmt.Errorf("error in calculating Borrow Interest before liquidation") } - if !borrowPos.StableBorrowRate.Equal(sdk.ZeroDec()) { + if !borrowPos.StableBorrowRate.Equal(sdkmath.LegacyZeroDec()) { borrowPos, err = k.lend.ReBalanceStableRates(ctx, borrowPos) if err != nil { return fmt.Errorf("error in re-balance stable rate check before liquidation") @@ -63,7 +64,7 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { assetIn, _ := k.asset.GetAsset(ctx, lendPair.AssetIn) assetOut, _ := k.asset.GetAsset(ctx, lendPair.AssetOut) - var currentCollateralizationRatio sdk.Dec + var currentCollateralizationRatio sdkmath.LegacyDec var firstTransitAssetID, secondTransitAssetID uint64 // for getting transit assets details for _, data := range pool.AssetData { @@ -88,12 +89,12 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { // a. if borrow is from same pool // b. if borrow is from first transit asset // c. if borrow is from second transit asset - if borrowPos.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { // first condition + if borrowPos.BridgedAssetAmount.Amount.Equal(sdkmath.ZeroInt()) { // first condition currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) if err != nil { return err } - if sdk.Dec.GT(currentCollateralizationRatio, LiquidationThreshold) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, LiquidationThreshold) { // after checking the currentCollateralizationRatio with LiquidationThreshold if borrow is to be liquidated then // CreateLockedBorrow function is called err = k.lend.MsgCalculateBorrowInterest(ctx, lendPos.Owner, borrowPos.ID) @@ -116,7 +117,7 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { if err != nil { return err } - if sdk.Dec.GT(currentCollateralizationRatio, LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { err = k.lend.MsgCalculateBorrowInterest(ctx, lendPos.Owner, borrowPos.ID) if err != nil { return fmt.Errorf("error in MsgCalculateBorrowInterest, liquidate_borrow.go for ID %d", borrowPos.ID) @@ -137,7 +138,7 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { return err } - if sdk.Dec.GT(currentCollateralizationRatio, LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { err = k.lend.MsgCalculateBorrowInterest(ctx, lendPos.Owner, borrowPos.ID) if err != nil { return fmt.Errorf("error in MsgCalculateBorrowInterest, liquidate_borrow.go for ID %d", borrowPos.ID) @@ -163,7 +164,7 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { return nil } -func (k Keeper) CreateLockedBorrow(ctx sdk.Context, borrow lendtypes.BorrowAsset, collateralizationRatio sdk.Dec, appID uint64) (types.LockedVault, error) { +func (k Keeper) CreateLockedBorrow(ctx sdk.Context, borrow lendtypes.BorrowAsset, collateralizationRatio sdkmath.LegacyDec, appID uint64) (types.LockedVault, error) { lockedVaultID := k.GetLockedVaultID(ctx) lendPos, _ := k.lend.GetLend(ctx, borrow.LendingID) kind := &types.LockedVault_BorrowMetaData{ @@ -188,10 +189,10 @@ func (k Keeper) CreateLockedBorrow(ctx sdk.Context, borrow lendtypes.BorrowAsset IsAuctionInProgress: false, CrAtLiquidation: collateralizationRatio, CurrentCollaterlisationRatio: collateralizationRatio, - CollateralToBeAuctioned: sdk.ZeroDec(), + CollateralToBeAuctioned: sdkmath.LegacyZeroDec(), LiquidationTimestamp: ctx.BlockTime(), SellOffHistory: nil, - InterestAccumulated: sdk.ZeroInt(), + InterestAccumulated: sdkmath.ZeroInt(), Kind: kind, } return lockedVault, nil @@ -203,7 +204,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.Lo if borrowMetaData != nil { lendPos, _ := k.lend.GetLend(ctx, borrowMetaData.LendingId) pool, _ := k.lend.GetPool(ctx, lendPos.PoolID) - var unliquidatePointPercentage sdk.Dec + var unliquidatePointPercentage sdkmath.LegacyDec // retrieving transit asset details from cPool var firstTransitAssetID, secondTransitAssetID uint64 for _, data := range pool.AssetData { @@ -228,7 +229,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.Lo } // finding unLiquidate Point percentage - if !borrowMetaData.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { // if bridged asset is being used for borrow (inter-pool borrow) + if !borrowMetaData.BridgedAssetAmount.Amount.Equal(sdkmath.ZeroInt()) { // if bridged asset is being used for borrow (inter-pool borrow) if borrowMetaData.BridgedAssetAmount.Denom == firstBridgeAsset.Denom { unliquidatePointPercentage = LiquidationThreshold.Mul(firstBridgeAssetStats.LiquidationThreshold) } else { @@ -250,10 +251,10 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.Lo assetInTotal, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, updatedLockedVault.AmountIn) assetOutTotal, _ := k.market.CalcAssetPrice(ctx, assetOut.Id, updatedLockedVault.UpdatedAmountOut) - deductionPercentage, _ := sdk.NewDecFromStr("1.0") + deductionPercentage, _ := sdkmath.LegacyNewDecFromStr("1.0") - var c sdk.Dec - if !borrowMetaData.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { + var c sdkmath.LegacyDec + if !borrowMetaData.BridgedAssetAmount.Amount.Equal(sdkmath.ZeroInt()) { if borrowMetaData.BridgedAssetAmount.Denom == firstBridgeAsset.Denom { c = assetRatesStats.Ltv.Mul(firstBridgeAssetStats.Ltv) } else { @@ -271,7 +272,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.Lo numerator := totalOut.Sub(factor1) denominator := deductionPercentage.Sub(factor2) selloffAmount := numerator.Quo(denominator) // Dollar Value - aip, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, sdk.OneInt()) + aip, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, sdkmath.OneInt()) liquidationDeductionAmt := selloffAmount.Mul(LiquidationPenalty.Add(assetRatesStats.LiquidationBonus)) liquidationDeductionAmount := liquidationDeductionAmt.Quo(aip) // To be subtracted from AmountIn along with sellOff amt @@ -291,11 +292,11 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.Lo if !found { allReserveStats = lendtypes.AllReserveStats{ AssetID: pair.AssetIn, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), - AmountInFromRepayments: sdk.ZeroInt(), - TotalAmountOutToLenders: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), + AmountInFromRepayments: sdkmath.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } } allReserveStats.AmountInFromLiqPenalty = allReserveStats.AmountInFromLiqPenalty.Add(penaltyToReserveAmount.TruncateInt()) @@ -313,8 +314,8 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.Lo assetStats.TotalLend = assetStats.TotalLend.Sub(updatedLockedVault.AmountIn) // setting the updated global lend data k.lend.SetAssetStatsByPoolIDAndAssetID(ctx, assetStats) - updatedLockedVault.AmountIn = sdk.ZeroInt() - borrowPos.AmountIn.Amount = sdk.ZeroInt() + updatedLockedVault.AmountIn = sdkmath.ZeroInt() + borrowPos.AmountIn.Amount = sdkmath.ZeroInt() } else { updatedLockedVault.AmountIn = updatedLockedVault.AmountIn.Sub(totalDeduction) lendPos.AmountIn.Amount = lendPos.AmountIn.Amount.Sub(totalDeduction) @@ -393,12 +394,12 @@ func (k Keeper) UnLiquidateLockedBorrows(ctx sdk.Context, appID, id uint64, dutc if !found { reservePoolRecords = lendtypes.BorrowInterestTracker{ BorrowingId: lockedVault.OriginalVaultId, - ReservePoolInterest: sdk.ZeroDec(), + ReservePoolInterest: sdkmath.LegacyZeroDec(), } } borrowPos, _ := k.lend.GetBorrow(ctx, lockedVault.OriginalVaultId) amtToReservePool := reservePoolRecords.ReservePoolInterest - if amtToReservePool.TruncateInt().GT(sdk.ZeroInt()) { + if amtToReservePool.TruncateInt().GT(sdkmath.ZeroInt()) { amount := sdk.NewCoin(assetOut.Denom, amtToReservePool.TruncateInt()) err := k.lend.UpdateReserveBalances(ctx, pair.AssetOut, assetOutPool.ModuleName, amount, true) if err != nil { @@ -408,18 +409,18 @@ func (k Keeper) UnLiquidateLockedBorrows(ctx sdk.Context, appID, id uint64, dutc if !found { allReserveStats = lendtypes.AllReserveStats{ AssetID: pair.AssetOut, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), - AmountInFromRepayments: sdk.ZeroInt(), - TotalAmountOutToLenders: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), + AmountInFromRepayments: sdkmath.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } } allReserveStats.AmountInFromRepayments = allReserveStats.AmountInFromRepayments.Add(amount.Amount) k.lend.SetAllReserveStatsByAssetID(ctx, allReserveStats) } amtToMint := (borrowPos.InterestAccumulated.Sub(amtToReservePool)).TruncateInt() - if amtToMint.GT(sdk.ZeroInt()) { + if amtToMint.GT(sdkmath.ZeroInt()) { err := k.bank.MintCoins(ctx, assetOutPool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, amtToMint))) if err != nil { return err @@ -427,8 +428,8 @@ func (k Keeper) UnLiquidateLockedBorrows(ctx sdk.Context, appID, id uint64, dutc poolAssetLBMappingData.TotalInterestAccumulated = poolAssetLBMappingData.TotalInterestAccumulated.Add(amtToMint) k.lend.SetAssetStatsByPoolIDAndAssetID(ctx, poolAssetLBMappingData) } - borrowPos.InterestAccumulated = borrowPos.InterestAccumulated.Sub(sdk.NewDecFromInt(borrowPos.InterestAccumulated.TruncateInt())) - reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Sub(sdk.NewDecFromInt(amtToReservePool.TruncateInt())) // the decimal precision is maintained + borrowPos.InterestAccumulated = borrowPos.InterestAccumulated.Sub(sdkmath.LegacyNewDecFromInt(borrowPos.InterestAccumulated.TruncateInt())) + reservePoolRecords.ReservePoolInterest = reservePoolRecords.ReservePoolInterest.Sub(sdkmath.LegacyNewDecFromInt(amtToReservePool.TruncateInt())) // the decimal precision is maintained k.lend.SetBorrowInterestTracker(ctx, reservePoolRecords) k.lend.SetBorrow(ctx, borrowPos) diff --git a/x/liquidation/keeper/liquidate_borrow_test.go b/x/liquidation/keeper/liquidate_borrow_test.go index 364dfff0b..7edfac37d 100644 --- a/x/liquidation/keeper/liquidate_borrow_test.go +++ b/x/liquidation/keeper/liquidate_borrow_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" assetTypes "github.com/comdex-official/comdex/x/asset/types" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" lendtypes "github.com/comdex-official/comdex/x/lend/types" @@ -9,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func Dec(s string) sdk.Dec { - dec, err := sdk.NewDecFromStr(s) +func Dec(s string) sdkmath.LegacyDec { + dec, err := sdkmath.LegacyNewDecFromStr(s) if err != nil { panic(err) } @@ -23,7 +24,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err := assetKeeper.AddAppRecords(*ctx, msg1) @@ -32,7 +33,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg2 := assetTypes.AppData{ Name: "harbor", ShortName: "harbor", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg2) @@ -40,7 +41,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg3 := assetTypes.AppData{ Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg3) @@ -49,7 +50,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg4 := assetTypes.Asset{ //1 Name: "ATOM", Denom: "uatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -71,7 +72,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg5 := assetTypes.Asset{ //2 Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -93,7 +94,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg6 := assetTypes.Asset{ //3 Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -115,7 +116,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg13a := assetTypes.Asset{ //4 Name: "OSMO", Denom: "uosmo", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg13a) @@ -135,7 +136,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg11 := assetTypes.Asset{ //5 Name: "CATOM", Denom: "ucatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg11) @@ -144,7 +145,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg12 := assetTypes.Asset{ //6 Name: "CCMDX", Denom: "uccmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg12) @@ -153,7 +154,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg13 := assetTypes.Asset{ //7 Name: "CCMST", Denom: "uccmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg13) @@ -162,7 +163,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg13b := assetTypes.Asset{ //8 Name: "COSMO", Denom: "ucosmo", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg13b) @@ -250,33 +251,33 @@ func (s *KeeperTestSuite) AddAppAssetLend() { assetDataPoolOneAssetOne := &lendtypes.AssetDataPoolMapping{ AssetID: 1, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataPoolOneAssetTwo := &lendtypes.AssetDataPoolMapping{ AssetID: 2, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000), } assetDataPoolOneAssetThree := &lendtypes.AssetDataPoolMapping{ AssetID: 3, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataPoolTwoAssetOne := &lendtypes.AssetDataPoolMapping{ AssetID: 1, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataPoolTwoAssetTwo := &lendtypes.AssetDataPoolMapping{ AssetID: 4, AssetTransitType: 1, - SupplyCap: sdk.NewDec(2000000000000), + SupplyCap: sdkmath.LegacyNewDec(2000000000000), } assetDataPoolTwoAssetThree := &lendtypes.AssetDataPoolMapping{ AssetID: 3, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataCMDXPool = append(assetDataCMDXPool, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -510,7 +511,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { AuctionDurationSeconds: 21600, Buffer: Dec("1.2"), Cusp: Dec("0.7"), - Step: sdk.NewInt(360), + Step: sdkmath.NewInt(360), PriceFunctionType: 1, DutchId: 3, BidDurationSeconds: 3600, @@ -522,28 +523,28 @@ func (s *KeeperTestSuite) AddAppAssetLend() { userAddr := "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t" userAddress, _ := sdk.AccAddressFromBech32(userAddr) - s.fundAddr(userAddress, sdk.NewCoin("uatom", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 1, userAddr, sdk.NewCoin("uatom", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 1, userAddr, sdk.NewCoin("uatom", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(100000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 2, userAddr, sdk.NewCoin("ucmdx", sdk.NewInt(1000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 2, userAddr, sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdk.NewIntFromUint64(100000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdkmath.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 3, userAddr, sdk.NewCoin("ucmst", sdk.NewInt(100000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 3, userAddr, sdk.NewCoin("ucmst", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("uosmo", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 2, 4, userAddr, sdk.NewCoin("uosmo", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uosmo", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 2, 4, userAddr, sdk.NewCoin("uosmo", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 2, 3, userAddr, sdk.NewCoin("ucmst", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 2, 3, userAddr, sdk.NewCoin("ucmst", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("uatom", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 2, 1, userAddr, sdk.NewCoin("uatom", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 2, 1, userAddr, sdk.NewCoin("uatom", sdkmath.NewInt(100000000000))) s.Require().NoError(err) lendKeeper, ctx = &s.lendKeeper, &s.ctx @@ -553,28 +554,28 @@ func (s *KeeperTestSuite) AddAppAssetLend() { Lender: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", AssetId: 1, PoolId: 1, - AmountIn: sdk.NewCoin("uatom", sdk.NewInt(100000000000)), + AmountIn: sdk.NewCoin("uatom", sdkmath.NewInt(100000000000)), PairId: 3, IsStableBorrow: false, - AmountOut: sdk.NewCoin("ucmdx", sdk.NewInt(70000000000)), + AmountOut: sdk.NewCoin("ucmdx", sdkmath.NewInt(70000000000)), AppId: 3, } - s.fundAddr(userAddress, sdk.NewCoin("uatom", sdk.NewIntFromUint64(1000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(1000000000000))) _, err = server.BorrowAlternate(sdk.WrapSDKContext(*ctx), &msg20) s.Require().NoError(err) msg30 := lendtypes.MsgBorrowAlternate{ Lender: "cosmos1kwtdrjkwu6y87vlylaeatzmc5p4jhvn7qwqnkp", AssetId: 1, PoolId: 1, - AmountIn: sdk.NewCoin("uatom", sdk.NewInt(100000000000)), + AmountIn: sdk.NewCoin("uatom", sdkmath.NewInt(100000000000)), PairId: 3, IsStableBorrow: false, - AmountOut: sdk.NewCoin("ucmdx", sdk.NewInt(70000000000)), + AmountOut: sdk.NewCoin("ucmdx", sdkmath.NewInt(70000000000)), AppId: 3, } userAddr2, _ := sdk.AccAddressFromBech32("cosmos1kwtdrjkwu6y87vlylaeatzmc5p4jhvn7qwqnkp") - s.fundAddr(userAddr2, sdk.NewCoin("uatom", sdk.NewIntFromUint64(1000000000000))) + s.fundAddr(userAddr2, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(1000000000000))) _, err = server.BorrowAlternate(sdk.WrapSDKContext(*ctx), &msg30) s.Require().NoError(err) @@ -582,14 +583,14 @@ func (s *KeeperTestSuite) AddAppAssetLend() { Lender: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", AssetId: 2, PoolId: 1, - AmountIn: sdk.NewCoin("ucmdx", sdk.NewInt(100000000000)), + AmountIn: sdk.NewCoin("ucmdx", sdkmath.NewInt(100000000000)), PairId: 13, IsStableBorrow: false, - AmountOut: sdk.NewCoin("uosmo", sdk.NewInt(32500000000)), + AmountOut: sdk.NewCoin("uosmo", sdkmath.NewInt(32500000000)), AppId: 3, } - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(1000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(1000000000000))) _, err = server.BorrowAlternate(sdk.WrapSDKContext(*ctx), &msg40) s.Require().NoError(err) } @@ -662,5 +663,5 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { updatedPrice := price.Sub(price.Mul(Dec("0.09090909090"))) s.Require().Equal(lockedVault[0].CollateralToBeAuctioned.TruncateInt(), updatedPrice.TruncateInt()) - s.Require().Equal(lockedVault[0].CrAtLiquidation, sdk.NewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)).Quo(sdk.NewDecFromInt(beforeAmtIn).Mul(s.GetAssetPrice(1)))) + s.Require().Equal(lockedVault[0].CrAtLiquidation, sdkmath.LegacyNewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)).Quo(sdkmath.LegacyNewDecFromInt(beforeAmtIn).Mul(s.GetAssetPrice(1)))) } diff --git a/x/liquidation/keeper/liquidate_vaults.go b/x/liquidation/keeper/liquidate_vaults.go index 0469dbcee..2f9da3e55 100644 --- a/x/liquidation/keeper/liquidate_vaults.go +++ b/x/liquidation/keeper/liquidate_vaults.go @@ -3,6 +3,9 @@ package keeper import ( "fmt" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -103,7 +106,7 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { return nil } -func (k Keeper) CreateLockedVault(ctx sdk.Context, vault vaulttypes.Vault, totalIn sdk.Dec, collateralizationRatio sdk.Dec, appID uint64, totalFees sdk.Int) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, vault vaulttypes.Vault, totalIn sdkmath.LegacyDec, collateralizationRatio sdkmath.LegacyDec, appID uint64, totalFees sdkmath.Int) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -114,7 +117,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, vault vaulttypes.Vault, total Owner: vault.Owner, AmountIn: vault.AmountIn, AmountOut: vault.AmountOut, - UpdatedAmountOut: sdk.ZeroInt(), + UpdatedAmountOut: sdkmath.ZeroInt(), Initiator: types.ModuleName, IsAuctionComplete: false, IsAuctionInProgress: false, @@ -136,7 +139,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, vault vaulttypes.Vault, total return nil } -func (k Keeper) GetModAccountBalances(ctx sdk.Context, accountName string, denom string) sdk.Int { +func (k Keeper) GetModAccountBalances(ctx sdk.Context, accountName string, denom string) sdkmath.Int { macc := k.account.GetModuleAccount(ctx, accountName) return k.bank.GetBalance(ctx, macc.GetAddress(), denom).Amount } @@ -273,10 +276,10 @@ func (k Keeper) GetLockedVaultByApp(ctx sdk.Context, appID uint64) (lockedVault var ( store = k.Store(ctx) key = types.LockedVaultKeyByApp(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -294,10 +297,10 @@ func (k Keeper) GetLockedVaultByApp(ctx sdk.Context, appID uint64) (lockedVault func (k Keeper) GetLockedVaults(ctx sdk.Context) (lockedVaults []types.LockedVault) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LockedVaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LockedVaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -371,10 +374,10 @@ func (k Keeper) GetAppIDByAppForLiquidation(ctx sdk.Context, appID uint64) (uint func (k Keeper) GetAppIdsForLiquidation(ctx sdk.Context) (appIds []uint64) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AppIdsKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AppIdsKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/liquidation/keeper/liquidate_vaults_test.go b/x/liquidation/keeper/liquidate_vaults_test.go index ef2801139..34c0ce4a1 100644 --- a/x/liquidation/keeper/liquidate_vaults_test.go +++ b/x/liquidation/keeper/liquidate_vaults_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" liquidationTypes "github.com/comdex-official/comdex/x/liquidation/types" @@ -29,15 +30,15 @@ func (s *KeeperTestSuite) AddPairAndExtendedPairVault1() { bindings.MsgAddExtendedPairsVault{ AppID: 1, PairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -101,8 +102,8 @@ func (s *KeeperTestSuite) CreateVault() { From: userAddress1, AppId: 1, ExtendedPairVaultId: 1, - AmountIn: sdk.NewIntFromUint64(1000000), - AmountOut: sdk.NewIntFromUint64(1000000), + AmountIn: sdkmath.NewIntFromUint64(1000000), + AmountOut: sdkmath.NewIntFromUint64(1000000), }, }, { @@ -111,8 +112,8 @@ func (s *KeeperTestSuite) CreateVault() { From: userAddress2, AppId: 1, ExtendedPairVaultId: 1, - AmountIn: sdk.NewIntFromUint64(1000000), - AmountOut: sdk.NewIntFromUint64(1000000), + AmountIn: sdkmath.NewIntFromUint64(1000000), + AmountOut: sdkmath.NewIntFromUint64(1000000), }, }, } { @@ -141,10 +142,10 @@ func (s *KeeperTestSuite) GetVaultCountForExtendedPairIDbyAppID(appID, extID uin return len(res.VaultIds) } -func (s *KeeperTestSuite) GetAssetPrice(id uint64) sdk.Dec { +func (s *KeeperTestSuite) GetAssetPrice(id uint64) sdkmath.LegacyDec { price, err := s.app.MarketKeeper.GetLatestPrice(s.ctx, id) s.Suite.NoError(err) - price1 := sdk.NewDecFromInt(sdk.NewIntFromUint64(price)) + price1 := sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(price)) return price1 } @@ -155,12 +156,12 @@ func (s *KeeperTestSuite) AddAppAsset() { s.Require().NoError(err) addr2, err := sdk.AccAddressFromBech32(userAddress2) s.Require().NoError(err) - genesisSupply := sdk.NewIntFromUint64(1000000) + genesisSupply := sdkmath.NewIntFromUint64(1000000) assetKeeper, ctx := &s.assetKeeper, &s.ctx msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -189,7 +190,7 @@ func (s *KeeperTestSuite) AddAppAsset() { assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, }, @@ -199,7 +200,7 @@ func (s *KeeperTestSuite) AddAppAsset() { assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, }, @@ -209,7 +210,7 @@ func (s *KeeperTestSuite) AddAppAsset() { assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, }, @@ -218,8 +219,8 @@ func (s *KeeperTestSuite) AddAppAsset() { s.Run(tc.name, func() { err := assetKeeper.AddAssetRecords(*ctx, tc.msg) s.Require().NoError(err) - s.fundAddr(addr, sdk.NewCoin(tc.msg.Denom, sdk.NewInt(1000000))) - s.fundAddr(addr2, sdk.NewCoin(tc.msg.Denom, sdk.NewInt(1000000))) + s.fundAddr(addr, sdk.NewCoin(tc.msg.Denom, sdkmath.NewInt(1000000))) + s.fundAddr(addr2, sdk.NewCoin(tc.msg.Denom, sdkmath.NewInt(1000000))) }) } } @@ -256,7 +257,7 @@ func (s *KeeperTestSuite) TestLiquidateVaults1() { s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) s.Require().Equal(lockedVault[0].AmountIn, beforeVault.AmountIn) s.Require().Equal(lockedVault[0].AmountOut, beforeVault.AmountOut) - s.Require().Equal(lockedVault[0].UpdatedAmountOut, sdk.ZeroInt()) + s.Require().Equal(lockedVault[0].UpdatedAmountOut, sdkmath.ZeroInt()) s.Require().Equal(lockedVault[0].Initiator, liquidationTypes.ModuleName) s.Require().Equal(lockedVault[0].IsAuctionInProgress, true) s.Require().Equal(lockedVault[0].IsAuctionComplete, false) @@ -264,7 +265,7 @@ func (s *KeeperTestSuite) TestLiquidateVaults1() { price, err := s.app.MarketKeeper.CalcAssetPrice(*ctx, uint64(1), beforeVault.AmountIn) s.Require().NoError(err) s.Require().Equal(lockedVault[0].CollateralToBeAuctioned, price) - s.Require().Equal(lockedVault[0].CrAtLiquidation, sdk.NewDecFromInt(lockedVault[0].AmountIn).Mul(s.GetAssetPrice(1)).Quo(sdk.NewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)))) + s.Require().Equal(lockedVault[0].CrAtLiquidation, sdkmath.LegacyNewDecFromInt(lockedVault[0].AmountIn).Mul(s.GetAssetPrice(1)).Quo(sdkmath.LegacyNewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)))) } func (s *KeeperTestSuite) TestUpdateLockedVaults() { @@ -272,7 +273,7 @@ func (s *KeeperTestSuite) TestUpdateLockedVaults() { liquidationKeeper, ctx := &s.liquidationKeeper, &s.ctx lockedVault1 := liquidationKeeper.GetLockedVaults(*ctx) - s.Require().Equal(lockedVault1[0].CrAtLiquidation, sdk.NewDecFromInt(lockedVault1[0].AmountIn).Mul(s.GetAssetPrice(1)).Quo(sdk.NewDecFromInt(lockedVault1[0].AmountOut).Mul(s.GetAssetPrice(2)))) + s.Require().Equal(lockedVault1[0].CrAtLiquidation, sdkmath.LegacyNewDecFromInt(lockedVault1[0].AmountIn).Mul(s.GetAssetPrice(1)).Quo(sdkmath.LegacyNewDecFromInt(lockedVault1[0].AmountOut).Mul(s.GetAssetPrice(2)))) } func (s *KeeperTestSuite) TestSetFlags() { diff --git a/x/liquidation/keeper/msg_server.go b/x/liquidation/keeper/msg_server.go index 5815acbf6..1783eccc9 100644 --- a/x/liquidation/keeper/msg_server.go +++ b/x/liquidation/keeper/msg_server.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "context" "fmt" @@ -109,7 +110,7 @@ func (k msgServer) MsgLiquidateBorrow(c context.Context, msg *types.MsgLiquidate if err != nil { return nil, err } - if !borrowPos.StableBorrowRate.Equal(sdk.ZeroDec()) { + if !borrowPos.StableBorrowRate.Equal(sdkmath.LegacyZeroDec()) { borrowPos, err = k.lend.ReBalanceStableRates(ctx, borrowPos) if err != nil { return nil, err @@ -125,7 +126,7 @@ func (k msgServer) MsgLiquidateBorrow(c context.Context, msg *types.MsgLiquidate assetIn, _ := k.asset.GetAsset(ctx, lendPair.AssetIn) assetOut, _ := k.asset.GetAsset(ctx, lendPair.AssetOut) - var currentCollateralizationRatio sdk.Dec + var currentCollateralizationRatio sdkmath.LegacyDec var firstTransitAssetID, secondTransitAssetID uint64 // for getting transit assets details for _, data := range pool.AssetData { @@ -145,12 +146,12 @@ func (k msgServer) MsgLiquidateBorrow(c context.Context, msg *types.MsgLiquidate // a. if borrow is from same pool // b. if borrow is from first transit asset // c. if borrow is from second transit asset - if borrowPos.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { // first condition + if borrowPos.BridgedAssetAmount.Amount.Equal(sdkmath.ZeroInt()) { // first condition currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) if err != nil { return nil, err } - if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { // after checking the currentCollateralizationRatio with LiquidationThreshold if borrow is to be liquidated then // CreateLockedBorrow function is called lockedVault, err := k.CreateLockedBorrow(ctx, borrowPos, currentCollateralizationRatio, lendPos.AppID) @@ -167,7 +168,7 @@ func (k msgServer) MsgLiquidateBorrow(c context.Context, msg *types.MsgLiquidate } else { if borrowPos.BridgedAssetAmount.Denom == firstBridgedAsset.Denom { currentCollateralizationRatio, _ = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) - if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { lockedVault, err := k.CreateLockedBorrow(ctx, borrowPos, currentCollateralizationRatio, lendPos.AppID) if err != nil { return nil, err @@ -182,7 +183,7 @@ func (k msgServer) MsgLiquidateBorrow(c context.Context, msg *types.MsgLiquidate } else { currentCollateralizationRatio, _ = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) - if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { lockedVault, err := k.CreateLockedBorrow(ctx, borrowPos, currentCollateralizationRatio, lendPos.AppID) if err != nil { return nil, err diff --git a/x/liquidation/keeper/query_server.go b/x/liquidation/keeper/query_server.go index be3ba114e..0d0c87448 100644 --- a/x/liquidation/keeper/query_server.go +++ b/x/liquidation/keeper/query_server.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" diff --git a/x/liquidation/module.go b/x/liquidation/module.go index 104846cee..a6c4b1c66 100644 --- a/x/liquidation/module.go +++ b/x/liquidation/module.go @@ -133,6 +133,12 @@ func (am AppModule) RegisterServices(configurator module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -155,12 +161,11 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, request abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context) error { //BeginBlocker(ctx, request, am.keeper) + return nil } -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/liquidation/types/errors.go b/x/liquidation/types/errors.go index f0c2eaa1c..15adfa14c 100644 --- a/x/liquidation/types/errors.go +++ b/x/liquidation/types/errors.go @@ -3,16 +3,16 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - LockedVaultDoesNotExist = sdkerrors.Register(ModuleName, 701, "locked vault does not exist with given id") - BorrowDoesNotExist = sdkerrors.Register(ModuleName, 702, "borrow position does not exist with given id") - BorrowPosAlreadyLiquidated = sdkerrors.Register(ModuleName, 703, "borrow position already liquidated") - ErrAppIDExists = sdkerrors.Register(ModuleName, 704, "App Id exists") - ErrAppIDDoesNotExists = sdkerrors.Register(ModuleName, 705, "App Id does not exist") - ErrAppIDInvalid = sdkerrors.Register(ModuleName, 706, "App Id invalid") - ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 707, "Vault Id invalid") - ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 708, "Unknown msg type") + LockedVaultDoesNotExist = errorsmod.Register(ModuleName, 701, "locked vault does not exist with given id") + BorrowDoesNotExist = errorsmod.Register(ModuleName, 702, "borrow position does not exist with given id") + BorrowPosAlreadyLiquidated = errorsmod.Register(ModuleName, 703, "borrow position already liquidated") + ErrAppIDExists = errorsmod.Register(ModuleName, 704, "App Id exists") + ErrAppIDDoesNotExists = errorsmod.Register(ModuleName, 705, "App Id does not exist") + ErrAppIDInvalid = errorsmod.Register(ModuleName, 706, "App Id invalid") + ErrVaultIDInvalid = errorsmod.Register(ModuleName, 707, "Vault Id invalid") + ErrorUnknownMsgType = errorsmod.Register(ModuleName, 708, "Unknown msg type") ) diff --git a/x/liquidation/types/locked_vault.pb.go b/x/liquidation/types/locked_vault.pb.go index 61c76493c..7bc20e5c5 100644 --- a/x/liquidation/types/locked_vault.pb.go +++ b/x/liquidation/types/locked_vault.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -30,25 +31,25 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type LockedVault struct { - LockedVaultId uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"id"` - OriginalVaultId uint64 `protobuf:"varint,3,opt,name=original_vault_id,json=originalVaultId,proto3" json:"original_vault_id,omitempty" yaml:"id"` - ExtendedPairId uint64 `protobuf:"varint,4,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - AmountIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=amount_in,json=amountIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in" yaml:"amount_in"` - AmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=amount_out,json=amountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out" yaml:"amount_out"` + LockedVaultId uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"id"` + OriginalVaultId uint64 `protobuf:"varint,3,opt,name=original_vault_id,json=originalVaultId,proto3" json:"original_vault_id,omitempty" yaml:"id"` + ExtendedPairId uint64 `protobuf:"varint,4,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` + AmountIn cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=amount_in,json=amountIn,proto3,customtype=cosmossdk.io/math.Int" json:"amount_in" yaml:"amount_in"` + AmountOut cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=amount_out,json=amountOut,proto3,customtype=cosmossdk.io/math.Int" json:"amount_out" yaml:"amount_out"` //updated_amount_out = amount_out + interest_accumulated + opening_fee_accumulated // + closing_fee_accumulated - UpdatedAmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=updated_amount_out,json=updatedAmountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"updated_amount_out" yaml:"updated_amount_out"` - Initiator string `protobuf:"bytes,9,opt,name=initiator,proto3" json:"initiator,omitempty" yaml:"admin"` - IsAuctionComplete bool `protobuf:"varint,10,opt,name=is_auction_complete,json=isAuctionComplete,proto3" json:"is_auction_complete,omitempty" yaml:"is_auction_complete"` - IsAuctionInProgress bool `protobuf:"varint,11,opt,name=is_auction_in_progress,json=isAuctionInProgress,proto3" json:"is_auction_in_progress,omitempty" yaml:"is_auction_in_progress"` - CrAtLiquidation github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=cr_at_liquidation,json=crAtLiquidation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cr_at_liquidation" yaml:"cr_at_liquidation"` - CurrentCollaterlisationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` - CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,14,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_to_be_auctioned" yaml:"collateral_to_be_auctioned"` - LiquidationTimestamp time.Time `protobuf:"bytes,15,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` - SellOffHistory []string `protobuf:"bytes,16,rep,name=selloff_history,json=selloffHistory,proto3" json:"selloff_history,omitempty" yaml:"selloff_history"` - InterestAccumulated github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,17,opt,name=interest_accumulated,json=interestAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"interest_accumulated" yaml:"interest_accumulated"` + UpdatedAmountOut cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=updated_amount_out,json=updatedAmountOut,proto3,customtype=cosmossdk.io/math.Int" json:"updated_amount_out" yaml:"updated_amount_out"` + Initiator string `protobuf:"bytes,9,opt,name=initiator,proto3" json:"initiator,omitempty" yaml:"admin"` + IsAuctionComplete bool `protobuf:"varint,10,opt,name=is_auction_complete,json=isAuctionComplete,proto3" json:"is_auction_complete,omitempty" yaml:"is_auction_complete"` + IsAuctionInProgress bool `protobuf:"varint,11,opt,name=is_auction_in_progress,json=isAuctionInProgress,proto3" json:"is_auction_in_progress,omitempty" yaml:"is_auction_in_progress"` + CrAtLiquidation cosmossdk_io_math.LegacyDec `protobuf:"bytes,12,opt,name=cr_at_liquidation,json=crAtLiquidation,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"cr_at_liquidation" yaml:"cr_at_liquidation"` + CurrentCollaterlisationRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,13,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` + CollateralToBeAuctioned cosmossdk_io_math.LegacyDec `protobuf:"bytes,14,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"collateral_to_be_auctioned" yaml:"collateral_to_be_auctioned"` + LiquidationTimestamp time.Time `protobuf:"bytes,15,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` + SellOffHistory []string `protobuf:"bytes,16,rep,name=selloff_history,json=selloffHistory,proto3" json:"selloff_history,omitempty" yaml:"selloff_history"` + InterestAccumulated cosmossdk_io_math.Int `protobuf:"bytes,17,opt,name=interest_accumulated,json=interestAccumulated,proto3,customtype=cosmossdk.io/math.Int" json:"interest_accumulated" yaml:"interest_accumulated"` // Types that are valid to be assigned to Kind: // *LockedVault_BorrowMetaData Kind isLockedVault_Kind `protobuf_oneof:"kind"` @@ -123,7 +124,7 @@ func (*LockedVault) XXX_OneofWrappers() []interface{} { type BorrowMetaData struct { LendingId uint64 `protobuf:"varint,1,opt,name=lending_id,json=lendingId,proto3" json:"lending_id,omitempty"` IsStableBorrow bool `protobuf:"varint,2,opt,name=is_stable_borrow,json=isStableBorrow,proto3" json:"is_stable_borrow,omitempty"` - StableBorrowRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=stable_borrow_rate,json=stableBorrowRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stable_borrow_rate" yaml:"stable_borrow_rate"` + StableBorrowRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=stable_borrow_rate,json=stableBorrowRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stable_borrow_rate" yaml:"stable_borrow_rate"` BridgedAssetAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=bridged_asset_amount,json=bridgedAssetAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bridged_asset_amount" yaml:"bridged_asset_amount"` } @@ -170,77 +171,78 @@ func init() { } var fileDescriptor_6e1145b6fa4b74d3 = []byte{ - // 1109 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xa6, 0x49, 0x88, 0x27, 0xad, 0x3f, 0x26, 0x21, 0xdd, 0x98, 0xc6, 0x63, 0xf6, 0x50, - 0x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2c, 0xf8, 0x83, 0x01, 0xaa, 0x6e, 0x84, 0x89, 0xc0, 0x33, - 0x6f, 0x89, 0x79, 0x53, 0xee, 0xcc, 0xb7, 0x4b, 0xf4, 0xe7, 0x21, 0x75, 0xf3, 0x6b, 0x79, 0x10, - 0xb5, 0xc5, 0xe1, 0x54, 0x28, 0x4b, 0x91, 0xa9, 0x8a, 0xba, 0xe6, 0x61, 0x39, 0x65, 0x77, 0x1e, - 0x0c, 0x7f, 0x37, 0x00, 0x72, 0x93, 0x28, 0xa2, 0xa1, 0xc0, 0x2e, 0xf7, 0x7d, 0x22, 0x68, 0x44, - 0x7c, 0x16, 0xcb, 0x2c, 0x8e, 0xf2, 0x0f, 0xf3, 0x96, 0xac, 0xec, 0x6c, 0xe9, 0xca, 0xee, 0x1c, - 0x28, 0xe1, 0x03, 0xad, 0x3b, 0x96, 0x75, 0xf2, 0xbf, 0x59, 0x8a, 0xee, 0xea, 0x32, 0xff, 0xdf, - 0xde, 0x72, 0xf6, 0xdc, 0x79, 0x1d, 0x32, 0x27, 0x04, 0x7f, 0x33, 0x40, 0x6d, 0xca, 0xc5, 0x82, - 0xe3, 0x1e, 0x1d, 0x77, 0x83, 0x7a, 0x66, 0x49, 0x56, 0x1f, 0x2e, 0x5d, 0xfd, 0xed, 0xa9, 0xdd, - 0x53, 0xde, 0xa1, 0xed, 0xb1, 0x60, 0x96, 0xa2, 0xf7, 0x75, 0xe1, 0x6f, 0x34, 0xb5, 0x9c, 0xdb, - 0xee, 0x62, 0x36, 0xfc, 0xc9, 0x00, 0xef, 0xce, 0xb4, 0x04, 0x4f, 0x66, 0x82, 0x59, 0x6e, 0x18, - 0xcd, 0xcd, 0xfb, 0x35, 0x5b, 0x4d, 0x0d, 0x7b, 0x3c, 0x35, 0xec, 0xa7, 0x63, 0x44, 0xe7, 0xf3, - 0x7c, 0x11, 0xa3, 0x14, 0x6d, 0xcf, 0x74, 0x70, 0x92, 0xcd, 0x52, 0x74, 0x47, 0xd5, 0xb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x12, 0x84, 0xe7, 0x00, 0xce, 0xc1, 0xf2, 0xeb, 0x40, 0xe5, - 0x3c, 0x2e, 0x76, 0xbe, 0x5c, 0xee, 0x38, 0x4f, 0x9f, 0xec, 0xeb, 0x8a, 0x96, 0x53, 0x89, 0x67, - 0x6c, 0x1d, 0x22, 0x28, 0xfc, 0xd9, 0x00, 0xdb, 0xbd, 0x88, 0x79, 0x83, 0xfc, 0x71, 0x8f, 0x63, - 0x2a, 0xf4, 0x13, 0x2f, 0x47, 0xf7, 0xe6, 0xfd, 0x5d, 0x5b, 0x99, 0xd8, 0xf9, 0x0f, 0x97, 0xc9, - 0xa6, 0x1d, 0x70, 0x16, 0xaa, 0x39, 0x3a, 0x6d, 0xd5, 0x22, 0x11, 0xeb, 0xdf, 0x14, 0x7d, 0xf0, - 0x16, 0x75, 0xe7, 0x7a, 0x0e, 0xd4, 0x0a, 0xed, 0x5c, 0x40, 0xcd, 0x94, 0xce, 0xd7, 0x17, 0xff, - 0xd4, 0x0b, 0xbf, 0x8e, 0xea, 0x85, 0x8b, 0x51, 0xdd, 0x78, 0x3d, 0xaa, 0x1b, 0x7f, 0x8f, 0xea, - 0xc6, 0xab, 0xcb, 0x7a, 0xe1, 0xf5, 0x65, 0xbd, 0xf0, 0xc7, 0x65, 0xbd, 0xf0, 0xcd, 0xc7, 0x73, - 0xf2, 0x79, 0x9b, 0xf7, 0x79, 0xbf, 0xcf, 0x5c, 0x46, 0x7c, 0xfd, 0xbd, 0x35, 0xff, 0xbb, 0x4f, - 0x3a, 0xf6, 0xd6, 0xe5, 0x9d, 0x7b, 0xf0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x71, 0x21, 0x19, - 0x41, 0x1a, 0x0a, 0x00, 0x00, + // 1121 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x49, 0x6f, 0xdb, 0x46, + 0x14, 0x16, 0x9d, 0xd8, 0xb5, 0xc6, 0x89, 0x2c, 0x8d, 0x1d, 0x87, 0x51, 0x62, 0x8d, 0xca, 0x43, + 0x2b, 0x14, 0x35, 0x89, 0x24, 0x28, 0x50, 0x74, 0x41, 0x2b, 0x39, 0x05, 0x22, 0xc0, 0xad, 0x03, + 0x66, 0x29, 0x90, 0x43, 0x89, 0x11, 0x39, 0x92, 0x07, 0x26, 0x39, 0x2a, 0x39, 0x4c, 0x62, 0xa0, + 0xe8, 0x6f, 0x48, 0xcf, 0xbd, 0xf4, 0xd8, 0x3f, 0x50, 0xf4, 0x2f, 0xf8, 0x98, 0x63, 0xd1, 0x03, + 0xdb, 0xca, 0x87, 0xde, 0x79, 0xec, 0xa9, 0x98, 0x45, 0x9b, 0xa5, 0xc4, 0xb9, 0x58, 0xe6, 0x7b, + 0xdf, 0xf2, 0xf8, 0x66, 0xe6, 0x0d, 0xc1, 0x9e, 0xcf, 0xa2, 0x80, 0xbc, 0x70, 0x42, 0xfa, 0x7d, + 0x46, 0x03, 0xcc, 0x29, 0x8b, 0x9d, 0x67, 0xb7, 0x7b, 0x84, 0xe3, 0xdb, 0x4e, 0xc8, 0xfc, 0x63, + 0x12, 0x78, 0xcf, 0x70, 0x16, 0x72, 0x7b, 0x98, 0x30, 0xce, 0x60, 0x5d, 0xc1, 0xed, 0x19, 0xb8, + 0xad, 0xe1, 0xf5, 0xed, 0x01, 0x1b, 0x30, 0x09, 0x73, 0xc4, 0x7f, 0x8a, 0x51, 0x47, 0x03, 0xc6, + 0x06, 0x21, 0x71, 0xe4, 0x53, 0x2f, 0xeb, 0x3b, 0x9c, 0x46, 0x24, 0xe5, 0x38, 0x1a, 0x6a, 0x40, + 0xc3, 0x67, 0x69, 0xc4, 0x52, 0xa7, 0x87, 0x53, 0x32, 0xb1, 0xf6, 0x19, 0x8d, 0x55, 0xde, 0xfa, + 0xbd, 0x02, 0x36, 0x0e, 0x64, 0x25, 0x4f, 0x44, 0x21, 0xd0, 0x06, 0x2b, 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, 0x07, 0xa7, 0x09, 0x00, + 0x00, } func (m *LockedVault) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidation/types/msg.go b/x/liquidation/types/msg.go index a7ef09076..451957037 100644 --- a/x/liquidation/types/msg.go +++ b/x/liquidation/types/msg.go @@ -1,8 +1,8 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" ) var ( @@ -31,10 +31,10 @@ func (m *MsgLiquidateVaultRequest) Type() string { func (m *MsgLiquidateVaultRequest) ValidateBasic() error { if m.AppId == 0 { - return errors.Wrap(ErrAppIDInvalid, "app_id cannot be zero") + return errorsmod.Wrap(ErrAppIDInvalid, "app_id cannot be zero") } if m.VaultId == 0 { - return errors.Wrap(ErrVaultIDInvalid, "vault_id cannot be nil") + return errorsmod.Wrap(ErrVaultIDInvalid, "vault_id cannot be nil") } return nil @@ -73,7 +73,7 @@ func (m *MsgLiquidateBorrowRequest) Type() string { func (m *MsgLiquidateBorrowRequest) ValidateBasic() error { if m.BorrowId == 0 { - return errors.Wrap(ErrVaultIDInvalid, "borrow_id cannot be zero") + return errorsmod.Wrap(ErrVaultIDInvalid, "borrow_id cannot be zero") } return nil diff --git a/x/liquidationsV2/abci.go b/x/liquidationsV2/abci.go index b8d3ad507..5bdfdc77b 100644 --- a/x/liquidationsV2/abci.go +++ b/x/liquidationsV2/abci.go @@ -5,12 +5,11 @@ import ( "github.com/comdex-official/comdex/x/liquidationsV2/keeper" "github.com/comdex-official/comdex/x/liquidationsV2/types" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" ) -func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper) { +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) err := k.Liquidate(ctx) diff --git a/x/liquidationsV2/client/cli/tx.go b/x/liquidationsV2/client/cli/tx.go index ec429d4a1..81ad6af6a 100644 --- a/x/liquidationsV2/client/cli/tx.go +++ b/x/liquidationsV2/client/cli/tx.go @@ -1,15 +1,17 @@ package cli import ( + sdkmath "cosmossdk.io/math" "fmt" + "strconv" + "time" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" flag "github.com/spf13/pflag" - "strconv" - "time" "github.com/spf13/cobra" @@ -182,7 +184,7 @@ func NewCmdSubmitWhitelistingLiquidationProposal() *cobra.Command { } txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) - if err !=nil { + if err != nil { return err } txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) @@ -214,12 +216,12 @@ func WhitelistLiquidation(clientCtx client.Context, txf tx.Factory, fs *flag.Fla return txf, nil, fmt.Errorf("failed to parse appId: %w", err) } - premium, err := sdk.NewDecFromStr(liquidationWhitelisting.Premium) + premium, err := sdkmath.LegacyNewDecFromStr(liquidationWhitelisting.Premium) if err != nil { return txf, nil, err } - discount, err := sdk.NewDecFromStr(liquidationWhitelisting.Discount) + discount, err := sdkmath.LegacyNewDecFromStr(liquidationWhitelisting.Discount) if err != nil { return txf, nil, err } @@ -237,9 +239,9 @@ func WhitelistLiquidation(clientCtx client.Context, txf tx.Factory, fs *flag.Fla dutchAuctionParam := types.DutchAuctionParam{ Premium: premium, Discount: discount, - DecrementFactor: sdk.NewInt(decrementFactor), + DecrementFactor: sdkmath.NewInt(decrementFactor), } - englishAuctionParam := types.EnglishAuctionParam{DecrementFactor: sdk.NewInt(decrementFactorEnglish)} + englishAuctionParam := types.EnglishAuctionParam{DecrementFactor: sdkmath.NewInt(decrementFactorEnglish)} liquidationWhitelistingStruct := types.LiquidationWhiteListing{ AppId: appId, @@ -262,9 +264,5 @@ func WhitelistLiquidation(clientCtx client.Context, txf tx.Factory, fs *flag.Fla return txf, nil, err } - if err = msg.ValidateBasic(); err != nil { - return txf, nil, err - } - return txf, msg, nil } diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index befd39057..545527303 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -1,6 +1,8 @@ package expected import ( + "context" + sdkmath "cosmossdk.io/math" assettypes "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auctionsV2/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" @@ -11,20 +13,19 @@ import ( rewardstypes "github.com/comdex-official/comdex/x/rewards/types" "github.com/comdex-official/comdex/x/vault/types" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) type AccountKeeper interface { - GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI + GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI } type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderModule string, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, address sdk.AccAddress, name string, coins sdk.Coins) error } type AssetKeeper interface { @@ -37,7 +38,7 @@ type AssetKeeper interface { type VaultKeeper interface { GetAppMappingData(ctx sdk.Context, appMappingID uint64) (appExtendedPairVaultData []types.AppExtendedPairVaultMappingData, found bool) - CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdk.Int, amountOut sdk.Int) (sdk.Dec, error) + CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdkmath.Int, amountOut sdkmath.Int) (sdkmath.LegacyDec, error) GetVault(ctx sdk.Context, id uint64) (vault types.Vault, found bool) GetVaults(ctx sdk.Context) (vaults []types.Vault) GetIDForVault(ctx sdk.Context) uint64 @@ -45,15 +46,15 @@ type VaultKeeper interface { GetLengthOfVault(ctx sdk.Context) uint64 SetLengthOfVault(ctx sdk.Context, length uint64) UpdateAppExtendedPairVaultMappingDataOnMsgCreate(ctx sdk.Context, vaultData types.Vault) - UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) DeleteUserVaultExtendedPairMapping(ctx sdk.Context, address string, appID uint64, pairVaultID uint64) DeleteAddressFromAppExtendedPairVaultMapping(ctx sdk.Context, extendedPairID uint64, userVaultID uint64, appMappingID uint64) SetVault(ctx sdk.Context, vault types.Vault) } type MarketKeeper interface { - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) } @@ -67,8 +68,8 @@ type LendKeeper interface { GetBorrow(ctx sdk.Context, id uint64) (borrow lendtypes.BorrowAsset, found bool) GetLendPair(ctx sdk.Context, id uint64) (pair lendtypes.Extended_Pair, found bool) GetAssetRatesParams(ctx sdk.Context, assetID uint64) (assetRatesStats lendtypes.AssetRatesParams, found bool) - VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset, liquidationThreshold sdk.Dec) error - CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset) (sdk.Dec, error) + VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdkmath.Int, assetIn assettypes.Asset, amountOut sdkmath.Int, assetOut assettypes.Asset, liquidationThreshold sdkmath.LegacyDec) error + CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdkmath.Int, assetIn assettypes.Asset, amountOut sdkmath.Int, assetOut assettypes.Asset) (sdkmath.LegacyDec, error) GetLend(ctx sdk.Context, id uint64) (lend lendtypes.LendAsset, found bool) // CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.LockedVault) GetPool(ctx sdk.Context, id uint64) (pool lendtypes.Pool, found bool) @@ -84,19 +85,19 @@ type LendKeeper interface { DeleteIDFromAssetStatsMapping(ctx sdk.Context, poolID, assetID, id uint64, typeOfID bool) DeleteBorrowIDFromUserMapping(ctx sdk.Context, owner string, lendID, borrowID uint64) DeleteBorrowInterestTracker(ctx sdk.Context, ID uint64) - UpdateBorrowStats(ctx sdk.Context, pair lendtypes.Extended_Pair, isStableBorrow bool, amount sdk.Int, inc bool) + UpdateBorrowStats(ctx sdk.Context, pair lendtypes.Extended_Pair, isStableBorrow bool, amount sdkmath.Int, inc bool) GetBorrowInterestTracker(ctx sdk.Context, ID uint64) (interest lendtypes.BorrowInterestTracker, found bool) SetBorrowInterestTracker(ctx sdk.Context, interest lendtypes.BorrowInterestTracker) SetAllReserveStatsByAssetID(ctx sdk.Context, allReserveStats lendtypes.AllReserveStats) GetAllReserveStatsByAssetID(ctx sdk.Context, id uint64) (allReserveStats lendtypes.AllReserveStats, found bool) MsgCalculateBorrowInterest(ctx sdk.Context, borrowerAddr string, borrowID uint64) error - UpdateLendStats(ctx sdk.Context, AssetID, PoolID uint64, amount sdk.Int, inc bool) + UpdateLendStats(ctx sdk.Context, AssetID, PoolID uint64, amount sdkmath.Int, inc bool) DeleteLendForAddressByAsset(ctx sdk.Context, address string, lendingID uint64) DeleteLend(ctx sdk.Context, id uint64) } type RewardsKeeper interface { - CalculateVaultInterest(ctx sdk.Context, appID, assetID, lockerID uint64, NetBalance sdk.Int, blockHeight int64, lockerBlockTime int64) error + CalculateVaultInterest(ctx sdk.Context, appID, assetID, lockerID uint64, NetBalance sdkmath.Int, blockHeight int64, lockerBlockTime int64) error DeleteVaultInterestTracker(ctx sdk.Context, vault rewardstypes.VaultInterestTracker) } @@ -107,12 +108,12 @@ type AuctionsV2Keeper interface { type CollectorKeeper interface { GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData collectortypes.AppToAssetIdCollectorMapping, found bool) - UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdk.Int) error + UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdkmath.Int) error GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup collectortypes.CollectorLookupTableData, found bool) GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable collectortypes.AppAssetIdToAuctionLookupTable, found bool) GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData collectortypes.AppAssetIdToFeeCollectedData, found bool) - GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) - SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error + GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdkmath.Int) (sdkmath.Int, error) + SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdkmath.Int) error SetAuctionMappingForApp(ctx sdk.Context, records collectortypes.AppAssetIdToAuctionLookupTable) error GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []collectortypes.AppAssetIdToAuctionLookupTable, found bool) } diff --git a/x/liquidationsV2/handler.go b/x/liquidationsV2/handler.go index b9568b37a..b71f9c8a3 100644 --- a/x/liquidationsV2/handler.go +++ b/x/liquidationsV2/handler.go @@ -1,15 +1,16 @@ package liquidationsV2 import ( + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/liquidationsV2/keeper" "github.com/comdex-official/comdex/x/liquidationsV2/types" + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -27,7 +28,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) + return nil, errorsmod.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } } } @@ -38,7 +39,7 @@ func NewLiquidationsV2Handler(k keeper.Keeper) govtypes.Handler { case *types.WhitelistLiquidationProposal: return handleWhitelistLiquidationProposal(ctx, k, c) default: - return sdkerrors.Wrapf(types.ErrorUnknownProposalType, "%T", c) + return errorsmod.Wrapf(types.ErrorUnknownProposalType, "%T", c) } } } diff --git a/x/liquidationsV2/keeper/genesis.go b/x/liquidationsV2/keeper/genesis.go index 68e94daaf..2ce8ecf4a 100644 --- a/x/liquidationsV2/keeper/genesis.go +++ b/x/liquidationsV2/keeper/genesis.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -8,10 +9,10 @@ import ( func (k Keeper) GetGenLiquidationWhiteListing(ctx sdk.Context) (liquidationWhiteListing []types.LiquidationWhiteListing) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LiquidationWhiteListingKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LiquidationWhiteListingKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -30,10 +31,10 @@ func (k Keeper) GetGenLiquidationWhiteListing(ctx sdk.Context) (liquidationWhite func (k Keeper) GetGenAppReserveFunds(ctx sdk.Context) (appReserveFunds []types.AppReserveFunds) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AppReserveFundsKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AppReserveFundsKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/liquidationsV2/keeper/grpc_query.go b/x/liquidationsV2/keeper/grpc_query.go index 539da32f8..704b22270 100644 --- a/x/liquidationsV2/keeper/grpc_query.go +++ b/x/liquidationsV2/keeper/grpc_query.go @@ -2,8 +2,9 @@ package keeper import ( "context" + + "cosmossdk.io/store/prefix" "github.com/comdex-official/comdex/x/liquidationsV2/types" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index 438d0ac06..2f29ba77b 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -3,13 +3,13 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/comdex-official/comdex/x/liquidationsV2/expected" "github.com/comdex-official/comdex/x/liquidationsV2/types" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -77,7 +77,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.storeKey) } diff --git a/x/liquidationsV2/keeper/keeper_test.go b/x/liquidationsV2/keeper/keeper_test.go index b8f6acb00..d0523cf4a 100644 --- a/x/liquidationsV2/keeper/keeper_test.go +++ b/x/liquidationsV2/keeper/keeper_test.go @@ -1,6 +1,9 @@ package keeper_test import ( + "testing" + + sdkmath "cosmossdk.io/math" chain "github.com/comdex-official/comdex/app" assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -15,10 +18,8 @@ import ( markettypes "github.com/comdex-official/comdex/x/market/types" vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" vaultTypes "github.com/comdex-official/comdex/x/vault/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "testing" ) type KeeperTestSuite struct { @@ -47,7 +48,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.vaultKeeper = s.app.VaultKeeper s.liquidationKeeper = s.app.NewliqKeeper s.assetKeeper = s.app.AssetKeeper @@ -67,7 +68,7 @@ func (s *KeeperTestSuite) CreateNewAsset(name, denom string, twa uint64) uint64 err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: true, @@ -97,16 +98,16 @@ func (s *KeeperTestSuite) CreateNewAsset(name, denom string, twa uint64) uint64 return assetID } -func newInt(i int64) sdk.Int { - return sdk.NewInt(i) +func newInt(i int64) sdkmath.Int { + return sdkmath.NewInt(i) } -func newDec(i string) sdk.Dec { - dec, _ := sdk.NewDecFromStr(i) +func newDec(i string) sdkmath.LegacyDec { + dec, _ := sdkmath.LegacyNewDecFromStr(i) return dec } -func (s *KeeperTestSuite) AddAssetRatesStats(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64) uint64 { +func (s *KeeperTestSuite) AddAssetRatesStats(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdkmath.LegacyDec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdkmath.LegacyDec, CAssetID uint64) uint64 { err := s.app.LendKeeper.AddAssetRatesParams(s.ctx, lendtypes.AssetRatesParams{ AssetID: AssetID, UOptimal: UOptimal, @@ -132,7 +133,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName, shortName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: shortName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -153,7 +154,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName, shortName string) uint64 { return appID } -func (s *KeeperTestSuite) AddAssetRatesPoolPairs(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64, moduleName, cPoolName string, assetData []*lendtypes.AssetDataPoolMapping, MinUsdValueLeft uint64, IsIsolated bool) uint64 { +func (s *KeeperTestSuite) AddAssetRatesPoolPairs(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdkmath.LegacyDec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdkmath.LegacyDec, CAssetID uint64, moduleName, cPoolName string, assetData []*lendtypes.AssetDataPoolMapping, MinUsdValueLeft uint64, IsIsolated bool) uint64 { err := s.app.LendKeeper.AddAssetRatesPoolPairs(s.ctx, lendtypes.AssetRatesPoolPairs{ AssetID: AssetID, UOptimal: UOptimal, diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index bc1fbf687..0429d7bb3 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,6 +2,8 @@ package keeper import ( "fmt" + + sdkmath "cosmossdk.io/math" utils "github.com/comdex-official/comdex/types" assettypes "github.com/comdex-official/comdex/x/asset/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" @@ -121,10 +123,10 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquid return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) } //Calculating Liquidation Fees - feesToBeCollected := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() + feesToBeCollected := sdkmath.LegacyNewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() //Calculating auction bonus to be given - auctionBonusToBeGiven := sdk.ZeroInt() + auctionBonusToBeGiven := sdkmath.ZeroInt() //Checking if the vault getting liquidated is a cmst based vault or not //This is primarily to infer that primary market will consider cmst at $1 at the time of buying it @@ -138,7 +140,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquid } - if vault.AmountIn.GT(sdk.ZeroInt()) { + if vault.AmountIn.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, vaulttypes.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn))) if err != nil { return fmt.Errorf("error , not enough token in vault to transfer %s", vault.AmountIn) @@ -166,12 +168,12 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquid return nil } -func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdk.Int) sdk.Coin { +func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdkmath.Int) sdk.Coin { asset, _ := k.asset.GetAsset(ctx, assetID) return sdk.NewCoin(asset.Denom, amount) } -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, collateralID uint64, DebtId uint64) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdkmath.LegacyDec, appID uint64, isInternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdkmath.Int, bonusToBeGiven sdkmath.Int, initiatorType string, auctionType bool, isDebtCmst bool, collateralID uint64, DebtId uint64) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -285,7 +287,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64, liqu if err != nil { return fmt.Errorf("error in calculating Borrow Interest before liquidation %d", err) } - if !borrowPos.StableBorrowRate.Equal(sdk.ZeroDec()) { + if !borrowPos.StableBorrowRate.Equal(sdkmath.LegacyZeroDec()) { borrowPos, err = k.lend.ReBalanceStableRates(ctx, borrowPos) if err != nil { return fmt.Errorf("error in re-balance stable rate check before liquidation") @@ -297,7 +299,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64, liqu LiquidationThreshold = liqThreshold.ELiquidationThreshold } - var currentCollateralizationRatio sdk.Dec + var currentCollateralizationRatio sdkmath.LegacyDec var firstTransitAssetID, secondTransitAssetID uint64 // for getting transit assets details for _, data := range pool.AssetData { @@ -317,12 +319,12 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64, liqu // a. if borrow is from same pool // b. if borrow is from first transit asset // c. if borrow is from second transit asset - if borrowPos.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { // first condition + if borrowPos.BridgedAssetAmount.Amount.Equal(sdkmath.ZeroInt()) { // first condition currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) if err != nil { return err } - if sdk.Dec.GT(currentCollateralizationRatio, LiquidationThreshold) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, LiquidationThreshold) { err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn, liquidator, isInternalkeeper) if err != nil { return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID ") @@ -334,7 +336,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64, liqu if err != nil { return err } - if sdk.Dec.GT(currentCollateralizationRatio, LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn, liquidator, isInternalkeeper) if err != nil { return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") @@ -346,7 +348,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64, liqu return err } - if sdk.Dec.GT(currentCollateralizationRatio, LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { + if sdkmath.LegacyDec.GT(currentCollateralizationRatio, LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn, liquidator, isInternalkeeper) if err != nil { return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") @@ -357,7 +359,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64, liqu return nil } -func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsset, owner string, appID uint64, currentCollateralizationRatio sdk.Dec, assetRatesStats lendtypes.AssetRatesParams, lendPair lendtypes.Extended_Pair, pool lendtypes.Pool, assetIn assettypes.Asset, liquidator string, isInternalkeeper bool) error { +func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsset, owner string, appID uint64, currentCollateralizationRatio sdkmath.LegacyDec, assetRatesStats lendtypes.AssetRatesParams, lendPair lendtypes.Extended_Pair, pool lendtypes.Pool, assetIn assettypes.Asset, liquidator string, isInternalkeeper bool) error { lendPos, _ := k.lend.GetLend(ctx, borrow.LendingID) whitelistingData, found := k.GetLiquidationWhiteListing(ctx, appID) if !found { @@ -368,10 +370,10 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse pair, _ := k.lend.GetLendPair(ctx, borrow.PairID) cAsset, _ := k.asset.GetAsset(ctx, assetRatesStats.CAssetID) //Calculating Liquidation Fees - feesToBeCollected := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationPenalty).TruncateInt() + feesToBeCollected := sdkmath.LegacyNewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationPenalty).TruncateInt() //Calculating auction bonus to be given - auctionBonusToBeGiven := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationBonus).TruncateInt() + auctionBonusToBeGiven := sdkmath.LegacyNewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationBonus).TruncateInt() err := k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetIn.Denom, borrow.AmountIn.Amount))) if err != nil { @@ -391,7 +393,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse k.lend.UpdateBorrowStats(ctx, lendPair, borrow.IsStableBorrow, borrow.AmountOut.Amount, false) lendPos.AmountIn.Amount = lendPos.AmountIn.Amount.Sub(borrow.AmountIn.Amount) k.lend.UpdateLendStats(ctx, lendPos.AssetID, lendPos.PoolID, borrow.AmountIn.Amount, false) - if !lendPos.AmountIn.Amount.GT(sdk.ZeroInt()) { + if !lendPos.AmountIn.Amount.GT(sdkmath.ZeroInt()) { // delete lend position k.lend.DeleteLendForAddressByAsset(ctx, lendPos.Owner, lendPos.ID) k.lend.DeleteIDFromAssetStatsMapping(ctx, lendPos.PoolID, lendPos.AssetID, borrow.LendingID, true) @@ -487,7 +489,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if netFeeCollectedData.NetFeesCollected.LTE(collector.DebtThreshold.Sub(collector.LotSize)) && auctionLookupTable.IsDebtAuction { // net = 200 debtThreshold = 500 , lotSize = 100 collateralToken, debtToken := k.DebtTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) - err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "debt", false, true, collateralAssetID, debtAssetID) + err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdkmath.LegacyZeroDec(), appID, false, "", "", sdkmath.ZeroInt(), sdkmath.ZeroInt(), "debt", false, true, collateralAssetID, debtAssetID) if err != nil { return err } @@ -509,7 +511,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if err != nil { return err } - err = k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "surplus", false, false, collateralAssetID, debtAssetID) + err = k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdkmath.LegacyZeroDec(), appID, false, "", "", sdkmath.ZeroInt(), sdkmath.ZeroInt(), "surplus", false, false, collateralAssetID, debtAssetID) if err != nil { return err } @@ -527,7 +529,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint // // --Collateral cmst harbor // debt harbor cmst -func (k Keeper) DebtTokenAmount(ctx sdk.Context, DebtAssetID, CollateralAssetId uint64, lotSize, debtLotSize sdk.Int) (collateralToken, debtToken sdk.Coin) { +func (k Keeper) DebtTokenAmount(ctx sdk.Context, DebtAssetID, CollateralAssetId uint64, lotSize, debtLotSize sdkmath.Int) (collateralToken, debtToken sdk.Coin) { collateralAsset, found1 := k.asset.GetAsset(ctx, CollateralAssetId) debtAsset, found2 := k.asset.GetAsset(ctx, DebtAssetID) if !found1 || !found2 { @@ -536,13 +538,13 @@ func (k Keeper) DebtTokenAmount(ctx sdk.Context, DebtAssetID, CollateralAssetId return sdk.NewCoin(collateralAsset.Denom, debtLotSize), sdk.NewCoin(debtAsset.Denom, lotSize) } -func (k Keeper) SurplusTokenAmount(ctx sdk.Context, CollateralAssetId, DebtAssetID uint64, lotSize sdk.Int) (collateralToken, debtToken sdk.Coin) { +func (k Keeper) SurplusTokenAmount(ctx sdk.Context, CollateralAssetId, DebtAssetID uint64, lotSize sdkmath.Int) (collateralToken, debtToken sdk.Coin) { collateralAsset, found1 := k.asset.GetAsset(ctx, CollateralAssetId) debtAsset, found2 := k.asset.GetAsset(ctx, DebtAssetID) if !found1 || !found2 { return sdk.Coin{}, sdk.Coin{} } - return sdk.NewCoin(collateralAsset.Denom, lotSize), sdk.NewCoin(debtAsset.Denom, sdk.ZeroInt()) + return sdk.NewCoin(collateralAsset.Denom, lotSize), sdk.NewCoin(debtAsset.Denom, sdkmath.ZeroInt()) } func (k Keeper) MsgAppReserveFundsFn(ctx sdk.Context, from string, appId, assetId uint64, tokenQuantity sdk.Coin) error { @@ -605,8 +607,8 @@ func (k Keeper) WithdrawAppReserveFundsFn(ctx sdk.Context, appId, assetId uint64 return types.ErrorInvalidAppOrAssetData } - if appReserveFunds.TokenQuantity.Amount.Sub(tokenQuantity.Amount).GTE(sdk.ZeroInt()) { - if tokenQuantity.Amount.GT(sdk.ZeroInt()) { + if appReserveFunds.TokenQuantity.Amount.Sub(tokenQuantity.Amount).GTE(sdkmath.ZeroInt()) { + if tokenQuantity.Amount.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(tokenQuantity)) if err != nil { return err @@ -696,21 +698,21 @@ func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, } appReserveFunds, found := k.GetAppReserveFunds(ctx, appID, debtAssetId) - if !found || appReserveFunds.TokenQuantity.Amount.LTE(sdk.NewInt(0)) { + if !found || appReserveFunds.TokenQuantity.Amount.LTE(sdkmath.NewInt(0)) { return fmt.Errorf("reserve funds not added for debt asset id") } - feeToBeCollected := sdk.NewDecFromInt(debtToken.Amount).Mul(auctionParams.LiquidationPenalty).TruncateInt() + feeToBeCollected := sdkmath.LegacyNewDecFromInt(debtToken.Amount).Mul(auctionParams.LiquidationPenalty).TruncateInt() feetoken := sdk.NewCoin(debtToken.Denom, feeToBeCollected) //Calculating auction bonus to be given - bonusToBeGiven := sdk.NewDecFromInt(debtToken.Amount).Mul(auctionParams.AuctionBonus).TruncateInt() + bonusToBeGiven := sdkmath.LegacyNewDecFromInt(debtToken.Amount).Mul(auctionParams.AuctionBonus).TruncateInt() addr, err := sdk.AccAddressFromBech32(from) err = k.bank.SendCoinsFromAccountToModule(ctx, addr, auctionsV2types.ModuleName, sdk.NewCoins(collateralToken)) if err != nil { return err } - err = k.CreateLockedVault(ctx, 0, 0, owner, collateralToken, debtToken, collateralToken, debtToken.Add(feetoken), sdk.ZeroDec(), appID, false, "", from, feeToBeCollected, bonusToBeGiven, "external", true, isDebtCmst, collateralAssetId, debtAssetId) + err = k.CreateLockedVault(ctx, 0, 0, owner, collateralToken, debtToken, collateralToken, debtToken.Add(feetoken), sdkmath.LegacyZeroDec(), appID, false, "", from, feeToBeCollected, bonusToBeGiven, "external", true, isDebtCmst, collateralAssetId, debtAssetId) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for External liquidation ") } @@ -745,7 +747,7 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t if !found { reservePoolRecords = lendtypes.BorrowInterestTracker{ BorrowingId: liquidationData.OriginalVaultId, - ReservePoolInterest: sdk.ZeroDec(), + ReservePoolInterest: sdkmath.LegacyZeroDec(), } } @@ -754,7 +756,7 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t if pair.IsEModeEnabled { liquidationPenalty = assetInStats.ELiquidationPenalty } - liqPenaltyAmount := sdk.NewDecFromInt(borrowPos.AmountOut.Amount).Mul(liquidationPenalty).TruncateInt() + liqPenaltyAmount := sdkmath.LegacyNewDecFromInt(borrowPos.AmountOut.Amount).Mul(liquidationPenalty).TruncateInt() err = k.lend.UpdateReserveBalances(ctx, pair.AssetOut, pool.ModuleName, sdk.NewCoin(borrowPos.AmountOut.Denom, liqPenaltyAmount), true) if err != nil { return err @@ -764,11 +766,11 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t if !found { allReserveStats = lendtypes.AllReserveStats{ AssetID: pair.AssetOut, - AmountOutFromReserveToLenders: sdk.ZeroInt(), - AmountOutFromReserveForAuction: sdk.ZeroInt(), - AmountInFromLiqPenalty: sdk.ZeroInt(), - AmountInFromRepayments: sdk.ZeroInt(), - TotalAmountOutToLenders: sdk.ZeroInt(), + AmountOutFromReserveToLenders: sdkmath.ZeroInt(), + AmountOutFromReserveForAuction: sdkmath.ZeroInt(), + AmountInFromLiqPenalty: sdkmath.ZeroInt(), + AmountInFromRepayments: sdkmath.ZeroInt(), + TotalAmountOutToLenders: sdkmath.ZeroInt(), } } allReserveStats.AmountInFromLiqPenalty = allReserveStats.AmountInFromLiqPenalty.Add(liqPenaltyAmount) @@ -777,7 +779,7 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t // after recovering interest some part of the interest goes into the reserve pool // and for the remaining quantity equivalent number of cToken is minted to be given to the lenders upon calculate interest and rewards amtToReservePool := reservePoolRecords.ReservePoolInterest - if amtToReservePool.TruncateInt().GT(sdk.ZeroInt()) { + if amtToReservePool.TruncateInt().GT(sdkmath.ZeroInt()) { amount := sdk.NewCoin(auctionData.DebtToken.Denom, amtToReservePool.TruncateInt()) err = k.lend.UpdateReserveBalances(ctx, pair.AssetOut, pool.ModuleName, amount, true) if err != nil { @@ -788,7 +790,7 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t k.lend.SetAllReserveStatsByAssetID(ctx, allReserveStats) // amount minted in the debt pool amtToMint := (borrowPos.InterestAccumulated.Sub(amtToReservePool)).TruncateInt() - if amtToMint.GT(sdk.ZeroInt()) { + if amtToMint.GT(sdkmath.ZeroInt()) { err = k.bank.MintCoins(ctx, pool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, amtToMint))) if err != nil { return err @@ -797,7 +799,7 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t k.lend.SetAssetStatsByPoolIDAndAssetID(ctx, poolAssetLBMappingData) } // if borrow position is having bridged asset then return to the initial pool - if borrowPos.BridgedAssetAmount.Amount.GT(sdk.NewInt(0)) { + if borrowPos.BridgedAssetAmount.Amount.GT(sdkmath.NewInt(0)) { assetInPool, _ := k.lend.GetPool(ctx, lend.PoolID) err = k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, assetInPool.ModuleName, sdk.NewCoins(borrowPos.BridgedAssetAmount)) if err != nil { diff --git a/x/liquidationsV2/keeper/liquidations.go b/x/liquidationsV2/keeper/liquidations.go index bba2dd07e..c5edda89b 100644 --- a/x/liquidationsV2/keeper/liquidations.go +++ b/x/liquidationsV2/keeper/liquidations.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -74,10 +75,10 @@ func (k Keeper) GetLockedVaultByApp(ctx sdk.Context, appID uint64) (lockedVault var ( store = k.Store(ctx) key = types.LockedVaultKeyByApp(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -95,10 +96,10 @@ func (k Keeper) GetLockedVaultByApp(ctx sdk.Context, appID uint64) (lockedVault func (k Keeper) GetLockedVaults(ctx sdk.Context) (lockedVaults []types.LockedVault) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LockedVaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LockedVaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index 46206da26..d60673771 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -1,7 +1,9 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "fmt" + "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" @@ -33,22 +35,22 @@ func (s *KeeperTestSuite) AddAppAssets() { assetDataPoolOneAssetOne := &lendtypes.AssetDataPoolMapping{ AssetID: assetOneID, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolOneAssetTwo := &lendtypes.AssetDataPoolMapping{ AssetID: assetTwoID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000000000), } assetDataPoolOneAssetThree := &lendtypes.AssetDataPoolMapping{ AssetID: assetThreeID, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000000000), } assetDataPoolTwoAssetFour := &lendtypes.AssetDataPoolMapping{ AssetID: assetFourID, AssetTransitType: 1, - SupplyCap: sdk.NewDec(3000000000000000000), + SupplyCap: sdkmath.LegacyNewDec(3000000000000000000), } assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -104,15 +106,15 @@ func (s *KeeperTestSuite) AddAppAssets() { extendedPairVault := bindings.MsgAddExtendedPairsVault{ AppID: 2, PairID: 1, - StabilityFee: sdk.MustNewDecFromStr("0.01"), - ClosingFee: sdk.MustNewDecFromStr("0"), - LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), - DrawDownFee: sdk.MustNewDecFromStr("0.01"), + StabilityFee: sdkmath.LegacyMustNewDecFromStr("0.01"), + ClosingFee: sdkmath.LegacyMustNewDecFromStr("0"), + LiquidationPenalty: sdkmath.LegacyMustNewDecFromStr("0.12"), + DrawDownFee: sdkmath.LegacyMustNewDecFromStr("0.01"), IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000), - DebtFloor: sdk.NewInt(1000000), + DebtCeiling: sdkmath.NewInt(1000000000000), + DebtFloor: sdkmath.NewInt(1000000), IsStableMintVault: false, - MinCr: sdk.MustNewDecFromStr("1.5"), + MinCr: sdkmath.LegacyMustNewDecFromStr("1.5"), PairName: "CMDX-B", AssetOutOraclePrice: true, AssetOutPrice: 1000000, @@ -130,9 +132,9 @@ func (s *KeeperTestSuite) AddAppAssets() { dutchAuctionParams := types.DutchAuctionParam{ Premium: newDec("0.1"), Discount: newDec("0.1"), - DecrementFactor: sdk.NewInt(1), + DecrementFactor: sdkmath.NewInt(1), } - englishAuctionParams := types.EnglishAuctionParam{DecrementFactor: sdk.NewInt(1)} + englishAuctionParams := types.EnglishAuctionParam{DecrementFactor: sdkmath.NewInt(1)} liqWhitelistingHbr := types.LiquidationWhiteListing{ AppId: 2, @@ -188,8 +190,8 @@ func (s *KeeperTestSuite) CreateVault() { From: userAddress1, AppId: 2, ExtendedPairVaultId: 1, - AmountIn: sdk.NewIntFromUint64(1000000), - AmountOut: sdk.NewIntFromUint64(1000000), + AmountIn: sdkmath.NewIntFromUint64(1000000), + AmountOut: sdkmath.NewIntFromUint64(1000000), }, }, { @@ -198,8 +200,8 @@ func (s *KeeperTestSuite) CreateVault() { From: userAddress2, AppId: 2, ExtendedPairVaultId: 1, - AmountIn: sdk.NewIntFromUint64(1000000), - AmountOut: sdk.NewIntFromUint64(1000000), + AmountIn: sdkmath.NewIntFromUint64(1000000), + AmountOut: sdkmath.NewIntFromUint64(1000000), }, }, } { @@ -281,8 +283,8 @@ func (s *KeeperTestSuite) TestLiquidateVaults() { s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeVault.AmountIn) s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeVault.AmountOut) - s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdk.NewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt()) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdkmath.LegacyNewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, sdkmath.LegacyNewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt()) s.Require().Equal(lockedVault[0].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) @@ -312,14 +314,14 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { assetStatsLend, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) - s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdkmath.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdkmath.NewInt(13000000000)) assetStatsBorrow, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) - s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(770000000)) - s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdkmath.NewInt(770000000)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdkmath.NewInt(10000000000)) modBalInitial, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) @@ -337,8 +339,8 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { s.Require().Equal(lockedVault[0].Owner, beforeLend.Owner) s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeBorrow.AmountIn.Amount) s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeBorrow.AmountOut.Amount) - s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdk.NewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt()) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdkmath.LegacyNewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, sdkmath.LegacyNewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt()) s.Require().Equal(lockedVault[0].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) @@ -347,21 +349,21 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { assetStatsLend, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) - s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(11900000000)) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdkmath.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdkmath.NewInt(11900000000)) assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) - s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdkmath.NewInt(0)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdkmath.NewInt(10000000000)) afterBorrow, found := s.lendKeeper.GetBorrow(*ctx, 1) s.Require().True(found) s.Require().Equal(afterBorrow.IsLiquidated, true) modBalFinal, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) - s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdk.NewInt(1100000000)) + s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdkmath.NewInt(1100000000)) } func (s *KeeperTestSuite) TestLiquidateInternalKeeperForVault() { @@ -434,8 +436,8 @@ func (s *KeeperTestSuite) TestLiquidateInternalKeeperForVault() { s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeVault.AmountIn) s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeVault.AmountOut) - s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdk.NewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt()) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdkmath.LegacyNewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, sdkmath.LegacyNewDecFromInt(beforeVault.AmountOut).Mul(newDec("0.12")).TruncateInt()) s.Require().Equal(lockedVault[0].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) @@ -471,14 +473,14 @@ func (s *KeeperTestSuite) TestLiquidateInternalKeeperForBorrow() { assetStatsLend, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) - s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdkmath.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdkmath.NewInt(13000000000)) assetStatsBorrow, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) - s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(770000000)) - s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdkmath.NewInt(770000000)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdkmath.NewInt(10000000000)) modBalInitial, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) s.ChangeOraclePrice(1) @@ -533,8 +535,8 @@ func (s *KeeperTestSuite) TestLiquidateInternalKeeperForBorrow() { s.Require().Equal(lockedVault[0].Owner, beforeLend.Owner) s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeBorrow.AmountIn.Amount) s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeBorrow.AmountOut.Amount) - s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdk.NewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt()) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(sdkmath.LegacyNewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, sdkmath.LegacyNewDecFromInt(beforeBorrow.AmountOut.Amount).Mul(newDec("0.05")).TruncateInt()) s.Require().Equal(lockedVault[0].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) @@ -543,21 +545,21 @@ func (s *KeeperTestSuite) TestLiquidateInternalKeeperForBorrow() { assetStatsLend, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(s.ctx, 1, 1) s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) - s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(12900000000)) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdkmath.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdkmath.NewInt(12900000000)) assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(s.ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) - s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(700000000)) - s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdkmath.NewInt(700000000)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdkmath.NewInt(10000000000)) afterBorrow, found := s.lendKeeper.GetBorrow(s.ctx, 1) s.Require().True(found) s.Require().Equal(afterBorrow.IsLiquidated, true) modBalFinal, _ := s.lendKeeper.GetModuleBalanceByPoolID(s.ctx, 1) - s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdk.NewInt(100000000)) + s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdkmath.NewInt(100000000)) s.Require().Equal(lockedVault[0].IsInternalKeeper, true) s.Require().Equal(lockedVault[0].InternalKeeperAddress, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7") @@ -578,31 +580,31 @@ func (s *KeeperTestSuite) TestAppReserveFunds() { }{ { Name: "asset does not exist", - Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 1, 10, sdk.NewCoin("uasset1", sdk.NewInt(100000000))), + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 1, 10, sdk.NewCoin("uasset1", sdkmath.NewInt(100000000))), ExpErr: assetTypes.ErrorAssetDoesNotExist, ExpResp: nil, }, { Name: "wrong denom", - Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 1, 1, sdk.NewCoin("uasset2", sdk.NewInt(100000000))), + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 1, 1, sdk.NewCoin("uasset2", sdkmath.NewInt(100000000))), ExpErr: assetTypes.ErrorInvalidDenom, ExpResp: nil, }, { Name: "wrong app", - Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 10, 1, sdk.NewCoin("uasset1", sdk.NewInt(100000000))), + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 10, 1, sdk.NewCoin("uasset1", sdkmath.NewInt(100000000))), ExpErr: assetTypes.ErrorUnknownAppType, ExpResp: nil, }, { Name: "success valid case 1", - Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 2, 1, sdk.NewCoin("uasset1", sdk.NewInt(100000000))), + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 2, 1, sdk.NewCoin("uasset1", sdkmath.NewInt(100000000))), ExpErr: nil, ExpResp: &types.MsgAppReserveFundsResponse{}, }, { Name: "success valid case 2", - Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 2, 2, sdk.NewCoin("uasset2", sdk.NewInt(100000000))), + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 2, 2, sdk.NewCoin("uasset2", sdkmath.NewInt(100000000))), ExpErr: nil, ExpResp: &types.MsgAppReserveFundsResponse{}, }, @@ -624,7 +626,7 @@ func (s *KeeperTestSuite) TestAppReserveFunds() { s.Require().Equal(found, true) s.Require().Equal(appResFunds.AppId, uint64(2)) s.Require().Equal(appResFunds.AssetId, uint64(1)) - s.Require().Equal(appResFunds.TokenQuantity, sdk.NewCoin("uasset1", sdk.NewInt(100000000))) + s.Require().Equal(appResFunds.TokenQuantity, sdk.NewCoin("uasset1", sdkmath.NewInt(100000000))) _, found = liquidationKeeper.GetAppReserveFundsTxData(s.ctx, 2) s.Require().Equal(found, true) @@ -637,7 +639,7 @@ func (s *KeeperTestSuite) TestLiquidateExternal() { addr, _ := sdk.AccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7") liquidationKeeper := &s.liquidationKeeper s.AddAppAssets() - err := liquidationKeeper.MsgAppReserveFundsFn(s.ctx, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 3, 2, sdk.NewCoin("uasset2", sdk.NewInt(100000000))) + err := liquidationKeeper.MsgAppReserveFundsFn(s.ctx, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 3, 2, sdk.NewCoin("uasset2", sdkmath.NewInt(100000000))) if err != nil { return } @@ -650,13 +652,13 @@ func (s *KeeperTestSuite) TestLiquidateExternal() { }{ { Name: "asset does not exist", - Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdk.NewInt(100000000)), sdk.NewCoin("uasset2", sdk.NewInt(100000000)), 10, 2, false), + Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdkmath.NewInt(100000000)), sdk.NewCoin("uasset2", sdkmath.NewInt(100000000)), 10, 2, false), ExpErr: assetTypes.ErrorAssetDoesNotExist, ExpResp: nil, }, { Name: "success valid case", - Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdk.NewInt(100000000)), sdk.NewCoin("uasset2", sdk.NewInt(100000000)), 1, 2, false), + Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdkmath.NewInt(100000000)), sdk.NewCoin("uasset2", sdkmath.NewInt(100000000)), 1, 2, false), ExpErr: nil, ExpResp: &types.MsgLiquidateExternalKeeperResponse{}, }, @@ -678,7 +680,7 @@ func (s *KeeperTestSuite) TestLiquidateExternal() { s.Require().Equal(found, true) s.Require().Equal(appResFunds.AppId, uint64(3)) s.Require().Equal(appResFunds.AssetId, uint64(2)) - s.Require().Equal(appResFunds.TokenQuantity, sdk.NewCoin("uasset2", sdk.NewInt(100000000))) + s.Require().Equal(appResFunds.TokenQuantity, sdk.NewCoin("uasset2", sdkmath.NewInt(100000000))) _, found = liquidationKeeper.GetAppReserveFundsTxData(s.ctx, 3) s.Require().Equal(found, true) @@ -703,12 +705,12 @@ func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForSurplus AppID: 2, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(200000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(200000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), }, }, } { @@ -775,12 +777,12 @@ func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForDebt() AppID: 2, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(1000000000000000000), - DebtThreshold: sdk.NewInt(282078000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(25000000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(13157894000000), + SurplusThreshold: sdkmath.NewInt(1000000000000000000), + DebtThreshold: sdkmath.NewInt(282078000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(25000000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(13157894000000), }, }, } { @@ -839,7 +841,7 @@ func (s *KeeperTestSuite) TestDebtActivator() { s.AddAppAssets() s.WasmSetCollectorLookupTableAndAuctionControlForDebt() - err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(4700000)) + err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdkmath.NewIntFromUint64(4700000)) s.Require().NoError(err) k, ctx := &s.liquidationKeeper, &s.ctx err = k.Liquidate(*ctx) @@ -859,12 +861,12 @@ func (s *KeeperTestSuite) TestSurplusActivator() { liquidationKeeper := &s.liquidationKeeper s.AddAppAssets() s.WasmSetCollectorLookupTableAndAuctionControlForSurplus() - err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdkmath.NewInt(10000000)))) s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdkmath.NewInt(10000000)))) s.Require().NoError(err) - err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(100000000)) + err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdkmath.NewIntFromUint64(100000000)) s.Require().NoError(err) k, ctx := &s.liquidationKeeper, &s.ctx err = k.Liquidate(*ctx) diff --git a/x/liquidationsV2/module.go b/x/liquidationsV2/module.go index c76e2c036..ef11e338f 100644 --- a/x/liquidationsV2/module.go +++ b/x/liquidationsV2/module.go @@ -133,6 +133,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -155,12 +161,10 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, request abci.RequestBeginBlock) { - BeginBlocker(ctx, request, am.keeper) +func (am AppModule) BeginBlock(ctx sdk.Context) { + BeginBlocker(ctx, am.keeper) } -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/liquidationsV2/module_simulation.go b/x/liquidationsV2/module_simulation.go index 1d5331f17..f3370efca 100644 --- a/x/liquidationsV2/module_simulation.go +++ b/x/liquidationsV2/module_simulation.go @@ -7,7 +7,6 @@ import ( "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -44,15 +43,6 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP return nil } -// RandomizedParams creates randomized param changes for the simulator -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { - -// return []simtypes.ParamChange{} -// } - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/liquidationsV2/types/codec.go b/x/liquidationsV2/types/codec.go index e184dd950..82143ce8c 100644 --- a/x/liquidationsV2/types/codec.go +++ b/x/liquidationsV2/types/codec.go @@ -6,7 +6,6 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" // this line is used by starport scaffolding # 1 @@ -44,7 +43,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - RegisterLegacyAminoCodec(authzcodec.Amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/liquidationsV2/types/errors.go b/x/liquidationsV2/types/errors.go index cd6b77c20..9739022c5 100644 --- a/x/liquidationsV2/types/errors.go +++ b/x/liquidationsV2/types/errors.go @@ -3,14 +3,14 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/liquidationsV2 module sentinel errors var ( - ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 1501, "Vault Id invalid") - ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 1502, "Unknown msg type") - ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 1503, "unknown proposal type") - ErrorInvalidAppOrAssetData = sdkerrors.Register(ModuleName, 1504, "Invalid data of app , or asset has not been added to the app , or low funds") - ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 1505, "English auction not enabled for the app") + ErrVaultIDInvalid = errorsmod.Register(ModuleName, 1501, "Vault Id invalid") + ErrorUnknownMsgType = errorsmod.Register(ModuleName, 1502, "Unknown msg type") + ErrorUnknownProposalType = errorsmod.Register(ModuleName, 1503, "unknown proposal type") + ErrorInvalidAppOrAssetData = errorsmod.Register(ModuleName, 1504, "Invalid data of app , or asset has not been added to the app , or low funds") + ErrEnglishAuctionDisabled = errorsmod.Register(ModuleName, 1505, "English auction not enabled for the app") ) diff --git a/x/liquidationsV2/types/expected_keepers.go b/x/liquidationsV2/types/expected_keepers.go index bcb4371f8..090b379fa 100644 --- a/x/liquidationsV2/types/expected_keepers.go +++ b/x/liquidationsV2/types/expected_keepers.go @@ -1,8 +1,8 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -11,12 +11,12 @@ import ( // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } \ No newline at end of file diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index aa8e0717e..af8f97dd3 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -42,9 +43,9 @@ type LiquidationWhiteListing struct { IsDutchActivated bool `protobuf:"varint,3,opt,name=is_dutch_activated,json=isDutchActivated,proto3" json:"is_dutch_activated,omitempty" yaml:"is_dutch_activated"` DutchAuctionParam *DutchAuctionParam `protobuf:"bytes,4,opt,name=dutch_auction_param,json=dutchAuctionParam,proto3" json:"dutch_auction_param,omitempty" yaml:"dutch_auction_param"` //Sets of Params for English Auction - IsEnglishActivated bool `protobuf:"varint,5,opt,name=is_english_activated,json=isEnglishActivated,proto3" json:"is_english_activated,omitempty" yaml:"is_english_activated"` - EnglishAuctionParam *EnglishAuctionParam `protobuf:"bytes,6,opt,name=english_auction_param,json=englishAuctionParam,proto3" json:"english_auction_param,omitempty" yaml:"english_auction_param"` - KeeeperIncentive github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=keeeper_incentive,json=keeeperIncentive,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"keeeper_incentive" yaml:"keeper_incentive"` + IsEnglishActivated bool `protobuf:"varint,5,opt,name=is_english_activated,json=isEnglishActivated,proto3" json:"is_english_activated,omitempty" yaml:"is_english_activated"` + EnglishAuctionParam *EnglishAuctionParam `protobuf:"bytes,6,opt,name=english_auction_param,json=englishAuctionParam,proto3" json:"english_auction_param,omitempty" yaml:"english_auction_param"` + KeeeperIncentive cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=keeeper_incentive,json=keeeperIncentive,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"keeeper_incentive" yaml:"keeper_incentive"` } func (m *LiquidationWhiteListing) Reset() { *m = LiquidationWhiteListing{} } @@ -197,9 +198,9 @@ func (m *AssetTxData) XXX_DiscardUnknown() { var xxx_messageInfo_AssetTxData proto.InternalMessageInfo type DutchAuctionParam struct { - Premium github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=premium,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"premium" yaml:"premium"` - Discount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=discount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"discount" yaml:"discount"` - DecrementFactor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=decrement_factor,json=decrementFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decrement_factor" yaml:"decrement_factor"` + Premium cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=premium,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"premium" yaml:"premium"` + Discount cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=discount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"discount" yaml:"discount"` + DecrementFactor cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=decrement_factor,json=decrementFactor,proto3,customtype=cosmossdk.io/math.Int" json:"decrement_factor" yaml:"decrement_factor"` } func (m *DutchAuctionParam) Reset() { *m = DutchAuctionParam{} } @@ -236,7 +237,7 @@ func (m *DutchAuctionParam) XXX_DiscardUnknown() { var xxx_messageInfo_DutchAuctionParam proto.InternalMessageInfo type EnglishAuctionParam struct { - DecrementFactor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=decrement_factor,json=decrementFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decrement_factor" yaml:"decrement_factor"` + DecrementFactor cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=decrement_factor,json=decrementFactor,proto3,customtype=cosmossdk.io/math.Int" json:"decrement_factor" yaml:"decrement_factor"` } func (m *EnglishAuctionParam) Reset() { *m = EnglishAuctionParam{} } @@ -318,7 +319,7 @@ type LockedVault struct { Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"collateral_token"` DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,7,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"debt_token"` - CurrentCollaterlisationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` + CurrentCollaterlisationRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,9,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_to_be_auctioned" yaml:"CollateralToBeAuctioned"` TargetDebt github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,10,opt,name=target_debt,json=targetDebt,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"target_debt" yaml:"target_debt"` LiquidationTimestamp time.Time `protobuf:"bytes,11,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` @@ -326,12 +327,12 @@ type LockedVault struct { IsInternalKeeper bool `protobuf:"varint,12,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` //To return funds to the external app back - ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` - FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` - BonusToBeGiven github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,17,opt,name=bonus_to_be_given,json=bonusToBeGiven,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonus_to_be_given" yaml:"bonus_to_be_given"` - InitiatorType string `protobuf:"bytes,18,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` - AuctionType bool `protobuf:"varint,19,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` - IsDebtCmst bool `protobuf:"varint,20,opt,name=is_debt_cmst,json=isDebtCmst,proto3" json:"is_debt_cmst,omitempty" yaml:"is_debt_cmst"` + ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` + FeeToBeCollected cosmossdk_io_math.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=cosmossdk.io/math.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` + BonusToBeGiven cosmossdk_io_math.Int `protobuf:"bytes,17,opt,name=bonus_to_be_given,json=bonusToBeGiven,proto3,customtype=cosmossdk.io/math.Int" json:"bonus_to_be_given" yaml:"bonus_to_be_given"` + InitiatorType string `protobuf:"bytes,18,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` + AuctionType bool `protobuf:"varint,19,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + IsDebtCmst bool `protobuf:"varint,20,opt,name=is_debt_cmst,json=isDebtCmst,proto3" json:"is_debt_cmst,omitempty" yaml:"is_debt_cmst"` // uint64 pair_id = 21 [ // (gogoproto.customname) = "PairId", // (gogoproto.moretags) = "yaml:\"pair_id\""]; @@ -388,107 +389,108 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1598 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6f, 0x1b, 0x47, - 0x12, 0xd6, 0x50, 0xd6, 0x83, 0x4d, 0x51, 0x22, 0x5b, 0xa2, 0x35, 0xd6, 0xda, 0x1c, 0xed, 0x00, - 0xf6, 0x0a, 0x36, 0x44, 0x5a, 0x32, 0x16, 0xfb, 0x04, 0x76, 0x45, 0x49, 0xb6, 0xb9, 0x2b, 0xc4, - 0xf6, 0x40, 0x70, 0x00, 0x23, 0xc9, 0x64, 0x38, 0xd3, 0xa4, 0x1a, 0x22, 0x67, 0xe8, 0x99, 0xa6, - 0x42, 0x21, 0x40, 0x80, 0xe4, 0x12, 0xe4, 0x01, 0xc4, 0x39, 0xe4, 0x9c, 0x6b, 0xf2, 0x2f, 0x72, - 0x08, 0x10, 0x23, 0x27, 0x1f, 0x83, 0x1c, 0x26, 0xc9, 0xf8, 0x1f, 0xf0, 0x98, 0x53, 0xd0, 0x8f, - 0x79, 0x91, 0xb4, 0x64, 0x1a, 0x08, 0x90, 0x8b, 0xe9, 0xe9, 0xaa, 0xef, 0xab, 0xea, 0xea, 0xea, - 0xea, 0x2a, 0x81, 0x4d, 0xd3, 0xe9, 0x58, 0xa8, 0x5f, 0x6d, 0xe3, 0xc7, 0x3d, 0x6c, 0x19, 0x04, - 0x3b, 0xb6, 0xf7, 0x70, 0xbb, 0x7a, 0xb2, 0xd5, 0x40, 0xc4, 0xd8, 0x8a, 0x96, 0x51, 0xa5, 0xeb, - 0x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1d, 0x2c, 0x84, - 0xd3, 0x16, 0x23, 0x5c, 0x66, 0x29, 0x7b, 0x8d, 0x75, 0xd0, 0x7c, 0x5d, 0xd0, 0x2d, 0x8b, 0x6e, - 0x37, 0xa1, 0x4c, 0x1b, 0xe8, 0x58, 0x07, 0xde, 0x01, 0x0b, 0x74, 0xba, 0xa6, 0x25, 0xdd, 0xec, - 0x78, 0x44, 0x5e, 0x61, 0x54, 0x57, 0x03, 0x5f, 0x01, 0x75, 0x8f, 0xde, 0xdc, 0xdd, 0x8e, 0x47, - 0x62, 0xa6, 0xa4, 0xae, 0xaa, 0x01, 0x1c, 0xa9, 0xc0, 0xd7, 0xc0, 0x72, 0xa2, 0x1e, 0x46, 0x4d, - 0x78, 0x89, 0xf7, 0x0f, 0xf1, 0xf9, 0x8d, 0x51, 0x52, 0xb5, 0x62, 0xbc, 0x2a, 0x5a, 0x75, 0xf8, - 0x6f, 0x90, 0x67, 0x96, 0x22, 0xa6, 0x8b, 0x8c, 0x49, 0x8e, 0xe7, 0x82, 0x94, 0x58, 0xd5, 0x72, - 0xf4, 0x5b, 0xa0, 0x6b, 0x8f, 0x9e, 0xfe, 0x52, 0x9e, 0xfa, 0x2a, 0x28, 0x4f, 0x3d, 0x0d, 0xca, - 0xd2, 0xb3, 0xa0, 0x2c, 0xfd, 0x1c, 0x94, 0xa5, 0x27, 0xcf, 0xcb, 0x53, 0xcf, 0x9e, 0x97, 0xa7, - 0x7e, 0x78, 0x5e, 0x9e, 0x7a, 0xf4, 0xf7, 0xd4, 0xe1, 0xd3, 0x49, 0x65, 0xd3, 0x69, 0x36, 0xb1, - 0x89, 0x8d, 0xb6, 0xf8, 0xae, 0x8e, 0xfc, 0x81, 0x87, 0xa5, 0x44, 0x63, 0x96, 0x95, 0xa8, 0x5b, - 0xbf, 0x05, 0x00, 0x00, 0xff, 0xff, 0x04, 0xfb, 0x8c, 0x7b, 0x06, 0x12, 0x00, 0x00, + // 1609 bytes of a gzipped FileDescriptorProto + 0x1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0x86, 0x81, 0x36, 0xb7, 0xc3, 0xc6, 0x38, 0x6d, 0x49, 0xd2, 0x24, 0x48, + 0x37, 0xe6, 0x90, 0xb0, 0xc1, 0xdf, 0x28, 0x60, 0x91, 0xba, 0x27, 0xd8, 0x31, 0xdf, 0x0e, 0x90, + 0x43, 0x09, 0x3d, 0xe7, 0xfb, 0xbd, 0xb0, 0x7d, 0xab, 0x26, 0x66, 0x59, 0x63, 0x87, 0x37, 0xce, + 0xff, 0xae, 0x4b, 0x9c, 0xc6, 0x73, 0x96, 0x87, 0x61, 0xa0, 0x55, 0x84, 0x6a, 0x96, 0xae, 0xff, + 0x27, 0xd0, 0xbe, 0xd9, 0x21, 0xf4, 0x78, 0xd0, 0x62, 0x6b, 0x59, 0x97, 0x25, 0x40, 0xfc, 0x6c, + 0xfa, 0xf6, 0x49, 0x9d, 0x9e, 0xf7, 0xb1, 0xcf, 0x95, 0x8c, 0x22, 0xe7, 0xbe, 0x8a, 0xa8, 0x7f, + 0x53, 0x40, 0x65, 0x24, 0x1d, 0x47, 0x67, 0x7b, 0x88, 0xa2, 0x2f, 0x49, 0xca, 0x2f, 0x41, 0x51, + 0xcc, 0x97, 0x9e, 0x99, 0x36, 0xa2, 0x48, 0xcd, 0xad, 0x4f, 0x6f, 0x14, 0xb6, 0xef, 0x5f, 0xb2, + 0xc3, 0x78, 0xd2, 0x84, 0xd7, 0xc6, 0x03, 0x36, 0xd1, 0x30, 0xd0, 0x0a, 0xa9, 0xc1, 0x61, 0xa0, + 0xad, 0xa4, 0xb3, 0x29, 0xd5, 0x75, 0xa3, 0x80, 0x12, 0x90, 0xfe, 0xeb, 0x1c, 0x48, 0x93, 0x32, + 0x2b, 0xa4, 0x5c, 0x6f, 0x85, 0x1e, 0x80, 0x39, 0x7a, 0x66, 0xb2, 0xa4, 0xf1, 0xb5, 0xcd, 0x37, + 0xe0, 0x30, 0xd0, 0x16, 0x65, 0xea, 0x85, 0x41, 0x37, 0x66, 0xe9, 0xd9, 0xd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0x45, 0x5a, 0x06, 0xfb, 0x77, 0x18, 0x68, + 0xf7, 0x64, 0x16, 0x2f, 0xf6, 0xa9, 0x1b, 0x77, 0xac, 0xac, 0x0e, 0xca, 0x08, 0xc1, 0xbf, 0x28, + 0x60, 0x2d, 0xb3, 0x12, 0x66, 0x0b, 0x47, 0x3d, 0x0b, 0xb6, 0xd5, 0xfc, 0x65, 0x89, 0x7c, 0x25, + 0x13, 0x59, 0x15, 0xe1, 0xec, 0xa6, 0x96, 0xa5, 0x81, 0x77, 0x22, 0x9d, 0x6b, 0x65, 0x75, 0xd5, + 0x9a, 0x2c, 0x02, 0x7f, 0xa5, 0x80, 0x02, 0x45, 0x5e, 0x07, 0x53, 0x93, 0x25, 0x5e, 0x05, 0x97, + 0x05, 0xb7, 0x2f, 0x83, 0x83, 0xf2, 0x96, 0x49, 0xb8, 0xd7, 0x0a, 0x08, 0x08, 0xe2, 0x1e, 0x6e, + 0x51, 0xf8, 0x3b, 0x05, 0x54, 0x52, 0xb7, 0xb8, 0x19, 0x3f, 0x3f, 0xd4, 0x02, 0x8f, 0x66, 0xad, + 0x26, 0x1e, 0x28, 0xb5, 0xe8, 0x81, 0x52, 0x3b, 0x8a, 0x10, 0x8d, 0x1f, 0xc9, 0xab, 0x7d, 0x25, + 0x55, 0x05, 0x63, 0x6b, 0xd2, 0x39, 0x4e, 0x94, 0xd7, 0xdf, 0xff, 0x53, 0x53, 0x8c, 0x95, 0xee, + 0x04, 0x26, 0xfc, 0x19, 0x7f, 0x42, 0x10, 0x87, 0x62, 0x8f, 0x95, 0x1e, 0xd1, 0x04, 0xaa, 0x0b, + 0xbc, 0x8f, 0x7e, 0x28, 0x9e, 0x10, 0x4d, 0x69, 0x7c, 0xc1, 0x6d, 0xc3, 0x40, 0x53, 0xe3, 0x2e, + 0x9a, 0xf1, 0x12, 0x1a, 0x7f, 0x41, 0x64, 0xd1, 0xd0, 0x07, 0xab, 0x23, 0xe2, 0x26, 0xb2, 0x6d, + 0x0f, 0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68, 0xab, 0xe7, 0x53, 0x75, 0x85, 0x4b, 0xdd, + 0x0d, 0x03, 0x0d, 0x34, 0x7d, 0x76, 0x2a, 0x77, 0x7b, 0x3e, 0x4d, 0x94, 0xd2, 0x58, 0xdd, 0x00, + 0x24, 0x86, 0xc0, 0x9f, 0x80, 0xe5, 0x54, 0xad, 0x8b, 0x9b, 0xe3, 0x8a, 0x68, 0x08, 0x92, 0xd5, + 0x9a, 0x00, 0xd2, 0x8d, 0x72, 0x32, 0x2a, 0x5b, 0x68, 0xf8, 0x7d, 0x50, 0xe4, 0x9e, 0x62, 0xa5, + 0x9b, 0x5c, 0x49, 0x4d, 0xfa, 0xf5, 0x8c, 0x59, 0x37, 0x0a, 0xec, 0x5b, 0xb2, 0x1b, 0x6f, 0x3e, + 0xfc, 0xbb, 0x3a, 0xf5, 0xe7, 0xb0, 0x3a, 0xf5, 0x21, 0xac, 0x2a, 0x1f, 0xc3, 0xaa, 0xf2, 0xaf, + 0xb0, 0xaa, 0xbc, 0xff, 0x54, 0x9d, 0xfa, 0xf8, 0xa9, 0x3a, 0xf5, 0xf7, 0x4f, 0xd5, 0xa9, 0x37, + 0x4f, 0x32, 0x15, 0x8a, 0xbd, 0x20, 0x36, 0xdd, 0x76, 0x9b, 0x58, 0x04, 0x75, 0xe5, 0x77, 0x7d, + 0xec, 0xaf, 0x2d, 0xbc, 0x6e, 0xb5, 0x66, 0x79, 0xf9, 0x79, 0xf4, 0xbf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x20, 0xc6, 0xd4, 0xcc, 0x93, 0x11, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/types/msg.go b/x/liquidationsV2/types/msg.go index 44d806138..ecb72748a 100644 --- a/x/liquidationsV2/types/msg.go +++ b/x/liquidationsV2/types/msg.go @@ -1,8 +1,9 @@ package types import ( + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" ) func NewMsgLiquidateInternalKeeperRequest( @@ -26,7 +27,7 @@ func (m *MsgLiquidateInternalKeeperRequest) Type() string { func (m *MsgLiquidateInternalKeeperRequest) ValidateBasic() error { if m.Id == 0 { - return errors.Wrap(ErrVaultIDInvalid, "id cannot be zero") + return errorsmod.Wrap(ErrVaultIDInvalid, "id cannot be zero") } return nil @@ -63,8 +64,8 @@ func (m *MsgAppReserveFundsRequest) Type() string { } func (m *MsgAppReserveFundsRequest) ValidateBasic() error { - if m.AppId == 0 || m.AssetId == 0 || m.TokenQuantity.Amount == sdk.NewInt(0) { - return errors.Wrap(ErrVaultIDInvalid, "id cannot be zero") + if m.AppId == 0 || m.AssetId == 0 || m.TokenQuantity.Amount == sdkmath.NewInt(0) { + return errorsmod.Wrap(ErrVaultIDInvalid, "id cannot be zero") } return nil @@ -113,7 +114,7 @@ func (m *MsgLiquidateExternalKeeperRequest) Type() string { func (m *MsgLiquidateExternalKeeperRequest) ValidateBasic() error { if m.AppId == 0 { - return errors.Wrap(ErrVaultIDInvalid, "app_id cannot be zero") + return errorsmod.Wrap(ErrVaultIDInvalid, "app_id cannot be zero") } return nil diff --git a/x/liquidity/amm/match_bench_test.go b/x/liquidity/amm/match_bench_test.go index 223a76353..de12e49bd 100644 --- a/x/liquidity/amm/match_bench_test.go +++ b/x/liquidity/amm/match_bench_test.go @@ -2,8 +2,8 @@ package amm_test //func BenchmarkFindMatchPrice(b *testing.B) { // minPrice, maxPrice := utils.ParseDec("0.0000001"), utils.ParseDec("10000000") -// minAmt, maxAmt := sdk.NewInt(100), sdk.NewInt(10000000) -// minReserveAmt, maxReserveAmt := sdk.NewInt(500), sdk.NewInt(1000000000) +// minAmt, maxAmt := sdkmath.NewInt(100), sdkmath.NewInt(10000000) +// minReserveAmt, maxReserveAmt := sdkmath.NewInt(500), sdkmath.NewInt(1000000000) // // for seed := int64(0); seed < 5; seed++ { // b.Run(fmt.Sprintf("seed/%d", seed), func(b *testing.B) { @@ -16,7 +16,7 @@ package amm_test // var poolOrderSources []amm.OrderSource // for i := 0; i < 1000; i++ { // rx, ry := utils.RandomInt(r, minReserveAmt, maxReserveAmt), utils.RandomInt(r, minReserveAmt, maxReserveAmt) -// pool := amm.NewBasicPool(rx, ry, sdk.Int{}) +// pool := amm.NewBasicPool(rx, ry, sdkmath.Int{}) // poolOrderSources = append(poolOrderSources, amm.NewMockPoolOrderSource(pool, "denom1", "denom2")) // } // os := amm.MergeOrderSources(append(poolOrderSources, ob)...) diff --git a/x/liquidity/client/cli/tx.go b/x/liquidity/client/cli/tx.go index 3a0361f69..398b18e12 100644 --- a/x/liquidity/client/cli/tx.go +++ b/x/liquidity/client/cli/tx.go @@ -1,6 +1,7 @@ package cli import ( + sdkmath "cosmossdk.io/math" "fmt" "strconv" "strings" @@ -176,17 +177,17 @@ $ %s tx %s create-ranged-pool 1 1 1000000000uatom,10000000000stake 1.3 2.5 1.5 - return fmt.Errorf("invalid deposit coins: %w", err) } - minPrice, err := sdk.NewDecFromStr(args[3]) + minPrice, err := sdkmath.LegacyNewDecFromStr(args[3]) if err != nil { return fmt.Errorf("invalid min price: %w", err) } - maxPrice, err := sdk.NewDecFromStr(args[4]) + maxPrice, err := sdkmath.LegacyNewDecFromStr(args[4]) if err != nil { return fmt.Errorf("invalid max price: %w", err) } - initialPrice, err := sdk.NewDecFromStr(args[5]) + initialPrice, err := sdkmath.LegacyNewDecFromStr(args[5]) if err != nil { return fmt.Errorf("invalid initial price: %w", err) } @@ -368,12 +369,12 @@ $ %s tx %s limit-order 1 1 s 10000uatom stake 2.0 10000 --order-lifespan=10m --f return fmt.Errorf("invalid demand coin denom: %w", err) } - price, err := sdk.NewDecFromStr(args[5]) + price, err := sdkmath.LegacyNewDecFromStr(args[5]) if err != nil { return fmt.Errorf("invalid price: %w", err) } - amt, ok := sdk.NewIntFromString(args[6]) + amt, ok := sdkmath.NewIntFromString(args[6]) if !ok { return fmt.Errorf("invalid amount: %s", args[6]) } @@ -462,7 +463,7 @@ $ %s tx %s market-order 1 1 s 10000uatom stake 10000 --order-lifespan=10m --from return fmt.Errorf("invalid demand coin denom: %w", err) } - amt, ok := sdk.NewIntFromString(args[5]) + amt, ok := sdkmath.NewIntFromString(args[5]) if !ok { return fmt.Errorf("invalid amount: %s", args[5]) } @@ -539,32 +540,32 @@ $ %s tx %s mm-order 1 1 102 101 10000 0 0 0 --from mykey return fmt.Errorf("parse pair id: %w", err) } - maxSellPrice, err := sdk.NewDecFromStr(args[2]) + maxSellPrice, err := sdkmath.LegacyNewDecFromStr(args[2]) if err != nil { return fmt.Errorf("invalid max sell price: %w", err) } - minSellPrice, err := sdk.NewDecFromStr(args[3]) + minSellPrice, err := sdkmath.LegacyNewDecFromStr(args[3]) if err != nil { return fmt.Errorf("invalid min sell price: %w", err) } - sellAmt, ok := sdk.NewIntFromString(args[4]) + sellAmt, ok := sdkmath.NewIntFromString(args[4]) if !ok { return fmt.Errorf("invalid sell amount: %s", args[4]) } - maxBuyPrice, err := sdk.NewDecFromStr(args[5]) + maxBuyPrice, err := sdkmath.LegacyNewDecFromStr(args[5]) if err != nil { return fmt.Errorf("invalid max buy price: %w", err) } - minBuyPrice, err := sdk.NewDecFromStr(args[6]) + minBuyPrice, err := sdkmath.LegacyNewDecFromStr(args[6]) if err != nil { return fmt.Errorf("invalid min buy price: %w", err) } - buyAmt, ok := sdk.NewIntFromString(args[7]) + buyAmt, ok := sdkmath.NewIntFromString(args[7]) if !ok { return fmt.Errorf("invalid buy amount: %s", args[7]) } @@ -902,10 +903,6 @@ func NewCmdUpdateGenericParamsProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -973,10 +970,6 @@ func NewCmdCreateNewLiquidityPairProposal() *cobra.Command { return err } - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } diff --git a/x/liquidity/client/testutil/helpers.go b/x/liquidity/client/testutil/helpers.go index e9bb13b80..3f1d5049c 100644 --- a/x/liquidity/client/testutil/helpers.go +++ b/x/liquidity/client/testutil/helpers.go @@ -4,6 +4,8 @@ import ( "fmt" "strconv" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" @@ -26,7 +28,7 @@ var commonArgs = []string{ func MsgCreate( clientCtx client.Context, appMappingID, extendedPairVaultID uint64, - amountIn, amountOut sdk.Int, + amountIn, amountOut sdkmath.Int, from string, extraArgs ...string, ) (testutil.BufferWriter, error) { @@ -52,7 +54,7 @@ func (s *LiquidityIntegrationTestSuite) CreateNewApp(appName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: appName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -77,7 +79,7 @@ func (s *LiquidityIntegrationTestSuite) CreateNewAsset(name, denom string, price err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, }) diff --git a/x/liquidity/client/testutil/suite.go b/x/liquidity/client/testutil/suite.go index db6526e71..85f75a636 100644 --- a/x/liquidity/client/testutil/suite.go +++ b/x/liquidity/client/testutil/suite.go @@ -10,16 +10,15 @@ import ( liquidityKeeper "github.com/comdex-official/comdex/x/liquidity/keeper" "github.com/comdex-official/comdex/x/liquidity/types" + pruningtypes "cosmossdk.io/store/pruning/types" "github.com/comdex-official/comdex/testutil/network" "github.com/cosmos/cosmos-sdk/baseapp" servertypes "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" networkI "github.com/cosmos/cosmos-sdk/testutil/network" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - dbm "github.com/cometbft/cometbft-db" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" ) type LiquidityIntegrationTestSuite struct { @@ -37,7 +36,7 @@ func NewAppConstructor() networkI.AppConstructor { return func(val networkI.ValidatorI) servertypes.Application { return chain.New( val.GetCtx().Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), val.GetCtx().Config.RootDir, 0, - chain.MakeEncodingConfig(), simtestutil.EmptyAppOptions{}, chain.GetWasmEnabledProposals(), chain.EmptyWasmOpts, + chain.MakeEncodingConfig(), simtestutil.EmptyAppOptions{}, chain.EmptyWasmOpts, baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), ) @@ -52,7 +51,7 @@ func (s *LiquidityIntegrationTestSuite) SetupSuite() { } s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.msgServer = liquidityKeeper.NewMsgServerImpl(s.app.LiquidityKeeper) cfg := network.DefaultConfig() diff --git a/x/liquidity/expected/keeper.go b/x/liquidity/expected/keeper.go index 8f76566e7..f846e848f 100644 --- a/x/liquidity/expected/keeper.go +++ b/x/liquidity/expected/keeper.go @@ -3,8 +3,10 @@ package expected import ( "time" + sdkmath "cosmossdk.io/math" + + "context" 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" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -14,23 +16,23 @@ import ( // AccountKeeper is the expected account keeper. type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(moduleName string) sdk.AccAddress } // BankKeeper is the expected bank keeper. type BankKeeper interface { - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetSupply(ctx sdk.Context, denom string) sdk.Coin - IterateTotalSupply(ctx sdk.Context, cb func(sdk.Coin) bool) - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - InputOutputCoins(ctx sdk.Context, inputs []banktypes.Input, outputs []banktypes.Output) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + GetSupply(ctx context.Context, denom string) sdk.Coin + IterateTotalSupply(ctx context.Context, cb func(sdk.Coin) bool) + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + InputOutputCoins(ctx context.Context, input banktypes.Input, outputs []banktypes.Output) error } type AssetKeeper interface { @@ -52,5 +54,5 @@ type RewardsKeeper interface { } type TokenMintKeeper interface { - UpdateAssetDataInTokenMintByApp(ctx sdk.Context, appMappingID uint64, assetID uint64, changeType bool, amount sdk.Int) + UpdateAssetDataInTokenMintByApp(ctx sdk.Context, appMappingID uint64, assetID uint64, changeType bool, amount sdkmath.Int) } diff --git a/x/liquidity/handler.go b/x/liquidity/handler.go index 92bbefab2..0fb400fda 100644 --- a/x/liquidity/handler.go +++ b/x/liquidity/handler.go @@ -1,6 +1,8 @@ package liquidity import ( + errorsmod "cosmossdk.io/errors" + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -11,7 +13,7 @@ import ( ) // NewHandler returns a new msg handler. -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { msgServer := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -64,7 +66,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := msgServer.UnfarmAndWithdraw(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) + return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } diff --git a/x/liquidity/handler_test.go b/x/liquidity/handler_test.go index 15ae335e5..a44ff61ce 100644 --- a/x/liquidity/handler_test.go +++ b/x/liquidity/handler_test.go @@ -1,12 +1,14 @@ package liquidity_test import ( + sdkmath "cosmossdk.io/math" "strings" "testing" "time" _ "github.com/stretchr/testify/suite" + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/app" utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity" @@ -15,7 +17,6 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" ) @@ -39,7 +40,7 @@ func TestInvalidMsg(t *testing.T) { require.Error(t, err) require.Nil(t, res) - _, _, log := sdkerrors.ABCIInfo(err, false) + _, _, log := errorsmod.ABCIInfo(err, false) require.True(t, strings.Contains(log, "unrecognized liquidityV1 message type:")) } @@ -106,7 +107,7 @@ func (s *ModuleTestSuite) TestMsgCreatePool() { s.Require().Equal(false, pools[0].Disabled) s.Require().Equal(appID1, pools[0].AppId) - s.Require().True(utils.ParseCoins("1000000000000uasset1,1000000000000uasset2").IsEqual(s.getBalances(pools[0].GetReserveAddress()))) + s.Require().True(utils.ParseCoins("1000000000000uasset1,1000000000000uasset2").Equal(s.getBalances(pools[0].GetReserveAddress()))) gauges := s.app.Rewardskeeper.GetAllGauges(s.ctx) s.Require().Len(gauges, 1) @@ -190,8 +191,8 @@ func (s *ModuleTestSuite) TestMsgLimitOrder() { types.OrderDirectionBuy, utils.ParseCoin("1003000uasset2"), asset1.Denom, - sdk.NewDec(1), - sdk.NewInt(1000000), + sdkmath.LegacyNewDec(1), + sdkmath.NewInt(1000000), time.Second*10, ) s.fundAddr(addr1, sdk.NewCoins(msg.OfferCoin)) @@ -208,9 +209,9 @@ func (s *ModuleTestSuite) TestMsgLimitOrder() { s.Require().Equal(utils.ParseCoin("1000000uasset2"), orders[0].OfferCoin) s.Require().Equal(utils.ParseCoin("1000000uasset2"), orders[0].RemainingOfferCoin) s.Require().Equal(utils.ParseCoin("0uasset1"), orders[0].ReceivedCoin) - s.Require().Equal(sdk.NewDec(1), orders[0].Price) - s.Require().Equal(sdk.NewInt(1000000), orders[0].Amount) - s.Require().Equal(sdk.NewInt(1000000), orders[0].OpenAmount) + s.Require().Equal(sdkmath.LegacyNewDec(1), orders[0].Price) + s.Require().Equal(sdkmath.NewInt(1000000), orders[0].Amount) + s.Require().Equal(sdkmath.NewInt(1000000), orders[0].OpenAmount) s.Require().Equal(uint64(1), orders[0].BatchId) s.Require().Equal(s.ctx.BlockTime().Add(time.Second*10), orders[0].ExpireAt) s.Require().Equal(types.OrderStatusNotExecuted, orders[0].Status) @@ -229,8 +230,8 @@ func (s *ModuleTestSuite) TestMsgMarketOrder() { pair := s.CreateNewLiquidityPair(appID1, addr1, asset1.Denom, asset2.Denom) _ = s.CreateNewLiquidityPool(appID1, pair.Id, addr1, "1000000000000uasset1,1000000000000uasset2") - s.LimitOrder(appID1, addr1, pair.Id, types.OrderDirectionBuy, utils.ParseDec("1"), sdk.NewInt(10000), 0) - s.LimitOrder(appID1, addr1, pair.Id, types.OrderDirectionSell, utils.ParseDec("1"), sdk.NewInt(10000), 0) + s.LimitOrder(appID1, addr1, pair.Id, types.OrderDirectionBuy, utils.ParseDec("1"), sdkmath.NewInt(10000), 0) + s.LimitOrder(appID1, addr1, pair.Id, types.OrderDirectionSell, utils.ParseDec("1"), sdkmath.NewInt(10000), 0) s.nextBlock() msg := types.NewMsgMarketOrder( @@ -240,7 +241,7 @@ func (s *ModuleTestSuite) TestMsgMarketOrder() { types.OrderDirectionBuy, utils.ParseCoin("1103300uasset2"), asset1.Denom, - sdk.NewInt(1000000), + sdkmath.NewInt(1000000), time.Second*10, ) s.fundAddr(addr1, sdk.NewCoins(msg.OfferCoin)) @@ -257,9 +258,9 @@ func (s *ModuleTestSuite) TestMsgMarketOrder() { s.Require().Equal(utils.ParseCoin("1100000uasset2"), orders[0].OfferCoin) s.Require().Equal(utils.ParseCoin("1100000uasset2"), orders[0].RemainingOfferCoin) s.Require().Equal(utils.ParseCoin("0uasset1"), orders[0].ReceivedCoin) - s.Require().Equal(sdk.MustNewDecFromStr("1.1"), orders[0].Price) - s.Require().Equal(sdk.NewInt(1000000), orders[0].Amount) - s.Require().Equal(sdk.NewInt(1000000), orders[0].OpenAmount) + s.Require().Equal(sdkmath.LegacyMustNewDecFromStr("1.1"), orders[0].Price) + s.Require().Equal(sdkmath.NewInt(1000000), orders[0].Amount) + s.Require().Equal(sdkmath.NewInt(1000000), orders[0].OpenAmount) s.Require().Equal(uint64(2), orders[0].BatchId) s.Require().Equal(s.ctx.BlockTime().Add(time.Second*10), orders[0].ExpireAt) s.Require().Equal(types.OrderStatusNotExecuted, orders[0].Status) @@ -279,7 +280,7 @@ func (s *ModuleTestSuite) TestMsgCancelOrder() { pair := s.CreateNewLiquidityPair(appID1, addr1, asset1.Denom, asset2.Denom) _ = s.CreateNewLiquidityPool(appID1, pair.Id, addr1, "1000000000000uasset1,1000000000000uasset2") - order := s.LimitOrder(appID1, addr2, pair.Id, types.OrderDirectionSell, utils.ParseDec("1.1"), sdk.NewInt(1000000), time.Second*10) + order := s.LimitOrder(appID1, addr2, pair.Id, types.OrderDirectionSell, utils.ParseDec("1.1"), sdkmath.NewInt(1000000), time.Second*10) s.nextBlock() @@ -291,7 +292,7 @@ func (s *ModuleTestSuite) TestMsgCancelOrder() { s.Require().True(found) s.Require().Equal(types.OrderStatusCanceled, order.Status) - s.Require().True(utils.ParseCoins("1003000uasset1").IsEqual(s.getBalances(addr2))) + s.Require().True(utils.ParseCoins("1003000uasset1").Equal(s.getBalances(addr2))) s.nextBlock() _, found = s.keeper.GetOrder(s.ctx, appID1, pair.Id, order.Id) @@ -311,7 +312,7 @@ func (s *ModuleTestSuite) TestMsgCancelAllOrders() { pair := s.CreateNewLiquidityPair(appID1, addr1, asset1.Denom, asset2.Denom) _ = s.CreateNewLiquidityPool(appID1, pair.Id, addr1, "1000000000000uasset1,1000000000000uasset2") - order := s.LimitOrder(appID1, addr2, pair.Id, types.OrderDirectionSell, utils.ParseDec("1.1"), sdk.NewInt(1000000), time.Second*10) + order := s.LimitOrder(appID1, addr2, pair.Id, types.OrderDirectionSell, utils.ParseDec("1.1"), sdkmath.NewInt(1000000), time.Second*10) s.nextBlock() @@ -323,7 +324,7 @@ func (s *ModuleTestSuite) TestMsgCancelAllOrders() { s.Require().True(found) s.Require().Equal(types.OrderStatusCanceled, order.Status) - s.Require().True(utils.ParseCoins("1003000uasset1").IsEqual(s.getBalances(addr2))) + s.Require().True(utils.ParseCoins("1003000uasset1").Equal(s.getBalances(addr2))) s.nextBlock() _, found = s.keeper.GetOrder(s.ctx, appID1, pair.Id, order.Id) @@ -345,7 +346,7 @@ func (s *ModuleTestSuite) TestMsgFarm() { liquidityProvider1 := s.addr(2) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) s.ctx = s.ctx.WithBlockTime(s.ctx.BlockTime()) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("5000000000pool1-1")) @@ -355,7 +356,7 @@ func (s *ModuleTestSuite) TestMsgFarm() { queuedFarmer, found := s.keeper.GetQueuedFarmer(s.ctx, appID1, pool.Id, liquidityProvider1) s.Require().True(found) s.Require().Equal(queuedFarmer.QueudCoins[0].FarmedPoolCoin.Denom, "pool1-1") - s.Require().Equal(queuedFarmer.QueudCoins[0].FarmedPoolCoin.Amount, sdk.NewInt(5000000000)) + s.Require().Equal(queuedFarmer.QueudCoins[0].FarmedPoolCoin.Amount, sdkmath.NewInt(5000000000)) } func (s *ModuleTestSuite) TestMsgUnfarm() { @@ -373,7 +374,7 @@ func (s *ModuleTestSuite) TestMsgUnfarm() { liquidityProvider1 := s.addr(2) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) s.ctx = s.ctx.WithBlockTime(s.ctx.BlockTime()) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("5000000000pool1-1")) @@ -383,7 +384,7 @@ func (s *ModuleTestSuite) TestMsgUnfarm() { queuedFarmer, found := s.keeper.GetQueuedFarmer(s.ctx, appID1, pool.Id, liquidityProvider1) s.Require().True(found) s.Require().Equal(queuedFarmer.QueudCoins[0].FarmedPoolCoin.Denom, "pool1-1") - s.Require().Equal(queuedFarmer.QueudCoins[0].FarmedPoolCoin.Amount, sdk.NewInt(5000000000)) + s.Require().Equal(queuedFarmer.QueudCoins[0].FarmedPoolCoin.Amount, sdkmath.NewInt(5000000000)) msgUnlock := types.NewMsgUnfarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("5000000000pool1-1")) _, err = handler(s.ctx, msgUnlock) @@ -392,5 +393,5 @@ func (s *ModuleTestSuite) TestMsgUnfarm() { queuedFarmer, found = s.keeper.GetQueuedFarmer(s.ctx, appID1, pool.Id, liquidityProvider1) s.Require().True(found) s.Require().Len(queuedFarmer.QueudCoins, 0) - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) } diff --git a/x/liquidity/keeper/grpc_query.go b/x/liquidity/keeper/grpc_query.go index 527923a7d..8fd097e6c 100644 --- a/x/liquidity/keeper/grpc_query.go +++ b/x/liquidity/keeper/grpc_query.go @@ -4,13 +4,14 @@ import ( "context" "strconv" + errorsmod "cosmossdk.io/errors" + "google.golang.org/grpc/codes" "google.golang.org/grpc/status" sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" @@ -713,7 +714,7 @@ func (k Querier) FarmedPoolCoin(c context.Context, req *types.QueryFarmedPoolCoi ctx := sdk.UnwrapSDKContext(c) pool, found := k.GetPool(ctx, req.AppId, req.PoolId) if !found { - return nil, sdkerrors.Wrapf(types.ErrInvalidPoolID, "pool id %d is invalid", req.PoolId) + return nil, errorsmod.Wrapf(types.ErrInvalidPoolID, "pool id %d is invalid", req.PoolId) } moduleAddr := k.accountKeeper.GetModuleAddress(types.ModuleName) farmedCoins := k.bankKeeper.GetBalance(ctx, moduleAddr, pool.PoolCoinDenom) @@ -804,12 +805,12 @@ func (k Querier) OrderBooks(c context.Context, req *types.QueryOrderBooksRequest _, found := k.assetKeeper.GetApp(ctx, req.AppId) if !found { - return nil, sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", req.AppId) + return nil, errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", req.AppId) } params, err := k.GetGenericParams(ctx, req.AppId) if err != nil { - return nil, sdkerrors.Wrap(err, "params retreval failed") + return nil, errorsmod.Wrap(err, "params retreval failed") } tickPrec := params.TickPrecision diff --git a/x/liquidity/keeper/grpc_query_test.go b/x/liquidity/keeper/grpc_query_test.go index 31fb916bb..e2d3719db 100644 --- a/x/liquidity/keeper/grpc_query_test.go +++ b/x/liquidity/keeper/grpc_query_test.go @@ -3,10 +3,11 @@ package keeper_test import ( "time" + errorsmod "cosmossdk.io/errors" + utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" _ "github.com/stretchr/testify/suite" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -39,7 +40,7 @@ func (s *KeeperTestSuite) TestGenericParams() { { Name: "error app id invalid", Req: &types.QueryGenericParamsRequest{AppId: 6969}, - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id 6969 not found"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id 6969 not found"), }, { Name: "success", @@ -955,7 +956,7 @@ func (s *KeeperTestSuite) TestFarmer() { liquidityProvider1 := s.addr(2) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) s.ctx = s.ctx.WithBlockTime(s.ctx.BlockTime()) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("5000000000pool1-1")) @@ -1135,7 +1136,7 @@ func (s *KeeperTestSuite) TestFarmedPoolCoin() { liquidityProvider1 := s.addr(2) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) s.ctx = s.ctx.WithBlockTime(s.ctx.BlockTime()) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("5000000000pool1-1")) @@ -1167,7 +1168,7 @@ func (s *KeeperTestSuite) TestFarmedPoolCoin() { { Name: "error pool id invalid", Req: &types.QueryFarmedPoolCoinRequest{AppId: appID1, PoolId: 123}, - ExpErr: sdkerrors.Wrapf(types.ErrInvalidPoolID, "pool id 123 is invalid"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidPoolID, "pool id 123 is invalid"), }, { Name: "success only by orderer", diff --git a/x/liquidity/keeper/keeper.go b/x/liquidity/keeper/keeper.go index eace2dfda..a99da3a83 100644 --- a/x/liquidity/keeper/keeper.go +++ b/x/liquidity/keeper/keeper.go @@ -3,14 +3,14 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/liquidity/expected" "github.com/comdex-official/comdex/x/liquidity/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" ) // Keeper of the liquidity store. diff --git a/x/liquidity/keeper/keeper_test.go b/x/liquidity/keeper/keeper_test.go index 2cc25dd0b..8cd78bd19 100644 --- a/x/liquidity/keeper/keeper_test.go +++ b/x/liquidity/keeper/keeper_test.go @@ -9,7 +9,6 @@ import ( "github.com/stretchr/testify/suite" sdkmath "cosmossdk.io/math" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -39,7 +38,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.keeper = s.app.LiquidityKeeper s.querier = keeper.Querier{Keeper: s.keeper} s.msgServer = keeper.NewMsgServerImpl(s.keeper) @@ -93,7 +92,7 @@ func coinEq(exp, got sdk.Coin) (bool, string, string, string) { } func coinsEq(exp, got sdk.Coins) (bool, string, string, string) { - return exp.IsEqual(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String() + return exp.Equal(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String() } func intEq(exp, got sdkmath.Int) (bool, string, string, string) { diff --git a/x/liquidity/keeper/pair.go b/x/liquidity/keeper/pair.go index 9b107ab0d..7750a80b1 100644 --- a/x/liquidity/keeper/pair.go +++ b/x/liquidity/keeper/pair.go @@ -3,8 +3,9 @@ package keeper import ( "strconv" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/comdex-official/comdex/x/liquidity/types" ) @@ -28,15 +29,15 @@ func (k Keeper) getNextOrderIDWithUpdate(ctx sdk.Context, pair types.Pair) uint6 func (k Keeper) ValidateMsgCreatePair(ctx sdk.Context, msg *types.MsgCreatePair) error { _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } if !k.assetKeeper.HasAssetForDenom(ctx, msg.BaseCoinDenom) { - return sdkerrors.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", msg.BaseCoinDenom) + return errorsmod.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", msg.BaseCoinDenom) } if !k.assetKeeper.HasAssetForDenom(ctx, msg.QuoteCoinDenom) { - return sdkerrors.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", msg.QuoteCoinDenom) + return errorsmod.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", msg.QuoteCoinDenom) } if _, found := k.GetPairByDenoms(ctx, msg.AppId, msg.BaseCoinDenom, msg.QuoteCoinDenom); found { @@ -53,7 +54,7 @@ func (k Keeper) CreatePair(ctx sdk.Context, msg *types.MsgCreatePair, isViaProp params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return types.Pair{}, sdkerrors.Wrap(err, "params retreval failed") + return types.Pair{}, errorsmod.Wrap(err, "params retreval failed") } // ignore fee collection if the request is from proposal @@ -61,7 +62,7 @@ func (k Keeper) CreatePair(ctx sdk.Context, msg *types.MsgCreatePair, isViaProp // Send the pair creation fee to the fee collector. feeCollectorAddr, _ := sdk.AccAddressFromBech32(params.FeeCollectorAddress) if err := k.bankKeeper.SendCoins(ctx, msg.GetCreator(), feeCollectorAddr, params.PairCreationFee); err != nil { - return types.Pair{}, sdkerrors.Wrap(err, "insufficient pair creation fee") + return types.Pair{}, errorsmod.Wrap(err, "insufficient pair creation fee") } } diff --git a/x/liquidity/keeper/pair_test.go b/x/liquidity/keeper/pair_test.go index f6d62594f..a02cb1a27 100644 --- a/x/liquidity/keeper/pair_test.go +++ b/x/liquidity/keeper/pair_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/x/liquidity/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -30,7 +31,7 @@ func (s *KeeperTestSuite) TestCreatePair() { Msg: *types.NewMsgCreatePair( 69, addr1, asset1.Denom, asset2.Denom, ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), ExpResp: &types.Pair{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -41,7 +42,7 @@ func (s *KeeperTestSuite) TestCreatePair() { Msg: *types.NewMsgCreatePair( appID1, addr1, "dummy1", "dummy2", ), - ExpErr: sdkerrors.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", "dummy1"), + ExpErr: errorsmod.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", "dummy1"), ExpResp: &types.Pair{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -52,7 +53,7 @@ func (s *KeeperTestSuite) TestCreatePair() { Msg: *types.NewMsgCreatePair( appID1, addr1, "dummy1", asset2.Denom, ), - ExpErr: sdkerrors.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", "dummy1"), + ExpErr: errorsmod.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", "dummy1"), ExpResp: &types.Pair{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -63,7 +64,7 @@ func (s *KeeperTestSuite) TestCreatePair() { Msg: *types.NewMsgCreatePair( appID1, addr1, asset1.Denom, "dummy2", ), - ExpErr: sdkerrors.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", "dummy2"), + ExpErr: errorsmod.Wrapf(types.ErrAssetNotWhiteListed, "asset with denom %s is not white listed", "dummy2"), ExpResp: &types.Pair{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -74,7 +75,7 @@ func (s *KeeperTestSuite) TestCreatePair() { Msg: *types.NewMsgCreatePair( appID1, addr1, asset1.Denom, asset2.Denom, ), - ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 2000000000ucmdx"), "insufficient pair creation fee"), + ExpErr: errorsmod.Wrap(errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 2000000000ucmdx"), "insufficient pair creation fee"), ExpResp: &types.Pair{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -229,12 +230,12 @@ func (s *KeeperTestSuite) TestCreatePair() { s.Require().Equal(tc.ExpResp, &resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Creator)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) params, err := s.keeper.GetGenericParams(s.ctx, tc.Msg.AppId) s.Require().NoError(err) collectedPairCreationFee := s.getBalances(sdk.MustAccAddressFromBech32(params.FeeCollectorAddress)) - s.Require().True(sdk.NewCoins(sdk.NewCoin(params.PairCreationFee[0].Denom, params.PairCreationFee[0].Amount.Mul(sdkmath.NewInt(int64(tc.QueryResponseIndex+1))))).IsEqual(collectedPairCreationFee)) + s.Require().True(sdk.NewCoins(sdk.NewCoin(params.PairCreationFee[0].Denom, params.PairCreationFee[0].Amount.Mul(sdkmath.NewInt(int64(tc.QueryResponseIndex+1))))).Equal(collectedPairCreationFee)) pairs := s.keeper.GetAllPairs(s.ctx, tc.Msg.AppId) s.Require().Len(pairs, int(tc.QueryResponseIndex)+1) diff --git a/x/liquidity/keeper/params.go b/x/liquidity/keeper/params.go index cb0563445..4f29eda5e 100644 --- a/x/liquidity/keeper/params.go +++ b/x/liquidity/keeper/params.go @@ -4,8 +4,9 @@ import ( "fmt" "reflect" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -32,7 +33,7 @@ func (k Keeper) GetGenericParams(ctx sdk.Context, appID uint64) (types.GenericPa } _, found := k.assetKeeper.GetApp(ctx, appID) if !found { - return types.GenericParams{}, sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", appID) + return types.GenericParams{}, errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", appID) } genericParams = types.DefaultGenericParams(appID) k.SetGenericParams(ctx, genericParams) @@ -48,7 +49,7 @@ func (k Keeper) SetGenericParams(ctx sdk.Context, genericParams types.GenericPar func (k Keeper) UpdateGenericParams(ctx sdk.Context, appID uint64, keys, values []string) error { _, found := k.assetKeeper.GetApp(ctx, appID) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", appID) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", appID) } if len(keys) != len(values) { diff --git a/x/liquidity/keeper/params_test.go b/x/liquidity/keeper/params_test.go index 3e1dae17a..832d9c32d 100644 --- a/x/liquidity/keeper/params_test.go +++ b/x/liquidity/keeper/params_test.go @@ -4,9 +4,10 @@ import ( "fmt" "time" + errorsmod "cosmossdk.io/errors" + utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" _ "github.com/stretchr/testify/suite" ) @@ -28,7 +29,7 @@ func (s *KeeperTestSuite) TestUpdateGenericParams() { appID: 69, Keys: []string{}, Values: []string{}, - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id 69 not found"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id 69 not found"), }, { Name: "error key-value length mismatch", diff --git a/x/liquidity/keeper/pool.go b/x/liquidity/keeper/pool.go index bbdf608b8..0611ccdb9 100644 --- a/x/liquidity/keeper/pool.go +++ b/x/liquidity/keeper/pool.go @@ -4,6 +4,8 @@ import ( "fmt" "strconv" + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -74,25 +76,25 @@ func (k Keeper) MarkPoolAsDisabled(ctx sdk.Context, pool types.Pool) { func (k Keeper) ValidateMsgCreatePool(ctx sdk.Context, msg *types.MsgCreatePool) error { _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } pair, found := k.GetPair(ctx, msg.AppId, msg.PairId) if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) } params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return sdkerrors.Wrap(err, "params retreval failed") + return errorsmod.Wrap(err, "params retreval failed") } for _, coin := range msg.DepositCoins { if coin.Denom != pair.BaseCoinDenom && coin.Denom != pair.QuoteCoinDenom { - return sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", coin.Denom) + return errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", coin.Denom) } minDepositCoin := sdk.NewCoin(coin.Denom, params.MinInitialDepositAmount) if coin.IsLT(minDepositCoin) { - return sdkerrors.Wrapf( + return errorsmod.Wrapf( types.ErrInsufficientDepositAmount, "%s is smaller than %s", coin, minDepositCoin) } } @@ -129,14 +131,14 @@ func (k Keeper) CreatePool(ctx sdk.Context, msg *types.MsgCreatePool) (types.Poo params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return types.Pool{}, sdkerrors.Wrap(err, "params retreval failed") + return types.Pool{}, errorsmod.Wrap(err, "params retreval failed") } pair, _ := k.GetPair(ctx, msg.AppId, msg.PairId) x, y := msg.DepositCoins.AmountOf(pair.QuoteCoinDenom), msg.DepositCoins.AmountOf(pair.BaseCoinDenom) ammPool, err := amm.CreateBasicPool(x, y) if err != nil { - return types.Pool{}, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + return types.Pool{}, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } // Create and save the new pool object. @@ -155,7 +157,7 @@ func (k Keeper) CreatePool(ctx sdk.Context, msg *types.MsgCreatePool) (types.Poo // Send the pool creation fee to the fee collector. feeCollectorAddr, _ := sdk.AccAddressFromBech32(params.FeeCollectorAddress) if err := k.bankKeeper.SendCoins(ctx, creator, feeCollectorAddr, params.PoolCreationFee); err != nil { - return types.Pool{}, sdkerrors.Wrap(err, "insufficient pool creation fee") + return types.Pool{}, errorsmod.Wrap(err, "insufficient pool creation fee") } // Mint and send pool coin to the creator. @@ -216,38 +218,38 @@ func (k Keeper) CreatePool(ctx sdk.Context, msg *types.MsgCreatePool) (types.Poo func (k Keeper) ValidateMsgCreateRangedPool(ctx sdk.Context, msg *types.MsgCreateRangedPool) error { _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return sdkerrors.Wrap(err, "params retreval failed") + return errorsmod.Wrap(err, "params retreval failed") } tickPrec := params.TickPrecision if !amm.PriceToDownTick(msg.MinPrice, int(tickPrec)).Equal(msg.MinPrice) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "min price is not on ticks") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "min price is not on ticks") } if !amm.PriceToDownTick(msg.MaxPrice, int(tickPrec)).Equal(msg.MaxPrice) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "max price is not on ticks") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "max price is not on ticks") } if !amm.PriceToDownTick(msg.InitialPrice, int(tickPrec)).Equal(msg.InitialPrice) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "initial price is not on ticks") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "initial price is not on ticks") } lowestTick := amm.LowestTick(int(tickPrec)) if msg.MinPrice.LT(lowestTick) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "min price must not be less than %s", lowestTick) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "min price must not be less than %s", lowestTick) } pair, found := k.GetPair(ctx, msg.AppId, msg.PairId) if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) } for _, coin := range msg.DepositCoins { if coin.Denom != pair.BaseCoinDenom && coin.Denom != pair.QuoteCoinDenom { - return sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", coin.Denom) + return errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", coin.Denom) } } @@ -273,7 +275,7 @@ func (k Keeper) CreateRangedPool(ctx sdk.Context, msg *types.MsgCreateRangedPool params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return types.Pool{}, sdkerrors.Wrap(err, "params retreval failed") + return types.Pool{}, errorsmod.Wrap(err, "params retreval failed") } pair, _ := k.GetPair(ctx, msg.AppId, msg.PairId) @@ -281,7 +283,7 @@ func (k Keeper) CreateRangedPool(ctx sdk.Context, msg *types.MsgCreateRangedPool x, y := msg.DepositCoins.AmountOf(pair.QuoteCoinDenom), msg.DepositCoins.AmountOf(pair.BaseCoinDenom) ammPool, err := amm.CreateRangedPool(x, y, msg.MinPrice, msg.MaxPrice, msg.InitialPrice) if err != nil { - return types.Pool{}, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + return types.Pool{}, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } ax, ay := ammPool.Balances() @@ -308,7 +310,7 @@ func (k Keeper) CreateRangedPool(ctx sdk.Context, msg *types.MsgCreateRangedPool // Send the pool creation fee to the fee collector. feeCollectorAddr, _ := sdk.AccAddressFromBech32(params.FeeCollectorAddress) if err := k.bankKeeper.SendCoins(ctx, creator, feeCollectorAddr, params.PoolCreationFee); err != nil { - return types.Pool{}, sdkerrors.Wrap(err, "insufficient pool creation fee") + return types.Pool{}, errorsmod.Wrap(err, "insufficient pool creation fee") } // Mint and send pool coin to the creator. @@ -365,12 +367,12 @@ func (k Keeper) CreateRangedPool(ctx sdk.Context, msg *types.MsgCreateRangedPool func (k Keeper) ValidateMsgDeposit(ctx sdk.Context, msg *types.MsgDeposit) error { _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } pool, found := k.GetPool(ctx, msg.AppId, msg.PoolId) if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", msg.PoolId) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", msg.PoolId) } if pool.Disabled { return types.ErrDisabledPool @@ -380,7 +382,7 @@ func (k Keeper) ValidateMsgDeposit(ctx sdk.Context, msg *types.MsgDeposit) error for _, coin := range msg.DepositCoins { if coin.Denom != pair.BaseCoinDenom && coin.Denom != pair.QuoteCoinDenom { - return sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", coin.Denom) + return errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", coin.Denom) } } @@ -403,7 +405,7 @@ func (k Keeper) Deposit(ctx sdk.Context, msg *types.MsgDeposit) (types.DepositRe params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return types.DepositRequest{}, sdkerrors.Wrap(err, "params retreval failed") + return types.DepositRequest{}, errorsmod.Wrap(err, "params retreval failed") } if err := k.bankKeeper.SendCoins(ctx, msg.GetDepositor(), types.GlobalEscrowAddress, msg.DepositCoins); err != nil { @@ -435,12 +437,12 @@ func (k Keeper) Deposit(ctx sdk.Context, msg *types.MsgDeposit) (types.DepositRe func (k Keeper) ValidateMsgWithdraw(ctx sdk.Context, msg *types.MsgWithdraw) error { _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } pool, found := k.GetPool(ctx, msg.AppId, msg.PoolId) if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", msg.PoolId) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", msg.PoolId) } if pool.Disabled { return types.ErrDisabledPool @@ -461,7 +463,7 @@ func (k Keeper) Withdraw(ctx sdk.Context, msg *types.MsgWithdraw) (types.Withdra params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return types.WithdrawRequest{}, sdkerrors.Wrap(err, "params retreval failed") + return types.WithdrawRequest{}, errorsmod.Wrap(err, "params retreval failed") } pool, _ := k.GetPool(ctx, msg.AppId, msg.PoolId) @@ -579,7 +581,7 @@ func (k Keeper) FinishDepositRequest(ctx sdk.Context, req types.DepositRequest, func (k Keeper) ExecuteWithdrawRequest(ctx sdk.Context, req types.WithdrawRequest) error { params, err := k.GetGenericParams(ctx, req.AppId) if err != nil { - return sdkerrors.Wrap(err, "params retreval failed") + return errorsmod.Wrap(err, "params retreval failed") } pool, _ := k.GetPool(ctx, req.AppId, req.PoolId) @@ -696,7 +698,7 @@ func (k Keeper) TransferFundsForSwapFeeDistribution(ctx sdk.Context, appID, requ params, err := k.GetGenericParams(ctx, appID) if err != nil { - return sdk.Coin{}, sdkerrors.Wrap(err, "params retreval failed") + return sdk.Coin{}, errorsmod.Wrap(err, "params retreval failed") } availableBalance := k.bankKeeper.GetBalance(ctx, pair.GetSwapFeeCollectorAddress(), params.SwapFeeDistrDenom) @@ -830,12 +832,12 @@ func (k Keeper) ValidateMsgDepositAndFarm(ctx sdk.Context, msg *types.MsgDeposit _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } pool, found := k.GetPool(ctx, msg.AppId, msg.PoolId) if !found { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", msg.PoolId) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", msg.PoolId) } if pool.Disabled { return types.ErrDisabledPool @@ -845,7 +847,7 @@ func (k Keeper) ValidateMsgDepositAndFarm(ctx sdk.Context, msg *types.MsgDeposit for _, coin := range msg.DepositCoins { if coin.Denom != pair.BaseCoinDenom && coin.Denom != pair.QuoteCoinDenom { - return sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", coin.Denom) + return errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", coin.Denom) } } @@ -897,19 +899,19 @@ func (k Keeper) ValidateMsgUnfarmAndWithdraw(ctx sdk.Context, msg *types.MsgUnfa _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } pool, found := k.GetPool(ctx, msg.AppId, msg.PoolId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", msg.PoolId) + return errorsmod.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", msg.PoolId) } if msg.UnfarmingPoolCoin.Denom != pool.PoolCoinDenom { - return sdkerrors.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found %s", pool.PoolCoinDenom, msg.UnfarmingPoolCoin.Denom) + return errorsmod.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found %s", pool.PoolCoinDenom, msg.UnfarmingPoolCoin.Denom) } if !msg.UnfarmingPoolCoin.Amount.IsPositive() { - return sdkerrors.Wrapf(types.ErrorNotPositiveAmont, "pool coin amount should be positive") + return errorsmod.Wrapf(types.ErrorNotPositiveAmont, "pool coin amount should be positive") } return nil } diff --git a/x/liquidity/keeper/pool_test.go b/x/liquidity/keeper/pool_test.go index c51335b0b..afde96b78 100644 --- a/x/liquidity/keeper/pool_test.go +++ b/x/liquidity/keeper/pool_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + errorsmod "cosmossdk.io/errors" utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity" "github.com/comdex-official/comdex/x/liquidity/amm" @@ -45,7 +46,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( 69, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin(app1pair.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -56,7 +57,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( appID1, addr1, 12, sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin(app1pair.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", 12), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", 12), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -67,7 +68,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin("fakedenom1", sdkmath.NewInt(1000000000000)), sdk.NewCoin("fakedenom2", sdkmath.NewInt(1000000000000))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom1"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom1"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -78,7 +79,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin("fakedenom2", sdkmath.NewInt(1000000000000))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom2"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom2"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -89,7 +90,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin("fakedenom1", sdkmath.NewInt(1000000000000)), sdk.NewCoin(app1pair.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom1"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom1"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -100,7 +101,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1))), sdk.NewCoin(app1pair.QuoteCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1)))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInsufficientDepositAmount, "%s is smaller than %s", sdk.NewCoin(app1pair.BaseCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1))), sdk.NewCoin(app1pair.BaseCoinDenom, params.MinInitialDepositAmount)), + ExpErr: errorsmod.Wrapf(types.ErrInsufficientDepositAmount, "%s is smaller than %s", sdk.NewCoin(app1pair.BaseCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1))), sdk.NewCoin(app1pair.BaseCoinDenom, params.MinInitialDepositAmount)), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -111,7 +112,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, params.MinInitialDepositAmount), sdk.NewCoin(app1pair.QuoteCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1)))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInsufficientDepositAmount, "%s is smaller than %s", sdk.NewCoin(app1pair.QuoteCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1))), sdk.NewCoin(app1pair.QuoteCoinDenom, params.MinInitialDepositAmount)), + ExpErr: errorsmod.Wrapf(types.ErrInsufficientDepositAmount, "%s is smaller than %s", sdk.NewCoin(app1pair.QuoteCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1))), sdk.NewCoin(app1pair.QuoteCoinDenom, params.MinInitialDepositAmount)), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -124,7 +125,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( appID1, addr1, dummyPair1.Id, sdk.NewCoins(sdk.NewCoin(dummyPair1.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin(dummyPair1.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 1000000000000%s", dummyPair1.QuoteCoinDenom), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 1000000000000%s", dummyPair1.QuoteCoinDenom), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -137,7 +138,7 @@ func (s *KeeperTestSuite) TestCreatePool() { Msg: *types.NewMsgCreatePool( appID1, addr1, dummyPair2.Id, sdk.NewCoins(sdk.NewCoin(dummyPair2.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin(dummyPair2.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), ), - ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than %s", params.PoolCreationFee[0].String()), "insufficient pool creation fee"), + ExpErr: errorsmod.Wrap(errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than %s", params.PoolCreationFee[0].String()), "insufficient pool creation fee"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -244,7 +245,7 @@ func (s *KeeperTestSuite) TestCreatePool() { s.Require().Equal(tc.ExpResp, &resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Creator)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) params, err := s.keeper.GetGenericParams(s.ctx, tc.Msg.AppId) s.Require().NoError(err) @@ -259,7 +260,7 @@ func (s *KeeperTestSuite) TestCreatePool() { } collectedPairPoolCreationFee := s.getBalances(sdk.MustAccAddressFromBech32(params.FeeCollectorAddress)) - s.Require().True(sdk.NewCoins(expectedPairCreationFeesCollected.Add(expectedPoolCreationFeesCollected)).IsEqual(collectedPairPoolCreationFee)) + s.Require().True(sdk.NewCoins(expectedPairCreationFeesCollected.Add(expectedPoolCreationFeesCollected)).Equal(collectedPairPoolCreationFee)) pools := s.keeper.GetAllPools(s.ctx, tc.Msg.AppId) s.Require().Len(pools, int(tc.QueryResponseIndex)+1) @@ -397,7 +398,7 @@ func (s *KeeperTestSuite) TestDeposit() { Msg: *types.NewMsgDeposit( 69, addr1, app1Pool.Id, sdk.NewCoins(sdk.NewCoin(app1Pair.BaseCoinDenom, sdkmath.NewInt(100000000)), sdk.NewCoin(app1Pair.QuoteCoinDenom, sdkmath.NewInt(100000000))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), ExpResp: &types.DepositRequest{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -408,7 +409,7 @@ func (s *KeeperTestSuite) TestDeposit() { Msg: *types.NewMsgDeposit( appID1, addr1, 69, sdk.NewCoins(sdk.NewCoin(app1Pair.BaseCoinDenom, sdkmath.NewInt(100000000)), sdk.NewCoin(app1Pair.QuoteCoinDenom, sdkmath.NewInt(100000000))), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", 69), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", 69), ExpResp: &types.DepositRequest{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -419,7 +420,7 @@ func (s *KeeperTestSuite) TestDeposit() { Msg: *types.NewMsgDeposit( appID1, addr1, app1Pool.Id, sdk.NewCoins(sdk.NewCoin("fakedenom1", sdkmath.NewInt(100000000)), sdk.NewCoin("fakedenom2", sdkmath.NewInt(100000000))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom fakedenom1 is not in the pair"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom fakedenom1 is not in the pair"), ExpResp: &types.DepositRequest{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -430,7 +431,7 @@ func (s *KeeperTestSuite) TestDeposit() { Msg: *types.NewMsgDeposit( appID1, addr1, app1Pool.Id, sdk.NewCoins(sdk.NewCoin(app1Pair.BaseCoinDenom, sdkmath.NewInt(100000000)), sdk.NewCoin("fakedenom2", sdkmath.NewInt(100000000))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom fakedenom2 is not in the pair"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom fakedenom2 is not in the pair"), ExpResp: &types.DepositRequest{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -441,7 +442,7 @@ func (s *KeeperTestSuite) TestDeposit() { Msg: *types.NewMsgDeposit( appID1, addr1, app1Pool.Id, sdk.NewCoins(sdk.NewCoin("fakedenom1", sdkmath.NewInt(100000000)), sdk.NewCoin(app1Pair.QuoteCoinDenom, sdkmath.NewInt(100000000))), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom fakedenom1 is not in the pair"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom fakedenom1 is not in the pair"), ExpResp: &types.DepositRequest{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -452,7 +453,7 @@ func (s *KeeperTestSuite) TestDeposit() { Msg: *types.NewMsgDeposit( appID1, addr1, app1Pool.Id, sdk.NewCoins(sdk.NewCoin(app1Pair.BaseCoinDenom, sdkmath.NewInt(100000000)), sdk.NewCoin(app1Pair.QuoteCoinDenom, sdkmath.NewInt(100000000))), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 100000000%s", app1Pair.BaseCoinDenom), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 100000000%s", app1Pair.BaseCoinDenom), ExpResp: &types.DepositRequest{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -566,7 +567,7 @@ func (s *KeeperTestSuite) TestDeposit() { s.Require().NoError(err) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Depositor)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) resp, found := s.keeper.GetDepositRequest(s.ctx, tc.Msg.AppId, tc.Msg.PoolId, depositReq.Id) s.Require().True(found) s.Require().Equal(tc.ExpResp.Id, resp.Id) @@ -610,7 +611,7 @@ func (s *KeeperTestSuite) TestDepositRefund() { liquidity.EndBlocker(s.ctx, s.keeper, s.app.AssetKeeper) req, _ = s.keeper.GetDepositRequest(s.ctx, appID1, req.PoolId, req.Id) s.Require().Equal(types.RequestStatusFailed, req.Status) - s.Require().True(req.DepositCoins.IsEqual(s.getBalances(addr2))) + s.Require().True(req.DepositCoins.Equal(s.getBalances(addr2))) } func (s *KeeperTestSuite) TestDepositRefundTooSmallMintedPoolCoin() { @@ -643,7 +644,7 @@ func (s *KeeperTestSuite) TestDepositRefundTooSmallMintedPoolCoin() { req, _ = s.keeper.GetDepositRequest(s.ctx, appID1, req.PoolId, req.Id) s.Require().Equal(types.RequestStatusFailed, req.Status) - s.Require().True(req.DepositCoins.IsEqual(s.getBalances(addr3))) + s.Require().True(req.DepositCoins.Equal(s.getBalances(addr3))) } func (s *KeeperTestSuite) TestDepositToDisabledPool() { @@ -718,7 +719,7 @@ func (s *KeeperTestSuite) TestWithdraw() { Msg: *types.NewMsgWithdraw( 69, addr1, pool.Id, availablePoolBalance, ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), ExpResp: &types.WithdrawRequest{}, AvailableBalance: sdk.NewCoins(), }, @@ -727,7 +728,7 @@ func (s *KeeperTestSuite) TestWithdraw() { Msg: *types.NewMsgWithdraw( appID1, addr1, 69, availablePoolBalance, ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", 69), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrNotFound, "pool %d not found", 69), ExpResp: &types.WithdrawRequest{}, AvailableBalance: sdk.NewCoins(), }, @@ -736,7 +737,7 @@ func (s *KeeperTestSuite) TestWithdraw() { Msg: *types.NewMsgWithdraw( appID1, addr1, pool.Id, availablePoolBalance.Add(sdk.NewCoin(availablePoolBalance.Denom, availablePoolBalance.Amount.Add(newInt(1000)))), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance %s is smaller than %s", availablePoolBalance.String(), availablePoolBalance.Add(sdk.NewCoin(availablePoolBalance.Denom, availablePoolBalance.Amount.Add(newInt(1000)))).String()), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance %s is smaller than %s", availablePoolBalance.String(), availablePoolBalance.Add(sdk.NewCoin(availablePoolBalance.Denom, availablePoolBalance.Amount.Add(newInt(1000)))).String()), ExpResp: &types.WithdrawRequest{}, AvailableBalance: sdk.NewCoins(), }, @@ -783,11 +784,11 @@ func (s *KeeperTestSuite) TestWithdraw() { s.Require().Equal(tc.ExpResp, &withdrawReq) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Withdrawer)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) depositedCoins := s.getBalances(pool.GetReserveAddress()) s.nextBlock() - s.Require().True(depositedCoins.IsEqual(s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Withdrawer)))) + s.Require().True(depositedCoins.Equal(s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Withdrawer)))) } }) } @@ -816,7 +817,7 @@ func (s *KeeperTestSuite) TestWithdrawRefund() { s.Withdraw(appID1, pool.Id, addr2, poolCoin) s.nextBlock() - s.Require().True(sdk.NewCoins(poolCoin).IsEqual(s.getBalances(addr2))) + s.Require().True(sdk.NewCoins(poolCoin).Equal(s.getBalances(addr2))) } func (s *KeeperTestSuite) TestWithdrawRefundTooSmallWithdrawCoins() { @@ -839,7 +840,7 @@ func (s *KeeperTestSuite) TestWithdrawRefundTooSmallWithdrawCoins() { s.Withdraw(appID1, pool.Id, addr2, utils.ParseCoin("100pool1-1")) s.nextBlock() - s.Require().True(sdk.NewCoins(poolCoin).IsEqual(s.getBalances(addr2))) + s.Require().True(sdk.NewCoins(poolCoin).Equal(s.getBalances(addr2))) } func (s *KeeperTestSuite) TestWithdrawFromDisabledPool() { @@ -945,7 +946,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin(app1pair.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("1"), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -958,7 +959,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin(app1pair.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("1"), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", 12), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", 12), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -971,7 +972,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { sdk.NewCoins(sdk.NewCoin("fakedenom1", sdkmath.NewInt(1000000000000)), sdk.NewCoin("fakedenom2", sdkmath.NewInt(1000000000000))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("1"), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom1"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom1"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -983,7 +984,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin("fakedenom2", sdkmath.NewInt(1000000000000))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("1"), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom2"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom2"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -995,7 +996,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin("fakedenom1", sdkmath.NewInt(1000000000000)), sdk.NewCoin(app1pair.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("1"), ), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom1"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidCoinDenom, "coin denom %s is not in the pair", "fakedenom1"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -1031,7 +1032,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, params.MinInitialDepositAmount), sdk.NewCoin(app1pair.QuoteCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1)))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("0.98"), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "initial price must not be lower than min price"), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "initial price must not be lower than min price"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -1043,7 +1044,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { appID1, addr1, app1pair.Id, sdk.NewCoins(sdk.NewCoin(app1pair.BaseCoinDenom, params.MinInitialDepositAmount), sdk.NewCoin(app1pair.QuoteCoinDenom, params.MinInitialDepositAmount.Sub(sdkmath.NewInt(1)))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("1.05"), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "initial price must not be higher than max price"), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "initial price must not be higher than max price"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -1057,7 +1058,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { appID1, addr1, dummyPair1.Id, sdk.NewCoins(sdk.NewCoin(dummyPair1.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin(dummyPair1.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("1"), ), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 1000000000000%s", dummyPair1.QuoteCoinDenom), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 1000000000000%s", dummyPair1.QuoteCoinDenom), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -1071,7 +1072,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { appID1, addr1, dummyPair2.Id, sdk.NewCoins(sdk.NewCoin(dummyPair2.BaseCoinDenom, sdkmath.NewInt(1000000000000)), sdk.NewCoin(dummyPair2.QuoteCoinDenom, sdkmath.NewInt(1000000000000))), sdkmath.LegacyMustNewDecFromStr("0.99"), sdkmath.LegacyMustNewDecFromStr("1.01"), sdkmath.LegacyMustNewDecFromStr("1"), ), - ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than %s", params.PoolCreationFee[0].String()), "insufficient pool creation fee"), + ExpErr: errorsmod.Wrap(errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than %s", params.PoolCreationFee[0].String()), "insufficient pool creation fee"), ExpResp: &types.Pool{}, QueryResponseIndex: 0, QueryResponse: nil, @@ -1183,7 +1184,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { s.Require().Equal(tc.ExpResp, &resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Creator)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) params, err := s.keeper.GetGenericParams(s.ctx, tc.Msg.AppId) s.Require().NoError(err) @@ -1198,7 +1199,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() { } collectedPairPoolCreationFee := s.getBalances(sdk.MustAccAddressFromBech32(params.FeeCollectorAddress)) - s.Require().True(sdk.NewCoins(expectedPairCreationFeesCollected.Add(expectedPoolCreationFeesCollected)).IsEqual(collectedPairPoolCreationFee)) + s.Require().True(sdk.NewCoins(expectedPairCreationFeesCollected.Add(expectedPoolCreationFeesCollected)).Equal(collectedPairPoolCreationFee)) pools := s.keeper.GetAllPools(s.ctx, tc.Msg.AppId) s.Require().Len(pools, int(tc.QueryResponseIndex)+1) s.Require().Equal(tc.QueryResponse.Id, pools[tc.QueryResponseIndex].Id) diff --git a/x/liquidity/keeper/rewards.go b/x/liquidity/keeper/rewards.go index 3054cb7b6..9b86efb0d 100644 --- a/x/liquidity/keeper/rewards.go +++ b/x/liquidity/keeper/rewards.go @@ -6,9 +6,10 @@ import ( "strconv" "time" + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/liquidity/amm" @@ -34,17 +35,17 @@ func (k Keeper) CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (pri func (k Keeper) GetPoolTokenDesrializerKit(ctx sdk.Context, appID, poolID uint64) (types.PoolTokenDeserializerKit, error) { pool, found := k.GetPool(ctx, appID, poolID) if !found { - return types.PoolTokenDeserializerKit{}, sdkerrors.Wrapf(types.ErrInvalidPoolID, "pool %d is invalid", poolID) + return types.PoolTokenDeserializerKit{}, errorsmod.Wrapf(types.ErrInvalidPoolID, "pool %d is invalid", poolID) } if pool.Disabled { - return types.PoolTokenDeserializerKit{}, sdkerrors.Wrapf(types.ErrDisabledPool, "pool %d is disabled", poolID) + return types.PoolTokenDeserializerKit{}, errorsmod.Wrapf(types.ErrDisabledPool, "pool %d is disabled", poolID) } pair, _ := k.GetPair(ctx, pool.AppId, pool.PairId) rx, ry := k.getPoolBalances(ctx, pool, pair) ps := k.GetPoolCoinSupply(ctx, pool) ammPool := pool.AMMPool(rx.Amount, ry.Amount, ps) if ammPool.IsDepleted() { - return types.PoolTokenDeserializerKit{}, sdkerrors.Wrapf(types.ErrDepletedPool, "pool %d is depleted", poolID) + return types.PoolTokenDeserializerKit{}, errorsmod.Wrapf(types.ErrDepletedPool, "pool %d is depleted", poolID) } deserializerKit := types.PoolTokenDeserializerKit{ @@ -171,7 +172,7 @@ func (k Keeper) GetFarmingRewardsData(ctx sdk.Context, appID uint64, coinsToDist pool := deserializerKit.Pool if pool.Disabled { - return nil, sdkerrors.Wrap(types.ErrDisabledPool, fmt.Sprintf("pool is disabled : %d", pool.Id)) + return nil, errorsmod.Wrap(types.ErrDisabledPool, fmt.Sprintf("pool is disabled : %d", pool.Id)) } asset, err := k.GetAssetWhoseOraclePriceExists(ctx, pair.QuoteCoinDenom, pair.BaseCoinDenom) @@ -306,19 +307,19 @@ func (k Keeper) ValidateMsgFarm(ctx sdk.Context, msg *types.MsgFarm) (sdk.AccAdd _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return nil, sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return nil, errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } pool, found := k.GetPool(ctx, msg.AppId, msg.PoolId) if !found { - return nil, sdkerrors.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", msg.PoolId) + return nil, errorsmod.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", msg.PoolId) } if msg.FarmingPoolCoin.Denom != pool.PoolCoinDenom { - return nil, sdkerrors.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found %s", pool.PoolCoinDenom, msg.FarmingPoolCoin.Denom) + return nil, errorsmod.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found %s", pool.PoolCoinDenom, msg.FarmingPoolCoin.Denom) } if !msg.FarmingPoolCoin.Amount.IsPositive() { - return nil, sdkerrors.Wrapf(types.ErrorNotPositiveAmont, "pool coin amount should be positive") + return nil, errorsmod.Wrapf(types.ErrorNotPositiveAmont, "pool coin amount should be positive") } return farmer, nil } @@ -373,19 +374,19 @@ func (k Keeper) ValidateMsgUnfarm(ctx sdk.Context, msg *types.MsgUnfarm) (sdk.Ac _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return nil, sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return nil, errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } pool, found := k.GetPool(ctx, msg.AppId, msg.PoolId) if !found { - return nil, sdkerrors.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", msg.PoolId) + return nil, errorsmod.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", msg.PoolId) } if msg.UnfarmingPoolCoin.Denom != pool.PoolCoinDenom { - return nil, sdkerrors.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found %s", pool.PoolCoinDenom, msg.UnfarmingPoolCoin.Denom) + return nil, errorsmod.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found %s", pool.PoolCoinDenom, msg.UnfarmingPoolCoin.Denom) } if !msg.UnfarmingPoolCoin.Amount.IsPositive() { - return nil, sdkerrors.Wrapf(types.ErrorNotPositiveAmont, "pool coin amount should be positive") + return nil, errorsmod.Wrapf(types.ErrorNotPositiveAmont, "pool coin amount should be positive") } return farmer, nil } @@ -400,7 +401,7 @@ func (k Keeper) Unfarm(ctx sdk.Context, msg *types.MsgUnfarm) error { queuedFarmer, qfound := k.GetQueuedFarmer(ctx, msg.AppId, msg.PoolId, farmer) if !afound && !qfound { - return sdkerrors.Wrapf(types.ErrorFarmerNotFound, "no active farm found for given pool id %d", msg.PoolId) + return errorsmod.Wrapf(types.ErrorFarmerNotFound, "no active farm found for given pool id %d", msg.PoolId) } farmedCoinAmount := sdkmath.NewInt(0) @@ -416,7 +417,7 @@ func (k Keeper) Unfarm(ctx sdk.Context, msg *types.MsgUnfarm) error { } if farmedCoinAmount.LT(msg.UnfarmingPoolCoin.Amount) { - return sdkerrors.Wrapf(types.ErrInvalidUnfarmAmount, "farmed pool coin amount %d%s smaller than requested unfarming pool coin amount %d%s", farmedCoinAmount.Int64(), msg.UnfarmingPoolCoin.Denom, msg.UnfarmingPoolCoin.Amount.Int64(), msg.UnfarmingPoolCoin.Denom) + return errorsmod.Wrapf(types.ErrInvalidUnfarmAmount, "farmed pool coin amount %d%s smaller than requested unfarming pool coin amount %d%s", farmedCoinAmount.Int64(), msg.UnfarmingPoolCoin.Denom, msg.UnfarmingPoolCoin.Amount.Int64(), msg.UnfarmingPoolCoin.Denom) } unFarmingCoin := msg.UnfarmingPoolCoin diff --git a/x/liquidity/keeper/rewards_test.go b/x/liquidity/keeper/rewards_test.go index 85752b79d..edc09f851 100644 --- a/x/liquidity/keeper/rewards_test.go +++ b/x/liquidity/keeper/rewards_test.go @@ -3,6 +3,8 @@ package keeper_test import ( "time" + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity/types" @@ -31,21 +33,21 @@ func (s *KeeperTestSuite) TestFarm() { // app1 deposit s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) // app2 deposit s.Deposit(appID2, pool2.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1,10000000000pool2-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1,10000000000pool2-1").Equal(s.getBalances(liquidityProvider1))) liquidityProvider2 := s.addr(2) // app1 deposit s.Deposit(appID1, pool.Id, liquidityProvider2, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider2))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider2))) // app2 deposit s.Deposit(appID2, pool2.Id, liquidityProvider2, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1,9999999999pool2-1").IsEqual(s.getBalances(liquidityProvider2))) + s.Require().True(utils.ParseCoins("9999999999pool1-1,9999999999pool2-1").Equal(s.getBalances(liquidityProvider2))) currentTime := s.ctx.BlockTime() s.ctx = s.ctx.WithBlockTime(currentTime) @@ -60,25 +62,25 @@ func (s *KeeperTestSuite) TestFarm() { { Name: "error app id invalid", Msg: *types.NewMsgFarm(69, pool.Id, liquidityProvider1, utils.ParseCoin("699000000pool1-1")), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), AvailableBalance: utils.ParseCoins("10000000000pool1-1,10000000000pool2-1"), }, { Name: "error pool id invalid", Msg: *types.NewMsgFarm(appID1, 69, liquidityProvider1, utils.ParseCoin("699000000pool1-1")), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", 69), AvailableBalance: utils.ParseCoins("10000000000pool1-1,10000000000pool2-1"), }, { Name: "error pool denom invalid", Msg: *types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("699000000pool1-2")), - ExpErr: sdkerrors.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found pool1-2", pool.PoolCoinDenom), + ExpErr: errorsmod.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found pool1-2", pool.PoolCoinDenom), AvailableBalance: utils.ParseCoins("10000000000pool1-1,10000000000pool2-1"), }, { Name: "error insufficient pool denoms", Msg: *types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("100000000000pool1-1")), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance 10000000000pool1-1 is smaller than 100000000000pool1-1"), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance 10000000000pool1-1 is smaller than 100000000000pool1-1"), AvailableBalance: utils.ParseCoins("10000000000pool1-1,10000000000pool2-1"), }, { @@ -130,7 +132,7 @@ func (s *KeeperTestSuite) TestFarm() { s.Require().False(found) } else { s.Require().NoError(err) - s.Require().True(tc.AvailableBalance.IsEqual(s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Farmer)))) + s.Require().True(tc.AvailableBalance.Equal(s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Farmer)))) queuedFarmer, found := s.keeper.GetQueuedFarmer(s.ctx, tc.Msg.AppId, tc.Msg.PoolId, tc.Msg.GetFarmer()) s.Require().True(found) @@ -155,8 +157,8 @@ func (s *KeeperTestSuite) TestFarm() { s.Require().Len(queuedFarmers[1].QueudCoins, 0) s.Require().Len(activeFarmers, 2) - s.Require().True(activeFarmers[0].FarmedPoolCoin.IsEqual(utils.ParseCoin("5275000000pool1-1"))) - s.Require().True(activeFarmers[1].FarmedPoolCoin.IsEqual(utils.ParseCoin("6934000000pool1-1"))) + s.Require().True(activeFarmers[0].FarmedPoolCoin.Equal(utils.ParseCoin("5275000000pool1-1"))) + s.Require().True(activeFarmers[1].FarmedPoolCoin.Equal(utils.ParseCoin("6934000000pool1-1"))) _, found := s.keeper.GetActiveFarmer(s.ctx, appID1, pool.Id, creator) s.Require().False(found) @@ -168,8 +170,8 @@ func (s *KeeperTestSuite) TestFarm() { s.Require().Len(queuedFarmers[1].QueudCoins, 0) s.Require().Len(activeFarmers, 2) - s.Require().True(activeFarmers[0].FarmedPoolCoin.IsEqual(utils.ParseCoin("123000000pool2-1"))) - s.Require().True(activeFarmers[1].FarmedPoolCoin.IsEqual(utils.ParseCoin("546000000pool2-1"))) + s.Require().True(activeFarmers[0].FarmedPoolCoin.Equal(utils.ParseCoin("123000000pool2-1"))) + s.Require().True(activeFarmers[1].FarmedPoolCoin.Equal(utils.ParseCoin("546000000pool2-1"))) _, found = s.keeper.GetActiveFarmer(s.ctx, appID2, pool2.Id, creator) s.Require().False(found) @@ -192,7 +194,7 @@ func (s *KeeperTestSuite) TestUnfarm() { liquidityProvider1 := s.addr(1) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) currentTime := s.ctx.BlockTime() s.ctx = s.ctx.WithBlockTime(currentTime) @@ -213,31 +215,31 @@ func (s *KeeperTestSuite) TestUnfarm() { { Name: "error app id invalid", Msg: *types.NewMsgUnfarm(69, pool.Id, liquidityProvider1, utils.ParseCoin("699000000pool1-1")), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), AvailableBalance: sdk.Coins{}, }, { Name: "error pool id invalid", Msg: *types.NewMsgUnfarm(appID1, 69, liquidityProvider1, utils.ParseCoin("699000000pool1-1")), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidPoolID, "no pool exists with id : %d", 69), AvailableBalance: sdk.Coins{}, }, { Name: "error pool denom invalid", Msg: *types.NewMsgUnfarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("699000000pool1-2")), - ExpErr: sdkerrors.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found pool1-2", pool.PoolCoinDenom), + ExpErr: errorsmod.Wrapf(types.ErrWrongPoolCoinDenom, "expected pool coin denom %s, found pool1-2", pool.PoolCoinDenom), AvailableBalance: sdk.Coins{}, }, { Name: "error farm not found", Msg: *types.NewMsgUnfarm(appID1, pool2.Id, liquidityProvider1, utils.ParseCoin("699000000pool1-2")), - ExpErr: sdkerrors.Wrapf(types.ErrorFarmerNotFound, "no active farm found for given pool id %d", pool2.Id), + ExpErr: errorsmod.Wrapf(types.ErrorFarmerNotFound, "no active farm found for given pool id %d", pool2.Id), AvailableBalance: sdk.Coins{}, }, { Name: "error insufficient farmed amounts", Msg: *types.NewMsgUnfarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("100000000000pool1-1")), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidUnfarmAmount, "farmed pool coin amount 10000000000pool1-1 smaller than requested unfarming pool coin amount 100000000000pool1-1"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidUnfarmAmount, "farmed pool coin amount 10000000000pool1-1 smaller than requested unfarming pool coin amount 100000000000pool1-1"), AvailableBalance: sdk.Coins{}, }, { @@ -262,7 +264,7 @@ func (s *KeeperTestSuite) TestUnfarm() { s.Require().EqualError(err, tc.ExpErr.Error()) } else { s.Require().NoError(err) - s.Require().True(tc.AvailableBalance.IsEqual(s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Farmer)))) + s.Require().True(tc.AvailableBalance.Equal(s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.Farmer)))) } }) } @@ -287,11 +289,11 @@ func (s *KeeperTestSuite) TestUnfarmTwo() { s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) s.Deposit(appID1, pool.Id, liquidityProvider2, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider2))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider2))) // farm 1, queue size 1 // SortedByTimeFarmQueue -> [10000000pool1-1] @@ -335,7 +337,7 @@ func (s *KeeperTestSuite) TestUnfarmTwo() { msgUnlock := types.NewMsgUnfarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("160000000pool1-1")) err = s.keeper.Unfarm(s.ctx, msgUnlock) s.Require().Error(err) - s.Require().EqualError(err, sdkerrors.Wrapf(types.ErrInvalidUnfarmAmount, "farmed pool coin amount 150000000pool1-1 smaller than requested unfarming pool coin amount 160000000pool1-1").Error()) + s.Require().EqualError(err, errorsmod.Wrapf(types.ErrInvalidUnfarmAmount, "farmed pool coin amount 150000000pool1-1 smaller than requested unfarming pool coin amount 160000000pool1-1").Error()) // unfarming small portions, below unlock removes token from most recently added queue // unlock is done from a single latest object in a queue since this object itself can satisfy the unlock requirement, @@ -404,7 +406,7 @@ func (s *KeeperTestSuite) TestUnfarmTwo() { msgUnlock = types.NewMsgUnfarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("11000000pool1-1")) err = s.keeper.Unfarm(s.ctx, msgUnlock) s.Require().Error(err) - s.Require().EqualError(err, sdkerrors.Wrapf(types.ErrInvalidUnfarmAmount, "farmed pool coin amount 10000000pool1-1 smaller than requested unfarming pool coin amount 11000000pool1-1").Error()) + s.Require().EqualError(err, errorsmod.Wrapf(types.ErrInvalidUnfarmAmount, "farmed pool coin amount 10000000pool1-1 smaller than requested unfarming pool coin amount 11000000pool1-1").Error()) s.ctx = s.ctx.WithBlockTime(s.ctx.BlockTime().Add(time.Hour * 1)) // SortedByTimeFarmQueue -> [69000000pool1-1, 10000000pool1-1] @@ -456,7 +458,7 @@ func (s *KeeperTestSuite) TestUnfarmTwo() { s.Require().Len(qfs[0].QueudCoins, 0) s.Require().Len(afs, 0) - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) s.ctx = s.ctx.WithBlockTime(currentTime) // SortedByTimeFarmQueue -> [11000000pool1-1] @@ -610,8 +612,8 @@ func (s *KeeperTestSuite) TestUnfarmTwo() { // s.Require().Equal(utils.ParseCoin("0pool1-1").Denom, afs[1].FarmedPoolCoin.Denom) // s.Require().Equal(utils.ParseCoin("0pool1-1").Amount, afs[1].FarmedPoolCoin.Amount) - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider2))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider2))) } // liquidity provided in incrementel order @@ -632,7 +634,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataLinearLPs() { liquidityProvider1 := s.addr(1) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("10000000000pool1-1")) err := s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -640,7 +642,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataLinearLPs() { liquidityProvider2 := s.addr(2) s.Deposit(appID1, pool.Id, liquidityProvider2, "2000000000uasset1,2000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("19999999999pool1-1").IsEqual(s.getBalances(liquidityProvider2))) + s.Require().True(utils.ParseCoins("19999999999pool1-1").Equal(s.getBalances(liquidityProvider2))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider2, utils.ParseCoin("19999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -648,7 +650,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataLinearLPs() { liquidityProvider3 := s.addr(3) s.Deposit(appID1, pool.Id, liquidityProvider3, "3000000000uasset1,3000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("29999999999pool1-1").IsEqual(s.getBalances(liquidityProvider3))) + s.Require().True(utils.ParseCoins("29999999999pool1-1").Equal(s.getBalances(liquidityProvider3))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider3, utils.ParseCoin("29999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -656,7 +658,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataLinearLPs() { liquidityProvider4 := s.addr(4) s.Deposit(appID1, pool.Id, liquidityProvider4, "4000000000uasset1,4000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("39999999999pool1-1").IsEqual(s.getBalances(liquidityProvider4))) + s.Require().True(utils.ParseCoins("39999999999pool1-1").Equal(s.getBalances(liquidityProvider4))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider4, utils.ParseCoin("39999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -737,7 +739,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataEqualLPs() { liquidityProvider1 := s.addr(1) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("10000000000pool1-1")) err := s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -745,7 +747,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataEqualLPs() { liquidityProvider2 := s.addr(2) s.Deposit(appID1, pool.Id, liquidityProvider2, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider2))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider2))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider2, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -753,7 +755,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataEqualLPs() { liquidityProvider3 := s.addr(3) s.Deposit(appID1, pool.Id, liquidityProvider3, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider3))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider3))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider3, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -761,7 +763,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataEqualLPs() { liquidityProvider4 := s.addr(4) s.Deposit(appID1, pool.Id, liquidityProvider4, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider4))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider4))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider4, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -892,7 +894,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataEqualLPsWChildPool() { liquidityProvider1 := s.addr(1) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("10000000000pool1-1")) err := s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -903,7 +905,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataEqualLPsWChildPool() { s.nextBlock() s.Deposit(appID1, pool2.Id, liquidityProvider2, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1,10000000000pool1-2").IsEqual(s.getBalances(liquidityProvider2))) + s.Require().True(utils.ParseCoins("9999999999pool1-1,10000000000pool1-2").Equal(s.getBalances(liquidityProvider2))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider2, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -915,7 +917,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataEqualLPsWChildPool() { liquidityProvider3 := s.addr(3) s.Deposit(appID1, pool.Id, liquidityProvider3, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider3))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider3))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider3, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -926,7 +928,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataEqualLPsWChildPool() { s.nextBlock() s.Deposit(appID1, pool2.Id, liquidityProvider4, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1,9999999999pool1-2").IsEqual(s.getBalances(liquidityProvider4))) + s.Require().True(utils.ParseCoins("9999999999pool1-1,9999999999pool1-2").Equal(s.getBalances(liquidityProvider4))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider4, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -1039,7 +1041,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataErrorHandellings() { liquidityProvider1 := s.addr(1) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("10000000000pool1-1")) err := s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -1054,14 +1056,14 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataErrorHandellings() { rewardDistrData, err := s.keeper.GetFarmingRewardsData(s.ctx, appID1, sdk.NewCoin("ucmdx", newInt(10000000000)), liquidityGauge) s.Require().Error(err) - s.Require().EqualError(err, sdkerrors.Wrapf(types.ErrDepletedPool, "pool 1 is depleted").Error()) + s.Require().EqualError(err, errorsmod.Wrapf(types.ErrDepletedPool, "pool 1 is depleted").Error()) s.Require().IsType([]rewardtypes.RewardDistributionDataCollector{}, rewardDistrData) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() rewardDistrData, err = s.keeper.GetFarmingRewardsData(s.ctx, appID1, sdk.NewCoin("ucmdx", newInt(10000000000)), liquidityGauge) s.Require().Error(err) - s.Require().EqualError(err, sdkerrors.Wrapf(types.ErrDisabledPool, "pool 1 is disabled").Error()) + s.Require().EqualError(err, errorsmod.Wrapf(types.ErrDisabledPool, "pool 1 is disabled").Error()) s.Require().IsType([]rewardtypes.RewardDistributionDataCollector{}, rewardDistrData) } @@ -1083,7 +1085,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataZeroLPs() { liquidityProvider1 := s.addr(1) s.Deposit(appID1, pool.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) msg := types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("10000000000pool1-1")) err := s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -1091,7 +1093,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataZeroLPs() { liquidityProvider2 := s.addr(2) s.Deposit(appID1, pool.Id, liquidityProvider2, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider2))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider2))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider2, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -1099,7 +1101,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataZeroLPs() { liquidityProvider3 := s.addr(3) s.Deposit(appID1, pool.Id, liquidityProvider3, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider3))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider3))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider3, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -1107,7 +1109,7 @@ func (s *KeeperTestSuite) TestGetFarmingRewardsDataZeroLPs() { liquidityProvider4 := s.addr(4) s.Deposit(appID1, pool.Id, liquidityProvider4, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("9999999999pool1-1").IsEqual(s.getBalances(liquidityProvider4))) + s.Require().True(utils.ParseCoins("9999999999pool1-1").Equal(s.getBalances(liquidityProvider4))) msg = types.NewMsgFarm(appID1, pool.Id, liquidityProvider4, utils.ParseCoin("9999999999pool1-1")) err = s.keeper.Farm(s.ctx, msg) s.Require().NoError(err) @@ -1189,19 +1191,19 @@ func (s *KeeperTestSuite) TestGetAmountFarmedForAssetID() { s.Deposit(appID1, pool1.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset2") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1").Equal(s.getBalances(liquidityProvider1))) s.Deposit(appID1, pool2.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset3") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1,10000000000pool1-2").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1,10000000000pool1-2").Equal(s.getBalances(liquidityProvider1))) s.Deposit(appID1, pool3.Id, liquidityProvider1, "1000000000uasset2,1000000000uasset3") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1,10000000000pool1-2,10000000000pool1-3").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1,10000000000pool1-2,10000000000pool1-3").Equal(s.getBalances(liquidityProvider1))) s.Deposit(appID1, pool4.Id, liquidityProvider1, "1000000000uasset1,1000000000uasset4") s.nextBlock() - s.Require().True(utils.ParseCoins("10000000000pool1-1,10000000000pool1-2,10000000000pool1-3,10000000000pool1-4").IsEqual(s.getBalances(liquidityProvider1))) + s.Require().True(utils.ParseCoins("10000000000pool1-1,10000000000pool1-2,10000000000pool1-3,10000000000pool1-4").Equal(s.getBalances(liquidityProvider1))) currentTime := s.ctx.BlockTime() s.ctx = s.ctx.WithBlockTime(currentTime) diff --git a/x/liquidity/keeper/store.go b/x/liquidity/keeper/store.go index bff881a8f..5afed602e 100644 --- a/x/liquidity/keeper/store.go +++ b/x/liquidity/keeper/store.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" gogotypes "github.com/cosmos/gogoproto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -77,8 +78,8 @@ func (k Keeper) SetPairLookupIndex(ctx sdk.Context, appID uint64, denomA string, // Stops iteration when callback returns true. func (k Keeper) IterateAllPairs(ctx sdk.Context, appID uint64, cb func(pair types.Pair) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllPairsKey(appID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllPairsKey(appID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -176,8 +177,8 @@ func (k Keeper) SetPoolsByPairIndex(ctx sdk.Context, pool types.Pool) { // Stops iteration when callback returns true. func (k Keeper) IterateAllPools(ctx sdk.Context, appID uint64, cb func(pool types.Pool) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllPoolsKey(appID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllPoolsKey(appID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -200,8 +201,8 @@ func (k Keeper) IterateAllPools(ctx sdk.Context, appID uint64, cb func(pool type // Stops iteration when callback returns true. func (k Keeper) IteratePoolsByPair(ctx sdk.Context, appID, pairID uint64, cb func(pool types.Pool) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetPoolsByPairIndexKeyPrefix(appID, pairID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetPoolsByPairIndexKeyPrefix(appID, pairID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -267,8 +268,8 @@ func (k Keeper) SetDepositRequestIndex(ctx sdk.Context, req types.DepositRequest // and call cb for each request. func (k Keeper) IterateAllDepositRequests(ctx sdk.Context, appID uint64, cb func(req types.DepositRequest) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllDepositRequestKey(appID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllDepositRequestKey(appID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -297,8 +298,8 @@ func (k Keeper) IterateDepositRequestsByDepositor( cb func(req types.DepositRequest) (stop bool, err error), ) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetDepositRequestIndexKeyPrefix(appID, depositor)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetDepositRequestIndexKeyPrefix(appID, depositor)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -376,8 +377,8 @@ func (k Keeper) SetWithdrawRequestIndex(ctx sdk.Context, req types.WithdrawReque // and call cb for each request. func (k Keeper) IterateAllWithdrawRequests(ctx sdk.Context, appID uint64, cb func(req types.WithdrawRequest) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllWithdrawRequestKey(appID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllWithdrawRequestKey(appID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -406,8 +407,8 @@ func (k Keeper) IterateWithdrawRequestsByWithdrawer( cb func(req types.WithdrawRequest) (stop bool, err error), ) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetWithdrawRequestIndexKeyPrefix(appID, withdrawer)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetWithdrawRequestIndexKeyPrefix(appID, withdrawer)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -485,8 +486,8 @@ func (k Keeper) SetOrderIndex(ctx sdk.Context, appID uint64, order types.Order) // cb for each order. func (k Keeper) IterateAllOrders(ctx sdk.Context, appID uint64, cb func(order types.Order) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllOrdersKey(appID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllOrdersKey(appID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -509,8 +510,8 @@ func (k Keeper) IterateAllOrders(ctx sdk.Context, appID uint64, cb func(order ty // and call cb for each order. func (k Keeper) IterateOrdersByPair(ctx sdk.Context, appID, pairID uint64, cb func(order types.Order) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetOrdersByPairKeyPrefix(appID, pairID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetOrdersByPairKeyPrefix(appID, pairID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -539,8 +540,8 @@ func (k Keeper) IterateOrdersByOrderer( cb func(order types.Order) (stop bool, err error), ) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetOrderIndexKeyPrefix(appID, orderer)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetOrderIndexKeyPrefix(appID, orderer)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -622,8 +623,8 @@ func (k Keeper) SetMMOrderIndex(ctx sdk.Context, appID uint64, index types.MMOrd // in the store and call cb for each order. func (k Keeper) IterateAllMMOrderIndexes(ctx sdk.Context, appID uint64, cb func(index types.MMOrderIndex) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllMMOrderIndexKey(appID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllMMOrderIndexKey(appID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -704,8 +705,8 @@ func (k Keeper) GetActiveFarmer(ctx sdk.Context, appID, poolID uint64, farmer sd // Stops iteration when callback returns true. func (k Keeper) IterateAllActiveFarmers(ctx sdk.Context, appID, poolID uint64, cb func(activeFarmer types.ActiveFarmer) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllActiveFarmersKey(appID, poolID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllActiveFarmersKey(appID, poolID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -756,8 +757,8 @@ func (k Keeper) GetQueuedFarmer(ctx sdk.Context, appID, poolID uint64, farmer sd // Stops iteration when callback returns true. func (k Keeper) IterateAllQueuedFarmers(ctx sdk.Context, appID, poolID uint64, cb func(queuedFarmer types.QueuedFarmer) (stop bool, err error)) error { store := ctx.KVStore(k.storeKey) - iter := sdk.KVStorePrefixIterator(store, types.GetAllQueuedFarmersKey(appID, poolID)) - defer func(iter sdk.Iterator) { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllQueuedFarmersKey(appID, poolID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/liquidity/keeper/swap.go b/x/liquidity/keeper/swap.go index 7bd5313f4..47cfee62c 100644 --- a/x/liquidity/keeper/swap.go +++ b/x/liquidity/keeper/swap.go @@ -6,6 +6,8 @@ import ( "strings" "time" + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -28,29 +30,29 @@ func (k Keeper) ValidateMsgLimitOrder(ctx sdk.Context, msg *types.MsgLimitOrder) _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, - sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrap(err, "params retreval failed") + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrap(err, "params retreval failed") } spendable := k.bankKeeper.SpendableCoins(ctx, msg.GetOrderer()) if spendableAmt := spendable.AmountOf(msg.OfferCoin.Denom); spendableAmt.LT(msg.OfferCoin.Amount) { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf( + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf( sdkerrors.ErrInsufficientFunds, "%s is smaller than %s", sdk.NewCoin(msg.OfferCoin.Denom, spendableAmt), msg.OfferCoin) } if msg.OrderLifespan > params.MaxOrderLifespan { return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, - sdkerrors.Wrapf(types.ErrTooLongOrderLifespan, "%s is longer than %s", msg.OrderLifespan, params.MaxOrderLifespan) + errorsmod.Wrapf(types.ErrTooLongOrderLifespan, "%s is longer than %s", msg.OrderLifespan, params.MaxOrderLifespan) } pair, found := k.GetPair(ctx, msg.AppId, msg.PairId) if !found { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) } var upperPriceLimit, lowerPriceLimit sdkmath.LegacyDec @@ -62,16 +64,16 @@ func (k Keeper) ValidateMsgLimitOrder(ctx sdk.Context, msg *types.MsgLimitOrder) } switch { case msg.Price.GT(upperPriceLimit): - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf(types.ErrPriceOutOfRange, "%s is higher than %s", msg.Price, upperPriceLimit) + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf(types.ErrPriceOutOfRange, "%s is higher than %s", msg.Price, upperPriceLimit) case msg.Price.LT(lowerPriceLimit): - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf(types.ErrPriceOutOfRange, "%s is lower than %s", msg.Price, lowerPriceLimit) + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf(types.ErrPriceOutOfRange, "%s is lower than %s", msg.Price, lowerPriceLimit) } switch msg.Direction { case types.OrderDirectionBuy: if msg.OfferCoin.Denom != pair.QuoteCoinDenom || msg.DemandCoinDenom != pair.BaseCoinDenom { return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, - sdkerrors.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", + errorsmod.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", msg.DemandCoinDenom, msg.OfferCoin.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom) } price = amm.PriceToDownTick(msg.Price, int(params.TickPrecision)) @@ -80,13 +82,13 @@ func (k Keeper) ValidateMsgLimitOrder(ctx sdk.Context, msg *types.MsgLimitOrder) swapFeeCoin = sdk.NewCoin(msg.OfferCoin.Denom, CalculateSwapFeeAmount(ctx, params, offerCoin.Amount)) if msg.OfferCoin.IsLT(offerCoin.Add(swapFeeCoin)) { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf( + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf( types.ErrInsufficientOfferCoin, "%s is smaller than %s", msg.OfferCoin, offerCoin.Add(swapFeeCoin)) } case types.OrderDirectionSell: if msg.OfferCoin.Denom != pair.BaseCoinDenom || msg.DemandCoinDenom != pair.QuoteCoinDenom { return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, - sdkerrors.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", + errorsmod.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", msg.OfferCoin.Denom, msg.DemandCoinDenom, pair.BaseCoinDenom, pair.QuoteCoinDenom) } price = amm.PriceToUpTick(msg.Price, int(params.TickPrecision)) @@ -95,7 +97,7 @@ func (k Keeper) ValidateMsgLimitOrder(ctx sdk.Context, msg *types.MsgLimitOrder) swapFeeCoin = sdk.NewCoin(msg.OfferCoin.Denom, CalculateSwapFeeAmount(ctx, params, offerCoin.Amount)) if msg.OfferCoin.Amount.LT(swapFeeCoin.Amount.Add(offerCoin.Amount)) { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf( + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf( types.ErrInsufficientOfferCoin, "%s is smaller than %s", msg.OfferCoin, sdk.NewCoin(msg.OfferCoin.Denom, swapFeeCoin.Amount.Add(offerCoin.Amount))) } } @@ -110,7 +112,7 @@ func (k Keeper) ValidateMsgLimitOrder(ctx sdk.Context, msg *types.MsgLimitOrder) func (k Keeper) LimitOrder(ctx sdk.Context, msg *types.MsgLimitOrder) (types.Order, error) { params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return types.Order{}, sdkerrors.Wrap(err, "params retreval failed") + return types.Order{}, errorsmod.Wrap(err, "params retreval failed") } offerCoin, swapFeeCoin, price, err := k.ValidateMsgLimitOrder(ctx, msg) @@ -158,29 +160,29 @@ func (k Keeper) ValidateMsgMarketOrder(ctx sdk.Context, msg *types.MsgMarketOrde _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, - sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrap(err, "params retreval failed") + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrap(err, "params retreval failed") } spendable := k.bankKeeper.SpendableCoins(ctx, msg.GetOrderer()) if spendableAmt := spendable.AmountOf(msg.OfferCoin.Denom); spendableAmt.LT(msg.OfferCoin.Amount) { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf( + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf( sdkerrors.ErrInsufficientFunds, "%s is smaller than %s", sdk.NewCoin(msg.OfferCoin.Denom, spendableAmt), msg.OfferCoin) } if msg.OrderLifespan > params.MaxOrderLifespan { return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, - sdkerrors.Wrapf(types.ErrTooLongOrderLifespan, "%s is longer than %s", msg.OrderLifespan, params.MaxOrderLifespan) + errorsmod.Wrapf(types.ErrTooLongOrderLifespan, "%s is longer than %s", msg.OrderLifespan, params.MaxOrderLifespan) } pair, found := k.GetPair(ctx, msg.AppId, msg.PairId) if !found { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) } if pair.LastPrice == nil { @@ -192,27 +194,27 @@ func (k Keeper) ValidateMsgMarketOrder(ctx sdk.Context, msg *types.MsgMarketOrde case types.OrderDirectionBuy: if msg.OfferCoin.Denom != pair.QuoteCoinDenom || msg.DemandCoinDenom != pair.BaseCoinDenom { return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, - sdkerrors.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", + errorsmod.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", msg.DemandCoinDenom, msg.OfferCoin.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom) } price = amm.PriceToDownTick(lastPrice.Mul(sdkmath.LegacyOneDec().Add(params.MaxPriceLimitRatio)), int(params.TickPrecision)) offerCoin = sdk.NewCoin(msg.OfferCoin.Denom, amm.OfferCoinAmount(amm.Buy, price, msg.Amount)) swapFeeCoin = sdk.NewCoin(msg.OfferCoin.Denom, CalculateSwapFeeAmount(ctx, params, offerCoin.Amount)) if msg.OfferCoin.IsLT(offerCoin.Add(swapFeeCoin)) { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf( + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf( types.ErrInsufficientOfferCoin, "%s is smaller than %s", msg.OfferCoin, offerCoin.Add(swapFeeCoin)) } case types.OrderDirectionSell: if msg.OfferCoin.Denom != pair.BaseCoinDenom || msg.DemandCoinDenom != pair.QuoteCoinDenom { return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, - sdkerrors.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", + errorsmod.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", msg.OfferCoin.Denom, msg.DemandCoinDenom, pair.BaseCoinDenom, pair.QuoteCoinDenom) } price = amm.PriceToUpTick(lastPrice.Mul(sdkmath.LegacyOneDec().Sub(params.MaxPriceLimitRatio)), int(params.TickPrecision)) offerCoin = sdk.NewCoin(msg.OfferCoin.Denom, msg.Amount) swapFeeCoin = sdk.NewCoin(msg.OfferCoin.Denom, CalculateSwapFeeAmount(ctx, params, offerCoin.Amount)) if msg.OfferCoin.Amount.LT(swapFeeCoin.Amount.Add(offerCoin.Amount)) { - return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, sdkerrors.Wrapf( + return sdk.Coin{}, sdk.Coin{}, sdkmath.LegacyDec{}, errorsmod.Wrapf( types.ErrInsufficientOfferCoin, "%s is smaller than %s", msg.OfferCoin, sdk.NewCoin(msg.OfferCoin.Denom, swapFeeCoin.Amount.Add(offerCoin.Amount))) } } @@ -227,7 +229,7 @@ func (k Keeper) ValidateMsgMarketOrder(ctx sdk.Context, msg *types.MsgMarketOrde func (k Keeper) MarketOrder(ctx sdk.Context, msg *types.MsgMarketOrder) (types.Order, error) { params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return types.Order{}, sdkerrors.Wrap(err, "params retreval failed") + return types.Order{}, errorsmod.Wrap(err, "params retreval failed") } offerCoin, swapFeeCoin, price, err := k.ValidateMsgMarketOrder(ctx, msg) @@ -272,36 +274,36 @@ func (k Keeper) MarketOrder(ctx sdk.Context, msg *types.MsgMarketOrder) (types.O func (k Keeper) MMOrder(ctx sdk.Context, msg *types.MsgMMOrder) (orders []types.Order, err error) { _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return nil, sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return nil, errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } params, err := k.GetGenericParams(ctx, msg.AppId) if err != nil { - return nil, sdkerrors.Wrap(err, "params retreval failed") + return nil, errorsmod.Wrap(err, "params retreval failed") } tickPrec := int(params.TickPrecision) if msg.SellAmount.IsPositive() { if !amm.PriceToDownTick(msg.MinSellPrice, tickPrec).Equal(msg.MinSellPrice) { - return nil, sdkerrors.Wrapf(types.ErrPriceNotOnTicks, "min sell price is not on ticks") + return nil, errorsmod.Wrapf(types.ErrPriceNotOnTicks, "min sell price is not on ticks") } if !amm.PriceToDownTick(msg.MaxSellPrice, tickPrec).Equal(msg.MaxSellPrice) { - return nil, sdkerrors.Wrapf(types.ErrPriceNotOnTicks, "max sell price is not on ticks") + return nil, errorsmod.Wrapf(types.ErrPriceNotOnTicks, "max sell price is not on ticks") } } if msg.BuyAmount.IsPositive() { if !amm.PriceToDownTick(msg.MinBuyPrice, tickPrec).Equal(msg.MinBuyPrice) { - return nil, sdkerrors.Wrapf(types.ErrPriceNotOnTicks, "min buy price is not on ticks") + return nil, errorsmod.Wrapf(types.ErrPriceNotOnTicks, "min buy price is not on ticks") } if !amm.PriceToDownTick(msg.MaxBuyPrice, tickPrec).Equal(msg.MaxBuyPrice) { - return nil, sdkerrors.Wrapf(types.ErrPriceNotOnTicks, "max buy price is not on ticks") + return nil, errorsmod.Wrapf(types.ErrPriceNotOnTicks, "max buy price is not on ticks") } } pair, found := k.GetPair(ctx, msg.AppId, msg.PairId) if !found { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) + return nil, errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) } var lowestPrice, highestPrice sdkmath.LegacyDec @@ -314,18 +316,18 @@ func (k Keeper) MMOrder(ctx sdk.Context, msg *types.MsgMMOrder) (orders []types. if msg.SellAmount.IsPositive() { if msg.MinSellPrice.LT(lowestPrice) || msg.MinSellPrice.GT(highestPrice) { - return nil, sdkerrors.Wrapf(types.ErrPriceOutOfRange, "min sell price is out of range [%s, %s]", lowestPrice, highestPrice) + return nil, errorsmod.Wrapf(types.ErrPriceOutOfRange, "min sell price is out of range [%s, %s]", lowestPrice, highestPrice) } if msg.MaxSellPrice.LT(lowestPrice) || msg.MaxSellPrice.GT(highestPrice) { - return nil, sdkerrors.Wrapf(types.ErrPriceOutOfRange, "max sell price is out of range [%s, %s]", lowestPrice, highestPrice) + return nil, errorsmod.Wrapf(types.ErrPriceOutOfRange, "max sell price is out of range [%s, %s]", lowestPrice, highestPrice) } } if msg.BuyAmount.IsPositive() { if msg.MinBuyPrice.LT(lowestPrice) || msg.MinBuyPrice.GT(highestPrice) { - return nil, sdkerrors.Wrapf(types.ErrPriceOutOfRange, "min buy price is out of range [%s, %s]", lowestPrice, highestPrice) + return nil, errorsmod.Wrapf(types.ErrPriceOutOfRange, "min buy price is out of range [%s, %s]", lowestPrice, highestPrice) } if msg.MaxBuyPrice.LT(lowestPrice) || msg.MaxBuyPrice.GT(highestPrice) { - return nil, sdkerrors.Wrapf(types.ErrPriceOutOfRange, "max buy price is out of range [%s, %s]", lowestPrice, highestPrice) + return nil, errorsmod.Wrapf(types.ErrPriceOutOfRange, "max buy price is out of range [%s, %s]", lowestPrice, highestPrice) } } @@ -352,19 +354,19 @@ func (k Keeper) MMOrder(ctx sdk.Context, msg *types.MsgMMOrder) (orders []types. orderer := msg.GetOrderer() spendable := k.bankKeeper.SpendableCoins(ctx, orderer) if spendableAmt := spendable.AmountOf(pair.BaseCoinDenom); spendableAmt.LT(offerBaseCoin.Amount) { - return nil, sdkerrors.Wrapf( + return nil, errorsmod.Wrapf( sdkerrors.ErrInsufficientFunds, "%s is smaller than %s", sdk.NewCoin(pair.BaseCoinDenom, spendableAmt), offerBaseCoin) } if spendableAmt := spendable.AmountOf(pair.QuoteCoinDenom); spendableAmt.LT(offerQuoteCoin.Amount) { - return nil, sdkerrors.Wrapf( + return nil, errorsmod.Wrapf( sdkerrors.ErrInsufficientFunds, "%s is smaller than %s", sdk.NewCoin(pair.QuoteCoinDenom, spendableAmt), offerQuoteCoin) } maxOrderLifespan := params.MaxOrderLifespan if msg.OrderLifespan > maxOrderLifespan { - return nil, sdkerrors.Wrapf( + return nil, errorsmod.Wrapf( types.ErrTooLongOrderLifespan, "%s is longer than %s", msg.OrderLifespan, maxOrderLifespan) } @@ -444,16 +446,16 @@ func (k Keeper) ValidateMsgCancelOrder(ctx sdk.Context, msg *types.MsgCancelOrde _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { return types.Order{}, - sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } order, found = k.GetOrder(ctx, msg.AppId, msg.PairId, msg.OrderId) if !found { return types.Order{}, - sdkerrors.Wrapf(sdkerrors.ErrNotFound, "order %d not found in pair %d", msg.OrderId, msg.PairId) + errorsmod.Wrapf(sdkerrors.ErrNotFound, "order %d not found in pair %d", msg.OrderId, msg.PairId) } if msg.Orderer != order.Orderer { - return types.Order{}, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "mismatching orderer") + return types.Order{}, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "mismatching orderer") } if order.Status == types.OrderStatusCanceled { return types.Order{}, types.ErrAlreadyCanceled @@ -494,7 +496,7 @@ func (k Keeper) CancelOrder(ctx sdk.Context, msg *types.MsgCancelOrder) error { func (k Keeper) ValidateMsgCancelAllOrders(ctx sdk.Context, msg *types.MsgCancelAllOrders) error { _, found := k.assetKeeper.GetApp(ctx, msg.AppId) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", msg.AppId) } return nil } @@ -512,7 +514,7 @@ func (k Keeper) CancelAllOrders(ctx sdk.Context, msg *types.MsgCancelAllOrders) for _, pairID := range msg.PairIds { pair, found := k.GetPair(ctx, msg.AppId, pairID) if !found { // check if the pair exists - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", pairID) + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", pairID) } pairIDSet[pairID] = struct{}{} // add pair id to the set pairIds = append(pairIds, strconv.FormatUint(pairID, 10)) @@ -562,7 +564,7 @@ func (k Keeper) cancelMMOrder(ctx sdk.Context, appID uint64, orderer sdk.AccAddr continue } if order.BatchId == pair.CurrentBatchId { - return nil, sdkerrors.Wrap(types.ErrSameBatch, "couldn't cancel previously placed orders") + return nil, errorsmod.Wrap(types.ErrSameBatch, "couldn't cancel previously placed orders") } if order.Status.CanBeCanceled() { if err := k.FinishOrder(ctx, order, types.OrderStatusCanceled); err != nil { @@ -573,7 +575,7 @@ func (k Keeper) cancelMMOrder(ctx sdk.Context, appID uint64, orderer sdk.AccAddr } k.DeleteMMOrderIndex(ctx, appID, index) } else if !skipIfNotFound { - return nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, "previous market making orders not found") + return nil, errorsmod.Wrap(sdkerrors.ErrNotFound, "previous market making orders not found") } return } @@ -583,7 +585,7 @@ func (k Keeper) cancelMMOrder(ctx sdk.Context, appID uint64, orderer sdk.AccAddr func (k Keeper) CancelMMOrder(ctx sdk.Context, msg *types.MsgCancelMMOrder) (canceledOrderIds []uint64, err error) { pair, found := k.GetPair(ctx, msg.AppId, msg.PairId) if !found { - return nil, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) + return nil, errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", msg.PairId) } canceledOrderIds, err = k.cancelMMOrder(ctx, msg.AppId, msg.GetOrderer(), pair, false) @@ -606,7 +608,7 @@ func (k Keeper) CancelMMOrder(ctx sdk.Context, msg *types.MsgCancelMMOrder) (can func (k Keeper) ExecuteMatching(ctx sdk.Context, pair types.Pair) error { params, err := k.GetGenericParams(ctx, pair.AppId) if err != nil { - return sdkerrors.Wrap(err, "params retreval failed") + return errorsmod.Wrap(err, "params retreval failed") } ob := amm.NewOrderBook() @@ -706,7 +708,7 @@ func (k Keeper) Match(ctx sdk.Context, params types.GenericParams, ob *amm.Order func (k Keeper) ApplyMatchResult(ctx sdk.Context, pair types.Pair, orders []amm.Order, quoteCoinDiff sdkmath.Int) error { params, err := k.GetGenericParams(ctx, pair.AppId) if err != nil { - return sdkerrors.Wrap(err, "params retreval failed") + return errorsmod.Wrap(err, "params retreval failed") } bulkOp := types.NewBulkSendCoinsOperation() for _, order := range orders { // TODO: need optimization to filter matched orders only @@ -832,7 +834,7 @@ func (k Keeper) FinishOrder(ctx sdk.Context, order types.Order, status types.Ord params, err := k.GetGenericParams(ctx, order.AppId) if err != nil { - return sdkerrors.Wrap(err, "params retreval failed") + return errorsmod.Wrap(err, "params retreval failed") } pair, _ := k.GetPair(ctx, order.AppId, order.PairId) diff --git a/x/liquidity/keeper/swap_test.go b/x/liquidity/keeper/swap_test.go index 8d08fe5a5..0e90776c1 100644 --- a/x/liquidity/keeper/swap_test.go +++ b/x/liquidity/keeper/swap_test.go @@ -4,6 +4,8 @@ import ( "math/rand" "time" + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity" @@ -49,7 +51,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), "params retreval failed"), + ExpErr: errorsmod.Wrap(errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), "params retreval failed"), ExpResp: &types.Order{}, }, { @@ -66,7 +68,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Hour*48, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrTooLongOrderLifespan, "%s is longer than %s", time.Hour*48, params.MaxOrderLifespan), + ExpErr: errorsmod.Wrapf(types.ErrTooLongOrderLifespan, "%s is longer than %s", time.Hour*48, params.MaxOrderLifespan), ExpResp: &types.Order{}, }, { @@ -83,7 +85,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", 69), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", 69), ExpResp: &types.Order{}, }, { @@ -100,7 +102,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrPriceOutOfRange, "%s is higher than %s", amm.HighestTick(int(params.TickPrecision+1)), amm.HighestTick(int(params.TickPrecision))), + ExpErr: errorsmod.Wrapf(types.ErrPriceOutOfRange, "%s is higher than %s", amm.HighestTick(int(params.TickPrecision+1)), amm.HighestTick(int(params.TickPrecision))), ExpResp: &types.Order{}, }, { @@ -117,7 +119,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrPriceOutOfRange, "%s is lower than %s", amm.LowestTick(int(params.TickPrecision-1)), amm.LowestTick(int(params.TickPrecision))), + ExpErr: errorsmod.Wrapf(types.ErrPriceOutOfRange, "%s is lower than %s", amm.LowestTick(int(params.TickPrecision-1)), amm.LowestTick(int(params.TickPrecision))), ExpResp: &types.Order{}, }, { @@ -134,7 +136,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", asset2.Denom, asset1.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom), + ExpErr: errorsmod.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", asset2.Denom, asset1.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom), ExpResp: &types.Order{}, }, { @@ -151,7 +153,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", asset2.Denom, asset1.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom), + ExpErr: errorsmod.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", asset2.Denom, asset1.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom), ExpResp: &types.Order{}, }, { @@ -168,7 +170,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrInsufficientOfferCoin, "10000000uasset2 is smaller than 10030000uasset2"), + ExpErr: errorsmod.Wrapf(types.ErrInsufficientOfferCoin, "10000000uasset2 is smaller than 10030000uasset2"), ExpResp: &types.Order{}, }, { @@ -185,7 +187,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrInsufficientOfferCoin, "10000000uasset1 is smaller than 10030000uasset1"), + ExpErr: errorsmod.Wrapf(types.ErrInsufficientOfferCoin, "10000000uasset1 is smaller than 10030000uasset1"), ExpResp: &types.Order{}, }, { @@ -236,7 +238,7 @@ func (s *KeeperTestSuite) TestLimitOrder() { time.Second*10, ), FundRequired: false, - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "0uasset2 is smaller than 1003000uasset2"), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "0uasset2 is smaller than 1003000uasset2"), ExpResp: &types.Order{}, }, { @@ -669,7 +671,7 @@ func (s *KeeperTestSuite) TestLimitOrderWithPoolSwap() { s.Require().False(found) availableBalance := s.getBalances(tc.Msg.GetOrderer()) - s.Require().True(tc.ExpBalanceAfterExpire.IsEqual(availableBalance)) + s.Require().True(tc.ExpBalanceAfterExpire.Equal(availableBalance)) // reset to default time s.ctx = s.ctx.WithBlockTime(currentTime) @@ -902,15 +904,15 @@ func (s *KeeperTestSuite) TestLimitOrderWithoutPool() { s.Require().False(found) buyerAvailableBalance := s.getBalances(tc.BuyMsg.GetOrderer()) - s.Require().True(tc.BuyerExpBalance.IsEqual(buyerAvailableBalance)) + s.Require().True(tc.BuyerExpBalance.Equal(buyerAvailableBalance)) selllerAvailableBalance := s.getBalances(tc.SellMsg.GetOrderer()) - s.Require().True(tc.SellerExpBalance.IsEqual(selllerAvailableBalance)) + s.Require().True(tc.SellerExpBalance.Equal(selllerAvailableBalance)) // verify swapfee coolection accumulatedSwapFee = accumulatedSwapFee.Add(tc.CollectedSwapFee...) availableSwapFees := s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(accumulatedSwapFee.IsEqual(availableSwapFees)) + s.Require().True(accumulatedSwapFee.Equal(availableSwapFees)) // transfer all funds from testing account to dummy account // for reusing the accounts, leads to easy account balance calculation @@ -1118,7 +1120,7 @@ func (s *KeeperTestSuite) TestMarketOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), "params retreval failed"), + ExpErr: errorsmod.Wrap(errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), "params retreval failed"), ExpResp: &types.Order{}, }, { @@ -1134,7 +1136,7 @@ func (s *KeeperTestSuite) TestMarketOrder() { time.Hour*48, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrTooLongOrderLifespan, "%s is longer than %s", time.Hour*48, params.MaxOrderLifespan), + ExpErr: errorsmod.Wrapf(types.ErrTooLongOrderLifespan, "%s is longer than %s", time.Hour*48, params.MaxOrderLifespan), ExpResp: &types.Order{}, }, { @@ -1150,7 +1152,7 @@ func (s *KeeperTestSuite) TestMarketOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", 69), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrNotFound, "pair %d not found", 69), ExpResp: &types.Order{}, }, { @@ -1182,7 +1184,7 @@ func (s *KeeperTestSuite) TestMarketOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", asset2.Denom, asset1.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom), + ExpErr: errorsmod.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", asset2.Denom, asset1.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom), ExpResp: &types.Order{}, }, { @@ -1198,7 +1200,7 @@ func (s *KeeperTestSuite) TestMarketOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", asset2.Denom, asset1.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom), + ExpErr: errorsmod.Wrapf(types.ErrWrongPair, "denom pair (%s, %s) != (%s, %s)", asset2.Denom, asset1.Denom, pair.BaseCoinDenom, pair.QuoteCoinDenom), ExpResp: &types.Order{}, }, { @@ -1214,7 +1216,7 @@ func (s *KeeperTestSuite) TestMarketOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrInsufficientOfferCoin, "10000000uasset2 is smaller than 11033000uasset2"), + ExpErr: errorsmod.Wrapf(types.ErrInsufficientOfferCoin, "10000000uasset2 is smaller than 11033000uasset2"), ExpResp: &types.Order{}, }, { @@ -1230,7 +1232,7 @@ func (s *KeeperTestSuite) TestMarketOrder() { time.Second*10, ), FundRequired: true, - ExpErr: sdkerrors.Wrapf(types.ErrInsufficientOfferCoin, "10000000uasset1 is smaller than 10030000uasset1"), + ExpErr: errorsmod.Wrapf(types.ErrInsufficientOfferCoin, "10000000uasset1 is smaller than 10030000uasset1"), ExpResp: &types.Order{}, }, { @@ -1278,7 +1280,7 @@ func (s *KeeperTestSuite) TestMarketOrder() { time.Second*10, ), FundRequired: false, - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "0uasset2 is smaller than 1103300uasset2"), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, "0uasset2 is smaller than 1103300uasset2"), ExpResp: &types.Order{}, }, { @@ -1407,7 +1409,7 @@ func (s *KeeperTestSuite) TestMarketOrderTwo() { // Check the result. s.Require().True(utils.ParseCoin("10000uasset1").IsEqual(s.getBalance(s.addr(3), "uasset1"))) - s.Require().True(utils.ParseCoins("10832uasset2").IsEqual(s.getBalances(s.addr(4)))) + s.Require().True(utils.ParseCoins("10832uasset2").Equal(s.getBalances(s.addr(4)))) } func (s *KeeperTestSuite) TestMarketOrderRefund() { @@ -1504,7 +1506,7 @@ func (s *KeeperTestSuite) TestSingleOrderNoMatch() { order, _ = k.GetOrder(ctx, appID1, order.PairId, order.Id) s.Require().Equal(types.OrderStatusExpired, order.Status) - s.Require().True(utils.ParseCoins("1003000denom2").IsEqual(s.getBalances(s.addr(1)))) + s.Require().True(utils.ParseCoins("1003000denom2").Equal(s.getBalances(s.addr(1)))) } func (s *KeeperTestSuite) TestTwoOrderExactMatch() { @@ -1526,8 +1528,8 @@ func (s *KeeperTestSuite) TestTwoOrderExactMatch() { req2, _ = k.GetOrder(ctx, appID1, req2.PairId, req2.Id) s.Require().Equal(types.OrderStatusCompleted, req2.Status) - s.Require().True(utils.ParseCoins("10000denom1").IsEqual(s.getBalances(s.addr(1)))) - s.Require().True(utils.ParseCoins("10000denom2").IsEqual(s.getBalances(s.addr(2)))) + s.Require().True(utils.ParseCoins("10000denom1").Equal(s.getBalances(s.addr(1)))) + s.Require().True(utils.ParseCoins("10000denom2").Equal(s.getBalances(s.addr(2)))) pair, _ = k.GetPair(ctx, appID1, pair.Id) s.Require().NotNil(pair.LastPrice) @@ -1701,17 +1703,17 @@ func (s *KeeperTestSuite) TestCancelOrder() { { Name: "error app id invalid", Msg: *types.NewMsgCancelOrder(69, creator, pair.Id, order.Id), - ExpErr: sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", 69), }, { Name: "error order id invalid", Msg: *types.NewMsgCancelOrder(appID1, creator, pair.Id, 69), - ExpErr: sdkerrors.Wrapf(sdkerrors.ErrNotFound, "order %d not found in pair %d", 69, pair.Id), + ExpErr: errorsmod.Wrapf(sdkerrors.ErrNotFound, "order %d not found in pair %d", 69, pair.Id), }, { Name: "error invalid orderer", Msg: *types.NewMsgCancelOrder(appID1, dummy, pair.Id, order.Id), - ExpErr: sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "mismatching orderer"), + ExpErr: errorsmod.Wrap(sdkerrors.ErrUnauthorized, "mismatching orderer"), }, { Name: "error order already cancelled", @@ -1747,7 +1749,7 @@ func (s *KeeperTestSuite) TestCancelOrder() { s.Require().True(found) s.Require().Equal(types.OrderStatusCanceled, order.Status) - s.Require().True(utils.ParseCoins("1003000denom1").IsEqual(s.getBalances(tc.Msg.GetOrderer()))) + s.Require().True(utils.ParseCoins("1003000denom1").Equal(s.getBalances(tc.Msg.GetOrderer()))) s.nextBlock() _, found = s.keeper.GetOrder(s.ctx, tc.Msg.AppId, tc.Msg.PairId, tc.Msg.OrderId) @@ -1785,7 +1787,7 @@ func (s *KeeperTestSuite) TestCancelOrderTwo() { s.Require().Equal(types.OrderStatusCanceled, order.Status) // Coins are refunded - s.Require().True(utils.ParseCoins("10030denom2").IsEqual(s.getBalances(s.addr(1)))) + s.Require().True(utils.ParseCoins("10030denom2").Equal(s.getBalances(s.addr(1)))) s.nextBlock() @@ -1823,7 +1825,7 @@ func (s *KeeperTestSuite) TestCancelAllOrders() { // already canceled. s.LimitOrder(appID1, s.addr(3), pair.Id, types.OrderDirectionSell, utils.ParseDec("1.0"), sdkmath.NewInt(10000), 0) s.nextBlock() - s.Require().True(utils.ParseCoins("10030denom2").IsEqual(s.getBalances(s.addr(1)))) + s.Require().True(utils.ParseCoins("10030denom2").Equal(s.getBalances(s.addr(1)))) pair2 := s.CreateNewLiquidityPair(appID1, s.addr(0), asset2.Denom, asset3.Denom) s.LimitOrder(appID1, s.addr(2), pair.Id, types.OrderDirectionBuy, utils.ParseDec("1.0"), sdkmath.NewInt(10000), time.Hour) @@ -1835,7 +1837,7 @@ func (s *KeeperTestSuite) TestCancelAllOrders() { // CancelAllOrders can cancel orders in specific pairs. s.keeper.CancelAllOrders(s.ctx, msg) // Coins from first two orders are refunded, but not from the last order. - s.Require().True(utils.ParseCoins("10030denom2,10030denom1").IsEqual(s.getBalances(s.addr(2)))) + s.Require().True(utils.ParseCoins("10030denom2,10030denom1").Equal(s.getBalances(s.addr(2)))) } func (s *KeeperTestSuite) TestSwapFeeCollectionWithoutPool() { @@ -1862,7 +1864,7 @@ func (s *KeeperTestSuite) TestSwapFeeCollectionWithoutPool() { s.Require().False(found) collectedSwapFee := s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(utils.ParseCoins("156000denom2,156000denom1").IsEqual(collectedSwapFee)) + s.Require().True(utils.ParseCoins("156000denom2,156000denom1").Equal(collectedSwapFee)) } func (s *KeeperTestSuite) TestSwapFeeCollectionWithPool() { @@ -1901,7 +1903,7 @@ func (s *KeeperTestSuite) TestSwapFeeCollectionWithPool() { s.Require().False(found) collectedSwapFee := s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(utils.ParseCoins("6000denom2,6000denom1").IsEqual(collectedSwapFee)) + s.Require().True(utils.ParseCoins("6000denom2,6000denom1").Equal(collectedSwapFee)) } func (s *KeeperTestSuite) TestSwapFeeCollectionMarketOrder() { @@ -1927,16 +1929,16 @@ func (s *KeeperTestSuite) TestSwapFeeCollectionMarketOrder() { s.nextBlock() _, found = s.keeper.GetOrder(s.ctx, appID1, pair.Id, sellMarketOrder.Id) s.Require().False(found) - s.Require().True(utils.ParseCoins("99902053denom2").IsEqual(s.getBalances(trader1))) + s.Require().True(utils.ParseCoins("99902053denom2").Equal(s.getBalances(trader1))) buyMarketOrder := s.MarketOrder(appID1, trader2, pair.Id, types.OrderDirectionBuy, newInt(100000000), time.Second*10) s.nextBlock() _, found = s.keeper.GetOrder(s.ctx, appID1, pair.Id, buyMarketOrder.Id) s.Require().False(found) - s.Require().True(utils.ParseCoins("100000000denom1,9908395denom2").IsEqual(s.getBalances(trader2))) + s.Require().True(utils.ParseCoins("100000000denom1,9908395denom2").Equal(s.getBalances(trader2))) accumulatedSwapFee := s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(utils.ParseCoins("300000denom1,302707denom2").IsEqual(accumulatedSwapFee)) + s.Require().True(utils.ParseCoins("300000denom1,302707denom2").Equal(accumulatedSwapFee)) s.nextBlock() } @@ -1970,12 +1972,12 @@ func (s *KeeperTestSuite) TestAccumulatedSwapFeeConversion() { // execute orders and try to convert, conversion will not take since there are no pool s.nextBlock() accumulatedSwapFee := s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(utils.ParseCoins("936000ucmdx,936000uharbor").IsEqual(accumulatedSwapFee)) + s.Require().True(utils.ParseCoins("936000ucmdx,936000uharbor").Equal(accumulatedSwapFee)) // try to convert again, conversion will not take place since there are no pool s.nextBlock() accumulatedSwapFee = s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(utils.ParseCoins("936000ucmdx,936000uharbor").IsEqual(accumulatedSwapFee)) + s.Require().True(utils.ParseCoins("936000ucmdx,936000uharbor").Equal(accumulatedSwapFee)) // now create pool, so that token conversion can go through this _ = s.CreateNewLiquidityPool(appID1, pair.Id, creator, "1000000000000ucmdx,1000000000000uharbor") @@ -1987,23 +1989,23 @@ func (s *KeeperTestSuite) TestAccumulatedSwapFeeConversion() { s.nextBlock() accumulatedSwapFee = s.getBalances(pair.GetSwapFeeCollectorAddress()) // here order is placed for swap, hence harbor tokens are reduced and this will get executed in next block - s.Require().True(utils.ParseCoins("936000ucmdx,5643uharbor").IsEqual(accumulatedSwapFee)) + s.Require().True(utils.ParseCoins("936000ucmdx,5643uharbor").Equal(accumulatedSwapFee)) // now execute the order placed in above block, swap order for 9 uharbor placed again in next block s.nextBlock() accumulatedSwapFee = s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(utils.ParseCoins("1779250ucmdx,556uharbor").IsEqual(accumulatedSwapFee)) + s.Require().True(utils.ParseCoins("1779250ucmdx,556uharbor").Equal(accumulatedSwapFee)) // now execute the order placed in above block, this block will execute the order for 9 harbor placed above s.nextBlock() accumulatedSwapFee = s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(utils.ParseCoins("1862727ucmdx,54uharbor").IsEqual(accumulatedSwapFee)) + s.Require().True(utils.ParseCoins("1862727ucmdx,54uharbor").Equal(accumulatedSwapFee)) // now execute the order placed in above block, here 1uharbor is refunded back since it is very small amount for swap order. // here all harbor tokens are converted into cmdx, since cmdx is the default distribution token for rewards s.nextBlock() accumulatedSwapFee = s.getBalances(pair.GetSwapFeeCollectorAddress()) - s.Require().True(utils.ParseCoins("1870997ucmdx,5uharbor").IsEqual(accumulatedSwapFee)) + s.Require().True(utils.ParseCoins("1870997ucmdx,5uharbor").Equal(accumulatedSwapFee)) } func (s *KeeperTestSuite) TestConvertAccumulatedSwapFeesWithSwapDistrToken_1() { @@ -2473,6 +2475,6 @@ func (s *KeeperTestSuite) TestSwap_edgecase4() { s.LimitOrder(appID1, addr2, pair.Id, types.OrderDirectionSell, utils.ParseDec("1.05"), sdkmath.NewInt(50_000000), 0) s.LimitOrder(appID1, addr2, pair.Id, types.OrderDirectionBuy, utils.ParseDec("0.97"), sdkmath.NewInt(100_000000), 0) s.nextBlock() - s.Require().True(utils.ParseCoins("50150000denom1,97291000denom2").IsEqual(s.getBalances(addr2))) + s.Require().True(utils.ParseCoins("50150000denom1,97291000denom2").Equal(s.getBalances(addr2))) } diff --git a/x/liquidity/legacy/v2/store.go b/x/liquidity/legacy/v2/store.go index c853a284b..1c73d1bf7 100644 --- a/x/liquidity/legacy/v2/store.go +++ b/x/liquidity/legacy/v2/store.go @@ -1,16 +1,16 @@ package v2 import ( + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" expected "github.com/comdex-official/comdex/x/liquidity/expected" v1liquidity "github.com/comdex-official/comdex/x/liquidity/legacy/v1" "github.com/comdex-official/comdex/x/liquidity/types" ) -func MigrateGenericParams(appID uint64, store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateGenericParams(appID uint64, store storetypes.KVStore, cdc codec.BinaryCodec) error { var oldGenericLiquidityParams v1liquidity.GenericParams if err := cdc.Unmarshal(store.Get(types.GetGenericParamsKey(appID)), &oldGenericLiquidityParams); err != nil { return err @@ -46,9 +46,9 @@ func MigrateGenericParams(appID uint64, store sdk.KVStore, cdc codec.BinaryCodec return nil } -func MigratePools(appID uint64, store sdk.KVStore, cdc codec.BinaryCodec) error { - iter := sdk.KVStorePrefixIterator(store, types.GetAllPoolsKey(appID)) - defer func(iter sdk.Iterator) { +func MigratePools(appID uint64, store storetypes.KVStore, cdc codec.BinaryCodec) error { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllPoolsKey(appID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -82,9 +82,9 @@ func MigratePools(appID uint64, store sdk.KVStore, cdc codec.BinaryCodec) error return nil } -func MigrateOrders(appID uint64, store sdk.KVStore, cdc codec.BinaryCodec) error { - iter := sdk.KVStorePrefixIterator(store, types.GetAllOrdersKey(appID)) - defer func(iter sdk.Iterator) { +func MigrateOrders(appID uint64, store storetypes.KVStore, cdc codec.BinaryCodec) error { + iter := storetypes.KVStorePrefixIterator(store, types.GetAllOrdersKey(appID)) + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/liquidity/legacy/v2/store_test.go b/x/liquidity/legacy/v2/store_test.go index 795306016..1b4e6153e 100644 --- a/x/liquidity/legacy/v2/store_test.go +++ b/x/liquidity/legacy/v2/store_test.go @@ -22,7 +22,7 @@ package v2_test // err := app.AssetKeeper.AddAppRecords(ctx, assettypes.AppData{ // Name: strings.ToLower(appName), // ShortName: strings.ToLower(appName), -// MinGovDeposit: sdk.NewInt(0), +// MinGovDeposit: sdkmath.NewInt(0), // GovTimeInSeconds: 0, // GenesisToken: []assettypes.MintGenesisToken{}, // }) diff --git a/x/liquidity/module.go b/x/liquidity/module.go index b2114d3f5..a66fa500e 100644 --- a/x/liquidity/module.go +++ b/x/liquidity/module.go @@ -140,6 +140,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -160,13 +166,13 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context) { BeginBlocker(ctx, am.keeper, am.assetKeeper) } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context) []abci.ValidatorUpdate { EndBlocker(ctx, am.keeper, am.assetKeeper) return []abci.ValidatorUpdate{} } diff --git a/x/liquidity/module_test.go b/x/liquidity/module_test.go index a35ee2a48..ccbbe99eb 100644 --- a/x/liquidity/module_test.go +++ b/x/liquidity/module_test.go @@ -5,7 +5,8 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + sdkmath "cosmossdk.io/math" + "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" @@ -36,7 +37,7 @@ func TestModuleTestSuite(t *testing.T) { func (suite *ModuleTestSuite) SetupTest() { app := chain.Setup(suite.T(), false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false) suite.app = app suite.ctx = ctx @@ -72,7 +73,7 @@ func (s *ModuleTestSuite) CreateNewApp(appName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: appName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -97,7 +98,7 @@ func (s *ModuleTestSuite) CreateNewAsset(name, denom string, price uint64) asset err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, }) @@ -184,8 +185,8 @@ func (s *ModuleTestSuite) LimitOrder( orderer sdk.AccAddress, pairId uint64, dir types.OrderDirection, - price sdk.Dec, - amt sdk.Int, + price sdkmath.LegacyDec, + amt sdkmath.Int, orderLifespan time.Duration, ) types.Order { s.T().Helper() @@ -207,7 +208,7 @@ func (s *ModuleTestSuite) LimitOrder( params, err := s.keeper.GetGenericParams(s.ctx, appID) s.Require().NoError(err) - offerCoin = offerCoin.Add(sdk.NewCoin(offerCoin.Denom, sdk.NewDec(offerCoin.Amount.Int64()).Mul(params.SwapFeeRate).RoundInt())) + offerCoin = offerCoin.Add(sdk.NewCoin(offerCoin.Denom, sdkmath.LegacyNewDec(offerCoin.Amount.Int64()).Mul(params.SwapFeeRate).RoundInt())) s.fundAddr(orderer, sdk.NewCoins(offerCoin)) msg := types.NewMsgLimitOrder( @@ -224,7 +225,7 @@ func (s *ModuleTestSuite) MarketOrder( orderer sdk.AccAddress, pairId uint64, dir types.OrderDirection, - amt sdk.Int, + amt sdkmath.Int, orderLifespan time.Duration, ) types.Order { s.T().Helper() @@ -238,7 +239,7 @@ func (s *ModuleTestSuite) MarketOrder( var demandCoinDenom string switch dir { case types.OrderDirectionBuy: - maxPrice := lastPrice.Mul(sdk.OneDec().Add(params.MaxPriceLimitRatio)) + maxPrice := lastPrice.Mul(sdkmath.LegacyOneDec().Add(params.MaxPriceLimitRatio)) offerCoin = sdk.NewCoin(pair.QuoteCoinDenom, amm.OfferCoinAmount(amm.Buy, maxPrice, amt)) demandCoinDenom = pair.BaseCoinDenom case types.OrderDirectionSell: @@ -246,7 +247,7 @@ func (s *ModuleTestSuite) MarketOrder( demandCoinDenom = pair.QuoteCoinDenom } - offerCoin = offerCoin.Add(sdk.NewCoin(offerCoin.Denom, sdk.NewDec(offerCoin.Amount.Int64()).Mul(params.SwapFeeRate).RoundInt())) + offerCoin = offerCoin.Add(sdk.NewCoin(offerCoin.Denom, sdkmath.LegacyNewDec(offerCoin.Amount.Int64()).Mul(params.SwapFeeRate).RoundInt())) s.fundAddr(orderer, sdk.NewCoins(offerCoin)) msg := types.NewMsgMarketOrder( diff --git a/x/liquidity/types/errors.go b/x/liquidity/types/errors.go index 0bac8511d..933af4190 100644 --- a/x/liquidity/types/errors.go +++ b/x/liquidity/types/errors.go @@ -1,42 +1,42 @@ package types import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // DONTCOVER var ( - ErrInsufficientDepositAmount = sdkerrors.Register(ModuleName, 801, "insufficient deposit amount") - ErrPairAlreadyExists = sdkerrors.Register(ModuleName, 802, "pair already exists") - ErrPoolAlreadyExists = sdkerrors.Register(ModuleName, 803, "pool already exists") - ErrWrongPoolCoinDenom = sdkerrors.Register(ModuleName, 804, "wrong pool coin denom") - ErrInvalidCoinDenom = sdkerrors.Register(ModuleName, 805, "invalid coin denom") - ErrNoLastPrice = sdkerrors.Register(ModuleName, 806, "cannot make a market order to a pair with no last price") - ErrInsufficientOfferCoin = sdkerrors.Register(ModuleName, 807, "insufficient offer coin") - ErrPriceOutOfRange = sdkerrors.Register(ModuleName, 808, "price out of range limit") - ErrTooLongOrderLifespan = sdkerrors.Register(ModuleName, 809, "order lifespan is too long") - ErrDisabledPool = sdkerrors.Register(ModuleName, 810, "disabled pool") - ErrWrongPair = sdkerrors.Register(ModuleName, 811, "wrong denom pair") - ErrSameBatch = sdkerrors.Register(ModuleName, 812, "cannot cancel an order within the same batch") - ErrAlreadyCanceled = sdkerrors.Register(ModuleName, 813, "the order is already canceled") - ErrDuplicatePairID = sdkerrors.Register(ModuleName, 814, "duplicate pair id presents in the pair id list") - ErrTooSmallOrder = sdkerrors.Register(ModuleName, 815, "too small order") - ErrTooLargePool = sdkerrors.Register(ModuleName, 816, "too large pool") - ErrInvalidPoolID = sdkerrors.Register(ModuleName, 817, "invalid pool id") - ErrorFarmerNotFound = sdkerrors.Register(ModuleName, 818, "farmer not found") - ErrInvalidUnfarmAmount = sdkerrors.Register(ModuleName, 819, "invalid unfarm amount") - ErrDepletedPool = sdkerrors.Register(ModuleName, 820, "pool is depleted") - ErrCalculatedPoolAmountIsZero = sdkerrors.Register(ModuleName, 821, "calculated provided pool supply with pool tokens is zero or something went wrong while calculation") - ErrOraclePricesNotFound = sdkerrors.Register(ModuleName, 822, "oracle prices not found") - ErrSupplyValueCalculationInvalid = sdkerrors.Register(ModuleName, 823, "something went wrong while calculation supply values") - ErrInvalidPairID = sdkerrors.Register(ModuleName, 824, "invalid pair id") - ErrAssetNotWhiteListed = sdkerrors.Register(ModuleName, 825, "asset not whitelisted") - ErrInvalidAppID = sdkerrors.Register(ModuleName, 826, "app id invalid") - ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 827, "unknown proposal type") - ErrorEmptyKeyValueForGenericParams = sdkerrors.Register(ModuleName, 828, "keys or values empty for update generic-params") - ErrorLengthMismatch = sdkerrors.Register(ModuleName, 829, "keys and values list length mismatch") - ErrorNotPositiveAmont = sdkerrors.Register(ModuleName, 830, "amount should be positive") - ErrTooManyPools = sdkerrors.Register(ModuleName, 831, "too many pools in the pair") - ErrPriceNotOnTicks = sdkerrors.Register(ModuleName, 832, "price is not on ticks") + ErrInsufficientDepositAmount = errorsmod.Register(ModuleName, 801, "insufficient deposit amount") + ErrPairAlreadyExists = errorsmod.Register(ModuleName, 802, "pair already exists") + ErrPoolAlreadyExists = errorsmod.Register(ModuleName, 803, "pool already exists") + ErrWrongPoolCoinDenom = errorsmod.Register(ModuleName, 804, "wrong pool coin denom") + ErrInvalidCoinDenom = errorsmod.Register(ModuleName, 805, "invalid coin denom") + ErrNoLastPrice = errorsmod.Register(ModuleName, 806, "cannot make a market order to a pair with no last price") + ErrInsufficientOfferCoin = errorsmod.Register(ModuleName, 807, "insufficient offer coin") + ErrPriceOutOfRange = errorsmod.Register(ModuleName, 808, "price out of range limit") + ErrTooLongOrderLifespan = errorsmod.Register(ModuleName, 809, "order lifespan is too long") + ErrDisabledPool = errorsmod.Register(ModuleName, 810, "disabled pool") + ErrWrongPair = errorsmod.Register(ModuleName, 811, "wrong denom pair") + ErrSameBatch = errorsmod.Register(ModuleName, 812, "cannot cancel an order within the same batch") + ErrAlreadyCanceled = errorsmod.Register(ModuleName, 813, "the order is already canceled") + ErrDuplicatePairID = errorsmod.Register(ModuleName, 814, "duplicate pair id presents in the pair id list") + ErrTooSmallOrder = errorsmod.Register(ModuleName, 815, "too small order") + ErrTooLargePool = errorsmod.Register(ModuleName, 816, "too large pool") + ErrInvalidPoolID = errorsmod.Register(ModuleName, 817, "invalid pool id") + ErrorFarmerNotFound = errorsmod.Register(ModuleName, 818, "farmer not found") + ErrInvalidUnfarmAmount = errorsmod.Register(ModuleName, 819, "invalid unfarm amount") + ErrDepletedPool = errorsmod.Register(ModuleName, 820, "pool is depleted") + ErrCalculatedPoolAmountIsZero = errorsmod.Register(ModuleName, 821, "calculated provided pool supply with pool tokens is zero or something went wrong while calculation") + ErrOraclePricesNotFound = errorsmod.Register(ModuleName, 822, "oracle prices not found") + ErrSupplyValueCalculationInvalid = errorsmod.Register(ModuleName, 823, "something went wrong while calculation supply values") + ErrInvalidPairID = errorsmod.Register(ModuleName, 824, "invalid pair id") + ErrAssetNotWhiteListed = errorsmod.Register(ModuleName, 825, "asset not whitelisted") + ErrInvalidAppID = errorsmod.Register(ModuleName, 826, "app id invalid") + ErrorUnknownProposalType = errorsmod.Register(ModuleName, 827, "unknown proposal type") + ErrorEmptyKeyValueForGenericParams = errorsmod.Register(ModuleName, 828, "keys or values empty for update generic-params") + ErrorLengthMismatch = errorsmod.Register(ModuleName, 829, "keys and values list length mismatch") + ErrorNotPositiveAmont = errorsmod.Register(ModuleName, 830, "amount should be positive") + ErrTooManyPools = errorsmod.Register(ModuleName, 831, "too many pools in the pair") + ErrPriceNotOnTicks = errorsmod.Register(ModuleName, 832, "price is not on ticks") ) diff --git a/x/liquidity/types/example_orderbook_test.go b/x/liquidity/types/example_orderbook_test.go index ff9969e1f..e68025747 100644 --- a/x/liquidity/types/example_orderbook_test.go +++ b/x/liquidity/types/example_orderbook_test.go @@ -1,7 +1,7 @@ package types_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity/amm" @@ -10,15 +10,15 @@ import ( func ExampleMakeOrderBookPairResponse() { ob := amm.NewOrderBook( - newOrder(amm.Sell, utils.ParseDec("15.0"), sdk.NewInt(10000)), - newOrder(amm.Sell, utils.ParseDec("13.0"), sdk.NewInt(10000)), - newOrder(amm.Sell, utils.ParseDec("10.01"), sdk.NewInt(10000)), - newOrder(amm.Sell, utils.ParseDec("10.0"), sdk.NewInt(10000)), - newOrder(amm.Buy, utils.ParseDec("10.01"), sdk.NewInt(10000)), - newOrder(amm.Buy, utils.ParseDec("10.0"), sdk.NewInt(10000)), - newOrder(amm.Buy, utils.ParseDec("9.0"), sdk.NewInt(10000)), - newOrder(amm.Buy, utils.ParseDec("3.0"), sdk.NewInt(10000)), - newOrder(amm.Buy, utils.ParseDec("0.1"), sdk.NewInt(10000)), + newOrder(amm.Sell, utils.ParseDec("15.0"), sdkmath.NewInt(10000)), + newOrder(amm.Sell, utils.ParseDec("13.0"), sdkmath.NewInt(10000)), + newOrder(amm.Sell, utils.ParseDec("10.01"), sdkmath.NewInt(10000)), + newOrder(amm.Sell, utils.ParseDec("10.0"), sdkmath.NewInt(10000)), + newOrder(amm.Buy, utils.ParseDec("10.01"), sdkmath.NewInt(10000)), + newOrder(amm.Buy, utils.ParseDec("10.0"), sdkmath.NewInt(10000)), + newOrder(amm.Buy, utils.ParseDec("9.0"), sdkmath.NewInt(10000)), + newOrder(amm.Buy, utils.ParseDec("3.0"), sdkmath.NewInt(10000)), + newOrder(amm.Buy, utils.ParseDec("0.1"), sdkmath.NewInt(10000)), ) ov := ob.MakeView() ov.Match() @@ -47,9 +47,9 @@ func ExampleMakeOrderBookPairResponse() { } func ExampleMakeOrderBookPairResponse_pool() { - pool1 := amm.NewBasicPool(sdk.NewInt(1050_000000), sdk.NewInt(1000_000000), sdk.Int{}) + pool1 := amm.NewBasicPool(sdkmath.NewInt(1050_000000), sdkmath.NewInt(1000_000000), sdkmath.Int{}) pool2, err := amm.CreateRangedPool( - sdk.NewInt(1000_000000), sdk.NewInt(1000_000000), + sdkmath.NewInt(1000_000000), sdkmath.NewInt(1000_000000), utils.ParseDec("0.1"), utils.ParseDec("5.0"), utils.ParseDec("0.95")) if err != nil { panic(err) @@ -100,7 +100,7 @@ func ExampleMakeOrderBookPairResponse_pool() { } func ExampleMakeOrderBookPairResponse_userOrder() { - pool := amm.NewBasicPool(sdk.NewInt(895590740832), sdk.NewInt(675897553075), sdk.Int{}) + pool := amm.NewBasicPool(sdkmath.NewInt(895590740832), sdkmath.NewInt(675897553075), sdkmath.Int{}) lastPrice := utils.ParseDec("1.325") lowestPrice := lastPrice.Mul(utils.ParseDec("0.9")) @@ -108,12 +108,12 @@ func ExampleMakeOrderBookPairResponse_userOrder() { ob := amm.NewOrderBook() ob.AddOrder(amm.PoolOrders(pool, amm.DefaultOrderer, lowestPrice, highestPrice, 4)...) ob.AddOrder( - newOrder(amm.Buy, utils.ParseDec("1.316"), sdk.NewInt(111000000)), - newOrder(amm.Buy, utils.ParseDec("1.32"), sdk.NewInt(111000000)), - newOrder(amm.Buy, utils.ParseDec("1.325"), sdk.NewInt(11000000)), - newOrder(amm.Buy, utils.ParseDec("1.325"), sdk.NewInt(111000000)), - newOrder(amm.Buy, utils.ParseDec("1.325"), sdk.NewInt(20000000)), - newOrder(amm.Buy, utils.ParseDec("1.325"), sdk.NewInt(111000000)), + newOrder(amm.Buy, utils.ParseDec("1.316"), sdkmath.NewInt(111000000)), + newOrder(amm.Buy, utils.ParseDec("1.32"), sdkmath.NewInt(111000000)), + newOrder(amm.Buy, utils.ParseDec("1.325"), sdkmath.NewInt(11000000)), + newOrder(amm.Buy, utils.ParseDec("1.325"), sdkmath.NewInt(111000000)), + newOrder(amm.Buy, utils.ParseDec("1.325"), sdkmath.NewInt(20000000)), + newOrder(amm.Buy, utils.ParseDec("1.325"), sdkmath.NewInt(111000000)), ) ov := ob.MakeView() @@ -159,10 +159,10 @@ func ExampleMakeOrderBookPairResponse_userOrder() { func ExampleMakeOrderBookPairResponse_match() { ob := amm.NewOrderBook( - newOrder(amm.Buy, utils.ParseDec("1.000"), sdk.NewInt(3000)), - newOrder(amm.Buy, utils.ParseDec("0.999"), sdk.NewInt(10000)), - newOrder(amm.Sell, utils.ParseDec("1.001"), sdk.NewInt(10000)), - newOrder(amm.Sell, utils.ParseDec("1.000"), sdk.NewInt(10000)), + newOrder(amm.Buy, utils.ParseDec("1.000"), sdkmath.NewInt(3000)), + newOrder(amm.Buy, utils.ParseDec("0.999"), sdkmath.NewInt(10000)), + newOrder(amm.Sell, utils.ParseDec("1.001"), sdkmath.NewInt(10000)), + newOrder(amm.Sell, utils.ParseDec("1.000"), sdkmath.NewInt(10000)), ) ov := ob.MakeView() @@ -191,10 +191,10 @@ func ExampleMakeOrderBookPairResponse_match() { func ExampleMakeOrderBookPairResponse_zigzag() { ob := amm.NewOrderBook( - newOrder(amm.Sell, utils.ParseDec("1.002"), sdk.NewInt(10000)), - newOrder(amm.Buy, utils.ParseDec("1.001"), sdk.NewInt(5000)), - newOrder(amm.Sell, utils.ParseDec("1.000"), sdk.NewInt(50000)), - newOrder(amm.Buy, utils.ParseDec("0.999"), sdk.NewInt(100000)), + newOrder(amm.Sell, utils.ParseDec("1.002"), sdkmath.NewInt(10000)), + newOrder(amm.Buy, utils.ParseDec("1.001"), sdkmath.NewInt(5000)), + newOrder(amm.Sell, utils.ParseDec("1.000"), sdkmath.NewInt(50000)), + newOrder(amm.Buy, utils.ParseDec("0.999"), sdkmath.NewInt(100000)), ) ov := ob.MakeView() ov.Match() @@ -218,8 +218,8 @@ func ExampleMakeOrderBookPairResponse_zigzag() { } func ExampleMakeOrderBookPairResponse_edgecase1() { - basicPool := amm.NewBasicPool(sdk.NewInt(2603170018), sdk.NewInt(2731547352), sdk.Int{}) - rangedPool := amm.NewRangedPool(sdk.NewInt(9204969), sdk.NewInt(292104465), sdk.Int{}, utils.ParseDec("0.95"), utils.ParseDec("1.05")) + basicPool := amm.NewBasicPool(sdkmath.NewInt(2603170018), sdkmath.NewInt(2731547352), sdkmath.Int{}) + rangedPool := amm.NewRangedPool(sdkmath.NewInt(9204969), sdkmath.NewInt(292104465), sdkmath.Int{}, utils.ParseDec("0.95"), utils.ParseDec("1.05")) lastPrice := utils.ParseDec("0.95299") ob := amm.NewOrderBook() @@ -268,11 +268,11 @@ func ExampleMakeOrderBookPairResponse_edgecase1() { func ExampleMakeOrderBookPairResponse_edgecase2() { ob := amm.NewOrderBook( - newOrder(amm.Buy, utils.ParseDec("1.001"), sdk.NewInt(3000)), - newOrder(amm.Buy, utils.ParseDec("1.000"), sdk.NewInt(10000)), - newOrder(amm.Sell, utils.ParseDec("0.999"), sdk.NewInt(5000)), - newOrder(amm.Sell, utils.ParseDec("0.998"), sdk.NewInt(3000)), - newOrder(amm.Sell, utils.ParseDec("0.997"), sdk.NewInt(2000)), + newOrder(amm.Buy, utils.ParseDec("1.001"), sdkmath.NewInt(3000)), + newOrder(amm.Buy, utils.ParseDec("1.000"), sdkmath.NewInt(10000)), + newOrder(amm.Sell, utils.ParseDec("0.999"), sdkmath.NewInt(5000)), + newOrder(amm.Sell, utils.ParseDec("0.998"), sdkmath.NewInt(3000)), + newOrder(amm.Sell, utils.ParseDec("0.997"), sdkmath.NewInt(2000)), ) ov := ob.MakeView() @@ -295,10 +295,10 @@ func ExampleMakeOrderBookPairResponse_edgecase2() { func ExampleMakeOrderBookPairResponse_edgecase3() { ob := amm.NewOrderBook( - newOrder(amm.Sell, utils.ParseDec("1.001"), sdk.NewInt(2000)), - newOrder(amm.Sell, utils.ParseDec("1.000"), sdk.NewInt(2000)), - newOrder(amm.Buy, utils.ParseDec("1.000"), sdk.NewInt(2000)), - newOrder(amm.Buy, utils.ParseDec("0.999"), sdk.NewInt(2000)), + newOrder(amm.Sell, utils.ParseDec("1.001"), sdkmath.NewInt(2000)), + newOrder(amm.Sell, utils.ParseDec("1.000"), sdkmath.NewInt(2000)), + newOrder(amm.Buy, utils.ParseDec("1.000"), sdkmath.NewInt(2000)), + newOrder(amm.Buy, utils.ParseDec("0.999"), sdkmath.NewInt(2000)), ) ov := ob.MakeView() @@ -325,7 +325,7 @@ func ExampleMakeOrderBookPairResponse_priceUnits1() { lastPrice := utils.ParseDec("0.9995") lowestPrice, highestPrice := types.PriceLimits(lastPrice, utils.ParseDec("0.1"), 4) - pool := amm.NewBasicPool(sdk.NewInt(9995_000000), sdk.NewInt(10000_000000), sdk.Int{}) + pool := amm.NewBasicPool(sdkmath.NewInt(9995_000000), sdkmath.NewInt(10000_000000), sdkmath.Int{}) ob.AddOrder(amm.PoolOrders(pool, amm.DefaultOrderer, lowestPrice, highestPrice, 4)...) ov := ob.MakeView() @@ -432,7 +432,7 @@ func ExampleMakeOrderBookPairResponse_priceUnits2() { lastPrice := utils.ParseDec("0.9999") lowestPrice, highestPrice := types.PriceLimits(lastPrice, utils.ParseDec("0.1"), 4) - pool := amm.NewBasicPool(sdk.NewInt(9999_000000), sdk.NewInt(10000_000000), sdk.Int{}) + pool := amm.NewBasicPool(sdkmath.NewInt(9999_000000), sdkmath.NewInt(10000_000000), sdkmath.Int{}) ob.AddOrder(amm.PoolOrders(pool, amm.DefaultOrderer, lowestPrice, highestPrice, 4)...) ov := ob.MakeView() diff --git a/x/liquidity/types/generic_params.go b/x/liquidity/types/generic_params.go index 1b54896f9..8a2e2f37e 100644 --- a/x/liquidity/types/generic_params.go +++ b/x/liquidity/types/generic_params.go @@ -6,6 +6,9 @@ import ( "strings" "time" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -21,18 +24,18 @@ const ( // Liquidity params default values. var ( - DefaultMinInitialPoolCoinSupply = sdk.NewInt(1_000_000_000_000) + DefaultMinInitialPoolCoinSupply = sdkmath.NewInt(1_000_000_000_000) DefaultPairCreationFee = sdk.NewCoins(sdk.NewInt64Coin(DefaultFeeDenom, 2000_000_000)) DefaultPoolCreationFee = sdk.NewCoins(sdk.NewInt64Coin(DefaultFeeDenom, 2000_000_000)) - DefaultMinInitialDepositAmount = sdk.NewInt(1000000) - DefaultMaxPriceLimitRatio = sdk.NewDecWithPrec(1, 1) // 10% - DefaultSwapFeeRate = sdk.NewDecWithPrec(3, 3) // 0.3% - DefaultWithdrawFeeRate = sdk.ZeroDec() - DefaultDepositExtraGas = sdk.Gas(60000) - DefaultWithdrawExtraGas = sdk.Gas(64000) - DefaultOrderExtraGas = sdk.Gas(37000) + DefaultMinInitialDepositAmount = sdkmath.NewInt(1000000) + DefaultMaxPriceLimitRatio = sdkmath.LegacyNewDecWithPrec(1, 1) // 10% + DefaultSwapFeeRate = sdkmath.LegacyNewDecWithPrec(3, 3) // 0.3% + DefaultWithdrawFeeRate = sdkmath.LegacyZeroDec() + DefaultDepositExtraGas = storetypes.Gas(60000) + DefaultWithdrawExtraGas = storetypes.Gas(64000) + DefaultOrderExtraGas = storetypes.Gas(37000) DefaultSwapFeeDistrDenom = DefaultFeeDenom - DefaultSwapFeeBurnRate = sdk.NewDecWithPrec(0, 0) // 0% + DefaultSwapFeeBurnRate = sdkmath.LegacyNewDecWithPrec(0, 0) // 0% ) var ( @@ -187,9 +190,9 @@ func ParseStringToUint(value string) (interface{}, error) { } func ParseStringToInt(value string) (interface{}, error) { - parsedValue, ok := sdk.NewIntFromString(value) + parsedValue, ok := sdkmath.NewIntFromString(value) if !ok { - return sdk.Int{}, fmt.Errorf("invalid parameter type: %T", value) + return sdkmath.Int{}, fmt.Errorf("invalid parameter type: %T", value) } return parsedValue, nil } @@ -199,7 +202,7 @@ func ParseStringToCoins(value string) (interface{}, error) { } func ParseStringToDec(value string) (interface{}, error) { - return sdk.NewDecFromStr(value) + return sdkmath.LegacyNewDecFromStr(value) } func ParseStringToDuration(value string) (interface{}, error) { @@ -209,7 +212,7 @@ func ParseStringToDuration(value string) (interface{}, error) { func ParseStringToGas(value string) (interface{}, error) { gas, err := ParseStringToUint(value) if err != nil { - return sdk.Gas(0), nil + return storetypes.Gas(0), nil } g, _ := gas.(uint64) return g, nil @@ -277,7 +280,7 @@ func validateDustCollectorAddress(i interface{}) error { } func validateMinInitialPoolCoinSupply(i interface{}) error { - v, ok := i.(sdk.Int) + v, ok := i.(sdkmath.Int) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -320,7 +323,7 @@ func validatePoolCreationFee(i interface{}) error { } func validateMinInitialDepositAmount(i interface{}) error { - v, ok := i.(sdk.Int) + v, ok := i.(sdkmath.Int) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -333,7 +336,7 @@ func validateMinInitialDepositAmount(i interface{}) error { } func validateMaxPriceLimitRatio(i interface{}) error { - v, ok := i.(sdk.Dec) + v, ok := i.(sdkmath.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -359,7 +362,7 @@ func validateMaxOrderLifespan(i interface{}) error { } func validateSwapFeeRate(i interface{}) error { - v, ok := i.(sdk.Dec) + v, ok := i.(sdkmath.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -368,7 +371,7 @@ func validateSwapFeeRate(i interface{}) error { return fmt.Errorf("swap fee rate must not be negative: %s", v) } - if v.GTE(sdk.OneDec()) { + if v.GTE(sdkmath.LegacyOneDec()) { return fmt.Errorf("swap fee rate cannot exceed 1 i.e 100 perc. : %s", v) } @@ -376,7 +379,7 @@ func validateSwapFeeRate(i interface{}) error { } func validateWithdrawFeeRate(i interface{}) error { - v, ok := i.(sdk.Dec) + v, ok := i.(sdkmath.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -384,7 +387,7 @@ func validateWithdrawFeeRate(i interface{}) error { if v.IsNegative() { return fmt.Errorf("withdraw fee rate must not be negative: %s", v) } - if v.GTE(sdk.OneDec()) { + if v.GTE(sdkmath.LegacyOneDec()) { return fmt.Errorf("withdraw fee rate cannot exceed 1 i.e 100 perc. : %s", v) } @@ -392,7 +395,7 @@ func validateWithdrawFeeRate(i interface{}) error { } func validateExtraGas(i interface{}) error { - _, ok := i.(sdk.Gas) + _, ok := i.(storetypes.Gas) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -410,7 +413,7 @@ func validateSwapFeeDistrDenom(i interface{}) error { } func validateSwapFeeBurnRate(i interface{}) error { - v, ok := i.(sdk.Dec) + v, ok := i.(sdkmath.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -419,7 +422,7 @@ func validateSwapFeeBurnRate(i interface{}) error { return fmt.Errorf("swap fee burn rate must not be negative: %s", v) } - if v.GTE(sdk.OneDec()) { + if v.GTE(sdkmath.LegacyOneDec()) { return fmt.Errorf("swap fee burn rate cannot exceed 1 i.e 100 perc. : %s", v) } diff --git a/x/liquidity/types/generic_params_test.go b/x/liquidity/types/generic_params_test.go index a7ab9aa2c..758c3a7ed 100644 --- a/x/liquidity/types/generic_params_test.go +++ b/x/liquidity/types/generic_params_test.go @@ -3,6 +3,7 @@ package types_test import ( "testing" + sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -52,42 +53,42 @@ func TestGenericParamsValidate(t *testing.T) { { "negative MinInitialPoolCoinSupply", func(params *types.GenericParams) { - params.MinInitialPoolCoinSupply = sdk.NewInt(-1) + params.MinInitialPoolCoinSupply = sdkmath.NewInt(-1) }, "min initial pool coin supply must be positive: -1", }, { "zero MinInitialPoolCoinSupply", func(params *types.GenericParams) { - params.MinInitialPoolCoinSupply = sdk.ZeroInt() + params.MinInitialPoolCoinSupply = sdkmath.ZeroInt() }, "min initial pool coin supply must be positive: 0", }, { "invalid PairCreationFee", func(params *types.GenericParams) { - params.PairCreationFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.ZeroInt()}} + params.PairCreationFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdkmath.ZeroInt()}} }, "invalid pair creation fee: coin 0stake amount is not positive", }, { "invalid PoolCreationFee", func(params *types.GenericParams) { - params.PoolCreationFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.ZeroInt()}} + params.PoolCreationFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdkmath.ZeroInt()}} }, "invalid pool creation fee: coin 0stake amount is not positive", }, { "negative MinInitialDepositAmount", func(params *types.GenericParams) { - params.MinInitialDepositAmount = sdk.NewInt(-1) + params.MinInitialDepositAmount = sdkmath.NewInt(-1) }, "minimum initial deposit amount must not be negative: -1", }, { "negative MaxPriceLimitRatio", func(params *types.GenericParams) { - params.MaxPriceLimitRatio = sdk.NewDec(-1) + params.MaxPriceLimitRatio = sdkmath.LegacyNewDec(-1) }, "max price limit ratio must not be negative: -1.000000000000000000", }, @@ -101,42 +102,42 @@ func TestGenericParamsValidate(t *testing.T) { { "negative SwapFeeRate", func(params *types.GenericParams) { - params.SwapFeeRate = sdk.NewDec(-1) + params.SwapFeeRate = sdkmath.LegacyNewDec(-1) }, "swap fee rate must not be negative: -1.000000000000000000", }, { "overflow SwapFeeRate", func(params *types.GenericParams) { - params.SwapFeeRate = sdk.NewDec(2) + params.SwapFeeRate = sdkmath.LegacyNewDec(2) }, "swap fee rate cannot exceed 1 i.e 100 perc. : 2.000000000000000000", }, { "negative WithdrawFeeRate", func(params *types.GenericParams) { - params.WithdrawFeeRate = sdk.NewDec(-1) + params.WithdrawFeeRate = sdkmath.LegacyNewDec(-1) }, "withdraw fee rate must not be negative: -1.000000000000000000", }, { "overflow WithdrawFeeRate", func(params *types.GenericParams) { - params.WithdrawFeeRate = sdk.NewDec(2) + params.WithdrawFeeRate = sdkmath.LegacyNewDec(2) }, "withdraw fee rate cannot exceed 1 i.e 100 perc. : 2.000000000000000000", }, { "negative SwapFeeBurnRate", func(params *types.GenericParams) { - params.SwapFeeBurnRate = sdk.NewDec(-1) + params.SwapFeeBurnRate = sdkmath.LegacyNewDec(-1) }, "swap fee burn rate must not be negative: -1.000000000000000000", }, { "overflow SwapFeeBurnRate", func(params *types.GenericParams) { - params.SwapFeeBurnRate = sdk.NewDec(2) + params.SwapFeeBurnRate = sdkmath.LegacyNewDec(2) }, "swap fee burn rate cannot exceed 1 i.e 100 perc. : 2.000000000000000000", }, diff --git a/x/liquidity/types/msgs.go b/x/liquidity/types/msgs.go index 937a53af8..ff54676d5 100644 --- a/x/liquidity/types/msgs.go +++ b/x/liquidity/types/msgs.go @@ -3,6 +3,10 @@ package types import ( "time" + errorsmod "cosmossdk.io/errors" + + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -67,16 +71,16 @@ func (msg MsgCreatePair) Type() string { return TypeMsgCreatePair } func (msg MsgCreatePair) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address: %v", err) } if err := sdk.ValidateDenom(msg.BaseCoinDenom); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } if err := sdk.ValidateDenom(msg.QuoteCoinDenom); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } if msg.BaseCoinDenom == msg.QuoteCoinDenom { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "cannot use same denom for both base coin and quote coin") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cannot use same denom for both base coin and quote coin") } return nil } @@ -123,20 +127,20 @@ func (msg MsgCreatePool) Type() string { return TypeMsgCreatePool } func (msg MsgCreatePool) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address: %v", err) } if msg.PairId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") } if err := msg.DepositCoins.Validate(); err != nil { return err } if len(msg.DepositCoins) != 2 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "wrong number of deposit coins: %d", len(msg.DepositCoins)) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "wrong number of deposit coins: %d", len(msg.DepositCoins)) } for _, coin := range msg.DepositCoins { if coin.Amount.GT(amm.MaxCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "deposit coin %s is bigger than the max amount %s", coin, amm.MaxCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "deposit coin %s is bigger than the max amount %s", coin, amm.MaxCoinAmount) } } return nil @@ -168,9 +172,9 @@ func NewMsgCreateRangedPool( creator sdk.AccAddress, pairID uint64, depositCoins sdk.Coins, - minPrice sdk.Dec, - maxPrice sdk.Dec, - initialPrice sdk.Dec, + minPrice sdkmath.LegacyDec, + maxPrice sdkmath.LegacyDec, + initialPrice sdkmath.LegacyDec, ) *MsgCreateRangedPool { return &MsgCreateRangedPool{ AppId: appID, @@ -189,24 +193,24 @@ func (msg MsgCreateRangedPool) Type() string { return TypeMsgCreateRangedPool } func (msg MsgCreateRangedPool) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address: %v", err) } if msg.PairId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") } if err := msg.DepositCoins.Validate(); err != nil { return err } if len(msg.DepositCoins) == 0 || len(msg.DepositCoins) > 2 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "wrong number of deposit coins: %d", len(msg.DepositCoins)) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "wrong number of deposit coins: %d", len(msg.DepositCoins)) } for _, coin := range msg.DepositCoins { if coin.Amount.GT(amm.MaxCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "deposit coin %s is bigger than the max amount %s", coin, amm.MaxCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "deposit coin %s is bigger than the max amount %s", coin, amm.MaxCoinAmount) } } if err := amm.ValidateRangedPoolParams(msg.MinPrice, msg.MaxPrice, msg.InitialPrice); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } return nil } @@ -253,16 +257,16 @@ func (msg MsgDeposit) Type() string { return TypeMsgDeposit } func (msg MsgDeposit) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Depositor); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid depositor address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid depositor address: %v", err) } if msg.PoolId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") } if err := msg.DepositCoins.Validate(); err != nil { return err } if len(msg.DepositCoins) == 0 || len(msg.DepositCoins) > 2 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "wrong number of deposit coins: %d", len(msg.DepositCoins)) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "wrong number of deposit coins: %d", len(msg.DepositCoins)) } return nil } @@ -309,16 +313,16 @@ func (msg MsgWithdraw) Type() string { return TypeMsgWithdraw } func (msg MsgWithdraw) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Withdrawer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid withdrawer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid withdrawer address: %v", err) } if msg.PoolId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") } if err := msg.PoolCoin.Validate(); err != nil { return err } if !msg.PoolCoin.IsPositive() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pool coin must be positive") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pool coin must be positive") } return nil } @@ -352,8 +356,8 @@ func NewMsgLimitOrder( dir OrderDirection, offerCoin sdk.Coin, demandCoinDenom string, - price sdk.Dec, - amt sdk.Int, + price sdkmath.LegacyDec, + amt sdkmath.Int, orderLifespan time.Duration, ) *MsgLimitOrder { return &MsgLimitOrder{ @@ -375,34 +379,34 @@ func (msg MsgLimitOrder) Type() string { return TypeMsgLimitOrder } func (msg MsgLimitOrder) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Orderer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) } if msg.PairId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") } if msg.Direction != OrderDirectionBuy && msg.Direction != OrderDirectionSell { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid order direction: %s", msg.Direction) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid order direction: %s", msg.Direction) } if err := sdk.ValidateDenom(msg.DemandCoinDenom); err != nil { - return sdkerrors.Wrap(err, "invalid demand coin denom") + return errorsmod.Wrap(err, "invalid demand coin denom") } if !msg.Price.IsPositive() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "price must be positive") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "price must be positive") } if err := msg.OfferCoin.Validate(); err != nil { - return sdkerrors.Wrap(err, "invalid offer coin") + return errorsmod.Wrap(err, "invalid offer coin") } if msg.OfferCoin.Amount.LT(amm.MinCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "offer coin %s is smaller than the min amount %s", msg.OfferCoin, amm.MinCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "offer coin %s is smaller than the min amount %s", msg.OfferCoin, amm.MinCoinAmount) } if msg.OfferCoin.Amount.GT(amm.MaxCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "offer coin %s is bigger than the max amount %s", msg.OfferCoin, amm.MaxCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "offer coin %s is bigger than the max amount %s", msg.OfferCoin, amm.MaxCoinAmount) } if msg.Amount.LT(amm.MinCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "order amount %s is smaller than the min amount %s", msg.Amount, amm.MinCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "order amount %s is smaller than the min amount %s", msg.Amount, amm.MinCoinAmount) } if msg.Amount.GT(amm.MaxCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "order amount %s is bigger than the max amount %s", msg.Amount, amm.MaxCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "order amount %s is bigger than the max amount %s", msg.Amount, amm.MaxCoinAmount) } var minOfferCoin sdk.Coin switch msg.Direction { @@ -412,13 +416,13 @@ func (msg MsgLimitOrder) ValidateBasic() error { minOfferCoin = sdk.NewCoin(msg.OfferCoin.Denom, msg.Amount) } if msg.OfferCoin.IsLT(minOfferCoin) { - return sdkerrors.Wrapf(ErrInsufficientOfferCoin, "%s is less than %s", msg.OfferCoin, minOfferCoin) + return errorsmod.Wrapf(ErrInsufficientOfferCoin, "%s is less than %s", msg.OfferCoin, minOfferCoin) } if msg.OfferCoin.Denom == msg.DemandCoinDenom { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "offer coin denom and demand coin denom must not be same") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "offer coin denom and demand coin denom must not be same") } if msg.OrderLifespan < 0 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "order lifespan must not be negative: %s", msg.OrderLifespan) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "order lifespan must not be negative: %s", msg.OrderLifespan) } return nil } @@ -452,7 +456,7 @@ func NewMsgMarketOrder( dir OrderDirection, offerCoin sdk.Coin, demandCoinDenom string, - amt sdk.Int, + amt sdkmath.Int, orderLifespan time.Duration, ) *MsgMarketOrder { return &MsgMarketOrder{ @@ -473,37 +477,37 @@ func (msg MsgMarketOrder) Type() string { return TypeMsgMarketOrder } func (msg MsgMarketOrder) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Orderer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) } if msg.PairId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") } if msg.Direction != OrderDirectionBuy && msg.Direction != OrderDirectionSell { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid order direction: %s", msg.Direction) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid order direction: %s", msg.Direction) } if err := sdk.ValidateDenom(msg.DemandCoinDenom); err != nil { - return sdkerrors.Wrap(err, "invalid demand coin denom") + return errorsmod.Wrap(err, "invalid demand coin denom") } if err := msg.OfferCoin.Validate(); err != nil { - return sdkerrors.Wrap(err, "invalid offer coin") + return errorsmod.Wrap(err, "invalid offer coin") } if msg.OfferCoin.Amount.LT(amm.MinCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "offer coin %s is smaller than the min amount %s", msg.OfferCoin, amm.MinCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "offer coin %s is smaller than the min amount %s", msg.OfferCoin, amm.MinCoinAmount) } if msg.OfferCoin.Amount.GT(amm.MaxCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "offer coin %s is bigger than the max amount %s", msg.OfferCoin, amm.MaxCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "offer coin %s is bigger than the max amount %s", msg.OfferCoin, amm.MaxCoinAmount) } if msg.Amount.LT(amm.MinCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "order amount %s is smaller than the min amount %s", msg.Amount, amm.MinCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "order amount %s is smaller than the min amount %s", msg.Amount, amm.MinCoinAmount) } if msg.Amount.GT(amm.MaxCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "order amount %s is bigger than the max amount %s", msg.Amount, amm.MaxCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "order amount %s is bigger than the max amount %s", msg.Amount, amm.MaxCoinAmount) } if msg.OfferCoin.Denom == msg.DemandCoinDenom { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "offer coin denom and demand coin denom must not be same") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "offer coin denom and demand coin denom must not be same") } if msg.OrderLifespan < 0 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "order lifespan must not be negative: %s", msg.OrderLifespan) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "order lifespan must not be negative: %s", msg.OrderLifespan) } return nil } @@ -533,8 +537,8 @@ func NewMsgMMOrder( appID uint64, orderer sdk.AccAddress, pairID uint64, - maxSellPrice, minSellPrice sdk.Dec, sellAmt sdk.Int, - maxBuyPrice, minBuyPrice sdk.Dec, buyAmt sdk.Int, + maxSellPrice, minSellPrice sdkmath.LegacyDec, sellAmt sdkmath.Int, + maxBuyPrice, minBuyPrice sdkmath.LegacyDec, buyAmt sdkmath.Int, orderLifespan time.Duration, ) *MsgMMOrder { return &MsgMMOrder{ @@ -557,44 +561,44 @@ func (msg MsgMMOrder) Type() string { return TypeMsgMMOrder } func (msg MsgMMOrder) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Orderer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) } if msg.PairId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") } if msg.SellAmount.IsZero() && msg.BuyAmount.IsZero() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "sell amount and buy amount must not be zero at the same time") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "sell amount and buy amount must not be zero at the same time") } if !msg.SellAmount.IsZero() { if msg.SellAmount.LT(amm.MinCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "sell amount %s is smaller than the min amount %s", msg.SellAmount, amm.MinCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "sell amount %s is smaller than the min amount %s", msg.SellAmount, amm.MinCoinAmount) } if !msg.MaxSellPrice.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "max sell price must be positive: %s", msg.MaxSellPrice) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "max sell price must be positive: %s", msg.MaxSellPrice) } if !msg.MinSellPrice.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "min sell price must be positive: %s", msg.MinSellPrice) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "min sell price must be positive: %s", msg.MinSellPrice) } if msg.MinSellPrice.GT(msg.MaxSellPrice) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "max sell price must not be lower than min sell price") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "max sell price must not be lower than min sell price") } } if !msg.BuyAmount.IsZero() { if msg.BuyAmount.LT(amm.MinCoinAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "buy amount %s is smaller than the min amount %s", msg.BuyAmount, amm.MinCoinAmount) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "buy amount %s is smaller than the min amount %s", msg.BuyAmount, amm.MinCoinAmount) } if !msg.MinBuyPrice.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "min buy price must be positive: %s", msg.MinBuyPrice) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "min buy price must be positive: %s", msg.MinBuyPrice) } if !msg.MaxBuyPrice.IsPositive() { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "max buy price must be positive: %s", msg.MaxBuyPrice) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "max buy price must be positive: %s", msg.MaxBuyPrice) } if msg.MinBuyPrice.GT(msg.MaxBuyPrice) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "max buy price must not be lower than min buy price") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "max buy price must not be lower than min buy price") } } if msg.OrderLifespan < 0 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "order lifespan must not be negative: %s", msg.OrderLifespan) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "order lifespan must not be negative: %s", msg.OrderLifespan) } return nil } @@ -641,13 +645,13 @@ func (msg MsgCancelOrder) Type() string { return TypeMsgCancelOrder } func (msg MsgCancelOrder) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Orderer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) } if msg.PairId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") } if msg.OrderId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "order id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "order id must not be 0") } return nil } @@ -692,12 +696,12 @@ func (msg MsgCancelAllOrders) Type() string { return TypeMsgCancelAllOrders } func (msg MsgCancelAllOrders) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Orderer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) } pairIDSet := map[uint64]struct{}{} for _, pairID := range msg.PairIds { if pairID == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") } if _, ok := pairIDSet[pairID]; ok { return ErrDuplicatePairID @@ -746,10 +750,10 @@ func (msg MsgCancelMMOrder) Type() string { return TypeMsgCancelMMOrder } func (msg MsgCancelMMOrder) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Orderer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid orderer address: %v", err) } if msg.PairId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pair id must not be 0") } return nil } @@ -796,19 +800,19 @@ func (msg MsgFarm) Type() string { return TypeMsgFarm } func (msg MsgFarm) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Farmer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid withdrawer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid withdrawer address: %v", err) } if msg.PoolId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") } if msg.AppId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "app id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "app id must not be 0") } if err := msg.FarmingPoolCoin.Validate(); err != nil { return err } if !msg.FarmingPoolCoin.IsPositive() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "coin must be positive") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "coin must be positive") } return nil } @@ -855,19 +859,19 @@ func (msg MsgUnfarm) Type() string { return TypeMsgUnfarm } func (msg MsgUnfarm) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Farmer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid withdrawer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid withdrawer address: %v", err) } if msg.PoolId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") } if msg.AppId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "app id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "app id must not be 0") } if err := msg.UnfarmingPoolCoin.Validate(); err != nil { return err } if !msg.UnfarmingPoolCoin.IsPositive() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "coin must be positive") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "coin must be positive") } return nil } @@ -913,16 +917,16 @@ func (msg MsgDepositAndFarm) Type() string { return TypeMsgDeposit } func (msg MsgDepositAndFarm) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Depositor); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid depositor address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid depositor address: %v", err) } if msg.PoolId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") } if err := msg.DepositCoins.Validate(); err != nil { return err } if len(msg.DepositCoins) == 0 || len(msg.DepositCoins) > 2 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "wrong number of deposit coins: %d", len(msg.DepositCoins)) + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "wrong number of deposit coins: %d", len(msg.DepositCoins)) } return nil } @@ -968,19 +972,19 @@ func (msg MsgUnfarmAndWithdraw) Type() string { return TypeMsgUnfarm } func (msg MsgUnfarmAndWithdraw) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Farmer); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid withdrawer address: %v", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid withdrawer address: %v", err) } if msg.PoolId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pool id must not be 0") } if msg.AppId == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "app id must not be 0") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "app id must not be 0") } if err := msg.UnfarmingPoolCoin.Validate(); err != nil { return err } if !msg.UnfarmingPoolCoin.IsPositive() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "coin must be positive") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "coin must be positive") } return nil } diff --git a/x/liquidity/types/msgs_test.go b/x/liquidity/types/msgs_test.go index 6f1c83bc9..d120f76ca 100644 --- a/x/liquidity/types/msgs_test.go +++ b/x/liquidity/types/msgs_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/require" "github.com/cometbft/cometbft/crypto" @@ -308,7 +309,7 @@ func TestMsgLimitOrder(t *testing.T) { func(msg *types.MsgLimitOrder) { msg.OfferCoin = utils.ParseCoin("1000000denom2") msg.Price = utils.ParseDec("10") - msg.Amount = sdk.NewInt(1000000) + msg.Amount = sdkmath.NewInt(1000000) }, "1000000denom2 is less than 10000000denom2: insufficient offer coin", }, @@ -337,14 +338,14 @@ func TestMsgLimitOrder(t *testing.T) { { "zero order amount", func(msg *types.MsgLimitOrder) { - msg.Amount = sdk.ZeroInt() + msg.Amount = sdkmath.ZeroInt() }, "order amount 0 is smaller than the min amount 100: invalid request", }, { "small order amount", func(msg *types.MsgLimitOrder) { - msg.Amount = sdk.NewInt(10) + msg.Amount = sdkmath.NewInt(10) }, "order amount 10 is smaller than the min amount 100: invalid request", }, @@ -359,7 +360,7 @@ func TestMsgLimitOrder(t *testing.T) { t.Run(tc.name, func(t *testing.T) { msg := types.NewMsgLimitOrder( 1, testAddr, 1, types.OrderDirectionBuy, utils.ParseCoin("1000000denom2"), - "denom1", utils.ParseDec("1.0"), sdk.NewInt(1000000), orderLifespan) + "denom1", utils.ParseDec("1.0"), sdkmath.NewInt(1000000), orderLifespan) tc.malleate(msg) require.Equal(t, types.TypeMsgLimitOrder, msg.Type()) require.Equal(t, types.RouterKey, msg.Route()) @@ -441,14 +442,14 @@ func TestMsgMarketOrder(t *testing.T) { { "zero order amount", func(msg *types.MsgMarketOrder) { - msg.Amount = sdk.ZeroInt() + msg.Amount = sdkmath.ZeroInt() }, "order amount 0 is smaller than the min amount 100: invalid request", }, { "small order amount", func(msg *types.MsgMarketOrder) { - msg.Amount = sdk.NewInt(10) + msg.Amount = sdkmath.NewInt(10) }, "order amount 10 is smaller than the min amount 100: invalid request", }, @@ -463,7 +464,7 @@ func TestMsgMarketOrder(t *testing.T) { t.Run(tc.name, func(t *testing.T) { msg := types.NewMsgMarketOrder( 1, testAddr, 1, types.OrderDirectionBuy, utils.ParseCoin("1000000denom1"), - "denom2", sdk.NewInt(1000000), orderLifespan) + "denom2", sdkmath.NewInt(1000000), orderLifespan) tc.malleate(msg) require.Equal(t, types.TypeMsgMarketOrder, msg.Type()) require.Equal(t, types.RouterKey, msg.Route()) diff --git a/x/liquidity/types/order.go b/x/liquidity/types/order.go index 6862c9892..7c91047ae 100644 --- a/x/liquidity/types/order.go +++ b/x/liquidity/types/order.go @@ -3,6 +3,8 @@ package types import ( "fmt" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" utils "github.com/comdex-official/comdex/types" @@ -34,12 +36,12 @@ type UserOrder struct { // NewUserOrder returns a new user order. func NewUserOrder(order Order) *UserOrder { var dir amm.OrderDirection - var amt sdk.Int + var amt sdkmath.Int switch order.Direction { case OrderDirectionBuy: dir = amm.Buy utils.SafeMath(func() { - amt = sdk.MinInt( + amt = sdkmath.MinInt( order.OpenAmount, order.RemainingOfferCoin.Amount.ToLegacyDec().QuoTruncate(order.Price).TruncateInt(), ) @@ -97,8 +99,8 @@ func NewPoolOrder( reserveAddr sdk.AccAddress, dir amm.OrderDirection, - price sdk.Dec, - amt sdk.Int, + price sdkmath.LegacyDec, + amt sdkmath.Int, offerCoinDenom, demandCoinDenom string, ) *PoolOrder { return &PoolOrder{ diff --git a/x/liquidity/types/orderbook.go b/x/liquidity/types/orderbook.go index 0efc8e51f..436e280d5 100644 --- a/x/liquidity/types/orderbook.go +++ b/x/liquidity/types/orderbook.go @@ -1,15 +1,14 @@ package types import ( + sdkmath "cosmossdk.io/math" "fmt" "sort" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/liquidity/amm" ) -func OrderBookBasePrice(ov amm.OrderView, tickPrec int) (sdk.Dec, bool) { +func OrderBookBasePrice(ov amm.OrderView, tickPrec int) (sdkmath.LegacyDec, bool) { highestBuyPrice, foundHighestBuyPrice := ov.HighestBuyPrice() lowestSellPrice, foundLowestSellPrice := ov.LowestSellPrice() @@ -21,7 +20,7 @@ func OrderBookBasePrice(ov amm.OrderView, tickPrec int) (sdk.Dec, bool) { case foundLowestSellPrice: return lowestSellPrice, true default: // not found - return sdk.Dec{}, false + return sdkmath.LegacyDec{}, false } } @@ -31,7 +30,7 @@ type OrderBookConfig struct { MaxNumTicks int } -func MakeOrderBookPairResponse(pairID uint64, ov *amm.OrderBookView, lowestPrice, highestPrice sdk.Dec, tickPrecision int, configs ...OrderBookConfig) OrderBookPairResponse { +func MakeOrderBookPairResponse(pairID uint64, ov *amm.OrderBookView, lowestPrice, highestPrice sdkmath.LegacyDec, tickPrecision int, configs ...OrderBookConfig) OrderBookPairResponse { resp := OrderBookPairResponse{ PairId: pairID, } @@ -50,7 +49,7 @@ func MakeOrderBookPairResponse(pairID uint64, ov *amm.OrderBookView, lowestPrice highestBuyPrice, foundHighestBuyPrice := ov.HighestBuyPrice() lowestSellPrice, foundLowestSellPrice := ov.LowestSellPrice() - var smallestPriceUnit sdk.Dec + var smallestPriceUnit sdkmath.LegacyDec if foundLowestSellPrice { currentPrice := lowestSellPrice for i := 0; i < lowestPriceUnitMaxNumTicks && currentPrice.LTE(highestPrice); { @@ -86,14 +85,14 @@ func MakeOrderBookPairResponse(pairID uint64, ov *amm.OrderBookView, lowestPrice if foundLowestSellPrice { startPrice := FitPriceToTickGap(lowestSellPrice, priceUnit, false) currentPrice := startPrice - accAmt := sdk.ZeroInt() + accAmt := sdkmath.ZeroInt() for j := 0; j < config.MaxNumTicks && currentPrice.LTE(highestPrice); { amt := ov.SellAmountUnder(currentPrice, true).Sub(accAmt) if amt.IsPositive() { ob.Sells = append(ob.Sells, OrderBookTickResponse{ Price: currentPrice, UserOrderAmount: amt, - PoolOrderAmount: sdk.ZeroInt(), + PoolOrderAmount: sdkmath.ZeroInt(), }) accAmt = accAmt.Add(amt) j++ @@ -111,14 +110,14 @@ func MakeOrderBookPairResponse(pairID uint64, ov *amm.OrderBookView, lowestPrice if foundHighestBuyPrice { startPrice := FitPriceToTickGap(highestBuyPrice, priceUnit, true) currentPrice := startPrice - accAmt := sdk.ZeroInt() + accAmt := sdkmath.ZeroInt() for j := 0; j < config.MaxNumTicks && currentPrice.GTE(lowestPrice) && !currentPrice.IsNegative(); { amt := ov.BuyAmountOver(currentPrice, true).Sub(accAmt) if amt.IsPositive() { ob.Buys = append(ob.Buys, OrderBookTickResponse{ Price: currentPrice, UserOrderAmount: amt, - PoolOrderAmount: sdk.ZeroInt(), + PoolOrderAmount: sdkmath.ZeroInt(), }) accAmt = accAmt.Add(amt) j++ @@ -136,7 +135,7 @@ func MakeOrderBookPairResponse(pairID uint64, ov *amm.OrderBookView, lowestPrice } // PrintOrderBookResponse prints out OrderBookResponse in human-readable form. -func PrintOrderBookResponse(ob OrderBookResponse, basePrice sdk.Dec) { +func PrintOrderBookResponse(ob OrderBookResponse, basePrice sdkmath.LegacyDec) { fmt.Println("+------------------------------------------------------------------------+") for _, tick := range ob.Sells { fmt.Printf("| %18s | %28s | |\n", tick.UserOrderAmount, tick.Price.String()) @@ -151,10 +150,10 @@ func PrintOrderBookResponse(ob OrderBookResponse, basePrice sdk.Dec) { } // FitPriceToTickGap fits price into given tick gap. -func FitPriceToTickGap(price, gap sdk.Dec, down bool) sdk.Dec { +func FitPriceToTickGap(price, gap sdkmath.LegacyDec, down bool) sdkmath.LegacyDec { b := price.BigInt() b.Quo(b, gap.BigInt()).Mul(b, gap.BigInt()) - tick := sdk.NewDecFromBigIntWithPrec(b, sdk.Precision) + tick := sdkmath.LegacyNewDecFromBigIntWithPrec(b, sdkmath.LegacyPrecision) if !down && !tick.Equal(price) { tick = tick.Add(gap) } diff --git a/x/liquidity/types/orderbook_test.go b/x/liquidity/types/orderbook_test.go index 1b716c4ea..2e31f134c 100644 --- a/x/liquidity/types/orderbook_test.go +++ b/x/liquidity/types/orderbook_test.go @@ -4,19 +4,19 @@ import ( "math/rand" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity/amm" "github.com/comdex-official/comdex/x/liquidity/types" ) -func newOrder(dir amm.OrderDirection, price sdk.Dec, amt sdk.Int) amm.Order { +func newOrder(dir amm.OrderDirection, price sdkmath.LegacyDec, amt sdkmath.Int) amm.Order { return amm.DefaultOrderer.Order(dir, price, amt) } func TestMakeOrderBookResponse(t *testing.T) { - pool := amm.NewBasicPool(sdk.NewInt(1000_000000), sdk.NewInt(1000_000000), sdk.Int{}) + pool := amm.NewBasicPool(sdkmath.NewInt(1000_000000), sdkmath.NewInt(1000_000000), sdkmath.Int{}) lastPrice := utils.ParseDec("1") lowestPrice := lastPrice.Mul(utils.ParseDec("0.9")) highestPrice := lastPrice.Mul(utils.ParseDec("1.1")) @@ -55,15 +55,15 @@ func makeOrderBookPairResponse(numOrders, numPools, numTicks, tickPrec int) type } price := amm.PriceToDownTick( utils.RandomDec(r, utils.ParseDec("0.5"), utils.ParseDec("1.5")), tickPrec) - amt := utils.RandomInt(r, sdk.NewInt(1000), sdk.NewInt(100000)) + amt := utils.RandomInt(r, sdkmath.NewInt(1000), sdkmath.NewInt(100000)) ob.AddOrder(newOrder(dir, price, amt)) } lowestPrice, highestPrice := utils.ParseDec("0.9"), utils.ParseDec("1.1") for i := 0; i < numPools; i++ { - rx := utils.RandomInt(r, sdk.NewInt(10000_000000), sdk.NewInt(11000_000000)) - ry := utils.RandomInt(r, sdk.NewInt(10000_000000), sdk.NewInt(11000_000000)) - pool := amm.NewBasicPool(rx, ry, sdk.Int{}) + rx := utils.RandomInt(r, sdkmath.NewInt(10000_000000), sdkmath.NewInt(11000_000000)) + ry := utils.RandomInt(r, sdkmath.NewInt(10000_000000), sdkmath.NewInt(11000_000000)) + pool := amm.NewBasicPool(rx, ry, sdkmath.Int{}) ob.AddOrder(amm.PoolOrders(pool, amm.DefaultOrderer, lowestPrice, highestPrice, tickPrec)...) } diff --git a/x/liquidity/types/pair_test.go b/x/liquidity/types/pair_test.go index b6a864f80..19829cdcd 100644 --- a/x/liquidity/types/pair_test.go +++ b/x/liquidity/types/pair_test.go @@ -1,9 +1,9 @@ package types_test import ( + sdkmath "cosmossdk.io/math" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "github.com/comdex-official/comdex/x/liquidity/types" @@ -51,7 +51,7 @@ func TestPair_Validate(t *testing.T) { { "", func(pair *types.Pair) { - p := sdk.NewDec(-1) + p := sdkmath.LegacyNewDec(-1) pair.LastPrice = &p }, "last price must be positive: -1.000000000000000000", diff --git a/x/liquidity/types/params.go b/x/liquidity/types/params.go index f7aaa6ee6..18cc1ef43 100644 --- a/x/liquidity/types/params.go +++ b/x/liquidity/types/params.go @@ -3,7 +3,7 @@ package types import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -19,11 +19,11 @@ const ( ) const ( - CreatePoolGas = sdk.Gas(67500) - CancelOrderGas = sdk.Gas(65000) - CancelAllOrdersGas = sdk.Gas(74000) - FarmGas = sdk.Gas(62300) - UnfarmGas = sdk.Gas(69000) + CreatePoolGas = storetypes.Gas(67500) + CancelOrderGas = storetypes.Gas(65000) + CancelAllOrdersGas = storetypes.Gas(74000) + FarmGas = storetypes.Gas(62300) + UnfarmGas = storetypes.Gas(69000) ) // GlobalEscrowAddress is an escrow for deposit/withdraw requests. diff --git a/x/liquidity/types/params.pb.go b/x/liquidity/types/params.pb.go index d8237db64..e16c954b6 100644 --- a/x/liquidity/types/params.pb.go +++ b/x/liquidity/types/params.pb.go @@ -5,6 +5,7 @@ package types import ( cosmossdk_io_math "cosmossdk.io/math" + cosmossdk_io_store "cosmossdk.io/store" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" @@ -81,9 +82,9 @@ type GenericParams struct { MaxOrderLifespan time.Duration `protobuf:"bytes,10,opt,name=max_order_lifespan,json=maxOrderLifespan,proto3,stdduration" json:"max_order_lifespan"` SwapFeeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,11,opt,name=swap_fee_rate,json=swapFeeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"swap_fee_rate"` WithdrawFeeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,12,opt,name=withdraw_fee_rate,json=withdrawFeeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"withdraw_fee_rate"` - DepositExtraGas github_com_cosmos_cosmos_sdk_types.Gas `protobuf:"varint,13,opt,name=deposit_extra_gas,json=depositExtraGas,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Gas" json:"deposit_extra_gas"` - WithdrawExtraGas github_com_cosmos_cosmos_sdk_types.Gas `protobuf:"varint,14,opt,name=withdraw_extra_gas,json=withdrawExtraGas,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Gas" json:"withdraw_extra_gas"` - OrderExtraGas github_com_cosmos_cosmos_sdk_types.Gas `protobuf:"varint,15,opt,name=order_extra_gas,json=orderExtraGas,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Gas" json:"order_extra_gas"` + DepositExtraGas cosmossdk_io_store.Gas `protobuf:"varint,13,opt,name=deposit_extra_gas,json=depositExtraGas,proto3,customtype=cosmossdk.io/store.Gas" json:"deposit_extra_gas"` + WithdrawExtraGas cosmossdk_io_store.Gas `protobuf:"varint,14,opt,name=withdraw_extra_gas,json=withdrawExtraGas,proto3,customtype=cosmossdk.io/store.Gas" json:"withdraw_extra_gas"` + OrderExtraGas cosmossdk_io_store.Gas `protobuf:"varint,15,opt,name=order_extra_gas,json=orderExtraGas,proto3,customtype=cosmossdk.io/store.Gas" json:"order_extra_gas"` SwapFeeDistrDenom string `protobuf:"bytes,16,opt,name=swap_fee_distr_denom,json=swapFeeDistrDenom,proto3" json:"swap_fee_distr_denom,omitempty"` SwapFeeBurnRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,17,opt,name=swap_fee_burn_rate,json=swapFeeBurnRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"swap_fee_burn_rate"` AppId uint64 `protobuf:"varint,18,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` @@ -134,60 +135,61 @@ func init() { } var fileDescriptor_babec35f52b1356c = []byte{ - // 847 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0x41, 0x73, 0x1b, 0x35, - 0x14, 0xc7, 0x6d, 0xda, 0x86, 0x44, 0xc1, 0x75, 0xac, 0x26, 0xb0, 0x84, 0xc6, 0x09, 0x65, 0xca, - 0xe4, 0xd2, 0x5d, 0xda, 0x72, 0x67, 0xe2, 0x98, 0x7a, 0x32, 0x93, 0x52, 0x77, 0xcb, 0xf4, 0x90, - 0x81, 0xd1, 0xc8, 0xbb, 0xcf, 0xce, 0x1b, 0xaf, 0x56, 0x42, 0xd2, 0x36, 0x4e, 0x3f, 0x05, 0x47, - 0x3e, 0x03, 0x9f, 0x24, 0xc7, 0x1e, 0x19, 0x0e, 0x2d, 0x24, 0x07, 0xbe, 0x06, 0x23, 0xed, 0xae, - 0x13, 0xa6, 0x1c, 0x4c, 0x66, 0x38, 0xd9, 0xab, 0xf7, 0xfe, 0xbf, 0xa7, 0x7d, 0x7f, 0xe9, 0x2d, - 0xb9, 0x9f, 0x48, 0x91, 0xc2, 0x2c, 0xca, 0xf0, 0xa7, 0x02, 0x53, 0xb4, 0xa7, 0xd1, 0xab, 0x87, - 0x23, 0xb0, 0xfc, 0x61, 0xa4, 0xb8, 0xe6, 0xc2, 0x84, 0x4a, 0x4b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x8c, - 0x0a, 0x9d, 0x97, 0xa6, 0x74, 0xfe, 0x83, 0x29, 0x15, 0xb3, 0x57, 0xe8, 0xdc, 0x9b, 0xb2, 0x41, - 0x96, 0xb8, 0x52, 0x0c, 0xd3, 0x80, 0xfa, 0x79, 0x78, 0x8b, 0x2b, 0x75, 0x90, 0xd2, 0x01, 0xf9, - 0xdc, 0x1d, 0xcc, 0xbc, 0x10, 0x4c, 0x70, 0x3d, 0x05, 0xcb, 0x04, 0x9f, 0x62, 0x3e, 0xa9, 0x8e, - 0xaa, 0x1b, 0x9a, 0x26, 0xb8, 0xe3, 0x15, 0x77, 0x05, 0x9f, 0x7d, 0x57, 0x88, 0xa7, 0x3e, 0xed, - 0xa9, 0xcf, 0xf2, 0x27, 0xf2, 0x7b, 0x97, 0x43, 0xbf, 0x21, 0x5b, 0x35, 0x88, 0x27, 0x16, 0x5f, - 0x81, 0x9f, 0x74, 0x86, 0x29, 0xd0, 0xcc, 0x8d, 0x8e, 0x60, 0xdd, 0x43, 0x82, 0x12, 0xb2, 0xe7, - 0x53, 0xdc, 0x28, 0x33, 0x43, 0xd0, 0x43, 0x8e, 0xba, 0xf7, 0xfc, 0xec, 0xcf, 0x6e, 0xe3, 0xec, - 0xbc, 0xdb, 0x7c, 0x73, 0xde, 0x6d, 0xfe, 0x71, 0xde, 0x6d, 0xfe, 0x7c, 0xd1, 0x6d, 0xbc, 0xb9, - 0xe8, 0x36, 0x7e, 0xbb, 0xe8, 0x36, 0x8e, 0x1e, 0xff, 0xa3, 0xf1, 0xee, 0x63, 0xf4, 0x40, 0x8e, - 0xc7, 0x98, 0x20, 0xcf, 0xaa, 0xe7, 0xe8, 0xea, 0x57, 0xcc, 0x3b, 0x31, 0x5a, 0xf2, 0x37, 0xea, - 0xf1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb3, 0xae, 0x91, 0x14, 0xe6, 0x06, 0x00, 0x00, + // 850 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0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b, 0xee, 0x09, 0x36, 0xfb, 0xbe, 0x14, + 0x4f, 0x7d, 0xda, 0x53, 0x9f, 0xe5, 0x6f, 0xd8, 0x0f, 0x2e, 0x07, 0x7f, 0x83, 0x76, 0x1a, 0x10, + 0x4b, 0x2c, 0x7f, 0x05, 0x7e, 0x72, 0x19, 0xaa, 0x40, 0x53, 0x37, 0x0a, 0xc8, 0xa6, 0x87, 0x90, + 0x0a, 0x72, 0xe0, 0x53, 0xdc, 0x68, 0x32, 0x23, 0xd0, 0x23, 0xc6, 0x75, 0xff, 0xf9, 0xc5, 0xdf, + 0x41, 0xeb, 0xe2, 0x32, 0x68, 0xbf, 0xb9, 0x0c, 0xda, 0x7f, 0x5d, 0x06, 0xed, 0x5f, 0xae, 0x82, + 0xd6, 0x9b, 0xab, 0xa0, 0xf5, 0xc7, 0x55, 0xd0, 0x7a, 0xf9, 0xe4, 0xbd, 0xfe, 0x77, 0x1f, 0x97, + 0x87, 0x72, 0x32, 0xe1, 0x09, 0x67, 0x79, 0xfd, 0x1c, 0x2d, 0x7e, 0x95, 0xfc, 0x40, 0x18, 0xaf, + 0xf8, 0x0e, 0x79, 0xf2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x44, 0x59, 0xf4, 0x6b, 0xb6, 0x06, + 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -966,7 +968,7 @@ func (m *GenericParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DepositExtraGas |= github_com_cosmos_cosmos_sdk_types.Gas(b&0x7F) << shift + m.DepositExtraGas |= cosmossdk_io_store.Gas(b&0x7F) << shift if b < 0x80 { break } @@ -985,7 +987,7 @@ func (m *GenericParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WithdrawExtraGas |= github_com_cosmos_cosmos_sdk_types.Gas(b&0x7F) << shift + m.WithdrawExtraGas |= cosmossdk_io_store.Gas(b&0x7F) << shift if b < 0x80 { break } @@ -1004,7 +1006,7 @@ func (m *GenericParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.OrderExtraGas |= github_com_cosmos_cosmos_sdk_types.Gas(b&0x7F) << shift + m.OrderExtraGas |= cosmossdk_io_store.Gas(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/liquidity/types/pool.go b/x/liquidity/types/pool.go index 977256515..1c51e761e 100644 --- a/x/liquidity/types/pool.go +++ b/x/liquidity/types/pool.go @@ -7,6 +7,8 @@ import ( "strings" "time" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -26,7 +28,7 @@ var ( type PoolTokenDeserializerKit struct { Pair Pair Pool Pool - PoolCoinSupply sdk.Int + PoolCoinSupply sdkmath.Int QuoteCoinPoolBalance sdk.Coin BaseCoinPoolBalance sdk.Coin AmmPoolObject amm.Pool @@ -80,7 +82,7 @@ func NewBasicPool(appID, id, pairID uint64, creator sdk.AccAddress) Pool { } // NewRangedPool returns a new ranged pool object. -func NewRangedPool(appID, id, pairID uint64, creator sdk.AccAddress, minPrice, maxPrice sdk.Dec) Pool { +func NewRangedPool(appID, id, pairID uint64, creator sdk.AccAddress, minPrice, maxPrice sdkmath.LegacyDec) Pool { return Pool{ Type: PoolTypeRanged, Id: id, @@ -134,7 +136,7 @@ func (pool Pool) Validate() error { } // AMMPool constructs amm.Pool interface from Pool. -func (pool Pool) AMMPool(rx, ry, ps sdk.Int) amm.Pool { +func (pool Pool) AMMPool(rx, ry, ps sdkmath.Int) amm.Pool { switch pool.Type { case PoolTypeBasic: return amm.NewBasicPool(rx, ry, ps) @@ -168,7 +170,7 @@ func NewPoolOrderer( } } -func (orderer *PoolOrderer) Order(dir amm.OrderDirection, price sdk.Dec, amt sdk.Int) amm.Order { +func (orderer *PoolOrderer) Order(dir amm.OrderDirection, price sdkmath.LegacyDec, amt sdkmath.Int) amm.Order { var offerCoinDenom, demandCoinDenom string switch dir { case amm.Buy: diff --git a/x/liquidity/types/request.go b/x/liquidity/types/request.go index 1f53c2a69..ae26bdd16 100644 --- a/x/liquidity/types/request.go +++ b/x/liquidity/types/request.go @@ -4,6 +4,8 @@ import ( "fmt" "time" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -17,7 +19,7 @@ func NewDepositRequest(msg *MsgDeposit, pool Pool, id uint64, msgHeight int64) D Depositor: msg.Depositor, DepositCoins: msg.DepositCoins, AcceptedCoins: nil, - MintedPoolCoin: sdk.NewCoin(pool.PoolCoinDenom, sdk.ZeroInt()), + MintedPoolCoin: sdk.NewCoin(pool.PoolCoinDenom, sdkmath.ZeroInt()), Status: RequestStatusNotExecuted, AppId: msg.AppId, } @@ -138,7 +140,7 @@ func (req *WithdrawRequest) SetStatus(status RequestStatus) { } // NewOrderForLimitOrder returns a new Order from MsgLimitOrder. -func NewOrderForLimitOrder(msg *MsgLimitOrder, id uint64, pair Pair, offerCoin sdk.Coin, price sdk.Dec, expireAt time.Time, msgHeight int64) Order { +func NewOrderForLimitOrder(msg *MsgLimitOrder, id uint64, pair Pair, offerCoin sdk.Coin, price sdkmath.LegacyDec, expireAt time.Time, msgHeight int64) Order { return Order{ Id: id, PairId: pair.Id, @@ -147,7 +149,7 @@ func NewOrderForLimitOrder(msg *MsgLimitOrder, id uint64, pair Pair, offerCoin s Direction: msg.Direction, OfferCoin: offerCoin, RemainingOfferCoin: offerCoin, - ReceivedCoin: sdk.NewCoin(msg.DemandCoinDenom, sdk.ZeroInt()), + ReceivedCoin: sdk.NewCoin(msg.DemandCoinDenom, sdkmath.ZeroInt()), Price: price, Amount: msg.Amount, OpenAmount: msg.Amount, @@ -160,7 +162,7 @@ func NewOrderForLimitOrder(msg *MsgLimitOrder, id uint64, pair Pair, offerCoin s } // NewOrderForMarketOrder returns a new Order from MsgMarketOrder. -func NewOrderForMarketOrder(msg *MsgMarketOrder, id uint64, pair Pair, offerCoin sdk.Coin, price sdk.Dec, expireAt time.Time, msgHeight int64) Order { +func NewOrderForMarketOrder(msg *MsgMarketOrder, id uint64, pair Pair, offerCoin sdk.Coin, price sdkmath.LegacyDec, expireAt time.Time, msgHeight int64) Order { return Order{ Id: id, PairId: pair.Id, @@ -169,7 +171,7 @@ func NewOrderForMarketOrder(msg *MsgMarketOrder, id uint64, pair Pair, offerCoin Direction: msg.Direction, OfferCoin: offerCoin, RemainingOfferCoin: offerCoin, - ReceivedCoin: sdk.NewCoin(msg.DemandCoinDenom, sdk.ZeroInt()), + ReceivedCoin: sdk.NewCoin(msg.DemandCoinDenom, sdkmath.ZeroInt()), Price: price, Amount: msg.Amount, OpenAmount: msg.Amount, @@ -183,7 +185,7 @@ func NewOrderForMarketOrder(msg *MsgMarketOrder, id uint64, pair Pair, offerCoin func NewOrder( typ OrderType, id, appID uint64, pair Pair, orderer sdk.AccAddress, - offerCoin sdk.Coin, price sdk.Dec, amt sdk.Int, expireAt time.Time, msgHeight int64, + offerCoin sdk.Coin, price sdkmath.LegacyDec, amt sdkmath.Int, expireAt time.Time, msgHeight int64, ) Order { var ( dir OrderDirection @@ -204,7 +206,7 @@ func NewOrder( Direction: dir, OfferCoin: offerCoin, RemainingOfferCoin: offerCoin, - ReceivedCoin: sdk.NewCoin(demandCoinDenom, sdk.ZeroInt()), + ReceivedCoin: sdk.NewCoin(demandCoinDenom, sdkmath.ZeroInt()), Price: price, Amount: amt, OpenAmount: amt, diff --git a/x/liquidity/types/request_test.go b/x/liquidity/types/request_test.go index 96662835e..eb3710438 100644 --- a/x/liquidity/types/request_test.go +++ b/x/liquidity/types/request_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + sdkmath "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -90,7 +91,7 @@ func TestDepositRequest_Validate(t *testing.T) { { "invalid minted pool coin", func(req *types.DepositRequest) { - req.MintedPoolCoin = sdk.Coin{Denom: "pool1", Amount: sdk.NewInt(-1)} + req.MintedPoolCoin = sdk.Coin{Denom: "pool1", Amount: sdkmath.NewInt(-1)} }, "invalid minted pool coin -1pool1: negative coin amount: -1", }, @@ -167,7 +168,7 @@ func TestWithdrawRequest_Validate(t *testing.T) { { "invalid pool coin", func(req *types.WithdrawRequest) { - req.PoolCoin = sdk.Coin{Denom: "pool1", Amount: sdk.NewInt(-1)} + req.PoolCoin = sdk.Coin{Denom: "pool1", Amount: sdkmath.NewInt(-1)} }, "invalid pool coin -1pool1: negative coin amount: -1", }, @@ -271,7 +272,7 @@ func TestOrder_Validate(t *testing.T) { { "invalid offer coin", func(order *types.Order) { - order.OfferCoin = sdk.Coin{Denom: "denom1", Amount: sdk.NewInt(-1)} + order.OfferCoin = sdk.Coin{Denom: "denom1", Amount: sdkmath.NewInt(-1)} }, "invalid offer coin -1denom1: negative coin amount: -1", }, @@ -285,7 +286,7 @@ func TestOrder_Validate(t *testing.T) { { "invalid remaining offer coin", func(order *types.Order) { - order.RemainingOfferCoin = sdk.Coin{Denom: "denom1", Amount: sdk.NewInt(-1)} + order.RemainingOfferCoin = sdk.Coin{Denom: "denom1", Amount: sdkmath.NewInt(-1)} }, "invalid remaining offer coin -1denom1: negative coin amount: -1", }, @@ -307,7 +308,7 @@ func TestOrder_Validate(t *testing.T) { { "invalid received coin", func(order *types.Order) { - order.ReceivedCoin = sdk.Coin{Denom: "denom1", Amount: sdk.NewInt(-1)} + order.ReceivedCoin = sdk.Coin{Denom: "denom1", Amount: sdkmath.NewInt(-1)} }, "invalid received coin -1denom1: negative coin amount: -1", }, @@ -321,21 +322,21 @@ func TestOrder_Validate(t *testing.T) { { "zero price", func(order *types.Order) { - order.Price = sdk.ZeroDec() + order.Price = sdkmath.LegacyZeroDec() }, "price must be positive: 0.000000000000000000", }, { "zero amount", func(order *types.Order) { - order.Amount = sdk.ZeroInt() + order.Amount = sdkmath.ZeroInt() }, "amount must be positive: 0", }, { "negative open amount", func(order *types.Order) { - order.OpenAmount = sdk.NewInt(-1) + order.OpenAmount = sdkmath.NewInt(-1) }, "open amount must not be negative: -1", }, @@ -366,7 +367,7 @@ func TestOrder_Validate(t *testing.T) { orderer := sdk.AccAddress(crypto.AddressHash([]byte("orderer"))) msg := types.NewMsgLimitOrder( 1, orderer, pair.Id, types.OrderDirectionBuy, utils.ParseCoin("1000000denom2"), - "denom1", utils.ParseDec("1.0"), sdk.NewInt(1000000), types.DefaultMaxOrderLifespan) + "denom1", utils.ParseDec("1.0"), sdkmath.NewInt(1000000), types.DefaultMaxOrderLifespan) expireAt := utils.ParseTime("2022-01-01T00:00:00Z") order := types.NewOrderForLimitOrder(msg, 1, pair, utils.ParseCoin("1000000denom2"), msg.Price, expireAt, 1) tc.malleate(&order) diff --git a/x/liquidity/types/util.go b/x/liquidity/types/util.go index a74ecdaf5..ecde02172 100644 --- a/x/liquidity/types/util.go +++ b/x/liquidity/types/util.go @@ -4,6 +4,8 @@ import ( "strconv" "strings" + sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" @@ -69,10 +71,10 @@ func (op *BulkSendCoinsOperation) Run(ctx sdk.Context, bankKeeper expected.BankK } // NewPoolResponse returns a new PoolResponse from given information. -func NewPoolResponse(pool Pool, rx, ry sdk.Coin, poolCoinSupply sdk.Int) PoolResponse { - var price *sdk.Dec +func NewPoolResponse(pool Pool, rx, ry sdk.Coin, poolCoinSupply sdkmath.Int) PoolResponse { + var price *sdkmath.LegacyDec if !pool.Disabled { - p := pool.AMMPool(rx.Amount, ry.Amount, sdk.Int{}).Price() + p := pool.AMMPool(rx.Amount, ry.Amount, sdkmath.Int{}).Price() price = &p } return PoolResponse{ @@ -99,15 +101,15 @@ func NewPoolResponse(pool Pool, rx, ry sdk.Coin, poolCoinSupply sdk.Int) PoolRes // IsTooSmallOrderAmount returns whether the order amount is too small for // matching, based on the order price. -func IsTooSmallOrderAmount(amt sdk.Int, price sdk.Dec) bool { +func IsTooSmallOrderAmount(amt sdkmath.Int, price sdkmath.LegacyDec) bool { return amt.LT(amm.MinCoinAmount) || price.MulInt(amt).LT(amm.MinCoinAmount.ToLegacyDec()) } // PriceLimits returns the lowest and the highest price limits with given last price // and price limit ratio. -func PriceLimits(lastPrice, priceLimitRatio sdk.Dec, tickPrec int) (lowestPrice, highestPrice sdk.Dec) { - lowestPrice = amm.PriceToUpTick(lastPrice.Mul(sdk.OneDec().Sub(priceLimitRatio)), tickPrec) - highestPrice = amm.PriceToDownTick(lastPrice.Mul(sdk.OneDec().Add(priceLimitRatio)), tickPrec) +func PriceLimits(lastPrice, priceLimitRatio sdkmath.LegacyDec, tickPrec int) (lowestPrice, highestPrice sdkmath.LegacyDec) { + lowestPrice = amm.PriceToUpTick(lastPrice.Mul(sdkmath.LegacyOneDec().Sub(priceLimitRatio)), tickPrec) + highestPrice = amm.PriceToDownTick(lastPrice.Mul(sdkmath.LegacyOneDec().Add(priceLimitRatio)), tickPrec) return } @@ -130,13 +132,13 @@ func (index MMOrderIndex) GetOrderer() sdk.AccAddress { // MMOrderTick holds information about each tick's price and amount of an MMOrder. type MMOrderTick struct { - OfferCoinAmount sdk.Int - Price sdk.Dec - Amount sdk.Int + OfferCoinAmount sdkmath.Int + Price sdkmath.LegacyDec + Amount sdkmath.Int } // MMOrderTicks returns fairly distributed tick information with given parameters. -func MMOrderTicks(dir OrderDirection, minPrice, maxPrice sdk.Dec, amt sdk.Int, maxNumTicks, tickPrec int) (ticks []MMOrderTick) { +func MMOrderTicks(dir OrderDirection, minPrice, maxPrice sdkmath.LegacyDec, amt sdkmath.Int, maxNumTicks, tickPrec int) (ticks []MMOrderTick) { ammDir := amm.OrderDirection(dir) if minPrice.Equal(maxPrice) { return []MMOrderTick{{OfferCoinAmount: amm.OfferCoinAmount(ammDir, minPrice, amt), Price: minPrice, Amount: amt}} @@ -144,7 +146,7 @@ func MMOrderTicks(dir OrderDirection, minPrice, maxPrice sdk.Dec, amt sdk.Int, m gap := maxPrice.Sub(minPrice).QuoInt64(int64(maxNumTicks - 1)) switch dir { case OrderDirectionBuy: - var prevP sdk.Dec + var prevP sdkmath.LegacyDec for i := 0; i < maxNumTicks-1; i++ { p := amm.PriceToDownTick(minPrice.Add(gap.MulInt64(int64(i))), tickPrec) if prevP.IsNil() || !p.Equal(prevP) { @@ -166,7 +168,7 @@ func MMOrderTicks(dir OrderDirection, minPrice, maxPrice sdk.Dec, amt sdk.Int, m Amount: amt, }) case OrderDirectionSell: - var prevP sdk.Dec + var prevP sdkmath.LegacyDec for i := 0; i < maxNumTicks-1; i++ { p := amm.PriceToUpTick(maxPrice.Sub(gap.MulInt64(int64(i))), tickPrec) if prevP.IsNil() || !p.Equal(prevP) { diff --git a/x/liquidity/types/util_test.go b/x/liquidity/types/util_test.go index 36da61d12..296772ce9 100644 --- a/x/liquidity/types/util_test.go +++ b/x/liquidity/types/util_test.go @@ -1,9 +1,9 @@ package types_test import ( + sdkmath "cosmossdk.io/math" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" utils "github.com/comdex-official/comdex/types" @@ -13,37 +13,37 @@ import ( func TestMMOrderTicks(t *testing.T) { require.Equal(t, []types.MMOrderTick{ - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("105"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("104.45"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("103.89"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("103.34"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("102.78"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("102.23"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("101.67"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("101.12"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("100.56"), Amount: sdk.NewInt(100000)}, - {OfferCoinAmount: sdk.NewInt(100000), Price: utils.ParseDec("100"), Amount: sdk.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("105"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("104.45"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("103.89"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("103.34"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("102.78"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("102.23"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("101.67"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("101.12"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("100.56"), Amount: sdkmath.NewInt(100000)}, + {OfferCoinAmount: sdkmath.NewInt(100000), Price: utils.ParseDec("100"), Amount: sdkmath.NewInt(100000)}, }, types.MMOrderTicks( types.OrderDirectionSell, utils.ParseDec("100"), utils.ParseDec("105"), - sdk.NewInt(1000000), int(types.DefaultMaxNumMarketMakingOrderTicks), 4), + sdkmath.NewInt(1000000), int(types.DefaultMaxNumMarketMakingOrderTicks), 4), ) require.Equal(t, []types.MMOrderTick{ { - OfferCoinAmount: sdk.NewInt(5402), + OfferCoinAmount: sdkmath.NewInt(5402), Price: utils.ParseDec("100.02"), - Amount: sdk.NewInt(54), + Amount: sdkmath.NewInt(54), }, { - OfferCoinAmount: sdk.NewInt(5502), + OfferCoinAmount: sdkmath.NewInt(5502), Price: utils.ParseDec("100.03"), - Amount: sdk.NewInt(55), + Amount: sdkmath.NewInt(55), }, }, types.MMOrderTicks( types.OrderDirectionBuy, utils.ParseDec("100.02"), utils.ParseDec("100.03"), - sdk.NewInt(109), int(types.DefaultMaxNumMarketMakingOrderTicks), 4), + sdkmath.NewInt(109), int(types.DefaultMaxNumMarketMakingOrderTicks), 4), ) } diff --git a/x/locker/client/cli/tx.go b/x/locker/client/cli/tx.go index f8664524d..19de51172 100644 --- a/x/locker/client/cli/tx.go +++ b/x/locker/client/cli/tx.go @@ -1,6 +1,7 @@ package cli import ( + sdkmath "cosmossdk.io/math" "strconv" "github.com/cosmos/cosmos-sdk/client/flags" @@ -8,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/locker/types" ) @@ -33,7 +33,7 @@ func txCreateLocker() *cobra.Command { if err != nil { return err } - amount, ok := sdk.NewIntFromString(args[2]) + amount, ok := sdkmath.NewIntFromString(args[2]) if !ok { return types.ErrorInvalidAmountIn } @@ -67,7 +67,7 @@ func txDepositAssetLocker() *cobra.Command { if err != nil { return err } - amount, ok := sdk.NewIntFromString(args[1]) + amount, ok := sdkmath.NewIntFromString(args[1]) if !ok { return types.ErrorInvalidAmountIn } @@ -108,7 +108,7 @@ func txWithdrawAssetLocker() *cobra.Command { if err != nil { return err } - amount, ok := sdk.NewIntFromString(args[1]) + amount, ok := sdkmath.NewIntFromString(args[1]) if !ok { return types.ErrorInvalidAmountIn } diff --git a/x/locker/expected/keeper.go b/x/locker/expected/keeper.go index f6a3d32ae..4bd896ba9 100644 --- a/x/locker/expected/keeper.go +++ b/x/locker/expected/keeper.go @@ -1,6 +1,8 @@ package expected import ( + "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -10,13 +12,13 @@ import ( ) type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error - SpendableCoins(ctx sdk.Context, address sdk.AccAddress) sdk.Coins + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, address sdk.AccAddress, name string, coins sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + SpendableCoins(ctx context.Context, address sdk.AccAddress) sdk.Coins SendCoinsFromModuleToModule( - ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins, + ctx context.Context, senderModule, recipientModule string, amt sdk.Coins, ) error } @@ -28,7 +30,7 @@ type AssetKeeper interface { } type CollectorKeeper interface { - UpdateCollector(ctx sdk.Context, appID, assetID uint64, collectedStabilityFee, collectedClosingFee, collectedOpeningFee, liquidationRewardsCollected sdk.Int) error + UpdateCollector(ctx sdk.Context, appID, assetID uint64, collectedStabilityFee, collectedClosingFee, collectedOpeningFee, liquidationRewardsCollected sdkmath.Int) error GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup collectortypes.CollectorLookupTableData, found bool) } @@ -38,6 +40,6 @@ type EsmKeeper interface { } type RewardsKeeper interface { - CalculateLockerRewards(ctx sdk.Context, appID, assetID, lockerID uint64, Depositor string, NetBalance sdk.Int, blockHeight int64, lockerBlockTime int64) error + CalculateLockerRewards(ctx sdk.Context, appID, assetID, lockerID uint64, Depositor string, NetBalance sdkmath.Int, blockHeight int64, lockerBlockTime int64) error DeleteLockerRewardTracker(ctx sdk.Context, rewards rewardstypes.LockerRewardsTracker) } diff --git a/x/locker/handler.go b/x/locker/handler.go index bf581f109..891ef4d75 100644 --- a/x/locker/handler.go +++ b/x/locker/handler.go @@ -1,15 +1,16 @@ package locker import ( + errorsmod "cosmossdk.io/errors" + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/comdex-official/comdex/x/locker/keeper" "github.com/comdex-official/comdex/x/locker/types" ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServer(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -32,7 +33,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := server.MsgLockerRewardCalc(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) + return nil, errorsmod.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } } } diff --git a/x/locker/keeper/keeper.go b/x/locker/keeper/keeper.go index b54447405..492b3d69d 100644 --- a/x/locker/keeper/keeper.go +++ b/x/locker/keeper/keeper.go @@ -3,15 +3,15 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/locker/expected" "github.com/comdex-official/comdex/x/locker/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" ) type Keeper struct { @@ -42,6 +42,6 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.key) } diff --git a/x/locker/keeper/keeper_test.go b/x/locker/keeper/keeper_test.go index 23b87c364..111af7dfc 100644 --- a/x/locker/keeper/keeper_test.go +++ b/x/locker/keeper/keeper_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -38,7 +37,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.lockerKeeper = s.app.LockerKeeper s.assetKeeper = s.app.AssetKeeper s.querier = lockerKeeper.QueryServer{Keeper: s.lockerKeeper} diff --git a/x/locker/keeper/locker.go b/x/locker/keeper/locker.go index 2fea6e84f..807dd81e9 100644 --- a/x/locker/keeper/locker.go +++ b/x/locker/keeper/locker.go @@ -1,6 +1,8 @@ package keeper import ( + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -40,10 +42,10 @@ func (k Keeper) GetLockerTotalRewardsByAppWise(ctx sdk.Context, appID uint64) (l var ( store = k.Store(ctx) key = types.LockerTotalRewardsByAppWiseKey(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -64,10 +66,10 @@ func (k Keeper) GetLockerTotalRewardsByAppWise(ctx sdk.Context, appID uint64) (l func (k Keeper) GetAllLockerTotalRewardsByAssetAppWise(ctx sdk.Context) (lockerTotalRewardsByAssetAppWise []types.LockerTotalRewardsByAssetAppWise) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LockerTotalRewardsByAssetAppWiseKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LockerTotalRewardsByAssetAppWiseKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -111,10 +113,10 @@ func (k Keeper) GetLockerProductAssetMappingByApp(ctx sdk.Context, appID uint64) var ( store = k.Store(ctx) key = types.LockerProductAssetMappingByAppKey(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -135,10 +137,10 @@ func (k Keeper) GetLockerProductAssetMappingByApp(ctx sdk.Context, appID uint64) func (k Keeper) GetAllLockerProductAssetMapping(ctx sdk.Context) (lockerProductAssetMapping []types.LockerProductAssetMapping) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LockerProductAssetMappingKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LockerProductAssetMappingKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -182,10 +184,10 @@ func (k Keeper) GetLockerLookupTableByApp(ctx sdk.Context, appID uint64) (locker var ( store = k.Store(ctx) key = types.LockerLookupTableByAppKey(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -207,10 +209,10 @@ func (k Keeper) GetLockerLookupTableByApp(ctx sdk.Context, appID uint64) (locker func (k Keeper) GetAllLockerLookupTable(ctx sdk.Context) (lockerLookupTable []types.LockerLookupTableData) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LockerLookupTableKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LockerLookupTableKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -226,7 +228,7 @@ func (k Keeper) GetAllLockerLookupTable(ctx sdk.Context) (lockerLookupTable []ty } // UpdateAmountLockerMapping For updating token locker mapping in lookup table. -func (k Keeper) UpdateAmountLockerMapping(ctx sdk.Context, appID uint64, assetID uint64, amount sdk.Int, changeType bool) { +func (k Keeper) UpdateAmountLockerMapping(ctx sdk.Context, appID uint64, assetID uint64, amount sdkmath.Int, changeType bool) { // if Change type true = Add to deposits // If change type false = Subtract from the deposits @@ -272,10 +274,10 @@ func (k Keeper) GetUserLockerAppMapping(ctx sdk.Context, address string, appID u var ( store = k.Store(ctx) key = types.UserAppLockerMappingKey(address, appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -298,10 +300,10 @@ func (k Keeper) GetUserLockerMapping(ctx sdk.Context, address string) (userLocke var ( store = k.Store(ctx) key = types.UserLockerMappingKey(address) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -323,10 +325,10 @@ func (k Keeper) GetUserLockerMapping(ctx sdk.Context, address string) (userLocke func (k Keeper) GetAllUserLockerAssetMapping(ctx sdk.Context) (userLockerAssetMapping []types.UserAppAssetLockerMapping) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.UserLockerAssetMappingKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.UserLockerAssetMappingKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -409,10 +411,10 @@ func (k Keeper) GetLocker(ctx sdk.Context, lockerID uint64) (locker types.Locker func (k Keeper) GetLockers(ctx sdk.Context) (locker []types.Locker) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LockerKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LockerKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/locker/keeper/locker_test.go b/x/locker/keeper/locker_test.go index a23f6d1a8..b819fa43e 100644 --- a/x/locker/keeper/locker_test.go +++ b/x/locker/keeper/locker_test.go @@ -1,7 +1,9 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "fmt" + "github.com/comdex-official/comdex/app/wasm/bindings" utils "github.com/comdex-official/comdex/types" assetTypes "github.com/comdex-official/comdex/x/asset/types" @@ -16,7 +18,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err := assetKeeper.AddAppRecords(*ctx, msg1) @@ -25,7 +27,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg2 := assetTypes.AppData{ Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg2) @@ -34,7 +36,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg3 := assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } @@ -44,7 +46,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg4 := assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg4) @@ -53,7 +55,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg5 := assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg5) @@ -66,12 +68,12 @@ func (s *KeeperTestSuite) AddCollectorLookupTable() { AppID: 1, CollectorAssetID: 1, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), } err := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &msg1) s.Require().NoError(err) @@ -80,12 +82,12 @@ func (s *KeeperTestSuite) AddCollectorLookupTable() { AppID: 1, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), } err1 := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &msg2) s.Require().NoError(err1) @@ -94,12 +96,12 @@ func (s *KeeperTestSuite) AddCollectorLookupTable() { AppID: 2, CollectorAssetID: 1, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), } err2 := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &msg3) s.Require().NoError(err2) @@ -161,7 +163,7 @@ func (s *KeeperTestSuite) TestCreateLocker() { "CreateLocker : App1 Asset 1", lockerTypes.MsgCreateLockerRequest{ Depositor: userAddress, - Amount: sdk.NewIntFromUint64(1000000), + Amount: sdkmath.NewIntFromUint64(1000000), AssetId: 1, AppId: 1, }, @@ -176,7 +178,7 @@ func (s *KeeperTestSuite) TestCreateLocker() { "CreateLocker : Duplicate locker App1 Asset1 should fail", lockerTypes.MsgCreateLockerRequest{ Depositor: userAddress, - Amount: sdk.NewIntFromUint64(1000000), + Amount: sdkmath.NewIntFromUint64(1000000), AssetId: 1, AppId: 1, }, @@ -191,7 +193,7 @@ func (s *KeeperTestSuite) TestCreateLocker() { "CreateLocker : ErrorAssetDoesNotExist", lockerTypes.MsgCreateLockerRequest{ Depositor: userAddress, - Amount: sdk.NewIntFromUint64(1000000), + Amount: sdkmath.NewIntFromUint64(1000000), AssetId: 10, AppId: 1, }, @@ -206,7 +208,7 @@ func (s *KeeperTestSuite) TestCreateLocker() { "CreateLocker : ErrorAppMappingDoesNotExist", lockerTypes.MsgCreateLockerRequest{ Depositor: userAddress, - Amount: sdk.NewIntFromUint64(1000000), + Amount: sdkmath.NewIntFromUint64(1000000), AssetId: 1, AppId: 10, }, @@ -221,7 +223,7 @@ func (s *KeeperTestSuite) TestCreateLocker() { "CreateLocker : ErrorAppMappingDoesNotExist", lockerTypes.MsgCreateLockerRequest{ Depositor: userAddress, - Amount: sdk.NewIntFromUint64(1000000), + Amount: sdkmath.NewIntFromUint64(1000000), AssetId: 2, AppId: 2, }, @@ -236,7 +238,7 @@ func (s *KeeperTestSuite) TestCreateLocker() { "CreateLocker : App1 Asset 2", lockerTypes.MsgCreateLockerRequest{ Depositor: userAddress, - Amount: sdk.NewIntFromUint64(2000000), + Amount: sdkmath.NewIntFromUint64(2000000), AssetId: 2, AppId: 1, }, @@ -251,7 +253,7 @@ func (s *KeeperTestSuite) TestCreateLocker() { "CreateLocker : App2 Asset 1", lockerTypes.MsgCreateLockerRequest{ Depositor: userAddress, - Amount: sdk.NewIntFromUint64(9900000), + Amount: sdkmath.NewIntFromUint64(9900000), AssetId: 1, AppId: 2, }, @@ -265,9 +267,9 @@ func (s *KeeperTestSuite) TestCreateLocker() { } { s.Run(tc.name, func() { if tc.msg.AssetId == 1 { - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(tc.fundAmount))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(tc.fundAmount))) } else { - s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdk.NewIntFromUint64(tc.fundAmount))) + s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdkmath.NewIntFromUint64(tc.fundAmount))) } _, err := server.MsgCreateLocker(sdk.WrapSDKContext(*ctx), &tc.msg) if tc.ExpErr != nil { @@ -306,7 +308,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(4000000), + Amount: sdkmath.NewIntFromUint64(4000000), AssetId: 10, AppId: 1, }, @@ -322,7 +324,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(4000000), + Amount: sdkmath.NewIntFromUint64(4000000), AssetId: 1, AppId: 10, }, @@ -338,7 +340,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress, LockerId: 10, - Amount: sdk.NewIntFromUint64(4000000), + Amount: sdkmath.NewIntFromUint64(4000000), AssetId: 1, AppId: 1, }, @@ -354,7 +356,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(4000000), + Amount: sdkmath.NewIntFromUint64(4000000), AssetId: 2, AppId: 1, }, @@ -370,7 +372,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress1, LockerId: 1, - Amount: sdk.NewIntFromUint64(4000000), + Amount: sdkmath.NewIntFromUint64(4000000), AssetId: 1, AppId: 1, }, @@ -386,7 +388,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(4000000), + Amount: sdkmath.NewIntFromUint64(4000000), AssetId: 1, AppId: 2, }, @@ -402,7 +404,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(4000000), + Amount: sdkmath.NewIntFromUint64(4000000), AssetId: 1, AppId: 1, }, @@ -418,7 +420,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress, LockerId: 3, - Amount: sdk.NewIntFromUint64(4000000), + Amount: sdkmath.NewIntFromUint64(4000000), AssetId: 1, AppId: 2, }, @@ -434,7 +436,7 @@ func (s *KeeperTestSuite) TestDepositLocker() { lockerTypes.MsgDepositAssetRequest{ Depositor: userAddress, LockerId: 3, - Amount: sdk.NewIntFromUint64(9223372036854775807), + Amount: sdkmath.NewIntFromUint64(9223372036854775807), AssetId: 1, AppId: 2, }, @@ -448,9 +450,9 @@ func (s *KeeperTestSuite) TestDepositLocker() { } { s.Run(tc.name, func() { if tc.msg.AssetId == 1 { - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(tc.fundAmount))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(tc.fundAmount))) } else { - s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdk.NewIntFromUint64(tc.fundAmount))) + s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdkmath.NewIntFromUint64(tc.fundAmount))) } lockerInfo, err := s.querier.QueryLockerInfo(sdk.WrapSDKContext(*ctx), &tc.query) s.Require().NoError(err) @@ -493,7 +495,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(100000), + Amount: sdkmath.NewIntFromUint64(100000), AssetId: 10, AppId: 1, }, @@ -509,7 +511,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(100000), + Amount: sdkmath.NewIntFromUint64(100000), AssetId: 1, AppId: 10, }, @@ -525,7 +527,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 10, - Amount: sdk.NewIntFromUint64(100000), + Amount: sdkmath.NewIntFromUint64(100000), AssetId: 1, AppId: 1, }, @@ -541,7 +543,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(100000), + Amount: sdkmath.NewIntFromUint64(100000), AssetId: 2, AppId: 1, }, @@ -557,7 +559,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(100000), + Amount: sdkmath.NewIntFromUint64(100000), AssetId: 1, AppId: 2, }, @@ -573,7 +575,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress1, LockerId: 1, - Amount: sdk.NewIntFromUint64(100000), + Amount: sdkmath.NewIntFromUint64(100000), AssetId: 1, AppId: 1, }, @@ -589,7 +591,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(9223372036854775807), + Amount: sdkmath.NewIntFromUint64(9223372036854775807), AssetId: 1, AppId: 1, }, @@ -605,7 +607,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(100000), + Amount: sdkmath.NewIntFromUint64(100000), AssetId: 1, AppId: 1, }, @@ -621,7 +623,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 1, - Amount: sdk.NewIntFromUint64(900000), + Amount: sdkmath.NewIntFromUint64(900000), AssetId: 1, AppId: 1, }, @@ -637,7 +639,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { lockerTypes.MsgWithdrawAssetRequest{ Depositor: userAddress, LockerId: 3, - Amount: sdk.NewIntFromUint64(9900000), + Amount: sdkmath.NewIntFromUint64(9900000), AssetId: 1, AppId: 2, }, @@ -667,7 +669,7 @@ func (s *KeeperTestSuite) TestWithdrawLocker() { if tc.partial { s.Require().Equal(lockerInfo.LockerInfo.NetBalance, previousNetAmount.Sub(tc.msg.Amount)) } else { - s.Require().Equal(lockerInfo.LockerInfo.NetBalance, sdk.NewIntFromUint64(0)) + s.Require().Equal(lockerInfo.LockerInfo.NetBalance, sdkmath.NewIntFromUint64(0)) } } }) @@ -796,14 +798,14 @@ func (s *KeeperTestSuite) TestCloseLocker() { func (s *KeeperTestSuite) TestSetNetFeeCollectedData() { collectorkeeper, ctx := &s.collector, &s.ctx - err := collectorkeeper.SetNetFeeCollectedData(*ctx, 1, 1, sdk.NewInt(1000000000)) + err := collectorkeeper.SetNetFeeCollectedData(*ctx, 1, 1, sdkmath.NewInt(1000000000)) s.Require().NoError(err) } func (s *KeeperTestSuite) TestFundModule() { - err := s.app.BankKeeper.MintCoins(s.ctx, lockerTypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(10000000000)))) + err := s.app.BankKeeper.MintCoins(s.ctx, lockerTypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(10000000000)))) s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, lockerTypes.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(10000000000)))) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, lockerTypes.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(10000000000)))) s.Require().NoError(err) } @@ -869,7 +871,7 @@ func (s *KeeperTestSuite) TestLockerRewardCalc() { s.Require().NoError(err) lockerInfo, err := s.querier.QueryLockerInfo(sdk.WrapSDKContext(*ctx), &tc.query) s.Require().NoError(err) - s.Require().NotEqual(lockerInfo.LockerInfo.ReturnsAccumulated, sdk.ZeroInt()) + s.Require().NotEqual(lockerInfo.LockerInfo.ReturnsAccumulated, sdkmath.ZeroInt()) fmt.Println("ReturnsAccumulated", lockerInfo.LockerInfo.ReturnsAccumulated) } }) diff --git a/x/locker/keeper/msg_server.go b/x/locker/keeper/msg_server.go index cd5d3e80c..e4fa618e2 100644 --- a/x/locker/keeper/msg_server.go +++ b/x/locker/keeper/msg_server.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "context" "sort" @@ -72,7 +73,7 @@ func (k msgServer) MsgCreateLocker(c context.Context, msg *types.MsgCreateLocker if err != nil { return nil, err } - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromAccountToModule(ctx, depositor, types.ModuleName, sdk.NewCoins(sdk.NewCoin(asset.Denom, msg.Amount))); err != nil { return nil, err } @@ -92,7 +93,7 @@ func (k msgServer) MsgCreateLocker(c context.Context, msg *types.MsgCreateLocker userLocker.CreatedAt = ctx.BlockTime() userLocker.IsLocked = false userLocker.NetBalance = msg.Amount - userLocker.ReturnsAccumulated = sdk.ZeroInt() + userLocker.ReturnsAccumulated = sdkmath.ZeroInt() userLocker.AppId = appMapping.Id userLocker.BlockHeight = blockHeight userLocker.BlockTime = blockTime @@ -179,7 +180,7 @@ func (k msgServer) MsgDepositAsset(c context.Context, msg *types.MsgDepositAsset } lockerData, _ = k.GetLocker(ctx, msg.LockerId) - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromAccountToModule(ctx, depositor, types.ModuleName, sdk.NewCoins(sdk.NewCoin(asset.Denom, msg.Amount))); err != nil { return nil, err } @@ -258,7 +259,7 @@ func (k msgServer) MsgWithdrawAsset(c context.Context, msg *types.MsgWithdrawAss lockerData.NetBalance = lockerData.NetBalance.Sub(msg.Amount) - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, sdk.NewCoins(sdk.NewCoin(asset.Denom, msg.Amount))); err != nil { return nil, err } @@ -332,7 +333,7 @@ func (k msgServer) MsgCloseLocker(c context.Context, msg *types.MsgCloseLockerRe lockerData, _ = k.GetLocker(ctx, msg.LockerId) - if lockerData.NetBalance.GT(sdk.ZeroInt()) { + if lockerData.NetBalance.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, sdk.NewCoins(sdk.NewCoin(asset.Denom, lockerData.NetBalance))); err != nil { return nil, err } @@ -344,7 +345,7 @@ func (k msgServer) MsgCloseLocker(c context.Context, msg *types.MsgCloseLockerRe userTxData.TxType = "Close" userTxData.Amount = lockerData.NetBalance - userTxData.Balance = sdk.ZeroInt() + userTxData.Balance = sdkmath.ZeroInt() userTxData.TxTime = ctx.BlockTime() userLockerAssetMappingData.UserData = append(userLockerAssetMappingData.UserData, &userTxData) diff --git a/x/locker/module.go b/x/locker/module.go index 854244981..bfaee3df5 100644 --- a/x/locker/module.go +++ b/x/locker/module.go @@ -132,6 +132,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -154,10 +160,8 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ sdk.Context) {} -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/locker/module_simulation.go b/x/locker/module_simulation.go index e3aaeaae9..93320adb7 100644 --- a/x/locker/module_simulation.go +++ b/x/locker/module_simulation.go @@ -3,7 +3,6 @@ package locker import ( "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -37,14 +36,6 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP return nil } -// RandomizedParams creates randomized param changes for the simulator. -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// return []simtypes.ParamChange{} -// } - -// RegisterStoreDecoder registers a decoder. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/locker/types/errors.go b/x/locker/types/errors.go index 36755250e..f625ed993 100644 --- a/x/locker/types/errors.go +++ b/x/locker/types/errors.go @@ -1,24 +1,24 @@ package types import ( - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrorInvalidAmountIn = errors.Register(ModuleName, 901, "invalid amount_in") - ErrorInvalidAmountOut = errors.Register(ModuleName, 902, "invalid amount_out") - ErrorInvalidFrom = errors.Register(ModuleName, 903, "invalid depositer adddress") - ErrorInvalidAssetID = errors.Register(ModuleName, 904, "Invalid AssetID") - ErrorInvalidLockerID = errors.Register(ModuleName, 905, "Invalid LockerID") - ErrorAssetDoesNotExist = errors.Register(ModuleName, 906, "asset does not exist") - ErrorUnauthorized = errors.Register(ModuleName, 907, "unauthorized") - ErrorAppMappingDoesNotExist = errors.Register(ModuleName, 908, "App Mapping Id does not exists") - ErrorLockerProductAssetMappingExists = errors.Register(ModuleName, 909, "Product mapping to this asset id already exists") - ErrorLockerProductAssetMappingDoesNotExists = errors.Register(ModuleName, 910, "Product mapping to this asset id does not exists") - ErrorUserLockerAlreadyExists = errors.Register(ModuleName, 911, "User Locker already exists, try deposit command") - ErrorLockerDoesNotExists = errors.Register(ModuleName, 912, "Locker does not exists") - ErrorRequestedAmountExceedsDepositAmount = errors.Register(ModuleName, 913, "Not enough balance in locker") - ErrorCollectorLookupDoesNotExists = errors.Register(ModuleName, 914, "Collector lookup does not exists") - ErrorAppMappingIDMismatch = errors.Register(ModuleName, 915, "App Mapping Id mismatch") - ErrorUnknownMsgType = errors.Register(ModuleName, 916, "unknown message type") + ErrorInvalidAmountIn = errorsmod.Register(ModuleName, 901, "invalid amount_in") + ErrorInvalidAmountOut = errorsmod.Register(ModuleName, 902, "invalid amount_out") + ErrorInvalidFrom = errorsmod.Register(ModuleName, 903, "invalid depositer adddress") + ErrorInvalidAssetID = errorsmod.Register(ModuleName, 904, "Invalid AssetID") + ErrorInvalidLockerID = errorsmod.Register(ModuleName, 905, "Invalid LockerID") + ErrorAssetDoesNotExist = errorsmod.Register(ModuleName, 906, "asset does not exist") + ErrorUnauthorized = errorsmod.Register(ModuleName, 907, "unauthorized") + ErrorAppMappingDoesNotExist = errorsmod.Register(ModuleName, 908, "App Mapping Id does not exists") + ErrorLockerProductAssetMappingExists = errorsmod.Register(ModuleName, 909, "Product mapping to this asset id already exists") + ErrorLockerProductAssetMappingDoesNotExists = errorsmod.Register(ModuleName, 910, "Product mapping to this asset id does not exists") + ErrorUserLockerAlreadyExists = errorsmod.Register(ModuleName, 911, "User Locker already exists, try deposit command") + ErrorLockerDoesNotExists = errorsmod.Register(ModuleName, 912, "Locker does not exists") + ErrorRequestedAmountExceedsDepositAmount = errorsmod.Register(ModuleName, 913, "Not enough balance in locker") + ErrorCollectorLookupDoesNotExists = errorsmod.Register(ModuleName, 914, "Collector lookup does not exists") + ErrorAppMappingIDMismatch = errorsmod.Register(ModuleName, 915, "App Mapping Id mismatch") + ErrorUnknownMsgType = errorsmod.Register(ModuleName, 916, "unknown message type") ) diff --git a/x/locker/types/expected_keepers.go b/x/locker/types/expected_keepers.go index cbc3a5589..914960c30 100644 --- a/x/locker/types/expected_keepers.go +++ b/x/locker/types/expected_keepers.go @@ -1,18 +1,18 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias). type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } diff --git a/x/locker/types/locker.pb.go b/x/locker/types/locker.pb.go index 3004734cc..fff272d3e 100644 --- a/x/locker/types/locker.pb.go +++ b/x/locker/types/locker.pb.go @@ -4,9 +4,9 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" @@ -31,16 +31,16 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // locker_id will be the key which will be derived from the LockerLookUpTable type Locker struct { - LockerId uint64 `protobuf:"varint,1,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` - ReturnsAccumulated github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=returns_accumulated,json=returnsAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"returns_accumulated" yaml:"returns_accumulated"` - NetBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=net_balance,json=netBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"net_balance" yaml:"net_balance"` - CreatedAt time.Time `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` - AssetDepositId uint64 `protobuf:"varint,6,opt,name=asset_deposit_id,json=assetDepositId,proto3" json:"asset_deposit_id,omitempty" yaml:"asset_deposit_id"` - IsLocked bool `protobuf:"varint,7,opt,name=is_locked,json=isLocked,proto3" json:"is_locked,omitempty" yaml:"is_locked"` - AppId uint64 `protobuf:"varint,8,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - BlockHeight int64 `protobuf:"varint,9,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` - BlockTime time.Time `protobuf:"bytes,10,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` + LockerId uint64 `protobuf:"varint,1,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` + ReturnsAccumulated cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=returns_accumulated,json=returnsAccumulated,proto3,customtype=cosmossdk.io/math.Int" json:"returns_accumulated" yaml:"returns_accumulated"` + NetBalance cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=net_balance,json=netBalance,proto3,customtype=cosmossdk.io/math.Int" json:"net_balance" yaml:"net_balance"` + CreatedAt time.Time `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` + AssetDepositId uint64 `protobuf:"varint,6,opt,name=asset_deposit_id,json=assetDepositId,proto3" json:"asset_deposit_id,omitempty" yaml:"asset_deposit_id"` + IsLocked bool `protobuf:"varint,7,opt,name=is_locked,json=isLocked,proto3" json:"is_locked,omitempty" yaml:"is_locked"` + AppId uint64 `protobuf:"varint,8,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + BlockHeight int64 `protobuf:"varint,9,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` + BlockTime time.Time `protobuf:"bytes,10,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` } func (m *Locker) Reset() { *m = Locker{} } @@ -118,10 +118,10 @@ func (m *UserAppAssetLockerMapping) XXX_DiscardUnknown() { var xxx_messageInfo_UserAppAssetLockerMapping proto.InternalMessageInfo type UserTxData struct { - TxType string `protobuf:"bytes,1,opt,name=tx_type,json=txType,proto3" json:"tx_type,omitempty" yaml:"tx_type"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` - Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance" yaml:"balance"` - TxTime time.Time `protobuf:"bytes,4,opt,name=tx_time,json=txTime,proto3,stdtime" json:"tx_time" yaml:"tx_time"` + TxType string `protobuf:"bytes,1,opt,name=tx_type,json=txType,proto3" json:"tx_type,omitempty" yaml:"tx_type"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` + Balance cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=balance,proto3,customtype=cosmossdk.io/math.Int" json:"balance" yaml:"balance"` + TxTime time.Time `protobuf:"bytes,4,opt,name=tx_time,json=txTime,proto3,stdtime" json:"tx_time" yaml:"tx_time"` } func (m *UserTxData) Reset() { *m = UserTxData{} } @@ -158,10 +158,10 @@ func (m *UserTxData) XXX_DiscardUnknown() { var xxx_messageInfo_UserTxData proto.InternalMessageInfo type LockerLookupTableData struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` - LockerIds []uint64 `protobuf:"varint,3,rep,packed,name=locker_ids,json=lockerIds,proto3" json:"locker_ids,omitempty" yaml:"addresses"` - DepositedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=deposited_amount,json=depositedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"deposited_amount" yaml:"deposited_amount"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + LockerIds []uint64 `protobuf:"varint,3,rep,packed,name=locker_ids,json=lockerIds,proto3" json:"locker_ids,omitempty" yaml:"addresses"` + DepositedAmount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=deposited_amount,json=depositedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"deposited_amount" yaml:"deposited_amount"` } func (m *LockerLookupTableData) Reset() { *m = LockerLookupTableData{} } @@ -237,8 +237,8 @@ func (m *LockerProductAssetMapping) XXX_DiscardUnknown() { var xxx_messageInfo_LockerProductAssetMapping proto.InternalMessageInfo type LockedDepositedAmountDataMap struct { - AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - DepositedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=deposited_amount,json=depositedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"deposited_amount" yaml:"deposited_amount"` + AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + DepositedAmount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=deposited_amount,json=depositedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"deposited_amount" yaml:"deposited_amount"` } func (m *LockedDepositedAmountDataMap) Reset() { *m = LockedDepositedAmountDataMap{} } @@ -275,9 +275,9 @@ func (m *LockedDepositedAmountDataMap) XXX_DiscardUnknown() { var xxx_messageInfo_LockedDepositedAmountDataMap proto.InternalMessageInfo type LockerTotalRewardsByAssetAppWise struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - TotalRewards github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=total_rewards,json=totalRewards,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_rewards" yaml:"total_rewards"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + TotalRewards cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=total_rewards,json=totalRewards,proto3,customtype=cosmossdk.io/math.Int" json:"total_rewards" yaml:"total_rewards"` } func (m *LockerTotalRewardsByAssetAppWise) Reset() { *m = LockerTotalRewardsByAssetAppWise{} } @@ -328,66 +328,66 @@ func init() { } var fileDescriptor_5cf8d15809df39ec = []byte{ - // 944 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x3f, 0x6f, 0xdb, 0x46, - 0x14, 0x17, 0xad, 0x3f, 0x96, 0xce, 0x4e, 0xe2, 0x9c, 0x6d, 0x98, 0x56, 0x5b, 0x51, 0xbd, 0x21, - 0x10, 0x50, 0x84, 0xaa, 0x9d, 0x2d, 0x4b, 0x2b, 0xc1, 0x2d, 0x2a, 0xc0, 0x41, 0x8b, 0x83, 0x8a, - 0x14, 0x59, 0x88, 0x13, 0x79, 0x96, 0x09, 0x4b, 0x3a, 0x82, 0x77, 0x6c, 0xec, 0xa1, 0x73, 0xd7, - 0x7c, 0x8c, 0x7e, 0x8b, 0x2e, 0x1d, 0x3c, 0x66, 0x2c, 0x3a, 0xb0, 0xad, 0x3d, 0x65, 0xe5, 0x07, - 0x28, 0x8a, 0xfb, 0x43, 0x8a, 0x0a, 0x0c, 0x38, 0x1a, 0x32, 0xe9, 0xde, 0x7f, 0xbe, 0xdf, 0xfb, - 0xbd, 0x07, 0x01, 0xe4, 0xb3, 0x79, 0x40, 0x2f, 0xfb, 0x33, 0xe6, 0x5f, 0xd0, 0xb8, 0xff, 0xf3, - 0xd1, 0x84, 0x0a, 0x72, 0x64, 0x44, 0x37, 0x8a, 0x99, 0x60, 0x70, 0x5f, 0xfb, 0xb8, 0x46, 0x69, - 0x7c, 0xda, 0x1d, 0x9f, 0xf1, 0x39, 0xe3, 0xfd, 0x09, 0xe1, 0xb4, 0x08, 0xf4, 0x59, 0xb8, 0xd0, - 0x61, 0xed, 0xbd, 0x29, 0x9b, 0x32, 0xf5, 0xec, 0xcb, 0x97, 0xd1, 0x3a, 0x53, 0xc6, 0xa6, 0x33, - 0xda, 0x57, 0xd2, 0x24, 0x39, 0xeb, 0x8b, 0x70, 0x4e, 0xb9, 0x20, 0xf3, 0x48, 0x3b, 0xa0, 0x77, - 0x75, 0xd0, 0x38, 0x55, 0x95, 0xe0, 0x11, 0x68, 0xe9, 0x9a, 0x5e, 0x18, 0xd8, 0x56, 0xd7, 0xea, - 0xd5, 0x86, 0x7b, 0x59, 0xea, 0xec, 0x5c, 0x91, 0xf9, 0xec, 0x39, 0x2a, 0x4c, 0x08, 0x37, 0xf5, - 0x7b, 0x14, 0xc0, 0x63, 0xd0, 0x0a, 0x68, 0xc4, 0x78, 0x28, 0x58, 0x6c, 0x6f, 0x74, 0xad, 0x5e, - 0xab, 0x1c, 0x52, 0x98, 0x10, 0x5e, 0xba, 0xc1, 0x5f, 0xc0, 0x6e, 0x4c, 0x45, 0x12, 0x2f, 0xb8, - 0x47, 0x7c, 0x3f, 0x99, 0x27, 0x33, 0x22, 0x68, 0x60, 0x57, 0x55, 0xf4, 0xe9, 0x75, 0xea, 0x54, - 0xfe, 0x4a, 0x9d, 0x27, 0xd3, 0x50, 0x9c, 0x27, 0x13, 0xd7, 0x67, 0xf3, 0xbe, 0x69, 0x5c, 0xff, - 0x3c, 0xe5, 0xc1, 0x45, 0x5f, 0x5c, 0x45, 0x94, 0xbb, 0xa3, 0x85, 0xc8, 0x52, 0xa7, 0xad, 0x6b, - 0xdd, 0x91, 0x12, 0x61, 0x68, 0xb4, 0x83, 0xa5, 0x12, 0x52, 0xb0, 0xb5, 0xa0, 0xc2, 0x9b, 0x90, - 0x19, 0x59, 0xf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, 0xcd, 0xe6, 0x7d, 0xbb, 0x76, 0xc7, 0x7b, 0x66, - 0x57, 0xca, 0xc9, 0x10, 0xde, 0x16, 0xe5, 0xa6, 0xf0, 0xf5, 0xbf, 0x9d, 0xca, 0x6f, 0x37, 0x9d, - 0xca, 0xf5, 0x4d, 0xc7, 0x7a, 0x7b, 0xd3, 0xb1, 0xfe, 0xb9, 0xe9, 0x58, 0x6f, 0x6e, 0x3b, 0x95, - 0xb7, 0xb7, 0x9d, 0xca, 0x9f, 0xb7, 0x9d, 0xca, 0xab, 0x2f, 0x57, 0xea, 0xc9, 0x23, 0xf7, 0x94, - 0x9d, 0x9d, 0x85, 0x7e, 0x48, 0x66, 0x46, 0xee, 0x17, 0xff, 0x99, 0x54, 0xf5, 0x49, 0x43, 0xed, - 0xef, 0xb3, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x82, 0xe2, 0x45, 0x51, 0x09, 0x00, 0x00, + // 940 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0x23, 0x45, + 0x10, 0xf6, 0xc4, 0x3f, 0xb1, 0x3b, 0xfb, 0x93, 0xed, 0x24, 0xca, 0xc4, 0x80, 0xc7, 0xf4, 0x01, + 0x59, 0x42, 0xcc, 0x90, 0x44, 0x48, 0x68, 0x39, 0xd9, 0x0a, 0x08, 0x4b, 0xbb, 0x02, 0xb5, 0x8c, + 0x40, 0x7b, 0x19, 0xb5, 0x67, 0x3a, 0xce, 0x28, 0xb6, 0x7b, 0x34, 0xdd, 0xc3, 0x26, 0x6f, 0xb1, + 0x2f, 0xc0, 0x9d, 0x3b, 0x0f, 0x41, 0x8e, 0x7b, 0x5c, 0x71, 0x18, 0x20, 0x79, 0x83, 0x39, 0x70, + 0x44, 0xa8, 0x7f, 0x66, 0x3c, 0x5e, 0x45, 0xf2, 0x22, 0xc1, 0x6d, 0xba,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 0x79, 0xe6, 0x74, 0x75, 0xea, 0x7b, 0x32, 0x20, 0x0c, 0x8d, 0x75, 0xb8, 0x32, 0xc2, + 0x09, 0xd8, 0x59, 0x52, 0xe1, 0x4f, 0xc9, 0x9c, 0x2c, 0x03, 0x6a, 0x37, 0x54, 0x95, 0xd3, 0x4d, + 0x55, 0xa0, 0xae, 0x52, 0x41, 0x22, 0x0c, 0x96, 0x54, 0x8c, 0xf4, 0x03, 0xfe, 0x00, 0x40, 0x90, + 0x50, 0x59, 0xc0, 0x27, 0xc2, 0x6e, 0xf6, 0xad, 0xc1, 0xce, 0x49, 0xd7, 0xd5, 0x5c, 0xbb, 0x05, + 0xd7, 0xee, 0xa4, 0xe0, 0x7a, 0xf4, 0x81, 0x2c, 0x98, 0x67, 0xce, 0x13, 0x9d, 0x77, 0x85, 0x45, + 0xaf, 0x7e, 0x77, 0x2c, 0xdc, 0x31, 0x86, 0xa1, 0x80, 0x5f, 0x82, 0x5d, 0xc2, 0x39, 0x15, 0xbe, + 0x21, 0x4c, 0xce, 0xa2, 0xa5, 0x66, 0xf1, 0x5e, 0x9e, 0x39, 0x87, 0x1a, 0xff, 0x76, 0x04, 0xc2, + 0x8f, 0x94, 0xe9, 0x4c, 0x5b, 0xc6, 0xa1, 0x9c, 0x65, 0xc4, 0x7d, 0x35, 0xa7, 0xd0, 0xde, 0xee, + 0x5b, 0x83, 0x76, 0x75, 0x30, 0xa5, 0x0b, 0xe1, 0x76, 0xc4, 0xd5, 0xf8, 0x43, 0x38, 0x00, 0x2d, + 0x12, 0xc7, 0xb2, 0x5e, 0x5b, 0xd5, 0x7b, 0x92, 0x67, 0xce, 0x43, 0x53, 0x4f, 0xd9, 0x11, 0x6e, + 0x92, 0x38, 0x1e, 0x87, 0xf0, 0x29, 0x78, 0x30, 0x95, 0x78, 0xff, 0x82, 0x46, 0xb3, 0x0b, 0x61, + 0x77, 0xfa, 0xd6, 0xa0, 0x3e, 0x3a, 0xcc, 0x33, 0x67, 0x4f, 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 0x92, 0x24, 0xe4, 0xa3, 0x6b, 0x45, 0xda, 0x30, 0x8e, 0xbf, 0x8f, + 0x38, 0xfd, 0xff, 0x48, 0x83, 0x2f, 0xc0, 0x43, 0x21, 0xeb, 0xfa, 0x89, 0x2e, 0x6c, 0xd6, 0xe8, + 0xb3, 0x4d, 0x0d, 0xee, 0x1b, 0xe1, 0x57, 0xb1, 0x08, 0x3f, 0x10, 0xd5, 0x1e, 0xf0, 0xcd, 0x9f, + 0xbd, 0xda, 0xcf, 0xb7, 0xbd, 0xda, 0xcd, 0x6d, 0xcf, 0x7a, 0x7d, 0xdb, 0xb3, 0xfe, 0xb8, 0xed, + 0x59, 0xaf, 0xee, 0x7a, 0xb5, 0xd7, 0x77, 0xbd, 0xda, 0x9b, 0xbb, 0x5e, 0xed, 0xc5, 0xa7, 0xb3, + 0x48, 0x5c, 0xa4, 0x53, 0x79, 0x8b, 0x3c, 0x7d, 0x8f, 0x3e, 0x61, 0xe7, 0xe7, 0x51, 0x10, 0x91, + 0xb9, 0x79, 0x7b, 0xe5, 0x9f, 0x17, 0x79, 0x40, 0xf8, 0xb4, 0xa5, 0x96, 0xf1, 0xf4, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x39, 0xbf, 0x21, 0x61, 0xda, 0x08, 0x00, 0x00, } func (m *Locker) Marshal() (dAtA []byte, err error) { diff --git a/x/locker/types/msg.go b/x/locker/types/msg.go index 0b7425b6f..dd4b256f9 100644 --- a/x/locker/types/msg.go +++ b/x/locker/types/msg.go @@ -1,8 +1,9 @@ package types import ( + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" ) var ( @@ -13,7 +14,7 @@ var ( _ sdk.Msg = (*MsgLockerRewardCalcRequest)(nil) ) -func NewMsgCreateLockerRequest(from string, amount sdk.Int, assetID uint64, appMappingID uint64) *MsgCreateLockerRequest { +func NewMsgCreateLockerRequest(from string, amount sdkmath.Int, assetID uint64, appMappingID uint64) *MsgCreateLockerRequest { return &MsgCreateLockerRequest{ Depositor: from, AppId: appMappingID, @@ -32,20 +33,20 @@ func (m *MsgCreateLockerRequest) Type() string { func (m *MsgCreateLockerRequest) ValidateBasic() error { if m.Depositor == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.Depositor); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be zero") } return nil @@ -64,7 +65,7 @@ func (m *MsgCreateLockerRequest) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{from} } -func NewMsgDepositAssetRequest(from string, lockerID uint64, amount sdk.Int, assetID uint64, appMappingID uint64) *MsgDepositAssetRequest { +func NewMsgDepositAssetRequest(from string, lockerID uint64, amount sdkmath.Int, assetID uint64, appMappingID uint64) *MsgDepositAssetRequest { return &MsgDepositAssetRequest{ Depositor: from, LockerId: lockerID, @@ -84,23 +85,23 @@ func (m *MsgDepositAssetRequest) Type() string { func (m *MsgDepositAssetRequest) ValidateBasic() error { if m.Depositor == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.Depositor); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.LockerId <= 0 { - return errors.Wrap(ErrorInvalidLockerID, "lockerID cannot be negative") + return errorsmod.Wrap(ErrorInvalidLockerID, "lockerID cannot be negative") } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be zero") } return nil @@ -119,7 +120,7 @@ func (m *MsgDepositAssetRequest) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{from} } -func NewMsgWithdrawAssetRequest(from string, lockerID uint64, amount sdk.Int, assetID uint64, appMappingID uint64) *MsgWithdrawAssetRequest { +func NewMsgWithdrawAssetRequest(from string, lockerID uint64, amount sdkmath.Int, assetID uint64, appMappingID uint64) *MsgWithdrawAssetRequest { return &MsgWithdrawAssetRequest{ Depositor: from, LockerId: lockerID, @@ -139,23 +140,23 @@ func (m *MsgWithdrawAssetRequest) Type() string { func (m *MsgWithdrawAssetRequest) ValidateBasic() error { if m.Depositor == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.Depositor); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.LockerId <= 0 { - return errors.Wrap(ErrorInvalidLockerID, "lockerID cannot be negative") + return errorsmod.Wrap(ErrorInvalidLockerID, "lockerID cannot be negative") } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be zero") } return nil @@ -226,14 +227,14 @@ func (m *MsgCloseLockerRequest) Type() string { func (m *MsgCloseLockerRequest) ValidateBasic() error { if m.Depositor == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.Depositor); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.LockerId <= 0 { - return errors.Wrap(ErrorInvalidLockerID, "lockerID cannot be negative") + return errorsmod.Wrap(ErrorInvalidLockerID, "lockerID cannot be negative") } return nil @@ -270,14 +271,14 @@ func (m *MsgLockerRewardCalcRequest) Type() string { func (m *MsgLockerRewardCalcRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.LockerId <= 0 { - return errors.Wrap(ErrorInvalidLockerID, "lockerID cannot be negative") + return errorsmod.Wrap(ErrorInvalidLockerID, "lockerID cannot be negative") } return nil diff --git a/x/locker/types/params.go b/x/locker/types/params.go index 2ee22f4be..302085143 100644 --- a/x/locker/types/params.go +++ b/x/locker/types/params.go @@ -1,17 +1,17 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = (*Params)(nil) const ( - CreateLockerGas = sdk.Gas(32640) - DepositLockerGas = sdk.Gas(26688) - WithdrawLockerGas = sdk.Gas(26473) - CloseLockerGas = sdk.Gas(16473) + CreateLockerGas = storetypes.Gas(32640) + DepositLockerGas = storetypes.Gas(26688) + WithdrawLockerGas = storetypes.Gas(26473) + CloseLockerGas = storetypes.Gas(16473) ) // ParamKeyTable the param key table for launch module. diff --git a/x/locker/types/tx.pb.go b/x/locker/types/tx.pb.go index ecfa3f9e4..3942ab2fb 100644 --- a/x/locker/types/tx.pb.go +++ b/x/locker/types/tx.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -30,10 +30,10 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgCreateLockerRequest struct { - Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` - AssetId uint64 `protobuf:"varint,3,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` + AssetId uint64 `protobuf:"varint,3,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` } func (m *MsgCreateLockerRequest) Reset() { *m = MsgCreateLockerRequest{} } @@ -181,11 +181,11 @@ func (m *MsgAddWhiteListedAssetResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddWhiteListedAssetResponse proto.InternalMessageInfo type MsgDepositAssetRequest struct { - Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` - LockerId uint64 `protobuf:"varint,2,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` - AssetId uint64 `protobuf:"varint,4,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - AppId uint64 `protobuf:"varint,5,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` + LockerId uint64 `protobuf:"varint,2,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` + AssetId uint64 `protobuf:"varint,4,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + AppId uint64 `protobuf:"varint,5,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` } func (m *MsgDepositAssetRequest) Reset() { *m = MsgDepositAssetRequest{} } @@ -258,11 +258,11 @@ func (m *MsgDepositAssetResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositAssetResponse proto.InternalMessageInfo type MsgWithdrawAssetRequest struct { - Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` - LockerId uint64 `protobuf:"varint,2,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` - AssetId uint64 `protobuf:"varint,4,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - AppId uint64 `protobuf:"varint,5,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` + LockerId uint64 `protobuf:"varint,2,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` + AssetId uint64 `protobuf:"varint,4,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + AppId uint64 `protobuf:"varint,5,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` } func (m *MsgWithdrawAssetRequest) Reset() { *m = MsgWithdrawAssetRequest{} } @@ -503,47 +503,47 @@ func init() { func init() { proto.RegisterFile("comdex/locker/v1beta1/tx.proto", fileDescriptor_907169e28dc0306d) } var fileDescriptor_907169e28dc0306d = []byte{ - // 638 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xb5, 0x13, 0xb7, 0xb4, 0x8b, 0x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b, 0x76, 0xf7, 0x97, 0x2e, 0x7d, 0xe9, 0xe9, - 0x52, 0xb7, 0xa7, 0xcb, 0x57, 0x3d, 0x5d, 0xfe, 0xd9, 0xd3, 0xe5, 0x4f, 0x7d, 0x5d, 0xba, 0xea, - 0xeb, 0xd2, 0x75, 0x5f, 0x97, 0xde, 0xbe, 0xc8, 0x69, 0x5b, 0x12, 0xbf, 0x4e, 0x8e, 0x8f, 0x7d, - 0xd7, 0x77, 0xda, 0xe2, 0xbf, 0x35, 0x7c, 0x10, 0xa5, 0x4a, 0x77, 0xb4, 0x98, 0xbe, 0x6f, 0x5e, - 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x77, 0x5d, 0x53, 0x3d, 0x2e, 0x09, 0x00, 0x00, + // 632 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xbf, 0x6e, 0xd3, 0x40, + 0x18, 0xb7, 0x13, 0xb7, 0xb4, 0x87, 0xa0, 0xc5, 0x6d, 0x21, 0x18, 0xd5, 0xae, 0x8e, 0xa5, 0x03, + 0xb5, 0x49, 0xd9, 0xd8, 0xda, 0x22, 0xa4, 0x48, 0xcd, 0xe2, 0xa5, 0x12, 0x0b, 0xba, 0xe6, 0xae, + 0x8e, 0xd5, 0x38, 0x67, 0x7c, 0x17, 0xda, 0x4a, 0x3c, 0x04, 0x4f, 0x80, 0x04, 0x13, 0x8f, 0x12, + 0x89, 0xa5, 0x63, 0xc5, 0x60, 0x41, 0xb2, 0x33, 0xe4, 0x09, 0x90, 0x7d, 0xd7, 0xc4, 0x69, 0x9c, + 0xc8, 0x41, 0xed, 0xc6, 0x76, 0xbe, 0xef, 0xcf, 0xef, 0xfb, 0x7e, 0xdf, 0x1f, 0x1f, 0x30, 0x1b, + 0x34, 0xc0, 0xe4, 0xdc, 0x69, 0xd1, 0xc6, 0x29, 0x89, 0x9c, 0x8f, 0xd5, 0x63, 0xc2, 0x51, 0xd5, + 0xe1, 0xe7, 0x76, 0x18, 0x51, 0x4e, 0xf5, 0x0d, 0x21, 0xb7, 0x85, 0xdc, 0x96, 0x72, 0x63, 0xdd, + 0xa3, 0x1e, 0x4d, 0x35, 0x9c, 0xe4, 0x24, 0x94, 0xe1, 0x1f, 0x15, 0x3c, 0xae, 0x33, 0xef, 0x20, + 0x22, 0x88, 0x93, 0xc3, 0xd4, 0xc2, 0x25, 0x1f, 0x3a, 0x84, 0x71, 0x7d, 0x17, 0x2c, 0x63, 0x12, + 0x52, 0xe6, 0x73, 0x1a, 0x55, 0xd4, 0x2d, 0x75, 0x7b, 0x79, 0x7f, 0x7d, 0x10, 0x5b, 0xab, 0x17, + 0x28, 0x68, 0xbd, 0x86, 0x43, 0x11, 0x74, 0x47, 0x6a, 0xfa, 0x5b, 0xb0, 0x88, 0x02, 0xda, 0x69, + 0xf3, 0x4a, 0x29, 0x35, 0xb0, 0xbb, 0xb1, 0xa5, 0xfc, 0x8c, 0xad, 0x8d, 0x06, 0x65, 0x01, 0x65, + 0x0c, 0x9f, 0xda, 0x3e, 0x75, 0x02, 0xc4, 0x9b, 0x76, 0xad, 0xcd, 0x07, 0xb1, 0xf5, 0x40, 0x78, + 0x13, 0x46, 0xd0, 0x95, 0xd6, 0xba, 0x0d, 0x96, 0x10, 0x63, 0x84, 0xbf, 0xf7, 0x71, 0xa5, 0xbc, + 0xa5, 0x6e, 0x6b, 0xfb, 0x6b, 0x83, 0xd8, 0x5a, 0x91, 0xca, 0x52, 0x02, 0xdd, 0x7b, 0xe9, 0xb1, + 0x86, 0xf5, 0x6d, 0xb0, 0x88, 0xc2, 0x30, 0xd1, 0xd6, 0x52, 0xed, 0x47, 0x19, 0xd7, 0xe9, 0x3d, + 0x74, 0x17, 0x50, 0x18, 0xd6, 0x30, 0x7c, 0x0a, 0x9e, 0x4c, 0xe4, 0xcb, 0x42, 0xda, 0x66, 0x04, + 0x7e, 0x51, 0xc1, 0x66, 0x9d,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, 0xdf, 0xb1, 0x73, + 0x7f, 0x26, 0x76, 0xfe, 0x2f, 0xc3, 0xb0, 0x8b, 0xaa, 0x0b, 0x64, 0x89, 0x98, 0x1d, 0xc5, 0x59, + 0x88, 0x39, 0x5b, 0x6d, 0x16, 0x62, 0xde, 0x84, 0xeb, 0x0c, 0xac, 0xde, 0x6c, 0x5e, 0x7d, 0x86, + 0x8f, 0xbc, 0x4d, 0x60, 0x38, 0x85, 0xf5, 0x25, 0x68, 0x00, 0x1e, 0x8e, 0xb7, 0x8e, 0xfe, 0x62, + 0x06, 0x51, 0x13, 0xb3, 0x63, 0xec, 0x14, 0xd4, 0x96, 0x70, 0x9f, 0xc0, 0x5a, 0x4e, 0xb9, 0xf5, + 0xea, 0x74, 0x2f, 0x53, 0x5a, 0xd7, 0xd8, 0x9d, 0xc7, 0x44, 0xa0, 0xef, 0xbb, 0xdd, 0xdf, 0xa6, + 0xf2, 0xbd, 0x67, 0x2a, 0xdd, 0x9e, 0xa9, 0x5e, 0xf6, 0x4c, 0xf5, 0x57, 0xcf, 0x54, 0x3f, 0xf7, + 0x4d, 0xe5, 0xb2, 0x6f, 0x2a, 0x57, 0x7d, 0x53, 0x79, 0xf7, 0xd2, 0xf3, 0x79, 0xb3, 0x73, 0x9c, + 0xf8, 0x76, 0x84, 0xff, 0x1d, 0x7a, 0x72, 0xe2, 0x37, 0x7c, 0xd4, 0x92, 0xdf, 0xce, 0xf0, 0x75, + 0xc3, 0x2f, 0x42, 0xc2, 0x8e, 0x17, 0xd3, 0xc7, 0xca, 0xab, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x3d, 0xdd, 0x52, 0x26, 0xfb, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/market/abci.go b/x/market/abci.go index 4cfdfdc47..30817af35 100644 --- a/x/market/abci.go +++ b/x/market/abci.go @@ -6,12 +6,11 @@ import ( bandoraclemoduletypes "github.com/comdex-official/comdex/x/bandoracle/types" "github.com/comdex-official/comdex/x/market/keeper" "github.com/comdex-official/comdex/x/market/types" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" ) -func BeginBlocker(ctx sdk.Context, _ abci.RequestBeginBlock, k keeper.Keeper, bandKeeper bandkeeper.Keeper, assetKeeper assetkeeper.Keeper) { +func BeginBlocker(ctx sdk.Context, k keeper.Keeper, bandKeeper bandkeeper.Keeper, assetKeeper assetkeeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) if bandKeeper.GetOracleValidationResult(ctx) { diff --git a/x/market/expected/keeper.go b/x/market/expected/keeper.go index be4f42dda..4b83b4766 100644 --- a/x/market/expected/keeper.go +++ b/x/market/expected/keeper.go @@ -2,9 +2,9 @@ package expected import ( sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - // ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + // ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/bandoracle/types" diff --git a/x/market/handler.go b/x/market/handler.go index cd014088d..95ab08c25 100644 --- a/x/market/handler.go +++ b/x/market/handler.go @@ -1,18 +1,19 @@ package market import ( + errorsmod "cosmossdk.io/errors" + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" "github.com/comdex-official/comdex/x/market/keeper" "github.com/comdex-official/comdex/x/market/types" ) -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { return func(_ sdk.Context, msg sdk.Msg) (*sdk.Result, error) { switch msg := msg.(type) { default: - return nil, errors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) + return nil, errorsmod.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } } } diff --git a/x/market/keeper/keeper.go b/x/market/keeper/keeper.go index 4d9cf58db..b5fdab99a 100644 --- a/x/market/keeper/keeper.go +++ b/x/market/keeper/keeper.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + storetypes "cosmossdk.io/store/types" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/comdex-official/comdex/x/market/expected" ) @@ -30,6 +30,6 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, params paramstype } } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.key) } diff --git a/x/market/keeper/keeper_test.go b/x/market/keeper/keeper_test.go index 8bd245db8..7c6d07bce 100644 --- a/x/market/keeper/keeper_test.go +++ b/x/market/keeper/keeper_test.go @@ -2,20 +2,20 @@ package keeper import ( "fmt" - rewardtypes "github.com/comdex-official/comdex/x/rewards/types" "math" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" + rewardtypes "github.com/comdex-official/comdex/x/rewards/types" ) func TestFucn(t *testing.T) { var id uint64 var rate uint64 var Decimals int64 - var amt sdk.Int + var amt sdkmath.Int id = 5 - amt = sdk.NewInt(1230045678934223213) + amt = sdkmath.NewInt(1230045678934223213) if id == 1 { rate = 11632845 @@ -37,20 +37,20 @@ func TestFucn(t *testing.T) { rate = 1297119384 Decimals = 1000000000000000000 } - numerator := sdk.NewDecFromInt(amt).Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(rate))) - denominator := sdk.NewDecFromInt(sdk.NewIntFromUint64(uint64(Decimals))) + numerator := sdkmath.LegacyNewDecFromInt(amt).Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(rate))) + denominator := sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(uint64(Decimals))) result := numerator.Quo(denominator) fmt.Println("result ", result) fmt.Println("--------------") - newAmtwithDec := result.Quo(sdk.NewDecFromInt(sdk.NewIntFromUint64(1000000))) - finalAMount := newAmtwithDec.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(uint64(1000000)))) - test123 := sdk.Int(newAmtwithDec.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(uint64(1000000))))) + newAmtwithDec := result.Quo(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(1000000))) + finalAMount := newAmtwithDec.Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(uint64(1000000)))) + test123 := sdkmath.Int(newAmtwithDec.Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(uint64(1000000))))) fmt.Println("test123 ", test123) fmt.Println("truncate ", finalAMount.TruncateInt()) } func TestFucn1(t *testing.T) { - x := sdk.MustNewDecFromStr("128345678.4567432") + x := sdkmath.LegacyMustNewDecFromStr("128345678.4567432") fmt.Println("uint64 value", x.TruncateInt().Uint64()) } @@ -59,18 +59,18 @@ func TestFucn2(t *testing.T) { //arr = arr[:0] // arr = []int{} // arr = make([]int, 0) - lsr, _ := sdk.NewDecFromStr("0.001") - amount := sdk.NewInt(100000000) - yearsElapsed := sdk.NewDec(50).QuoInt64(rewardtypes.SecondsPerYear) + lsr, _ := sdkmath.LegacyNewDecFromStr("0.001") + amount := sdkmath.NewInt(100000000) + yearsElapsed := sdkmath.LegacyNewDec(50).QuoInt64(rewardtypes.SecondsPerYear) perc := lsr.String() - a, _ := sdk.NewDecFromStr("1") - b, _ := sdk.NewDecFromStr(perc) + a, _ := sdkmath.LegacyNewDecFromStr("1") + b, _ := sdkmath.LegacyNewDecFromStr(perc) factor1 := a.Add(b) intPerBlockFactor := math.Pow(factor1.MustFloat64(), yearsElapsed.MustFloat64()) intAccPerBlock := intPerBlockFactor - rewardtypes.Float64One - amtFloat := sdk.NewDecFromInt(amount).MustFloat64() + amtFloat := sdkmath.LegacyNewDecFromInt(amount).MustFloat64() newAmount := intAccPerBlock * amtFloat fmt.Println("yearsElapsed", yearsElapsed) @@ -83,7 +83,7 @@ func TestFucn2(t *testing.T) { } func TestFucn3(t *testing.T) { - x := sdk.NewInt(32606975564) - y := sdk.NewInt(2600633730) + x := sdkmath.NewInt(32606975564) + y := sdkmath.NewInt(2600633730) fmt.Println("answer", x.Sub(y)) } diff --git a/x/market/keeper/oracle.go b/x/market/keeper/oracle.go index ee21ca387..a98b2675f 100644 --- a/x/market/keeper/oracle.go +++ b/x/market/keeper/oracle.go @@ -3,6 +3,10 @@ package keeper import ( "strconv" + storetypes "cosmossdk.io/store/types" + + sdkmath "cosmossdk.io/math" + assetTypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/market/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -36,10 +40,10 @@ func (k Keeper) GetTwa(ctx sdk.Context, id uint64) (twa types.TimeWeightedAverag func (k Keeper) GetAllTwa(ctx sdk.Context) (twa []types.TimeWeightedAverage) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.TwaKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.TwaKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -155,16 +159,16 @@ func (k Keeper) GetLatestPrice(ctx sdk.Context, id uint64) (price uint64, err er return 0, types.ErrorPriceNotActive } -func (k Keeper) CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) { +func (k Keeper) CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) { asset, found := k.assetKeeper.GetAsset(ctx, id) if !found { - return sdk.ZeroDec(), assetTypes.ErrorAssetDoesNotExist + return sdkmath.LegacyZeroDec(), assetTypes.ErrorAssetDoesNotExist } twa, found := k.GetTwa(ctx, id) if found && twa.IsPriceActive { - numerator := sdk.NewDecFromInt(amt).Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(twa.Twa))) - denominator := sdk.NewDecFromInt(asset.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amt).Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(twa.Twa))) + denominator := sdkmath.LegacyNewDecFromInt(asset.Decimals) return numerator.Quo(denominator), nil } - return sdk.ZeroDec(), types.ErrorPriceNotActive + return sdkmath.LegacyZeroDec(), types.ErrorPriceNotActive } diff --git a/x/market/keeper/query_server.go b/x/market/keeper/query_server.go index b3d5d7f6e..fbaea94e6 100644 --- a/x/market/keeper/query_server.go +++ b/x/market/keeper/query_server.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" diff --git a/x/market/module.go b/x/market/module.go index 1cef4485e..cc00f663d 100644 --- a/x/market/module.go +++ b/x/market/module.go @@ -25,7 +25,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} ) type AppModuleBasic struct{ cdc codec.BinaryCodec } @@ -94,6 +93,12 @@ func (a AppModule) ConsensusVersion() uint64 { return 1 } +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + func (a AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, message json.RawMessage) []abcitypes.ValidatorUpdate { var state types.GenesisState cdc.MustUnmarshalJSON(message, &state) @@ -116,11 +121,11 @@ func (a AppModule) RegisterServices(configurator module.Configurator) { types.RegisterQueryServer(configurator.QueryServer(), keeper.NewQueryServer(a.keeper)) } -func (a AppModule) BeginBlock(ctx sdk.Context, req abcitypes.RequestBeginBlock) { - BeginBlocker(ctx, req, a.keeper, a.bandKeeper, a.assetKeeper) +func (a AppModule) BeginBlock(ctx sdk.Context) { + BeginBlocker(ctx, a.keeper, a.bandKeeper, a.assetKeeper) } -func (a AppModule) EndBlock(_ sdk.Context, _ abcitypes.RequestEndBlock) []abcitypes.ValidatorUpdate { +func (a AppModule) EndBlock(_ sdk.Context) []abcitypes.ValidatorUpdate { return nil } @@ -130,12 +135,6 @@ func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.Weigh return nil } -// func (a AppModule) RandomizedParams(_ *rand.Rand) []simulation.ParamChange { -// return nil -// } - -func (a AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - func (a AppModule) WeightedOperations(_ module.SimulationState) []simulation.WeightedOperation { return nil } diff --git a/x/market/types/errors.go b/x/market/types/errors.go index d3b6c9e87..54fac3c9e 100644 --- a/x/market/types/errors.go +++ b/x/market/types/errors.go @@ -1,11 +1,11 @@ package types import ( - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrorAssetDoesNotExist = errors.Register(ModuleName, 1001, "asset does not exist") - ErrorUnknownMsgType = errors.Register(ModuleName, 1002, "unknown message type") - ErrorPriceNotActive = errors.Register(ModuleName, 1003, "Price inactive") + ErrorAssetDoesNotExist = errorsmod.Register(ModuleName, 1001, "asset does not exist") + ErrorUnknownMsgType = errorsmod.Register(ModuleName, 1002, "unknown message type") + ErrorPriceNotActive = errorsmod.Register(ModuleName, 1003, "Price inactive") ) diff --git a/x/rewards/abci.go b/x/rewards/abci.go index 14d686756..b9d8e6a3d 100644 --- a/x/rewards/abci.go +++ b/x/rewards/abci.go @@ -1,7 +1,6 @@ package rewards import ( - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -10,7 +9,7 @@ import ( "github.com/comdex-official/comdex/x/rewards/types" ) -func BeginBlocker(ctx sdk.Context, _ abci.RequestBeginBlock, k keeper.Keeper) { +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { diff --git a/x/rewards/expected/keeper.go b/x/rewards/expected/keeper.go index 887d824b8..58d7f6596 100644 --- a/x/rewards/expected/keeper.go +++ b/x/rewards/expected/keeper.go @@ -1,9 +1,10 @@ package expected import ( + "context" + sdkmath "cosmossdk.io/math" lendtypes "github.com/comdex-official/comdex/x/lend/types" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" assettypes "github.com/comdex-official/comdex/x/asset/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" @@ -17,7 +18,7 @@ import ( // AccountKeeper defines the expected account keeper used for simulations (noalias). type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } @@ -28,9 +29,9 @@ type LiquidityKeeper interface { TransferFundsForSwapFeeDistribution(ctx sdk.Context, appID, poolID uint64) (sdk.Coin, error) GetActiveFarmer(ctx sdk.Context, appID, poolID uint64, farmer sdk.AccAddress) (activeFarmer liquiditytypes.ActiveFarmer, found bool) GetPoolTokenDesrializerKit(ctx sdk.Context, appID, poolID uint64) (liquiditytypes.PoolTokenDeserializerKit, error) - CalculateXYFromPoolCoin(ctx sdk.Context, deserializerKit liquiditytypes.PoolTokenDeserializerKit, poolCoin sdk.Coin) (sdk.Int, sdk.Int, error) + CalculateXYFromPoolCoin(ctx sdk.Context, deserializerKit liquiditytypes.PoolTokenDeserializerKit, poolCoin sdk.Coin) (sdkmath.Int, sdkmath.Int, error) GetQueuedFarmer(ctx sdk.Context, appID, poolID uint64, farmer sdk.AccAddress) (queuedFarmer liquiditytypes.QueuedFarmer, found bool) - GetAmountFarmedForAssetID(ctx sdk.Context, appID, assetID uint64, farmer sdk.AccAddress) (sdk.Int, error) + GetAmountFarmedForAssetID(ctx sdk.Context, appID, assetID uint64, farmer sdk.AccAddress) (sdkmath.Int, error) } type AssetKeeper interface { @@ -45,7 +46,7 @@ type AssetKeeper interface { } type MarketKeeper interface { - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) } @@ -67,18 +68,18 @@ type CollectorKeeper interface { GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup collectortypes.CollectorLookupTableData, found bool) GetAppToDenomsMapping(ctx sdk.Context, appID uint64) (appToDenom collectortypes.AppToDenomsMapping, found bool) GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData collectortypes.AppAssetIdToFeeCollectedData, found bool) - SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error - DecreaseNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) error + SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdkmath.Int) error + DecreaseNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, amount sdkmath.Int) error } type VaultKeeper interface { GetAppMappingData(ctx sdk.Context, appMappingID uint64) (appExtendedPairVaultData []vaulttypes.AppExtendedPairVaultMappingData, found bool) - CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdk.Int, amountOut sdk.Int) (sdk.Dec, error) + CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdkmath.Int, amountOut sdkmath.Int) (sdkmath.LegacyDec, error) GetVault(ctx sdk.Context, id uint64) (vault vaulttypes.Vault, found bool) DeleteVault(ctx sdk.Context, id uint64) UpdateAppExtendedPairVaultMappingDataOnMsgCreate(ctx sdk.Context, vaultData vaulttypes.Vault) - UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) DeleteUserVaultExtendedPairMapping(ctx sdk.Context, address string, appID uint64, pairVaultID uint64) DeleteAddressFromAppExtendedPairVaultMapping(ctx sdk.Context, extendedPairID uint64, userVaultID uint64, appMappingID uint64) SetVault(ctx sdk.Context, vault vaulttypes.Vault) @@ -92,18 +93,18 @@ type VaultKeeper interface { } type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, address sdk.AccAddress, name string, coins sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error SendCoinsFromModuleToModule( - ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins, + ctx context.Context, senderModule, recipientModule string, amt sdk.Coins, ) error - SpendableCoins(ctx sdk.Context, address sdk.AccAddress) sdk.Coins - GetSupply(ctx sdk.Context, denom string) sdk.Coin - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + SpendableCoins(ctx context.Context, address sdk.AccAddress) sdk.Coins + GetSupply(ctx context.Context, denom string) sdk.Coin + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } type EsmKeeper interface { @@ -117,5 +118,5 @@ type LendKeeper interface { GetAssetStatsByPoolIDAndAssetID(ctx sdk.Context, poolID, assetID uint64) (PoolAssetLBMapping lendtypes.PoolAssetLBMapping, found bool) GetLendPair(ctx sdk.Context, id uint64) (pair lendtypes.Extended_Pair, found bool) GetPool(ctx sdk.Context, id uint64) (pool lendtypes.Pool, found bool) - UserAssetLends(ctx sdk.Context, addr string, assetID uint64) (sdk.Int, bool) + UserAssetLends(ctx sdk.Context, addr string, assetID uint64) (sdkmath.Int, bool) } diff --git a/x/rewards/genesis_test.go b/x/rewards/genesis_test.go index 20546d6dc..c12228f6e 100644 --- a/x/rewards/genesis_test.go +++ b/x/rewards/genesis_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/comdex-official/comdex/app" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/comdex-official/comdex/x/rewards" "github.com/comdex-official/comdex/x/rewards/types" @@ -13,7 +12,7 @@ import ( func TestGenesis(t *testing.T) { comdexApp := app.Setup(t, false) - ctx := comdexApp.BaseApp.NewContext(false, tmproto.Header{}) + ctx := comdexApp.BaseApp.NewContext(false) genesisState := types.GenesisState{ Params: types.DefaultParams(), diff --git a/x/rewards/handler.go b/x/rewards/handler.go index 31e59e51e..826dd9224 100644 --- a/x/rewards/handler.go +++ b/x/rewards/handler.go @@ -3,6 +3,10 @@ package rewards import ( "fmt" + bam "github.com/cosmos/cosmos-sdk/baseapp" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -11,7 +15,7 @@ import ( ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) @@ -39,7 +43,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } diff --git a/x/rewards/keeper/distribution.go b/x/rewards/keeper/distribution.go index 47c4ea047..939554c23 100644 --- a/x/rewards/keeper/distribution.go +++ b/x/rewards/keeper/distribution.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "fmt" "time" @@ -63,7 +64,7 @@ func (k Keeper) BeginRewardDistributions( ) (sdk.Coin, error) { rewardDistributionData, err := k.GetRewardDistributionData(ctx, gauge, coinToDistribute, epochCount, epochDuration) if err != nil { - return sdk.NewCoin(coinToDistribute.Denom, sdk.NewInt(0)), err + return sdk.NewCoin(coinToDistribute.Denom, sdkmath.NewInt(0)), err } newDistributionInfo := types.DistributionInfo{ @@ -71,7 +72,7 @@ func (k Keeper) BeginRewardDistributions( Coins: []sdk.Coins{}, } - totalDistributionCoinsCalculated := sdk.NewCoin(coinToDistribute.Denom, sdk.NewInt(0)) + totalDistributionCoinsCalculated := sdk.NewCoin(coinToDistribute.Denom, sdkmath.NewInt(0)) for _, distrData := range rewardDistributionData { newDistributionInfo.Addresses = append(newDistributionInfo.Addresses, distrData.RewardReceiver) @@ -80,7 +81,7 @@ func (k Keeper) BeginRewardDistributions( } if totalDistributionCoinsCalculated.Amount.GT(coinToDistribute.Amount) { - return sdk.NewCoin(coinToDistribute.Denom, sdk.NewInt(0)), types.ErrInvalidCalculatedAMount + return sdk.NewCoin(coinToDistribute.Denom, sdkmath.NewInt(0)), types.ErrInvalidCalculatedAMount } k.doDistributionSends(ctx, gauge.GaugeTypeId, &newDistributionInfo) diff --git a/x/rewards/keeper/gauge.go b/x/rewards/keeper/gauge.go index e0a6f1577..21bc73518 100644 --- a/x/rewards/keeper/gauge.go +++ b/x/rewards/keeper/gauge.go @@ -4,8 +4,10 @@ import ( "fmt" "time" + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/comdex-official/comdex/x/rewards/types" ) @@ -32,7 +34,7 @@ func (k Keeper) ValidateMsgCreateGauge(ctx sdk.Context, msg *types.MsgCreateGaug return types.ErrInvalidDepositAmount } - if msg.DepositAmount.Amount.LT(sdk.NewIntFromUint64(msg.TotalTriggers)) { + if msg.DepositAmount.Amount.LT(sdkmath.NewIntFromUint64(msg.TotalTriggers)) { return types.ErrDepositSmallThanEpoch } @@ -59,13 +61,13 @@ func (k Keeper) OraclePrice(ctx sdk.Context, denom string) (uint64, bool) { func (k Keeper) ValidateIfOraclePricesExists(ctx sdk.Context, appID, pairID uint64) error { pair, found := k.liquidityKeeper.GetPair(ctx, appID, pairID) if !found { - return sdkerrors.Wrapf(types.ErrPairNotExists, "pair does not exists for given pool id") + return errorsmod.Wrapf(types.ErrPairNotExists, "pair does not exists for given pool id") } _, baseCoinPriceFound := k.OraclePrice(ctx, pair.BaseCoinDenom) _, quoteCoinPriceFound := k.OraclePrice(ctx, pair.QuoteCoinDenom) if !(baseCoinPriceFound || quoteCoinPriceFound) { - return sdkerrors.Wrapf(types.ErrPriceNotFound, "oracle price required for atleast %s or %s but not found", pair.QuoteCoinDenom, pair.BaseCoinDenom) + return errorsmod.Wrapf(types.ErrPriceNotFound, "oracle price required for atleast %s or %s but not found", pair.QuoteCoinDenom, pair.BaseCoinDenom) } return nil @@ -75,7 +77,7 @@ func (k Keeper) ValidateIfOraclePricesExists(ctx sdk.Context, appID, pairID uint func (k Keeper) ValidateMsgCreateGaugeLiquidityMetaData(ctx sdk.Context, appID uint64, kind *types.MsgCreateGauge_LiquidityMetaData, forSwapFee bool) error { _, found := k.asset.GetApp(ctx, appID) if !found { - return sdkerrors.Wrapf(types.ErrInvalidAppID, "app id %d not found", appID) + return errorsmod.Wrapf(types.ErrInvalidAppID, "app id %d not found", appID) } pool, found := k.liquidityKeeper.GetPool(ctx, appID, kind.LiquidityMetaData.PoolId) @@ -93,14 +95,14 @@ func (k Keeper) ValidateMsgCreateGaugeLiquidityMetaData(ctx sdk.Context, appID u childPoolIds := kind.LiquidityMetaData.ChildPoolIds for _, poolID := range childPoolIds { if poolID == kind.LiquidityMetaData.PoolId { - return sdkerrors.Wrap(types.ErrSamePoolID, fmt.Sprintf("pool id : %d", poolID)) + return errorsmod.Wrap(types.ErrSamePoolID, fmt.Sprintf("pool id : %d", poolID)) } pool, found := k.liquidityKeeper.GetPool(ctx, appID, poolID) if !found { - return sdkerrors.Wrap(types.ErrInvalidPoolID, fmt.Sprintf("invalid child pool id : %d", poolID)) + return errorsmod.Wrap(types.ErrInvalidPoolID, fmt.Sprintf("invalid child pool id : %d", poolID)) } if pool.Disabled { - return sdkerrors.Wrap(types.ErrDisabledPool, fmt.Sprintf("pool is disabled : %d", poolID)) + return errorsmod.Wrap(types.ErrDisabledPool, fmt.Sprintf("pool is disabled : %d", poolID)) } } @@ -119,7 +121,7 @@ func (k Keeper) NewGauge(ctx sdk.Context, msg *types.MsgCreateGauge, forSwapFee DepositAmount: msg.DepositAmount, TotalTriggers: msg.TotalTriggers, TriggeredCount: 0, - DistributedAmount: sdk.NewCoin(msg.DepositAmount.Denom, sdk.NewInt(0)), + DistributedAmount: sdk.NewCoin(msg.DepositAmount.Denom, sdkmath.NewInt(0)), IsActive: true, ForSwapFee: false, Kind: nil, @@ -170,7 +172,7 @@ func (k Keeper) GetUpdatedGaugeIdsByTriggerDurationObj(ctx sdk.Context, triggerD } if gaugeIDAlreadyExists { - return types.GaugeByTriggerDuration{}, sdkerrors.Wrapf(types.ErrInvalidGaugeID, "gauge id already exists in map : %d", newGaugeID) + return types.GaugeByTriggerDuration{}, errorsmod.Wrapf(types.ErrInvalidGaugeID, "gauge id already exists in map : %d", newGaugeID) } gaugeIdsByTriggerDuration.GaugeIds = append(gaugeIdsByTriggerDuration.GaugeIds, newGaugeID) return gaugeIdsByTriggerDuration, nil @@ -211,7 +213,7 @@ func (k Keeper) InitateGaugesForDuration(ctx sdk.Context, triggerDuration time.D logger := k.Logger(ctx) gaugesForDuration, found := k.GetGaugeIdsByTriggerDuration(ctx, triggerDuration) if !found { - return sdkerrors.Wrapf(types.ErrNoGaugeForDuration, "duration : %d", triggerDuration) + return errorsmod.Wrapf(types.ErrNoGaugeForDuration, "duration : %d", triggerDuration) } for _, gaugeID := range gaugesForDuration.GaugeIds { @@ -239,12 +241,12 @@ func (k Keeper) InitateGaugesForDuration(ctx sdk.Context, triggerDuration time.D availableDeposits := gauge.DepositAmount.Amount.Sub(gauge.DistributedAmount.Amount) // just in case (exception handelled), but this will never pass - if availableDeposits.LT(sdk.NewIntFromUint64(amountToDistribute)) { + if availableDeposits.LT(sdkmath.NewIntFromUint64(amountToDistribute)) { continue } ongoingEpochCount := gauge.TriggeredCount + 1 - coinToDistribute := sdk.NewCoin(gauge.DepositAmount.Denom, sdk.NewIntFromUint64(amountToDistribute)) + coinToDistribute := sdk.NewCoin(gauge.DepositAmount.Denom, sdkmath.NewIntFromUint64(amountToDistribute)) coinsDistributed, err := k.BeginRewardDistributions(ctx, gauge, coinToDistribute, ongoingEpochCount, triggerDuration) if err != nil { diff --git a/x/rewards/keeper/grpc_query.go b/x/rewards/keeper/grpc_query.go index a180bbf78..2cd945f98 100644 --- a/x/rewards/keeper/grpc_query.go +++ b/x/rewards/keeper/grpc_query.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" diff --git a/x/rewards/keeper/grpc_query_params_test.go b/x/rewards/keeper/grpc_query_params_test.go index fe4b324ab..eb0f36dce 100644 --- a/x/rewards/keeper/grpc_query_params_test.go +++ b/x/rewards/keeper/grpc_query_params_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/comdex-official/comdex/app" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/comdex-official/comdex/x/rewards/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -13,7 +12,7 @@ import ( func TestParamsQuery(t *testing.T) { comdexApp := app.Setup(t, false) - ctx := comdexApp.BaseApp.NewContext(false, tmproto.Header{}) + ctx := comdexApp.BaseApp.NewContext(false) wctx := sdk.WrapSDKContext(ctx) params := types.DefaultParams() diff --git a/x/rewards/keeper/iter.go b/x/rewards/keeper/iter.go index 37145f9fd..6aa314343 100644 --- a/x/rewards/keeper/iter.go +++ b/x/rewards/keeper/iter.go @@ -5,8 +5,11 @@ import ( "math" "strconv" + errorsmod "cosmossdk.io/errors" + + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" esmtypes "github.com/comdex-official/comdex/x/esm/types" "github.com/comdex-official/comdex/x/rewards/types" @@ -45,7 +48,7 @@ func (k Keeper) DistributeExtRewardLocker(ctx sdk.Context) error { totalShare := lockerLookup.DepositedAmount // initializing amountRewardedTracker to keep a track of daily rewards given to locker owners - amountRewardedTracker := sdk.NewCoin(v.TotalRewards.Denom, sdk.ZeroInt()) + amountRewardedTracker := sdk.NewCoin(v.TotalRewards.Denom, sdkmath.ZeroInt()) for _, lockerID := range lockerLookup.LockerIds { locker, found := k.locker.GetLocker(ctx, lockerID) if !found { @@ -58,16 +61,16 @@ func (k Keeper) DistributeExtRewardLocker(ctx sdk.Context) error { continue } } - userShare := (sdk.NewDecFromInt(locker.NetBalance)).Quo(sdk.NewDecFromInt(totalShare)) // getting share percentage - availableRewards := v.AvailableRewards // Available Rewards - Duration := v.DurationDays - int64(epoch.Count) // duration left (total duration - current count) + userShare := (sdkmath.LegacyNewDecFromInt(locker.NetBalance)).Quo(sdkmath.LegacyNewDecFromInt(totalShare)) // getting share percentage + availableRewards := v.AvailableRewards // Available Rewards + Duration := v.DurationDays - int64(epoch.Count) // duration left (total duration - current count) - epochRewards := sdk.NewDecFromInt(availableRewards.Amount).Quo(sdk.NewDec(Duration)) + epochRewards := sdkmath.LegacyNewDecFromInt(availableRewards.Amount).Quo(sdkmath.LegacyNewDec(Duration)) dailyRewards := userShare.Mul(epochRewards) user, _ := sdk.AccAddressFromBech32(locker.Depositor) finalDailyRewards := dailyRewards.TruncateInt() // after calculating final daily rewards, the amount is sent to the user - if finalDailyRewards.GT(sdk.ZeroInt()) { + if finalDailyRewards.GT(sdkmath.ZeroInt()) { amountRewardedTracker.Amount = amountRewardedTracker.Amount.Add(finalDailyRewards) err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, user, sdk.NewCoins(sdk.NewCoin(availableRewards.Denom, finalDailyRewards))) if err != nil { @@ -124,7 +127,7 @@ func (k Keeper) DistributeExtRewardVault(ctx sdk.Context) error { appExtPairVaultData, _ := k.vault.GetAppExtendedPairVaultMappingData(ctx, v.AppMappingId, v.ExtendedPairId) // initializing amountRewardedTracker to keep a track of daily rewards given to locker owners - amountRewardedTracker := sdk.NewCoin(v.TotalRewards.Denom, sdk.ZeroInt()) + amountRewardedTracker := sdk.NewCoin(v.TotalRewards.Denom, sdkmath.ZeroInt()) for _, vaultID := range appExtPairVaultData.VaultIds { totalRewards := v.AvailableRewards @@ -139,14 +142,14 @@ func (k Keeper) DistributeExtRewardVault(ctx sdk.Context) error { continue } } - individualUserShare := sdk.NewDecFromInt(userVault.AmountOut).Quo(sdk.NewDecFromInt(appExtPairVaultData.TokenMintedAmount)) // getting share percentage - Duration := v.DurationDays - int64(epoch.Count) // duration left (total duration - current count) - epochRewards := (sdk.NewDecFromInt(totalRewards.Amount)).Quo(sdk.NewDec(Duration)) + individualUserShare := sdkmath.LegacyNewDecFromInt(userVault.AmountOut).Quo(sdkmath.LegacyNewDecFromInt(appExtPairVaultData.TokenMintedAmount)) // getting share percentage + Duration := v.DurationDays - int64(epoch.Count) // duration left (total duration - current count) + epochRewards := (sdkmath.LegacyNewDecFromInt(totalRewards.Amount)).Quo(sdkmath.LegacyNewDec(Duration)) dailyRewards := individualUserShare.Mul(epochRewards) finalDailyRewards := dailyRewards.TruncateInt() user, _ := sdk.AccAddressFromBech32(userVault.Owner) - if finalDailyRewards.GT(sdk.ZeroInt()) { + if finalDailyRewards.GT(sdkmath.ZeroInt()) { amountRewardedTracker = amountRewardedTracker.Add(sdk.NewCoin(totalRewards.Denom, finalDailyRewards)) err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, user, sdk.NewCoins(sdk.NewCoin(totalRewards.Denom, finalDailyRewards))) if err != nil { @@ -177,61 +180,61 @@ func (k Keeper) DistributeExtRewardVault(ctx sdk.Context) error { // calculate new locker rewards func (k Keeper) CalculationOfRewards( ctx sdk.Context, - amount sdk.Int, lsr sdk.Dec, bTime int64, -) (sdk.Dec, error) { + amount sdkmath.Int, lsr sdkmath.LegacyDec, bTime int64, +) (sdkmath.LegacyDec, error) { currentTime := ctx.BlockTime().Unix() secondsElapsed := currentTime - bTime if secondsElapsed < types.Int64Zero { - return sdk.ZeroDec(), sdkerrors.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) + return sdkmath.LegacyZeroDec(), errorsmod.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) } //{(1+ Annual Interest Rate)^(No of seconds per block/No. of seconds in a year)}-1 - yearsElapsed := sdk.NewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) + yearsElapsed := sdkmath.LegacyNewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) perc := lsr.String() - a, _ := sdk.NewDecFromStr("1") - b, _ := sdk.NewDecFromStr(perc) + a, _ := sdkmath.LegacyNewDecFromStr("1") + b, _ := sdkmath.LegacyNewDecFromStr(perc) factor1 := a.Add(b) intPerBlockFactor := math.Pow(factor1.MustFloat64(), yearsElapsed.MustFloat64()) intAccPerBlock := intPerBlockFactor - types.Float64One - amtFloat := sdk.NewDecFromInt(amount).MustFloat64() + amtFloat := sdkmath.LegacyNewDecFromInt(amount).MustFloat64() newAmount := intAccPerBlock * amtFloat // s := fmt.Sprint(newAmount) s := strconv.FormatFloat(newAmount, 'f', 18, 64) - newAm, err := sdk.NewDecFromStr(s) + newAm, err := sdkmath.LegacyNewDecFromStr(s) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } return newAm, nil } -func (k Keeper) OraclePriceForRewards(ctx sdk.Context, id uint64, amt sdk.Int) (sdk.Dec, bool) { +func (k Keeper) OraclePriceForRewards(ctx sdk.Context, id uint64, amt sdkmath.Int) (sdkmath.LegacyDec, bool) { asset, found := k.asset.GetAsset(ctx, id) if !found { - return sdk.ZeroDec(), false + return sdkmath.LegacyZeroDec(), false } price, found := k.marketKeeper.GetTwa(ctx, asset.Id) if !found { - return sdk.ZeroDec(), false + return sdkmath.LegacyZeroDec(), false } // if price is not active and twa is 0 return false if !price.IsPriceActive && price.Twa <= 0 { - return sdk.ZeroDec(), false + return sdkmath.LegacyZeroDec(), false } - numerator := sdk.NewDecFromInt(amt).Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(price.Twa))) - denominator := sdk.NewDecFromInt(asset.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amt).Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(price.Twa))) + denominator := sdkmath.LegacyNewDecFromInt(asset.Decimals) return numerator.Quo(denominator), true } func (k Keeper) DistributeExtRewardLend(ctx sdk.Context) error { // Give external rewards to borrowers for opening a vault with specific assetID var addrArr []string - var amountArr []sdk.Dec - totalAmount := sdk.NewInt(0) + var amountArr []sdkmath.LegacyDec + totalAmount := sdkmath.NewInt(0) extRewards := k.GetExternalRewardLends(ctx) for _, v := range extRewards { klwsParams, _ := k.esm.GetKillSwitchData(ctx, v.AppMappingId) @@ -281,16 +284,16 @@ func (k Keeper) DistributeExtRewardLend(ctx sdk.Context) error { if !found { continue } - if totalAmount.LTE(sdk.ZeroInt()) { + if totalAmount.LTE(sdkmath.ZeroInt()) { continue } - dailyRewardAmt := totalRewardAmt.Quo(sdk.NewDec(v.DurationDays - int64(epoch.Count))) - totalAPR := dailyRewardAmt.Quo(sdk.NewDecFromInt(totalAmount)) - amountRewardedTracker := sdk.NewInt(0) + dailyRewardAmt := totalRewardAmt.Quo(sdkmath.LegacyNewDec(v.DurationDays - int64(epoch.Count))) + totalAPR := dailyRewardAmt.Quo(sdkmath.LegacyNewDecFromInt(totalAmount)) + amountRewardedTracker := sdkmath.NewInt(0) for i, borrower := range addrArr { user, _ := sdk.AccAddressFromBech32(borrower) finalDailyRewardsPerUser := amountArr[i].Mul(totalAPR) - if finalDailyRewardsPerUser.TruncateInt().GT(sdk.ZeroInt()) { + if finalDailyRewardsPerUser.TruncateInt().GT(sdkmath.ZeroInt()) { amountRewardedTracker = amountRewardedTracker.Add(finalDailyRewardsPerUser.TruncateInt()) err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, user, sdk.NewCoins(sdk.NewCoin(v.TotalRewards.Denom, finalDailyRewardsPerUser.TruncateInt()))) if err != nil { @@ -313,32 +316,32 @@ func (k Keeper) DistributeExtRewardLend(ctx sdk.Context) error { return nil } -func (k Keeper) CheckMinOfBorrowersLiquidityAndBorrow(ctx sdk.Context, addr sdk.AccAddress, masterPoolID int64, appID uint64, borrowAmount sdk.Dec) (sdk.Dec, bool) { +func (k Keeper) CheckMinOfBorrowersLiquidityAndBorrow(ctx sdk.Context, addr sdk.AccAddress, masterPoolID int64, appID uint64, borrowAmount sdkmath.LegacyDec) (sdkmath.LegacyDec, bool) { farmedCoin, found := k.liquidityKeeper.GetActiveFarmer(ctx, appID, uint64(masterPoolID), addr) if !found { - return sdk.ZeroDec(), false + return sdkmath.LegacyZeroDec(), false } deserializerKit, err := k.liquidityKeeper.GetPoolTokenDesrializerKit(ctx, appID, uint64(masterPoolID)) if err != nil { - return sdk.ZeroDec(), false + return sdkmath.LegacyZeroDec(), false } x, y, err := k.liquidityKeeper.CalculateXYFromPoolCoin(ctx, deserializerKit, farmedCoin.FarmedPoolCoin) if err != nil { - return sdk.ZeroDec(), false + return sdkmath.LegacyZeroDec(), false } quoteCoinAsset, _ := k.asset.GetAssetForDenom(ctx, deserializerKit.Pair.QuoteCoinDenom) baseCoinAsset, _ := k.asset.GetAssetForDenom(ctx, deserializerKit.Pair.BaseCoinDenom) priceQuoteCoin, found := k.OraclePriceForRewards(ctx, quoteCoinAsset.Id, x) if !found { - return sdk.ZeroDec(), false + return sdkmath.LegacyZeroDec(), false } priceBaseCoin, found := k.OraclePriceForRewards(ctx, baseCoinAsset.Id, y) if !found { - return sdk.ZeroDec(), false + return sdkmath.LegacyZeroDec(), false } - return sdk.MinDec(priceQuoteCoin.Add(priceBaseCoin), borrowAmount), true + return sdkmath.LegacyMinDec(priceQuoteCoin.Add(priceBaseCoin), borrowAmount), true } func (k Keeper) CombinePSMUserPositions(ctx sdk.Context) error { @@ -407,7 +410,7 @@ func (k Keeper) DistributeExtRewardStableVault(ctx sdk.Context) error { if et < timeNow { if epoch.Count < uint64(extRew.DurationDays) { // rewards will be given till the duration defined in the ext rewards // initializing amountRewardedTracker to keep a track of daily rewards given to stableVault users - amountRewardedTracker := sdk.NewCoin(extRew.TotalRewards.Denom, sdk.ZeroInt()) + amountRewardedTracker := sdk.NewCoin(extRew.TotalRewards.Denom, sdkmath.ZeroInt()) totalRewards := extRew.AvailableRewards // checking if the locker was not created just to claim the external rewards, so we apply a basic check here. @@ -424,27 +427,27 @@ func (k Keeper) DistributeExtRewardStableVault(ctx sdk.Context) error { userBalance := k.bank.GetBalance(ctx, user, asset.Denom) // userbal farmedAmount, err := k.liquidityKeeper.GetAmountFarmedForAssetID(ctx, extRew.CswapAppId, asset.Id, user) // cswap farm if err != nil { - farmedAmount = sdk.ZeroInt() + farmedAmount = sdkmath.ZeroInt() } lendAsset, found := k.lend.UserAssetLends(ctx, user.String(), asset.Id) // commodo lend pos if !found { - lendAsset = sdk.ZeroInt() + lendAsset = sdkmath.ZeroInt() } - lockerAmt := sdk.ZeroInt() + lockerAmt := sdkmath.ZeroInt() lockerLookupData, found := k.locker.GetUserLockerAssetMapping(ctx, user.String(), extRew.AppId, asset.Id) // locker data if found { lockerData, _ := k.locker.GetLocker(ctx, lockerLookupData.LockerId) lockerAmt = lockerData.NetBalance } - eligibleRewardAmt := sdk.ZeroInt() + eligibleRewardAmt := sdkmath.ZeroInt() if (userBalance.Amount.Add(farmedAmount).Add(lendAsset).Add(lockerAmt)).GTE(userReward.Amount) { eligibleRewardAmt = userReward.Amount } else { eligibleRewardAmt = userBalance.Amount.Add(farmedAmount).Add(lendAsset).Add(lockerAmt) } - totalMintedData := sdk.ZeroInt() + totalMintedData := sdkmath.ZeroInt() getAllExtpairData, _ := k.asset.GetPairsVaults(ctx) for _, stableExtPairData := range getAllExtpairData { if stableExtPairData.AppId == extRew.AppId && stableExtPairData.IsStableMintVault { @@ -453,13 +456,13 @@ func (k Keeper) DistributeExtRewardStableVault(ctx sdk.Context) error { } } - individualUserShare := sdk.NewDecFromInt(eligibleRewardAmt).Quo(sdk.NewDecFromInt(totalMintedData)) // getting share percentage - Duration := extRew.DurationDays - int64(epoch.Count) // duration left (total duration - current count) - epochRewards := (sdk.NewDecFromInt(totalRewards.Amount)).Quo(sdk.NewDec(Duration)) + individualUserShare := sdkmath.LegacyNewDecFromInt(eligibleRewardAmt).Quo(sdkmath.LegacyNewDecFromInt(totalMintedData)) // getting share percentage + Duration := extRew.DurationDays - int64(epoch.Count) // duration left (total duration - current count) + epochRewards := (sdkmath.LegacyNewDecFromInt(totalRewards.Amount)).Quo(sdkmath.LegacyNewDec(Duration)) dailyRewards := individualUserShare.Mul(epochRewards) finalDailyRewards := dailyRewards.TruncateInt() - if finalDailyRewards.GT(sdk.ZeroInt()) { + if finalDailyRewards.GT(sdkmath.ZeroInt()) { amountRewardedTracker = amountRewardedTracker.Add(sdk.NewCoin(totalRewards.Denom, finalDailyRewards)) err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, user, sdk.NewCoins(sdk.NewCoin(totalRewards.Denom, finalDailyRewards))) if err != nil { diff --git a/x/rewards/keeper/keeper.go b/x/rewards/keeper/keeper.go index c61efea71..7f5fe08f7 100644 --- a/x/rewards/keeper/keeper.go +++ b/x/rewards/keeper/keeper.go @@ -4,6 +4,8 @@ import ( "fmt" "time" + sdkmath "cosmossdk.io/math" + assettypes "github.com/comdex-official/comdex/x/asset/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" liquiditytypes "github.com/comdex-official/comdex/x/liquidity/types" @@ -11,10 +13,10 @@ import ( esmtypes "github.com/comdex-official/comdex/x/esm/types" "github.com/comdex-official/comdex/x/rewards/expected" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -115,7 +117,7 @@ func (k Keeper) WhitelistAppIDVault(ctx sdk.Context, appMappingID uint64) error return nil } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.storeKey) } @@ -393,9 +395,9 @@ func (k Keeper) ActExternalRewardsStableVaults( return nil } -func (k Keeper) ExtLendRewardsAPR(ctx sdk.Context, request *types.QueryExtLendRewardsAPRRequest) sdk.Dec { - totalAmount := sdk.NewInt(0) - totalAPR := sdk.NewDec(0) +func (k Keeper) ExtLendRewardsAPR(ctx sdk.Context, request *types.QueryExtLendRewardsAPRRequest) sdkmath.LegacyDec { + totalAmount := sdkmath.NewInt(0) + totalAPR := sdkmath.LegacyNewDec(0) id := uint64(0) extRews := k.GetExternalRewardLends(ctx) for _, data := range extRews { @@ -403,7 +405,7 @@ func (k Keeper) ExtLendRewardsAPR(ctx sdk.Context, request *types.QueryExtLendRe if dataAsset.AssetId[0] == request.AssetId && dataAsset.CPoolId == request.CPoolId { id = data.Id } else { - return sdk.NewDec(0) + return sdkmath.LegacyNewDec(0) } } v := k.GetExternalRewardLend(ctx, id) @@ -412,7 +414,7 @@ func (k Keeper) ExtLendRewardsAPR(ctx sdk.Context, request *types.QueryExtLendRe assetID := request.AssetId borrowByPoolIDAssetID, found := k.lend.GetAssetStatsByPoolIDAndAssetID(ctx, request.CPoolId, assetID) if !found { - return sdk.Dec{} + return sdkmath.LegacyDec{} } for _, borrowId := range borrowByPoolIDAssetID.BorrowIds { borrowPos, found := k.lend.GetBorrow(ctx, borrowId) @@ -436,18 +438,18 @@ func (k Keeper) ExtLendRewardsAPR(ctx sdk.Context, request *types.QueryExtLendRe } rewardAsset, found := k.asset.GetAssetForDenom(ctx, v.TotalRewards.Denom) if !found { - return sdk.NewDec(0) + return sdkmath.LegacyNewDec(0) } totalRewardAmt, found := k.OraclePriceForRewards(ctx, rewardAsset.Id, v.AvailableRewards.Amount) if !found { - return sdk.NewDec(0) + return sdkmath.LegacyNewDec(0) } - if totalAmount.LTE(sdk.ZeroInt()) { - return sdk.NewDec(0) + if totalAmount.LTE(sdkmath.ZeroInt()) { + return sdkmath.LegacyNewDec(0) } - dailyRewardAmt := totalRewardAmt.Quo(sdk.NewDec(v.DurationDays - int64(epoch.Count))) - str, _ := sdk.NewDecFromStr(types.DaysInYear) - APR := dailyRewardAmt.Quo(sdk.NewDecFromInt(totalAmount)) + dailyRewardAmt := totalRewardAmt.Quo(sdkmath.LegacyNewDec(v.DurationDays - int64(epoch.Count))) + str, _ := sdkmath.LegacyNewDecFromStr(types.DaysInYear) + APR := dailyRewardAmt.Quo(sdkmath.LegacyNewDecFromInt(totalAmount)) totalAPR = APR.Mul(str) return totalAPR diff --git a/x/rewards/keeper/keeper_test.go b/x/rewards/keeper/keeper_test.go index 25105b063..2f88c061a 100644 --- a/x/rewards/keeper/keeper_test.go +++ b/x/rewards/keeper/keeper_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "encoding/binary" "strings" "testing" @@ -19,7 +20,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -49,7 +49,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.assetKeeper = s.app.AssetKeeper s.lockerKeeper = s.app.LockerKeeper s.querier = rewardsKeeper.QueryServer{Keeper: s.rewardsKeeper} @@ -103,7 +103,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: strings.ToLower(appName), ShortName: strings.ToLower(appName), - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -128,7 +128,7 @@ func (s *KeeperTestSuite) CreateNewAsset(name, denom string, price uint64) asset err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, }) @@ -172,15 +172,15 @@ func (s *KeeperTestSuite) CreateNewExtendedVaultPair( err := s.app.AssetKeeper.WasmAddExtendedPairsVaultRecords(s.ctx, &bindings.MsgAddExtendedPairsVault{ AppID: appMappingID, PairID: pairID, - StabilityFee: sdk.NewDecWithPrec(2, 2), // 0.02 - ClosingFee: sdk.NewDec(0), - LiquidationPenalty: sdk.NewDecWithPrec(15, 2), // 0.15 - DrawDownFee: sdk.NewDecWithPrec(1, 2), // 0.01 + StabilityFee: sdkmath.LegacyNewDecWithPrec(2, 2), // 0.02 + ClosingFee: sdkmath.LegacyNewDec(0), + LiquidationPenalty: sdkmath.LegacyNewDecWithPrec(15, 2), // 0.15 + DrawDownFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 0.01 IsVaultActive: isVaultActive, - DebtCeiling: sdk.NewInt(1000000000000000000), - DebtFloor: sdk.NewInt(100000000), + DebtCeiling: sdkmath.NewInt(1000000000000000000), + DebtFloor: sdkmath.NewInt(100000000), IsStableMintVault: isStableMintVault, - MinCr: sdk.NewDecWithPrec(23, 1), // 2.3 + MinCr: sdkmath.LegacyNewDecWithPrec(23, 1), // 2.3 PairName: pairName, AssetOutOraclePrice: true, AssetOutPrice: 1000000, diff --git a/x/rewards/keeper/migrate.go b/x/rewards/keeper/migrate.go index b8c527d9e..d8faed81b 100644 --- a/x/rewards/keeper/migrate.go +++ b/x/rewards/keeper/migrate.go @@ -1,9 +1,9 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/rewards/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -33,7 +33,7 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar return err } -func MigrateExternalRewardLends(store sdk.KVStore, cdc codec.BinaryCodec) error { +func MigrateExternalRewardLends(store storetypes.KVStore, cdc codec.BinaryCodec) error { key := types.ExternalRewardsLendMappingKey(3) value := store.Get(key) var extRew types.LendExternalRewards @@ -45,7 +45,7 @@ func MigrateExternalRewardLends(store sdk.KVStore, cdc codec.BinaryCodec) error return nil } -func SetExternalRewardLends(store sdk.KVStore, cdc codec.BinaryCodec, extRew types.LendExternalRewards) { +func SetExternalRewardLends(store storetypes.KVStore, cdc codec.BinaryCodec, extRew types.LendExternalRewards) { var ( key = types.ExternalRewardsLendMappingKey(extRew.AppMappingId) value = cdc.MustMarshal(&extRew) diff --git a/x/rewards/keeper/msg_server_test.go b/x/rewards/keeper/msg_server_test.go index f640fafb4..6160ee76d 100644 --- a/x/rewards/keeper/msg_server_test.go +++ b/x/rewards/keeper/msg_server_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "fmt" "time" @@ -18,7 +19,6 @@ import ( "github.com/comdex-official/comdex/x/rewards/types" vaultkeeper "github.com/comdex-official/comdex/x/vault/keeper" vaulttypes "github.com/comdex-official/comdex/x/vault/types" - abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -27,7 +27,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err := assetKeeper.AddAppRecords(*ctx, msg1) @@ -36,7 +36,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg2a := assetTypes.AppData{ Name: "harbor", ShortName: "hbr", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg2a) @@ -45,7 +45,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg2 := assetTypes.AppData{ Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg2) @@ -54,7 +54,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg3 := assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -76,7 +76,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg4 := assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -98,7 +98,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg5 := assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg5) @@ -117,8 +117,8 @@ func (s *KeeperTestSuite) AddAppAsset() { s.Suite.NoError(err) } -func Dec(s string) sdk.Dec { - dec, err := sdk.NewDecFromStr(s) +func Dec(s string) sdkmath.LegacyDec { + dec, err := sdkmath.LegacyNewDecFromStr(s) if err != nil { panic(err) } @@ -131,7 +131,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err := assetKeeper.AddAppRecords(*ctx, msg1) @@ -140,7 +140,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg2 := assetTypes.AppData{ Name: "harbor", ShortName: "harbor", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg2) @@ -148,7 +148,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg3 := assetTypes.AppData{ Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, } err = assetKeeper.AddAppRecords(*ctx, msg3) @@ -157,7 +157,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg4 := assetTypes.Asset{ Name: "ATOM", Denom: "uatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -179,7 +179,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg5 := assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -201,7 +201,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg6 := assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsCdpMintable: true, } @@ -223,7 +223,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg7 := assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg7) @@ -244,7 +244,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg11 := assetTypes.Asset{ Name: "CATOM", Denom: "ucatom", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg11) @@ -253,7 +253,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg12 := assetTypes.Asset{ Name: "CCMDX", Denom: "uccmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg12) @@ -262,7 +262,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { msg13 := assetTypes.Asset{ Name: "CCMST", Denom: "uccmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg13) @@ -330,17 +330,17 @@ func (s *KeeperTestSuite) AddAppAssetLend() { assetDataPoolOneAssetOne := &lendtypes.AssetDataPoolMapping{ AssetID: 1, AssetTransitType: 3, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataPoolOneAssetTwo := &lendtypes.AssetDataPoolMapping{ AssetID: 2, AssetTransitType: 1, - SupplyCap: sdk.NewDec(1000000000000), + SupplyCap: sdkmath.LegacyNewDec(1000000000000), } assetDataPoolOneAssetThree := &lendtypes.AssetDataPoolMapping{ AssetID: 3, AssetTransitType: 2, - SupplyCap: sdk.NewDec(5000000000000), + SupplyCap: sdkmath.LegacyNewDec(5000000000000), } assetDataCMDXPool = append(assetDataCMDXPool, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) @@ -446,7 +446,7 @@ func (s *KeeperTestSuite) AddAppAssetLend() { AuctionDurationSeconds: 21600, Buffer: Dec("1.2"), Cusp: Dec("0.7"), - Step: sdk.NewInt(360), + Step: sdkmath.NewInt(360), PriceFunctionType: 1, DutchId: 3, BidDurationSeconds: 3600, @@ -457,16 +457,16 @@ func (s *KeeperTestSuite) AddAppAssetLend() { } userAddress := "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t" - s.fundAddr(userAddress, sdk.NewCoin("uatom", sdk.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 1, userAddress, sdk.NewCoin("uatom", sdk.NewInt(100000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(100000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 1, userAddress, sdk.NewCoin("uatom", sdkmath.NewInt(100000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(100000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 2, userAddress, sdk.NewCoin("ucmdx", sdk.NewInt(1000000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 2, userAddress, sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000000000))) s.Require().NoError(err) - s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdk.NewIntFromUint64(100000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdkmath.NewIntFromUint64(100000000000000))) - err = lendKeeper.FundModAcc(s.ctx, 1, 3, userAddress, sdk.NewCoin("ucmst", sdk.NewInt(100000000000))) + err = lendKeeper.FundModAcc(s.ctx, 1, 3, userAddress, sdk.NewCoin("ucmst", sdkmath.NewInt(100000000000))) s.Require().NoError(err) lendKeeper, ctx = &s.lendKeeper, &s.ctx @@ -476,28 +476,28 @@ func (s *KeeperTestSuite) AddAppAssetLend() { Lender: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", AssetId: 1, PoolId: 1, - AmountIn: sdk.NewCoin("uatom", sdk.NewInt(100000000000)), + AmountIn: sdk.NewCoin("uatom", sdkmath.NewInt(100000000000)), PairId: 3, IsStableBorrow: false, - AmountOut: sdk.NewCoin("ucmdx", sdk.NewInt(1000000000)), + AmountOut: sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000000)), AppId: 3, } - s.fundAddr(userAddress, sdk.NewCoin("uatom", sdk.NewIntFromUint64(1000000000000))) + s.fundAddr(userAddress, sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(1000000000000))) _, err = server.BorrowAlternate(sdk.WrapSDKContext(*ctx), &msg20) s.Require().NoError(err) msg30 := lendtypes.MsgBorrowAlternate{ Lender: "cosmos1kwtdrjkwu6y87vlylaeatzmc5p4jhvn7qwqnkp", AssetId: 1, PoolId: 1, - AmountIn: sdk.NewCoin("uatom", sdk.NewInt(100000000000)), + AmountIn: sdk.NewCoin("uatom", sdkmath.NewInt(100000000000)), PairId: 3, IsStableBorrow: false, - AmountOut: sdk.NewCoin("ucmdx", sdk.NewInt(1000000000)), + AmountOut: sdk.NewCoin("ucmdx", sdkmath.NewInt(1000000000)), AppId: 3, } - s.fundAddr("cosmos1kwtdrjkwu6y87vlylaeatzmc5p4jhvn7qwqnkp", sdk.NewCoin("uatom", sdk.NewIntFromUint64(1000000000000))) + s.fundAddr("cosmos1kwtdrjkwu6y87vlylaeatzmc5p4jhvn7qwqnkp", sdk.NewCoin("uatom", sdkmath.NewIntFromUint64(1000000000000))) _, err = server.BorrowAlternate(sdk.WrapSDKContext(*ctx), &msg30) s.Require().NoError(err) } @@ -508,12 +508,12 @@ func (s *KeeperTestSuite) AddCollectorLookupTable() { AppID: 1, CollectorAssetID: 1, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), } err := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &msg1) s.Require().NoError(err) @@ -522,12 +522,12 @@ func (s *KeeperTestSuite) AddCollectorLookupTable() { AppID: 1, CollectorAssetID: 2, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), } err1 := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &msg2) s.Require().NoError(err1) @@ -536,12 +536,12 @@ func (s *KeeperTestSuite) AddCollectorLookupTable() { AppID: 2, CollectorAssetID: 1, SecondaryAssetID: 3, - SurplusThreshold: sdk.NewInt(10000000), - DebtThreshold: sdk.NewInt(5000000), - LockerSavingRate: sdk.MustNewDecFromStr("0.1"), - LotSize: sdk.NewInt(2000000), - BidFactor: sdk.MustNewDecFromStr("0.01"), - DebtLotSize: sdk.NewInt(2000000), + SurplusThreshold: sdkmath.NewInt(10000000), + DebtThreshold: sdkmath.NewInt(5000000), + LockerSavingRate: sdkmath.LegacyMustNewDecFromStr("0.1"), + LotSize: sdkmath.NewInt(2000000), + BidFactor: sdkmath.LegacyMustNewDecFromStr("0.01"), + DebtLotSize: sdkmath.NewInt(2000000), } err2 := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &msg3) s.Require().NoError(err2) @@ -591,12 +591,12 @@ func (s *KeeperTestSuite) TestCreateLocker() { } msg2 := lockertypes.MsgCreateLockerRequest{ Depositor: userAddress, - Amount: sdk.NewInt(1000000000), + Amount: sdkmath.NewInt(1000000000), AssetId: 1, AppId: 1, } - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(1000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(1000000000))) _, err := server.MsgCreateLocker(sdk.WrapSDKContext(*ctx), &msg2) s.Require().NoError(err) } @@ -605,7 +605,7 @@ func (s *KeeperTestSuite) TestCreateExtRewardsLocker() { s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-01T12:00:00Z")) s.ctx = s.ctx.WithBlockHeight(10) userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" - amt, _ := sdk.NewIntFromString("1000000000000000000000") + amt, _ := sdkmath.NewIntFromString("1000000000000000000000") s.fundAddr(userAddress, sdk.NewCoin("weth", amt)) s.TestCreateLocker() @@ -646,13 +646,12 @@ func (s *KeeperTestSuite) TestCreateExtRewardsLocker() { } s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-02T12:10:00Z")) s.ctx = s.ctx.WithBlockHeight(11) - req := abci.RequestBeginBlock{} - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) fmt.Println("bal at first day", availableBalances) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-03T12:11:00Z")) s.ctx = s.ctx.WithBlockHeight(12) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances = s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) fmt.Println("bal at second day", availableBalances) } @@ -677,11 +676,11 @@ func (s *KeeperTestSuite) TestCreateVault() { From: userAddress, AppId: 2, ExtendedPairVaultId: extendedVaultPairID1, - AmountIn: sdk.NewInt(1000000000), - AmountOut: sdk.NewInt(200000000), + AmountIn: sdkmath.NewInt(1000000000), + AmountOut: sdkmath.NewInt(200000000), } - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(1000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(1000000000))) _, err := server.MsgCreate(sdk.WrapSDKContext(*ctx), &msg2) s.Require().NoError(err) @@ -689,11 +688,11 @@ func (s *KeeperTestSuite) TestCreateVault() { From: userAddress1, AppId: 2, ExtendedPairVaultId: extendedVaultPairID1, - AmountIn: sdk.NewInt(1000000000), - AmountOut: sdk.NewInt(100000000), + AmountIn: sdkmath.NewInt(1000000000), + AmountOut: sdkmath.NewInt(100000000), } - s.fundAddr(userAddress1, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(1000000000))) + s.fundAddr(userAddress1, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(1000000000))) _, err = server.MsgCreate(sdk.WrapSDKContext(*ctx), &msg3) s.Require().NoError(err) } @@ -702,7 +701,7 @@ func (s *KeeperTestSuite) TestCreateExtRewardsVault() { s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-01T12:00:00Z")) s.ctx = s.ctx.WithBlockHeight(10) userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" - amt, _ := sdk.NewIntFromString("1000000000000000000000") + amt, _ := sdkmath.NewIntFromString("1000000000000000000000") s.fundAddr(userAddress, sdk.NewCoin("btc", amt)) s.TestCreateVault() @@ -744,18 +743,17 @@ func (s *KeeperTestSuite) TestCreateExtRewardsVault() { userAddress1 := "cosmos1kwtdrjkwu6y87vlylaeatzmc5p4jhvn7qwqnkp" s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-02T12:10:00Z")) s.ctx = s.ctx.WithBlockHeight(11) - req := abci.RequestBeginBlock{} - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) fmt.Println("bal at first day", availableBalances) availableBalances1 := s.getBalances(sdk.MustAccAddressFromBech32(userAddress1)) fmt.Println("bal at first day second user", availableBalances1) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-03T12:11:00Z")) s.ctx = s.ctx.WithBlockHeight(12) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances = s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) fmt.Println("bal at second day", availableBalances) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances1 = s.getBalances(sdk.MustAccAddressFromBech32(userAddress1)) fmt.Println("bal at second day second user", availableBalances1) } @@ -767,7 +765,7 @@ func (s *KeeperTestSuite) TestCreateExtRewardsLend() { s.TestFarmSetup() rewardsKeeper, ctx := &s.rewardsKeeper, &s.ctx server := keeper.NewMsgServerImpl(*rewardsKeeper) - s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdk.NewInt(1234567890))) + s.fundAddr(userAddress, sdk.NewCoin("ucmst", sdkmath.NewInt(1234567890))) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) fmt.Println("bal at t0 ", availableBalances) @@ -785,7 +783,7 @@ func (s *KeeperTestSuite) TestCreateExtRewardsLend() { AssetId: []uint64{2}, CSwapAppId: 1, CSwapMinLockAmount: 100000000, - TotalRewards: sdk.NewCoin("ucmst", sdk.NewInt(1234567890)), + TotalRewards: sdk.NewCoin("ucmst", sdkmath.NewInt(1234567890)), MasterPoolId: 1, DurationDays: 3, MinLockupTimeSeconds: 1, @@ -816,8 +814,7 @@ func (s *KeeperTestSuite) TestCreateExtRewardsLend() { s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-03T12:10:10Z")) s.ctx = s.ctx.WithBlockHeight(11) - req := abci.RequestBeginBlock{} - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances = s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) availableBalances2 := s.getBalances(sdk.MustAccAddressFromBech32(userAddress2)) fmt.Println("bal at first day", availableBalances, availableBalances2) @@ -825,29 +822,29 @@ func (s *KeeperTestSuite) TestCreateExtRewardsLend() { s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-04T12:11:00Z")) s.ctx = s.ctx.WithBlockHeight(12) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances = s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) availableBalances2 = s.getBalances(sdk.MustAccAddressFromBech32(userAddress2)) fmt.Println("bal at second day", availableBalances, availableBalances2) fmt.Println("rewQuery", rewQuery) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-05T12:12:00Z")) s.ctx = s.ctx.WithBlockHeight(15) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances = s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) availableBalances2 = s.getBalances(sdk.MustAccAddressFromBech32(userAddress2)) fmt.Println("bal at third day", availableBalances, availableBalances2) fmt.Println("rewQuery", rewQuery) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-06T12:15:00Z")) s.ctx = s.ctx.WithBlockHeight(15) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances = s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) availableBalances2 = s.getBalances(sdk.MustAccAddressFromBech32(userAddress2)) fmt.Println("bal at fourth day", availableBalances, availableBalances2) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-07T12:17:00Z")) s.ctx = s.ctx.WithBlockHeight(16) availableBalances = s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) @@ -898,7 +895,7 @@ func (s *KeeperTestSuite) TestCreateExtRewardsStableVault() { s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-01T12:00:00Z")) s.ctx = s.ctx.WithBlockHeight(5) userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" - amt, _ := sdk.NewIntFromString("100000000000") + amt, _ := sdkmath.NewIntFromString("100000000000") s.fundAddr(userAddress, sdk.NewCoin("cmdx", amt)) s.TestCreateVault() @@ -949,9 +946,9 @@ func (s *KeeperTestSuite) TestCreateExtRewardsStableVault() { From: userAddress1, AppId: 2, ExtendedPairVaultId: 2, - Amount: sdk.NewInt(1000000000), + Amount: sdkmath.NewInt(1000000000), } - s.fundAddr(userAddress1, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(1000000000))) + s.fundAddr(userAddress1, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(1000000000))) _, err := vaultServer.MsgCreateStableMint(sdk.WrapSDKContext(*ctx), &msg4) s.Require().NoError(err) @@ -959,25 +956,24 @@ func (s *KeeperTestSuite) TestCreateExtRewardsStableVault() { From: userAddress, AppId: 2, ExtendedPairVaultId: 2, - Amount: sdk.NewInt(1000000000), + Amount: sdkmath.NewInt(1000000000), StableVaultId: 1, } - s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdk.NewIntFromUint64(1000000000))) + s.fundAddr(userAddress, sdk.NewCoin("ucmdx", sdkmath.NewIntFromUint64(1000000000))) _, err = vaultServer.MsgDepositStableMint(sdk.WrapSDKContext(*ctx), &msg5) s.Require().NoError(err) - req := abci.RequestBeginBlock{} - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) fmt.Println("bal at first day", availableBalances) availableBalances1 := s.getBalances(sdk.MustAccAddressFromBech32(userAddress1)) fmt.Println("bal at first day second user", availableBalances1) s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2022-03-03T12:11:00Z")) s.ctx = s.ctx.WithBlockHeight(120) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances = s.getBalances(sdk.MustAccAddressFromBech32(userAddress)) fmt.Println("bal at second day", availableBalances) - rewards.BeginBlocker(*ctx, req, *rewardsKeeper) + rewards.BeginBlocker(*ctx, *rewardsKeeper) availableBalances1 = s.getBalances(sdk.MustAccAddressFromBech32(userAddress1)) fmt.Println("bal at second day second user", availableBalances1) } diff --git a/x/rewards/keeper/params_test.go b/x/rewards/keeper/params_test.go index ecc84f5a5..f48a77a36 100644 --- a/x/rewards/keeper/params_test.go +++ b/x/rewards/keeper/params_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/comdex-official/comdex/app" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/comdex-official/comdex/x/rewards/types" "github.com/stretchr/testify/require" @@ -12,7 +11,7 @@ import ( func TestGetParams(t *testing.T) { comdexApp := app.Setup(t, false) - ctx := comdexApp.BaseApp.NewContext(false, tmproto.Header{}) + ctx := comdexApp.BaseApp.NewContext(false) params := types.DefaultParams() diff --git a/x/rewards/keeper/rewards.go b/x/rewards/keeper/rewards.go index d1f38b341..00055e2ed 100644 --- a/x/rewards/keeper/rewards.go +++ b/x/rewards/keeper/rewards.go @@ -1,6 +1,8 @@ package keeper import ( + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -50,10 +52,10 @@ func (k Keeper) GetRewardByApp(ctx sdk.Context, appID uint64) (rewards []types.I var ( store = k.Store(ctx) key = types.RewardsKeyByApp(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -74,10 +76,10 @@ func (k Keeper) GetRewardByApp(ctx sdk.Context, appID uint64) (rewards []types.I func (k Keeper) GetRewards(ctx sdk.Context) (lends []types.InternalRewards) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.RewardsKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.RewardsKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -127,10 +129,10 @@ func (k Keeper) GetAppIDByApp(ctx sdk.Context, appID uint64) (uint64, bool) { func (k Keeper) GetAppIDs(ctx sdk.Context) (appIds []uint64) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AppIdsVaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AppIdsVaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -179,10 +181,10 @@ func (k Keeper) GetExternalRewardsLocker(ctx sdk.Context, id uint64) (LockerExte func (k Keeper) GetExternalRewardsLockers(ctx sdk.Context) (LockerExternalRewards []types.LockerExternalRewards) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.ExternalRewardsLockerKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.ExternalRewardsLockerKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -319,10 +321,10 @@ func (k Keeper) GetExternalRewardsVaultID(ctx sdk.Context) uint64 { func (k Keeper) GetExternalRewardVaults(ctx sdk.Context) (VaultExternalRewards []types.VaultExternalRewards) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.ExternalRewardsVaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.ExternalRewardsVaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -461,10 +463,10 @@ func (k Keeper) GetLockerRewardTracker(ctx sdk.Context, id, appID uint64) (rewar func (k Keeper) GetAllLockerRewardTracker(ctx sdk.Context) (Lockrewards []types.LockerRewardsTracker) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.LockerRewardsTrackerKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.LockerRewardsTrackerKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -516,10 +518,10 @@ func (k Keeper) GetVaultInterestTracker(ctx sdk.Context, id, appID uint64) (vaul func (k Keeper) GetAllVaultInterestTracker(ctx sdk.Context) (Vaultrewards []types.VaultInterestTracker) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.VaultInterestTrackerKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.VaultInterestTrackerKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -535,7 +537,7 @@ func (k Keeper) GetAllVaultInterestTracker(ctx sdk.Context) (Vaultrewards []type return Vaultrewards } -func (k Keeper) CalculateLockerRewards(ctx sdk.Context, appID, assetID, lockerID uint64, Depositor string, NetBalance sdk.Int, blockHeight int64, lockerBlockTime int64) error { +func (k Keeper) CalculateLockerRewards(ctx sdk.Context, appID, assetID, lockerID uint64, Depositor string, NetBalance sdkmath.Int, blockHeight int64, lockerBlockTime int64) error { _, found := k.GetReward(ctx, appID, assetID) if !found { return nil @@ -546,7 +548,7 @@ func (k Keeper) CalculateLockerRewards(ctx sdk.Context, appID, assetID, lockerID if !found { return collectortypes.ErrorAssetDoesNotExist } - var rewards sdk.Dec + var rewards sdkmath.LegacyDec var err error collectorBTime := collectorLookup.BlockTime.Unix() if collectorLookup.LockerSavingRate.IsZero() { @@ -577,10 +579,10 @@ func (k Keeper) CalculateLockerRewards(ctx sdk.Context, appID, assetID, lockerID lockerRewardsTracker.RewardsAccumulated = lockerRewardsTracker.RewardsAccumulated.Add(rewards) } - if lockerRewardsTracker.RewardsAccumulated.GTE(sdk.OneDec()) { + if lockerRewardsTracker.RewardsAccumulated.GTE(sdkmath.LegacyOneDec()) { // send rewards newReward := lockerRewardsTracker.RewardsAccumulated.TruncateInt() - newRewardDec := sdk.NewDecFromInt(newReward) + newRewardDec := sdkmath.LegacyNewDecFromInt(newReward) lockerRewardsTracker.RewardsAccumulated = lockerRewardsTracker.RewardsAccumulated.Sub(newRewardDec) k.SetLockerRewardTracker(ctx, lockerRewardsTracker) // netFeeCollectedData, found := k.collector.GetNetFeeCollectedData(ctx, appID, lockerData.AssetDepositId) @@ -593,7 +595,7 @@ func (k Keeper) CalculateLockerRewards(ctx sdk.Context, appID, assetID, lockerID } assetData, _ := k.asset.GetAsset(ctx, assetID) - if newReward.GT(sdk.ZeroInt()) { + if newReward.GT(sdkmath.ZeroInt()) { err = k.bank.SendCoinsFromModuleToModule(ctx, collectortypes.ModuleName, lockertypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetData.Denom, newReward))) if err != nil { return err @@ -636,7 +638,7 @@ func (k Keeper) CalculateLockerRewards(ctx sdk.Context, appID, assetID, lockerID return nil } -func (k Keeper) CalculateVaultInterest(ctx sdk.Context, appID, extendedPairID, vaultID uint64, totalDebt sdk.Int, blockHeight int64, vaultBlockTime int64) error { +func (k Keeper) CalculateVaultInterest(ctx sdk.Context, appID, extendedPairID, vaultID uint64, totalDebt sdkmath.Int, blockHeight int64, vaultBlockTime int64) error { _, found := k.GetAppIDByApp(ctx, appID) if !found { return nil @@ -672,9 +674,9 @@ func (k Keeper) CalculateVaultInterest(ctx sdk.Context, appID, extendedPairID, v vaultInterestTracker.InterestAccumulated = vaultInterestTracker.InterestAccumulated.Add(interest) } - if vaultInterestTracker.InterestAccumulated.GTE(sdk.OneDec()) { + if vaultInterestTracker.InterestAccumulated.GTE(sdkmath.LegacyOneDec()) { newInterest := vaultInterestTracker.InterestAccumulated.TruncateInt() - newInterestDec := sdk.NewDecFromInt(newInterest) + newInterestDec := sdkmath.LegacyNewDecFromInt(newInterest) vaultInterestTracker.InterestAccumulated = vaultInterestTracker.InterestAccumulated.Sub(newInterestDec) vaultData.BlockTime = ctx.BlockTime() @@ -698,10 +700,10 @@ func (k Keeper) CalculateVaultInterest(ctx sdk.Context, appID, extendedPairID, v func (k Keeper) GetExternalRewardLends(ctx sdk.Context) (LendExternalRewards []types.LendExternalRewards) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.ExternalRewardsLendKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.ExternalRewardsLendKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -795,10 +797,10 @@ func (k Keeper) GetExternalRewardStableVaultByApp(ctx sdk.Context, id uint64) (V func (k Keeper) GetAllExternalRewardStableVault(ctx sdk.Context) (VaultExternalRewards []types.StableVaultExternalRewards) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.ExternalRewardsStableVaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.ExternalRewardsStableVaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/rewards/keeper/store.go b/x/rewards/keeper/store.go index 2872e23b1..91841d440 100644 --- a/x/rewards/keeper/store.go +++ b/x/rewards/keeper/store.go @@ -3,6 +3,8 @@ package keeper import ( "time" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -48,9 +50,9 @@ func (k Keeper) DeleteEpochInfoByDuration(ctx sdk.Context, duration time.Duratio func (k Keeper) GetAllEpochInfos(ctx sdk.Context) (epochInfos []types.EpochInfo) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.EpochInfoByDurationKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.EpochInfoByDurationKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -132,9 +134,9 @@ func (k Keeper) GetGaugeByID(ctx sdk.Context, id uint64) (gauge types.Gauge, fou func (k Keeper) GetAllGauges(ctx sdk.Context) (gauges []types.Gauge) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.GaugeKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.GaugeKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -175,9 +177,9 @@ func (k Keeper) GetGaugeIdsByTriggerDuration(ctx sdk.Context, triggerDuration ti func (k Keeper) GetAllGaugeIdsByTriggerDuration(ctx sdk.Context) (gaugeByTriggerDuration []types.GaugeByTriggerDuration) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.GaugeIdsByTriggerDurationKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.GaugeIdsByTriggerDurationKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -195,9 +197,9 @@ func (k Keeper) GetAllGaugeIdsByTriggerDuration(ctx sdk.Context) (gaugeByTrigger func (k Keeper) GetAllGaugesByGaugeTypeID(ctx sdk.Context, gaugeTypeID uint64) (gauges []types.Gauge) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.GaugeKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.GaugeKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/rewards/module.go b/x/rewards/module.go index e5b6e4c25..731326223 100644 --- a/x/rewards/module.go +++ b/x/rewards/module.go @@ -140,6 +140,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -162,13 +168,13 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 3 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, request abci.RequestBeginBlock) { - BeginBlocker(ctx, request, am.keeper) +func (am AppModule) BeginBlock(ctx sdk.Context) { + BeginBlocker(ctx, am.keeper) } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context) []abci.ValidatorUpdate { EndBlocker(ctx, am.keeper) return []abci.ValidatorUpdate{} } diff --git a/x/rewards/module_simulation.go b/x/rewards/module_simulation.go index ba5a95cbd..76bb5b21a 100644 --- a/x/rewards/module_simulation.go +++ b/x/rewards/module_simulation.go @@ -4,7 +4,6 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -40,14 +39,6 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP return nil } -// RandomizedParams creates randomized param changes for the simulator. -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// return []simtypes.ParamChange{} -// } - -// RegisterStoreDecoder registers a decoder. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/rewards/types/errors.go b/x/rewards/types/errors.go index 93c6d7f09..7b5ff9252 100644 --- a/x/rewards/types/errors.go +++ b/x/rewards/types/errors.go @@ -3,29 +3,29 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/rewards module sentinel errors . var ( - ErrInvalidGaugeStartTime = sdkerrors.Register(ModuleName, 1101, "start time smaller than current time") - ErrInvalidGaugeTypeID = sdkerrors.Register(ModuleName, 1102, "gauge type id invalid") - ErrInvalidDuration = sdkerrors.Register(ModuleName, 1103, "duration should be positive") - ErrInvalidDepositAmount = sdkerrors.Register(ModuleName, 1104, "deposit amount should be positive") - ErrInvalidPoolID = sdkerrors.Register(ModuleName, 1105, "invalid pool id") - ErrInvalidGaugeID = sdkerrors.Register(ModuleName, 1106, "invalid gauge id") - ErrNoGaugeForDuration = sdkerrors.Register(ModuleName, 1107, "no gauges found for given duration") - ErrDepositSmallThanEpoch = sdkerrors.Register(ModuleName, 1108, "deposit amount smaller than total epochs/triggers") - ErrInvalidCalculatedAMount = sdkerrors.Register(ModuleName, 1109, "available distribution coins smaller than calculated distribution amount") - ErrSamePoolID = sdkerrors.Register(ModuleName, 1110, "same pool id cannot exists in child pool ids") - ErrAssetIDDoesNotExist = sdkerrors.Register(ModuleName, 1111, "Asset Id does not exist in locker for App_Mapping") - ErrNegativeTimeElapsed = sdkerrors.Register(ModuleName, 1112, "negative time elapsed since last interest time") - ErrAppIDExists = sdkerrors.Register(ModuleName, 1113, "App id exists") - ErrAppIDDoesNotExists = sdkerrors.Register(ModuleName, 1114, "App Id does not exist in rewards for interest accrual") - ErrPairNotExists = sdkerrors.Register(ModuleName, 1115, "pair does not exists") - ErrPriceNotFound = sdkerrors.Register(ModuleName, 1116, "price not found") - ErrInvalidAppID = sdkerrors.Register(ModuleName, 1117, "invalid app id") - ErrInternalRewardsNotFound = sdkerrors.Register(ModuleName, 1118, "Internal rewards not found") - ErrStablemintVaultFound = sdkerrors.Register(ModuleName, 1119, "Can't give reward to stablemint vault") - ErrDisabledPool = sdkerrors.Register(ModuleName, 1120, "diabled pool") + ErrInvalidGaugeStartTime = errorsmod.Register(ModuleName, 1101, "start time smaller than current time") + ErrInvalidGaugeTypeID = errorsmod.Register(ModuleName, 1102, "gauge type id invalid") + ErrInvalidDuration = errorsmod.Register(ModuleName, 1103, "duration should be positive") + ErrInvalidDepositAmount = errorsmod.Register(ModuleName, 1104, "deposit amount should be positive") + ErrInvalidPoolID = errorsmod.Register(ModuleName, 1105, "invalid pool id") + ErrInvalidGaugeID = errorsmod.Register(ModuleName, 1106, "invalid gauge id") + ErrNoGaugeForDuration = errorsmod.Register(ModuleName, 1107, "no gauges found for given duration") + ErrDepositSmallThanEpoch = errorsmod.Register(ModuleName, 1108, "deposit amount smaller than total epochs/triggers") + ErrInvalidCalculatedAMount = errorsmod.Register(ModuleName, 1109, "available distribution coins smaller than calculated distribution amount") + ErrSamePoolID = errorsmod.Register(ModuleName, 1110, "same pool id cannot exists in child pool ids") + ErrAssetIDDoesNotExist = errorsmod.Register(ModuleName, 1111, "Asset Id does not exist in locker for App_Mapping") + ErrNegativeTimeElapsed = errorsmod.Register(ModuleName, 1112, "negative time elapsed since last interest time") + ErrAppIDExists = errorsmod.Register(ModuleName, 1113, "App id exists") + ErrAppIDDoesNotExists = errorsmod.Register(ModuleName, 1114, "App Id does not exist in rewards for interest accrual") + ErrPairNotExists = errorsmod.Register(ModuleName, 1115, "pair does not exists") + ErrPriceNotFound = errorsmod.Register(ModuleName, 1116, "price not found") + ErrInvalidAppID = errorsmod.Register(ModuleName, 1117, "invalid app id") + ErrInternalRewardsNotFound = errorsmod.Register(ModuleName, 1118, "Internal rewards not found") + ErrStablemintVaultFound = errorsmod.Register(ModuleName, 1119, "Can't give reward to stablemint vault") + ErrDisabledPool = errorsmod.Register(ModuleName, 1120, "diabled pool") ) diff --git a/x/rewards/types/expected_keepers.go b/x/rewards/types/expected_keepers.go index cbc3a5589..de8eeef6d 100644 --- a/x/rewards/types/expected_keepers.go +++ b/x/rewards/types/expected_keepers.go @@ -1,18 +1,18 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias). type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } diff --git a/x/rewards/types/query.pb.go b/x/rewards/types/query.pb.go index 18fbf34b4..1da469354 100644 --- a/x/rewards/types/query.pb.go +++ b/x/rewards/types/query.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -1386,7 +1386,7 @@ func (m *QueryExtLendRewardsAPRRequest) GetCPoolId() uint64 { } type QueryExtLendRewardsAPRResponse struct { - Apr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=apr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"apr" yaml:"ext_rewards_lend_apr"` + Apr cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=apr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"apr" yaml:"ext_rewards_lend_apr"` } func (m *QueryExtLendRewardsAPRResponse) Reset() { *m = QueryExtLendRewardsAPRResponse{} } @@ -1461,106 +1461,106 @@ func init() { var fileDescriptor_e41ca79380357ae5 = []byte{ // 1589 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xdf, 0x6f, 0x14, 0xd5, - 0x17, 0xef, 0x5d, 0xa0, 0x7c, 0xb9, 0xf0, 0xe5, 0xfb, 0xe5, 0xd2, 0x56, 0x3a, 0x94, 0xdd, 0xf6, - 0xb6, 0x14, 0x6c, 0xe9, 0x0e, 0x5d, 0x0b, 0x94, 0x1f, 0x3e, 0x74, 0x83, 0x31, 0x1b, 0x4b, 0x52, - 0x07, 0x83, 0x51, 0xa3, 0x9b, 0xe9, 0xce, 0x65, 0x99, 0x30, 0x3b, 0x33, 0xec, 0x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0x9f, 0x5f, 0x16, 0x8f, 0xe9, - 0x0d, 0x3c, 0x29, 0xb7, 0x06, 0x31, 0xba, 0x84, 0x77, 0x71, 0x6e, 0x90, 0x9c, 0x2e, 0x42, 0x34, - 0x02, 0x21, 0xda, 0xd7, 0x12, 0x22, 0xaa, 0x09, 0x2b, 0x74, 0x13, 0x8f, 0x86, 0x09, 0x79, 0x39, - 0x28, 0x5a, 0x6f, 0x40, 0x95, 0xf0, 0x33, 0xc2, 0x63, 0xed, 0x8e, 0x81, 0xe1, 0x2a, 0x1e, 0xe6, - 0xdf, 0x4f, 0x58, 0x05, 0x47, 0x64, 0x14, 0xb9, 0x5e, 0x7b, 0x05, 0x08, 0x55, 0xaa, 0x81, 0x8d, - 0xbe, 0x57, 0x40, 0x01, 0x02, 0x28, 0xc0, 0x6c, 0x95, 0x8c, 0x30, 0x80, 0xe3, 0xf8, 0x3f, 0x1c, - 0x42, 0xd9, 0x34, 0x20, 0xdf, 0xbb, 0xf9, 0xef, 0x92, 0x41, 0x2b, 0xc0, 0xbd, 0x45, 0x07, 0xb8, - 0x97, 0xf0, 0x2e, 0x2e, 0x04, 0x01, 0x4f, 0xa1, 0xde, 0x96, 0x59, 0xae, 0x49, 0x35, 0x61, 0x81, - 0x96, 0xf0, 0x44, 0xd3, 0x89, 0xf7, 0x8f, 0xea, 0xd2, 0x6a, 0x35, 0x15, 0x53, 0x93, 0xff, 0x6a, - 0xc6, 0xa8, 0x0f, 0xa7, 0x9e, 0x26, 0x94, 0x07, 0x54, 0x90, 0xbf, 0x21, 0x3c, 0x12, 0x75, 0x0b, - 0xe4, 0xde, 0xc0, 0xbb, 0x81, 0x06, 0xb0, 0x3b, 0x26, 0x63, 0x57, 0xb2, 0x7d, 0x56, 0xb7, 0x75, - 0x0b, 0x2c, 0x14, 0xc7, 0x80, 0xe7, 0x7e, 0xe1, 0x19, 0xc4, 0xa9, 0x16, 0xda, 0xeb, 0x7b, 0x6d, - 0xce, 0xc0, 0xad, 0x22, 0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 0x16, 0xd4, 0x71, - 0xd3, 0x1f, 0x59, 0xee, 0x01, 0x53, 0x64, 0x68, 0x55, 0xce, 0x3e, 0x83, 0x26, 0x70, 0x39, 0xcd, - 0xb9, 0x9c, 0x24, 0x79, 0x19, 0x97, 0xf8, 0x69, 0x31, 0x38, 0xa0, 0x0f, 0x27, 0x0c, 0x4c, 0x29, - 0xc9, 0x49, 0x9c, 0xf5, 0x52, 0x92, 0x93, 0x3c, 0xa1, 0xd1, 0x65, 0x4e, 0xa8, 0x40, 0x4e, 0xca, - 0x08, 0xb5, 0x8c, 0x5f, 0x65, 0xdd, 0x75, 0x4d, 0xc3, 0x2b, 0x0b, 0xc8, 0x3f, 0x36, 0xee, 0x9c, - 0xce, 0xe9, 0x24, 0xed, 0xce, 0x91, 0x8e, 0x54, 0xca, 0x72, 0xef, 0x8a, 0xc0, 0xe4, 0x14, 0x67, - 0xa2, 0x92, 0x05, 0x69, 0x99, 0xc5, 0x4d, 0x33, 0xe4, 0x21, 0x6a, 0xf6, 0x54, 0xb1, 0xfd, 0x3c, - 0xb9, 0xd0, 0x03, 0xa4, 0x8e, 0x71, 0x44, 0x79, 0xf1, 0x19, 0xb5, 0x81, 0xd5, 0x05, 0xce, 0xea, - 0x34, 0x59, 0x92, 0xb1, 0x4a, 0xea, 0xfd, 0xc9, 0x57, 0xe1, 0x55, 0xd5, 0x68, 0x64, 0x53, 0xae, - 0xaa, 0xf6, 0x46, 0x3d, 0xe5, 0xaa, 0xea, 0x68, 0xaf, 0xe9, 0x1c, 0xc7, 0x3b, 0x43, 0x68, 0xf2, - 0xcd, 0x1f, 0x74, 0xce, 0xe4, 0x87, 0x46, 0x97, 0xde, 0xde, 0x75, 0x92, 0x53, 0x69, 0x51, 0x8b, - 0x6d, 0x7f, 0x95, 0xd3, 0xbd, 0xaa, 0x01, 0xea, 0x25, 0x8e, 0x3a, 0x4f, 0x4e, 0x48, 0x51, 0xc7, - 0xf4, 0xad, 0xc5, 0x57, 0xee, 0x3f,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 0x22, 0xfc, 0x82, 0xc5, 0x9f, 0x95, + 0x18, 0x58, 0x96, 0xa2, 0xed, 0x30, 0x2f, 0xab, 0x8b, 0x08, 0xd5, 0x12, 0xbf, 0x70, 0x14, 0xaa, + 0x93, 0x15, 0xf8, 0x24, 0xb1, 0xa9, 0x36, 0x6c, 0xc5, 0xb9, 0xf7, 0xbc, 0x65, 0x3e, 0x40, 0xe1, + 0x1e, 0x14, 0x49, 0x7c, 0x55, 0xdf, 0xb0, 0xfc, 0x7e, 0x69, 0xf3, 0x59, 0x06, 0x4f, 0x25, 0x60, + 0x00, 0x65, 0x3e, 0x46, 0x78, 0x64, 0x33, 0x78, 0x24, 0x13, 0xe6, 0x84, 0x4c, 0x18, 0x1e, 0xa8, + 0x55, 0x97, 0x23, 0xa0, 0xcb, 0x61, 0x81, 0x2d, 0x3e, 0x32, 0xd5, 0x86, 0x36, 0x63, 0x9c, 0x7b, + 0xae, 0x4a, 0xfd, 0x9b, 0x79, 0x63, 0xdd, 0xf4, 0x99, 0x65, 0x7a, 0x3e, 0x33, 0x96, 0x5d, 0xb7, + 0x68, 0x78, 0x9c, 0x4b, 0x9f, 0x74, 0x79, 0x84, 0xe0, 0x9b, 0x91, 0xa1, 0xa8, 0xaf, 0x98, 0x23, + 0x37, 0x63, 0x2d, 0xb8, 0x30, 0x3b, 0x0b, 0x53, 0x8d, 0x32, 0xc7, 0xdb, 0x51, 0x4d, 0x12, 0xa0, + 0xe7, 0x85, 0x7e, 0x1f, 0x85, 0x07, 0xba, 0x88, 0xc2, 0x2b, 0xcc, 0xee, 0xdb, 0x46, 0xf4, 0x49, + 0x26, 0xf6, 0x0b, 0x04, 0x08, 0x50, 0xe2, 0xbb, 0x08, 0x0f, 0x5b, 0xcc, 0x36, 0x64, 0xbd, 0x3f, + 0x27, 0x5d, 0x94, 0x98, 0x6d, 0xb4, 0xb6, 0xfe, 0x0c, 0xb4, 0xfe, 0x38, 0x2c, 0x49, 0x71, 0x71, + 0xa9, 0x76,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 0xe1, 0xcd, 0xc2, 0x1d, 0xf2, 0x73, 0x38, 0xb7, 0xb6, 0x0c, 0xe7, 0x64, 0x31, 0x3d, 0x75, 0xfb, + 0xad, 0x80, 0xb2, 0xd8, 0x09, 0xe0, 0xee, 0xbb, 0x40, 0xe0, 0x4d, 0xea, 0x82, 0x2f, 0x10, 0xde, + 0xd7, 0x3c, 0x7f, 0x93, 0xe4, 0x8f, 0x3c, 0x7a, 0x39, 0xa0, 0x9c, 0xe8, 0xcc, 0x18, 0xe0, 0x1e, + 0xe3, 0x70, 0xa7, 0xc8, 0x84, 0x9a, 0x7c, 0xcb, 0x4b, 0xee, 0x21, 0xbc, 0xb7, 0x29, 0x42, 0xca, + 0x22, 0x15, 0x19, 0xb3, 0x95, 0xb9, 0x8e, 0x6c, 0x01, 0xd1, 0x1c, 0x47, 0x74, 0x84, 0x4c, 0x27, + 0x23, 0x52, 0x6f, 0x07, 0x92, 0xff, 0x86, 0xf0, 0x58, 0xc2, 0xec, 0x4a, 0xce, 0x25, 0x7f, 0xcd, + 0x49, 0x63, 0xb7, 0x72, 0xfe, 0x99, 0x7c, 0x81, 0xc5, 0x19, 0xce, 0x62, 0x81, 0xa8, 0x32, 0x16, + 0x92, 0x69, 0x97, 0xdc, 0x47, 0x70, 0x29, 0x1d, 0x37, 0xf1, 0x91, 0xa5, 0x2e, 0x30, 0x45, 0x06, + 0x55, 0xe5, 0xec, 0x33, 0x78, 0x02, 0x97, 0xd3, 0x9c, 0xcb, 0x49, 0x92, 0x93, 0x71, 0x89, 0x9f, + 0x10, 0x83, 0x05, 0x7a, 0x2c, 0x61, 0x48, 0x4a, 0x11, 0x27, 0x71, 0xbe, 0x4b, 0x11, 0x27, 0x79, + 0x2a, 0xa3, 0x4b, 0x9c, 0x50, 0x9e, 0x9c, 0x94, 0x11, 0x6a, 0x1a, 0xb9, 0x4a, 0xba, 0xeb, 0x9a, + 0x86, 0x57, 0x12, 0x90, 0x7f, 0xaa, 0xef, 0x39, 0xed, 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ae, 0x5d, 0x9b, + 0x2a, 0x24, 0x1d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/rewards/types/rewards.pb.go b/x/rewards/types/rewards.pb.go index a2f91f5fa..71a341ea4 100644 --- a/x/rewards/types/rewards.pb.go +++ b/x/rewards/types/rewards.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -82,9 +83,9 @@ func (m *InternalRewards) GetAssetId() uint64 { } type LockerRewardsTracker struct { - LockerId uint64 `protobuf:"varint,1,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` - AppMappingId uint64 `protobuf:"varint,2,opt,name=app_mapping_id,json=appMappingId,proto3" json:"app_mapping_id,omitempty" yaml:"app_mapping_id"` - RewardsAccumulated github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=rewards_accumulated,json=rewardsAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rewards_accumulated" yaml:"rewards_accumulated"` + LockerId uint64 `protobuf:"varint,1,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` + AppMappingId uint64 `protobuf:"varint,2,opt,name=app_mapping_id,json=appMappingId,proto3" json:"app_mapping_id,omitempty" yaml:"app_mapping_id"` + RewardsAccumulated cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=rewards_accumulated,json=rewardsAccumulated,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rewards_accumulated" yaml:"rewards_accumulated"` } func (m *LockerRewardsTracker) Reset() { *m = LockerRewardsTracker{} } @@ -135,9 +136,9 @@ func (m *LockerRewardsTracker) GetAppMappingId() uint64 { } type VaultInterestTracker struct { - VaultId uint64 `protobuf:"varint,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id,omitempty" yaml:"vault_id"` - AppMappingId uint64 `protobuf:"varint,2,opt,name=app_mapping_id,json=appMappingId,proto3" json:"app_mapping_id,omitempty" yaml:"app_mapping_id"` - InterestAccumulated github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=interest_accumulated,json=interestAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_accumulated" yaml:"interest_accumulated"` + VaultId uint64 `protobuf:"varint,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id,omitempty" yaml:"vault_id"` + AppMappingId uint64 `protobuf:"varint,2,opt,name=app_mapping_id,json=appMappingId,proto3" json:"app_mapping_id,omitempty" yaml:"app_mapping_id"` + InterestAccumulated cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=interest_accumulated,json=interestAccumulated,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"interest_accumulated" yaml:"interest_accumulated"` } func (m *VaultInterestTracker) Reset() { *m = VaultInterestTracker{} } @@ -884,85 +885,85 @@ func init() { } var fileDescriptor_d29f449503627a2b = []byte{ - // 1233 bytes of a gzipped FileDescriptorProto + // 1239 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x3a, 0x1f, 0xb6, 0x27, 0x76, 0x92, 0x3a, 0x6e, 0xe3, 0xa6, 0xd4, 0x6b, 0x46, 0xa8, - 0xe4, 0x40, 0xd7, 0xa4, 0x70, 0x01, 0x84, 0xaa, 0x98, 0x56, 0x60, 0x35, 0x95, 0xaa, 0x69, 0x41, - 0x82, 0xcb, 0x6a, 0xbc, 0x33, 0x75, 0x56, 0xdd, 0xdd, 0x59, 0xed, 0x8e, 0xd3, 0xe6, 0x80, 0x84, - 0xb8, 0x54, 0x20, 0x0e, 0x95, 0xf8, 0x97, 0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b, 0xaa, 0x6e, 0xba, 0xbf, 0xac, 0xda, 0xf2, 0xf1, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb4, + 0xa2, 0xad, 0x33, 0x4c, 0x15, 0x00, 0x00, } func (m *InternalRewards) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/tx.go b/x/rewards/types/tx.go index 0ca65180b..4ec805a0f 100644 --- a/x/rewards/types/tx.go +++ b/x/rewards/types/tx.go @@ -1,6 +1,7 @@ package types import ( + sdkmath "cosmossdk.io/math" "fmt" "time" @@ -63,7 +64,7 @@ func (m MsgCreateGauge) ValidateBasic() error { return fmt.Errorf("invalid coin amount: %s < 0", m.DepositAmount.Amount) } - if m.DepositAmount.Amount.LT(sdk.NewIntFromUint64(m.TotalTriggers)) { + if m.DepositAmount.Amount.LT(sdkmath.NewIntFromUint64(m.TotalTriggers)) { return fmt.Errorf("deposit amount : %s smaller than total triggers %d", m.DepositAmount.Amount, m.TotalTriggers) } diff --git a/x/tokenmint/abci.go b/x/tokenmint/abci.go deleted file mode 100644 index 95b050804..000000000 --- a/x/tokenmint/abci.go +++ /dev/null @@ -1 +0,0 @@ -package tokenmint diff --git a/x/tokenmint/expected/keeper.go b/x/tokenmint/expected/keeper.go index dca0cbce9..b9da0885e 100644 --- a/x/tokenmint/expected/keeper.go +++ b/x/tokenmint/expected/keeper.go @@ -1,22 +1,23 @@ package expected import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" assettypes "github.com/comdex-official/comdex/x/asset/types" ) type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, address sdk.AccAddress, name string, coins sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error SendCoinsFromModuleToModule( - ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins, + ctx context.Context, senderModule, recipientModule string, amt sdk.Coins, ) error - SpendableCoins(ctx sdk.Context, address sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, address sdk.AccAddress) sdk.Coins } type AssetKeeper interface { diff --git a/x/tokenmint/genesis_test.go b/x/tokenmint/genesis_test.go index 9616f7598..9ecafbaed 100644 --- a/x/tokenmint/genesis_test.go +++ b/x/tokenmint/genesis_test.go @@ -5,7 +5,6 @@ import ( "github.com/comdex-official/comdex/app" "github.com/comdex-official/comdex/x/tokenmint" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/comdex-official/comdex/x/tokenmint/types" "github.com/stretchr/testify/require" @@ -13,7 +12,7 @@ import ( func TestGenesis(t *testing.T) { comdexApp := app.Setup(t, false) - ctx := comdexApp.BaseApp.NewContext(false, tmproto.Header{}) + ctx := comdexApp.BaseApp.NewContext(false) genesisState := types.GenesisState{ Params: types.DefaultParams(), diff --git a/x/tokenmint/handler.go b/x/tokenmint/handler.go index 2d157377a..5f0154380 100644 --- a/x/tokenmint/handler.go +++ b/x/tokenmint/handler.go @@ -3,6 +3,10 @@ package tokenmint import ( "fmt" + bam "github.com/cosmos/cosmos-sdk/baseapp" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -11,7 +15,7 @@ import ( ) // NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServer(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { @@ -23,7 +27,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return sdk.WrapServiceResult(ctx, res, err) default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) } } } diff --git a/x/tokenmint/handler_test.go b/x/tokenmint/handler_test.go index f956bd70a..1129b320b 100644 --- a/x/tokenmint/handler_test.go +++ b/x/tokenmint/handler_test.go @@ -4,6 +4,7 @@ import ( "strings" "testing" + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/app" "github.com/comdex-official/comdex/x/tokenmint" "github.com/comdex-official/comdex/x/tokenmint/keeper" @@ -11,7 +12,6 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" ) @@ -26,7 +26,7 @@ func TestInvalidMsg(t *testing.T) { require.Error(t, err) require.Nil(t, res) - _, _, log := sdkerrors.ABCIInfo(err, false) + _, _, log := errorsmod.ABCIInfo(err, false) require.True(t, strings.Contains(log, "unknown request")) } diff --git a/x/tokenmint/keeper/keeper.go b/x/tokenmint/keeper/keeper.go index 2bb136dc5..9a5b71b76 100644 --- a/x/tokenmint/keeper/keeper.go +++ b/x/tokenmint/keeper/keeper.go @@ -3,13 +3,13 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/tokenmint/expected" "github.com/comdex-official/comdex/x/tokenmint/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" ) type Keeper struct { @@ -32,6 +32,6 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.key) } diff --git a/x/tokenmint/keeper/keeper_test.go b/x/tokenmint/keeper/keeper_test.go index 015e66562..dade184c0 100644 --- a/x/tokenmint/keeper/keeper_test.go +++ b/x/tokenmint/keeper/keeper_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "encoding/binary" "testing" "time" @@ -12,7 +13,6 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -42,7 +42,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.collectorKeeper = s.app.CollectorKeeper s.assetKeeper = s.app.AssetKeeper s.auctionKeeper = s.app.AuctionKeeper @@ -103,7 +103,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: appName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -128,7 +128,7 @@ func (s *KeeperTestSuite) CreateNewAsset(name, denom string, price uint64) uint6 err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: true, diff --git a/x/tokenmint/keeper/mint.go b/x/tokenmint/keeper/mint.go index a25dd4c7a..1d38a6e1c 100644 --- a/x/tokenmint/keeper/mint.go +++ b/x/tokenmint/keeper/mint.go @@ -1,6 +1,8 @@ package keeper import ( + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/tokenmint/types" @@ -34,10 +36,10 @@ func (k Keeper) GetTokenMint(ctx sdk.Context, appMappingID uint64) (appTokenMint func (k Keeper) GetTotalTokenMinted(ctx sdk.Context) (appTokenMintData []types.TokenMint) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.TokenMintKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.TokenMintKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -76,7 +78,7 @@ func (k Keeper) GetAssetDataInTokenMintByAppSupply(ctx sdk.Context, appMappingID return tokenData.CurrentSupply.Int64(), found } -func (k Keeper) MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdk.Int) error { +func (k Keeper) MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdkmath.Int) error { assetData, found := k.asset.GetAsset(ctx, assetID) if !found { return types.ErrorAssetDoesNotExist @@ -90,7 +92,7 @@ func (k Keeper) MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetI if !found { return types.ErrorAssetNotWhiteListedForGenesisMinting } - if amount.GT(sdk.ZeroInt()) { + if amount.GT(sdkmath.ZeroInt()) { if err := k.bank.MintCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetData.Denom, amount))); err != nil { return err } @@ -106,7 +108,7 @@ func (k Keeper) MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetI return nil } -func (k Keeper) BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error { +func (k Keeper) BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdkmath.Int) error { assetData, found := k.asset.GetAsset(ctx, assetID) if !found { return types.ErrorAssetDoesNotExist @@ -120,7 +122,7 @@ func (k Keeper) BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID u if !found { return types.ErrorAssetNotWhiteListedForGenesisMinting } - if tokenData.CurrentSupply.Sub(amount).LTE(sdk.NewInt(0)) || amount.LTE(sdk.ZeroInt()) { + if tokenData.CurrentSupply.Sub(amount).LTE(sdkmath.NewInt(0)) || amount.LTE(sdkmath.ZeroInt()) { return types.ErrorBurningMakesSupplyLessThanZero } if err := k.bank.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetData.Denom, amount))); err != nil { @@ -132,7 +134,7 @@ func (k Keeper) BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID u return nil } -func (k Keeper) UpdateAssetDataInTokenMintByApp(ctx sdk.Context, appMappingID uint64, assetID uint64, changeType bool, amount sdk.Int) { +func (k Keeper) UpdateAssetDataInTokenMintByApp(ctx sdk.Context, appMappingID uint64, assetID uint64, changeType bool, amount sdkmath.Int) { // ChangeType + == add to current supply // Change type - == reduce from supply mintData, found := k.GetTokenMint(ctx, appMappingID) @@ -182,7 +184,7 @@ func (k Keeper) BurnFrom(ctx sdk.Context, amount sdk.Coin, burnFrom sdk.AccAddre return nil } -func (k Keeper) WasmMsgFoundationEmission(ctx sdk.Context, appID uint64, amount sdk.Int, foundationAddr []string) error { +func (k Keeper) WasmMsgFoundationEmission(ctx sdk.Context, appID uint64, amount sdkmath.Int, foundationAddr []string) error { s := len(foundationAddr) var assetID uint64 app, _ := k.asset.GetApp(ctx, appID) @@ -193,17 +195,17 @@ func (k Keeper) WasmMsgFoundationEmission(ctx sdk.Context, appID uint64, amount } } asset, _ := k.asset.GetAsset(ctx, assetID) - if amount.GT(sdk.ZeroInt()) { + if amount.GT(sdkmath.ZeroInt()) { err := k.bank.MintCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(asset.Denom, amount))) if err != nil { return err } } - amountToIndividualFoundationAddr := amount.Quo(sdk.NewInt(int64(s))) + amountToIndividualFoundationAddr := amount.Quo(sdkmath.NewInt(int64(s))) for _, addr := range foundationAddr { newAddr, _ := sdk.AccAddressFromBech32(addr) - if amountToIndividualFoundationAddr.GT(sdk.ZeroInt()) { + if amountToIndividualFoundationAddr.GT(sdkmath.ZeroInt()) { err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, newAddr, sdk.NewCoins(sdk.NewCoin(asset.Denom, amountToIndividualFoundationAddr))) if err != nil { return err @@ -215,7 +217,7 @@ func (k Keeper) WasmMsgFoundationEmission(ctx sdk.Context, appID uint64, amount return nil } -func (k Keeper) WasmMsgRebaseMint(ctx sdk.Context, appID uint64, amount sdk.Int, contractAddr sdk.AccAddress) error { +func (k Keeper) WasmMsgRebaseMint(ctx sdk.Context, appID uint64, amount sdkmath.Int, contractAddr sdk.AccAddress) error { var assetID uint64 app, _ := k.asset.GetApp(ctx, appID) govToken := app.GenesisToken @@ -225,7 +227,7 @@ func (k Keeper) WasmMsgRebaseMint(ctx sdk.Context, appID uint64, amount sdk.Int, } } asset, _ := k.asset.GetAsset(ctx, assetID) - if amount.GT(sdk.ZeroInt()) { + if amount.GT(sdkmath.ZeroInt()) { err := k.bank.MintCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(asset.Denom, amount))) if err != nil { return err diff --git a/x/tokenmint/keeper/mint_test.go b/x/tokenmint/keeper/mint_test.go index 6e1632d45..c5b55985c 100644 --- a/x/tokenmint/keeper/mint_test.go +++ b/x/tokenmint/keeper/mint_test.go @@ -2,6 +2,8 @@ package keeper_test import ( "fmt" + + sdkmath "cosmossdk.io/math" assetTypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/tokenmint/keeper" tokenmintTypes "github.com/comdex-official/comdex/x/tokenmint/types" @@ -10,12 +12,12 @@ import ( func (s *KeeperTestSuite) AddAppAsset() { userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" - genesisSupply := sdk.NewIntFromUint64(9000000) + genesisSupply := sdkmath.NewIntFromUint64(9000000) assetKeeper, ctx := &s.assetKeeper, &s.ctx msg1 := assetTypes.AppData{ Name: "cswap", ShortName: "cswap", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -38,7 +40,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg2 := assetTypes.AppData{ Name: "commodo", ShortName: "comdo", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { @@ -55,7 +57,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg20 := assetTypes.AppData{ Name: "cool", ShortName: "cool", - MinGovDeposit: sdk.NewIntFromUint64(10000000), + MinGovDeposit: sdkmath.NewIntFromUint64(10000000), GovTimeInSeconds: 900, GenesisToken: nil, } @@ -65,7 +67,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg3 := assetTypes.Asset{ Name: "CMDX", Denom: "ucmdx", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } @@ -75,7 +77,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg4 := assetTypes.Asset{ Name: "CMST", Denom: "ucmst", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } err = assetKeeper.AddAssetRecords(*ctx, msg4) @@ -84,7 +86,7 @@ func (s *KeeperTestSuite) AddAppAsset() { msg5 := assetTypes.Asset{ Name: "HARBOR", Denom: "uharbor", - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, } @@ -159,7 +161,7 @@ func (s *KeeperTestSuite) TestMsgMintNewTokens() { }, } { s.Run(tc.name, func() { - genesisSupply := sdk.NewIntFromUint64(9000000) + genesisSupply := sdkmath.NewIntFromUint64(9000000) asset, found := s.assetKeeper.GetAsset(*ctx, tc.msg.AssetId) s.Require().True(found) previousCoin, err := s.getBalance(userAddress, asset.Denom) @@ -203,7 +205,7 @@ func (s *KeeperTestSuite) TestMintNewTokensForApp() { appID uint64 assetID uint64 address string - mintAmount sdk.Int + mintAmount sdkmath.Int expectedError bool }{ { @@ -211,7 +213,7 @@ func (s *KeeperTestSuite) TestMintNewTokensForApp() { 1, 2, userAddress, - sdk.NewIntFromUint64(423), + sdkmath.NewIntFromUint64(423), false, }, { @@ -219,7 +221,7 @@ func (s *KeeperTestSuite) TestMintNewTokensForApp() { 33, 2, userAddress, - sdk.NewIntFromUint64(423), + sdkmath.NewIntFromUint64(423), true, }, { @@ -227,7 +229,7 @@ func (s *KeeperTestSuite) TestMintNewTokensForApp() { 3, 2, userAddress, - sdk.NewIntFromUint64(423), + sdkmath.NewIntFromUint64(423), true, }, } { @@ -279,8 +281,8 @@ func (s *KeeperTestSuite) TestBurnTokensForApp() { appID uint64 assetID uint64 address string - sendAmount sdk.Int - burnAmount sdk.Int + sendAmount sdkmath.Int + burnAmount sdkmath.Int expectedError bool }{ { @@ -288,8 +290,8 @@ func (s *KeeperTestSuite) TestBurnTokensForApp() { 1, 2, userAddress, - sdk.NewIntFromUint64(423), - sdk.NewIntFromUint64(423), + sdkmath.NewIntFromUint64(423), + sdkmath.NewIntFromUint64(423), false, }, { @@ -297,8 +299,8 @@ func (s *KeeperTestSuite) TestBurnTokensForApp() { 1, 2, userAddress, - sdk.NewIntFromUint64(422), - sdk.NewIntFromUint64(423), + sdkmath.NewIntFromUint64(422), + sdkmath.NewIntFromUint64(423), true, }, } { @@ -348,7 +350,7 @@ func (s *KeeperTestSuite) TestBurnGovTokensForApp() { appID uint64 assetID uint64 address string - burnAmount sdk.Int + burnAmount sdkmath.Int expectedError bool }{ { @@ -356,7 +358,7 @@ func (s *KeeperTestSuite) TestBurnGovTokensForApp() { 1, 2, userAddress, - sdk.NewIntFromUint64(423), + sdkmath.NewIntFromUint64(423), false, }, { @@ -364,7 +366,7 @@ func (s *KeeperTestSuite) TestBurnGovTokensForApp() { 1, 2, userAddress, - sdk.NewIntFromUint64(9000001), + sdkmath.NewIntFromUint64(9000001), true, }, } { @@ -403,7 +405,7 @@ func (s *KeeperTestSuite) TestBurnGovTokensForApp() { s.Require().True(found) s.Require().Equal(res.MintedTokens.AssetId, tc.assetID) s.Require().Equal(res.MintedTokens.GenesisSupply, beforeTokenMint.MintedTokens.GenesisSupply) - s.Require().Equal(sdk.NewInt(currentSupply).Add(tc.burnAmount), beforeTokenMint.MintedTokens.CurrentSupply) + s.Require().Equal(sdkmath.NewInt(currentSupply).Add(tc.burnAmount), beforeTokenMint.MintedTokens.CurrentSupply) s.Require().Equal(beforeTokenMintBalance, afterTokenMintBalance) s.Require().Equal(beforeUserBalance.Amount.Sub(afterUserBalance.Amount), tc.burnAmount) } diff --git a/x/tokenmint/keeper/msg_server.go b/x/tokenmint/keeper/msg_server.go index b82aac85d..4689dd44d 100644 --- a/x/tokenmint/keeper/msg_server.go +++ b/x/tokenmint/keeper/msg_server.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "context" sdk "github.com/cosmos/cosmos-sdk/types" @@ -49,7 +50,7 @@ func (k msgServer) MsgMintNewTokens(c context.Context, msg *types.MsgMintNewToke if err != nil { return nil, err } - if assetDataInApp.GenesisSupply.GT(sdk.ZeroInt()) { + if assetDataInApp.GenesisSupply.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, userAddress, sdk.NewCoins(sdk.NewCoin(assetData.Denom, assetDataInApp.GenesisSupply))); err != nil { return nil, err } @@ -74,7 +75,7 @@ func (k msgServer) MsgMintNewTokens(c context.Context, msg *types.MsgMintNewToke if err != nil { return nil, err } - if assetDataInApp.GenesisSupply.GT(sdk.ZeroInt()) { + if assetDataInApp.GenesisSupply.GT(sdkmath.ZeroInt()) { if err = k.bank.MintCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetData.Denom, assetDataInApp.GenesisSupply))); err != nil { return nil, err } diff --git a/x/tokenmint/module.go b/x/tokenmint/module.go index 55f67e3aa..f78d2ea6f 100644 --- a/x/tokenmint/module.go +++ b/x/tokenmint/module.go @@ -132,6 +132,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { @@ -154,10 +160,8 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ sdk.Context) {} -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (a AppModule) EndBlock(ctx context.Context) error { + return nil } diff --git a/x/tokenmint/module_test.go b/x/tokenmint/module_test.go index 9ad35f5bf..c5a151a9f 100644 --- a/x/tokenmint/module_test.go +++ b/x/tokenmint/module_test.go @@ -1,10 +1,10 @@ package tokenmint_test import ( + sdkmath "cosmossdk.io/math" "encoding/binary" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" @@ -31,7 +31,7 @@ func TestModuleTestSuite(t *testing.T) { func (suite *ModuleTestSuite) SetupTest() { app := chain.Setup(suite.T(), false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false) suite.app = app suite.ctx = ctx @@ -50,7 +50,7 @@ func (s *ModuleTestSuite) CreateNewApp(appName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: appName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -75,7 +75,7 @@ func (s *ModuleTestSuite) CreateNewAsset(name, denom string, price uint64) uint6 err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: true, diff --git a/x/tokenmint/types/errors.go b/x/tokenmint/types/errors.go index 08df2cb8c..d51cbf502 100644 --- a/x/tokenmint/types/errors.go +++ b/x/tokenmint/types/errors.go @@ -3,17 +3,17 @@ package types // DONTCOVER import ( - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrorAssetDoesNotExist = errors.Register(ModuleName, 1201, "Asset Does not exists") - ErrorAppMappingDoesNotExists = errors.Register(ModuleName, 1202, "App Mapping Does Not exists") - ErrorAssetNotWhiteListedForGenesisMinting = errors.Register(ModuleName, 1203, "Asset not added in appMapping data for genesis minting") - ErrorGenesisMintingForTokenAlreadyDone = errors.Register(ModuleName, 1204, "Asset minting already done for the given app") - ErrorBurningMakesSupplyLessThanZero = errors.Register(ModuleName, 1205, "Burning request reduces the the supply to 0 or less than 0 tokens") - ErrorMintDataNotFound = errors.Register(ModuleName, 1206, "minted data not found") - ErrorInvalidAppID = errors.Register(ModuleName, 1207, "app id can not be zero") - ErrorInvalidAssetID = errors.Register(ModuleName, 1208, "asset id can not be zero") - ErrorInvalidFrom = errors.Register(ModuleName, 1209, "invalid from") + ErrorAssetDoesNotExist = errorsmod.Register(ModuleName, 1201, "Asset Does not exists") + ErrorAppMappingDoesNotExists = errorsmod.Register(ModuleName, 1202, "App Mapping Does Not exists") + ErrorAssetNotWhiteListedForGenesisMinting = errorsmod.Register(ModuleName, 1203, "Asset not added in appMapping data for genesis minting") + ErrorGenesisMintingForTokenAlreadyDone = errorsmod.Register(ModuleName, 1204, "Asset minting already done for the given app") + ErrorBurningMakesSupplyLessThanZero = errorsmod.Register(ModuleName, 1205, "Burning request reduces the the supply to 0 or less than 0 tokens") + ErrorMintDataNotFound = errorsmod.Register(ModuleName, 1206, "minted data not found") + ErrorInvalidAppID = errorsmod.Register(ModuleName, 1207, "app id can not be zero") + ErrorInvalidAssetID = errorsmod.Register(ModuleName, 1208, "asset id can not be zero") + ErrorInvalidFrom = errorsmod.Register(ModuleName, 1209, "invalid from") ) diff --git a/x/tokenmint/types/expected_keepers.go b/x/tokenmint/types/expected_keepers.go index cbc3a5589..914960c30 100644 --- a/x/tokenmint/types/expected_keepers.go +++ b/x/tokenmint/types/expected_keepers.go @@ -1,18 +1,18 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias). type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } diff --git a/x/tokenmint/types/mint.pb.go b/x/tokenmint/types/mint.pb.go index f2d9bed47..5b86d88b4 100644 --- a/x/tokenmint/types/mint.pb.go +++ b/x/tokenmint/types/mint.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" @@ -68,10 +68,10 @@ func (m *TokenMint) XXX_DiscardUnknown() { var xxx_messageInfo_TokenMint proto.InternalMessageInfo type MintedTokens struct { - AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - GenesisSupply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=genesis_supply,json=genesisSupply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"genesis_supply" yaml:"genesis_supply"` - CreatedAt time.Time `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` - CurrentSupply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=current_supply,json=currentSupply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"current_supply" yaml:"current_supply"` + AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + GenesisSupply cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=genesis_supply,json=genesisSupply,proto3,customtype=cosmossdk.io/math.Int" json:"genesis_supply" yaml:"genesis_supply"` + CreatedAt time.Time `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` + CurrentSupply cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=current_supply,json=currentSupply,proto3,customtype=cosmossdk.io/math.Int" json:"current_supply" yaml:"current_supply"` } func (m *MintedTokens) Reset() { *m = MintedTokens{} } @@ -117,36 +117,36 @@ func init() { } var fileDescriptor_0f3526562ed06c1c = []byte{ - // 456 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x3f, 0x8f, 0xd3, 0x30, - 0x18, 0xc6, 0xe3, 0xfb, 0x07, 0xf5, 0x5d, 0x41, 0x84, 0x43, 0x8a, 0x2a, 0x11, 0x57, 0x46, 0x3a, - 0x75, 0x39, 0x5b, 0xbd, 0xdb, 0xd8, 0x2e, 0x0b, 0xea, 0x70, 0x4b, 0x38, 0x24, 0xc4, 0x52, 0xb9, - 0x89, 0x1b, 0xa2, 0x6b, 0x62, 0xab, 0x76, 0x11, 0xfd, 0x16, 0xf7, 0x25, 0x90, 0xf8, 0x28, 0x1d, - 0x6f, 0x44, 0x0c, 0x01, 0xd2, 0x6f, 0x90, 0x89, 0x11, 0xd9, 0x4e, 0xb9, 0x76, 0x60, 0x62, 0x8a, - 0xdf, 0x37, 0x3f, 0x3f, 0xef, 0xf3, 0xe4, 0x0d, 0x7c, 0x95, 0x88, 0x22, 0xe5, 0x9f, 0xa9, 0x16, - 0xb7, 0xbc, 0x2c, 0xf2, 0x52, 0xd3, 0x4f, 0xc3, 0x09, 0xd7, 0x6c, 0x48, 0x4d, 0x41, 0xe4, 0x5c, - 0x68, 0xe1, 0x07, 0x0e, 0x22, 0x7f, 0x21, 0xd2, 0x42, 0xbd, 0xd3, 0x4c, 0x64, 0xc2, 0x42, 0xd4, -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, 0x9b, 0x0a, 0xbd, 0x70, 0x33, 0x76, 0xd5, 0x70, 0xdc, 0x6d, - 0x1b, 0x6f, 0x6d, 0xed, 0xbf, 0x87, 0x30, 0x99, 0x73, 0x66, 0x12, 0x31, 0x1d, 0xec, 0xf7, 0xc1, - 0xe0, 0xf8, 0xa2, 0x47, 0xdc, 0x3a, 0xc8, 0x66, 0x1d, 0xe4, 0x66, 0xb3, 0x8e, 0xe8, 0xa5, 0xf1, - 0xd1, 0x54, 0xe8, 0x99, 0x53, 0x7f, 0xb8, 0x8b, 0xef, 0x7e, 0x20, 0x10, 0x77, 0xda, 0xc6, 0x95, - 0x36, 0x49, 0x92, 0xc5, 0x7c, 0xce, 0x4b, 0xbd, 0x49, 0x72, 0xf0, 0x7f, 0x49, 0x76, 0xd5, 0x70, - 0xdc, 0x6d, 0x1b, 0x2e, 0x49, 0xf4, 0x6e, 0xf5, 0x2b, 0xf4, 0xbe, 0xd6, 0xa1, 0xb7, 0xaa, 0x43, - 0x70, 0x5f, 0x87, 0xe0, 0x67, 0x1d, 0x82, 0xbb, 0x75, 0xe8, 0xdd, 0xaf, 0x43, 0xef, 0xdb, 0x3a, - 0xf4, 0x3e, 0x5c, 0xee, 0x4c, 0x34, 0x6b, 0x3f, 0x17, 0xd3, 0x69, 0x9e, 0xe4, 0x6c, 0xd6, 0xd6, - 0x74, 0xfb, 0xbf, 0xb6, 0x16, 0x26, 0x47, 0xf6, 0x23, 0x5c, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, - 0xf5, 0xe3, 0x28, 0x4c, 0xf8, 0x02, 0x00, 0x00, + // 455 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcf, 0x6e, 0xd3, 0x30, + 0x1c, 0xc7, 0xe3, 0xee, 0x0f, 0xd4, 0x5b, 0x41, 0x84, 0x4d, 0x8a, 0x2a, 0x11, 0x57, 0x46, 0x42,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c1, 0xef, 0x32, 0x04, 0xb7, + 0xeb, 0xd0, 0xbb, 0x5b, 0x87, 0xde, 0x8f, 0x75, 0xe8, 0x7d, 0x3c, 0x4f, 0x85, 0xb9, 0x5e, 0x4c, + 0xec, 0x83, 0x52, 0xf7, 0xa8, 0xaf, 0xe5, 0x74, 0x2a, 0x62, 0xc1, 0x66, 0x4d, 0x4d, 0xb7, 0xff, + 0x5a, 0xb3, 0x54, 0x5c, 0x4f, 0x0e, 0xeb, 0x33, 0x9f, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xac, + 0xe6, 0xdc, 0x80, 0xd6, 0x02, 0x00, 0x00, } func (m *TokenMint) Marshal() (dAtA []byte, err error) { diff --git a/x/tokenmint/types/msg.go b/x/tokenmint/types/msg.go index 743382100..e3b4401a9 100644 --- a/x/tokenmint/types/msg.go +++ b/x/tokenmint/types/msg.go @@ -2,7 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var _ sdk.Msg = (*MsgMintNewTokensRequest)(nil) @@ -25,16 +25,16 @@ func (m *MsgMintNewTokensRequest) Type() string { func (m *MsgMintNewTokensRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if m.AppId == 0 { - return errors.Wrap(ErrorInvalidAppID, "app id can not be zero") + return errorsmod.Wrap(ErrorInvalidAppID, "app id can not be zero") } if m.AssetId == 0 { - return errors.Wrap(ErrorInvalidAssetID, "asset id can not be zero") + return errorsmod.Wrap(ErrorInvalidAssetID, "asset id can not be zero") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } return nil diff --git a/x/tokenmint/types/params.go b/x/tokenmint/types/params.go index 764037317..584ceaf10 100644 --- a/x/tokenmint/types/params.go +++ b/x/tokenmint/types/params.go @@ -1,7 +1,7 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" ) @@ -9,7 +9,7 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) const ( - TokenmintGas = sdk.Gas(36329) + TokenmintGas = storetypes.Gas(36329) ) // ParamKeyTable the param key table for launch module. diff --git a/x/vault/client/cli/tx.go b/x/vault/client/cli/tx.go index f71f0c89a..66f2dd1a1 100644 --- a/x/vault/client/cli/tx.go +++ b/x/vault/client/cli/tx.go @@ -4,12 +4,13 @@ import ( "fmt" "strconv" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/vault/types" ) @@ -62,12 +63,12 @@ func Create() *cobra.Command { return err } - amountIn, ok := sdk.NewIntFromString(args[2]) + amountIn, ok := sdkmath.NewIntFromString(args[2]) if !ok { return types.ErrorInvalidAmountIn } - amountOut, ok := sdk.NewIntFromString(args[3]) + amountOut, ok := sdkmath.NewIntFromString(args[3]) if !ok { return types.ErrorInvalidAmountOut } @@ -112,7 +113,7 @@ func Deposit() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[3]) + amount, ok := sdkmath.NewIntFromString(args[3]) if !ok { return types.ErrorInvalidAmount } @@ -155,7 +156,7 @@ func Withdraw() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[3]) + amount, ok := sdkmath.NewIntFromString(args[3]) if !ok { return types.ErrorInvalidAmount } @@ -198,7 +199,7 @@ func DrawDebt() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[3]) + amount, ok := sdkmath.NewIntFromString(args[3]) if !ok { return types.ErrorInvalidAmount } @@ -240,7 +241,7 @@ func RepayDebt() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[3]) + amount, ok := sdkmath.NewIntFromString(args[3]) if !ok { return types.ErrorInvalidAmount } @@ -319,7 +320,7 @@ func DepositAndDraw() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[3]) + amount, ok := sdkmath.NewIntFromString(args[3]) if !ok { return types.ErrorInvalidAmount } @@ -357,7 +358,7 @@ func CreateStableMint() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[2]) + amount, ok := sdkmath.NewIntFromString(args[2]) if !ok { return types.ErrorInvalidAmountIn } @@ -397,7 +398,7 @@ func DepositStableMint() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[2]) + amount, ok := sdkmath.NewIntFromString(args[2]) if !ok { return types.ErrorInvalidAmountIn } @@ -442,7 +443,7 @@ func WithdrawStableMint() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[2]) + amount, ok := sdkmath.NewIntFromString(args[2]) if !ok { return types.ErrorInvalidAmountIn } diff --git a/x/vault/client/testutil/helpers.go b/x/vault/client/testutil/helpers.go index b267cd74c..c42da310a 100644 --- a/x/vault/client/testutil/helpers.go +++ b/x/vault/client/testutil/helpers.go @@ -5,6 +5,8 @@ import ( "fmt" "strconv" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" @@ -28,7 +30,7 @@ var commonArgs = []string{ func MsgCreate( clientCtx client.Context, appMappingID, extendedPairVaultID uint64, - amountIn, amountOut sdk.Int, + amountIn, amountOut sdkmath.Int, from string, extraArgs ...string, ) (testutil.BufferWriter, error) { @@ -68,7 +70,7 @@ func (s *VaultIntegrationTestSuite) CreateNewApp(appName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: appName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -93,7 +95,7 @@ func (s *VaultIntegrationTestSuite) CreateNewAsset(name, denom string, price uin err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, }) @@ -170,15 +172,15 @@ func (s *VaultIntegrationTestSuite) CreateNewExtendedVaultPair(pairName string, err := s.app.AssetKeeper.WasmAddExtendedPairsVaultRecords(s.ctx, &bindings.MsgAddExtendedPairsVault{ AppID: appMappingID, PairID: pairID, - StabilityFee: sdk.NewDecWithPrec(2, 2), // 0.02 - ClosingFee: sdk.NewDec(0), - LiquidationPenalty: sdk.NewDecWithPrec(15, 2), // 0.15 - DrawDownFee: sdk.NewDecWithPrec(1, 2), // 0.01 + StabilityFee: sdkmath.LegacyNewDecWithPrec(2, 2), // 0.02 + ClosingFee: sdkmath.LegacyNewDec(0), + LiquidationPenalty: sdkmath.LegacyNewDecWithPrec(15, 2), // 0.15 + DrawDownFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 0.01 IsVaultActive: true, - DebtCeiling: sdk.NewInt(1000000000000000000), - DebtFloor: sdk.NewInt(100000000), + DebtCeiling: sdkmath.NewInt(1000000000000000000), + DebtFloor: sdkmath.NewInt(100000000), IsStableMintVault: false, - MinCr: sdk.NewDecWithPrec(23, 1), // 2.3 + MinCr: sdkmath.LegacyNewDecWithPrec(23, 1), // 2.3 PairName: pairName, AssetOutOraclePrice: true, AssetOutPrice: 1000000, diff --git a/x/vault/client/testutil/suite.go b/x/vault/client/testutil/suite.go index 2a0a5b7c6..ff2aec110 100644 --- a/x/vault/client/testutil/suite.go +++ b/x/vault/client/testutil/suite.go @@ -1,6 +1,7 @@ package testutil import ( + sdkmath "cosmossdk.io/math" "fmt" "testing" @@ -11,19 +12,19 @@ import ( vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" "github.com/comdex-official/comdex/x/vault/types" + pruningtypes "cosmossdk.io/store/pruning/types" "github.com/comdex-official/comdex/testutil/network" "github.com/cosmos/cosmos-sdk/baseapp" servertypes "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" - // store "github.com/cosmos/cosmos-sdk/store/types" + + // store "cosmossdk.io/core/store" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" networkI "github.com/cosmos/cosmos-sdk/testutil/network" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - dbm "github.com/cometbft/cometbft-db" tmcli "github.com/cometbft/cometbft/libs/cli" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" ) type VaultIntegrationTestSuite struct { @@ -41,7 +42,7 @@ func NewAppConstructor() networkI.AppConstructor { return func(val networkI.ValidatorI) servertypes.Application { return chain.New( val.GetCtx().Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), val.GetCtx().Config.RootDir, 0, - chain.MakeEncodingConfig(), simtestutil.EmptyAppOptions{}, chain.GetWasmEnabledProposals(), chain.EmptyWasmOpts, + chain.MakeEncodingConfig(), simtestutil.EmptyAppOptions{}, chain.EmptyWasmOpts, baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), ) @@ -56,7 +57,7 @@ func (s *VaultIntegrationTestSuite) SetupSuite() { } s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.msgServer = vaultKeeper.NewMsgServer(s.app.VaultKeeper) cfg := network.DefaultConfig() @@ -89,7 +90,7 @@ func (s *VaultIntegrationTestSuite) Create() { pairID := s.CreateNewPair(assetInID, assetOutID) extendedVaultPairID := s.CreateNewExtendedVaultPair("CMDX-C", appID, pairID) - _, _ = MsgCreate(s.val.ClientCtx, appID, extendedVaultPairID, sdk.NewInt(3), sdk.NewInt(2), s.val.Address.String()) + _, _ = MsgCreate(s.val.ClientCtx, appID, extendedVaultPairID, sdkmath.NewInt(3), sdkmath.NewInt(2), s.val.Address.String()) // s.Require().NoError(err) err := s.network.WaitForNextBlock() diff --git a/x/vault/expected/keeper.go b/x/vault/expected/keeper.go index b0ba1b0d8..4b5d549e8 100644 --- a/x/vault/expected/keeper.go +++ b/x/vault/expected/keeper.go @@ -1,6 +1,8 @@ package expected import ( + "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -9,16 +11,16 @@ import ( ) type BankKeeper interface { - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + BurnCoins(ctx context.Context, name string, coins sdk.Coins) error + MintCoins(ctx context.Context, name string, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, address sdk.AccAddress, name string, coins sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, name string, address sdk.AccAddress, coins sdk.Coins) error SendCoinsFromModuleToModule( - ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins, + ctx context.Context, senderModule, recipientModule string, amt sdk.Coins, ) error - SpendableCoins(ctx sdk.Context, address sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, address sdk.AccAddress) sdk.Coins } type AssetKeeper interface { @@ -29,11 +31,11 @@ type AssetKeeper interface { } type MarketKeeper interface { - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) } type CollectorKeeper interface { - UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdk.Int) error + UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdkmath.Int) error } type EsmKeeper interface { @@ -44,11 +46,11 @@ type EsmKeeper interface { } type TokenMintKeeper interface { - UpdateAssetDataInTokenMintByApp(ctx sdk.Context, appMappingID uint64, assetID uint64, changeType bool, amount sdk.Int) + UpdateAssetDataInTokenMintByApp(ctx sdk.Context, appMappingID uint64, assetID uint64, changeType bool, amount sdkmath.Int) } type RewardsKeeper interface { - CalculateVaultInterest(ctx sdk.Context, appID, assetID, lockerID uint64, NetBalance sdk.Int, blockHeight int64, lockerBlockTime int64) error + CalculateVaultInterest(ctx sdk.Context, appID, assetID, lockerID uint64, NetBalance sdkmath.Int, blockHeight int64, lockerBlockTime int64) error DeleteVaultInterestTracker(ctx sdk.Context, vault rewardstypes.VaultInterestTracker) GetExternalRewardStableVaultByApp(ctx sdk.Context, appID uint64) (VaultExternalRewards rewardstypes.StableVaultExternalRewards, found bool) VerifyAppIDInRewards(ctx sdk.Context, appID uint64) bool diff --git a/x/vault/genesis_test.go b/x/vault/genesis_test.go index 88d22185e..52976a0a5 100644 --- a/x/vault/genesis_test.go +++ b/x/vault/genesis_test.go @@ -6,13 +6,12 @@ import ( "github.com/comdex-official/comdex/app" "github.com/comdex-official/comdex/x/vault" "github.com/comdex-official/comdex/x/vault/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" ) func TestGenesis(t *testing.T) { comdexApp := app.Setup(t, false) - ctx := comdexApp.BaseApp.NewContext(false, tmproto.Header{}) + ctx := comdexApp.BaseApp.NewContext(false) genesisState := types.GenesisState{ Vaults: nil, diff --git a/x/vault/handler.go b/x/vault/handler.go index 9838f7164..a881e5f5b 100644 --- a/x/vault/handler.go +++ b/x/vault/handler.go @@ -1,6 +1,7 @@ package vault import ( + bam "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pkg/errors" @@ -8,7 +9,7 @@ import ( "github.com/comdex-official/comdex/x/vault/types" ) -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) bam.MsgServiceHandler { server := keeper.NewMsgServer(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { diff --git a/x/vault/handler_test.go b/x/vault/handler_test.go index ea38d42a5..22454f50f 100644 --- a/x/vault/handler_test.go +++ b/x/vault/handler_test.go @@ -1,6 +1,8 @@ package vault_test import ( + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" "strings" "testing" @@ -13,7 +15,6 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" ) @@ -29,7 +30,7 @@ func TestInvalidMsg(t *testing.T) { require.Error(t, err) require.Nil(t, res) - _, _, log := sdkerrors.ABCIInfo(err, false) + _, _, log := errorsmod.ABCIInfo(err, false) require.True(t, strings.Contains(log, "unknown message type")) } @@ -43,7 +44,7 @@ func (s *ModuleTestSuite) TestMsgCreate() { extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, false, true) msg := types.NewMsgCreateRequest( - addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), sdk.NewInt(200000000), + addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), sdkmath.NewInt(200000000), ) s.fundAddr(addr1, sdk.NewCoins(sdk.NewCoin("uasset1", msg.AmountIn))) @@ -52,7 +53,7 @@ func (s *ModuleTestSuite) TestMsgCreate() { s.Require().NoError(err) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(addr1.String())) - s.Require().True(sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(198000000))).IsEqual(availableBalances)) + s.Require().True(sdk.NewCoins(sdk.NewCoin("uasset2", sdkmath.NewInt(198000000))).Equal(availableBalances)) vaults := s.keeper.GetVaults(s.ctx) s.Require().Len(vaults, 1) @@ -74,14 +75,14 @@ func (s *ModuleTestSuite) TestMsgDeposit() { pairID := s.CreateNewPair(addr1, asseOneID, asseTwoID) extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, false, true) - msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), sdk.NewInt(200000000)) + msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), sdkmath.NewInt(200000000)) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgCreate.AmountIn))) _, err := handler(s.ctx, msgCreate) s.Require().NoError(err) msgDeposit := types.NewMsgDepositRequest( - addr1, appID1, extendedVaultPairID1, 1, sdk.NewInt(69000000), + addr1, appID1, extendedVaultPairID1, 1, sdkmath.NewInt(69000000), ) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgDeposit.Amount))) @@ -108,14 +109,14 @@ func (s *ModuleTestSuite) TestMsgWithdraw() { pairID := s.CreateNewPair(addr1, asseOneID, asseTwoID) extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, false, true) - msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), sdk.NewInt(200000000)) + msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), sdkmath.NewInt(200000000)) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgCreate.AmountIn))) _, err := handler(s.ctx, msgCreate) s.Require().NoError(err) msgWithdraw := types.NewMsgWithdrawRequest( - addr1, appID1, extendedVaultPairID1, 1, sdk.NewInt(50000000), + addr1, appID1, extendedVaultPairID1, 1, sdkmath.NewInt(50000000), ) _, err = handler(s.ctx, msgWithdraw) s.Require().NoError(err) @@ -140,14 +141,14 @@ func (s *ModuleTestSuite) TestMsgDraw() { pairID := s.CreateNewPair(addr1, asseOneID, asseTwoID) extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, false, true) - msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), sdk.NewInt(200000000)) + msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), sdkmath.NewInt(200000000)) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgCreate.AmountIn))) _, err := handler(s.ctx, msgCreate) s.Require().NoError(err) msgDraw := types.NewMsgDrawRequest( - addr1, appID1, extendedVaultPairID1, 1, sdk.NewInt(10000000), + addr1, appID1, extendedVaultPairID1, 1, sdkmath.NewInt(10000000), ) _, err = handler(s.ctx, msgDraw) s.Require().NoError(err) @@ -172,14 +173,14 @@ func (s *ModuleTestSuite) TestMsgDepositAndDraw() { pairID := s.CreateNewPair(addr1, asseOneID, asseTwoID) extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, false, true) - msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), sdk.NewInt(200000000)) + msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), sdkmath.NewInt(200000000)) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgCreate.AmountIn))) _, err := handler(s.ctx, msgCreate) s.Require().NoError(err) msgDepositAndDraw := types.NewMsgDepositAndDrawRequest( - addr1, appID1, extendedVaultPairID1, 1, sdk.NewInt(69000000), + addr1, appID1, extendedVaultPairID1, 1, sdkmath.NewInt(69000000), ) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgDepositAndDraw.Amount))) @@ -205,7 +206,7 @@ func (s *ModuleTestSuite) TestMsgVaultInterestCalcRequest() { pairID := s.CreateNewPair(addr1, asseOneID, asseTwoID) extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, false, true) - msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), sdk.NewInt(200000000)) + msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), sdkmath.NewInt(200000000)) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgCreate.AmountIn))) _, err := handler(s.ctx, msgCreate) @@ -237,14 +238,14 @@ func (s *ModuleTestSuite) TestMsgRepay() { pairID := s.CreateNewPair(addr1, asseOneID, asseTwoID) extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, false, true) - msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), sdk.NewInt(200000000)) + msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), sdkmath.NewInt(200000000)) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgCreate.AmountIn))) _, err := handler(s.ctx, msgCreate) s.Require().NoError(err) msgRepay := types.NewMsgRepayRequest( - addr1, appID1, extendedVaultPairID1, 1, sdk.NewInt(100000000), + addr1, appID1, extendedVaultPairID1, 1, sdkmath.NewInt(100000000), ) _, err = handler(s.ctx, msgRepay) s.Require().NoError(err) @@ -269,13 +270,13 @@ func (s *ModuleTestSuite) TestMsgClose() { pairID := s.CreateNewPair(addr1, asseOneID, asseTwoID) extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, false, true) - msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), sdk.NewInt(200000000)) + msgCreate := types.NewMsgCreateRequest(addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), sdkmath.NewInt(200000000)) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgCreate.AmountIn))) _, err := handler(s.ctx, msgCreate) s.Require().NoError(err) - s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(2000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset2", sdkmath.NewInt(2000000)))) msgRepay := types.NewMsgLiquidateRequest( addr1, appID1, extendedVaultPairID1, 1, @@ -298,7 +299,7 @@ func (s *ModuleTestSuite) TestMsgCreateStableMint() { extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, true, true) msgStableMintCreate := types.NewMsgCreateStableMintRequest( - addr1, appID1, extendedVaultPairID1, sdk.NewInt(100000000), + addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(100000000), ) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgStableMintCreate.Amount))) @@ -324,7 +325,7 @@ func (s *ModuleTestSuite) TestMsgDepositStableMint() { extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, true, true) msgStableMintCreate := types.NewMsgCreateStableMintRequest( - addr1, appID1, extendedVaultPairID1, sdk.NewInt(100000000), + addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(100000000), ) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgStableMintCreate.Amount))) @@ -332,7 +333,7 @@ func (s *ModuleTestSuite) TestMsgDepositStableMint() { s.Require().NoError(err) msgStableMintDeposit := types.NewMsgDepositStableMintRequest( - addr1, appID1, extendedVaultPairID1, sdk.NewInt(2000000000), 1, + addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(2000000000), 1, ) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgStableMintDeposit.Amount))) @@ -358,7 +359,7 @@ func (s *ModuleTestSuite) TestMsgWithdrawStableMint() { extendedVaultPairID1 := s.CreateNewExtendedVaultPair("CMDX-C", appID1, pairID, true, true) msgStableMintCreate := types.NewMsgCreateStableMintRequest( - addr1, appID1, extendedVaultPairID1, sdk.NewInt(1000000000), + addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(1000000000), ) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgStableMintCreate.Amount))) @@ -366,7 +367,7 @@ func (s *ModuleTestSuite) TestMsgWithdrawStableMint() { s.Require().NoError(err) msgStableMintWithdraw := types.NewMsgWithdrawStableMintRequest( - addr1, appID1, extendedVaultPairID1, sdk.NewInt(500000000), 1, + addr1, appID1, extendedVaultPairID1, sdkmath.NewInt(500000000), 1, ) s.fundAddr(sdk.MustAccAddressFromBech32(addr1.String()), sdk.NewCoins(sdk.NewCoin("uasset1", msgStableMintWithdraw.Amount))) @@ -375,8 +376,8 @@ func (s *ModuleTestSuite) TestMsgWithdrawStableMint() { stableMintVaults := s.querier.GetStableMintVaults(s.ctx) s.Require().Equal(uint64(1), stableMintVaults[0].Id) - s.Require().Equal(sdk.NewInt(505000000), stableMintVaults[0].AmountIn) - s.Require().Equal(sdk.NewInt(505000000), stableMintVaults[0].AmountOut) + s.Require().Equal(sdkmath.NewInt(505000000), stableMintVaults[0].AmountIn) + s.Require().Equal(sdkmath.NewInt(505000000), stableMintVaults[0].AmountOut) s.Require().Equal(appID1, stableMintVaults[0].AppId) s.Require().Equal(extendedVaultPairID1, stableMintVaults[0].ExtendedPairVaultID) } diff --git a/x/vault/keeper/keeper.go b/x/vault/keeper/keeper.go index 547464972..6a8babdba 100644 --- a/x/vault/keeper/keeper.go +++ b/x/vault/keeper/keeper.go @@ -3,13 +3,13 @@ package keeper import ( "fmt" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cometbft/cometbft/libs/log" + storetypes "cosmossdk.io/store/types" "github.com/comdex-official/comdex/x/vault/expected" "github.com/comdex-official/comdex/x/vault/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" ) type Keeper struct { @@ -42,6 +42,6 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { +func (k Keeper) Store(ctx sdk.Context) storetypes.KVStore { return ctx.KVStore(k.key) } diff --git a/x/vault/keeper/keeper_test.go b/x/vault/keeper/keeper_test.go index eb09966e6..a04642cf0 100644 --- a/x/vault/keeper/keeper_test.go +++ b/x/vault/keeper/keeper_test.go @@ -4,12 +4,13 @@ import ( "encoding/binary" "testing" + sdkmath "cosmossdk.io/math" + rewardsKeeper "github.com/comdex-official/comdex/x/rewards/keeper" "github.com/comdex-official/comdex/app/wasm/bindings" "github.com/stretchr/testify/suite" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" chain "github.com/comdex-official/comdex/app" @@ -37,7 +38,7 @@ func TestKeeperTestSuite(t *testing.T) { func (s *KeeperTestSuite) SetupTest() { s.app = chain.Setup(s.T(), false) - s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.ctx = s.app.BaseApp.NewContext(false) s.keeper = s.app.VaultKeeper s.querier = keeper.QueryServer{Keeper: s.keeper} s.msgServer = keeper.NewMsgServer(s.keeper) @@ -74,12 +75,12 @@ func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, amt sdk.Coins) { s.Require().NoError(err) } -func newInt(i int64) sdk.Int { - return sdk.NewInt(i) +func newInt(i int64) sdkmath.Int { + return sdkmath.NewInt(i) } -func newIntStr(i string) sdk.Int { - res, _ := sdk.NewIntFromString(i) +func newIntStr(i string) sdkmath.Int { + res, _ := sdkmath.NewIntFromString(i) return res } @@ -87,7 +88,7 @@ func (s *KeeperTestSuite) CreateNewApp(appName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: appName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -112,7 +113,7 @@ func (s *KeeperTestSuite) CreateNewAsset(name, denom string, price uint64) uint6 err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: true, @@ -169,15 +170,15 @@ func (s *KeeperTestSuite) CreateNewExtendedVaultPair( err := s.app.AssetKeeper.WasmAddExtendedPairsVaultRecords(s.ctx, &bindings.MsgAddExtendedPairsVault{ AppID: appMappingID, PairID: pairID, - StabilityFee: sdk.NewDecWithPrec(2, 2), // 0.02 - ClosingFee: sdk.NewDec(0), - LiquidationPenalty: sdk.NewDecWithPrec(15, 2), // 0.15 - DrawDownFee: sdk.NewDecWithPrec(1, 2), // 0.01 + StabilityFee: sdkmath.LegacyNewDecWithPrec(2, 2), // 0.02 + ClosingFee: sdkmath.LegacyNewDec(0), + LiquidationPenalty: sdkmath.LegacyNewDecWithPrec(15, 2), // 0.15 + DrawDownFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 0.01 IsVaultActive: isVaultActive, - DebtCeiling: sdk.NewInt(1000000000000000000), - DebtFloor: sdk.NewInt(100000000), + DebtCeiling: sdkmath.NewInt(1000000000000000000), + DebtFloor: sdkmath.NewInt(100000000), IsStableMintVault: isStableMintVault, - MinCr: sdk.NewDecWithPrec(23, 1), // 2.3 + MinCr: sdkmath.LegacyNewDecWithPrec(23, 1), // 2.3 PairName: pairName, AssetOutOraclePrice: true, AssetOutPrice: 1000000, diff --git a/x/vault/keeper/msg_server.go b/x/vault/keeper/msg_server.go index ef12948ba..a1b8e004d 100644 --- a/x/vault/keeper/msg_server.go +++ b/x/vault/keeper/msg_server.go @@ -4,6 +4,8 @@ import ( "context" "strconv" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" @@ -104,7 +106,7 @@ func (k msgServer) MsgCreate(c context.Context, msg *types.MsgCreateRequest) (*t return nil, err } // Take amount from user - if msg.AmountIn.GT(sdk.ZeroInt()) { + if msg.AmountIn.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromAccountToModule(ctx, depositorAddress, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetInData.Denom, msg.AmountIn))); err != nil { return nil, err } @@ -121,21 +123,21 @@ func (k msgServer) MsgCreate(c context.Context, msg *types.MsgCreateRequest) (*t // Send Fees to Accumulator // Deducting Opening Fee if 0 opening fee then act accordingly - if extendedPairVault.DrawDownFee.IsZero() && msg.AmountOut.GT(sdk.ZeroInt()) { // Send Rest to user + if extendedPairVault.DrawDownFee.IsZero() && msg.AmountOut.GT(sdkmath.ZeroInt()) { // Send Rest to user if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositorAddress, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, msg.AmountOut))); err != nil { return nil, err } } else { // If not zero deduct send to collector////////// // one approach could be - collectorShare := sdk.NewDecFromInt(msg.AmountOut).Mul(extendedPairVault.DrawDownFee).TruncateInt() + collectorShare := sdkmath.LegacyNewDecFromInt(msg.AmountOut).Mul(extendedPairVault.DrawDownFee).TruncateInt() - if collectorShare.GT(sdk.ZeroInt()) { + if collectorShare.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, collectorShare))); err != nil { return nil, err } - err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdk.ZeroInt(), sdk.ZeroInt(), collectorShare, sdk.ZeroInt()) + err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdkmath.ZeroInt(), sdkmath.ZeroInt(), collectorShare, sdkmath.ZeroInt()) if err != nil { return nil, err } @@ -143,7 +145,7 @@ func (k msgServer) MsgCreate(c context.Context, msg *types.MsgCreateRequest) (*t // and send the rest to the user amountToUser := msg.AmountOut.Sub(collectorShare) - if amountToUser.GT(sdk.ZeroInt()) { + if amountToUser.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositorAddress, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, amountToUser))); err != nil { return nil, err } @@ -157,14 +159,14 @@ func (k msgServer) MsgCreate(c context.Context, msg *types.MsgCreateRequest) (*t // If all correct create vault oldID := k.GetIDForVault(ctx) - zeroVal := sdk.ZeroInt() + zeroVal := sdkmath.ZeroInt() var newVault types.Vault updatedID := oldID + 1 newVault.Id = updatedID newVault.AmountIn = msg.AmountIn - // closingFeeVal := msg.AmountOut.Mul(sdk.Int(extendedPairVault.ClosingFee)).Quo(sdk.Int(sdk.OneDec())) - closingFeeVal := sdk.NewDecFromInt(msg.AmountOut).Mul(extendedPairVault.ClosingFee).TruncateInt() + // closingFeeVal := msg.AmountOut.Mul(sdkmath.Int(extendedPairVault.ClosingFee)).Quo(sdkmath.Int(sdkmath.LegacyOneDec())) + closingFeeVal := sdkmath.LegacyNewDecFromInt(msg.AmountOut).Mul(extendedPairVault.ClosingFee).TruncateInt() newVault.ClosingFeeAccumulated = closingFeeVal newVault.AmountOut = msg.AmountOut @@ -292,7 +294,7 @@ func (k msgServer) MsgDeposit(c context.Context, msg *types.MsgDepositRequest) ( return nil, types.ErrorInvalidAmount } - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromAccountToModule(ctx, depositor, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetInData.Denom, msg.Amount))); err != nil { return nil, err } @@ -410,7 +412,7 @@ func (k msgServer) MsgWithdraw(c context.Context, msg *types.MsgWithdrawRequest) if err := k.VerifyCollaterlizationRatio(ctx, extendedPairVault.Id, userVault.AmountIn, totalDebtCalculation, extendedPairVault.MinCr, status); err != nil { return nil, err } - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, sdk.NewCoins(sdk.NewCoin(assetInData.Denom, msg.Amount))); err != nil { return nil, err } @@ -500,7 +502,7 @@ func (k msgServer) MsgDraw(c context.Context, msg *types.MsgDrawRequest) (*types if extendedPairVault.Id != userVault.ExtendedPairVaultID { return nil, types.ErrorInvalidExtendedPairMappingData } - if msg.Amount.LTE(sdk.NewInt(0)) { + if msg.Amount.LTE(sdkmath.NewInt(0)) { return nil, types.ErrorInvalidAmount } @@ -540,7 +542,7 @@ func (k msgServer) MsgDraw(c context.Context, msg *types.MsgDrawRequest) (*types return nil, err } - if extendedPairVault.DrawDownFee.IsZero() && msg.Amount.GT(sdk.ZeroInt()) { + if extendedPairVault.DrawDownFee.IsZero() && msg.Amount.GT(sdkmath.ZeroInt()) { // Send Rest to user if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, msg.Amount))); err != nil { return nil, err @@ -548,21 +550,21 @@ func (k msgServer) MsgDraw(c context.Context, msg *types.MsgDrawRequest) (*types } else { // If not zero deduct send to collector////////// // one approach could be - collectorShare := sdk.NewDecFromInt(msg.Amount).Mul(extendedPairVault.DrawDownFee).TruncateInt() + collectorShare := sdkmath.LegacyNewDecFromInt(msg.Amount).Mul(extendedPairVault.DrawDownFee).TruncateInt() - if collectorShare.GT(sdk.ZeroInt()) { + if collectorShare.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, collectorShare))); err != nil { return nil, err } - err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdk.ZeroInt(), sdk.ZeroInt(), collectorShare, sdk.ZeroInt()) + err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdkmath.ZeroInt(), sdkmath.ZeroInt(), collectorShare, sdkmath.ZeroInt()) if err != nil { return nil, err } } // and send the rest to the user amountToUser := msg.Amount.Sub(collectorShare) - if amountToUser.GT(sdk.ZeroInt()) { + if amountToUser.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, amountToUser))); err != nil { return nil, err } @@ -653,7 +655,7 @@ func (k msgServer) MsgRepay(c context.Context, msg *types.MsgRepayRequest) (*typ if extendedPairVault.Id != userVault.ExtendedPairVaultID { return nil, types.ErrorInvalidExtendedPairMappingData } - if msg.Amount.LTE(sdk.NewInt(0)) { + if msg.Amount.LTE(sdkmath.NewInt(0)) { return nil, types.ErrorInvalidAmount } @@ -670,7 +672,7 @@ func (k msgServer) MsgRepay(c context.Context, msg *types.MsgRepayRequest) (*typ newAmount := userVault.AmountOut.Add(userVault.InterestAccumulated) newAmount = newAmount.Sub(msg.Amount) - if newAmount.LT(sdk.NewInt(0)) { + if newAmount.LT(sdkmath.NewInt(0)) { return nil, types.ErrorInvalidAmount } @@ -680,7 +682,7 @@ func (k msgServer) MsgRepay(c context.Context, msg *types.MsgRepayRequest) (*typ reducedFees := userVault.InterestAccumulated.Sub(msg.Amount) userVault.InterestAccumulated = reducedFees // and send it to the collector module - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromAccountToModule(ctx, depositor, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, msg.Amount))); err != nil { return nil, err } @@ -688,7 +690,7 @@ func (k msgServer) MsgRepay(c context.Context, msg *types.MsgRepayRequest) (*typ if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, msg.Amount))); err != nil { return nil, err } - err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, msg.Amount, sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroInt()) + err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, msg.Amount, sdkmath.ZeroInt(), sdkmath.ZeroInt(), sdkmath.ZeroInt()) if err != nil { return nil, err } @@ -706,12 +708,12 @@ func (k msgServer) MsgRepay(c context.Context, msg *types.MsgRepayRequest) (*typ if !updatedUserDebt.GTE(extendedPairVault.DebtFloor) { return nil, types.ErrorAmountOutLessThanDebtFloor } - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromAccountToModule(ctx, depositor, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, msg.Amount))); err != nil { return nil, err } } - if updatedUserSentAmountAfterFeesDeduction.GT(sdk.ZeroInt()) { + if updatedUserSentAmountAfterFeesDeduction.GT(sdkmath.ZeroInt()) { burnCoin := sdk.NewCoin(assetOutData.Denom, updatedUserSentAmountAfterFeesDeduction) if burnCoin.IsZero() { return nil, types.BurnCoinValueInVaultIsZero @@ -721,18 +723,18 @@ func (k msgServer) MsgRepay(c context.Context, msg *types.MsgRepayRequest) (*typ } } // SEND TO COLLECTOR----userVault.InterestAccumulated - if userVault.InterestAccumulated.GT(sdk.ZeroInt()) { + if userVault.InterestAccumulated.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, userVault.InterestAccumulated))); err != nil { return nil, err } - err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, userVault.InterestAccumulated, sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroInt()) + err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, userVault.InterestAccumulated, sdkmath.ZeroInt(), sdkmath.ZeroInt(), sdkmath.ZeroInt()) if err != nil { return nil, err } } userVault.AmountOut = updatedUserDebt - zeroVal := sdk.ZeroInt() + zeroVal := sdkmath.ZeroInt() userVault.InterestAccumulated = zeroVal userVault.BlockHeight = ctx.BlockHeight() userVault.BlockTime = ctx.BlockTime() @@ -834,7 +836,7 @@ func (k msgServer) MsgClose(c context.Context, msg *types.MsgCloseRequest) (*typ totalUserDebt := userVault.AmountOut.Add(userVault.InterestAccumulated) totalUserDebt = totalUserDebt.Add(userVault.ClosingFeeAccumulated) - if totalUserDebt.GT(sdk.ZeroInt()) { + if totalUserDebt.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromAccountToModule(ctx, depositor, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, totalUserDebt))); err != nil { return nil, err } @@ -842,21 +844,21 @@ func (k msgServer) MsgClose(c context.Context, msg *types.MsgCloseRequest) (*typ // SEND TO COLLECTOR----userVault.InterestAccumulated & userVault.ClosingFees - err = k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, userVault.InterestAccumulated, userVault.ClosingFeeAccumulated, sdk.ZeroInt(), sdk.ZeroInt()) + err = k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, userVault.InterestAccumulated, userVault.ClosingFeeAccumulated, sdkmath.ZeroInt(), sdkmath.ZeroInt()) if err != nil { return nil, err } - if userVault.InterestAccumulated.GT(sdk.ZeroInt()) { + if userVault.InterestAccumulated.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, userVault.InterestAccumulated))); err != nil { return nil, err } } - if userVault.ClosingFeeAccumulated.GT(sdk.ZeroInt()) { + if userVault.ClosingFeeAccumulated.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, userVault.ClosingFeeAccumulated))); err != nil { return nil, err } } - if userVault.AmountOut.GT(sdk.ZeroInt()) { + if userVault.AmountOut.GT(sdkmath.ZeroInt()) { burnCoin := sdk.NewCoin(assetOutData.Denom, userVault.AmountOut) if burnCoin.IsZero() { return nil, types.BurnCoinValueInVaultIsZero @@ -865,7 +867,7 @@ func (k msgServer) MsgClose(c context.Context, msg *types.MsgCloseRequest) (*typ return nil, err } } - if userVault.AmountIn.GT(sdk.ZeroInt()) { + if userVault.AmountIn.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, sdk.NewCoins(sdk.NewCoin(assetInData.Denom, userVault.AmountIn))); err != nil { return nil, err } @@ -1003,7 +1005,7 @@ func (k msgServer) MsgCreateStableMint(c context.Context, msg *types.MsgCreateSt } // Call CheckAppExtendedPairVaultMapping function to get counter - it also initialised the kv store if appMapping_id does not exists, or extendedPairVault_id does not exists. - _, tokenOutAmount, err := k.GetAmountOfOtherToken(ctx, assetInData.Id, sdk.OneDec(), msg.Amount, assetOutData.Id, sdk.OneDec()) + _, tokenOutAmount, err := k.GetAmountOfOtherToken(ctx, assetInData.Id, sdkmath.LegacyOneDec(), msg.Amount, assetOutData.Id, sdkmath.LegacyOneDec()) if err != nil { return nil, err } @@ -1026,9 +1028,9 @@ func (k msgServer) MsgCreateStableMint(c context.Context, msg *types.MsgCreateSt if currentMintedStatistics.GTE(extendedPairVault.DebtCeiling) { return nil, types.ErrorAmountOutGreaterThanDebtCeiling } - var amountToUser sdk.Int + var amountToUser sdkmath.Int - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { // Take amount from user if err := k.bank.SendCoinsFromAccountToModule(ctx, depositorAddress, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetInData.Denom, msg.Amount))); err != nil { return nil, err @@ -1044,7 +1046,7 @@ func (k msgServer) MsgCreateStableMint(c context.Context, msg *types.MsgCreateSt } } - if extendedPairVault.DrawDownFee.IsZero() && msg.Amount.GT(sdk.ZeroInt()) { + if extendedPairVault.DrawDownFee.IsZero() && msg.Amount.GT(sdkmath.ZeroInt()) { // Send Rest to user if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositorAddress, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, msg.Amount))); err != nil { return nil, err @@ -1052,14 +1054,14 @@ func (k msgServer) MsgCreateStableMint(c context.Context, msg *types.MsgCreateSt } else { // If not zero deduct send to collector////////// // COLLECTOR FUNCTION - // collectorShare := (tokenOutAmount.Mul(sdk.Int(extendedPairVault.DrawDownFee))).Quo(sdk.Int(sdk.OneDec())) - collectorShare := sdk.NewDecFromInt(tokenOutAmount).Mul(extendedPairVault.DrawDownFee).TruncateInt() + // collectorShare := (tokenOutAmount.Mul(sdkmath.Int(extendedPairVault.DrawDownFee))).Quo(sdkmath.Int(sdkmath.LegacyOneDec())) + collectorShare := sdkmath.LegacyNewDecFromInt(tokenOutAmount).Mul(extendedPairVault.DrawDownFee).TruncateInt() - if collectorShare.GT(sdk.ZeroInt()) { + if collectorShare.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, collectorShare))); err != nil { return nil, err } - err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdk.ZeroInt(), sdk.ZeroInt(), collectorShare, sdk.ZeroInt()) + err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdkmath.ZeroInt(), sdkmath.ZeroInt(), collectorShare, sdkmath.ZeroInt()) if err != nil { return nil, err } @@ -1068,7 +1070,7 @@ func (k msgServer) MsgCreateStableMint(c context.Context, msg *types.MsgCreateSt // and send the rest to the user // amountToUser := msg.Amount.Sub(collectorShare) amountToUser = tokenOutAmount.Sub(collectorShare) - if amountToUser.GT(sdk.ZeroInt()) { + if amountToUser.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositorAddress, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, amountToUser))); err != nil { return nil, err } @@ -1179,7 +1181,7 @@ func (k msgServer) MsgDepositStableMint(c context.Context, msg *types.MsgDeposit // Looking for a case where apart from create function , this function creates new vaults and its data. tokenMintedStatistics, _ := k.CheckAppExtendedPairVaultMapping(ctx, appMapping.Id, extendedPairVault.Id) - _, tokenOutAmount, err := k.GetAmountOfOtherToken(ctx, assetInData.Id, sdk.OneDec(), msg.Amount, assetOutData.Id, sdk.OneDec()) + _, tokenOutAmount, err := k.GetAmountOfOtherToken(ctx, assetInData.Id, sdkmath.LegacyOneDec(), msg.Amount, assetOutData.Id, sdkmath.LegacyOneDec()) if err != nil { return nil, err } @@ -1194,9 +1196,9 @@ func (k msgServer) MsgDepositStableMint(c context.Context, msg *types.MsgDeposit if currentMintedStatistics.GTE(extendedPairVault.DebtCeiling) { return nil, types.ErrorAmountOutGreaterThanDebtCeiling } - var amountToUser sdk.Int + var amountToUser sdkmath.Int - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { // Take amount from user if err := k.bank.SendCoinsFromAccountToModule(ctx, depositorAddress, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetInData.Denom, msg.Amount))); err != nil { return nil, err @@ -1211,7 +1213,7 @@ func (k msgServer) MsgDepositStableMint(c context.Context, msg *types.MsgDeposit return nil, err } } - if extendedPairVault.DrawDownFee.IsZero() && msg.Amount.GT(sdk.ZeroInt()) { + if extendedPairVault.DrawDownFee.IsZero() && msg.Amount.GT(sdkmath.ZeroInt()) { // Send Rest to user if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositorAddress, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, tokenOutAmount))); err != nil { return nil, err @@ -1221,13 +1223,13 @@ func (k msgServer) MsgDepositStableMint(c context.Context, msg *types.MsgDeposit // COLLECTOR FUNCTION ///////////////////////////////////////////////// - collectorShare := sdk.NewDecFromInt(tokenOutAmount).Mul(extendedPairVault.DrawDownFee).TruncateInt() + collectorShare := sdkmath.LegacyNewDecFromInt(tokenOutAmount).Mul(extendedPairVault.DrawDownFee).TruncateInt() - if collectorShare.GT(sdk.ZeroInt()) { + if collectorShare.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, collectorShare))); err != nil { return nil, err } - err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdk.ZeroInt(), sdk.ZeroInt(), collectorShare, sdk.ZeroInt()) + err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdkmath.ZeroInt(), sdkmath.ZeroInt(), collectorShare, sdkmath.ZeroInt()) if err != nil { return nil, err } @@ -1236,7 +1238,7 @@ func (k msgServer) MsgDepositStableMint(c context.Context, msg *types.MsgDeposit // and send the rest to the user // amountToUser := msg.Amount.Sub(collectorShare) amountToUser = tokenOutAmount.Sub(collectorShare) - if amountToUser.GT(sdk.ZeroInt()) { + if amountToUser.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositorAddress, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, amountToUser))); err != nil { return nil, err } @@ -1333,26 +1335,26 @@ func (k msgServer) MsgWithdrawStableMint(c context.Context, msg *types.MsgWithdr return nil, types.ErrorInvalidExtendedPairMappingData } - _, tokenOutAmount, err := k.GetAmountOfOtherToken(ctx, assetOutData.Id, sdk.OneDec(), msg.Amount, assetInData.Id, sdk.OneDec()) + _, tokenOutAmount, err := k.GetAmountOfOtherToken(ctx, assetOutData.Id, sdkmath.LegacyOneDec(), msg.Amount, assetInData.Id, sdkmath.LegacyOneDec()) if err != nil { return nil, nil } // stableAmountIn := stableVault.AmountIn.Sub(msg.Amount) stableAmountIn := stableVault.AmountIn.Sub(tokenOutAmount) - if stableAmountIn.LT(sdk.NewInt(0)) { + if stableAmountIn.LT(sdkmath.NewInt(0)) { return nil, types.ErrorInvalidAmount } // updated amount is the CMST amount - var updatedAmount sdk.Int + var updatedAmount sdkmath.Int // Take amount from user - if msg.Amount.GT(sdk.ZeroInt()) { + if msg.Amount.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromAccountToModule(ctx, depositorAddress, types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, msg.Amount))); err != nil { return nil, err } } - if extendedPairVault.DrawDownFee.IsZero() && msg.Amount.GT(sdk.ZeroInt()) { + if extendedPairVault.DrawDownFee.IsZero() && msg.Amount.GT(sdkmath.ZeroInt()) { // BurnTokens for user burnCoin := sdk.NewCoin(assetOutData.Denom, msg.Amount) if burnCoin.IsZero() { @@ -1371,14 +1373,14 @@ func (k msgServer) MsgWithdrawStableMint(c context.Context, msg *types.MsgWithdr //If not zero deduct send to collector////////// // COLLECTOR FUNCTION ///////////////////////////////////////////////// - //collectorShare := (msg.Amount.Mul(sdk.Int(extendedPairVault.DrawDownFee))).Quo(sdk.Int(sdk.OneDec())) - collectorShare := sdk.NewDecFromInt(msg.Amount).Mul(extendedPairVault.DrawDownFee).TruncateInt() + //collectorShare := (msg.Amount.Mul(sdkmath.Int(extendedPairVault.DrawDownFee))).Quo(sdkmath.Int(sdkmath.LegacyOneDec())) + collectorShare := sdkmath.LegacyNewDecFromInt(msg.Amount).Mul(extendedPairVault.DrawDownFee).TruncateInt() - if collectorShare.GT(sdk.ZeroInt()) { + if collectorShare.GT(sdkmath.ZeroInt()) { if err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetOutData.Denom, collectorShare))); err != nil { return nil, err } - err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdk.ZeroInt(), sdk.ZeroInt(), collectorShare, sdk.ZeroInt()) + err := k.collector.UpdateCollector(ctx, appMapping.Id, pairData.AssetOut, sdkmath.ZeroInt(), sdkmath.ZeroInt(), collectorShare, sdkmath.ZeroInt()) if err != nil { return nil, err } @@ -1386,7 +1388,7 @@ func (k msgServer) MsgWithdrawStableMint(c context.Context, msg *types.MsgWithdr updatedAmount = msg.Amount.Sub(collectorShare) - if updatedAmount.GT(sdk.ZeroInt()) { + if updatedAmount.GT(sdkmath.ZeroInt()) { // BurnTokens for user burnCoin := sdk.NewCoin(assetOutData.Denom, updatedAmount) if burnCoin.IsZero() { @@ -1397,7 +1399,7 @@ func (k msgServer) MsgWithdrawStableMint(c context.Context, msg *types.MsgWithdr } // and send the rest to the user - _, newOutAmount, err := k.GetAmountOfOtherToken(ctx, assetOutData.Id, sdk.OneDec(), updatedAmount, assetInData.Id, sdk.OneDec()) + _, newOutAmount, err := k.GetAmountOfOtherToken(ctx, assetOutData.Id, sdkmath.LegacyOneDec(), updatedAmount, assetInData.Id, sdkmath.LegacyOneDec()) if err != nil { return nil, err } diff --git a/x/vault/keeper/msg_server_test.go b/x/vault/keeper/msg_server_test.go index 7a9356730..b0aa4819f 100644 --- a/x/vault/keeper/msg_server_test.go +++ b/x/vault/keeper/msg_server_test.go @@ -249,7 +249,7 @@ func (s *KeeperTestSuite) TestMsgCreate() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) vaults := s.keeper.GetVaults(s.ctx) s.Require().Equal(tc.QueryResponse.Id, vaults[tc.QueryResponseIndex].Id) @@ -463,7 +463,7 @@ func (s *KeeperTestSuite) TestMsgDeposit() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) vaults := s.keeper.GetVaults(s.ctx) s.Require().Len(vaults, 2) @@ -673,7 +673,7 @@ func (s *KeeperTestSuite) TestMsgWithdraw() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) vaults := s.keeper.GetVaults(s.ctx) s.Require().Len(vaults, 2) @@ -883,7 +883,7 @@ func (s *KeeperTestSuite) TestMsgDraw() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) vaults := s.keeper.GetVaults(s.ctx) s.Require().Len(vaults, 2) @@ -1094,7 +1094,7 @@ func (s *KeeperTestSuite) TestMsgRepay() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) vaults := s.keeper.GetVaults(s.ctx) s.Require().Len(vaults, 2) @@ -1256,7 +1256,7 @@ func (s *KeeperTestSuite) TestMsgClose() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) vaults := s.keeper.GetVaults(s.ctx) s.Require().Len(vaults, int(tc.AvailableVaultsLen)) @@ -1532,7 +1532,7 @@ func (s *KeeperTestSuite) TestMsgCreateStableMint() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) stableMintVaults := s.querier.GetStableMintVaults(s.ctx) s.Require().Equal(tc.QueryResponse.Id, stableMintVaults[tc.QueryRespIndex].Id) @@ -1742,7 +1742,7 @@ func (s *KeeperTestSuite) TestMsgDepositStableMint() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) stableMintVaults := s.querier.GetStableMintVaults(s.ctx) s.Require().Equal(tc.QueryResponse.Id, stableMintVaults[tc.QueryRespIndex].Id) @@ -1999,7 +1999,7 @@ func (s *KeeperTestSuite) TestMsgWithdrawStableMint() { s.Require().Equal(tc.ExpResp, resp) availableBalances := s.getBalances(sdk.MustAccAddressFromBech32(tc.Msg.From)) - s.Require().True(tc.AvailableBalance.IsEqual(availableBalances)) + s.Require().True(tc.AvailableBalance.Equal(availableBalances)) stableMintVaults := s.querier.GetStableMintVaults(s.ctx) s.Require().Equal(tc.QueryResponse.Id, stableMintVaults[tc.QueryRespIndex].Id) diff --git a/x/vault/keeper/query_server.go b/x/vault/keeper/query_server.go index ed2c00a83..0e22a07c5 100644 --- a/x/vault/keeper/query_server.go +++ b/x/vault/keeper/query_server.go @@ -3,7 +3,8 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" + sdkmath "cosmossdk.io/math" + "cosmossdk.io/store/prefix" "github.com/cosmos/cosmos-sdk/types/query" sdk "github.com/cosmos/cosmos-sdk/types" @@ -400,7 +401,7 @@ func (q QueryServer) QueryTotalValueLockedByAppAndExtendedPair(c context.Context } var ( ctx = sdk.UnwrapSDKContext(c) - valueLocked = sdk.ZeroInt() + valueLocked = sdkmath.ZeroInt() ) _, found := q.asset.GetApp(ctx, req.AppId) if !found { @@ -584,7 +585,7 @@ func (q QueryServer) QueryTVLByApp(c context.Context, req *types.QueryTVLByAppRe } var ( ctx = sdk.UnwrapSDKContext(c) - locked = sdk.ZeroDec() + locked = sdkmath.LegacyZeroDec() ) _, found := q.asset.GetApp(ctx, req.AppId) if !found { @@ -602,7 +603,7 @@ func (q QueryServer) QueryTVLByApp(c context.Context, req *types.QueryTVLByAppRe twaData, _ := q.oracle.CalcAssetPrice(ctx, pairID.AssetIn, data.CollateralLockedAmount) locked = twaData.Add(locked) } - // locked = locked.Quo(sdk.NewInt(1000000)) + // locked = locked.Quo(sdkmath.NewInt(1000000)) return &types.QueryTVLByAppResponse{ CollateralLocked: locked.TruncateInt(), @@ -616,10 +617,10 @@ func (q QueryServer) QueryUserMyPositionByApp(c context.Context, req *types.Quer var ( ctx = sdk.UnwrapSDKContext(c) vaultsIds []uint64 - totalLocked = sdk.ZeroDec() - totalDue = sdk.ZeroDec() - availableBorrow = sdk.ZeroDec() - averageCr sdk.Dec + totalLocked = sdkmath.LegacyZeroDec() + totalDue = sdkmath.LegacyZeroDec() + availableBorrow = sdkmath.LegacyZeroDec() + averageCr sdkmath.LegacyDec ) _, err := sdk.AccAddressFromBech32(req.Owner) @@ -655,13 +656,13 @@ func (q QueryServer) QueryUserMyPositionByApp(c context.Context, req *types.Quer } assetInTotalPrice, _ := q.oracle.CalcAssetPrice(ctx, pairID.AssetIn, vault.AmountIn) - var assetOutTotalPrice sdk.Dec + var assetOutTotalPrice sdkmath.LegacyDec totalLocked = assetInTotalPrice.Add(totalLocked) if extPairVault.AssetOutOraclePrice { assetOutTotalPrice, _ = q.oracle.CalcAssetPrice(ctx, pairID.AssetOut, vault.AmountOut) } else { - assetOutTotalPrice = (sdk.NewDecFromInt(sdk.NewIntFromUint64(extPairVault.AssetOutPrice)).Mul(sdk.NewDecFromInt(vault.AmountOut))).Quo(sdk.NewDecFromInt(assetOutData.Decimals)) + assetOutTotalPrice = (sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(extPairVault.AssetOutPrice)).Mul(sdkmath.LegacyNewDecFromInt(vault.AmountOut))).Quo(sdkmath.LegacyNewDecFromInt(assetOutData.Decimals)) } totalDue = assetOutTotalPrice.Add(totalDue) @@ -673,7 +674,7 @@ func (q QueryServer) QueryUserMyPositionByApp(c context.Context, req *types.Quer av := AmtIn.Quo(minCr) av = av.Sub(AmtOut) - availableBorrow = av.Quo(sdk.OneDec()).Add(availableBorrow) + availableBorrow = av.Quo(sdkmath.LegacyOneDec()).Add(availableBorrow) } averageCr = totalLocked.Quo(totalDue) diff --git a/x/vault/keeper/query_server_test.go b/x/vault/keeper/query_server_test.go index a398d6dc4..d0284316a 100644 --- a/x/vault/keeper/query_server_test.go +++ b/x/vault/keeper/query_server_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "github.com/comdex-official/comdex/x/vault/types" sdk "github.com/cosmos/cosmos-sdk/types" _ "github.com/stretchr/testify/suite" @@ -24,8 +25,8 @@ func (s *KeeperTestSuite) TestQueryAllVaults() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int }{ { Address: addr1, @@ -93,8 +94,8 @@ func (s *KeeperTestSuite) TestQueryAllVaultsByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int }{ { Address: addr1, @@ -159,8 +160,8 @@ func (s *KeeperTestSuite) TestQueryVault() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryVaultRequest ExpErr error ExpResp *types.QueryVaultResponse @@ -299,8 +300,8 @@ func (s *KeeperTestSuite) TestQueryVaultInfoByVaultID() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryVaultInfoByVaultIDRequest ExpErr error ExpResp *types.QueryVaultInfoByVaultIDResponse @@ -450,8 +451,8 @@ func (s *KeeperTestSuite) TestQueryVaultInfoOfOwnerByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryVaultInfoOfOwnerByAppRequest ExpErr error ExpResp *types.QueryVaultInfoOfOwnerByAppResponse @@ -609,8 +610,8 @@ func (s *KeeperTestSuite) TestQueryAllVaultsByAppAndExtendedPair() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryAllVaultsByAppAndExtendedPairRequest ExpErr error ExpResp *types.QueryAllVaultsByAppAndExtendedPairResponse @@ -769,8 +770,8 @@ func (s *KeeperTestSuite) TestQueryVaultIDOfOwnerByExtendedPairAndApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryVaultIDOfOwnerByExtendedPairAndAppRequest ExpErr error ExpResp *types.QueryVaultIDOfOwnerByExtendedPairAndAppResponse @@ -877,8 +878,8 @@ func (s *KeeperTestSuite) TestQueryVaultIdsByAppInAllExtendedPairs() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryVaultIdsByAppInAllExtendedPairsRequest ExpErr error ExpResp *types.QueryVaultIdsByAppInAllExtendedPairsResponse @@ -984,8 +985,8 @@ func (s *KeeperTestSuite) TestQueryAllVaultIdsByAnOwner() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryAllVaultIdsByAnOwnerRequest ExpErr error ExpResp *types.QueryAllVaultIdsByAnOwnerResponse @@ -1091,8 +1092,8 @@ func (s *KeeperTestSuite) TestQueryTokenMintedByAppAndExtendedPair() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryTokenMintedByAppAndExtendedPairRequest ExpErr error ExpResp *types.QueryTokenMintedByAppAndExtendedPairResponse @@ -1113,7 +1114,7 @@ func (s *KeeperTestSuite) TestQueryTokenMintedByAppAndExtendedPair() { Req: &types.QueryTokenMintedByAppAndExtendedPairRequest{AppId: appID1, ExtendedPairId: extendedVaultPairID1}, ExpErr: nil, ExpResp: &types.QueryTokenMintedByAppAndExtendedPairResponse{ - TokenMinted: sdk.NewInt(200000000), + TokenMinted: sdkmath.NewInt(200000000), }, }, { @@ -1126,7 +1127,7 @@ func (s *KeeperTestSuite) TestQueryTokenMintedByAppAndExtendedPair() { Req: &types.QueryTokenMintedByAppAndExtendedPairRequest{AppId: appID1, ExtendedPairId: extendedVaultPairID1}, ExpErr: nil, ExpResp: &types.QueryTokenMintedByAppAndExtendedPairResponse{ - TokenMinted: sdk.NewInt(400000000), + TokenMinted: sdkmath.NewInt(400000000), }, }, { @@ -1139,7 +1140,7 @@ func (s *KeeperTestSuite) TestQueryTokenMintedByAppAndExtendedPair() { Req: &types.QueryTokenMintedByAppAndExtendedPairRequest{AppId: appID2, ExtendedPairId: extendedVaultPairID2}, ExpErr: nil, ExpResp: &types.QueryTokenMintedByAppAndExtendedPairResponse{ - TokenMinted: sdk.NewInt(200000000), + TokenMinted: sdkmath.NewInt(200000000), }, }, { @@ -1152,7 +1153,7 @@ func (s *KeeperTestSuite) TestQueryTokenMintedByAppAndExtendedPair() { Req: &types.QueryTokenMintedByAppAndExtendedPairRequest{AppId: appID2, ExtendedPairId: extendedVaultPairID2}, ExpErr: nil, ExpResp: &types.QueryTokenMintedByAppAndExtendedPairResponse{ - TokenMinted: sdk.NewInt(400000000), + TokenMinted: sdkmath.NewInt(400000000), }, }, } @@ -1192,8 +1193,8 @@ func (s *KeeperTestSuite) TestQueryTokenMintedAssetWiseByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryTokenMintedAssetWiseByAppRequest ExpErr error ExpResp *types.QueryTokenMintedAssetWiseByAppResponse @@ -1307,8 +1308,8 @@ func (s *KeeperTestSuite) TestQueryVaultCountByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryVaultCountByAppRequest ExpErr error ExpResp *types.QueryVaultCountByAppResponse @@ -1420,8 +1421,8 @@ func (s *KeeperTestSuite) TestQueryVaultCountByAppAndExtendedPair() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryVaultCountByAppAndExtendedPairRequest ExpErr error ExpResp *types.QueryVaultCountByAppAndExtendedPairResponse @@ -1533,8 +1534,8 @@ func (s *KeeperTestSuite) TestQueryTotalValueLockedByAppAndExtendedPair() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryTotalValueLockedByAppAndExtendedPairRequest ExpErr error ExpResp uint64 @@ -1644,8 +1645,8 @@ func (s *KeeperTestSuite) TestQueryExtendedPairIDsByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryExtendedPairIDsByAppRequest ExpErr error ExpResp *types.QueryExtendedPairIDsByAppResponse @@ -1751,7 +1752,7 @@ func (s *KeeperTestSuite) TestQueryStableVaultByVaultID() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int + AmountIn sdkmath.Int Req *types.QueryStableVaultByVaultIDRequest ExpErr error ExpResp *types.QueryStableVaultByVaultIDResponse @@ -1840,7 +1841,7 @@ func (s *KeeperTestSuite) TestQueryStableVaultByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int + AmountIn sdkmath.Int Req *types.QueryStableVaultByAppRequest ExpErr error ExpResp *types.QueryStableVaultByAppResponse @@ -1933,7 +1934,7 @@ func (s *KeeperTestSuite) TestQueryStableVaultByAppAndExtendedPair() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int + AmountIn sdkmath.Int Req *types.QueryStableVaultByAppAndExtendedPairRequest ExpErr error ExpResp *types.QueryStableVaultByAppAndExtendedPairResponse @@ -2022,8 +2023,8 @@ func (s *KeeperTestSuite) TestQueryExtendedPairVaultMappingByAppAndExtendedPair( Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryExtendedPairVaultMappingByAppAndExtendedPairRequest ExpErr error ExpResp *types.QueryExtendedPairVaultMappingByAppAndExtendedPairResponse @@ -2152,8 +2153,8 @@ func (s *KeeperTestSuite) TestQueryExtendedPairVaultMappingByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryExtendedPairVaultMappingByAppRequest ExpErr error ExpResp *types.QueryExtendedPairVaultMappingByAppResponse @@ -2290,8 +2291,8 @@ func (s *KeeperTestSuite) TestQueryTVLByAppOfAllExtendedPairs() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryTVLByAppOfAllExtendedPairsRequest ExpErr error ExpResp *types.QueryTVLByAppOfAllExtendedPairsResponse @@ -2412,8 +2413,8 @@ func (s *KeeperTestSuite) TestQueryTVLByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryTVLByAppRequest ExpErr error ExpResp *types.QueryTVLByAppResponse @@ -2519,8 +2520,8 @@ func (s *KeeperTestSuite) TestQueryUserMyPositionByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryUserMyPositionByAppRequest ExpErr error ExpResp *types.QueryUserMyPositionByAppResponse @@ -2550,7 +2551,7 @@ func (s *KeeperTestSuite) TestQueryUserMyPositionByApp() { CollateralLocked: newInt(1000000000), TotalDue: newInt(400000000), AvailableToBorrow: newInt(34782608), - AverageCrRatio: sdk.MustNewDecFromStr("2.5"), + AverageCrRatio: sdkmath.LegacyMustNewDecFromStr("2.5"), }, }, { @@ -2566,7 +2567,7 @@ func (s *KeeperTestSuite) TestQueryUserMyPositionByApp() { CollateralLocked: newInt(1000000000), TotalDue: newInt(400000000), AvailableToBorrow: newInt(34782608), - AverageCrRatio: sdk.MustNewDecFromStr("2.5"), + AverageCrRatio: sdkmath.LegacyMustNewDecFromStr("2.5"), }, }, { @@ -2582,7 +2583,7 @@ func (s *KeeperTestSuite) TestQueryUserMyPositionByApp() { CollateralLocked: newInt(1000000000), TotalDue: newInt(400000000), AvailableToBorrow: newInt(34782608), - AverageCrRatio: sdk.MustNewDecFromStr("2.5"), + AverageCrRatio: sdkmath.LegacyMustNewDecFromStr("2.5"), }, }, { @@ -2598,7 +2599,7 @@ func (s *KeeperTestSuite) TestQueryUserMyPositionByApp() { CollateralLocked: newInt(1000000000), TotalDue: newInt(400000000), AvailableToBorrow: newInt(34782608), - AverageCrRatio: sdk.MustNewDecFromStr("2.5"), + AverageCrRatio: sdkmath.LegacyMustNewDecFromStr("2.5"), }, }, } @@ -2641,8 +2642,8 @@ func (s *KeeperTestSuite) TestQueryUserExtendedPairTotalData() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryUserExtendedPairTotalDataRequest ExpErr error ExpResp *types.QueryUserExtendedPairTotalDataResponse @@ -2776,8 +2777,8 @@ func (s *KeeperTestSuite) TestQueryPairsLockedAndMintedStatisticByApp() { Address sdk.AccAddress AppID uint64 ExtendedVaultPairID uint64 - AmountIn sdk.Int - AmountOut sdk.Int + AmountIn sdkmath.Int + AmountOut sdkmath.Int Req *types.QueryPairsLockedAndMintedStatisticByAppRequest ExpErr error ExpResp *types.QueryPairsLockedAndMintedStatisticByAppResponse diff --git a/x/vault/keeper/vault.go b/x/vault/keeper/vault.go index 956f30bce..b3258443c 100644 --- a/x/vault/keeper/vault.go +++ b/x/vault/keeper/vault.go @@ -3,6 +3,10 @@ package keeper import ( "sort" + storetypes "cosmossdk.io/store/types" + + sdkmath "cosmossdk.io/math" + assettypes "github.com/comdex-official/comdex/x/asset/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/cosmos/gogoproto/types" @@ -102,10 +106,10 @@ func (k Keeper) GetUserAppMappingData(ctx sdk.Context, address string, appID uin var ( store = k.Store(ctx) key = types.UserAppMappingKey(address, appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -137,10 +141,10 @@ func (k Keeper) GetUserMappingData(ctx sdk.Context, address string) (mappingData var ( store = k.Store(ctx) key = types.UserKey(address) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -159,10 +163,10 @@ func (k Keeper) GetUserMappingData(ctx sdk.Context, address string) (mappingData func (k Keeper) GetAllUserVaultExtendedPairMapping(ctx sdk.Context) (userVaultAssetData []types.OwnerAppExtendedPairVaultMappingData) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.UserVaultExtendedPairMappingKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.UserVaultExtendedPairMappingKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -208,10 +212,10 @@ func (k Keeper) GetAppMappingData(ctx sdk.Context, appMappingID uint64) (appExte var ( store = k.Store(ctx) key = types.AppMappingKey(appMappingID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -233,10 +237,10 @@ func (k Keeper) GetAppMappingData(ctx sdk.Context, appMappingID uint64) (appExte func (k Keeper) GetAllAppExtendedPairVaultMapping(ctx sdk.Context) (appExtendedPairVaultData []types.AppExtendedPairVaultMappingData) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AppExtendedPairVaultMappingKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.AppExtendedPairVaultMappingKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -255,13 +259,13 @@ func (k Keeper) GetAllAppExtendedPairVaultMapping(ctx sdk.Context) (appExtendedP // If exists fine --- go with the next steps from here // else instantiate 1 and set it. and go for the next steps from here // So best way will be to create a function which will first check if AppExtendedPairVault Data exists or not. If it does. then send counted value. else create a struct save it. and send counter value. -func (k Keeper) CheckAppExtendedPairVaultMapping(ctx sdk.Context, appMappingID uint64, extendedPairVaultID uint64) (mintedStatistics sdk.Int, lenVaults uint64) { +func (k Keeper) CheckAppExtendedPairVaultMapping(ctx sdk.Context, appMappingID uint64, extendedPairVaultID uint64) (mintedStatistics sdkmath.Int, lenVaults uint64) { appExtendedPairVaultData, found := k.GetAppExtendedPairVaultMappingData(ctx, appMappingID, extendedPairVaultID) if !found { // Initialising a new struct var newAppExtendedPairVault types.AppExtendedPairVaultMappingData newAppExtendedPairVault.AppId = appMappingID - zeroVal := sdk.ZeroInt() + zeroVal := sdkmath.ZeroInt() newAppExtendedPairVault.ExtendedPairId = extendedPairVaultID newAppExtendedPairVault.CollateralLockedAmount = zeroVal newAppExtendedPairVault.TokenMintedAmount = zeroVal @@ -297,77 +301,77 @@ func (k Keeper) UpdateAppExtendedPairVaultMappingDataOnMsgCreateStableMintVault( } // CalculateCollateralizationRatio Calculate Collaterlization Ratio . -func (k Keeper) CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdk.Int, amountOut sdk.Int) (sdk.Dec, error) { +func (k Keeper) CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdkmath.Int, amountOut sdkmath.Int) (sdkmath.LegacyDec, error) { extendedPairVault, found := k.asset.GetPairsVault(ctx, extendedPairVaultID) if !found { - return sdk.ZeroDec(), types.ErrorExtendedPairVaultDoesNotExists + return sdkmath.LegacyZeroDec(), types.ErrorExtendedPairVaultDoesNotExists } pairData, found := k.asset.GetPair(ctx, extendedPairVault.PairId) if !found { - return sdk.ZeroDec(), types.ErrorPairDoesNotExist + return sdkmath.LegacyZeroDec(), types.ErrorPairDoesNotExist } assetInData, found := k.asset.GetAsset(ctx, pairData.AssetIn) if !found { - return sdk.ZeroDec(), types.ErrorAssetDoesNotExist + return sdkmath.LegacyZeroDec(), types.ErrorAssetDoesNotExist } assetOutData, found := k.asset.GetAsset(ctx, pairData.AssetOut) if !found { - return sdk.ZeroDec(), types.ErrorAssetDoesNotExist + return sdkmath.LegacyZeroDec(), types.ErrorAssetDoesNotExist } esmStatus, found := k.esm.GetESMStatus(ctx, extendedPairVault.AppId) statusEsm := false if found { statusEsm = esmStatus.Status } - var assetInTotalPrice sdk.Dec + var assetInTotalPrice sdkmath.LegacyDec var err error // check to get calc asset price from esm if statusEsm && esmStatus.SnapshotStatus { price, found := k.esm.GetSnapshotOfPrices(ctx, extendedPairVault.AppId, assetInData.Id) if !found { - return sdk.ZeroDec(), types.ErrorPriceDoesNotExist + return sdkmath.LegacyZeroDec(), types.ErrorPriceDoesNotExist } - numerator := sdk.NewDecFromInt(amountIn).Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(price))) - denominator := sdk.NewDecFromInt(assetInData.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amountIn).Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(price))) + denominator := sdkmath.LegacyNewDecFromInt(assetInData.Decimals) assetInTotalPrice = numerator.Quo(denominator) } else if !statusEsm { // calculating price of the asset_in assetInTotalPrice, err = k.oracle.CalcAssetPrice(ctx, assetInData.Id, amountIn) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } } - var assetOutTotalPrice sdk.Dec + var assetOutTotalPrice sdkmath.LegacyDec if extendedPairVault.AssetOutOraclePrice { // If oracle Price required for the assetOut if statusEsm && esmStatus.SnapshotStatus { price, found := k.esm.GetSnapshotOfPrices(ctx, extendedPairVault.AppId, assetOutData.Id) if !found { - return sdk.ZeroDec(), types.ErrorPriceDoesNotExist + return sdkmath.LegacyZeroDec(), types.ErrorPriceDoesNotExist } - numerator := sdk.NewDecFromInt(amountOut).Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(price))) - denominator := sdk.NewDecFromInt(assetOutData.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amountOut).Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(price))) + denominator := sdkmath.LegacyNewDecFromInt(assetOutData.Decimals) assetOutTotalPrice = numerator.Quo(denominator) } else { assetOutTotalPrice, err = k.oracle.CalcAssetPrice(ctx, assetOutData.Id, amountOut) if err != nil { - return sdk.ZeroDec(), err + return sdkmath.LegacyZeroDec(), err } } } else { // If oracle Price is not required for the assetOut - numerator := sdk.NewDecFromInt(amountOut).Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(extendedPairVault.AssetOutPrice))) - denominator := sdk.NewDecFromInt(assetOutData.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amountOut).Mul(sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(extendedPairVault.AssetOutPrice))) + denominator := sdkmath.LegacyNewDecFromInt(assetOutData.Decimals) assetOutTotalPrice = numerator.Quo(denominator) } - if assetInTotalPrice.LTE(sdk.ZeroDec()) { - return sdk.ZeroDec(), types.ErrorInvalidAmountIn + if assetInTotalPrice.LTE(sdkmath.LegacyZeroDec()) { + return sdkmath.LegacyZeroDec(), types.ErrorInvalidAmountIn } - if assetOutTotalPrice.LTE(sdk.ZeroDec()) { - return sdk.ZeroDec(), types.ErrorInvalidAmountOut + if assetOutTotalPrice.LTE(sdkmath.LegacyZeroDec()) { + return sdkmath.LegacyZeroDec(), types.ErrorInvalidAmountOut } return assetInTotalPrice.Quo(assetOutTotalPrice), nil } @@ -375,9 +379,9 @@ func (k Keeper) CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVau func (k Keeper) VerifyCollaterlizationRatio( ctx sdk.Context, extendedPairVaultID uint64, - amountIn sdk.Int, - amountOut sdk.Int, - minCrRequired sdk.Dec, + amountIn sdkmath.Int, + amountOut sdkmath.Int, + minCrRequired sdkmath.LegacyDec, statusEsm bool, ) error { collaterlizationRatio, err := k.CalculateCollateralizationRatio(ctx, extendedPairVaultID, amountIn, amountOut) @@ -386,7 +390,7 @@ func (k Keeper) VerifyCollaterlizationRatio( } if collaterlizationRatio.LT(minCrRequired) && !statusEsm { return types.ErrorInvalidCollateralizationRatio - } else if collaterlizationRatio.LT(sdk.MustNewDecFromStr("1")) && statusEsm { + } else if collaterlizationRatio.LT(sdkmath.LegacyMustNewDecFromStr("1")) && statusEsm { return types.ErrorInvalidCollateralizationRatio } return nil @@ -416,7 +420,7 @@ func (k Keeper) GetVault(ctx sdk.Context, id uint64) (vault types.Vault, found b } // UpdateCollateralLockedAmountLockerMapping For updating token stats of collateral . -func (k Keeper) UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) { +func (k Keeper) UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) { // if Change type true = Add to collateral Locked // If change type false = Subtract from the collateral Locked appExtendedPairVaultData, found := k.GetAppExtendedPairVaultMappingData(ctx, appMappingID, extendedPairID) @@ -434,7 +438,7 @@ func (k Keeper) UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMa } // UpdateTokenMintedAmountLockerMapping For updating token stats of minted . -func (k Keeper) UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) { +func (k Keeper) UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdkmath.Int, changeType bool) { // if Change type true = Add to token Locked // If change type false = Subtract from the token Locked appExtendedPairVaultData, found := k.GetAppExtendedPairVaultMappingData(ctx, appMappingID, extendedPairID) @@ -462,10 +466,10 @@ func (k Keeper) DeleteVault(ctx sdk.Context, id uint64) { func (k Keeper) GetVaults(ctx sdk.Context) (vaults []types.Vault) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.VaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.VaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -553,10 +557,10 @@ func (k Keeper) GetStableMintVault(ctx sdk.Context, id uint64) (stableVault type func (k Keeper) GetStableMintVaults(ctx sdk.Context) (stableVaults []types.StableMintVault) { var ( store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.StableMintVaultKeyPrefix) + iter = storetypes.KVStorePrefixIterator(store, types.StableMintVaultKeyPrefix) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -571,7 +575,7 @@ func (k Keeper) GetStableMintVaults(ctx sdk.Context) (stableVaults []types.Stabl return stableVaults } -func (k Keeper) CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) error { +func (k Keeper) CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdkmath.Int, AmountOut sdkmath.Int) error { appMapping, _ := k.asset.GetApp(ctx, AppID) extendedPairVault, _ := k.asset.GetPairsVault(ctx, ExtendedPairVaultID) //checking if vault exists @@ -586,7 +590,7 @@ func (k Keeper) CreateNewVault(ctx sdk.Context, From string, AppID uint64, Exten return nil } - zeroVal := sdk.ZeroInt() + zeroVal := sdkmath.ZeroInt() oldID := k.GetIDForVault(ctx) var newVault types.Vault newID := oldID + 1 @@ -618,7 +622,7 @@ func (k Keeper) CreateNewVault(ctx sdk.Context, From string, AppID uint64, Exten return nil } -func (k Keeper) calculateUserToken(userVault types.Vault, amountIn sdk.Int) (userToken sdk.Int) { +func (k Keeper) calculateUserToken(userVault types.Vault, amountIn sdkmath.Int) (userToken sdkmath.Int) { nume := userVault.AmountOut.Mul(amountIn) deno := userVault.AmountIn userToken = nume.Quo(deno) @@ -626,11 +630,11 @@ func (k Keeper) calculateUserToken(userVault types.Vault, amountIn sdk.Int) (use return userToken } -func (k Keeper) WasmMsgAddEmissionRewards(ctx sdk.Context, appID uint64, amount sdk.Int, extPair []uint64, votingRatio []sdk.Int) error { +func (k Keeper) WasmMsgAddEmissionRewards(ctx sdk.Context, appID uint64, amount sdkmath.Int, extPair []uint64, votingRatio []sdkmath.Int) error { var assetID uint64 var vaultsData types.AppExtendedPairVaultMappingData - totalVote := sdk.ZeroInt() + totalVote := sdkmath.ZeroInt() app, _ := k.asset.GetApp(ctx, appID) govToken := app.GenesisToken for _, v := range govToken { @@ -639,7 +643,7 @@ func (k Keeper) WasmMsgAddEmissionRewards(ctx sdk.Context, appID uint64, amount } } asset, _ := k.asset.GetAsset(ctx, assetID) - if amount.GT(sdk.ZeroInt()) { + if amount.GT(sdkmath.ZeroInt()) { err := k.bank.MintCoins(ctx, tokenminttypes.ModuleName, sdk.NewCoins(sdk.NewCoin(asset.Denom, amount))) if err != nil { return err @@ -652,19 +656,19 @@ func (k Keeper) WasmMsgAddEmissionRewards(ctx sdk.Context, appID uint64, amount for j, extP := range extPair { extPairVaultMappingData, found := k.GetAppExtendedPairVaultMappingData(ctx, appID, extP) individualVote := votingRatio[j] - votingR := sdk.NewDecFromInt(individualVote).Quo(sdk.NewDecFromInt(totalVote)) - shareByExtPair := votingR.Mul(sdk.NewDecFromInt(amount)) + votingR := sdkmath.LegacyNewDecFromInt(individualVote).Quo(sdkmath.LegacyNewDecFromInt(totalVote)) + shareByExtPair := votingR.Mul(sdkmath.LegacyNewDecFromInt(amount)) if !found || extPairVaultMappingData.TokenMintedAmount.IsZero() { continue } - perUserShareByAmtDec := shareByExtPair.Quo(sdk.NewDecFromInt(extPairVaultMappingData.TokenMintedAmount)) + perUserShareByAmtDec := shareByExtPair.Quo(sdkmath.LegacyNewDecFromInt(extPairVaultMappingData.TokenMintedAmount)) vaultsData, _ = k.GetAppExtendedPairVaultMappingData(ctx, appID, extP) for _, vaultID := range vaultsData.VaultIds { vault, _ := k.GetVault(ctx, vaultID) - amt := sdk.NewDecFromInt(vault.AmountOut).Mul(perUserShareByAmtDec) + amt := sdkmath.LegacyNewDecFromInt(vault.AmountOut).Mul(perUserShareByAmtDec) addr, _ := sdk.AccAddressFromBech32(vault.Owner) - if amt.GT(sdk.NewDec(0)) { + if amt.GT(sdkmath.LegacyNewDec(0)) { err := k.bank.SendCoinsFromModuleToAccount(ctx, tokenminttypes.ModuleName, addr, sdk.NewCoins(sdk.NewCoin(asset.Denom, amt.TruncateInt()))) if err != nil { return err @@ -676,23 +680,23 @@ func (k Keeper) WasmMsgAddEmissionRewards(ctx sdk.Context, appID uint64, amount return nil } -func (k Keeper) GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) { +func (k Keeper) GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdkmath.LegacyDec, amt1 sdkmath.Int, id2 uint64, rate2 sdkmath.LegacyDec) (sdkmath.LegacyDec, sdkmath.Int, error) { asset1, found := k.asset.GetAsset(ctx, id1) if !found { - return sdk.ZeroDec(), sdk.ZeroInt(), assettypes.ErrorAssetDoesNotExist + return sdkmath.LegacyZeroDec(), sdkmath.ZeroInt(), assettypes.ErrorAssetDoesNotExist } asset2, found := k.asset.GetAsset(ctx, id2) if !found { - return sdk.ZeroDec(), sdk.ZeroInt(), assettypes.ErrorAssetDoesNotExist + return sdkmath.LegacyZeroDec(), sdkmath.ZeroInt(), assettypes.ErrorAssetDoesNotExist } - numerator := sdk.NewDecFromInt(amt1).Mul(rate1) //rate urate 1000000 - denominator := sdk.NewDecFromInt(asset1.Decimals) + numerator := sdkmath.LegacyNewDecFromInt(amt1).Mul(rate1) //rate urate 1000000 + denominator := sdkmath.LegacyNewDecFromInt(asset1.Decimals) t1dAmount := numerator.Quo(denominator) newAmount := t1dAmount.Quo(rate2) - tokenAmount := newAmount.Mul(sdk.NewDecFromInt(asset2.Decimals)) - // return sdk.Int(tokenAmount), nil + tokenAmount := newAmount.Mul(sdkmath.LegacyNewDecFromInt(asset2.Decimals)) + // return sdkmath.Int(tokenAmount), nil return t1dAmount, tokenAmount.TruncateInt(), nil } @@ -734,10 +738,10 @@ func (k Keeper) GetStableMintVaultUserRewards(ctx sdk.Context, appID uint64, use var ( store = k.Store(ctx) key = types.StableMintRewardsKey(appID, user) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -760,10 +764,10 @@ func (k Keeper) GetStableMintVaultRewardsByApp(ctx sdk.Context, appID uint64) (m var ( store = k.Store(ctx) key = types.StableMintRewardsAppKey(appID) - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return @@ -782,7 +786,7 @@ func (k Keeper) GetStableMintVaultRewardsByApp(ctx sdk.Context, appID uint64) (m return mappingData, true } -func (k Keeper) DeleteUserStableRewardEntries(ctx sdk.Context, appID uint64, user string, quanitity sdk.Int) { +func (k Keeper) DeleteUserStableRewardEntries(ctx sdk.Context, appID uint64, user string, quanitity sdkmath.Int) { stableVaultRewards, found := k.GetStableMintVaultUserRewards(ctx, appID, user) if found { for _, userRewards := range stableVaultRewards { @@ -802,10 +806,10 @@ func (k Keeper) GetStableMintVaultRewardsOfAllApps(ctx sdk.Context) (mappingData var ( store = k.Store(ctx) key = types.StableVaultRewardsKeyPrefix - iter = sdk.KVStorePrefixIterator(store, key) + iter = storetypes.KVStorePrefixIterator(store, key) ) - defer func(iter sdk.Iterator) { + defer func(iter storetypes.Iterator) { err := iter.Close() if err != nil { return diff --git a/x/vault/module.go b/x/vault/module.go index e7fe7ccec..f1f43a3ae 100644 --- a/x/vault/module.go +++ b/x/vault/module.go @@ -23,7 +23,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} ) type AppModuleBasic struct{} @@ -84,6 +83,12 @@ func (a AppModule) ConsensusVersion() uint64 { return 1 } +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (a AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (a AppModule) IsAppModule() {} + func (a AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, message json.RawMessage) []abcitypes.ValidatorUpdate { var state types.GenesisState cdc.MustUnmarshalJSON(message, &state) @@ -107,9 +112,9 @@ func (a AppModule) RegisterServices(configurator module.Configurator) { types.RegisterQueryServer(configurator.QueryServer(), keeper.NewQueryServer(a.k)) } -func (a AppModule) BeginBlock(_ sdk.Context, _ abcitypes.RequestBeginBlock) {} +func (a AppModule) BeginBlock(_ sdk.Context) {} -func (a AppModule) EndBlock(_ sdk.Context, _ abcitypes.RequestEndBlock) []abcitypes.ValidatorUpdate { +func (a AppModule) EndBlock(ctx context.Context) error { return nil } @@ -119,12 +124,6 @@ func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.Weigh return nil } -// func (a AppModule) RandomizedParams(_ *rand.Rand) []simulation.ParamChange { -// return nil -// } - -func (a AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - func (a AppModule) WeightedOperations(_ module.SimulationState) []simulation.WeightedOperation { return nil } diff --git a/x/vault/module_test.go b/x/vault/module_test.go index f566f6f9e..f7b8d3e0d 100644 --- a/x/vault/module_test.go +++ b/x/vault/module_test.go @@ -1,10 +1,10 @@ package vault_test import ( + sdkmath "cosmossdk.io/math" "encoding/binary" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" @@ -33,7 +33,7 @@ func TestModuleTestSuite(t *testing.T) { func (suite *ModuleTestSuite) SetupTest() { app := chain.Setup(suite.T(), false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + ctx := app.BaseApp.NewContext(false) suite.app = app suite.ctx = ctx @@ -64,7 +64,7 @@ func (s *ModuleTestSuite) CreateNewApp(appName string) uint64 { err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ Name: appName, ShortName: appName, - MinGovDeposit: sdk.NewInt(0), + MinGovDeposit: sdkmath.NewInt(0), GovTimeInSeconds: 0, GenesisToken: []assettypes.MintGenesisToken{}, }) @@ -89,7 +89,7 @@ func (s *ModuleTestSuite) CreateNewAsset(name, denom string, price uint64) uint6 err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ Name: name, Denom: denom, - Decimals: sdk.NewInt(1000000), + Decimals: sdkmath.NewInt(1000000), IsOnChain: true, IsOraclePriceRequired: true, IsCdpMintable: true, @@ -171,15 +171,15 @@ func (s *ModuleTestSuite) CreateNewExtendedVaultPair( err := s.app.AssetKeeper.WasmAddExtendedPairsVaultRecords(s.ctx, &bindings.MsgAddExtendedPairsVault{ AppID: appMappingID, PairID: pairID, - StabilityFee: sdk.NewDecWithPrec(2, 2), // 0.02 - ClosingFee: sdk.NewDec(0), - LiquidationPenalty: sdk.NewDecWithPrec(15, 2), // 0.15 - DrawDownFee: sdk.NewDecWithPrec(1, 2), // 0.01 + StabilityFee: sdkmath.LegacyNewDecWithPrec(2, 2), // 0.02 + ClosingFee: sdkmath.LegacyNewDec(0), + LiquidationPenalty: sdkmath.LegacyNewDecWithPrec(15, 2), // 0.15 + DrawDownFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 0.01 IsVaultActive: isVaultActive, - DebtCeiling: sdk.NewInt(1000000000000000000), - DebtFloor: sdk.NewInt(100000000), + DebtCeiling: sdkmath.NewInt(1000000000000000000), + DebtFloor: sdkmath.NewInt(100000000), IsStableMintVault: isStableMintVault, - MinCr: sdk.NewDecWithPrec(23, 1), // 2.3 + MinCr: sdkmath.LegacyNewDecWithPrec(23, 1), // 2.3 PairName: pairName, AssetOutOraclePrice: true, AssetOutPrice: 1000000, diff --git a/x/vault/types/errors.go b/x/vault/types/errors.go index 725eb9df9..7728be860 100644 --- a/x/vault/types/errors.go +++ b/x/vault/types/errors.go @@ -1,35 +1,35 @@ package types import ( - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( - ErrorInvalidAmount = errors.Register(ModuleName, 1301, "invalid amount") - ErrorInvalidAmountIn = errors.Register(ModuleName, 1302, "invalid amount_in") - ErrorInvalidAmountOut = errors.Register(ModuleName, 1303, "invalid amount_out") - ErrorInvalidFrom = errors.Register(ModuleName, 1304, "invalid from") - ErrorInvalidID = errors.Register(ModuleName, 1305, "invalid id") - ErrorExtendedPairVaultDoesNotExists = errors.Register(ModuleName, 1306, "Extended pair vault does not exists for the given id") - ErrorAppMappingDoesNotExist = errors.Register(ModuleName, 1307, "App Mapping Id does not exists") - ErrorAppMappingIDMismatch = errors.Register(ModuleName, 1308, "App Mapping Id mismatch, use the correct App Mapping ID in request") - ErrorVaultCreationInactive = errors.Register(ModuleName, 1309, "Vault Creation Inactive") - ErrorUserVaultAlreadyExists = errors.Register(ModuleName, 1310, "User vault already exists for the given extended pair vault id ") - ErrorAmountOutLessThanDebtFloor = errors.Register(ModuleName, 1311, "Amount Out is less than Debt Floor") - ErrorAmountOutGreaterThanDebtCeiling = errors.Register(ModuleName, 1312, "Amount Out is greater than Debt Ceiling") - ErrorPairDoesNotExist = errors.Register(ModuleName, 1313, "Pair does not exists") - ErrorAssetDoesNotExist = errors.Register(ModuleName, 1314, "Asset does not exists") - ErrorPriceDoesNotExist = errors.Register(ModuleName, 1315, "Price does not exist") - ErrorInvalidCollateralizationRatio = errors.Register(ModuleName, 1316, "Invalid collateralization ratio") - ErrorVaultDoesNotExist = errors.Register(ModuleName, 1317, "Vault does not exist") - ErrVaultAccessUnauthorised = errors.Register(ModuleName, 1318, "Unauthorized user for the tx") - ErrorInvalidAppMappingData = errors.Register(ModuleName, 1319, "Invalid App Mapping data sent as compared to data exists in vault") - ErrorInvalidExtendedPairMappingData = errors.Register(ModuleName, 1320, "Invalid Extended Pair Vault Mapping data sent as compared to data exists in vault") - ErrorVaultInactive = errors.Register(ModuleName, 1321, "Vault tx Inactive") - ErrorStableMintVaultAlreadyCreated = errors.Register(ModuleName, 1322, "Stable Mint with this ExtendedPair Already exists, try deposit for stable mint") - BurnCoinValueInVaultIsZero = errors.Register(ModuleName, 1323, "Burn Coin value in vault is zero") - MintCoinValueInVaultIsZero = errors.Register(ModuleName, 1324, "Mint Coin value in vault is zero") - ErrorAppExtendedPairDataDoesNotExists = errors.Register(ModuleName, 1325, "App ExtendedPair Data Does Not Exists") - ErrorUnknownMsgType = errors.Register(ModuleName, 1326, "unknown message type") - ErrorCannotCreateStableMintVault = errors.Register(ModuleName, 1327, "Cannot Create Stable Mint Vault, StableMint tx command") + ErrorInvalidAmount = errorsmod.Register(ModuleName, 1301, "invalid amount") + ErrorInvalidAmountIn = errorsmod.Register(ModuleName, 1302, "invalid amount_in") + ErrorInvalidAmountOut = errorsmod.Register(ModuleName, 1303, "invalid amount_out") + ErrorInvalidFrom = errorsmod.Register(ModuleName, 1304, "invalid from") + ErrorInvalidID = errorsmod.Register(ModuleName, 1305, "invalid id") + ErrorExtendedPairVaultDoesNotExists = errorsmod.Register(ModuleName, 1306, "Extended pair vault does not exists for the given id") + ErrorAppMappingDoesNotExist = errorsmod.Register(ModuleName, 1307, "App Mapping Id does not exists") + ErrorAppMappingIDMismatch = errorsmod.Register(ModuleName, 1308, "App Mapping Id mismatch, use the correct App Mapping ID in request") + ErrorVaultCreationInactive = errorsmod.Register(ModuleName, 1309, "Vault Creation Inactive") + ErrorUserVaultAlreadyExists = errorsmod.Register(ModuleName, 1310, "User vault already exists for the given extended pair vault id ") + ErrorAmountOutLessThanDebtFloor = errorsmod.Register(ModuleName, 1311, "Amount Out is less than Debt Floor") + ErrorAmountOutGreaterThanDebtCeiling = errorsmod.Register(ModuleName, 1312, "Amount Out is greater than Debt Ceiling") + ErrorPairDoesNotExist = errorsmod.Register(ModuleName, 1313, "Pair does not exists") + ErrorAssetDoesNotExist = errorsmod.Register(ModuleName, 1314, "Asset does not exists") + ErrorPriceDoesNotExist = errorsmod.Register(ModuleName, 1315, "Price does not exist") + ErrorInvalidCollateralizationRatio = errorsmod.Register(ModuleName, 1316, "Invalid collateralization ratio") + ErrorVaultDoesNotExist = errorsmod.Register(ModuleName, 1317, "Vault does not exist") + ErrVaultAccessUnauthorised = errorsmod.Register(ModuleName, 1318, "Unauthorized user for the tx") + ErrorInvalidAppMappingData = errorsmod.Register(ModuleName, 1319, "Invalid App Mapping data sent as compared to data exists in vault") + ErrorInvalidExtendedPairMappingData = errorsmod.Register(ModuleName, 1320, "Invalid Extended Pair Vault Mapping data sent as compared to data exists in vault") + ErrorVaultInactive = errorsmod.Register(ModuleName, 1321, "Vault tx Inactive") + ErrorStableMintVaultAlreadyCreated = errorsmod.Register(ModuleName, 1322, "Stable Mint with this ExtendedPair Already exists, try deposit for stable mint") + BurnCoinValueInVaultIsZero = errorsmod.Register(ModuleName, 1323, "Burn Coin value in vault is zero") + MintCoinValueInVaultIsZero = errorsmod.Register(ModuleName, 1324, "Mint Coin value in vault is zero") + ErrorAppExtendedPairDataDoesNotExists = errorsmod.Register(ModuleName, 1325, "App ExtendedPair Data Does Not Exists") + ErrorUnknownMsgType = errorsmod.Register(ModuleName, 1326, "unknown message type") + ErrorCannotCreateStableMintVault = errorsmod.Register(ModuleName, 1327, "Cannot Create Stable Mint Vault, StableMint tx command") ) diff --git a/x/vault/types/msg.go b/x/vault/types/msg.go index 8709aa9c4..f5b20f1b8 100644 --- a/x/vault/types/msg.go +++ b/x/vault/types/msg.go @@ -1,8 +1,9 @@ package types import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var ( @@ -20,7 +21,7 @@ var ( func NewMsgCreateRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, amountIn sdk.Int, amountOut sdk.Int, + appID uint64, extendedPairVaultID uint64, amountIn sdkmath.Int, amountOut sdkmath.Int, ) *MsgCreateRequest { return &MsgCreateRequest{ From: from.String(), @@ -41,28 +42,28 @@ func (m *MsgCreateRequest) Type() string { func (m *MsgCreateRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.AmountIn.IsNil() { - return errors.Wrap(ErrorInvalidAmountIn, "amount_in cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmountIn, "amount_in cannot be nil") } if m.AmountIn.IsNegative() { - return errors.Wrap(ErrorInvalidAmountIn, "amount_in cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmountIn, "amount_in cannot be negative") } if m.AmountIn.IsZero() { - return errors.Wrap(ErrorInvalidAmountIn, "amount_in cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmountIn, "amount_in cannot be zero") } if m.AmountOut.IsNil() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be nil") } if m.AmountOut.IsNegative() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be negative") } if m.AmountOut.IsZero() { - return errors.Wrap(ErrorInvalidAmountOut, "amount_out cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmountOut, "amount_out cannot be zero") } return nil @@ -83,7 +84,7 @@ func (m *MsgCreateRequest) GetSigners() []sdk.AccAddress { func NewMsgDepositRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, userVaultID uint64, amount sdk.Int, + appID uint64, extendedPairVaultID uint64, userVaultID uint64, amount sdkmath.Int, ) *MsgDepositRequest { return &MsgDepositRequest{ From: from.String(), @@ -104,22 +105,22 @@ func (m *MsgDepositRequest) Type() string { func (m *MsgDepositRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.UserVaultId == 0 { - return errors.Wrap(ErrorInvalidID, "id cannot be null") + return errorsmod.Wrap(ErrorInvalidID, "id cannot be null") } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil @@ -140,7 +141,7 @@ func (m *MsgDepositRequest) GetSigners() []sdk.AccAddress { func NewMsgWithdrawRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, userVaultid uint64, amount sdk.Int, + appID uint64, extendedPairVaultID uint64, userVaultid uint64, amount sdkmath.Int, ) *MsgWithdrawRequest { return &MsgWithdrawRequest{ From: from.String(), @@ -161,22 +162,22 @@ func (m *MsgWithdrawRequest) Type() string { func (m *MsgWithdrawRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.UserVaultId == 0 { - return errors.Wrap(ErrorInvalidID, "id cannot be zero") + return errorsmod.Wrap(ErrorInvalidID, "id cannot be zero") } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil @@ -197,7 +198,7 @@ func (m *MsgWithdrawRequest) GetSigners() []sdk.AccAddress { func NewMsgDrawRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, userVaultid uint64, amount sdk.Int, + appID uint64, extendedPairVaultID uint64, userVaultid uint64, amount sdkmath.Int, ) *MsgDrawRequest { return &MsgDrawRequest{ From: from.String(), @@ -218,22 +219,22 @@ func (m *MsgDrawRequest) Type() string { func (m *MsgDrawRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.UserVaultId == 0 { - return errors.Wrap(ErrorInvalidID, "id cannot be null") + return errorsmod.Wrap(ErrorInvalidID, "id cannot be null") } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil @@ -254,7 +255,7 @@ func (m *MsgDrawRequest) GetSigners() []sdk.AccAddress { func NewMsgRepayRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, userVaultid uint64, amount sdk.Int, + appID uint64, extendedPairVaultID uint64, userVaultid uint64, amount sdkmath.Int, ) *MsgRepayRequest { return &MsgRepayRequest{ From: from.String(), @@ -275,22 +276,22 @@ func (m *MsgRepayRequest) Type() string { func (m *MsgRepayRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.UserVaultId == 0 { - return errors.Wrap(ErrorInvalidID, "id cannot be null") + return errorsmod.Wrap(ErrorInvalidID, "id cannot be null") } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil @@ -331,13 +332,13 @@ func (m *MsgCloseRequest) Type() string { func (m *MsgCloseRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.UserVaultId == 0 { - return errors.Wrap(ErrorInvalidID, "id cannot be null") + return errorsmod.Wrap(ErrorInvalidID, "id cannot be null") } return nil @@ -358,7 +359,7 @@ func (m *MsgCloseRequest) GetSigners() []sdk.AccAddress { func NewMsgDepositAndDrawRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, userVaultid uint64, amount sdk.Int, + appID uint64, extendedPairVaultID uint64, userVaultid uint64, amount sdkmath.Int, ) *MsgDepositAndDrawRequest { return &MsgDepositAndDrawRequest{ From: from.String(), @@ -379,22 +380,22 @@ func (m *MsgDepositAndDrawRequest) Type() string { func (m *MsgDepositAndDrawRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.UserVaultId == 0 { - return errors.Wrap(ErrorInvalidID, "id cannot be null") + return errorsmod.Wrap(ErrorInvalidID, "id cannot be null") } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil @@ -415,7 +416,7 @@ func (m *MsgDepositAndDrawRequest) GetSigners() []sdk.AccAddress { func NewMsgCreateStableMintRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, amount sdk.Int, + appID uint64, extendedPairVaultID uint64, amount sdkmath.Int, ) *MsgCreateStableMintRequest { return &MsgCreateStableMintRequest{ From: from.String(), @@ -435,19 +436,19 @@ func (m *MsgCreateStableMintRequest) Type() string { func (m *MsgCreateStableMintRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil @@ -468,7 +469,7 @@ func (m *MsgCreateStableMintRequest) GetSigners() []sdk.AccAddress { func NewMsgDepositStableMintRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, amount sdk.Int, stablemintID uint64, + appID uint64, extendedPairVaultID uint64, amount sdkmath.Int, stablemintID uint64, ) *MsgDepositStableMintRequest { return &MsgDepositStableMintRequest{ From: from.String(), @@ -489,19 +490,19 @@ func (m *MsgDepositStableMintRequest) Type() string { func (m *MsgDepositStableMintRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil @@ -522,7 +523,7 @@ func (m *MsgDepositStableMintRequest) GetSigners() []sdk.AccAddress { func NewMsgWithdrawStableMintRequest( from sdk.AccAddress, - appID uint64, extendedPairVaultID uint64, amount sdk.Int, stablemintID uint64, + appID uint64, extendedPairVaultID uint64, amount sdkmath.Int, stablemintID uint64, ) *MsgWithdrawStableMintRequest { return &MsgWithdrawStableMintRequest{ From: from.String(), @@ -543,19 +544,19 @@ func (m *MsgWithdrawStableMintRequest) Type() string { func (m *MsgWithdrawStableMintRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } if m.Amount.IsNil() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be nil") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be nil") } if m.Amount.IsNegative() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be negative") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be negative") } if m.Amount.IsZero() { - return errors.Wrap(ErrorInvalidAmount, "amount cannot be zero") + return errorsmod.Wrap(ErrorInvalidAmount, "amount cannot be zero") } return nil @@ -595,10 +596,10 @@ func (m *MsgVaultInterestCalcRequest) Type() string { func (m *MsgVaultInterestCalcRequest) ValidateBasic() error { if m.From == "" { - return errors.Wrap(ErrorInvalidFrom, "from cannot be empty") + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.From); err != nil { - return errors.Wrapf(ErrorInvalidFrom, "%s", err) + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) } return nil diff --git a/x/vault/types/msg_test.go b/x/vault/types/msg_test.go index 13fe04d43..8a2943e82 100644 --- a/x/vault/types/msg_test.go +++ b/x/vault/types/msg_test.go @@ -3,6 +3,8 @@ package types_test import ( "testing" + sdkmath "cosmossdk.io/math" + "github.com/comdex-official/comdex/x/vault/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -17,56 +19,56 @@ func TestNewMsgCreateRequest(t *testing.T) { { name: "empty from", msg: types.NewMsgCreateRequest( - sdk.AccAddress([]byte("")), 1, 1, sdk.NewInt(100), sdk.NewInt(50), + sdk.AccAddress([]byte("")), 1, 1, sdkmath.NewInt(100), sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amountIn nil", msg: types.NewMsgCreateRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.Int{}, sdk.NewInt(50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.Int{}, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amountIn negative", msg: types.NewMsgCreateRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(-123), sdk.NewInt(50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(-123), sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amountIn zero", msg: types.NewMsgCreateRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(0), sdk.NewInt(50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(0), sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amountOut nil", msg: types.NewMsgCreateRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(50), sdk.Int{}, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(50), sdkmath.Int{}, ), isErrExp: true, }, { name: "amountOut negative", msg: types.NewMsgCreateRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(50), sdk.NewInt(-123), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(50), sdkmath.NewInt(-123), ), isErrExp: true, }, { name: "amountOut zero", msg: types.NewMsgCreateRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(50), sdk.NewInt(0), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(50), sdkmath.NewInt(0), ), isErrExp: true, }, { name: "valid case", msg: types.NewMsgCreateRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(50), sdk.NewInt(25), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(50), sdkmath.NewInt(25), ), isErrExp: false, }, @@ -98,42 +100,42 @@ func TestNewMsgDepositRequest(t *testing.T) { { name: "empty from", msg: types.NewMsgDepositRequest( - sdk.AccAddress([]byte("")), 1, 1, 1, sdk.NewInt(50), + sdk.AccAddress([]byte("")), 1, 1, 1, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "vaultID zero", msg: types.NewMsgDepositRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 0, sdk.NewInt(50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 0, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amount nil", msg: types.NewMsgDepositRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.Int{}, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.Int{}, ), isErrExp: true, }, { name: "amount negative", msg: types.NewMsgDepositRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(-50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(-50), ), isErrExp: true, }, { name: "amount Zero", msg: types.NewMsgDepositRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(0), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(0), ), isErrExp: true, }, { name: "valid case", msg: types.NewMsgDepositRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(25), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(25), ), isErrExp: false, }, @@ -165,42 +167,42 @@ func TestNewMsgWithdrawRequest(t *testing.T) { { name: "empty from", msg: types.NewMsgWithdrawRequest( - sdk.AccAddress([]byte("")), 1, 1, 1, sdk.NewInt(50), + sdk.AccAddress([]byte("")), 1, 1, 1, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "vaultID zero", msg: types.NewMsgWithdrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 0, sdk.NewInt(50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 0, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amount nil", msg: types.NewMsgWithdrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.Int{}, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.Int{}, ), isErrExp: true, }, { name: "amount negative", msg: types.NewMsgWithdrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(-50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(-50), ), isErrExp: true, }, { name: "amount Zero", msg: types.NewMsgWithdrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(0), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(0), ), isErrExp: true, }, { name: "valid case", msg: types.NewMsgWithdrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(25), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(25), ), isErrExp: false, }, @@ -232,42 +234,42 @@ func TestNewMsgDrawRequest(t *testing.T) { { name: "empty from", msg: types.NewMsgDrawRequest( - sdk.AccAddress([]byte("")), 1, 1, 1, sdk.NewInt(50), + sdk.AccAddress([]byte("")), 1, 1, 1, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "vaultID zero", msg: types.NewMsgDrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 0, sdk.NewInt(50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 0, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amount nil", msg: types.NewMsgDrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.Int{}, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.Int{}, ), isErrExp: true, }, { name: "amount negative", msg: types.NewMsgDrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(-50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(-50), ), isErrExp: true, }, { name: "amount Zero", msg: types.NewMsgDrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(0), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(0), ), isErrExp: true, }, { name: "valid case", msg: types.NewMsgDrawRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(25), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(25), ), isErrExp: false, }, @@ -299,42 +301,42 @@ func TestNewMsgRepayRequest(t *testing.T) { { name: "empty from", msg: types.NewMsgRepayRequest( - sdk.AccAddress([]byte("")), 1, 1, 1, sdk.NewInt(50), + sdk.AccAddress([]byte("")), 1, 1, 1, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "vaultID zero", msg: types.NewMsgRepayRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 0, sdk.NewInt(50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 0, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amount nil", msg: types.NewMsgRepayRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.Int{}, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.Int{}, ), isErrExp: true, }, { name: "amount negative", msg: types.NewMsgRepayRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(-50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(-50), ), isErrExp: true, }, { name: "amount Zero", msg: types.NewMsgRepayRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(0), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(0), ), isErrExp: true, }, { name: "valid case", msg: types.NewMsgRepayRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdk.NewInt(25), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, 1, sdkmath.NewInt(25), ), isErrExp: false, }, @@ -412,35 +414,35 @@ func TestNewMsgCreateStableMintRequest(t *testing.T) { { name: "empty from", msg: types.NewMsgCreateStableMintRequest( - sdk.AccAddress([]byte("")), 1, 1, sdk.NewInt(50), + sdk.AccAddress([]byte("")), 1, 1, sdkmath.NewInt(50), ), isErrExp: true, }, { name: "amount nil", msg: types.NewMsgCreateStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.Int{}, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.Int{}, ), isErrExp: true, }, { name: "amount negative", msg: types.NewMsgCreateStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(-50), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(-50), ), isErrExp: true, }, { name: "amount Zero", msg: types.NewMsgCreateStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(0), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(0), ), isErrExp: true, }, { name: "valid case", msg: types.NewMsgCreateStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(25), + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(25), ), isErrExp: false, }, @@ -472,35 +474,35 @@ func TestNewMsgDepositStableMintRequest(t *testing.T) { { name: "empty from", msg: types.NewMsgDepositStableMintRequest( - sdk.AccAddress([]byte("")), 1, 1, sdk.NewInt(50), 1, + sdk.AccAddress([]byte("")), 1, 1, sdkmath.NewInt(50), 1, ), isErrExp: true, }, { name: "amount nil", msg: types.NewMsgDepositStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.Int{}, 1, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.Int{}, 1, ), isErrExp: true, }, { name: "amount negative", msg: types.NewMsgDepositStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(-50), 1, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(-50), 1, ), isErrExp: true, }, { name: "amount Zero", msg: types.NewMsgDepositStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(0), 1, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(0), 1, ), isErrExp: true, }, { name: "valid case", msg: types.NewMsgDepositStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(25), 1, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(25), 1, ), isErrExp: false, }, @@ -532,35 +534,35 @@ func TestNewMsgWithdrawStableMintRequest(t *testing.T) { { name: "empty from", msg: types.NewMsgWithdrawStableMintRequest( - sdk.AccAddress([]byte("")), 1, 1, sdk.NewInt(50), 1, + sdk.AccAddress([]byte("")), 1, 1, sdkmath.NewInt(50), 1, ), isErrExp: true, }, { name: "amount nil", msg: types.NewMsgWithdrawStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.Int{}, 1, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.Int{}, 1, ), isErrExp: true, }, { name: "amount negative", msg: types.NewMsgWithdrawStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(-50), 1, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(-50), 1, ), isErrExp: true, }, { name: "amount Zero", msg: types.NewMsgWithdrawStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(0), 1, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(0), 1, ), isErrExp: true, }, { name: "valid case", msg: types.NewMsgWithdrawStableMintRequest( - sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdk.NewInt(25), 1, + sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), 1, 1, sdkmath.NewInt(25), 1, ), isErrExp: false, }, diff --git a/x/vault/types/query.pb.go b/x/vault/types/query.pb.go index 1f7c33531..149e147d0 100644 --- a/x/vault/types/query.pb.go +++ b/x/vault/types/query.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -32,17 +32,17 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type VaultInfo struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - ExtendedPairID uint64 `protobuf:"varint,2,opt,name=extended_pair_id,json=extendedPairId,proto3" json:"extended_pair_id,omitempty" yaml:"extended_pair_id"` - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - Collateral github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=collateral,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral" yaml:"collateral"` - Debt github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=debt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt" yaml:"debt"` - CollateralizationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=collateralization_ratio,json=collateralizationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateralization_ratio" yaml:"collateralization_ratio"` - ExtendedPairName string `protobuf:"bytes,7,opt,name=extended_pair_name,json=extendedPairName,proto3" json:"extended_pair_name,omitempty" yaml:"extended_pair_name"` - InterestRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=interest_rate,json=interestRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate" yaml:"interest_rate"` - AssetInDenom string `protobuf:"bytes,9,opt,name=asset_in_denom,json=assetInDenom,proto3" json:"asset_in_denom,omitempty" yaml:"asset_in_denom"` - AssetOutDenom string `protobuf:"bytes,10,opt,name=asset_out_denom,json=assetOutDenom,proto3" json:"asset_out_denom,omitempty" yaml:"asset_out_denom"` - MinCr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=min_cr,json=minCr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_cr" yaml:"min_cr"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ExtendedPairID uint64 `protobuf:"varint,2,opt,name=extended_pair_id,json=extendedPairId,proto3" json:"extended_pair_id,omitempty" yaml:"extended_pair_id"` + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` + Collateral cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=collateral,proto3,customtype=cosmossdk.io/math.Int" json:"collateral" yaml:"collateral"` + Debt cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=debt,proto3,customtype=cosmossdk.io/math.Int" json:"debt" yaml:"debt"` + CollateralizationRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=collateralization_ratio,json=collateralizationRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"collateralization_ratio" yaml:"collateralization_ratio"` + ExtendedPairName string `protobuf:"bytes,7,opt,name=extended_pair_name,json=extendedPairName,proto3" json:"extended_pair_name,omitempty" yaml:"extended_pair_name"` + InterestRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=interest_rate,json=interestRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"interest_rate" yaml:"interest_rate"` + AssetInDenom string `protobuf:"bytes,9,opt,name=asset_in_denom,json=assetInDenom,proto3" json:"asset_in_denom,omitempty" yaml:"asset_in_denom"` + AssetOutDenom string `protobuf:"bytes,10,opt,name=asset_out_denom,json=assetOutDenom,proto3" json:"asset_out_denom,omitempty" yaml:"asset_out_denom"` + MinCr cosmossdk_io_math.LegacyDec `protobuf:"bytes,11,opt,name=min_cr,json=minCr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_cr" yaml:"min_cr"` } func (m *VaultInfo) Reset() { *m = VaultInfo{} } @@ -828,7 +828,7 @@ func (m *QueryTokenMintedByAppAndExtendedPairRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryTokenMintedByAppAndExtendedPairRequest proto.InternalMessageInfo type QueryTokenMintedByAppAndExtendedPairResponse struct { - TokenMinted github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=token_minted,json=tokenMinted,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_minted" yaml:"token_minted"` + TokenMinted cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=token_minted,json=tokenMinted,proto3,customtype=cosmossdk.io/math.Int" json:"token_minted" yaml:"token_minted"` } func (m *QueryTokenMintedByAppAndExtendedPairResponse) Reset() { @@ -1148,7 +1148,7 @@ func (m *QueryTotalValueLockedByAppAndExtendedPairRequest) XXX_DiscardUnknown() var xxx_messageInfo_QueryTotalValueLockedByAppAndExtendedPairRequest proto.InternalMessageInfo type QueryTotalValueLockedByAppAndExtendedPairResponse struct { - ValueLocked *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=value_locked,json=valueLocked,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"value_locked,omitempty"` + ValueLocked *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=value_locked,json=valueLocked,proto3,customtype=cosmossdk.io/math.Int" json:"value_locked,omitempty"` } func (m *QueryTotalValueLockedByAppAndExtendedPairResponse) Reset() { @@ -1782,7 +1782,7 @@ func (m *QueryTVLByAppRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryTVLByAppRequest proto.InternalMessageInfo type QueryTVLByAppResponse struct { - CollateralLocked github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=collateral_locked,json=collateralLocked,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_locked" yaml:"collateral_locked"` + CollateralLocked cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=collateral_locked,json=collateralLocked,proto3,customtype=cosmossdk.io/math.Int" json:"collateral_locked" yaml:"collateral_locked"` } func (m *QueryTVLByAppResponse) Reset() { *m = QueryTVLByAppResponse{} } @@ -1857,10 +1857,10 @@ func (m *QueryUserMyPositionByAppRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryUserMyPositionByAppRequest proto.InternalMessageInfo type QueryUserMyPositionByAppResponse struct { - CollateralLocked github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=collateral_locked,json=collateralLocked,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_locked" yaml:"collateral_locked"` - TotalDue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=total_due,json=totalDue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_due" yaml:"total_due"` - AvailableToBorrow github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=available_to_borrow,json=availableToBorrow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"available_to_borrow" yaml:"available_to_borrow"` - AverageCrRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=average_cr_ratio,json=averageCrRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"average_cr_ratio" yaml:"average_cr_ratio"` + CollateralLocked cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=collateral_locked,json=collateralLocked,proto3,customtype=cosmossdk.io/math.Int" json:"collateral_locked" yaml:"collateral_locked"` + TotalDue cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=total_due,json=totalDue,proto3,customtype=cosmossdk.io/math.Int" json:"total_due" yaml:"total_due"` + AvailableToBorrow cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=available_to_borrow,json=availableToBorrow,proto3,customtype=cosmossdk.io/math.Int" json:"available_to_borrow" yaml:"available_to_borrow"` + AverageCrRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=average_cr_ratio,json=averageCrRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"average_cr_ratio" yaml:"average_cr_ratio"` } func (m *QueryUserMyPositionByAppResponse) Reset() { *m = QueryUserMyPositionByAppResponse{} } @@ -2193,192 +2193,192 @@ func init() { proto.RegisterFile("comdex/vault/v1beta1/query.proto", fileDescrip var fileDescriptor_8d35126a97363346 = []byte{ // 2973 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5b, 0x5d, 0x6c, 0x1c, 0x57, - 0xf5, 0xf7, 0xac, 0xe3, 0x34, 0xbe, 0x8e, 0x1d, 0xfb, 0xc6, 0x75, 0xb6, 0xdb, 0x74, 0xd7, 0xbd, - 0x49, 0x9d, 0xcf, 0xdd, 0xad, 0x9d, 0xcf, 0xe6, 0xcb, 0xd9, 0xb5, 0x9d, 0xfc, 0xf7, 0xdf, 0xa4, - 0x76, 0x26, 0xc1, 0x69, 0x40, 0xe9, 0x32, 0xde, 0x19, 0xbb, 0xa3, 0xcc, 0xce, 0x6c, 0x77, 0xc6, - 0x4e, 0x4d, 0x88, 0x84, 0xf2, 0x00, 0xa2, 0x88, 0xaa, 0x08, 0x84, 0xa0, 0x08, 0x78, 0x01, 0xd1, - 0xaa, 0x2f, 0x45, 0x42, 0x95, 0x10, 0xbc, 0xe4, 0x05, 0x05, 0x09, 0xa4, 0x20, 0x82, 0x84, 0xfa, - 0xb0, 0x2a, 0x4e, 0x9f, 0x78, 0x00, 0xb4, 0x42, 0x42, 0xe2, 0x43, 0x42, 0x73, 0xef, 0x99, 0x9d, - 0x99, 0xf5, 0xec, 0x7c, 0xd8, 0x59, 0xea, 0x2a, 0x2f, 0xf6, 0xee, 0xcc, 0xbd, 0xe7, 0x9e, 0xdf, - 0xef, 0xdc, 0x7b, 0xee, 0xb9, 0xf7, 0x9c, 0x45, 0xc3, 0x25, 0xad, 0x2c, 0x4a, 0xaf, 0x67, 0x97, - 0x84, 0x45, 0xc5, 0xc8, 0x2e, 0x8d, 0xce, 0x49, 0x86, 0x30, 0x9a, 0x7d, 0x6d, 0x51, 0xaa, 0x2e, - 0x67, 0x2a, 0x55, 0xcd, 0xd0, 0xf0, 0x20, 0x6b, 0x91, 0xa1, 0x2d, 0x32, 0xd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3, 0x51, 0x02, 0xaf, 0x36, 0xfb, 0xa6, 0x3f, 0x70, 0x68, - 0x7f, 0x18, 0xf4, 0x9f, 0x36, 0xab, 0xbe, 0x13, 0x43, 0x19, 0x87, 0xcf, 0x9d, 0x6c, 0x78, 0x5c, - 0x27, 0xac, 0x9c, 0x2a, 0xb6, 0x75, 0x5f, 0xf1, 0x9a, 0x02, 0x9d, 0xeb, 0x9d, 0x02, 0x9b, 0x1e, - 0xf5, 0x14, 0x10, 0x50, 0x36, 0x34, 0x53, 0x30, 0x0d, 0x32, 0x68, 0x0b, 0x35, 0x63, 0xb1, 0x60, - 0x91, 0xb5, 0xbd, 0x5e, 0x4b, 0x6d, 0x73, 0x18, 0xba, 0x58, 0x10, 0x09, 0xff, 0x04, 0xfd, 0x58, - 0x10, 0xc9, 0x07, 0x1c, 0x3a, 0xe0, 0x18, 0x43, 0x64, 0x93, 0xac, 0xa0, 0xe6, 0x14, 0xc5, 0x39, - 0x8a, 0xbe, 0xe1, 0xbc, 0xdc, 0x5d, 0x0e, 0x1d, 0x0c, 0xa7, 0x38, 0x30, 0x33, 0x8a, 0xba, 0x19, - 0x7e, 0x59, 0xd4, 0xe9, 0x22, 0xd9, 0x94, 0x1f, 0xac, 0xd7, 0x52, 0xfd, 0x4e, 0x6a, 0x64, 0x51, - 0x27, 0xfc, 0x16, 0xe0, 0x46, 0x6f, 0xfb, 0x52, 0x78, 0x97, 0x43, 0xc3, 0xae, 0x25, 0xce, 0x60, - 0xa8, 0xd4, 0xcc, 0x16, 0xe3, 0x8d, 0x29, 0xcd, 0x45, 0x09, 0x95, 0x1e, 0x39, 0xdf, 0x1f, 0x58, - 0x11, 0xa0, 0xb7, 0xae, 0x1b, 0x97, 0xe4, 0xff, 0x58, 0x33, 0xfc, 0x8a, 0x76, 0x43, 0x52, 0x2f, - 0x9a, 0xa7, 0x22, 0xf1, 0x71, 0xda, 0x47, 0xbe, 0x63, 0x2d, 0x94, 0x40, 0xfc, 0x8d, 0x68, 0x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f6, 0x33, 0x88, 0x9b, 0x75, 0xc8, 0xa6, 0x7e, 0x46, 0x97, 0xaa, 0x17, 0x97, 0x67, 0x34, 0x5d, - 0x36, 0xb1, 0xb6, 0x37, 0x7b, 0x49, 0xfe, 0xda, 0x09, 0xf1, 0xa2, 0xe7, 0xa8, 0x9f, 0x30, 0x25, - 0xb8, 0x88, 0xba, 0x0d, 0xf3, 0x24, 0x53, 0x14, 0x17, 0x25, 0x40, 0x92, 0x8f, 0x3c, 0x60, 0xbf, - 0x75, 0xc9, 0x03, 0x82, 0x08, 0xbf, 0x85, 0x7e, 0x9e, 0x5c, 0x94, 0xf0, 0x17, 0xd1, 0x76, 0x61, - 0x49, 0x90, 0x15, 0xba, 0xe9, 0x1a, 0x5a, 0x71, 0x4e, 0xab, 0x56, 0xb5, 0x9b, 0x50, 0xa7, 0x72, - 0x21, 0xf2, 0x50, 0x09, 0xb0, 0xc5, 0x6a, 0x91, 0x84, 0x1f, 0x68, 0x3c, 0xbd, 0xa2, 0xe5, 0xe9, - 0x33, 0xac, 0xa3, 0x7e, 0x61, 0x49, 0xaa, 0x0a, 0x0b, 0x52, 0xb1, 0x54, 0x85, 0x7a, 0x11, 0x56, - 0xf5, 0x52, 0x88, 0x5c, 0x76, 0xb0, 0xc3, 0x1a, 0xda, 0x2d, 0x8f, 0xf0, 0x7d, 0xf0, 0x68, 0xa2, - 0x4a, 0x0b, 0x44, 0xc8, 0x34, 0x5c, 0x68, 0x99, 0x06, 0x77, 0xfa, 0x05, 0x7a, 0x64, 0x34, 0x57, - 0x78, 0xc4, 0x5b, 0x5d, 0x33, 0x1c, 0x19, 0x09, 0x92, 0x08, 0x13, 0xe9, 0x4b, 0x1c, 0xea, 0x5d, - 0xd4, 0x25, 0xfb, 0x0d, 0x38, 0x9e, 0x13, 0xde, 0x8e, 0x87, 0x5e, 0xdc, 0x06, 0x6d, 0x24, 0x49, - 0x70, 0x46, 0x70, 0x6e, 0x31, 0xc5, 0x17, 0xc1, 0xd6, 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0xe3, 0xde, 0x4a, 0x92, 0xbb, - 0xbf, 0x92, 0xe4, 0x3e, 0x5a, 0x49, 0x72, 0x6f, 0x3d, 0x4c, 0x76, 0xdc, 0x7f, 0x98, 0xec, 0xf8, - 0xe3, 0xc3, 0x64, 0xc7, 0x67, 0xb3, 0xae, 0xf4, 0x9f, 0x29, 0x3c, 0xad, 0xcd, 0xcf, 0xcb, 0x25, - 0x59, 0x50, 0xac, 0xc1, 0xac, 0xe1, 0x68, 0x2e, 0x70, 0x6e, 0x33, 0xfd, 0x9d, 0xff, 0xa1, 0xff, - 0x06, 0x00, 0x00, 0xff, 0xff, 0x93, 0x7f, 0xea, 0xf2, 0xa3, 0x40, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5b, 0x5d, 0x6c, 0x14, 0xd7, + 0x15, 0xf6, 0xac, 0x31, 0xc1, 0xd7, 0xd8, 0xd8, 0x17, 0x63, 0x96, 0x85, 0xec, 0x3a, 0x97, 0x04, + 0x48, 0x60, 0x77, 0x63, 0x63, 0x20, 0xe1, 0x7f, 0xd7, 0x76, 0xe8, 0x8a, 0x1f, 0xc3, 0x40, 0x21, + 0xb4, 0x22, 0x9b, 0xf1, 0xce, 0xd8, 0x8c, 0x98, 0x9d, 0x59, 0x76, 0xc6, 0x26, 0x2e, 0xa2, 0xad, + 0x78, 0x68, 0xa4, 0x54, 0x8d, 0x5a, 0xb5, 0xaa, 0xd4, 0x54, 0x6d, 0x5f, 0x5a, 0x35, 0x51, 0x5e, + 0x12, 0xb5, 0x8a, 0x54, 0xb5, 0x2f, 0xbc, 0x54, 0x54, 0x6a, 0x25, 0xaa, 0x52, 0xa9, 0xca, 0xc3, + 0x2a, 0x35, 0x79, 0xea, 0x43, 0x55, 0xad, 0xfa, 0xd4, 0x1f, 0xa9, 0x9a, 0x7b, 0xcf, 0xec, 0xcc, + 0xec, 0xce, 0xdf, 0xda, 0x6c, 0xea, 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, 0x4d, 0x4a, 0xec, 0x8b, 0xd6, + 0x18, 0x14, 0x7f, 0x96, 0x2a, 0x9e, 0xc4, 0x3b, 0x82, 0x14, 0xc7, 0x1f, 0x70, 0x68, 0xb3, 0xc7, + 0xed, 0x0a, 0xfc, 0x62, 0x94, 0xb1, 0x5c, 0x14, 0x8f, 0xb5, 0xd1, 0x03, 0x54, 0x9c, 0xa0, 0x2a, + 0x66, 0xf0, 0xbe, 0x20, 0x15, 0x4d, 0x3a, 0x73, 0x0e, 0x3a, 0xf1, 0xdd, 0x18, 0x5c, 0x56, 0x0b, + 0xbc, 0x10, 0x82, 0x4f, 0x44, 0xd6, 0xc7, 0xfb, 0x9c, 0x23, 0x71, 0x72, 0xe5, 0x02, 0x00, 0xdf, + 0x55, 0x8a, 0xef, 0x22, 0xbe, 0x10, 0x86, 0x4f, 0xa8, 0x54, 0xd2, 0x82, 0x2a, 0xba, 0x7d, 0xdc, + 0x31, 0x81, 0x9a, 0xcf, 0x48, 0xee, 0xe0, 0x9f, 0xc6, 0x60, 0x97, 0x16, 0x7e, 0x27, 0x02, 0x4f, + 0x85, 0x4e, 0xfe, 0x08, 0x97, 0x4f, 0x12, 0xd3, 0xab, 0x94, 0x02, 0x9c, 0x28, 0x94, 0x93, 0x39, + 0x2c, 0x06, 0x70, 0x92, 0x96, 0x45, 0x97, 0x37, 0xb9, 0x43, 0x9f, 0x49, 0x94, 0x97, 0x7f, 0x79, + 0xd1, 0xf4, 0x2f, 0x0e, 0x3d, 0x1b, 0xe5, 0x76, 0x04, 0xce, 0x85, 0xa2, 0x0b, 0xbb, 0x12, 0x92, + 0xc8, 0xaf, 0x46, 0x04, 0xb0, 0x73, 0x9a, 0xb2, 0x33, 0x8d, 0x27, 0x03, 0xd8, 0x29, 0x88, 0x8d, + 0x39, 0x23, 0xab, 0x69, 0x41, 0x51, 0xd2, 0xce, 0xf3, 0x0d, 0xdd, 0x76, 0x94, 0xdf, 0x71, 0x68, + 0x9b, 0xef, 0x55, 0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x20, 0xf3, 0xd7, 0x2d, 0x69, 0x2d, 0xd6, 0x7d, 0x68, 0xed, 0x6e, + 0x7c, 0x4f, 0xd8, 0x03, 0x77, 0x37, 0x61, 0x05, 0x82, 0xc0, 0xdd, 0x4d, 0xe8, 0xa1, 0x3e, 0x39, + 0x44, 0xe1, 0x8e, 0xe1, 0x6c, 0xd0, 0xba, 0xe4, 0x71, 0x2a, 0x9f, 0xbf, 0x70, 0xff, 0xaf, 0xc9, + 0xae, 0x77, 0x97, 0x93, 0x5d, 0xf7, 0x97, 0x93, 0xdc, 0x83, 0xe5, 0x24, 0xf7, 0xc9, 0x72, 0x92, + 0xfb, 0xf6, 0xa3, 0x64, 0xd7, 0x83, 0x47, 0xc9, 0xae, 0xbf, 0x3c, 0x4a, 0x76, 0x7d, 0x29, 0x3b, + 0x2f, 0x1b, 0xd7, 0x17, 0x66, 0x4d, 0xf5, 0x40, 0x78, 0x5a, 0x9b, 0x9b, 0x93, 0x4b, 0xb2, 0xa0, + 0x58, 0x83, 0x59, 0xc3, 0x19, 0x4b, 0x15, 0x49, 0x9f, 0x5d, 0x4f, 0xff, 0x60, 0x7e, 0xff, 0xff, + 0x02, 0x00, 0x00, 0xff, 0xff, 0xea, 0xd6, 0xc1, 0x10, 0xec, 0x3f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -9781,7 +9781,7 @@ func (m *QueryTotalValueLockedByAppAndExtendedPairResponse) Unmarshal(dAtA []byt if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.ValueLocked = &v if err := m.ValueLocked.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/vault/types/tx.pb.go b/x/vault/types/tx.pb.go index 81222ee83..10fc94034 100644 --- a/x/vault/types/tx.pb.go +++ b/x/vault/types/tx.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -30,11 +30,11 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgCreateRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - AmountIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount_in,json=amountIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in" yaml:"amount_in"` - AmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount_out,json=amountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out" yaml:"amount_out"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + AmountIn cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=amount_in,json=amountIn,proto3,customtype=cosmossdk.io/math.Int" json:"amount_in" yaml:"amount_in"` + AmountOut cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount_out,json=amountOut,proto3,customtype=cosmossdk.io/math.Int" json:"amount_out" yaml:"amount_out"` } func (m *MsgCreateRequest) Reset() { *m = MsgCreateRequest{} } @@ -107,11 +107,11 @@ func (m *MsgCreateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateResponse proto.InternalMessageInfo type MsgDepositRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` } func (m *MsgDepositRequest) Reset() { *m = MsgDepositRequest{} } @@ -184,11 +184,11 @@ func (m *MsgDepositResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo type MsgWithdrawRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` } func (m *MsgWithdrawRequest) Reset() { *m = MsgWithdrawRequest{} } @@ -261,11 +261,11 @@ func (m *MsgWithdrawResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawResponse proto.InternalMessageInfo type MsgDrawRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` } func (m *MsgDrawRequest) Reset() { *m = MsgDrawRequest{} } @@ -338,11 +338,11 @@ func (m *MsgDrawResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDrawResponse proto.InternalMessageInfo type MsgRepayRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` } func (m *MsgRepayRequest) Reset() { *m = MsgRepayRequest{} } @@ -491,11 +491,11 @@ func (m *MsgCloseResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCloseResponse proto.InternalMessageInfo type MsgDepositAndDrawRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + UserVaultId uint64 `protobuf:"varint,4,opt,name=user_vault_id,json=userVaultId,proto3" json:"user_vault_id,omitempty" yaml:"user_vault_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` } func (m *MsgDepositAndDrawRequest) Reset() { *m = MsgDepositAndDrawRequest{} } @@ -568,10 +568,10 @@ func (m *MsgDepositAndDrawResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositAndDrawResponse proto.InternalMessageInfo type MsgCreateStableMintRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"Amount"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"Amount"` } func (m *MsgCreateStableMintRequest) Reset() { *m = MsgCreateStableMintRequest{} } @@ -644,11 +644,11 @@ func (m *MsgCreateStableMintResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateStableMintResponse proto.InternalMessageInfo type MsgDepositStableMintRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` - StableVaultId uint64 `protobuf:"varint,5,opt,name=stable_vault_id,json=stableVaultId,proto3" json:"stable_vault_id,omitempty" yaml:"stable_vault_id"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` + StableVaultId uint64 `protobuf:"varint,5,opt,name=stable_vault_id,json=stableVaultId,proto3" json:"stable_vault_id,omitempty" yaml:"stable_vault_id"` } func (m *MsgDepositStableMintRequest) Reset() { *m = MsgDepositStableMintRequest{} } @@ -721,11 +721,11 @@ func (m *MsgDepositStableMintResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositStableMintResponse proto.InternalMessageInfo type MsgWithdrawStableMintRequest struct { - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` - StableVaultId uint64 `protobuf:"varint,5,opt,name=stable_vault_id,json=stableVaultId,proto3" json:"stable_vault_id,omitempty" yaml:"stable_vault_id"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultId uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` + StableVaultId uint64 `protobuf:"varint,5,opt,name=stable_vault_id,json=stableVaultId,proto3" json:"stable_vault_id,omitempty" yaml:"stable_vault_id"` } func (m *MsgWithdrawStableMintRequest) Reset() { *m = MsgWithdrawStableMintRequest{} } @@ -900,63 +900,63 @@ func init() { func init() { proto.RegisterFile("comdex/vault/v1beta1/tx.proto", fileDescriptor_4b7a3c3b9b1a607e) } var fileDescriptor_4b7a3c3b9b1a607e = []byte{ - // 891 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x98, 0xcf, 0x6e, 0xe2, 0x46, - 0x18, 0xc0, 0xb1, 0x43, 0xd2, 0x30, 0x11, 0x4d, 0x98, 0x90, 0x88, 0x3a, 0xc5, 0x4e, 0xdd, 0x36, - 0xa5, 0x87, 0xd8, 0x25, 0xb9, 0x55, 0x95, 0xaa, 0x40, 0x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xb2, 0x51, 0xdd, 0x19, 0x16, 0xe3, 0x1e, 0x62, 0x34, 0xfa, 0xde, - 0x34, 0x26, 0x2c, 0xfc, 0xdf, 0x1c, 0xd8, 0x88, 0x6c, 0x4c, 0x70, 0x2f, 0x76, 0x0f, 0x8f, 0x66, - 0xb0, 0x3f, 0x95, 0x4d, 0x88, 0xc0, 0x48, 0x33, 0x99, 0x40, 0x60, 0x5c, 0x93, 0x9c, 0x40, 0x60, - 0x6c, 0xaf, 0x2a, 0xfd, 0x78, 0x79, 0x23, 0x26, 0xfe, 0xeb, 0x88, 0x89, 0xcb, 0x8e, 0xc8, 0x5d, - 0x75, 0x44, 0xee, 0x55, 0x47, 0xe4, 0xfe, 0xb9, 0x15, 0x13, 0x57, 0xb7, 0x62, 0xe2, 0xfa, 0x56, - 0x4c, 0xfc, 0xa2, 0x86, 0x0e, 0x90, 0x9e, 0xff, 0x5d, 0x7c, 0x72, 0x62, 0xd6, 0x4d, 0xbd, 0xc9, - 0x7e, 0xab, 0xfd, 0x7f, 0x01, 0xe9, 0x69, 0x52, 0x5b, 0xa2, 0xff, 0xea, 0xed, 0xbf, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x50, 0x76, 0xdc, 0x27, 0x22, 0x14, 0x00, 0x00, + // 887 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x98, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0x80, 0x63, 0x37, 0x2d, 0xcd, 0x54, 0xa1, 0xcd, 0x34, 0xad, 0x82, 0x4b, 0xec, 0x62, 0xa0, + 0x84, 0x03, 0x36, 0x49, 0x6f, 0x88, 0x4b, 0x53, 0x84, 0x94, 0x43, 0x81, 0x1a, 0xa9, 0x08, 0x84, + 0x14, 0x39, 0xf1, 0x34, 0xb5, 0x48, 0x3c, 0x26, 0x1e, 0x97, 0x16, 0x09, 0x89, 0x3b, 0x17, 0x7e, + 0xc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, 0x11, 0x9f, + 0x63, 0x9d, 0x0d, 0x6b, 0x06, 0xac, 0x5e, 0xe3, 0x63, 0x48, 0x1f, 0xf1, 0x54, 0xa6, 0x21, 0x5b, + 0x3f, 0x9f, 0x33, 0x9d, 0x81, 0x29, 0xa4, 0xad, 0x8b, 0xf1, 0x63, 0x50, 0xdf, 0x70, 0x14, 0xea, + 0x7e, 0x13, 0x3b, 0xe8, 0x2e, 0x41, 0x65, 0x30, 0xd8, 0x73, 0x33, 0x18, 0x4f, 0x79, 0x90, 0x1b, + 0x94, 0xc9, 0x3d, 0xcb, 0x98, 0x7f, 0xbe, 0x33, 0xa6, 0xda, 0x16, 0xf8, 0x28, 0x02, 0x24, 0xc3, + 0xfc, 0x1f, 0x0f, 0x84, 0xeb, 0x2e, 0xff, 0x33, 0xd1, 0x6b, 0x4d, 0x74, 0x60, 0x5a, 0xb7, 0xad, + 0xb1, 0x0f, 0x50, 0x25, 0xa7, 0x42, 0xb5, 0x37, 0x84, 0x2a, 0x0f, 0xb6, 0x22, 0x61, 0x30, 0x58, + 0x97, 0x3c, 0x5d, 0x67, 0x28, 0xef, 0x1c, 0xad, 0xa1, 0xc4, 0x82, 0x65, 0xb0, 0xea, 0x50, 0x06, + 0x83, 0xc0, 0x16, 0x69, 0x60, 0x42, 0xd7, 0x93, 0x36, 0x7d, 0x9b, 0x21, 0x05, 0x59, 0x4b, 0xfb, + 0x92, 0xfe, 0xa7, 0x2f, 0x82, 0x8f, 0xa3, 0x89, 0x32, 0xe4, 0xcf, 0x78, 0xaa, 0xd0, 0xef, 0xe9, + 0x73, 0xe6, 0xef, 0x80, 0xb9, 0x04, 0xf2, 0x63, 0x90, 0x32, 0xe8, 0x0f, 0x38, 0x9a, 0xe7, 0xbe, + 0xbe, 0x45, 0x50, 0x1b, 0x39, 0x64, 0x5f, 0x6f, 0xd6, 0xdf, 0x13, 0xf3, 0x91, 0x32, 0xb9, 0x30, + 0x4d, 0xf3, 0xf0, 0x33, 0x28, 0x22, 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0x98, 0x4c, 0x20, + 0x30, 0xae, 0x48, 0x4e, 0x20, 0x30, 0xb6, 0x56, 0x95, 0x0f, 0x2f, 0x5e, 0x8b, 0x89, 0x7b, 0x1d, + 0x31, 0x71, 0xd1, 0x11, 0xb9, 0xcb, 0x8e, 0xc8, 0xbd, 0xea, 0x88, 0xdc, 0xff, 0x57, 0x62, 0xe2, + 0xf2, 0x4a, 0x4c, 0x3c, 0xbf, 0x12, 0x13, 0xbf, 0xa9, 0x0d, 0x93, 0x9c, 0xb8, 0xb5, 0x9e, 0x6f, + 0xd5, 0xf7, 0xff, 0x15, 0x3e, 0x3e, 0x36, 0xeb, 0xa6, 0xde, 0x64, 0xf7, 0x6a, 0xff, 0xdf, 0x1a, + 0x39, 0xb7, 0x91, 0x53, 0x5b, 0xa2, 0xff, 0xca, 0x76, 0xdf, 0x06, 0x00, 0x00, 0xff, 0xff, 0x9d, + 0x4f, 0x41, 0x91, 0x78, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/vault/types/vault.go b/x/vault/types/vault.go index ca2bb3652..dd0ab3d1a 100644 --- a/x/vault/types/vault.go +++ b/x/vault/types/vault.go @@ -1,23 +1,24 @@ package types import ( + errorsmod "cosmossdk.io/errors" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" + storetypes "cosmossdk.io/store/types" ) const ( - CreateVaultGas = sdk.Gas(36329) - DepositVaultGas = sdk.Gas(23554) - WithdrawVaultGas = sdk.Gas(26473) - DrawVaultGas = sdk.Gas(37559) - RepayVaultGas = sdk.Gas(37559) - CloseVaultGas = sdk.Gas(37559) - DepositDrawVaultGas = sdk.Gas(26329) - CreateStableVaultGas = sdk.Gas(36329) - DepositStableVaultGas = sdk.Gas(23554) - WithdrawStableVaultGas = sdk.Gas(26473) + CreateVaultGas = storetypes.Gas(36329) + DepositVaultGas = storetypes.Gas(23554) + WithdrawVaultGas = storetypes.Gas(26473) + DrawVaultGas = storetypes.Gas(37559) + RepayVaultGas = storetypes.Gas(37559) + CloseVaultGas = storetypes.Gas(37559) + DepositDrawVaultGas = storetypes.Gas(26329) + CreateStableVaultGas = storetypes.Gas(36329) + DepositStableVaultGas = storetypes.Gas(23554) + WithdrawStableVaultGas = storetypes.Gas(26473) ) func (m *Vault) Validate() error { @@ -28,7 +29,7 @@ func (m *Vault) Validate() error { return fmt.Errorf("owner cannot be empty") } if _, err := sdk.AccAddressFromBech32(m.Owner); err != nil { - return errors.Wrapf(err, "invalid owner %s", m.Owner) + return errorsmod.Wrapf(err, "invalid owner %s", m.Owner) } if m.AmountIn.IsNil() { return fmt.Errorf("amount_in cannot be nil") diff --git a/x/vault/types/vault.pb.go b/x/vault/types/vault.pb.go index 171745700..54221bb71 100644 --- a/x/vault/types/vault.pb.go +++ b/x/vault/types/vault.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" @@ -30,17 +30,17 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // app_vault_type_id will be the key for the KVStore for this value type Vault struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultID uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - Owner string `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - AmountIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount_in,json=amountIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in" yaml:"amount_in"` - AmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=amount_out,json=amountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out" yaml:"amount_out"` - CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` - InterestAccumulated github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=interest_accumulated,json=interestAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"interest_accumulated" yaml:"interest_accumulated"` - ClosingFeeAccumulated github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=closing_fee_accumulated,json=closingFeeAccumulated,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"closing_fee_accumulated" yaml:"interest_accumulated"` - BlockHeight int64 `protobuf:"varint,10,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` - BlockTime time.Time `protobuf:"bytes,11,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultID uint64 `protobuf:"varint,3,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + Owner string `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` + AmountIn cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount_in,json=amountIn,proto3,customtype=cosmossdk.io/math.Int" json:"amount_in" yaml:"amount_in"` + AmountOut cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=amount_out,json=amountOut,proto3,customtype=cosmossdk.io/math.Int" json:"amount_out" yaml:"amount_out"` + CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` + InterestAccumulated cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=interest_accumulated,json=interestAccumulated,proto3,customtype=cosmossdk.io/math.Int" json:"interest_accumulated" yaml:"interest_accumulated"` + ClosingFeeAccumulated cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=closing_fee_accumulated,json=closingFeeAccumulated,proto3,customtype=cosmossdk.io/math.Int" json:"closing_fee_accumulated" yaml:"interest_accumulated"` + BlockHeight int64 `protobuf:"varint,10,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` + BlockTime time.Time `protobuf:"bytes,11,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` } func (m *Vault) Reset() { *m = Vault{} } @@ -117,11 +117,11 @@ func (m *OwnerAppExtendedPairVaultMappingData) XXX_DiscardUnknown() { var xxx_messageInfo_OwnerAppExtendedPairVaultMappingData proto.InternalMessageInfo type AppExtendedPairVaultMappingData struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - ExtendedPairId uint64 `protobuf:"varint,2,opt,name=extended_pair_id,json=extendedPairId,proto3" json:"extended_pair_id,omitempty" yaml:"extended_pair_id"` - VaultIds []uint64 `protobuf:"varint,3,rep,packed,name=vault_ids,json=vaultIds,proto3" json:"vault_ids,omitempty" yaml:"vault_ids"` - TokenMintedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=token_minted_amount,json=tokenMintedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_minted_amount" yaml:"token_minted_amount"` - CollateralLockedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=collateral_locked_amount,json=collateralLockedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_locked_amount" yaml:"collateral_locked_amount"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + ExtendedPairId uint64 `protobuf:"varint,2,opt,name=extended_pair_id,json=extendedPairId,proto3" json:"extended_pair_id,omitempty" yaml:"extended_pair_id"` + VaultIds []uint64 `protobuf:"varint,3,rep,packed,name=vault_ids,json=vaultIds,proto3" json:"vault_ids,omitempty" yaml:"vault_ids"` + TokenMintedAmount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=token_minted_amount,json=tokenMintedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"token_minted_amount" yaml:"token_minted_amount"` + CollateralLockedAmount cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=collateral_locked_amount,json=collateralLockedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"collateral_locked_amount" yaml:"collateral_locked_amount"` } func (m *AppExtendedPairVaultMappingData) Reset() { *m = AppExtendedPairVaultMappingData{} } @@ -158,8 +158,8 @@ func (m *AppExtendedPairVaultMappingData) XXX_DiscardUnknown() { var xxx_messageInfo_AppExtendedPairVaultMappingData proto.InternalMessageInfo type TvlLockedDataMap struct { - AssetDenom string `protobuf:"bytes,1,opt,name=asset_denom,json=assetDenom,proto3" json:"asset_denom,omitempty" yaml:"asset_denom"` - CollateralLockedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=collateral_locked_amount,json=collateralLockedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_locked_amount" yaml:"collateral_locked_amount"` + AssetDenom string `protobuf:"bytes,1,opt,name=asset_denom,json=assetDenom,proto3" json:"asset_denom,omitempty" yaml:"asset_denom"` + CollateralLockedAmount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=collateral_locked_amount,json=collateralLockedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"collateral_locked_amount" yaml:"collateral_locked_amount"` } func (m *TvlLockedDataMap) Reset() { *m = TvlLockedDataMap{} } @@ -196,8 +196,8 @@ func (m *TvlLockedDataMap) XXX_DiscardUnknown() { var xxx_messageInfo_TvlLockedDataMap proto.InternalMessageInfo type MintedDataMap struct { - AssetDenom string `protobuf:"bytes,1,opt,name=asset_denom,json=assetDenom,proto3" json:"asset_denom,omitempty" yaml:"asset_denom"` - MintedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=minted_amount,json=mintedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"minted_amount" yaml:"minted_amount"` + AssetDenom string `protobuf:"bytes,1,opt,name=asset_denom,json=assetDenom,proto3" json:"asset_denom,omitempty" yaml:"asset_denom"` + MintedAmount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=minted_amount,json=mintedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"minted_amount" yaml:"minted_amount"` } func (m *MintedDataMap) Reset() { *m = MintedDataMap{} } @@ -234,12 +234,12 @@ func (m *MintedDataMap) XXX_DiscardUnknown() { var xxx_messageInfo_MintedDataMap proto.InternalMessageInfo type StableMintVault struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` - AmountIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount_in,json=amountIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in" yaml:"amount_in"` - AmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount_out,json=amountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out" yaml:"amount_out"` - AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - ExtendedPairVaultID uint64 `protobuf:"varint,5,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - CreatedAt time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + AmountIn cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount_in,json=amountIn,proto3,customtype=cosmossdk.io/math.Int" json:"amount_in" yaml:"amount_in"` + AmountOut cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount_out,json=amountOut,proto3,customtype=cosmossdk.io/math.Int" json:"amount_out" yaml:"amount_out"` + AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + ExtendedPairVaultID uint64 `protobuf:"varint,5,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + CreatedAt time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` } func (m *StableMintVault) Reset() { *m = StableMintVault{} } @@ -276,11 +276,11 @@ func (m *StableMintVault) XXX_DiscardUnknown() { var xxx_messageInfo_StableMintVault proto.InternalMessageInfo type PairStatisticData struct { - AssetInDenom string `protobuf:"bytes,1,opt,name=asset_in_denom,json=assetInDenom,proto3" json:"asset_in_denom,omitempty" yaml:"asset_in_denom"` - AssetOutDenom string `protobuf:"bytes,2,opt,name=asset_out_denom,json=assetOutDenom,proto3" json:"asset_out_denom,omitempty" yaml:"asset_out_denom"` - CollateralAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=collateral_amount,json=collateralAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_amount" yaml:"collateral_amount"` - MintedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=minted_amount,json=mintedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"minted_amount" yaml:"minted_amount"` - ExtendedPairVaultID uint64 `protobuf:"varint,5,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + AssetInDenom string `protobuf:"bytes,1,opt,name=asset_in_denom,json=assetInDenom,proto3" json:"asset_in_denom,omitempty" yaml:"asset_in_denom"` + AssetOutDenom string `protobuf:"bytes,2,opt,name=asset_out_denom,json=assetOutDenom,proto3" json:"asset_out_denom,omitempty" yaml:"asset_out_denom"` + CollateralAmount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=collateral_amount,json=collateralAmount,proto3,customtype=cosmossdk.io/math.Int" json:"collateral_amount" yaml:"collateral_amount"` + MintedAmount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=minted_amount,json=mintedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"minted_amount" yaml:"minted_amount"` + ExtendedPairVaultID uint64 `protobuf:"varint,5,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` } func (m *PairStatisticData) Reset() { *m = PairStatisticData{} } @@ -317,11 +317,11 @@ func (m *PairStatisticData) XXX_DiscardUnknown() { var xxx_messageInfo_PairStatisticData proto.InternalMessageInfo type StableMintVaultRewards struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - StableExtendedPairId uint64 `protobuf:"varint,2,opt,name=stable_extended_pair_id,json=stableExtendedPairId,proto3" json:"stable_extended_pair_id,omitempty" yaml:"stable_extended_pair_id"` - User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` - BlockHeight uint64 `protobuf:"varint,4,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + StableExtendedPairId uint64 `protobuf:"varint,2,opt,name=stable_extended_pair_id,json=stableExtendedPairId,proto3" json:"stable_extended_pair_id,omitempty" yaml:"stable_extended_pair_id"` + User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` + BlockHeight uint64 `protobuf:"varint,4,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount" yaml:"amount"` } func (m *StableMintVaultRewards) Reset() { *m = StableMintVaultRewards{} } @@ -371,76 +371,76 @@ func init() { func init() { proto.RegisterFile("comdex/vault/v1beta1/vault.proto", fileDescriptor_217d238efc540f4d) } var fileDescriptor_217d238efc540f4d = []byte{ - // 1104 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x3b, 0x73, 0xdb, 0xc6, - 0x13, 0x27, 0xf8, 0x90, 0xc4, 0x93, 0xa8, 0x07, 0x48, 0x49, 0xf8, 0xd3, 0x23, 0x1e, 0xe7, 0xfe, - 0x19, 0x0f, 0x1b, 0x93, 0xa3, 0xa4, 0x48, 0xc6, 0x8d, 0x47, 0x8c, 0xe4, 0x09, 0x33, 0xd6, 0x28, - 0x86, 0x3d, 0x79, 0x35, 0x98, 0x23, 0x71, 0xa2, 0x30, 0x22, 0x70, 0x18, 0xe2, 0x20, 0xd9, 0x33, - 0x29, 0xd2, 0xa4, 0x4a, 0xe3, 0xaf, 0x90, 0x2e, 0x5f, 0x20, 0x6d, 0xd2, 0xaa, 0x74, 0x97, 0x47, - 0x81, 0x24, 0x54, 0x93, 0x26, 0x0d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e, 0x17, 0x13, 0x99, 0xd5, 0x04, 0xde, 0x49, 0x51, 0xfd, 0x2b, 0x0d, 0x6c, 0x0e, 0x46, 0x34, - 0x70, 0xbc, 0xa1, 0x75, 0x48, 0x48, 0xa6, 0x8a, 0xf2, 0x6d, 0x54, 0xb1, 0xae, 0xb2, 0x3d, 0x24, - 0x64, 0xba, 0x8e, 0xfb, 0x60, 0xa9, 0x3f, 0xa2, 0x83, 0x63, 0xeb, 0x88, 0x38, 0xc3, 0x23, 0x66, - 0x80, 0xa6, 0xd6, 0x2a, 0x74, 0x37, 0xe3, 0x08, 0x56, 0x65, 0xb4, 0x69, 0x2b, 0x32, 0x17, 0xc5, - 0xf1, 0x03, 0x71, 0xe2, 0x0d, 0x92, 0x56, 0x2e, 0x31, 0x63, 0x71, 0xd6, 0x06, 0xa5, 0xcf, 0xaa, - 0x06, 0x09, 0x80, 0xbb, 0xa3, 0x1f, 0x34, 0xf0, 0xd6, 0x01, 0x67, 0xf2, 0x8e, 0xef, 0x5f, 0x51, - 0xcf, 0x3e, 0xf6, 0x7d, 0xc7, 0x1b, 0xee, 0x62, 0x86, 0x53, 0x41, 0x68, 0xaf, 0x16, 0xc4, 0x7a, - 0x56, 0xda, 0x89, 0x7c, 0x5b, 0x60, 0x35, 0xab, 0xbf, 0x44, 0xb8, 0xe6, 0xf2, 0xb4, 0xfc, 0x7a, - 0xb6, 0xde, 0x06, 0x0b, 0x17, 0xd2, 0x2e, 0x0a, 0x69, 0x57, 0xe3, 0x08, 0xae, 0xc8, 0x5c, 0xa9, - 0x6a, 0xe7, 0x4f, 0xa4, 0x52, 0xd1, 0xf7, 0x05, 0x00, 0x5f, 0x57, 0x7c, 0x5a, 0x94, 0x36, 0x5d, - 0xd4, 0xde, 0x35, 0x45, 0xc9, 0x81, 0x74, 0x27, 0x8e, 0xe0, 0xe6, 0x75, 0x63, 0x83, 0xa7, 0xbe, - 0x5c, 0xf1, 0x36, 0x28, 0x27, 0x75, 0x05, 0x46, 0xa1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x70, 0x51, 0xc6, 0xe1, 0x28, 0x32, 0x85, 0xf1, 0xca, - 0xcb, 0x94, 0x54, 0xeb, 0xdf, 0x7b, 0x99, 0xfa, 0x04, 0xcc, 0x65, 0x56, 0xdd, 0x83, 0x99, 0xbb, - 0x5a, 0x99, 0x9e, 0x21, 0xc8, 0x54, 0xe1, 0xba, 0x8f, 0xcf, 0x7e, 0x6f, 0xe4, 0xbe, 0x9d, 0x34, - 0x72, 0x67, 0x93, 0x86, 0xf6, 0x72, 0xd2, 0xd0, 0x7e, 0x9b, 0x34, 0xb4, 0x17, 0xe7, 0x8d, 0xdc, - 0xcb, 0xf3, 0x46, 0xee, 0xa7, 0xf3, 0x46, 0xee, 0xf3, 0x4e, 0x26, 0x05, 0xff, 0xd2, 0xba, 0x47, - 0x0f, 0x0f, 0x9d, 0x81, 0x83, 0x47, 0xea, 0xdc, 0x49, 0xbe, 0xce, 0x44, 0xbe, 0xfe, 0x9c, 0x90, - 0xf6, 0x3b, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xaf, 0x01, 0x2c, 0xba, 0x0d, 0x00, 0x00, + // 1090 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0x8e, 0xf3, 0xb7, 0xcd, 0xb4, 0xd9, 0xb6, 0x4e, 0xda, 0x9a, 0xac, 0x9a, 0x89, 0x06, 0x84, + 0x72, 0x43, 0xa2, 0x2e, 0x42, 0xc0, 0x82, 0x04, 0x8d, 0xda, 0x15, 0x91, 0x28, 0x65, 0xbd, 0x2b, + 0x04, 0x7b, 0x63, 0x4d, 0xec, 0x69, 0x6a, 0x35, 0xf6, 0x58, 0xf1, 0xb8, 0xbb, 0xcb, 0x53, 0xec, + 0x3d, 0xb7, 0x5c, 0xf0, 0x16, 0xdc, 0x2d, 0x95, 0xb8, 0xd9, 0x4b, 0x04, 0x92, 0x81, 0xf4, 0x0d, + 0xfc, 0x04, 0x68, 0x7e, 0x5c, 0x27, 0xfd, 0xd9, 0xf0, 0x93, 0xe5, 0x2e, 0x73, 0xce, 0x99, 0xef, + 0x1c, 0xfb, 0x7c, 0xdf, 0x39, 0x31, 0x68, 0xd9, 0xd4, 0x73, 0xc8, 0xd3, 0xee, 0x29, 0x8e, 0x46, + 0xac, 0x7b, 0xba, 0x33, 0x20, 0x0c, 0xef, 0xc8, 0x53, 0x27, 0x18, 0x53, 0x46, 0xf5, 0xba, 0x8c, + 0xe8, 0x48, 0x9b, 0x8a, 0x68, 0xd4, 0x87, 0x74, 0x48, 0x45, 0x40, 0x97, 0xff, 0x92, 0xb1, 0x0d, + 0x38, 0xa4, 0x74, 0x38, 0x22, 0x5d, 0x71, 0x1a, 0x44, 0x47, 0x5d, 0xe6, 0x7a, 0x24, 0x64, 0xd8, + 0x0b, 0x64, 0x00, 0xfa, 0xad, 0x0c, 0x4a, 0x5f, 0x71, 0x20, 0xfd, 0x36, 0xc8, 0xbb, 0x8e, 0xa1, + 0xb5, 0xb4, 0x76, 0xd1, 0xcc, 0xbb, 0x8e, 0xbe, 0x03, 0xca, 0x38, 0x08, 0x2c, 0xd7, 0x31, 0xf2, + 0xdc, 0xd6, 0x6b, 0x4c, 0x62, 0x58, 0xda, 0x0d, 0x82, 0xbe, 0x93, 0xc4, 0xb0, 0xfa, 0x0c, 0x7b, + 0xa3, 0x7b, 0x48, 0x06, 0x20, 0xb3, 0x84, 0xb9, 0x5d, 0xf7, 0xc0, 0x26, 0x79, 0xca, 0x88, 0xef, + 0x10, 0xc7, 0x0a, 0xb0, 0x3b, 0xb6, 0x44, 0x89, 0x1c, 0xa2, 0x20, 0x20, 0x3e, 0x98, 0xc4, 0xb0, + 0xb6, 0xaf, 0x22, 0xbe, 0xc4, 0xee, 0x58, 0x64, 0xee, 0xef, 0x25, 0x31, 0xdc, 0x96, 0x80, 0xd7, + 0x5f, 0x47, 0x66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e5, 0x2f, 0x8c, 0xd4, 0xe2, 0xdf, 0xfb, + 0x0b, 0x73, 0x1f, 0x94, 0x67, 0x56, 0x4e, 0x67, 0x5e, 0x13, 0xab, 0xd3, 0x03, 0x01, 0x99, 0xea, + 0x76, 0xef, 0xc1, 0xd9, 0x9f, 0xcd, 0xdc, 0x0f, 0x93, 0x66, 0xee, 0x6c, 0xd2, 0xd4, 0x5e, 0x4e, + 0x9a, 0xda, 0x1f, 0x93, 0xa6, 0xf6, 0xfc, 0xbc, 0x99, 0x7b, 0x79, 0xde, 0xcc, 0xfd, 0x72, 0xde, + 0xcc, 0x3d, 0xee, 0x0e, 0x5d, 0x76, 0x1c, 0x0d, 0x3a, 0x36, 0xf5, 0xba, 0xf2, 0x43, 0xe4, 0x1d, + 0x7a, 0x74, 0xe4, 0xda, 0x2e, 0x1e, 0xa9, 0x73, 0x37, 0xfd, 0x78, 0x61, 0xcf, 0x02, 0x12, 0x0e, + 0xca, 0x42, 0xa7, 0xef, 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x9a, 0x19, 0xe5, 0xd9, 0x0c, + 0x00, 0x00, } func (m *Vault) Marshal() (dAtA []byte, err error) { diff --git a/x/vault/types/vault_test.go b/x/vault/types/vault_test.go index 5e7f1f987..710b53952 100644 --- a/x/vault/types/vault_test.go +++ b/x/vault/types/vault_test.go @@ -3,10 +3,11 @@ package types_test import ( "testing" + sdkmath "cosmossdk.io/math" + "github.com/stretchr/testify/require" "github.com/comdex-official/comdex/x/vault/types" - sdk "github.com/cosmos/cosmos-sdk/types" ) func TestValidateVault(t *testing.T) { @@ -20,8 +21,8 @@ func TestValidateVault(t *testing.T) { vault: types.Vault{ ExtendedPairVaultID: 0, Owner: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - AmountIn: sdk.NewInt(10000), - AmountOut: sdk.NewInt(5000), + AmountIn: sdkmath.NewInt(10000), + AmountOut: sdkmath.NewInt(5000), }, expErr: true, }, @@ -30,8 +31,8 @@ func TestValidateVault(t *testing.T) { vault: types.Vault{ ExtendedPairVaultID: 1, Owner: "", - AmountIn: sdk.NewInt(10000), - AmountOut: sdk.NewInt(5000), + AmountIn: sdkmath.NewInt(10000), + AmountOut: sdkmath.NewInt(5000), }, expErr: true, }, @@ -40,8 +41,8 @@ func TestValidateVault(t *testing.T) { vault: types.Vault{ ExtendedPairVaultID: 1, Owner: "cosmos....", - AmountIn: sdk.NewInt(10000), - AmountOut: sdk.NewInt(5000), + AmountIn: sdkmath.NewInt(10000), + AmountOut: sdkmath.NewInt(5000), }, expErr: true, }, @@ -50,8 +51,8 @@ func TestValidateVault(t *testing.T) { vault: types.Vault{ ExtendedPairVaultID: 1, Owner: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - AmountIn: sdk.Int{}, - AmountOut: sdk.NewInt(5000), + AmountIn: sdkmath.Int{}, + AmountOut: sdkmath.NewInt(5000), }, expErr: true, }, @@ -60,8 +61,8 @@ func TestValidateVault(t *testing.T) { vault: types.Vault{ ExtendedPairVaultID: 1, Owner: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - AmountIn: sdk.NewInt(-123), - AmountOut: sdk.NewInt(5000), + AmountIn: sdkmath.NewInt(-123), + AmountOut: sdkmath.NewInt(5000), }, expErr: true, }, @@ -70,8 +71,8 @@ func TestValidateVault(t *testing.T) { vault: types.Vault{ ExtendedPairVaultID: 1, Owner: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - AmountIn: sdk.NewInt(10000), - AmountOut: sdk.Int{}, + AmountIn: sdkmath.NewInt(10000), + AmountOut: sdkmath.Int{}, }, expErr: true, }, @@ -80,8 +81,8 @@ func TestValidateVault(t *testing.T) { vault: types.Vault{ ExtendedPairVaultID: 1, Owner: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - AmountIn: sdk.NewInt(10000), - AmountOut: sdk.NewInt(-5000), + AmountIn: sdkmath.NewInt(10000), + AmountOut: sdkmath.NewInt(-5000), }, expErr: true, }, @@ -90,8 +91,8 @@ func TestValidateVault(t *testing.T) { vault: types.Vault{ ExtendedPairVaultID: 1, Owner: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", - AmountIn: sdk.NewInt(10000), - AmountOut: sdk.NewInt(5000), + AmountIn: sdkmath.NewInt(10000), + AmountOut: sdkmath.NewInt(5000), }, expErr: false, },