diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 6f81bc251..000000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf2b2b938..616ea48da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v4.0.1 with: - go-version: 1.20.5 + go-version: 1.21.7 id: go - name: Check out code into the Go module directory˛˜ diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 8c34a32fb..8841f73c2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-go@v4.0.1 with: - go-version: 1.20.5 + go-version: 1.21.7 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index c687d75be..cd79a487b 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/setup-go@v4.0.1 with: - go-version: 1.20.5 # we run the linter with go 1.20 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18) + go-version: 1.21.7 # we run the linter with go 1.21 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18) - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b90949eec..c05de64fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v4.0.1 with: - go-version: 1.20.5 + go-version: 1.21.7 id: go - name: Check out code into the Go module directory diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8918b1055..d77978ca6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: name: Setup Golang uses: actions/setup-go@v4.0.1 with: - go-version: 1.20.5 + go-version: 1.21.7 - name: Display go version run: go version diff --git a/Makefile b/Makefile index 0b5f24011..f5d4ddd24 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ GOBIN = $(shell go env GOPATH)/bin GOARCH = $(shell go env GOARCH) GOOS = $(shell go env GOOS) GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) +GO_MINIMUM_MINOR_VERSION = $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f2 | cut -d'.' -f2) export GO111MODULE = on @@ -94,8 +95,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_MINIMUM_MINOR_VERSION),21) + @echo "ERROR: Please upgrade Go version to 1.21+" exit 1 endif diff --git a/README.md b/README.md index 5c90babe8..0e31d6fd0 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ If you have technical questions or concerns, ask a developer or community member ### Installation -Requires [Go 1.20+](https://golang.org/dl/) +Requires [Go 1.21+](https://golang.org/dl/) ### Linux diff --git a/app/ante.go b/app/ante.go index b7fa16018..1586b3b86 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,39 +1,47 @@ package app import ( - "github.com/CosmWasm/wasmd/x/wasm" + errorsmod "cosmossdk.io/errors" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/comdex-official/comdex/app/decorators" "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" 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" + auctionanteskip "github.com/skip-mev/block-sdk/x/auction/ante" + auctionkeeperskip "github.com/skip-mev/block-sdk/x/auction/keeper" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC // channel keeper. type HandlerOptions struct { ante.HandlerOptions - wasmConfig wasm.Config + wasmConfig wasmtypes.WasmConfig txCounterStoreKey storetypes.StoreKey IBCChannelKeeper *ibckeeper.Keeper GovKeeper govkeeper.Keeper Cdc codec.BinaryCodec + + MEVLane auctionanteskip.MEVLane + TxDecoder sdk.TxDecoder + TxEncoder sdk.TxEncoder + auctionkeeperskip auctionkeeperskip.Keeper } 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 @@ -59,6 +67,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), ante.NewIncrementSequenceDecorator(options.AccountKeeper), ibcante.NewRedundantRelayDecorator(options.IBCChannelKeeper), + auctionanteskip.NewAuctionDecorator(options.auctionkeeperskip, options.TxEncoder, options.MEVLane), } return sdk.ChainAnteDecorators(anteDecorators...), nil diff --git a/app/app.go b/app/app.go index 3b7eae529..530ad9854 100644 --- a/app/app.go +++ b/app/app.go @@ -6,8 +6,8 @@ import ( "net/http" "os" "path/filepath" + "reflect" "sort" - "strings" paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" @@ -81,7 +81,6 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" @@ -138,6 +137,7 @@ import ( "github.com/comdex-official/comdex/x/collector" collectorkeeper "github.com/comdex-official/comdex/x/collector/keeper" collectortypes "github.com/comdex-official/comdex/x/collector/types" + "github.com/comdex-official/comdex/x/esm" esmkeeper "github.com/comdex-official/comdex/x/esm/keeper" esmtypes "github.com/comdex-official/comdex/x/esm/types" @@ -196,10 +196,18 @@ import ( icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v7/keeper" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" + "github.com/skip-mev/block-sdk/abci" + "github.com/skip-mev/block-sdk/abci/checktx" + "github.com/skip-mev/block-sdk/block" + "github.com/skip-mev/block-sdk/block/base" + auctionmoduleskip "github.com/skip-mev/block-sdk/x/auction" + auctionkeeperskip "github.com/skip-mev/block-sdk/x/auction/keeper" + auctionmoduleskiptypes "github.com/skip-mev/block-sdk/x/auction/types" + cwasm "github.com/comdex-official/comdex/app/wasm" mv13 "github.com/comdex-official/comdex/app/upgrades/mainnet/v13" - tv13 "github.com/comdex-official/comdex/app/upgrades/testnet/v13" + tv14 "github.com/comdex-official/comdex/app/upgrades/testnet/v14" ) const ( @@ -207,23 +215,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, @@ -263,7 +254,7 @@ var ( // 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 + EmptyWasmOpts []wasmkeeper.Option // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. @@ -309,6 +300,7 @@ var ( icq.AppModuleBasic{}, ibchooks.AppModuleBasic{}, packetforward.AppModuleBasic{}, + auctionmoduleskip.AppModuleBasic{}, ) ) @@ -329,8 +321,9 @@ func init() { type App struct { *baseapp.BaseApp - amino *codec.LegacyAmino - cdc codec.Codec + amino *codec.LegacyAmino + cdc codec.Codec + txConfig client.TxConfig interfaceRegistry codectypes.InterfaceRegistry @@ -388,6 +381,8 @@ type App struct { Rewardskeeper rewardskeeper.Keeper NewliqKeeper liquidationsV2keeper.Keeper NewaucKeeper auctionsV2keeper.Keeper + // auctionKeeper is the keeper that handles processing auction transactions + AuctionKeeperSkip auctionkeeperskip.Keeper // IBC modules // transfer module @@ -398,8 +393,10 @@ type App struct { ConsensusParamsKeeper consensusparamkeeper.Keeper - WasmKeeper wasm.Keeper + WasmKeeper wasmkeeper.Keeper ContractKeeper *wasmkeeper.PermissionedKeeper + // Custom checkTx handler + checkTxHandler checktx.CheckTx // the module manager mm *module.Manager // Module configurator @@ -417,8 +414,7 @@ func New( invCheckPeriod uint, encoding EncodingConfig, appOptions servertypes.AppOptions, - wasmEnabledProposals []wasm.ProposalType, - wasmOpts []wasm.Option, + wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *App { appCodec := encoding.Marshaler @@ -432,9 +428,10 @@ func New( evidencetypes.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey, capabilitytypes.StoreKey, vaulttypes.StoreKey, assettypes.StoreKey, collectortypes.StoreKey, liquidationtypes.StoreKey, markettypes.StoreKey, bandoraclemoduletypes.StoreKey, lockertypes.StoreKey, - wasm.StoreKey, authzkeeper.StoreKey, auctiontypes.StoreKey, tokenminttypes.StoreKey, + wasmtypes.StoreKey, authzkeeper.StoreKey, auctiontypes.StoreKey, tokenminttypes.StoreKey, rewardstypes.StoreKey, feegrant.StoreKey, liquiditytypes.StoreKey, esmtypes.ModuleName, lendtypes.StoreKey, - liquidationsV2types.StoreKey, auctionsV2types.StoreKey, ibchookstypes.StoreKey, packetforwardtypes.StoreKey, icqtypes.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, + liquidationsV2types.StoreKey, auctionsV2types.StoreKey, + ibchookstypes.StoreKey, packetforwardtypes.StoreKey, icqtypes.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, auctionmoduleskiptypes.StoreKey, ) ) @@ -442,11 +439,13 @@ func New( baseApp.SetCommitMultiStoreTracer(traceStore) baseApp.SetVersion(version.Version) baseApp.SetInterfaceRegistry(encoding.InterfaceRegistry) + baseApp.SetTxEncoder(encoding.TxConfig.TxEncoder()) app := &App{ BaseApp: baseApp, amino: encoding.Amino, cdc: encoding.Marshaler, + txConfig: encoding.TxConfig, interfaceRegistry: encoding.InterfaceRegistry, invCheckPeriod: invCheckPeriod, keys: keys, @@ -462,14 +461,14 @@ func New( ) //nolint:godox //TODO: refactor this code - app.ParamsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable()) - app.ParamsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) - app.ParamsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable()) - app.ParamsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) - app.ParamsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) - app.ParamsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) - app.ParamsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypesv1.ParamKeyTable()) - app.ParamsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) + app.ParamsKeeper.Subspace(authtypes.ModuleName) + app.ParamsKeeper.Subspace(banktypes.ModuleName) + app.ParamsKeeper.Subspace(stakingtypes.ModuleName) + app.ParamsKeeper.Subspace(minttypes.ModuleName) + app.ParamsKeeper.Subspace(distrtypes.ModuleName) + app.ParamsKeeper.Subspace(slashingtypes.ModuleName) + app.ParamsKeeper.Subspace(govtypes.ModuleName) + app.ParamsKeeper.Subspace(crisistypes.ModuleName) app.ParamsKeeper.Subspace(ibctransfertypes.ModuleName) app.ParamsKeeper.Subspace(ibchost.ModuleName) app.ParamsKeeper.Subspace(icahosttypes.SubModuleName) @@ -482,7 +481,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) @@ -492,13 +491,8 @@ func New( app.ParamsKeeper.Subspace(icqtypes.ModuleName) app.ParamsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable()) - // set the BaseApp's parameter store - // baseApp.SetParamStore( - // app.ParamsKeeper. - // Subspace(baseapp.Paramspace). - // WithKeyTable(paramskeeper.ConsensusParamsKeyTable()), - // ) - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) + govModAddress := authtypes.NewModuleAddress(govtypes.ModuleName).String() + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], govModAddress) baseApp.SetParamStore(&app.ConsensusParamsKeeper) // add capability keeper and ScopeToModule for ibc module @@ -513,7 +507,7 @@ func New( scopedIBCKeeper = app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) scopedTransferKeeper = app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) scopedIBCOracleKeeper = app.CapabilityKeeper.ScopeToModule(markettypes.ModuleName) // can remove it - scopedWasmKeeper = app.CapabilityKeeper.ScopeToModule(wasm.ModuleName) + scopedWasmKeeper = app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName) scopedICAHostKeeper = app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) scopedBandoracleKeeper = app.CapabilityKeeper.ScopeToModule(bandoraclemoduletypes.ModuleName) scopedICQKeeper = app.CapabilityKeeper.ScopeToModule(icqtypes.ModuleName) @@ -526,21 +520,21 @@ func New( authtypes.ProtoBaseAccount, app.ModuleAccountsPermissions(), AccountAddressPrefix, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.BankKeeper = bankkeeper.NewBaseKeeper( app.cdc, app.keys[banktypes.StoreKey], app.AccountKeeper, nil, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) stakingKeeper := stakingkeeper.NewKeeper( app.cdc, app.keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.MintKeeper = mintkeeper.NewKeeper( app.cdc, @@ -549,7 +543,7 @@ func New( app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.DistrKeeper = distrkeeper.NewKeeper( app.cdc, @@ -558,14 +552,14 @@ func New( app.BankKeeper, stakingKeeper, authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.SlashingKeeper = slashingkeeper.NewKeeper( app.cdc, encoding.Amino, app.keys[slashingtypes.StoreKey], stakingKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.CrisisKeeper = crisiskeeper.NewKeeper( app.cdc, @@ -573,7 +567,7 @@ func New( invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) app.AuthzKeeper = authzkeeper.NewKeeper( @@ -589,7 +583,7 @@ func New( app.cdc, homePath, app.BaseApp, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, ) // register the staking hooks // NOTE: StakingKeeper above is passed by reference, so that it will contain these hooks @@ -645,12 +639,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( @@ -687,6 +681,7 @@ func New( &app.Rewardskeeper, &app.VaultKeeper, &app.BandoracleKeeper, + govModAddress, ) app.LendKeeper = lendkeeper.NewKeeper( @@ -714,6 +709,7 @@ func New( &app.MarketKeeper, &app.TokenmintKeeper, &app.CollectorKeeper, + govModAddress, ) app.VaultKeeper = vaultkeeper.NewKeeper( @@ -806,6 +802,7 @@ func New( &app.AuctionKeeper, &app.LockerKeeper, &app.Rewardskeeper, + &app.EsmKeeper, app.GetSubspace(collectortypes.ModuleName), app.BankKeeper, ) @@ -864,6 +861,7 @@ func New( &app.LendKeeper, &app.NewaucKeeper, &app.CollectorKeeper, + govModAddress, ) app.NewaucKeeper = auctionsV2keeper.NewKeeper( @@ -881,6 +879,16 @@ func New( &app.TokenmintKeeper, ) + app.AuctionKeeperSkip = auctionkeeperskip.NewKeeper( + appCodec, + keys[auctionmoduleskiptypes.StoreKey], + app.AccountKeeper, + app.BankKeeper, + app.DistrKeeper, + app.StakingKeeper, + govModAddress, + ) + // ICQ Keeper icqKeeper := icqkeeper.NewKeeper( appCodec, @@ -905,7 +913,7 @@ func New( if err != nil { panic(fmt.Sprintf("error while reading wasm config: %s", err)) } - supportedFeatures := "iterator,staking,stargate,comdex,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3" + supportedFeatures := "iterator,staking,stargate,comdex,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_1_5" wasmOpts = append(cwasm.RegisterCustomPlugins(&app.LockerKeeper, &app.TokenmintKeeper, &app.AssetKeeper, &app.Rewardskeeper, &app.CollectorKeeper, &app.LiquidationKeeper, &app.AuctionKeeper, &app.EsmKeeper, &app.VaultKeeper, &app.LendKeeper, &app.LiquidityKeeper, &app.MarketKeeper), wasmOpts...) @@ -926,7 +934,7 @@ func New( wasmDir, wasmConfig, supportedFeatures, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModAddress, wasmOpts..., ) @@ -948,13 +956,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(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.StakingKeeper, app.MsgServiceRouter(), govtypes.DefaultConfig(), govModAddress, ) govKeeper.SetLegacyRouter(govRouter) @@ -993,7 +997,7 @@ func New( ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferStack) ibcRouter.AddRoute(bandoraclemoduletypes.ModuleName, bandOracleIBCModule) - ibcRouter.AddRoute(wasm.ModuleName, wasmStack) + ibcRouter.AddRoute(wasmtypes.ModuleName, wasmStack) ibcRouter.AddRoute(icahosttypes.SubModuleName, icaHostStack) ibcRouter.AddRoute(icqtypes.ModuleName, icqModule) app.IbcKeeper.SetRouter(ibcRouter) @@ -1034,6 +1038,7 @@ func New( ibcfee.NewAppModule(app.IBCFeeKeeper), ica.NewAppModule(nil, &app.ICAHostKeeper), params.NewAppModule(app.ParamsKeeper), + consensus.NewAppModule(app.cdc, app.ConsensusParamsKeeper), // app.RawIcs20TransferAppModule, ibctransfer.NewAppModule(app.IbcTransferKeeper), asset.NewAppModule(app.cdc, app.AssetKeeper), @@ -1054,7 +1059,8 @@ func New( auctionsV2.NewAppModule(app.cdc, app.NewaucKeeper, app.BankKeeper), ibchooks.NewAppModule(app.AccountKeeper), icq.NewAppModule(*app.ICQKeeper), - packetforward.NewAppModule(app.PacketForwardKeeper), + packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)), + auctionmoduleskip.NewAppModule(app.cdc, app.AuctionKeeperSkip), ) // During begin block slashing happens after distr.BeginBlocker so that @@ -1102,6 +1108,7 @@ func New( packetforwardtypes.ModuleName, ibcfeetypes.ModuleName, consensusparamtypes.ModuleName, + auctionmoduleskiptypes.ModuleName, ) app.mm.SetOrderEndBlockers( @@ -1145,6 +1152,7 @@ func New( packetforwardtypes.ModuleName, ibcfeetypes.ModuleName, consensusparamtypes.ModuleName, + auctionmoduleskiptypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -1192,6 +1200,7 @@ func New( packetforwardtypes.ModuleName, ibcfeetypes.ModuleName, consensusparamtypes.ModuleName, + auctionmoduleskiptypes.ModuleName, ) app.mm.RegisterInvariants(app.CrisisKeeper) @@ -1211,9 +1220,26 @@ func New( } reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) - // initialize BaseApp - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) + // STEP 1-3: Create the Block SDK lanes. + mevLane, defaultLane := CreateLanes(app) + + // STEP 4: Construct a mempool based off the lanes. Note that the order of the lanes + // matters. Blocks are constructed from the top lane to the bottom lane. The top lane + // is the first lane in the array and the bottom lane is the last lane in the array. + mempool, err := block.NewLanedMempool( + app.Logger(), + []block.Lane{mevLane, defaultLane}, + ) + if err != nil { + panic(err) + } + + // The application's mempool is now powered by the Block SDK! + app.BaseApp.SetMempool(mempool) + + // STEP 5: Create a global ante handler that will be called on each transaction when + // proposals are being built and verified. Note that this step must be done before + // setting the ante handler on the lanes. anteHandler, err := NewAnteHandler( HandlerOptions{ HandlerOptions: ante.HandlerOptions{ @@ -1225,9 +1251,13 @@ func New( }, GovKeeper: app.GovKeeper, wasmConfig: wasmConfig, - txCounterStoreKey: app.GetKey(wasm.StoreKey), + txCounterStoreKey: app.GetKey(wasmtypes.StoreKey), IBCChannelKeeper: app.IbcKeeper, Cdc: appCodec, + MEVLane: mevLane, + TxDecoder: encoding.TxConfig.TxDecoder(), + TxEncoder: encoding.TxConfig.TxEncoder(), + auctionkeeperskip: app.AuctionKeeperSkip, }, ) if err != nil { @@ -1235,6 +1265,52 @@ func New( } app.SetAnteHandler(anteHandler) + + // Set the ante handler on the lanes. + opt := []base.LaneOption{ + base.WithAnteHandler(anteHandler), + } + mevLane.WithOptions( + opt..., + ) + defaultLane.WithOptions( + opt..., + ) + + // Step 6: Create the proposal handler and set it on the app. Now the application + // will build and verify proposals using the Block SDK! + proposalHandler := abci.NewProposalHandler( + app.Logger(), + encoding.TxConfig.TxDecoder(), + encoding.TxConfig.TxEncoder(), + mempool, + ) + app.BaseApp.SetPrepareProposal(proposalHandler.PrepareProposalHandler()) + app.BaseApp.SetProcessProposal(proposalHandler.ProcessProposalHandler()) + + // Step 7: Set the custom CheckTx handler on BaseApp. This is only required if you + // use the MEV lane. + mevCheckTxHandler := checktx.NewMEVCheckTxHandler( + app.BaseApp, + encoding.TxConfig.TxDecoder(), + mevLane, + anteHandler, + app.BaseApp.CheckTx, + app.ChainID(), + ) + + parityCheckTxHandler := checktx.NewMempoolParityCheckTx( + app.BaseApp.Logger(), + mempool, + encoding.TxConfig.TxDecoder(), + mevCheckTxHandler.CheckTx(), + ) + + app.SetCheckTx(parityCheckTxHandler.CheckTx()) + + // initialize BaseApp + app.SetInitChainer(app.InitChainer) + app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) if manager := app.SnapshotManager(); manager != nil { @@ -1368,6 +1444,17 @@ func (a *App) GetSubspace(moduleName string) paramstypes.Subspace { return subspace } +// ChainID gets chainID from private fields of BaseApp +func (a *App) ChainID() string { + field := reflect.ValueOf(a.BaseApp).Elem().FieldByName("chainID") + return field.String() +} + +// SetCheckTx sets the checkTxHandler for the app. +func (a *App) SetCheckTx(handler checktx.CheckTx) { + a.checkTxHandler = handler +} + // RegisterAPIRoutes registers all application module routes with the provided // API server. func (a *App) RegisterAPIRoutes(server *api.Server, apiConfig serverconfig.APIConfig) { @@ -1416,48 +1503,49 @@ func (a *App) RegisterNodeService(clientCtx client.Context) { func (a *App) ModuleAccountsPermissions() map[string][]string { return map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - collectortypes.ModuleName: {authtypes.Burner, authtypes.Staking}, - vaulttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - tokenminttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc1: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc2: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc3: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc4: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc5: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc6: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc7: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc8: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc9: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc10: {authtypes.Minter, authtypes.Burner}, - lendtypes.ModuleAcc11: {authtypes.Minter, authtypes.Burner}, - liquidationtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - auctiontypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - lockertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - esmtypes.ModuleName: {authtypes.Burner}, - wasm.ModuleName: {authtypes.Burner}, - liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - liquidationsV2types.ModuleName: {authtypes.Minter, authtypes.Burner}, - auctionsV2types.ModuleName: {authtypes.Minter, authtypes.Burner}, - icatypes.ModuleName: nil, - ibcfeetypes.ModuleName: nil, - assettypes.ModuleName: nil, - icqtypes.ModuleName: nil, + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + collectortypes.ModuleName: {authtypes.Burner, authtypes.Staking}, + vaulttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + tokenminttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc1: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc2: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc3: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc4: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc5: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc6: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc7: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc8: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc9: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc10: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc11: {authtypes.Minter, authtypes.Burner}, + liquidationtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + auctiontypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + lockertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + esmtypes.ModuleName: {authtypes.Burner}, + wasmtypes.ModuleName: {authtypes.Burner}, + liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + liquidationsV2types.ModuleName: {authtypes.Minter, authtypes.Burner}, + auctionsV2types.ModuleName: {authtypes.Minter, authtypes.Burner}, + icatypes.ModuleName: nil, + ibcfeetypes.ModuleName: nil, + assettypes.ModuleName: nil, + icqtypes.ModuleName: nil, + auctionmoduleskiptypes.ModuleName: nil, } } func (a *App) registerUpgradeHandlers() { a.UpgradeKeeper.SetUpgradeHandler( - mv13.UpgradeName, - mv13.CreateUpgradeHandlerV13(a.mm, a.configurator, a.cdc, a.ParamsKeeper, a.ConsensusParamsKeeper, *a.IbcKeeper, a.ICQKeeper, a.GovKeeper, a.AssetKeeper, a.LendKeeper, a.NewliqKeeper, a.NewaucKeeper), + tv14.UpgradeName, + tv14.CreateUpgradeHandlerV14(a.mm, a.configurator, a.AuctionKeeperSkip, a.LendKeeper, a.WasmKeeper, *a.StakingKeeper, a.MintKeeper, a.SlashingKeeper, a.BandoracleKeeper), ) // When a planned update height is reached, the old binary will panic // writing on disk the height and name of the update that triggered it @@ -1491,12 +1579,10 @@ func upgradeHandlers(upgradeInfo upgradetypes.Plan, a *App, storeUpgrades *store ibcfeetypes.StoreKey, }, } - case upgradeInfo.Name == tv13.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height): + case upgradeInfo.Name == tv14.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height): storeUpgrades = &storetypes.StoreUpgrades{ Added: []string{ - crisistypes.StoreKey, - consensusparamtypes.StoreKey, - ibcfeetypes.StoreKey, + auctionmoduleskiptypes.StoreKey, }, } } diff --git a/app/decorators/gov_filter.go b/app/decorators/gov_filter.go index 0dc94c5de..c5a760a31 100644 --- a/app/decorators/gov_filter.go +++ b/app/decorators/gov_filter.go @@ -4,6 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/x/authz" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -45,7 +46,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 +60,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/lanes.go b/app/lanes.go new file mode 100644 index 000000000..720068009 --- /dev/null +++ b/app/lanes.go @@ -0,0 +1,86 @@ +package app + +import ( + "cosmossdk.io/math" + + signerextraction "github.com/skip-mev/block-sdk/adapters/signer_extraction_adapter" + "github.com/skip-mev/block-sdk/block/base" + defaultlane "github.com/skip-mev/block-sdk/lanes/base" + mevlane "github.com/skip-mev/block-sdk/lanes/mev" +) + +const ( + maxTxPerTopOfBlockAuctionLane = 500 // this is the maximum # of bids that will be held in the app-side in-memory mempool + maxTxPerDefaultLane = 3000 // all other txs +) + +var ( + defaultLaneBlockspacePercentage = math.LegacyMustNewDecFromStr("0.90") + topOfBlockAuctionLaneBlockspacePercentage = math.LegacyMustNewDecFromStr("0.10") +) + +// CreateLanes walks through the process of creating the lanes for the block sdk. In this function +// we create three separate lanes - MEV, Free, and Default - and then return them. +// +// NOTE: Application Developers should closely replicate this function in their own application. +func CreateLanes(app *App) (*mevlane.MEVLane, *base.BaseLane) { + // 1. Create the signer extractor. This is used to extract the expected signers from + // a transaction. Each lane can have a different signer extractor if needed. + signerAdapter := signerextraction.NewDefaultAdapter() + encodingConfig := NewEncodingConfig() + + // 2. Create the configurations for each lane. These configurations determine how many + // transactions the lane can store, the maximum block space the lane can consume, and + // the signer extractor used to extract the expected signers from a transaction. + // + // IMPORTANT NOTE: If the block sdk module is utilized to store lanes, than the maximum + // block space will be replaced with what is in state / in the genesis file. + + // Create a mev configuration that accepts 1000 transactions and consumes 20% of the + // block space. + mevConfig := base.LaneConfig{ + Logger: app.Logger(), + TxEncoder: encodingConfig.TxConfig.TxEncoder(), + TxDecoder: encodingConfig.TxConfig.TxDecoder(), + MaxBlockSpace: topOfBlockAuctionLaneBlockspacePercentage, + SignerExtractor: signerAdapter, + MaxTxs: maxTxPerTopOfBlockAuctionLane, + } + + // Create a default configuration that accepts 1000 transactions and consumes 60% of the + // block space. + defaultConfig := base.LaneConfig{ + Logger: app.Logger(), + TxEncoder: encodingConfig.TxConfig.TxEncoder(), + TxDecoder: encodingConfig.TxConfig.TxDecoder(), + MaxBlockSpace: defaultLaneBlockspacePercentage, + SignerExtractor: signerAdapter, + MaxTxs: maxTxPerDefaultLane, + } + + // 3. Create the match handlers for each lane. These match handlers determine whether or not + // a transaction belongs in the lane. + + // Create the final match handler for the mev lane. + factory := mevlane.NewDefaultAuctionFactory(encodingConfig.TxConfig.TxDecoder(), signerAdapter) + mevMatchHandler := factory.MatchHandler() + + // Create the final match handler for the free lane. + + // Create the final match handler for the default lane. + defaultMatchHandler := base.DefaultMatchHandler() + + // 4. Create the lanes. + mevLane := mevlane.NewMEVLane( + mevConfig, + factory, + mevMatchHandler, + ) + + defaultLane := defaultlane.NewDefaultLane( + defaultConfig, + defaultMatchHandler, + ) + + return mevLane, defaultLane +} diff --git a/app/test_helpers.go b/app/test_helpers.go index 9e4f2cf00..0a3f5e333 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -14,14 +14,13 @@ import ( "github.com/cosmos/cosmos-sdk/std" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" "testing" "time" - // simappparams "cosmossdk.io/simapp/params" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) // DefaultConsensusParams defines the default Tendermint consensus params used in @@ -52,10 +51,10 @@ func MakeTestEncodingConfig() moduletestutil.TestEncodingConfig { return encodingConfig } -func setup(t *testing.T, withGenesis bool) (*App, GenesisState) { +func setup(_ *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()) } diff --git a/app/test_suite.go b/app/test_suite.go index bf171433e..90884a160 100644 --- a/app/test_suite.go +++ b/app/test_suite.go @@ -312,3 +312,18 @@ func GenerateTestAddrs() (string, string) { invalidAddr := sdk.AccAddress("invalid").String() return validAddr, invalidAddr } + +// AssertEventEmitted asserts that ctx's event manager has emitted the given number of events +// of the given type. +func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int) { + allEvents := ctx.EventManager().Events() + + // filter out other events + actualEvents := make([]sdk.Event, 0) + for _, event := range allEvents { + if event.Type == eventTypeExpected { + actualEvents = append(actualEvents, event) + } + } + s.Equal(numEventsExpected, len(actualEvents)) +} diff --git a/app/upgrades/mainnet/v13/upgrade_test.go b/app/upgrades/mainnet/v13/upgrade_test.go index 41fe9e288..db682518c 100644 --- a/app/upgrades/mainnet/v13/upgrade_test.go +++ b/app/upgrades/mainnet/v13/upgrade_test.go @@ -1,45 +1,45 @@ package v13_test -import ( - "testing" +// import ( +// "testing" - "github.com/stretchr/testify/suite" +// "github.com/stretchr/testify/suite" - "github.com/comdex-official/comdex/app" - v13 "github.com/comdex-official/comdex/app/upgrades/mainnet/v13" -) +// "github.com/comdex-official/comdex/app" +// v13 "github.com/comdex-official/comdex/app/upgrades/mainnet/v13" +// ) -type UpgradeTestSuite struct { - app.KeeperTestHelper -} +// type UpgradeTestSuite struct { +// app.KeeperTestHelper +// } -func (s *UpgradeTestSuite) SetupTest() { - s.Setup() -} +// func (s *UpgradeTestSuite) SetupTest() { +// s.Setup() +// } -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(UpgradeTestSuite)) -} +// func TestKeeperTestSuite(t *testing.T) { +// suite.Run(t, new(UpgradeTestSuite)) +// } -// Ensures the test does not error out. -func (s *UpgradeTestSuite) TestUpgrade() { - s.Setup() +// // Ensures the test does not error out. +// func (s *UpgradeTestSuite) TestUpgrade() { +// s.Setup() - preUpgradeChecks(s) +// preUpgradeChecks(s) - upgradeHeight := int64(5) - s.ConfirmUpgradeSucceeded(v13.UpgradeName, upgradeHeight) +// upgradeHeight := int64(5) +// s.ConfirmUpgradeSucceeded(v13.UpgradeName, upgradeHeight) - postUpgradeChecks(s) -} +// postUpgradeChecks(s) +// } -func preUpgradeChecks(s *UpgradeTestSuite) { +// func preUpgradeChecks(s *UpgradeTestSuite) { -} +// } -func postUpgradeChecks(s *UpgradeTestSuite) { +// func postUpgradeChecks(s *UpgradeTestSuite) { - // Ensure the gov params have MinInitialDepositRatio added - gp := s.App.GovKeeper.GetParams(s.Ctx) - s.Require().Equal(gp.MinInitialDepositRatio, "0.200000000000000000") -} +// // Ensure the gov params have MinInitialDepositRatio added +// gp := s.App.GovKeeper.GetParams(s.Ctx) +// s.Require().Equal(gp.MinInitialDepositRatio, "0.200000000000000000") +// } diff --git a/app/upgrades/testnet/v14/constants.go b/app/upgrades/testnet/v14/constants.go new file mode 100644 index 000000000..213d13d12 --- /dev/null +++ b/app/upgrades/testnet/v14/constants.go @@ -0,0 +1,15 @@ +package v14 + +const ( + UpgradeName = "v14.0.0" + UpgradeHeight = "" + UpgradeInfo = `'{ + "binaries": { + "darwin/arm64":"", + "darwin/x86_64":"", + "linux/arm64":"", + "linux/x86_64":"", + "windows/x86_64":"" + } + }'` +) diff --git a/app/upgrades/testnet/v14/upgrade_test.go b/app/upgrades/testnet/v14/upgrade_test.go new file mode 100644 index 000000000..9d5d7e0de --- /dev/null +++ b/app/upgrades/testnet/v14/upgrade_test.go @@ -0,0 +1,59 @@ +package v14_test + +import ( + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/comdex-official/comdex/app" + v14 "github.com/comdex-official/comdex/app/upgrades/testnet/v14" + "github.com/stretchr/testify/suite" + "testing" +) + +type UpgradeTestSuite struct { + app.KeeperTestHelper +} + +func (s *UpgradeTestSuite) SetupTest() { + s.Setup() +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(UpgradeTestSuite)) +} + +// Ensures the test does not error out. +func (s *UpgradeTestSuite) TestUpgrade() { + s.Setup() + + preUpgradeChecks(s) + + upgradeHeight := int64(5) + s.ConfirmUpgradeSucceeded(v14.UpgradeName, upgradeHeight) + + postUpgradeChecks(s) +} + +func preUpgradeChecks(s *UpgradeTestSuite) { + + mp := s.App.MintKeeper.GetParams(s.Ctx) + s.Require().Equal(mp.BlocksPerYear, uint64(6311520)) + + sp := s.App.SlashingKeeper.GetParams(s.Ctx) + s.Require().Equal(sp.SignedBlocksWindow, int64(100)) + +} + +func postUpgradeChecks(s *UpgradeTestSuite) { + + // Ensure the mint params have halved + mp := s.App.MintKeeper.GetParams(s.Ctx) + s.Require().Equal(mp.BlocksPerYear, uint64(6311520/2)) + + // Ensure the slashing params have halved + sp := s.App.SlashingKeeper.GetParams(s.Ctx) + s.Require().Equal(sp.SignedBlocksWindow, int64(100/2)) + + // Ensure the wasm Permission nobody + wp := s.App.WasmKeeper.GetParams(s.Ctx) + s.Require().Equal(wp.CodeUploadAccess, wasmtypes.AllowNobody) + +} diff --git a/app/upgrades/testnet/v14/upgrades.go b/app/upgrades/testnet/v14/upgrades.go new file mode 100644 index 000000000..5981f562d --- /dev/null +++ b/app/upgrades/testnet/v14/upgrades.go @@ -0,0 +1,113 @@ +package v14 + +import ( + "fmt" + 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" + lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + 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" + auctionkeeperskip "github.com/skip-mev/block-sdk/x/auction/keeper" + auctionmoduleskiptypes "github.com/skip-mev/block-sdk/x/auction/types" + "strings" +) + +func CreateUpgradeHandlerV14( + mm *module.Manager, + configurator module.Configurator, + auctionkeeperskip auctionkeeperskip.Keeper, + lendKeeper lendkeeper.Keeper, + wasmKeeper wasmkeeper.Keeper, + StakingKeeper stakingkeeper.Keeper, + MintKeeper mintkeeper.Keeper, + SlashingKeeper slashingkeeper.Keeper, + bandoracleKeeper bandoraclemodulekeeper.Keeper, + +) upgradetypes.UpgradeHandler { + return func(ctx sdk.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) + vm, err := mm.RunMigrations(ctx, configurator, fromVM) + if err != nil { + return vm, err + } + + ctx.Logger().Info("setting default params for MEV module (x/auction)") + if err = setDefaultMEVParams(ctx, auctionkeeperskip); err != nil { + return nil, err + } + + // x/Mint + // from 3 seconds to 6 = 1/2x blocks per year + mintParams := MintKeeper.GetParams(ctx) + mintParams.BlocksPerYear /= 2 + if err = MintKeeper.SetParams(ctx, mintParams); err != nil { + return nil, err + } + logger.Info(fmt.Sprintf("updated minted blocks per year logic to %v", mintParams)) + + // x/Slashing + slashingParams := SlashingKeeper.GetParams(ctx) + slashingParams.SignedBlocksWindow /= 2 + if err := SlashingKeeper.SetParams(ctx, slashingParams); err != nil { + return nil, err + } + logger.Info(fmt.Sprintf("updated slashing params to %v", slashingParams)) + + // update wasm to permission nobody + wasmParams := wasmKeeper.GetParams(ctx) + wasmParams.CodeUploadAccess = wasmtypes.AllowNobody + wasmKeeper.SetParams(ctx, wasmParams) + logger.Info(fmt.Sprintf("updated wasm params to %v", wasmParams)) + + // update discard BH of oracle + bandData := bandoracleKeeper.GetFetchPriceMsg(ctx) + if bandData.Size() > 0 { + bandData.AcceptedHeightDiff = 3000 + bandoracleKeeper.SetFetchPriceMsg(ctx, bandData) + logger.Info(fmt.Sprintf("updated bandData to %v", bandData)) + } + + //TODO: uncomment this before mainnet upgrade + //UpdateLendParams(ctx, lendKeeper) + return vm, err + } +} + +func setDefaultMEVParams(ctx sdk.Context, auctionkeeperskip auctionkeeperskip.Keeper) error { + nativeDenom := getChainBondDenom(ctx.ChainID()) + + // Skip MEV (x/auction) + return auctionkeeperskip.SetParams(ctx, auctionmoduleskiptypes.Params{ + MaxBundleSize: auctionmoduleskiptypes.DefaultMaxBundleSize, + EscrowAccountAddress: authtypes.NewModuleAddress(auctionmoduleskiptypes.ModuleName), // TODO: revisit + ReserveFee: sdk.NewCoin(nativeDenom, sdk.NewInt(10)), + MinBidIncrement: sdk.NewCoin(nativeDenom, sdk.NewInt(5)), + FrontRunningProtection: auctionmoduleskiptypes.DefaultFrontRunningProtection, + ProposerFee: auctionmoduleskiptypes.DefaultProposerFee, + }) +} + +// getChainBondDenom returns expected bond denom based on chainID. +func getChainBondDenom(chainID string) string { + if strings.HasPrefix(chainID, "comdex-") { + return "ucmdx" + } + return "stake" +} + +func UpdateLendParams( + ctx sdk.Context, + lendKeeper lendkeeper.Keeper, +) { + assetRatesParamsStAtom, _ := lendKeeper.GetAssetRatesParams(ctx, 14) + assetRatesParamsStAtom.CAssetID = 23 + lendKeeper.SetAssetRatesParams(ctx, assetRatesParamsStAtom) +} 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..fe4c9a8a6 100644 --- a/app/wasm/bindings/query.go +++ b/app/wasm/bindings/query.go @@ -2,7 +2,7 @@ package bindings import sdk "github.com/cosmos/cosmos-sdk/types" -type ComdexQuery struct { +type ContractQuery struct { AppData *AppData `json:"get_app,omitempty"` AssetData *AssetData `json:"get_asset_data,omitempty"` State *State `json:"state,omitempty"` diff --git a/app/wasm/message_plugin.go b/app/wasm/message_plugin.go index 4eeef075d..11423218e 100644 --- a/app/wasm/message_plugin.go +++ b/app/wasm/message_plugin.go @@ -1,28 +1,25 @@ package wasm import ( + errorsmod "cosmossdk.io/errors" "encoding/json" - - esmkeeper "github.com/comdex-official/comdex/x/esm/keeper" - vaultkeeper "github.com/comdex-official/comdex/x/vault/keeper" - - auctionkeeper "github.com/comdex-official/comdex/x/auction/keeper" - liquidationkeeper "github.com/comdex-official/comdex/x/liquidation/keeper" - tokenmintkeeper "github.com/comdex-official/comdex/x/tokenmint/keeper" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" 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" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" + auctionkeeper "github.com/comdex-official/comdex/x/auction/keeper" collectorkeeper "github.com/comdex-official/comdex/x/collector/keeper" + esmkeeper "github.com/comdex-official/comdex/x/esm/keeper" + liquidationkeeper "github.com/comdex-official/comdex/x/liquidation/keeper" liquidityKeeper "github.com/comdex-official/comdex/x/liquidity/keeper" lockerkeeper "github.com/comdex-official/comdex/x/locker/keeper" lockertypes "github.com/comdex-official/comdex/x/locker/types" rewardskeeper "github.com/comdex-official/comdex/x/rewards/keeper" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" + tokenmintkeeper "github.com/comdex-official/comdex/x/tokenmint/keeper" + vaultkeeper "github.com/comdex-official/comdex/x/vault/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func CustomMessageDecorator(lockerKeeper lockerkeeper.Keeper, rewardsKeeper rewardskeeper.Keeper, @@ -71,7 +68,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 +146,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 +179,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 +212,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 +244,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 +271,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 +298,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 +325,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 +352,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 +379,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 +406,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 +433,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 +460,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 +487,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 +514,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 +541,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 +561,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 +585,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 +622,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 +649,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 +676,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..69d059671 100644 --- a/app/wasm/queries.go +++ b/app/wasm/queries.go @@ -209,7 +209,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..2074cb979 100644 --- a/app/wasm/query_plugin.go +++ b/app/wasm/query_plugin.go @@ -1,23 +1,22 @@ package wasm import ( + errorsmod "cosmossdk.io/errors" "encoding/json" - 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" + sdk "github.com/cosmos/cosmos-sdk/types" ) func CustomQuerier(queryPlugin *QueryPlugin) func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { 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") + var contractQuery bindings.ContractQuery + if err := json.Unmarshal(request, &contractQuery); err != nil { + return nil, errorsmod.Wrap(err, "app query") } - if comdexQuery.AppData != nil { - appID := comdexQuery.AppData.AppID + switch { + case contractQuery.AppData != nil: + appID := contractQuery.AppData.AppID MinGovDeposit, GovTimeInSeconds, assetID, _ := queryPlugin.GetAppInfo(ctx, appID) res := bindings.AppDataResponse{ MinGovDeposit: MinGovDeposit.String(), @@ -26,35 +25,35 @@ 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 { - assetID := comdexQuery.AssetData.AssetID + case contractQuery.AssetData != nil: + assetID := contractQuery.AssetData.AssetID denom, _ := queryPlugin.GetAssetInfo(ctx, assetID) res := bindings.AssetDataResponse{ Denom: denom, } 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 { - appID := comdexQuery.MintedToken.AppID - assetID := comdexQuery.MintedToken.AssetID + case contractQuery.MintedToken != nil: + appID := contractQuery.MintedToken.AppID + assetID := contractQuery.MintedToken.AssetID MintedToken, _ := queryPlugin.GetTokenMint(ctx, appID, assetID) res := bindings.MintedTokenResponse{ MintedTokens: MintedToken, } 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 { - appID := comdexQuery.RemoveWhiteListAssetLocker.AppID - assetID := comdexQuery.RemoveWhiteListAssetLocker.AssetIDs + case contractQuery.RemoveWhiteListAssetLocker != nil: + appID := contractQuery.RemoveWhiteListAssetLocker.AppID + assetID := contractQuery.RemoveWhiteListAssetLocker.AssetIDs found, errormsg := queryPlugin.GetRemoveWhitelistAppIDLockerRewardsCheck(ctx, appID, assetID) res := bindings.RemoveWhiteListAssetResponse{ @@ -63,12 +62,12 @@ 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 { - appID := comdexQuery.WhitelistAppIDLockerRewards.AppID - assetID := comdexQuery.WhitelistAppIDLockerRewards.AssetID + case contractQuery.WhitelistAppIDLockerRewards != nil: + appID := contractQuery.WhitelistAppIDLockerRewards.AppID + assetID := contractQuery.WhitelistAppIDLockerRewards.AssetID found, errormsg := queryPlugin.GetWhitelistAppIDLockerRewardsCheck(ctx, appID, assetID) res := bindings.WhitelistAppIDLockerRewardsResponse{ @@ -77,11 +76,11 @@ 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 { - appID := comdexQuery.WhitelistAppIDVaultInterest.AppID + case contractQuery.WhitelistAppIDVaultInterest != nil: + appID := contractQuery.WhitelistAppIDVaultInterest.AppID found, errormsg := queryPlugin.GetWhitelistAppIDVaultInterestCheck(ctx, appID) res := bindings.WhitelistAppIDLockerRewardsResponse{ @@ -90,12 +89,12 @@ 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 { - appID := comdexQuery.ExternalLockerRewards.AppID - assetID := comdexQuery.ExternalLockerRewards.AssetID + case contractQuery.ExternalLockerRewards != nil: + appID := contractQuery.ExternalLockerRewards.AppID + assetID := contractQuery.ExternalLockerRewards.AssetID found, errormsg := queryPlugin.GetExternalLockerRewardsCheck(ctx, appID, assetID) res := bindings.WhitelistAppIDLockerRewardsResponse{ @@ -104,12 +103,12 @@ 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 { - appID := comdexQuery.ExternalVaultRewards.AppID - assetID := comdexQuery.ExternalVaultRewards.AssetID + case contractQuery.ExternalVaultRewards != nil: + appID := contractQuery.ExternalVaultRewards.AppID + assetID := contractQuery.ExternalVaultRewards.AssetID found, errormsg := queryPlugin.GetExternalVaultRewardsCheck(ctx, appID, assetID) res := bindings.ExternalVaultRewardsResponse{ @@ -118,13 +117,13 @@ 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 { - appID := comdexQuery.CollectorLookupTableQuery.AppID - collectorAssetID := comdexQuery.CollectorLookupTableQuery.CollectorAssetID - secondaryAssetID := comdexQuery.CollectorLookupTableQuery.SecondaryAssetID + case contractQuery.CollectorLookupTableQuery != nil: + appID := contractQuery.CollectorLookupTableQuery.AppID + collectorAssetID := contractQuery.CollectorLookupTableQuery.CollectorAssetID + secondaryAssetID := contractQuery.CollectorLookupTableQuery.SecondaryAssetID found, errormsg := queryPlugin.CollectorLookupTableQueryCheck(ctx, appID, collectorAssetID, secondaryAssetID) res := bindings.CollectorLookupTableQueryResponse{ Found: found, @@ -132,18 +131,18 @@ 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 { - appID := comdexQuery.ExtendedPairsVaultRecordsQuery.AppID - pairID := comdexQuery.ExtendedPairsVaultRecordsQuery.PairID - StabilityFee := comdexQuery.ExtendedPairsVaultRecordsQuery.StabilityFee - ClosingFee := comdexQuery.ExtendedPairsVaultRecordsQuery.ClosingFee - DrawDownFee := comdexQuery.ExtendedPairsVaultRecordsQuery.DrawDownFee - DebtCeiling := comdexQuery.ExtendedPairsVaultRecordsQuery.DebtCeiling - DebtFloor := comdexQuery.ExtendedPairsVaultRecordsQuery.DebtFloor - PairName := comdexQuery.ExtendedPairsVaultRecordsQuery.PairName + case contractQuery.ExtendedPairsVaultRecordsQuery != nil: + appID := contractQuery.ExtendedPairsVaultRecordsQuery.AppID + pairID := contractQuery.ExtendedPairsVaultRecordsQuery.PairID + StabilityFee := contractQuery.ExtendedPairsVaultRecordsQuery.StabilityFee + ClosingFee := contractQuery.ExtendedPairsVaultRecordsQuery.ClosingFee + DrawDownFee := contractQuery.ExtendedPairsVaultRecordsQuery.DrawDownFee + DebtCeiling := contractQuery.ExtendedPairsVaultRecordsQuery.DebtCeiling + DebtFloor := contractQuery.ExtendedPairsVaultRecordsQuery.DebtFloor + PairName := contractQuery.ExtendedPairsVaultRecordsQuery.PairName found, errorMsg := queryPlugin.ExtendedPairsVaultRecordsQueryCheck(ctx, appID, pairID, StabilityFee, ClosingFee, DrawDownFee, DebtCeiling, DebtFloor, PairName) res := bindings.ExtendedPairsVaultRecordsQueryResponse{ @@ -152,11 +151,11 @@ 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 { - appID := comdexQuery.AuctionMappingForAppQuery.AppID + case contractQuery.AuctionMappingForAppQuery != nil: + appID := contractQuery.AuctionMappingForAppQuery.AppID found, errormsg := queryPlugin.AuctionMappingForAppQueryCheck(ctx, appID) res := bindings.AuctionMappingForAppQueryResponse{ Found: found, @@ -164,12 +163,12 @@ 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 { - appID := comdexQuery.WhiteListedAssetQuery.AppID - assetID := comdexQuery.WhiteListedAssetQuery.AssetID + case contractQuery.WhiteListedAssetQuery != nil: + appID := contractQuery.WhiteListedAssetQuery.AppID + assetID := contractQuery.WhiteListedAssetQuery.AssetID found, errormsg := queryPlugin.WhiteListedAssetQueryCheck(ctx, appID, assetID) res := bindings.WhiteListedAssetQueryResponse{ Found: found, @@ -177,12 +176,12 @@ 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 { - appID := comdexQuery.UpdatePairsVaultQuery.AppID - extPairID := comdexQuery.UpdatePairsVaultQuery.ExtPairID + case contractQuery.UpdatePairsVaultQuery != nil: + appID := contractQuery.UpdatePairsVaultQuery.AppID + extPairID := contractQuery.UpdatePairsVaultQuery.ExtPairID found, errormsg := queryPlugin.UpdatePairsVaultQueryCheck(ctx, appID, extPairID) res := bindings.UpdatePairsVaultQueryResponse{ Found: found, @@ -190,12 +189,12 @@ 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 { - appID := comdexQuery.UpdateCollectorLookupTableQuery.AppID - assetID := comdexQuery.UpdateCollectorLookupTableQuery.AssetID + case contractQuery.UpdateCollectorLookupTableQuery != nil: + appID := contractQuery.UpdateCollectorLookupTableQuery.AppID + assetID := contractQuery.UpdateCollectorLookupTableQuery.AssetID found, errormsg := queryPlugin.UpdateCollectorLookupTableQueryCheck(ctx, appID, assetID) res := bindings.UpdateCollectorLookupTableQueryResponse{ Found: found, @@ -203,11 +202,11 @@ 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 { - appID := comdexQuery.RemoveWhitelistAppIDVaultInterestQuery.AppID + case contractQuery.RemoveWhitelistAppIDVaultInterestQuery != nil: + appID := contractQuery.RemoveWhitelistAppIDVaultInterestQuery.AppID found, errormsg := queryPlugin.WasmRemoveWhitelistAppIDVaultInterestQueryCheck(ctx, appID) res := bindings.RemoveWhitelistAppIDVaultInterestQueryResponse{ Found: found, @@ -215,12 +214,12 @@ 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 { - appID := comdexQuery.RemoveWhitelistAssetLockerQuery.AppID - assetID := comdexQuery.RemoveWhitelistAssetLockerQuery.AssetID + case contractQuery.RemoveWhitelistAssetLockerQuery != nil: + appID := contractQuery.RemoveWhitelistAssetLockerQuery.AppID + assetID := contractQuery.RemoveWhitelistAssetLockerQuery.AssetID found, errormsg := queryPlugin.WasmRemoveWhitelistAssetLockerQueryCheck(ctx, appID, assetID) res := bindings.RemoveWhitelistAssetLockerQueryResponse{ @@ -229,11 +228,11 @@ 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 { - AppID := comdexQuery.WhitelistAppIDLiquidationQuery.AppID + case contractQuery.WhitelistAppIDLiquidationQuery != nil: + AppID := contractQuery.WhitelistAppIDLiquidationQuery.AppID found, errormsg := queryPlugin.WasmWhitelistAppIDLiquidationQueryCheck(ctx, AppID) res := bindings.WhitelistAppIDLiquidationQueryResponse{ @@ -242,11 +241,11 @@ 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 { - AppID := comdexQuery.RemoveWhitelistAppIDLiquidationQuery.AppID + case contractQuery.RemoveWhitelistAppIDLiquidationQuery != nil: + AppID := contractQuery.RemoveWhitelistAppIDLiquidationQuery.AppID found, errormsg := queryPlugin.WasmRemoveWhitelistAppIDLiquidationQueryCheck(ctx, AppID) res := bindings.RemoveWhitelistAppIDLiquidationQueryResponse{ @@ -255,11 +254,11 @@ 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 { - AppID := comdexQuery.AddESMTriggerParamsForAppQuery.AppID + case contractQuery.AddESMTriggerParamsForAppQuery != nil: + AppID := contractQuery.AddESMTriggerParamsForAppQuery.AppID found, errormsg := queryPlugin.WasmAddESMTriggerParamsQueryCheck(ctx, AppID) res := bindings.AddESMTriggerParamsForAppResponse{ @@ -268,11 +267,11 @@ 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 { - AppID := comdexQuery.ExtendedPairByApp.AppID + case contractQuery.ExtendedPairByApp != nil: + AppID := contractQuery.ExtendedPairByApp.AppID extendedPair, _ := queryPlugin.WasmExtendedPairByApp(ctx, AppID) res := bindings.ExtendedPairByAppResponse{ @@ -280,23 +279,23 @@ 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 { - AppID := comdexQuery.CheckSurplusReward.AppID - AssetID := comdexQuery.CheckSurplusReward.AssetID + case contractQuery.CheckSurplusReward != nil: + AppID := contractQuery.CheckSurplusReward.AppID + AssetID := contractQuery.CheckSurplusReward.AssetID amount := queryPlugin.WasmCheckSurplusReward(ctx, AppID, AssetID) res := bindings.CheckSurplusRewardResponse{ Amount: amount, } 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 { - Denom := comdexQuery.CheckWhitelistedAsset.Denom + case contractQuery.CheckWhitelistedAsset != nil: + Denom := contractQuery.CheckWhitelistedAsset.Denom found := queryPlugin.WasmCheckWhitelistedAsset(ctx, Denom) res := bindings.CheckWhitelistedAssetResponse{ @@ -304,68 +303,69 @@ 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 { - Address := comdexQuery.CheckVaultCreated.Address - AppID := comdexQuery.CheckVaultCreated.AppID + case contractQuery.CheckVaultCreated != nil: + Address := contractQuery.CheckVaultCreated.Address + AppID := contractQuery.CheckVaultCreated.AppID found := queryPlugin.WasmCheckVaultCreated(ctx, Address, AppID) res := bindings.VaultCreatedResponse{ IsCompleted: found, } 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 { - AssetID := comdexQuery.CheckBorrowed.AssetID - Address := comdexQuery.CheckBorrowed.Address + case contractQuery.CheckBorrowed != nil: + AssetID := contractQuery.CheckBorrowed.AssetID + Address := contractQuery.CheckBorrowed.Address found := queryPlugin.WasmCheckBorrowed(ctx, AssetID, Address) res := bindings.BorrowedResponse{ IsCompleted: found, } 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 { - AppID := comdexQuery.CheckLiquidityProvided.AppID - PoolID := comdexQuery.CheckLiquidityProvided.PoolID - Address := comdexQuery.CheckLiquidityProvided.Address + case contractQuery.CheckLiquidityProvided != nil: + AppID := contractQuery.CheckLiquidityProvided.AppID + PoolID := contractQuery.CheckLiquidityProvided.PoolID + Address := contractQuery.CheckLiquidityProvided.Address found := queryPlugin.WasmCheckLiquidityProvided(ctx, AppID, PoolID, Address) res := bindings.LiquidityProvidedResponse{ IsCompleted: found, } 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 { - AppID := comdexQuery.GetPoolByApp.AppID + case contractQuery.GetPoolByApp != nil: + AppID := contractQuery.GetPoolByApp.AppID pools := queryPlugin.WasmGetPools(ctx, AppID) res := bindings.GetPoolByAppResponse{ Pools: pools, } 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 { - assetID := comdexQuery.GetAssetPrice.AssetID + case contractQuery.GetAssetPrice != nil: + assetID := contractQuery.GetAssetPrice.AssetID assetPrice, _ := queryPlugin.WasmGetAssetPrice(ctx, assetID) res := bindings.GetAssetPriceResponse{ Price: assetPrice, } 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 + } return nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown App Data query variant"} } diff --git a/app/wasm/test/helpers_test.go b/app/wasm/test/helpers_test.go index 5beec95ad..b47b2fffa 100644 --- a/app/wasm/test/helpers_test.go +++ b/app/wasm/test/helpers_test.go @@ -2,30 +2,56 @@ package wasm import ( "fmt" - "testing" - "time" - + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/comdex-official/comdex/app" "github.com/comdex-official/comdex/app/wasm/bindings" 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" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - - "github.com/stretchr/testify/require" - "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" - - "github.com/comdex-official/comdex/app" - "github.com/comdex-official/comdex/x/tokenmint/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/stretchr/testify/require" + "os" + "testing" + "time" ) -func SetupCustomApp(t *testing.T) (*app.App, *sdk.Context) { - comdex, ctx := CreateTestInput(t) - return comdex, ctx +func SetupCustomApp(t *testing.T, addr sdk.AccAddress) (*app.App, *sdk.Context) { + comdexApp, ctx := CreateTestInput(t) + wasmKeeper := comdexApp.WasmKeeper + + storeReflectCode(t, *ctx, comdexApp, addr) + + cInfo := wasmKeeper.GetCodeInfo(*ctx, 1) + require.NotNil(t, cInfo) + + return comdexApp, ctx +} + +func storeReflectCode(t *testing.T, ctx sdk.Context, comdexApp *app.App, addr sdk.AccAddress) uint64 { + wasmCode, err := os.ReadFile("../testdata/counter.wasm") + require.NoError(t, err) + + contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(comdexApp.WasmKeeper) + codeID, _, err := contractKeeper.Create(ctx, addr, wasmCode, nil) + require.NoError(t, err) + + return codeID +} + +func instantiateReflectContract(t *testing.T, ctx sdk.Context, comdexApp *app.App, funder sdk.AccAddress) sdk.AccAddress { + initMsgBz := []byte("{}") + contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(comdexApp.WasmKeeper) + codeID := uint64(1) + addr, _, err := contractKeeper.Instantiate(ctx, codeID, funder, funder, initMsgBz, "demo contract", nil) + require.NoError(t, err) + + return addr } func CreateTestInput(t *testing.T) (*app.App, *sdk.Context) { @@ -34,10 +60,13 @@ func CreateTestInput(t *testing.T) (*app.App, *sdk.Context) { 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)), - )) +func fundAccount(t *testing.T, ctx sdk.Context, comdexapp *app.App, addr sdk.AccAddress, coins sdk.Coins) { + err := banktestutil.FundAccount( + comdexapp.BankKeeper, + ctx, + addr, + coins, + ) require.NoError(t, err) } @@ -69,10 +98,10 @@ func AddAppAsset(app *app.App, ctx1 sdk.Context) { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress, }, }, } diff --git a/app/wasm/test/messages_test.go b/app/wasm/test/messages_test.go index dcc1e2f8b..f75c20183 100644 --- a/app/wasm/test/messages_test.go +++ b/app/wasm/test/messages_test.go @@ -11,7 +11,7 @@ import ( func TestWhitelistAssetLocker(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddAppAsset(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, &comdex.LockerKeeper, @@ -55,7 +55,7 @@ func TestWhitelistAssetLocker(t *testing.T) { func TestAddMsgAddExtendedPairsVault(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddPair(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, &comdex.LockerKeeper, @@ -67,7 +67,8 @@ func TestAddMsgAddExtendedPairsVault(t *testing.T) { &comdex.VaultKeeper, &comdex.LendKeeper, &comdex.LiquidityKeeper, - &comdex.MarketKeeper) + &comdex.MarketKeeper, + ) for _, tc := range []struct { name string msg *bindings.MsgAddExtendedPairsVault @@ -113,7 +114,7 @@ func TestAddMsgAddExtendedPairsVault(t *testing.T) { func TestMsgSetCollectorLookupTable(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddPair(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, &comdex.LockerKeeper, @@ -125,7 +126,8 @@ func TestMsgSetCollectorLookupTable(t *testing.T) { &comdex.VaultKeeper, &comdex.LendKeeper, &comdex.LiquidityKeeper, - &comdex.MarketKeeper) + &comdex.MarketKeeper, + ) for _, tc := range []struct { name string msg *bindings.MsgSetCollectorLookupTable @@ -165,7 +167,7 @@ func TestMsgSetCollectorLookupTable(t *testing.T) { func TestMsgSetAuctionMappingForApp(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddPair(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, &comdex.LockerKeeper, @@ -177,7 +179,8 @@ func TestMsgSetAuctionMappingForApp(t *testing.T) { &comdex.VaultKeeper, &comdex.LendKeeper, &comdex.LiquidityKeeper, - &comdex.MarketKeeper) + &comdex.MarketKeeper, + ) for _, tc := range []struct { name string msg *bindings.MsgSetAuctionMappingForApp @@ -215,7 +218,7 @@ func TestMsgSetAuctionMappingForApp(t *testing.T) { func TestMsgUpdateCollectorLookupTable(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddPair(comdex, *ctx) AddCollectorLookuptable(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, @@ -228,7 +231,8 @@ func TestMsgUpdateCollectorLookupTable(t *testing.T) { &comdex.VaultKeeper, &comdex.LendKeeper, &comdex.LiquidityKeeper, - &comdex.MarketKeeper) + &comdex.MarketKeeper, + ) for _, tc := range []struct { name string msg *bindings.MsgUpdateCollectorLookupTable @@ -267,7 +271,7 @@ func TestMsgUpdateCollectorLookupTable(t *testing.T) { func TestMsgUpdatePairsVault(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddPair(comdex, *ctx) AddExtendedPairVault(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, @@ -280,7 +284,8 @@ func TestMsgUpdatePairsVault(t *testing.T) { &comdex.VaultKeeper, &comdex.LendKeeper, &comdex.LiquidityKeeper, - &comdex.MarketKeeper) + &comdex.MarketKeeper, + ) for _, tc := range []struct { name string msg *bindings.MsgUpdatePairsVault @@ -324,7 +329,7 @@ func TestMsgUpdatePairsVault(t *testing.T) { func TestMsgWhitelistAppIDLiquidation(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddPair(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, &comdex.LockerKeeper, @@ -336,7 +341,8 @@ func TestMsgWhitelistAppIDLiquidation(t *testing.T) { &comdex.VaultKeeper, &comdex.LendKeeper, &comdex.LiquidityKeeper, - &comdex.MarketKeeper) + &comdex.MarketKeeper, + ) for _, tc := range []struct { name string msg *bindings.MsgWhitelistAppIDLiquidation @@ -371,7 +377,7 @@ func TestMsgWhitelistAppIDLiquidation(t *testing.T) { func TestMsgRemoveWhitelistAppIDLiquidation(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddPair(comdex, *ctx) WhitelistAppIDLiquidation(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, @@ -384,7 +390,8 @@ func TestMsgRemoveWhitelistAppIDLiquidation(t *testing.T) { &comdex.VaultKeeper, &comdex.LendKeeper, &comdex.LiquidityKeeper, - &comdex.MarketKeeper) + &comdex.MarketKeeper, + ) for _, tc := range []struct { name string msg *bindings.MsgRemoveWhitelistAppIDLiquidation @@ -416,7 +423,7 @@ func TestMsgRemoveWhitelistAppIDLiquidation(t *testing.T) { func TestMsgAddAuctionParams(t *testing.T) { actor := RandomAccountAddress() - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) AddPair(comdex, *ctx) querier := wasm.NewQueryPlugin(&comdex.AssetKeeper, &comdex.LockerKeeper, @@ -428,7 +435,8 @@ func TestMsgAddAuctionParams(t *testing.T) { &comdex.VaultKeeper, &comdex.LendKeeper, &comdex.LiquidityKeeper, - &comdex.MarketKeeper) + &comdex.MarketKeeper, + ) for _, tc := range []struct { name string msg *bindings.MsgAddAuctionParams @@ -474,7 +482,7 @@ func TestMsgBurnGovTokensForApp(t *testing.T) { actor := RandomAccountAddress() userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" addr, _ := sdk.AccAddressFromBech32(userAddress) - comdex, ctx := SetupCustomApp(t) + comdex, ctx := SetupCustomApp(t, actor) MsgMintNewTokens(comdex, *ctx) for _, tc := range []struct { diff --git a/app/wasm/testdata/counter.wasm b/app/wasm/testdata/counter.wasm new file mode 100644 index 000000000..407509573 Binary files /dev/null and b/app/wasm/testdata/counter.wasm differ diff --git a/app/wasm/wasm.go b/app/wasm/wasm.go index 3aab22cce..e6b80204e 100644 --- a/app/wasm/wasm.go +++ b/app/wasm/wasm.go @@ -1,9 +1,7 @@ package wasm import ( - "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" auctionKeeper "github.com/comdex-official/comdex/x/auction/keeper" collectorKeeper "github.com/comdex-official/comdex/x/collector/keeper" @@ -12,10 +10,10 @@ import ( liquidationKeeper "github.com/comdex-official/comdex/x/liquidation/keeper" liquidityKeeper "github.com/comdex-official/comdex/x/liquidity/keeper" lockerkeeper "github.com/comdex-official/comdex/x/locker/keeper" + marketKeeper "github.com/comdex-official/comdex/x/market/keeper" rewardsKeeper "github.com/comdex-official/comdex/x/rewards/keeper" tokenMintkeeper "github.com/comdex-official/comdex/x/tokenmint/keeper" vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" - marketKeeper "github.com/comdex-official/comdex/x/market/keeper" ) func RegisterCustomPlugins( @@ -41,7 +39,7 @@ func RegisterCustomPlugins( CustomMessageDecorator(*locker, *rewards, *asset, *collector, *liquidation, *auction, *tokenMint, *esm, *vault, *liquidity), ) - return []wasm.Option{ + return []wasmkeeper.Option{ appDataQueryPluginOpt, messengerDecoratorOpt, } diff --git a/cmd/comdex/root.go b/cmd/comdex/root.go index 6dbdaa3dd..11131e6a0 100644 --- a/cmd/comdex/root.go +++ b/cmd/comdex/root.go @@ -2,16 +2,9 @@ package main import ( "errors" - "io" - "os" - "path/filepath" - // "time" - - "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/prometheus/client_golang/prometheus" - + comdex "github.com/comdex-official/comdex/app" tmdb "github.com/cometbft/cometbft-db" tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" @@ -39,10 +32,13 @@ import ( "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/prometheus/client_golang/prometheus" "github.com/spf13/cast" "github.com/spf13/cobra" - - comdex "github.com/comdex-official/comdex/app" + "io" + "os" + "path/filepath" + // "time" ) func NewRootCmd() (*cobra.Command, comdex.EncodingConfig) { @@ -131,7 +127,7 @@ func initAppConfig() (string, interface{}) { func initRootCmd(rootCmd *cobra.Command, encoding comdex.EncodingConfig) { cfg := sdk.GetConfig() cfg.Seal() - + gentxModule := comdex.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) rootCmd.AddCommand( genutilcli.InitCmd(comdex.ModuleBasics, comdex.DefaultNodeHome), @@ -235,7 +231,7 @@ func appCreatorFunc(logger log.Logger, db tmdb.DB, tracer io.Writer, options ser if err != nil { panic(err) } - var wasmOpts []wasm.Option + var wasmOpts []wasmkeeper.Option if cast.ToBool(options.Get("telemetry.enabled")) { wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) } @@ -262,7 +258,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))), @@ -286,16 +281,16 @@ func appExportFunc(logger log.Logger, db tmdb.DB, tracer io.Writer, height int64 if !ok || homePath == "" { return servertypes.ExportedApp{}, errors.New("application home is not set") } - var emptyWasmOpts []wasm.Option + var emptyWasmOpts []wasmkeeper.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/go.mod b/go.mod index 8cac8fadb..8b940ee95 100644 --- a/go.mod +++ b/go.mod @@ -1,109 +1,120 @@ module github.com/comdex-official/comdex -go 1.20 +go 1.21.7 require ( cosmossdk.io/api v0.3.1 - cosmossdk.io/math v1.1.2 - github.com/CosmWasm/wasmd v0.41.0 - github.com/CosmWasm/wasmvm v1.3.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/math v1.2.0 + github.com/CosmWasm/wasmd v0.45.0 + github.com/CosmWasm/wasmvm v1.5.0 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/cosmos/cosmos-sdk v0.47.5 + github.com/cometbft/cometbft v0.37.5 + github.com/cometbft/cometbft-db v0.11.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.47.9 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/golang/protobuf v1.5.3 - github.com/gorilla/mux v1.8.0 + github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017 + github.com/golang/protobuf v1.5.4 + 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/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.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 + github.com/skip-mev/block-sdk v1.4.3 + github.com/spf13/cast v1.6.0 + github.com/spf13/cobra v1.8.0 + github.com/stretchr/testify v1.9.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 + google.golang.org/grpc v1.62.1 + google.golang.org/protobuf v1.33.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/v7 v7.1.3 + github.com/cosmos/ibc-go/v7 v7.4.0 github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/golangci/golangci-lint v1.51.2 + github.com/golangci/golangci-lint v1.56.2 github.com/rakyll/statik v0.1.7 github.com/spf13/pflag v1.0.5 gopkg.in/yaml.v2 v2.4.0 - mvdan.cc/gofumpt v0.5.0 + mvdan.cc/gofumpt v0.6.0 ) 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.112.0 // 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/storage v1.30.1 // indirect + cloud.google.com/go/iam v1.1.5 // indirect + cloud.google.com/go/storage v1.36.0 // indirect cosmossdk.io/core v0.6.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/log v1.2.1 // indirect + cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/tools/rosetta v0.2.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect + github.com/4meepo/tagalign v1.3.3 // 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/BurntSushi/toml v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/Abirdcfly/dupword v0.0.13 // indirect + github.com/Antonboom/errname v0.1.12 // indirect + github.com/Antonboom/nilnil v0.1.7 // indirect + github.com/Antonboom/testifylint v1.1.2 // indirect + github.com/BurntSushi/toml v1.3.2 // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect + github.com/DataDog/zstd v1.5.2 // indirect github.com/Djarvur/go-err113 v0.1.0 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect - github.com/OpenPeeDeeP/depguard v1.1.1 // indirect + github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect + github.com/alecthomas/go-check-sumtype v0.1.4 // indirect + github.com/alexkohler/nakedret/v2 v2.0.2 // 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/forbidigo v1.6.0 // 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/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/bombsimon/wsl/v4 v4.2.1 // indirect + github.com/breml/bidichk v0.2.7 // indirect + github.com/breml/errchkjson v0.3.6 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/butuzov/ireturn v0.1.1 // indirect + github.com/butuzov/ireturn v0.3.0 // indirect + github.com/butuzov/mirror v1.1.0 // indirect + github.com/catenacyber/perfsprint v0.6.0 // indirect + github.com/ccojocar/zxcvbn-go v1.0.2 // 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/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 // indirect + github.com/charithe/durationcheck v0.0.10 // indirect + github.com/chavacava/garif v0.1.0 // 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 v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // 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/iavl v0.20.1 // 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/curioswitch/go-reassign v0.2.0 // indirect - github.com/daixiang0/gci v0.10.1 // indirect + github.com/daixiang0/gci v0.12.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 @@ -111,71 +122,73 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/dvsekhvalnov/jose2go 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/ettle/strcase v0.2.0 // indirect + github.com/fatih/color v1.16.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/fsnotify/fsnotify v1.7.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/ghostiam/protogetter v0.3.4 // indirect github.com/gin-gonic/gin v1.9.0 // indirect - github.com/go-critic/go-critic v0.8.1 // indirect + github.com/go-critic/go-critic v0.11.1 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect - github.com/go-toolsmith/astequal v1.1.0 // indirect + github.com/go-toolsmith/astequal v1.2.0 // indirect github.com/go-toolsmith/astfmt v1.1.0 // indirect github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect github.com/go-toolsmith/typep v1.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect 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/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 github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect - github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect + github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect - github.com/golangci/misspell v0.4.0 // indirect - github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect + github.com/golangci/misspell v0.4.1 // indirect + github.com/golangci/revgrep v0.5.2 // 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/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.6.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.1.0 // indirect github.com/gorilla/handlers v1.5.1 // 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-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-multierror v1.1.1 // 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 @@ -186,40 +199,41 @@ require ( github.com/iancoleman/orderedmap v0.2.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 + github.com/jgautheron/goconst v1.7.0 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect + github.com/jjti/go-spancheck v0.5.2 // indirect 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/kisielk/errcheck v1.6.3 // indirect + github.com/kisielk/errcheck v1.7.0 // 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.0 // 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 - github.com/kunwardeep/paralleltest v1.0.7 // indirect + github.com/kunwardeep/paralleltest v1.0.9 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect github.com/ldez/gomoddirectives v0.2.3 // indirect github.com/ldez/tagliatelle v0.5.0 // indirect 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.12 // indirect github.com/lufeee/execinquery v1.2.1 // indirect + github.com/macabu/inamedparam v0.1.3 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/maratori/testableexamples v1.0.0 // indirect 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/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.3.2 // indirect + github.com/mgechev/revive v1.3.7 // 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 @@ -228,98 +242,108 @@ require ( github.com/moricho/tparallel v0.3.1 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/nakabonne/nestif v0.3.1 // indirect - github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect - github.com/nishanths/exhaustive v0.11.0 // indirect + github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nunnatsa/ginkgolinter v0.12.1 // indirect + github.com/nunnatsa/ginkgolinter v0.15.2 // 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/pelletier/go-toml/v2 v2.1.0 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/pmezard/go-difflib v1.0.0 // 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/quasilyte/go-ruleguard v0.3.19 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/polyfloyd/go-errorlint v1.4.8 // indirect + github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.0 // indirect + github.com/quasilyte/go-ruleguard v0.4.0 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.30.0 // indirect + github.com/rs/zerolog v1.32.0 // indirect github.com/ryancurrah/gomodguard v1.3.0 // indirect - github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect + github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect + github.com/sagikazarmark/locafero v0.4.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 - github.com/sashamelentyev/usestdlibvars v1.23.0 // indirect - github.com/securego/gosec/v2 v2.16.0 // indirect + github.com/sashamelentyev/usestdlibvars v1.25.0 // indirect + github.com/securego/gosec/v2 v2.19.0 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect 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.11.0 // indirect + github.com/spf13/viper v1.18.2 // 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/stretchr/objx v0.5.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/tetafro/godot v1.4.16 // indirect github.com/tidwall/btree v1.6.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/timakin/bodyclose v0.0.0-20230421092635-574207250966 // 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 - github.com/ultraware/whitespace v0.0.5 // indirect - github.com/uudashr/gocognit v1.0.6 // indirect + github.com/ultraware/funlen v0.1.0 // indirect + github.com/ultraware/whitespace v0.1.0 // indirect + github.com/uudashr/gocognit v1.1.2 // indirect + github.com/xen0n/gosmopolitan v1.2.2 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.2.0 // indirect + github.com/ykadowak/zerologlint v0.1.5 // indirect 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 + gitlab.com/bosi/decorder v0.4.1 // indirect + go-simpler.org/musttag v0.8.0 // indirect + go-simpler.org/sloglint v0.4.0 // indirect + go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.10.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/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 + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect + golang.org/x/exp/typeparams v0.0.0-20231219180239-dc181d75b848 // indirect + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.18.0 // indirect + google.golang.org/api v0.155.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.4.3 // indirect + honnef.co/go/tools v0.4.6 // 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 + mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 // 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 ( @@ -327,7 +351,11 @@ replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 //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 + // fork of block-sdk, module name changed + github.com/skip-mev/block-sdk => github.com/comdex-official/block-sdk v1.4.3-comdex // 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 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 + // https://github.com/skip-mev/block-sdk/blob/v1.4.0/go.mod#L331 + golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb ) diff --git a/go.sum b/go.sum index 937ee83e0..f829c128b 100644 --- a/go.sum +++ b/go.sum @@ -53,8 +53,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.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= 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= @@ -141,8 +141,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 +237,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= @@ -383,8 +383,8 @@ cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeL cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= -cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= +cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= +cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= @@ -445,20 +445,19 @@ cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3s 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.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= 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/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= -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= @@ -466,18 +465,24 @@ git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGy 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/4meepo/tagalign v1.3.3 h1:ZsOxcwGD/jP4U/aw7qeWu58i7dwYemfy5Y+IF1ACoNw= +github.com/4meepo/tagalign v1.3.3/go.mod h1:Q9c1rYMZJc9dPRkbQPpcBNCLEmY2njbAsXhQOZFE2dE= 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.13 h1:SMS17YXypwP000fA7Lr+kfyBQyW14tTT+nRv9ASwUUo= +github.com/Abirdcfly/dupword v0.0.13/go.mod h1:Ut6Ue2KgF/kCOawpW4LnExT+xZLQviJPE4klBPMK/5Y= 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.12 h1:oh9ak2zUtsLp5oaEd/erjB4GPu9w19NyoIskZClDcQY= +github.com/Antonboom/errname v0.1.12/go.mod h1:bK7todrzvlaZoQagP1orKzWXv59X/x0W0Io2XT1Ssro= github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= +github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTow= +github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ= +github.com/Antonboom/testifylint v1.1.2 h1:IdLRermiLRogxY5AumBL4sP0A+qKHQM/AP1Xd7XOTKc= +github.com/Antonboom/testifylint v1.1.2/go.mod h1:9PFi+vWa8zzl4/B/kqmFJcw85ZUv8ReyBzuQCd30+WI= 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= @@ -542,27 +547,31 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -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/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= 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/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/CosmWasm/wasmd v0.45.0 h1:9zBqrturKJwC2kVsfHvbrA++EN0PS7UTXCffCGbg6JI= +github.com/CosmWasm/wasmd v0.45.0/go.mod h1:RnSAiqbNIZu4QhO+0pd7qGZgnYAMBPGmXpzTADag944= +github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw= +github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= 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/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.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/DataDog/zstd v1.5.2/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= github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v2 v2.1.0/go.mod h1:LGOGuvEgCfCQsy3JF2tRmpGDpzA53iZfyGEWSPwQ6/4= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7IAzX8QezqtFV9m0MUHFJgts= github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmcxJL+UEG2f8cQploZm1mR/v6BW0mU0= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 h1:sATXp1x6/axKxz2Gjxv8MALP0bXaNRfQinEwyfMcx8c= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0/go.mod h1:Nl76DrGNJTA1KJ0LePKBw/vznBX1EHbAZX8mwjR82nI= github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo= github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= @@ -592,8 +601,9 @@ github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOp github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= @@ -619,8 +629,9 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= -github.com/OpenPeeDeeP/depguard v1.1.1 h1:TSUznLjvp/4IUP+OQ0t/4jF4QUyxIcVX8YnghZdunyA= github.com/OpenPeeDeeP/depguard v1.1.1/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -644,9 +655,15 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= +github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= +github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= +github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= +github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= +github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -654,6 +671,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= +github.com/alexkohler/nakedret/v2 v2.0.2 h1:qnXuZNvv3/AxkAb22q/sEsEpcA99YxLFACDtEw9TPxE= +github.com/alexkohler/nakedret/v2 v2.0.2/go.mod h1:2b8Gkk0GsOrqQv/gPWjNLDSKwG8I5moSXG1K4VIBcTQ= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= @@ -690,8 +709,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= -github.com/ashanbrown/forbidigo v1.5.3 h1:jfg+fkm/snMx+V9FBwsl1d340BV/99kZGv5jN9hBoXk= -github.com/ashanbrown/forbidigo v1.5.3/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= +github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= +github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= @@ -712,8 +731,9 @@ 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= @@ -763,13 +783,15 @@ github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6 github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -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/bombsimon/wsl/v4 v4.2.1 h1:Cxg6u+XDWff75SIFFmNsqnIOgob+Q9hG6y/ioKbRFiM= +github.com/bombsimon/wsl/v4 v4.2.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= 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.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= +github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= +github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= +github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= 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= @@ -812,22 +834,31 @@ github.com/bufbuild/connect-go v0.2.0/go.mod h1:4efZ2eXFENwd4p7tuLaL9m0qtTsCOzuB 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.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= 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= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= +github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= +github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA= +github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= +github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= 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/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= 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= github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= +github.com/catenacyber/perfsprint v0.6.0 h1:VSv95RRkk5+BxrU/YTPcnxuMEWar1iMK5Vyh3fWcBfs= +github.com/catenacyber/perfsprint v0.6.0/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A= +github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= +github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -847,17 +878,19 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8/go.mod h1:gakxgyXaaPkxvLw1XQxNGK4I37ys9iBRzNUx/B7pUCo= +github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= +github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= 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= @@ -894,32 +927,42 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= 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 v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= 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/comdex-official/block-sdk v1.4.3-comdex h1:L4ms81FDntPiOla5gq5f92BrAHHkmqZGvnw4c7wH56g= +github.com/comdex-official/block-sdk v1.4.3-comdex/go.mod h1:rVPgr1X5tMyOwcPxNalJEDErgC4ynVbVQdmI89Txhv4= 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.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= +github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= 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.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= +github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= 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= @@ -1072,13 +1115,13 @@ github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNs 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= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= 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.47.9 h1:D51VLkF59D53PMLsbNtp6JyWR+6MbetFyomrH88+y08= +github.com/cosmos/cosmos-sdk v0.47.9/go.mod h1:cmAawe8FV/52oPKbgeHLt4UpNkrNu8R5KD+kw0kxJFc= 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= @@ -1095,16 +1138,17 @@ github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzck 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/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 h1:MZGDMETv72suFpTAD6VPGqSIm1FJcChtk2HmVh9D+Bo= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= 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/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017 h1:/m++TlQ4CfCZs+7vGFDQNdlnkvSNKFoLbjzmWOT7m10= +github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017/go.mod h1:JwHFbo1oX/ht4fPpnPvmhZr+dCkYK1Vihw+vZE9umR4= +github.com/cosmos/ibc-go/v7 v7.4.0 h1:8FqYMptvksgMvlbN4UW9jFxTXzsPyfAzEZurujXac8M= +github.com/cosmos/ibc-go/v7 v7.4.0/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo= 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= @@ -1120,6 +1164,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma 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/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= @@ -1143,8 +1188,8 @@ github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjI github.com/daixiang0/gci v0.3.3/go.mod h1:1Xr2bxnQbDxCqqulUOv8qpGqkgRw9RSCGGjEC2LjF8o= github.com/daixiang0/gci v0.6.3/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= github.com/daixiang0/gci v0.8.1/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= -github.com/daixiang0/gci v0.10.1 h1:eheNA3ljF6SxnPD/vE4lCBusVHmV3Rs3dkKvFrJ7MR0= -github.com/daixiang0/gci v0.10.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= +github.com/daixiang0/gci v0.12.1 h1:ugsG+KRYny1VK4oqrX4Vtj70bo4akYKa0tgT1DXMYiY= +github.com/daixiang0/gci v0.12.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= 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= @@ -1153,14 +1198,17 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2 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/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/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= 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= @@ -1240,8 +1288,9 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= 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= @@ -1269,11 +1318,14 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= 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/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= +github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -1288,13 +1340,14 @@ github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= 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= @@ -1312,13 +1365,15 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= 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.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/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= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= github.com/fzipp/gocyclo v0.5.1/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= @@ -1334,6 +1389,8 @@ github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZW github.com/getsentry/sentry-go v0.23.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/ghostiam/protogetter v0.3.4 h1:5SZ+lZSNmNkSbGVSF9hUHhv/b7ELF9Rwchoq7btYo6c= +github.com/ghostiam/protogetter v0.3.4/go.mod h1:A0JgIhs0fgVnotGinjQiKaFVG3waItLJNwPmcMzDnvk= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= @@ -1350,18 +1407,16 @@ github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJo github.com/go-critic/go-critic v0.6.3/go.mod h1:c6b3ZP1MQ7o6lPR7Rv3lEf7pYQUmAcx8ABHgdZCQt/k= github.com/go-critic/go-critic v0.6.4/go.mod h1:qL5SOlk7NtY6sJPoVCTKDIgzNOxHkkkOCVDyi9wJe1U= github.com/go-critic/go-critic v0.6.5/go.mod h1:ezfP/Lh7MA6dBNn4c6ab5ALv3sKnZVLx37tr00uuaOY= -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-critic/go-critic v0.11.1 h1:/zBseUSUMytnRqxjlsYNbDDxpu3R2yH8oLXo/FOE8b8= +github.com/go-critic/go-critic v0.11.1/go.mod h1:aZVQR7+gazH6aDEQx4356SD7d8ez8MipYjXbEl5JAKA= 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= github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo= github.com/go-git/go-git/v5 v5.5.1/go.mod h1:uz5PQ3d0gz7mSgzZhSJToM6ALPaKCdSnl58/Xb5hzr8= github.com/go-git/go-git/v5 v5.5.2/go.mod h1:BE5hUJ5yaV2YMxhmaP4l6RBQ08kMxKSPD4BlxtH7OjI= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -1386,8 +1441,10 @@ github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= 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.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= 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= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -1408,10 +1465,13 @@ 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= @@ -1421,6 +1481,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= @@ -1434,8 +1495,9 @@ github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CY github.com/go-toolsmith/astequal v1.0.1/go.mod h1:4oGA3EZXTVItV/ipGiOx7NWkY5veFfcsOJVS2YxltLw= github.com/go-toolsmith/astequal v1.0.2/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= -github.com/go-toolsmith/astequal v1.1.0 h1:kHKm1AWqClYn15R0K1KKE4RG614D46n+nqUQ06E1dTw= github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= +github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0bI2+Cw= +github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY= github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= @@ -1449,6 +1511,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= @@ -1456,6 +1519,8 @@ github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2 github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= @@ -1469,6 +1534,7 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm 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= @@ -1509,8 +1575,9 @@ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGw 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= @@ -1549,8 +1616,9 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -1569,15 +1637,16 @@ github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TW github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 h1:amWTbTGqOZ71ruzrdA+Nx5WA3tV1N0goTspwmKCQvBY= github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2/go.mod h1:9wOXstvyDRshQ9LggQuzBCGysxs3b6Uo/1MvYCR2NMs= +github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= +github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ= github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng= 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.56.2 h1:dgQzlWHgNbCqJjuxRJhFEnHDVrrjuTGQHJ3RIZMpp/o= +github.com/golangci/golangci-lint v1.56.2/go.mod h1:7CfNO675+EY7j84jihO4iAqDQ80s3HCjcc5M6B7SlZQ= 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= @@ -1586,14 +1655,15 @@ github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29M github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/misspell v0.4.0 h1:KtVB/hTK4bbL/S6bs64rYyk8adjmh1BygbBiaAiX+a0= -github.com/golangci/misspell v0.4.0/go.mod h1:W6O/bwV6lGDxUCChm2ykw9NQdd5bYd1Xkjo88UcWyJc= +github.com/golangci/misspell v0.4.1 h1:+y73iSicVy2PqyX7kmUefHusENlrP9YwuHZHPLGQj/g= +github.com/golangci/misspell v0.4.1/go.mod h1:9mAN1quEo3DlpbaIKKyEvRxK1pwqR9s/Sea1bJCtlNI= github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2/go.mod h1:LK+zW4MpyytAWQRz0M4xnzEk50lSvqDQKfx304apFkY= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= +github.com/golangci/revgrep v0.5.2 h1:EndcWoRhcnfj2NHQ+28hyuXpLMF+dQmCN+YaeeIl4FU= +github.com/golangci/revgrep v0.5.2/go.mod h1:bjAMA+Sh/QUfTDcHzxfyHxr4xKvllVr/0sCv2e7jJHA= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -1622,8 +1692,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= @@ -1669,8 +1740,8 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJY github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 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 +1750,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.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.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 +1774,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= @@ -1717,8 +1790,8 @@ github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEo github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= -github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 h1:9alfqbrhuD+9fLZ4iaAVwhlp5PEhmnBt7yvK2Oy5C1U= -github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= +github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= +github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904= github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w= github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40= @@ -1730,8 +1803,9 @@ github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv 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= @@ -1764,8 +1838,9 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmg 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= @@ -1801,7 +1876,6 @@ github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOj github.com/hashicorp/consul/sdk v0.11.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 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= @@ -1827,7 +1901,6 @@ github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iP github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 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-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= @@ -1940,8 +2013,9 @@ github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0 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= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jgautheron/goconst v1.7.0 h1:cEqH+YBKLsECnRSd4F4TK5ri8t/aXtt/qoL0Ft252B0= +github.com/jgautheron/goconst v1.7.0/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= @@ -1952,12 +2026,15 @@ github.com/jhump/protoreflect v1.12.1-0.20220417024638-438db461d753/go.mod h1:Jy 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.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= 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= github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jjti/go-spancheck v0.5.2 h1:WXTZG3efY/ji1Vi8mkH+23O3bLeKR6hp3tI3YB7XwKk= +github.com/jjti/go-spancheck v0.5.2/go.mod h1:ARPNI1JRG1V2Rjnd6/2f2NEfghjSVDZGVmruNKlnXU0= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -2000,8 +2077,6 @@ 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= @@ -2011,12 +2086,13 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL 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= -github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM8= -github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= +github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= +github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= 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,13 +2110,15 @@ 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/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= 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/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= 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/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -2067,8 +2145,8 @@ github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= github.com/kunwardeep/paralleltest v1.0.3/go.mod h1:vLydzomDFpk7yu5UX02RmP0H8QfRPOV/oFhWN85Mjb4= github.com/kunwardeep/paralleltest v1.0.6/go.mod h1:Y0Y0XISdZM5IKm3TREQMZ6iteqn1YuwCsJO/0kL9Zes= -github.com/kunwardeep/paralleltest v1.0.7 h1:2uCk94js0+nVNQoHZNLBkAR1DQJrVzw6T0RMzJn55dQ= -github.com/kunwardeep/paralleltest v1.0.7/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= +github.com/kunwardeep/paralleltest v1.0.9 h1:3Sr2IfFNcsMmlqPk1cjTUbJ4zofKPGyHxenwPebgTug= +github.com/kunwardeep/paralleltest v1.0.9/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= @@ -2084,6 +2162,7 @@ github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5j 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,8 +2184,8 @@ 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.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= +github.com/linxGnu/grocksdb v1.8.12/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= @@ -2116,6 +2195,8 @@ github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc8 github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= +github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= github.com/magefile/mage v1.13.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -2170,8 +2251,9 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA 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= @@ -2200,8 +2282,8 @@ github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfp github.com/mgechev/revive v1.2.1/go.mod h1:+Ro3wqY4vakcYNtkBWdZC7dBg1xSB6sp054wWwmeFm0= github.com/mgechev/revive v1.2.3/go.mod h1:iAWlQishqCuj4yhV24FTnKSXGpbAA+0SckXB8GQMX/Q= github.com/mgechev/revive v1.2.4/go.mod h1:iAWlQishqCuj4yhV24FTnKSXGpbAA+0SckXB8GQMX/Q= -github.com/mgechev/revive v1.3.2 h1:Wb8NQKBaALBJ3xrrj4zpwJwqwNA6nDpyJSEQWcCka6U= -github.com/mgechev/revive v1.3.2/go.mod h1:UCLtc7o5vg5aXCwdUTU1kEBQ1v+YXPAkYDIDXbrs5I0= +github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= +github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -2320,7 +2402,6 @@ github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1t github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= -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= @@ -2329,13 +2410,13 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nishanths/exhaustive v0.7.11/go.mod h1:gX+MP7DWMKJmNa1HfMozK+u04hQd3na9i0hyqf3/dOI= github.com/nishanths/exhaustive v0.8.1/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg= github.com/nishanths/exhaustive v0.8.3/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg= -github.com/nishanths/exhaustive v0.11.0 h1:T3I8nUGhl/Cwu5Z2hfc92l0e04D2GEW6e0l8pzda2l0= -github.com/nishanths/exhaustive v0.11.0/go.mod h1:RqwDsZ1xY0dNdqHho2z6X+bgzizwbLYOWnZbbl2wLB4= +github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= +github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.12.1 h1:vwOqb5Nu05OikTXqhvLdHCGcx5uthIYIl0t79UVrERQ= -github.com/nunnatsa/ginkgolinter v0.12.1/go.mod h1:AK8Ab1PypVrcGUusuKD8RDcl2KgsIwvNaaxAlyHSzso= +github.com/nunnatsa/ginkgolinter v0.15.2 h1:N2ORxUxPU56R9gsfLIlVVvCv/V/VVou5qVI1oBKBNHg= +github.com/nunnatsa/ginkgolinter v0.15.2/go.mod h1:oYxE7dt1vZI8cK2rZOs3RgTaBN2vggkqnENmoJ8kVvc= 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= @@ -2367,7 +2448,8 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= 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.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= 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= @@ -2385,7 +2467,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= 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.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= 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= @@ -2411,8 +2494,9 @@ github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04s github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runc v1.1.1/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -2443,8 +2527,9 @@ github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= -github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= +github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= +github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= @@ -2467,8 +2552,8 @@ 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= @@ -2483,6 +2568,7 @@ github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG 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= @@ -2499,16 +2585,17 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ 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= github.com/polyfloyd/go-errorlint v1.0.0/go.mod h1:KZy4xxPJyy88/gldCe5OdW6OQRtNO3EZE7hXzmnebgA= github.com/polyfloyd/go-errorlint v1.0.2/go.mod h1:APVvOesVSAnne5SClsPxPdfvZTVDojXh1/G3qb5wjGI= github.com/polyfloyd/go-errorlint v1.0.5/go.mod h1:APVvOesVSAnne5SClsPxPdfvZTVDojXh1/G3qb5wjGI= -github.com/polyfloyd/go-errorlint v1.4.2 h1:CU+O4181IxFDdPH6t/HT7IiDj1I7zxNi1RIUxYwn8d0= -github.com/polyfloyd/go-errorlint v1.4.2/go.mod h1:k6fU/+fQe38ednoZS51T7gSIGQW1y94d6TkSr35OzH8= +github.com/polyfloyd/go-errorlint v1.4.8 h1:jiEjKDH33ouFktyez7sckv6pHWif9B7SuS8cutDXFHw= +github.com/polyfloyd/go-errorlint v1.4.8/go.mod h1:NNCxFcFjZcw3xNjVdCchERkEM6Oz7wta2XJVxRftwO4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= @@ -2539,8 +2626,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.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= 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 +2646,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.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= 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 +2664,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.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= +github.com/prometheus/procfs v0.11.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= 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= @@ -2587,8 +2675,8 @@ github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1 github.com/quasilyte/go-ruleguard v0.3.16-0.20220213074421-6aa060fab41a/go.mod h1:VMX+OnnSw4LicdiEGtRSD/1X8kW7GuEscjYNr4cOIT4= github.com/quasilyte/go-ruleguard v0.3.17/go.mod h1:sST5PvaR7yb/Az5ksX8oc88usJ4EGjmJv7cK7y3jyig= github.com/quasilyte/go-ruleguard v0.3.18/go.mod h1:lOIzcYlgxrQ2sGJ735EHXmf/e9MJ516j16K/Ifcttvs= -github.com/quasilyte/go-ruleguard v0.3.19 h1:tfMnabXle/HzOb5Xe9CUZYWXKfkS1KwRmZyPmD9nVcc= -github.com/quasilyte/go-ruleguard v0.3.19/go.mod h1:lHSn69Scl48I7Gt9cX3VrbsZYvYiBYszZOZW4A+oTEw= +github.com/quasilyte/go-ruleguard v0.4.0 h1:DyM6r+TKL+xbKB4Nm7Afd1IQh9kEUKQs2pboWGKtvQo= +github.com/quasilyte/go-ruleguard v0.4.0/go.mod h1:Eu76Z/R8IXtViWUIHkE3p8gdH3/PKk1eh3YGfaEof10= github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.16/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.19/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= @@ -2628,8 +2716,8 @@ github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= @@ -2640,8 +2728,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.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.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= @@ -2654,8 +2742,8 @@ github.com/ryancurrah/gomodguard v1.2.4/go.mod h1:+Kem4VjWwvFpUJRJSwa16s1tBJe+vb github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= -github.com/ryanrolds/sqlclosecheck v0.4.0 h1:i8SX60Rppc1wRuyQjMciLqIzV3xnoHB7/tXbr6RGYNI= -github.com/ryanrolds/sqlclosecheck v0.4.0/go.mod h1:TBRRjzL31JONc9i4XMinicuo+s+E8yKZ5FN8X3G6CKQ= +github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= +github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= @@ -2664,6 +2752,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.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +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= @@ -2675,8 +2767,8 @@ github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tM github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.13.0/go.mod h1:D2Wb7niIYmTB+gB8z7kh8tyP5ccof1dQ+SFk+WW5NtY= github.com/sashamelentyev/usestdlibvars v1.20.0/go.mod h1:0GaP+ecfZMXShS0A94CJn6aEuPRILv8h/VuWI9n1ygg= -github.com/sashamelentyev/usestdlibvars v1.23.0 h1:01h+/2Kd+NblNItNeux0veSL5cBF1jbEOPrEhDzGYq0= -github.com/sashamelentyev/usestdlibvars v1.23.0/go.mod h1:YPwr/Y1LATzHI93CqoPUN/2BzGQ/6N/cl/KwgR0B/aU= +github.com/sashamelentyev/usestdlibvars v1.25.0 h1:IK8SI2QyFzy/2OD2PYnhy84dpfNo9qADrRt6LH8vSzU= +github.com/sashamelentyev/usestdlibvars v1.25.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= @@ -2690,8 +2782,8 @@ github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+y github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME= github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= 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/securego/gosec/v2 v2.19.0 h1:gl5xMkOI0/E6Hxx0XCY2XujA3V7SNSefA8sC+3f1gnk= +github.com/securego/gosec/v2 v2.19.0/go.mod h1:hOkDcHz9J/XIgIlPDXalxjeVYsHxoWUc5zJSHxcB8YM= 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= @@ -2744,6 +2836,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,14 +2852,14 @@ 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.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= 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= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= @@ -2778,10 +2872,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,8 +2893,8 @@ 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.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= 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= @@ -2820,8 +2913,9 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 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= @@ -2839,15 +2933,15 @@ 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/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 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 +2955,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= @@ -2880,8 +2975,9 @@ github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpR github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= 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/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0= +github.com/tetafro/godot v1.4.16/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= 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= @@ -2892,10 +2988,11 @@ github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp1 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/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= +github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= 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= @@ -2914,8 +3011,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,6 +3029,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/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= 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/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= @@ -2942,6 +3040,7 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM 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.9/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= @@ -2949,11 +3048,13 @@ github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= +github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= +github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/ultraware/whitespace v0.1.0 h1:O1HKYoh0kIeqE8sFqZf1o0qbORXUCOQFrlaQyZsczZw= +github.com/ultraware/whitespace v0.1.0/go.mod h1:/se4r3beMFNmewJ4Xmz0nMQ941GJt+qmSHGP9emHYe0= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -2962,8 +3063,9 @@ github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX 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= github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= +github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= +github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= 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= @@ -2999,6 +3101,8 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= +github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= 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= @@ -3009,6 +3113,8 @@ github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsT 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/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= +github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= @@ -3031,15 +3137,23 @@ github.com/zondax/ledger-go v0.14.0/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2f github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= gitlab.com/bosi/decorder v0.2.1/go.mod h1:6C/nhLSbF6qZbYD8bRmISBwc6vcWdNsiIBkRvjJFrH0= -gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= +gitlab.com/bosi/decorder v0.4.1 h1:VdsdfxhstabyhZovHafFw+9eJ6eU0d2CkFNJcZz/NU4= +gitlab.com/bosi/decorder v0.4.1/go.mod h1:jecSqWUew6Yle1pCr2eLWTensJMmsxHsBwt+PVbkAqA= +go-simpler.org/assert v0.7.0 h1:OzWWZqfNxt8cLS+MlUp6Tgk1HjPkmgdKBq9qvy8lZsA= +go-simpler.org/assert v0.7.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= +go-simpler.org/musttag v0.8.0 h1:DR4UTgetNNhPRNo02rkK1hwDTRzAPotN+ZqYpdtEwWc= +go-simpler.org/musttag v0.8.0/go.mod h1:fiNdCkXt2S6je9Eblma3okjnlva9NT1Eg/WUt19rWu8= +go-simpler.org/sloglint v0.4.0 h1:UVJuUJo63iNQNFEOtZ6o1xAgagVg/giVLLvG9nNLobI= +go-simpler.org/sloglint v0.4.0/go.mod h1:v6zJ++j/thFPhefs2wEXoCKwT10yo5nkBDYRCXyqgNQ= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 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= @@ -3088,15 +3202,21 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.2 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0/go.mod h1:LsankqVDx4W+RhZNA5uWarULII/MBhF5qwCYxTuyXjs= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.3/go.mod h1:Dts42MGkzZne2yCru741+bFiTMWkIj/LLRizad7b9tw= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0/go.mod h1:vHItvsnJtp7ES++nFLLFBzUWny7fJQSvTlxFcqQGUr4= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0/go.mod h1:tLYsuf2v8fZreBVwp9gVMhefZlLFZaUiNVSq8QxXRII= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/exporters/jaeger v1.4.1/go.mod h1:ZW7vkOu9nC1CxsD8bHNHCia5JUbwP39vxgd1q4Z5rCI= go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= @@ -3111,10 +3231,14 @@ go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/on go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/metric v0.27.0/go.mod h1:raXDJ7uP2/Jc0nVZWQjJtzoyssOYWu/+pjZqRzfvZ7g= go.opentelemetry.io/otel/metric v0.32.3/go.mod h1:pgiGmKohxHyTPHGOff+vrtIH39/R9fiO/WoenUQ3kcc= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= @@ -3123,6 +3247,8 @@ go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+ go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= go.opentelemetry.io/proto/otlp v0.12.0/go.mod h1:TsIjwGWIx5VFYv9KGVlOpxoBl5Dy+63SUguV7GGvlSQ= @@ -3140,6 +3266,7 @@ 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.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= 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= @@ -3153,6 +3280,7 @@ 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 +3290,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= @@ -3208,7 +3337,6 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y 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,29 +3349,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/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= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= -golang.org/x/exp v0.0.0-20221019170559-20944726eadf/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -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/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= 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/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= @@ -3251,11 +3358,9 @@ golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl 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-20231219180239-dc181d75b848 h1:UhRVJ0i7bF9n/Hd8YjW3eKjlPVBHzbQdxrBgjbSKl64= +golang.org/x/exp/typeparams v0.0.0-20231219180239-dc181d75b848/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= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -3270,12 +3375,8 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -3288,8 +3389,9 @@ 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.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.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= @@ -3396,8 +3498,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.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= 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 +3535,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.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= 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 +3556,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -3472,7 +3574,6 @@ golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3495,7 +3596,6 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3641,8 +3741,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.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.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 +3759,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.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= 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,8 +3777,8 @@ 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= @@ -3690,6 +3791,8 @@ golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -3707,7 +3810,6 @@ golang.org/x/tools v0.0.0-20190228203856-589c23e65e65/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -3724,14 +3826,12 @@ golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -3754,7 +3854,6 @@ golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -3826,8 +3925,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.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= 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= @@ -3916,8 +4015,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.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA= +google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= 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 +4026,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= @@ -4078,12 +4178,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-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= 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 +4238,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.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= 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 +4260,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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.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= @@ -4227,7 +4327,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= @@ -4242,8 +4343,8 @@ honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 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= -honnef.co/go/tools v0.4.3/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= +honnef.co/go/tools v0.4.6 h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= +honnef.co/go/tools v0.4.6/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA= k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= @@ -4327,8 +4428,8 @@ modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= mvdan.cc/gofumpt v0.3.1/go.mod h1:w3ymliuxvzVx8DAutBnVyDqYb1Niy/yCJt/lk821YCE= mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= -mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= -mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= +mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= +mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= @@ -4337,8 +4438,8 @@ mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZI mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc= mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5/go.mod h1:b8RRCBm0eeiWR8cfN88xeq2G5SG3VKGO+5UPWi5FSOY= mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2YjFf5CaW0Bw4RL8RfbEf4GRggJk= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d h1:3rvTIIM22r9pvXk+q3swxUQAQOxksVMGK7sml4nG57w= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d/go.mod h1:IeHQjmn6TOD+e4Z3RFiZMMsLVL+A96Nvptar8Fj71is= +mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 h1:zCr3iRRgdk5eIikZNDphGcM6KGVTx3Yu+/Uu9Es254w= +mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14/go.mod h1:ZzZjEpJDOmx8TdVU6umamY3Xy0UAQUI2DHbf05USVbI= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= @@ -4346,8 +4447,9 @@ 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= @@ -4366,8 +4468,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/Dockerfile b/proto/Dockerfile new file mode 100644 index 000000000..f5eb9c7fb --- /dev/null +++ b/proto/Dockerfile @@ -0,0 +1,39 @@ +# This Dockerfile is used for proto generation +# To build, run `make proto-image-build` + +FROM bufbuild/buf:1.7.0 as BUILDER + +FROM golang:1.20-alpine + + +RUN apk add --no-cache \ + nodejs \ + npm \ + git \ + make + +ENV GOLANG_PROTOBUF_VERSION=1.28.0 \ + GOGO_PROTOBUF_VERSION=1.3.2 \ + GRPC_GATEWAY_VERSION=1.16.0 + + +RUN go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} +RUN go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \ + github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} + +# install all gogo protobuf binaries +RUN git clone https://github.com/regen-network/protobuf.git; \ + cd protobuf; \ + go mod download; \ + make install + +# we need to use git clone because we use 'replace' directive in go.mod +# protoc-gen-gocosmos was moved to to in cosmos/gogoproto but pending a migration there. +RUN git clone https://github.com/regen-network/cosmos-proto.git; \ + cd cosmos-proto/protoc-gen-gocosmos; \ + go install . + +RUN npm install -g swagger-combine + +COPY --from=BUILDER /usr/local/bin /usr/local/bin \ No newline at end of file diff --git a/proto/buf.lock b/proto/buf.lock index 78c5a2713..4dbbcc212 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -4,12 +4,20 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 954f7b05f38440fc8250134b15adec47 + digest: shake256:2ab4404fd04a7d1d52df0e2d0f2d477a3d83ffd88d876957bf3fedfd702c8e52833d65b3ce1d89a3c5adf2aab512616b0e4f51d8463f07eda9a8a3317ee3ac54 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba - remote: buf.build owner: googleapis repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 + commit: f0e53af8f2fc4556b94f482688b57223 + digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95 diff --git a/proto/buf.yaml b/proto/buf.yaml index e8b388892..95a9e8319 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -2,6 +2,7 @@ version: v1 name: buf.build/comdex-official/comdex deps: + - buf.build/cosmos/cosmos-sdk:v0.47.0 - buf.build/cosmos/cosmos-proto - buf.build/cosmos/gogo-proto - buf.build/googleapis/googleapis diff --git a/proto/comdex/asset/v1beta1/tx.proto b/proto/comdex/asset/v1beta1/tx.proto index 336f9ccc7..9ee22fc3b 100644 --- a/proto/comdex/asset/v1beta1/tx.proto +++ b/proto/comdex/asset/v1beta1/tx.proto @@ -3,6 +3,9 @@ package comdex.asset.v1beta1; import "gogoproto/gogo.proto"; import "comdex/asset/v1beta1/asset.proto"; +import "comdex/asset/v1beta1/params.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/comdex-official/comdex/x/asset/types"; option (gogoproto.goproto_getters_all) = false; @@ -11,6 +14,7 @@ option (gogoproto.goproto_getters_all) = false; service Msg { // AddAsset defines a method for adding new asset in asset module rpc AddAsset(MsgAddAsset) returns (MsgAddAssetResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgAddAsset defines an SDK message for adding new asset in asset module. @@ -19,4 +23,25 @@ message MsgAddAsset { Asset asset = 2 [(gogoproto.nullable) = false]; } -message MsgAddAssetResponse {} \ No newline at end of file +message MsgAddAssetResponse {} + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/asset parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index 16382ca10..f9c2c1a87 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -62,6 +62,17 @@ message QueryBidsResponse { [(gogoproto.moretags) = "yaml:\"pagination\""]; } +message QueryBidRequest { + uint64 bid_id = 1; +} + +message QueryBidResponse { + Bid bid = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"bid\"" + ]; +} + message QueryAuctionParamsRequest {} message QueryAuctionParamsResponse { @@ -203,6 +214,9 @@ service Query { rpc Bids(QueryBidsRequest) returns (QueryBidsResponse) { option (google.api.http).get = "/comdex/auctions/v2/bids/{bidder}/{bid_type}/{history}"; } + rpc Bid(QueryBidRequest) returns (QueryBidResponse) { + option (google.api.http).get = "/comdex/auctions/v2/bid/{bid_id}"; + } rpc AuctionParams(QueryAuctionParamsRequest) returns (QueryAuctionParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/auction_params"; } diff --git a/proto/comdex/collector/v1beta1/tx.proto b/proto/comdex/collector/v1beta1/tx.proto index 9e9c04dec..9ac881c09 100644 --- a/proto/comdex/collector/v1beta1/tx.proto +++ b/proto/comdex/collector/v1beta1/tx.proto @@ -9,6 +9,8 @@ option go_package = "github.com/comdex-official/comdex/x/collector/types"; // Msg defines the Msg service. service Msg { rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + rpc Refund(MsgRefund) returns (MsgRefundResponse); + rpc UpdateDebtParams(MsgUpdateDebtParams) returns (MsgUpdateDebtParamsResponse); } message MsgDeposit { @@ -18,3 +20,31 @@ message MsgDeposit { } message MsgDepositResponse {} + +message MsgRefund { + string addr = 1; +} + +message MsgRefundResponse {} + +message MsgUpdateDebtParams { + string addr = 1; + uint64 app_id = 2; + uint64 asset_id = 3; + uint64 slots = 4; + string debt_threshold = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"debt_threshold\""]; + string lot_size = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"lot_size\""]; + string debt_lot_size = 7 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"debt_lot_size\""]; + bool is_debt_auction = 8 [(gogoproto.moretags) = "yaml:\"is_debt_auction\""]; +} + +message MsgUpdateDebtParamsResponse {} diff --git a/proto/comdex/esm/v1beta1/tx.proto b/proto/comdex/esm/v1beta1/tx.proto index e2a4d14a7..ba61edd11 100644 --- a/proto/comdex/esm/v1beta1/tx.proto +++ b/proto/comdex/esm/v1beta1/tx.proto @@ -4,6 +4,10 @@ package comdex.esm.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "comdex/esm/v1beta1/esm.proto"; +import "comdex/esm/v1beta1/params.proto"; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/comdex-official/comdex/x/esm/types"; @@ -12,6 +16,7 @@ service Msg { rpc ExecuteESM(MsgExecuteESM) returns (MsgExecuteESMResponse); rpc MsgKillSwitch(MsgKillRequest) returns (MsgKillResponse); rpc MsgCollateralRedemption(MsgCollateralRedemptionRequest) returns (MsgCollateralRedemptionResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } message MsgDepositESM { @@ -40,4 +45,26 @@ message MsgCollateralRedemptionRequest { message MsgDepositESMResponse {} message MsgExecuteESMResponse {} message MsgKillResponse {} -message MsgCollateralRedemptionResponse{} \ No newline at end of file +message MsgCollateralRedemptionResponse{} + + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/esm parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto index 09b34c65a..140f460a9 100644 --- a/proto/comdex/liquidationsV2/v1beta1/tx.proto +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -3,6 +3,10 @@ package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "comdex/liquidationsV2/v1beta1/params.proto"; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; option (gogoproto.equal_all) = false; @@ -12,6 +16,7 @@ service Msg { rpc MsgLiquidateInternalKeeper(MsgLiquidateInternalKeeperRequest) returns (MsgLiquidateInternalKeeperResponse); rpc MsgAppReserveFunds(MsgAppReserveFundsRequest) returns (MsgAppReserveFundsResponse); rpc MsgLiquidateExternalKeeper(MsgLiquidateExternalKeeperRequest) returns (MsgLiquidateExternalKeeperResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } message MsgLiquidateInternalKeeperRequest { @@ -76,3 +81,24 @@ message MsgLiquidateExternalKeeperRequest { } message MsgLiquidateExternalKeeperResponse{} + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/liquidationsV2 parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/comdex/tokenmint/v1beta1/tx.proto b/proto/comdex/tokenmint/v1beta1/tx.proto index a158a75a8..e18e79310 100644 --- a/proto/comdex/tokenmint/v1beta1/tx.proto +++ b/proto/comdex/tokenmint/v1beta1/tx.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package comdex.tokenmint.v1beta1; import "gogoproto/gogo.proto"; - +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/comdex-official/comdex/x/tokenmint/types"; option (gogoproto.equal_all) = false; @@ -10,6 +10,7 @@ option (gogoproto.goproto_getters_all) = false; service Msg { rpc MsgMintNewTokens(MsgMintNewTokensRequest) returns (MsgMintNewTokensResponse); + rpc MsgBurnHarborTokens(MsgBurnHarborTokensRequest) returns (MsgBurnHarborTokensResponse); } //Will become governance proposal- will trigger token minting & sending message MsgMintNewTokensRequest { @@ -20,4 +21,13 @@ message MsgMintNewTokensRequest { (gogoproto.moretags) = "yaml:\"asset_id\"" ]; } -message MsgMintNewTokensResponse{} \ No newline at end of file +message MsgMintNewTokensResponse{} + +message MsgBurnHarborTokensRequest { + string from = 1 [ (gogoproto.moretags) = "yaml:\"from\"" ]; + uint64 app_id = 2 [(gogoproto.moretags) = "yaml:\"app_id\"", + (gogoproto.customname) = "AppId"]; + cosmos.base.v1beta1.Coin burn_coins = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} +message MsgBurnHarborTokensResponse{} \ No newline at end of file diff --git a/proto/comdex/vault/v1beta1/tx.proto b/proto/comdex/vault/v1beta1/tx.proto index c9cdca40f..84298e202 100644 --- a/proto/comdex/vault/v1beta1/tx.proto +++ b/proto/comdex/vault/v1beta1/tx.proto @@ -190,6 +190,13 @@ message MsgVaultInterestCalcRequest { message MsgVaultInterestCalcResponse{} +message MsgWithdrawStableMintControlRequest { + string from = 1 [ (gogoproto.moretags) = "yaml:\"from\"" ]; + uint64 app_id = 2 [(gogoproto.moretags) = "yaml:\"app_id\""]; +} + +message MsgWithdrawStableMintControlResponse{} + service Msg { rpc MsgCreate(MsgCreateRequest) returns (MsgCreateResponse); rpc MsgDeposit(MsgDepositRequest) returns (MsgDepositResponse); @@ -202,4 +209,5 @@ service Msg { rpc MsgDepositStableMint(MsgDepositStableMintRequest) returns (MsgDepositStableMintResponse); rpc MsgWithdrawStableMint(MsgWithdrawStableMintRequest) returns (MsgWithdrawStableMintResponse); rpc MsgVaultInterestCalc(MsgVaultInterestCalcRequest) returns (MsgVaultInterestCalcResponse); + rpc MsgWithdrawStableMintControl(MsgWithdrawStableMintControlRequest) returns (MsgWithdrawStableMintControlResponse); } diff --git a/proto/cosmos/base/query/v1beta1/pagination.proto b/proto/cosmos/base/query/v1beta1/pagination.proto deleted file mode 100644 index 2e906335a..000000000 --- a/proto/cosmos/base/query/v1beta1/pagination.proto +++ /dev/null @@ -1,54 +0,0 @@ -syntax = "proto3"; -package cosmos.base.query.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/types/query"; - -// PageRequest is to be embedded in gRPC request messages for efficient -// pagination. Ex: -// -// message SomeRequest { -// Foo some_parameter = 1; -// PageRequest pagination = 2; -// } -message PageRequest { - // key is a value returned in PageResponse.next_key to begin - // querying the next page most efficiently. Only one of offset or key - // should be set. - bytes key = 1; - - // offset is a numeric offset that can be used when key is unavailable. - // It is less efficient than using key. Only one of offset or key should - // be set. - uint64 offset = 2; - - // limit is the total number of results to be returned in the result page. - // If left empty it will default to a value to be set by each app. - uint64 limit = 3; - - // count_total is set to true to indicate that the result set should include - // a count of the total number of items available for pagination in UIs. - // count_total is only respected when offset is used. It is ignored when key - // is set. - bool count_total = 4; - - // reverse is set to true if results are to be returned in the descending - // order. - bool reverse = 5; -} - -// PageResponse is to be embedded in gRPC response messages where the -// corresponding request message has used PageRequest. -// -// message SomeResponse { -// repeated Bar results = 1; -// PageResponse page = 2; -// } -message PageResponse { - // next_key is the key to be passed to PageRequest.key to - // query the next page most efficiently - bytes next_key = 1; - - // total is total number of results available if PageRequest.count_total - // was set, its value is undefined otherwise - uint64 total = 2; -} diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto deleted file mode 100644 index fab75284b..000000000 --- a/proto/cosmos/base/v1beta1/coin.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; -package cosmos.base.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; - -// Coin defines a token with a denomination and an amount. -// -// NOTE: The amount field is an Int which implements the custom method -// signatures required by gogoproto. -message Coin { - option (gogoproto.equal) = true; - - string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// DecCoin defines a token with a denomination and a decimal amount. -// -// NOTE: The amount field is an Dec which implements the custom method -// signatures required by gogoproto. -message DecCoin { - option (gogoproto.equal) = true; - - string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} - -// IntProto defines a Protobuf wrapper around an Int object. -message IntProto { - string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// DecProto defines a Protobuf wrapper around a Dec object. -message DecProto { - string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} diff --git a/scripts/comdex_local_setup/constants.py b/scripts/comdex_local_setup/constants.py index 74d0aa7e3..cb70db99a 100644 --- a/scripts/comdex_local_setup/constants.py +++ b/scripts/comdex_local_setup/constants.py @@ -9,5 +9,5 @@ GENESIS_ACCOUNT_NAME = "cooluser" GENESIS_TOKENS = "1000000000000000000000stake,1000000000000000000000ucmst,100000000000000000000000000ucmdx,100000000000000000000000uosmo,100000000000000000000000000uatom,10000000000000000000000000000000000000000weth-wei,10000000000000000000000000000ucgold,1000000000000000000000000000usdc,1000000000000000000000000000ustatom,1000000000000000000000000000ustcmdx" -VOTING_PERIOD_IN_SEC = 10 -DEPOSIT_PERIOD_IN_SEC = 10 \ No newline at end of file +VOTING_PERIOD_IN_SEC = 20 +DEPOSIT_PERIOD_IN_SEC = 20 \ No newline at end of file diff --git a/scripts/comdex_local_setup/main.py b/scripts/comdex_local_setup/main.py index c81713bd9..b03ee4cac 100644 --- a/scripts/comdex_local_setup/main.py +++ b/scripts/comdex_local_setup/main.py @@ -29,12 +29,12 @@ def SetupNewChain(): with open(f"{HOME_DIR}/.comdex/config/genesis.json", "r") as jsonFile: data = json.load(jsonFile) - data["app_state"]["gov"]["deposit_params"]["min_deposit"][0]["denom"] = "ucmdx" - data["app_state"]["gov"]["deposit_params"]["max_deposit_period"] = str(DEPOSIT_PERIOD_IN_SEC)+"s" - data["app_state"]["gov"]["voting_params"]["voting_period"] = str(VOTING_PERIOD_IN_SEC)+"s" - data["app_state"]["gov"]["tally_params"]["quorum"] = "0" - data["app_state"]["gov"]["tally_params"]["threshold"] = "0" - data["app_state"]["gov"]["tally_params"]["veto_threshold"] = "0" + data["app_state"]["gov"]["params"]["min_deposit"][0]["denom"] = "ucmdx" + data["app_state"]["gov"]["params"]["max_deposit_period"] = str(DEPOSIT_PERIOD_IN_SEC)+"s" + data["app_state"]["gov"]["params"]["voting_period"] = str(VOTING_PERIOD_IN_SEC)+"s" + data["app_state"]["gov"]["params"]["quorum"] = "0" + data["app_state"]["gov"]["params"]["threshold"] = "0" + data["app_state"]["gov"]["params"]["veto_threshold"] = "0" with open(f"{HOME_DIR}/.comdex/config/genesis.json", "w") as jsonFile: json.dump(data, jsonFile) @@ -52,6 +52,7 @@ def SetupNewChain(): print("RPC configurations done ✔️") lcdConfig = toml.load(f"{HOME_DIR}/.comdex/config/app.toml") + lcdConfig["minimum-gas-prices"]="0ucmdx" lcdConfig["api"]["enable"]=True lcdConfig["api"]["enabled-unsafe-cors"]= True @@ -88,20 +89,23 @@ def GetGenesisAccAddress(): def Vote(option): if option not in ["yes", "no"]: exit("Invalid voting option") + time.sleep(6) latestPropID = GetLatestPropID() command = f"comdex tx gov vote {latestPropID} {option} --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit(f"error while voting on prop {latestPropID}") + time.sleep(6) print(f"Vote submitted on Prop {latestPropID} ✔️") def AddApp(name, shortName, minGovDeposit=0, govTimeInSeconds=0): - command = f"""comdex tx gov submit-proposal add-app {name} {shortName} {minGovDeposit} {govTimeInSeconds} --title "New App" --description "Adding new app on comdex" --deposit 10000000ucmdx --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" + command = f"""comdex tx gov submit-legacy-proposal add-app {name} {shortName} {minGovDeposit} {govTimeInSeconds} --title "New App" --description "Adding new app on comdex" --deposit 10000000ucmdx --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: + if "code: 0" in output: + print("success") + else: print(output) exit("error in add app prop") print(f"New App {name} Proposal Submitted ✔️") @@ -122,10 +126,11 @@ def AddAsset(name, denom, decimals=1, isOnChain=1, assetOraclePriceRequired=1, i with open(fileName, "w") as jsonFile: json.dump(jsonData, jsonFile) - command = f"""comdex tx gov submit-proposal add-assets --add-assets-file "{fileName}" --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" + command = f"""comdex tx gov submit-legacy-proposal add-assets --add-assets-file "{fileName}" --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y --gas 303942""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: + if "code: 0" in output: + print("success") + else: print(output) exit("error in add asset prop") if os.path.exists(fileName): @@ -133,10 +138,11 @@ def AddAsset(name, denom, decimals=1, isOnChain=1, assetOraclePriceRequired=1, i print(f"New Asset {name} Proposal Submitted ✔️") def AddPair(assetID1, assetID2): - command = f"""comdex tx gov submit-proposal add-pairs {assetID1} {assetID2} --title "New Pair" --description "Adding new pair" --deposit 10000000ucmdx --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" + command = f"""comdex tx gov submit-legacy-proposal add-pairs {assetID1} {assetID2} --title "New Pair" --description "Adding new pair" --deposit 10000000ucmdx --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: + if "code: 0" in output: + print("success") + else: print(output) exit("error in add pairs prop") print(f"New Pair ({assetID1}, {assetID2}) Proposal Submitted ✔️") @@ -145,8 +151,9 @@ def MintToken(appID, assetID): print("Minting token for previosly added asset in app..") command = f"comdex tx tokenmint tokenmint {appID} {assetID} --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: + if "code: 0" in output: + print("success") + else: print(output) exit("error whle minting tokens") print(f"Token Minting Done For AssetID {assetID} in App {appID} ✔️") @@ -166,11 +173,11 @@ def AddAssetInAppsAndVote(appID, assetID): with open(fileName, "w") as jsonFile: json.dump(jsonData, jsonFile) - command = f"""comdex tx gov submit-proposal add-asset-in-app --add-asset-mapping-file "{fileName}" --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" + command = f"""comdex tx gov submit-legacy-proposal add-asset-in-app --add-asset-mapping-file "{fileName}" --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit("error in add asset in app prop") print(f"New Add Asset In App (appID - {appID}, assetID - {assetID}) Proposal Submitted ✔️") if os.path.exists(fileName): @@ -181,20 +188,20 @@ def AddAssetInAppsAndVote(appID, assetID): MintToken(appID, assetID) def CreateLiquidityPair(appID, baseCoinDenom, quoteCoinDenom): - command = f"""comdex tx gov submit-proposal create-liquidity-pair {appID} {baseCoinDenom} {quoteCoinDenom} --title "New Liquidity Pair" --description "Adding new liquidity pair" --deposit 10000000ucmdx --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" + command = f"""comdex tx gov submit-legacy-proposal create-liquidity-pair {appID} {baseCoinDenom} {quoteCoinDenom} --title "New Liquidity Pair" --description "Adding new liquidity pair" --deposit 10000000ucmdx --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit("error in add pairs prop") print(f"New Liquidity Pair ({baseCoinDenom}, {quoteCoinDenom}) Proposal Submitted ✔️") def CreateLiquidityPool(appID, pairID, depositCoins): command = f"comdex tx liquidity create-pool {appID} {pairID} {depositCoins} --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit("error in create pool") print(f"New liquidity pool created for pairID {pairID} in app {appID} with initial deposit of {depositCoins} ✔️") @@ -213,7 +220,7 @@ def StoreAndIntantiateWasmContract(): for index, contractData in enumerate(WASM_CONTRACTS): print(f"fetching test {contractData['name']} ....") wget.download(contractData['contractLink'], contractData['contractPath']) - + time.sleep(6) command = f"comdex tx wasm store {contractData['contractPath']} --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --gas-adjustment 1.3 --keyring-backend test -y --output json" output = subprocess.getstatusoutput(command)[1] output = json.loads(output) @@ -225,14 +232,16 @@ def StoreAndIntantiateWasmContract(): for keys in contractData['formatKeys']: contractData['initator'][keys] = contractAddresses[keys] + time.sleep(6) currentCodeID = GetLastContractCodeID() - command = f"""comdex tx wasm instantiate {currentCodeID} '{json.dumps(contractData['initator'])}' --label "Instantiate {contractData['name']}" --no-admin --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --gas-adjustment 1.3 --keyring-backend test -y""" + command = f"""comdex tx wasm instantiate {currentCodeID} '{json.dumps(contractData['initator'])}' --label "Instantiate {contractData['name']}" --no-admin --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --gas-adjustment 1.3 --keyring-backend test -y --output json""" output = subprocess.getstatusoutput(command)[1] output = json.loads(output) if int(output["code"]) != 0: print(output) exit(f"error in instantiating {contractData['name']}") print(f"{contractData['name']} instantiated successfully ✔️") + time.sleep(6) contractAddresses[contractData['contractAddressKey']] = GetContractAddress(currentCodeID) if os.path.exists(contractData['contractPath']): os.remove(contractData['contractPath']) @@ -246,7 +255,7 @@ def ExecuteWasmGovernanceProposal(contractAddress, proposalID): "proposal_id":proposalID } } - command = f"""comdex tx wasm execute {contractAddress} '{json.dumps(execute)}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y""" + command = f"""comdex tx wasm execute {contractAddress} '{json.dumps(execute)}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y --output json""" output = subprocess.getstatusoutput(command)[1] output = json.loads(output) if int(output["code"]) != 0: @@ -255,7 +264,7 @@ def ExecuteWasmGovernanceProposal(contractAddress, proposalID): print(f"Proposal with ID {proposalID} executed successfully ✔️") def ProposeWasmProposal(contractAddress, proposal, proposlID): - command = f"""comdex tx wasm execute {contractAddress} '{json.dumps(proposal)}' --amount 100000000uharbor --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y""" + command = f"""comdex tx wasm execute {contractAddress} '{json.dumps(proposal)}' --amount 100000000uharbor --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y --output json""" output = subprocess.getstatusoutput(command)[1] output = json.loads(output) if int(output["code"]) != 0: @@ -268,11 +277,11 @@ def AddAssetRates(assetName, jsonData): with open(fileName, "w") as jsonFile: json.dump(jsonData, jsonFile) - command = f"""comdex tx gov submit-proposal add-asset-rates-params --add-asset-rates-params-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 5000000 -y""" + command = f"""comdex tx gov submit-legacy-proposal add-asset-rates-params --add-asset-rates-params-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 9000000 -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit("error in add asset rate prop") if os.path.exists(fileName): os.remove(fileName) @@ -283,11 +292,11 @@ def AddLendPool(jsonData): with open(fileName, "w") as jsonFile: json.dump(jsonData, jsonFile) - command = f"""comdex tx gov submit-proposal add-lend-pool --add-lend-pool-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 5000000 -y""" + command = f"""comdex tx gov submit-legacy-proposal add-lend-pool --add-lend-pool-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 9000000 -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit("error in add lend pool prop") if os.path.exists(fileName): os.remove(fileName) @@ -298,22 +307,22 @@ def AddLendPair(pairString, jsonData): with open(fileName, "w") as jsonFile: json.dump(jsonData, jsonFile) - command = f"""comdex tx gov submit-proposal add-lend-pairs --add-lend-pair-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 5000000 -y""" + command = f"""comdex tx gov submit-legacy-proposal add-lend-pairs --add-lend-pair-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 5000000 -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit("error in add lend pair prop") if os.path.exists(fileName): os.remove(fileName) print(f"Proposal For - Add Lend Pair {pairString} Submitted ✔️") def AddLendAssetPairMapping(assetID, poolID, pairIDs): - command = f"""comdex tx gov submit-proposal add-asset-to-pair-mapping {assetID} {poolID} {','.join([str(i) for i in pairIDs])} --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --title "Lend Asset Pair Mapping" --description "Adding New Lend Asset To Pair Mapping" --deposit 100000000ucmdx --keyring-backend test -y""" + command = f"""comdex tx gov submit-legacy-proposal add-asset-to-pair-mapping {assetID} {poolID} {','.join([str(i) for i in pairIDs])} --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --title "Lend Asset Pair Mapping" --description "Adding New Lend Asset To Pair Mapping" --deposit 100000000ucmdx --keyring-backend test -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit("error in add lend asset pair mapping prop") print(f"Proposal For - Add Lend Asset Pair Mapping assetID-{assetID}, poolID-{poolID}, pairIDs-{pairIDs} Submitted ✔️") @@ -335,11 +344,11 @@ def AddLendAuctionParamsAndVote(): with open(fileName, "w") as jsonFile: json.dump(jsonData, jsonFile) - command = f"""comdex tx gov submit-proposal add-auction-params --add-auction-params-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 5000000 -y""" + command = f"""comdex tx gov submit-legacy-proposal add-auction-params --add-auction-params-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 5000000 -y""" output = subprocess.getstatusoutput(command)[1] - output = json.loads(output) - if int(output["code"]) != 0: - print(output) + if "code: 0" in output: + print("success") + else: exit("error in add lend auction params prop") if os.path.exists(fileName): os.remove(fileName) @@ -366,42 +375,35 @@ def CreateState(): Vote("yes") AddAssetInAppsAndVote(1, 9) - contractAddresses = StoreAndIntantiateWasmContract() - for wasmProp in WASM_PROPOSALS: - contractAddress = contractAddresses[wasmProp['contractAddressKey']] - ProposeWasmProposal(contractAddress, wasmProp['content'], wasmProp['proposalID']) - print(f"waiting for wasm prop {wasmProp['proposalID']}") - if wasmProp['isProposal']: - time.sleep(APPS[0][3]) # waiting for proposal duration - ExecuteWasmGovernanceProposal(contractAddress, wasmProp['proposalID']) + time.sleep(6) for liquidityPair in LIQUIDITY_PAIRS: if len(liquidityPair) != 3: exit("Invalid liquidity pair configs") CreateLiquidityPair(liquidityPair[0], liquidityPair[1], liquidityPair[2]) Vote("yes") - + time.sleep(20) for liquidityPool in LIQUIDITY_POOLS: if len(liquidityPool) != 3: exit("Invalid liquidity pool configs") CreateLiquidityPool(liquidityPool[0], liquidityPool[1], liquidityPool[2]) - + time.sleep(20) for assetRate in ADD_ASSET_RATES: if len(assetRate) != 2: exit("Invalid add asset rate configs") AddAssetRates(assetRate[0], assetRate[1]) Vote("yes") - + time.sleep(20) for lenPoolData in ADD_LEND_POOL: AddLendPool(lenPoolData) Vote("yes") - + time.sleep(20) for lendPair in ADD_LEND_PAIR: if len(lendPair) != 2: exit("Invalid lend pair configs") AddLendPair(lendPair[0], lendPair[1]) Vote("yes") - + time.sleep(20) for lenAssetPairMap in LEND_ASSET_PAIR_MAPPING: if len(lenAssetPairMap) != 3: exit("Invalid lend asset pair map configs") @@ -410,7 +412,86 @@ def CreateState(): AddLendAuctionParamsAndVote() + contractAddresses = StoreAndIntantiateWasmContract() + for wasmProp in WASM_PROPOSALS: + time.sleep(10) + contractAddress = contractAddresses[wasmProp['contractAddressKey']] + ProposeWasmProposal(contractAddress, wasmProp['content'], wasmProp['proposalID']) + print(f"waiting for wasm prop {wasmProp['proposalID']}") + if wasmProp['isProposal']: + time.sleep(20) # waiting for proposal duration + ExecuteWasmGovernanceProposal(contractAddress, wasmProp['proposalID']) +def limitOrderHelper(fromAcc, appID, pairID, direction, offerCoin, demandCoinDenom, price, amount): + print(fromAcc) + command = f"comdex tx liquidity limit-order {appID} {pairID} {direction} {offerCoin} {demandCoinDenom} {price} {amount} --from {fromAcc} --chain-id test-3 --node https://dev3.rpc.comdex.one:443 --fees 1000000ucmdx --keyring-backend test --output json -y" + output = subprocess.getstatusoutput(command)[1] + print(output) + try: + output = json.loads(output) + except Exception as e: + exit(f"{fromAcc} - error while limit order... {output}") + if int(output["code"]) != 0: + print(fromAcc, " - ", output["raw_log"]) + else: + print(f"limit order placed successfully : from - {fromAcc}, appID - {appID}, pairID - {pairID}, -direction - {direction}, -offerCoin {offerCoin}, -demandCoinDenom {demandCoinDenom}, price {price}, amount {amount} ✔️") + +def thread( + fromAcc, + appID, + pairID, + direction, + offerCoin, + demandCoinDenom, + price, + amount, +): + + start = datetime.datetime.now() + limitOrderHelper(fromAcc, appID, pairID, direction, offerCoin, demandCoinDenom, price, amount) + end = datetime.datetime.now() + print("time taken - ", (end-start).seconds, "s") + +def limitOrder(): + chunks = [ + { + "fromAcc" : "hotuser", + "appID" : 2, + "pairID" : 1, + "direction" : "sell", + "offerCoin" : "20000000ucmdx", + "demandCoinDenom" : "uharbor", + "price" : 2, + "amount" : 10000000 + }, + { + "fromAcc" : "cooluser", + "appID" : 2, + "pairID" : 1, + "direction" : "sell", + "offerCoin" : "20000000ucmdx", + "demandCoinDenom" : "uharbor", + "price" : 2, + "amount" : 10000000 + }, + { + "fromAcc" : "chilluser", + "appID" : 2, + "pairID" : 1, + "direction" : "sell", + "offerCoin" : "20000000ucmdx", + "demandCoinDenom" : "uharbor", + "price" : 2, + "amount" : 10000000 + } + ] + threads = [] + for data in chunks: + threads.append(threading.Thread(target=thread, args=(data["fromAcc"], data["appID"], data["pairID"], data["direction"], data["offerCoin"], data["demandCoinDenom"], data["price"], data["amount"]))) + for t in threads: + t.start() + for t in threads: + t.join() def main(): if not os.path.exists(HOME_DIR): @@ -422,6 +503,13 @@ def main(): thr.start() StartChainIndicator() CreateState() - print("Press Ctr+C to stop the chain") + # while True: + # try: + # limitOrder() + # time.sleep(3) # Replace with your actual task or wait logic + # except KeyboardInterrupt: + # print("Keyboard interrupt received. Exiting...") + # break + # print("Press Ctr+C to stop the chain") main() \ No newline at end of file diff --git a/scripts/comdex_local_setup/states.py b/scripts/comdex_local_setup/states.py index 54d0ebcfa..01c09b66b 100644 --- a/scripts/comdex_local_setup/states.py +++ b/scripts/comdex_local_setup/states.py @@ -2,7 +2,7 @@ APPS = [ # [name, shortName, minGovDeposit, govTimeInSeconds] - ["harbor", "hbr", 1000000, 5], # ID - 1 + ["harbor", "hbr", 1000000, 10], # ID - 1 ["cswap", "cswap", 0, 0], # ID - 2 ["commodo", "comdo", 0, 0], # ID - 3 ] @@ -789,4 +789,4 @@ }, }, -] +] \ No newline at end of file diff --git a/scripts/proto-gen.sh b/scripts/proto-gen.sh index e689bba3c..c95cd046a 100755 --- a/scripts/proto-gen.sh +++ b/scripts/proto-gen.sh @@ -4,25 +4,29 @@ # docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools" # docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh -set -e +set -e pipefail echo "Generating gogo proto code" cd proto -proto_dirs=$(find ./comdex -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) -for dir in $proto_dirs; do - for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do - # this regex checks if a proto file has its go_package set to cosmossdk.io/api/... - # gogo proto files SHOULD ONLY be generated if this is false - # we don't want gogo proto to run for proto files which are natively built for google.golang.org/protobuf - if grep -q "option go_package" "$file" && grep -H -o -c 'option go_package.*cosmossdk.io/api' "$file" | grep -q ':0$'; then - buf generate --template buf.gen.gogo.yaml $file - fi - done -done - +buf mod update cd .. +buf generate +# cd proto +# proto_dirs=$(find ./comdex -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +# for dir in $proto_dirs; do +# for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do +# # this regex checks if a proto file has its go_package set to cosmossdk.io/api/... +# # gogo proto files SHOULD ONLY be generated if this is false +# # we don't want gogo proto to run for proto files which are natively built for google.golang.org/protobuf +# if grep -q "option go_package" "$file" && grep -H -o -c 'option go_package.*cosmossdk.io/api' "$file" | grep -q ':0$'; then +# buf generate --template buf.gen.gogo.yaml $file +# fi +# done +# done + +# cd .. # move proto files to the right places -cp -r github.com/comdex-official/comdex/* ./ -rm -rf github.com -go mod tidy \ No newline at end of file +cp -r ./github.com/comdex-official/comdex/x/* x/ +rm -rf ./github.com +# go mod tidy \ No newline at end of file diff --git a/testutil/keeper/auction.go b/testutil/keeper/auction.go deleted file mode 100644 index 6a9cff2d5..000000000 --- a/testutil/keeper/auction.go +++ /dev/null @@ -1,48 +0,0 @@ -package keeper - -// -//import ( -// "testing" -// -// "github.com/comdex-official/comdex/x/auction/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" -// 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" -// tmproto "github.com/cometbft/cometbft/proto/tendermint/types" -// tmdb "github.com/cometbft/cometbft-db" -//) -// -//func AuctionKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { -// storeKey := sdk.NewKVStoreKey(types.StoreKey) -// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) -// -// db := tmdb.NewMemDB() -// stateStore := store.NewCommitMultiStore(db) -// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) -// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) -// require.NoError(t, stateStore.LoadLatestVersion()) -// -// registry := codectypes.NewInterfaceRegistry() -// cdc := codec.NewProtoCodec(registry) -// -// paramsSubspace := typesparams.NewSubspace(cdc, -// types.Amino, -// storeKey, -// memStoreKey, -// "AuctionParams", -// ) -// k := keeper.NewKeeper() -// -// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) -// -// // Initialize params -// k.SetParams(ctx, types.DefaultParams()) -// -// return k, ctx -//} diff --git a/testutil/keeper/auctionsV2.go b/testutil/keeper/auctionsV2.go deleted file mode 100644 index 0c79fe841..000000000 --- a/testutil/keeper/auctionsV2.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -//import ( -// "testing" -// -// "github.com/comdex-official/comdex/x/auctions/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" -// 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" -// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -// tmdb "github.com/tendermint/tm-db" -//) -// -//func NewaucKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { -// storeKey := sdk.NewKVStoreKey(types.StoreKey) -// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) -// -// db := tmdb.NewMemDB() -// stateStore := store.NewCommitMultiStore(db) -// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) -// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) -// require.NoError(t, stateStore.LoadLatestVersion()) -// -// registry := codectypes.NewInterfaceRegistry() -// cdc := codec.NewProtoCodec(registry) -// -// paramsSubspace := typesparams.NewSubspace(cdc, -// types.Amino, -// storeKey, -// memStoreKey, -// "NewaucParams", -// ) -// k := keeper.NewKeeper( -// cdc, -// storeKey, -// memStoreKey, -// paramsSubspace, -// nil, -// ) -// -// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) -// -// // Initialize params -// k.SetParams(ctx, types.DefaultParams()) -// -// return k, ctx -//} diff --git a/testutil/keeper/collector.go b/testutil/keeper/collector.go deleted file mode 100644 index a747fc400..000000000 --- a/testutil/keeper/collector.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -// -//import ( -// "testing" -// -// "github.com/comdex-official/comdex/x/collector/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" -// 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" -// tmproto "github.com/cometbft/cometbft/proto/tendermint/types" -// tmdb "github.com/cometbft/cometbft-db" -//) -// -//func CollectorKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { -// storeKey := sdk.NewKVStoreKey(types.StoreKey) -// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) -// -// db := tmdb.NewMemDB() -// stateStore := store.NewCommitMultiStore(db) -// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) -// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) -// require.NoError(t, stateStore.LoadLatestVersion()) -// -// registry := codectypes.NewInterfaceRegistry() -// cdc := codec.NewProtoCodec(registry) -// -// paramsSubspace := typesparams.NewSubspace(cdc, -// types.Amino, -// storeKey, -// memStoreKey, -// "CollectorParams", -// ) -// k := keeper.NewKeeper( -// cdc, -// storeKey, -// memStoreKey, -// paramsSubspace, -// ) -// -// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) -// -// // Initialize params -// k.SetParams(ctx, types.DefaultParams()) -// -// return k, ctx -//} diff --git a/testutil/keeper/esm.go b/testutil/keeper/esm.go deleted file mode 100644 index 2811be96c..000000000 --- a/testutil/keeper/esm.go +++ /dev/null @@ -1,52 +0,0 @@ -package keeper - -// import ( -// "testing" - -// "github.com/comdex-official/comdex/x/esm/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" -// 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" -// tmproto "github.com/cometbft/cometbft/proto/tendermint/types" -// tmdb "github.com/cometbft/cometbft-db" -// ) - -// func EsmKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { -// storeKey := sdk.NewKVStoreKey(types.StoreKey) -// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - -// db := tmdb.NewMemDB() -// stateStore := store.NewCommitMultiStore(db) -// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) -// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) -// require.NoError(t, stateStore.LoadLatestVersion()) - -// registry := codectypes.NewInterfaceRegistry() -// cdc := codec.NewProtoCodec(registry) - -// paramsSubspace := typesparams.NewSubspace(cdc, -// types.Amino, -// storeKey, -// memStoreKey, -// "EsmParams", -// ) -// k := keeper.NewKeeper( -// cdc, -// storeKey, -// memStoreKey, -// paramsSubspace, -// ) - -// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - -// // Initialize params -// k.SetParams(ctx, types.DefaultParams()) - -// return k, ctx -// } diff --git a/testutil/keeper/liquidationsV2.go b/testutil/keeper/liquidationsV2.go deleted file mode 100644 index 10a0a0be9..000000000 --- a/testutil/keeper/liquidationsV2.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -//import ( -// "testing" -// -// "github.com/comdex-official/comdex/x/liquidationsV2/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" -// 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" -// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -// tmdb "github.com/tendermint/tm-db" -//) -// -//func NewliqKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { -// storeKey := sdk.NewKVStoreKey(types.StoreKey) -// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) -// -// db := tmdb.NewMemDB() -// stateStore := store.NewCommitMultiStore(db) -// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) -// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) -// require.NoError(t, stateStore.LoadLatestVersion()) -// -// registry := codectypes.NewInterfaceRegistry() -// cdc := codec.NewProtoCodec(registry) -// -// paramsSubspace := typesparams.NewSubspace(cdc, -// types.Amino, -// storeKey, -// memStoreKey, -// "NewliqParams", -// ) -// k := keeper.NewKeeper( -// cdc, -// storeKey, -// memStoreKey, -// paramsSubspace, -// nil, -// ) -// -// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) -// -// // Initialize params -// k.SetParams(ctx, types.DefaultParams()) -// -// return k, ctx -//} diff --git a/testutil/keeper/rewards.go b/testutil/keeper/rewards.go deleted file mode 100644 index fc3981541..000000000 --- a/testutil/keeper/rewards.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -// -//import ( -// "testing" -// -// "github.com/comdex-official/comdex/x/rewards/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" -// 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" -// tmproto "github.com/cometbft/cometbft/proto/tendermint/types" -// tmdb "github.com/cometbft/cometbft-db" -//) -// -//func RewardsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { -// storeKey := sdk.NewKVStoreKey(types.StoreKey) -// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) -// -// db := tmdb.NewMemDB() -// stateStore := store.NewCommitMultiStore(db) -// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) -// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) -// require.NoError(t, stateStore.LoadLatestVersion()) -// -// registry := codectypes.NewInterfaceRegistry() -// cdc := codec.NewProtoCodec(registry) -// -// paramsSubspace := typesparams.NewSubspace(cdc, -// types.Amino, -// storeKey, -// memStoreKey, -// "RewardsParams", -// ) -// k := keeper.NewKeeper( -// cdc, -// storeKey, -// memStoreKey, -// paramsSubspace, -// ) -// -// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) -// -// // Initialize params -// k.SetParams(ctx, types.DefaultParams()) -// -// return k, ctx -//} diff --git a/testutil/keeper/tokenmint.go b/testutil/keeper/tokenmint.go deleted file mode 100644 index 77fe7eb9e..000000000 --- a/testutil/keeper/tokenmint.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -// -//import ( -// "testing" -// -// "github.com/comdex-official/comdex/x/tokenmint/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" -// 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" -// tmproto "github.com/cometbft/cometbft/proto/tendermint/types" -// tmdb "github.com/cometbft/cometbft-db" -//) -// -//func TokenmintKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { -// storeKey := sdk.NewKVStoreKey(types.StoreKey) -// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) -// -// db := tmdb.NewMemDB() -// stateStore := store.NewCommitMultiStore(db) -// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) -// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) -// require.NoError(t, stateStore.LoadLatestVersion()) -// -// registry := codectypes.NewInterfaceRegistry() -// cdc := codec.NewProtoCodec(registry) -// -// paramsSubspace := typesparams.NewSubspace(cdc, -// types.Amino, -// storeKey, -// memStoreKey, -// "TokenmintParams", -// ) -// k := keeper.NewKeeper( -// cdc, -// storeKey, -// memStoreKey, -// paramsSubspace, -// ) -// -// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) -// -// // Initialize params -// k.SetParams(ctx, types.DefaultParams()) -// -// return k, ctx -//} diff --git a/testutil/network/network.go b/testutil/network/network.go index cc2897844..d8d05a80b 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -58,7 +58,6 @@ func DefaultConfig() network.Config { val.GetCtx().Logger, tmdb.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), diff --git a/testutil/simapp/simapp.go b/testutil/simapp/simapp.go index c96425a12..a5429921d 100644 --- a/testutil/simapp/simapp.go +++ b/testutil/simapp/simapp.go @@ -22,7 +22,7 @@ func New(dir string) *comdex.App { ) 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{ ConsensusParams: defaultConsensusParams, diff --git a/types/utils.go b/types/utils.go index 777c06daa..05dafabf8 100644 --- a/types/utils.go +++ b/types/utils.go @@ -180,9 +180,6 @@ func GenAndDeliverTxWithFees(txCtx simulation.OperationInput, gas uint64, fees s return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "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 GenAndDeliverTx(txCtx, fees, gas) } diff --git a/x/asset/abci.go b/x/asset/abci.go index a856ae6f0..79965365a 100644 --- a/x/asset/abci.go +++ b/x/asset/abci.go @@ -8,7 +8,7 @@ import ( "github.com/comdex-official/comdex/x/asset/keeper" ) -func BeginBlocker(ctx sdk.Context, _ abci.RequestBeginBlock, k keeper.Keeper) { +func BeginBlocker(ctx sdk.Context, _ abci.RequestBeginBlock, _ keeper.Keeper) { _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { return nil }) diff --git a/x/asset/expected/keeper.go b/x/asset/expected/keeper.go index f076f11b8..f13cf170c 100644 --- a/x/asset/expected/keeper.go +++ b/x/asset/expected/keeper.go @@ -1,11 +1,11 @@ package expected import ( - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - + sdkmath "cosmossdk.io/math" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" vaulttypes "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 { @@ -22,7 +22,7 @@ type BankKeeper interface { 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 sdk.Dec, 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..a9011cb88 100644 --- a/x/asset/handler.go +++ b/x/asset/handler.go @@ -2,14 +2,13 @@ package asset //goland:noinspection GoLinter import ( + errorsmod "cosmossdk.io/errors" "fmt" - + "github.com/comdex-official/comdex/x/asset/keeper" + "github.com/comdex-official/comdex/x/asset/types" 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" - - "github.com/comdex-official/comdex/x/asset/keeper" - "github.com/comdex-official/comdex/x/asset/types" ) // NewHandler ... @@ -25,7 +24,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 +54,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/asset.go b/x/asset/keeper/asset.go index befc6ffcb..9f05cb3e7 100644 --- a/x/asset/keeper/asset.go +++ b/x/asset/keeper/asset.go @@ -1,13 +1,11 @@ package keeper import ( - "regexp" - + errorsmod "cosmossdk.io/errors" + "github.com/comdex-official/comdex/x/asset/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" + "regexp" ) func (k Keeper) SetAssetID(ctx sdk.Context, id uint64) { @@ -235,7 +233,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) diff --git a/x/asset/keeper/asset_test.go b/x/asset/keeper/asset_test.go index 61d1d14fa..dc56380dd 100644 --- a/x/asset/keeper/asset_test.go +++ b/x/asset/keeper/asset_test.go @@ -36,16 +36,16 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, { - 2, - sdk.ZeroInt(), - true, - userAddress1, + AssetId: 2, + GenesisSupply: sdk.ZeroInt(), + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -61,10 +61,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -80,10 +80,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -99,10 +99,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -118,10 +118,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -137,10 +137,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -156,10 +156,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -175,10 +175,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -194,10 +194,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -213,10 +213,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 0, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - false, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: false, + Recipient: userAddress1, }, }, }, @@ -232,10 +232,10 @@ func (s *KeeperTestSuite) TestAddApp() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 3, - genesisSupply, - true, - userAddress1, + AssetId: 3, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -273,10 +273,6 @@ func (s *KeeperTestSuite) TestAddApp() { s.Require().Equal(res.App.MinGovDeposit, tc.msg.MinGovDeposit) err = assetKeeper.UpdateGovTimeInApp(*ctx, assetTypes.AppAndGovTime{AppId: tc.appID, GovTimeInSeconds: 653, MinGovDeposit: sdk.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(govTimeInSeconds, int64(653)) } }) } @@ -1260,10 +1256,10 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 4, - genesisSupply, - true, - userAddress1, + AssetId: 4, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -1281,10 +1277,10 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 8, - genesisSupply, - true, - userAddress1, + AssetId: 8, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -1302,10 +1298,10 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 5, - genesisSupply, - true, - userAddress1, + AssetId: 5, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -1337,10 +1333,10 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 2, - genesisSupply, - true, - userAddress1, + AssetId: 2, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -1358,10 +1354,10 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 4, - genesisSupply, - true, - userAddress1, + AssetId: 4, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -1379,10 +1375,10 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 4, - genesisSupply, - true, - userAddress1, + AssetId: 4, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, @@ -1400,10 +1396,10 @@ func (s *KeeperTestSuite) TestAddAssetInAppRecords() { GovTimeInSeconds: 900, GenesisToken: []assetTypes.MintGenesisToken{ { - 4, - genesisSupply, - true, - userAddress1, + AssetId: 4, + GenesisSupply: genesisSupply, + IsGovToken: true, + Recipient: userAddress1, }, }, }, diff --git a/x/asset/keeper/keeper.go b/x/asset/keeper/keeper.go index 771035188..07819be7d 100644 --- a/x/asset/keeper/keeper.go +++ b/x/asset/keeper/keeper.go @@ -1,15 +1,12 @@ package keeper import ( + "github.com/comdex-official/comdex/x/asset/expected" + 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" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - - assettypes "github.com/comdex-official/comdex/x/asset/types" - - storetypes "github.com/cosmos/cosmos-sdk/store/types" - - "github.com/comdex-official/comdex/x/asset/expected" ) type Keeper struct { @@ -21,6 +18,7 @@ type Keeper struct { rewards expected.RewardsKeeper vault expected.VaultKeeper bandoracle expected.Bandoraclekeeper + authority string } func NewKeeper( @@ -32,6 +30,7 @@ func NewKeeper( rewards expected.RewardsKeeper, vault expected.VaultKeeper, bandoracle expected.Bandoraclekeeper, + authority string, ) Keeper { if !params.HasKeyTable() { params = params.WithKeyTable(assettypes.ParamKeyTable()) @@ -46,6 +45,7 @@ func NewKeeper( rewards: rewards, vault: vault, bandoracle: bandoracle, + authority: authority, } } diff --git a/x/asset/keeper/keeper_test.go b/x/asset/keeper/keeper_test.go index 0cd4b3b1e..4e318b34e 100644 --- a/x/asset/keeper/keeper_test.go +++ b/x/asset/keeper/keeper_test.go @@ -1,14 +1,6 @@ package keeper_test import ( - "testing" - "time" - - "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" assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" liquidationKeeper "github.com/comdex-official/comdex/x/liquidation/keeper" @@ -17,6 +9,11 @@ import ( rewardsKeeper "github.com/comdex-official/comdex/x/rewards/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" + "time" ) type KeeperTestSuite struct { @@ -51,34 +48,6 @@ func (s *KeeperTestSuite) SetupTest() { s.rewardsKeeper = s.app.Rewardskeeper } -// -//// Below are just shortcuts to frequently-used functions. -//func (s *KeeperTestSuite) getBalances(addr sdk.AccAddress) sdk.Coins { -// return s.app.bankKeeper.GetAllBalances(s.ctx, addr) -//} -// -//func (s *KeeperTestSuite) getBalance(addr sdk.AccAddress, denom string) sdk.Coin { -// return s.app.bankKeeper.GetBalance(s.ctx, addr, denom) -//} -// -//func (s *KeeperTestSuite) sendCoins(fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) { -// s.T().Helper() -// err := s.app.bankKeeper.SendCoins(s.ctx, fromAddr, toAddr, amt) -// s.Require().NoError(err) -//} -// -//func (s *KeeperTestSuite) nextBlock() { -// liquidity.EndBlocker(s.ctx, s.keeper) -// liquidity.BeginBlocker(s.ctx, s.keeper) -//} -// -//// Below are useful helpers to write test code easily. -//func (s *KeeperTestSuite) addr(addrNum int) sdk.AccAddress { -// addr := make(sdk.AccAddress, 20) -// binary.PutVarint(addr, int64(addrNum)) -// return addr -//} - func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, amt sdk.Coin) { amt1 := sdk.NewCoins(amt) s.T().Helper() diff --git a/x/asset/keeper/msg_server.go b/x/asset/keeper/msg_server.go index baab081b2..800cb55ea 100644 --- a/x/asset/keeper/msg_server.go +++ b/x/asset/keeper/msg_server.go @@ -2,9 +2,11 @@ package keeper import ( "context" + "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/asset/types" sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) type msgServer struct { @@ -29,3 +31,14 @@ func (m msgServer) AddAsset(goCtx context.Context, msg *types.MsgAddAsset) (*typ return &types.MsgAddAssetResponse{}, nil } + +func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.authority != req.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + k.SetParams(ctx, req.Params) + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/asset/module.go b/x/asset/module.go index 86ee035c8..3b4b4a129 100644 --- a/x/asset/module.go +++ b/x/asset/module.go @@ -121,7 +121,7 @@ func (a AppModule) EndBlock(_ sdk.Context, _ abcitypes.RequestEndBlock) []abcity func (a AppModule) GenerateGenesisState(_ *module.SimulationState) {} -func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.WeightedProposalContent { +func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.WeightedProposalMsg { return nil } diff --git a/x/asset/types/asset.go b/x/asset/types/asset.go index 44a366e81..412d2e54f 100644 --- a/x/asset/types/asset.go +++ b/x/asset/types/asset.go @@ -1,10 +1,9 @@ package types import ( + errorsmod "cosmossdk.io/errors" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -19,7 +18,7 @@ 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()) { return fmt.Errorf("decimals cannot be less than or equal to zero") @@ -36,7 +35,7 @@ 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()) { return fmt.Errorf("decimals cannot be less than or equal to zero") diff --git a/x/asset/types/codec.go b/x/asset/types/codec.go index 229a17992..a94cef52f 100644 --- a/x/asset/types/codec.go +++ b/x/asset/types/codec.go @@ -2,6 +2,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -21,6 +22,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&AddAssetInAppProposal{}, "comdex/asset/AddAssetInAppProposal", nil) cdc.RegisterConcrete(&UpdateGovTimeInAppProposal{}, "comdex/asset/UpdateGovTimeInAppProposal", nil) cdc.RegisterConcrete(&AddMultipleAssetsPairsProposal{}, "comdex/asset/AddMultipleAssetsPairsProposal", nil) + cdc.RegisterConcrete(&Params{}, "comdex/asset/Params", nil) + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "comdex/asset/MsgUpdateParams") } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -41,6 +44,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgAddAsset{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) @@ -54,6 +58,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/asset/types/message_update_params.go b/x/asset/types/message_update_params.go new file mode 100644 index 000000000..9c12198b2 --- /dev/null +++ b/x/asset/types/message_update_params.go @@ -0,0 +1,35 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +func (msg *MsgUpdateParams) Route() string { + return RouterKey +} + +func (msg *MsgUpdateParams) Type() string { + return "update-params" +} + +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + authority, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{authority} +} + +func (msg *MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (msg *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority is invalid") + } + return nil +} diff --git a/x/asset/types/msgs.go b/x/asset/types/msgs.go index bb90db4f2..157e7d9da 100644 --- a/x/asset/types/msgs.go +++ b/x/asset/types/msgs.go @@ -3,6 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) var _ sdk.Msg = (*MsgAddAsset)(nil) @@ -45,7 +46,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/tx.pb.go b/x/asset/types/tx.pb.go index ed0fc05a6..f5d69585f 100644 --- a/x/asset/types/tx.pb.go +++ b/x/asset/types/tx.pb.go @@ -6,6 +6,8 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -103,32 +105,128 @@ func (m *MsgAddAssetResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddAssetResponse proto.InternalMessageInfo +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.47 +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/asset parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_78d9fd76d8e93e29, []int{2} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_78d9fd76d8e93e29, []int{3} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgAddAsset)(nil), "comdex.asset.v1beta1.MsgAddAsset") proto.RegisterType((*MsgAddAssetResponse)(nil), "comdex.asset.v1beta1.MsgAddAssetResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "comdex.asset.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "comdex.asset.v1beta1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("comdex/asset/v1beta1/tx.proto", fileDescriptor_78d9fd76d8e93e29) } var fileDescriptor_78d9fd76d8e93e29 = []byte{ - // 257 bytes of a gzipped FileDescriptorProto + // 409 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x2e, 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0x48, 0xeb, 0x81, 0xa5, 0xf5, 0xa0, 0xd2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x05, 0xfa, 0x20, 0x16, 0x44, 0xad, - 0x94, 0x02, 0x56, 0xa3, 0x20, 0x3a, 0xc1, 0x2a, 0x94, 0x12, 0xb8, 0xb8, 0x7d, 0x8b, 0xd3, 0x1d, - 0x53, 0x52, 0x1c, 0x41, 0x82, 0x42, 0x12, 0x5c, 0xec, 0xc9, 0x45, 0xa9, 0x89, 0x25, 0xf9, 0x45, - 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x30, 0xae, 0x90, 0x39, 0x17, 0x2b, 0x58, 0x9f, 0x04, - 0x93, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xb4, 0x1e, 0x36, 0x67, 0xe8, 0x81, 0x4d, 0x71, 0x62, 0x39, - 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xa2, 0x5e, 0x49, 0x94, 0x4b, 0x18, 0xc9, 0x86, 0xa0, 0xd4, 0xe2, - 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa3, 0x78, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x08, 0x2e, 0x0e, - 0xb8, 0xe5, 0x8a, 0xd8, 0xcd, 0x44, 0xd2, 0x2d, 0xa5, 0x49, 0x50, 0x09, 0xcc, 0x02, 0x27, 0xdf, - 0x13, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, - 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x3f, - 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x09, 0x64, 0x9c, 0x3e, 0xc4, 0x48, 0xdd, 0xfc, 0xb4, 0xb4, 0xcc, - 0xe4, 0xcc, 0xc4, 0x1c, 0x28, 0x5f, 0x1f, 0x16, 0x6c, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, - 0xe0, 0xf0, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xda, 0x99, 0x98, 0xf3, 0x9e, 0x01, 0x00, - 0x00, + 0x94, 0x02, 0x56, 0xa3, 0x20, 0x3a, 0x21, 0x2a, 0x14, 0xb1, 0xaa, 0x28, 0x48, 0x2c, 0x4a, 0xcc, + 0x2d, 0x86, 0x2a, 0x11, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, 0x4e, 0xd7, 0x2f, + 0x33, 0x04, 0x51, 0x50, 0x09, 0x49, 0x88, 0x44, 0x3c, 0xc4, 0x5a, 0x08, 0x07, 0x22, 0xa5, 0x94, + 0xc0, 0xc5, 0xed, 0x5b, 0x9c, 0xee, 0x98, 0x92, 0xe2, 0x08, 0x32, 0x57, 0x48, 0x82, 0x8b, 0x3d, + 0xb9, 0x28, 0x35, 0xb1, 0x24, 0xbf, 0x48, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xc6, 0x15, + 0x32, 0xe7, 0x62, 0x05, 0x5b, 0x2d, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xad, 0x87, 0xcd, + 0x77, 0x7a, 0x60, 0x53, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0xa8, 0x57, 0x12, 0xe5, + 0x12, 0x46, 0xb2, 0x21, 0x28, 0xb5, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, 0x69, 0x2a, 0x23, 0x17, + 0xbf, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0x6a, 0x00, 0xd8, 0x1b, 0x42, 0x66, 0x5c, + 0x9c, 0x89, 0xa5, 0x25, 0x19, 0xf9, 0x45, 0x99, 0x25, 0x95, 0x10, 0xfb, 0x9d, 0x24, 0x2e, 0x6d, + 0xd1, 0x15, 0x81, 0xba, 0xd8, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, 0x33, + 0x2f, 0x3d, 0x08, 0xa1, 0x54, 0xc8, 0x8a, 0x8b, 0x0d, 0x12, 0x10, 0x50, 0xc7, 0xc9, 0x60, 0x77, + 0x1c, 0xc4, 0x16, 0xa8, 0xeb, 0xa0, 0x3a, 0xac, 0xf8, 0x9a, 0x9e, 0x6f, 0xd0, 0x42, 0x98, 0xa5, + 0x24, 0xc9, 0x25, 0x8e, 0xe6, 0x2c, 0x98, 0x93, 0x8d, 0x8e, 0x32, 0x72, 0x31, 0xfb, 0x16, 0xa7, + 0x0b, 0x45, 0x70, 0x71, 0xc0, 0x03, 0x4c, 0x11, 0xbb, 0x55, 0x48, 0x3e, 0x96, 0xd2, 0x24, 0xa8, + 0x04, 0x66, 0x83, 0x50, 0x0a, 0x17, 0x0f, 0x4a, 0x80, 0xa8, 0xe2, 0xd4, 0x8a, 0xac, 0x4c, 0x4a, + 0x97, 0x28, 0x65, 0x30, 0x5b, 0x9c, 0x7c, 0x4f, 0x3c, 0x94, 0x63, 0x38, 0xf1, 0x48, 0x8e, 0xf1, + 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, + 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0x90, 0x91, 0xfa, + 0x10, 0x63, 0x75, 0xf3, 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, 0x7d, 0x58, 0x2a, + 0x2c, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xa7, 0x24, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xde, 0x4a, 0x82, 0x17, 0x0f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -145,6 +243,7 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // AddAsset defines a method for adding new asset in asset module AddAsset(ctx context.Context, in *MsgAddAsset, opts ...grpc.CallOption) (*MsgAddAssetResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -164,10 +263,20 @@ func (c *msgClient) AddAsset(ctx context.Context, in *MsgAddAsset, opts ...grpc. return out, nil } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // AddAsset defines a method for adding new asset in asset module AddAsset(context.Context, *MsgAddAsset) (*MsgAddAssetResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -177,6 +286,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) AddAsset(ctx context.Context, req *MsgAddAsset) (*MsgAddAssetResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddAsset not implemented") } +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -200,6 +312,24 @@ func _Msg_AddAsset_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.asset.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -208,6 +338,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AddAsset", Handler: _Msg_AddAsset_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/asset/v1beta1/tx.proto", @@ -276,6 +410,69 @@ func (m *MsgAddAssetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -311,6 +508,30 @@ func (m *MsgAddAssetResponse) Size() (n int) { return n } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -482,6 +703,171 @@ func (m *MsgAddAssetResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auction/expected/keeper.go b/x/auction/expected/keeper.go index 16f75bad6..f27b48cff 100644 --- a/x/auction/expected/keeper.go +++ b/x/auction/expected/keeper.go @@ -1,9 +1,6 @@ package expected import ( - 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" "github.com/comdex-official/comdex/x/collector/types" @@ -12,103 +9,105 @@ import ( liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" markettypes "github.com/comdex-official/comdex/x/market/types" vaulttypes "github.com/comdex-official/comdex/x/vault/types" + sdktypes "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 - GetModuleAddress(name string) sdk.AccAddress + GetModuleAccount(ctx sdktypes.Context, name string) authtypes.ModuleAccountI + GetModuleAddress(name string) sdktypes.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 sdktypes.Context, name string, coins sdktypes.Coins) error + BurnCoins(ctx sdktypes.Context, name string, coins sdktypes.Coins) error + SendCoinsFromModuleToModule(ctx sdktypes.Context, senderModule string, recipientModule string, amt sdktypes.Coins) error + SendCoinsFromModuleToAccount(ctx sdktypes.Context, senderModule string, recipientAddr sdktypes.AccAddress, amt sdktypes.Coins) error + SendCoinsFromAccountToModule(ctx sdktypes.Context, senderAddr sdktypes.AccAddress, recipientModule string, amt sdktypes.Coins) error + GetBalance(ctx sdktypes.Context, addr sdktypes.AccAddress, denom string) sdktypes.Coin } type MarketKeeper interface { - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) - GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) + CalcAssetPrice(ctx sdktypes.Context, id uint64, amt sdktypes.Int) (price sdktypes.Dec, err error) + GetTwa(ctx sdktypes.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) } type LiquidationKeeper interface { - SetFlagIsAuctionInProgress(ctx sdk.Context, appID, id uint64, flag bool) error - SetFlagIsAuctionComplete(ctx sdk.Context, appID, id uint64, flag bool) error - GetLockedVaults(ctx sdk.Context) (lockedVaults []liquidationtypes.LockedVault) - GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationtypes.LockedVault, found bool) - SetLockedVault(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) - DeleteLockedVault(ctx sdk.Context, appID, id uint64) - CreateLockedVaultHistory(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) error - UnLiquidateLockedBorrows(ctx sdk.Context, appID, id uint64, dutchAuction auctiontypes.DutchAuction) error + SetFlagIsAuctionInProgress(ctx sdktypes.Context, appID, id uint64, flag bool) error + SetFlagIsAuctionComplete(ctx sdktypes.Context, appID, id uint64, flag bool) error + GetLockedVaults(ctx sdktypes.Context) (lockedVaults []liquidationtypes.LockedVault) + GetLockedVault(ctx sdktypes.Context, appID, id uint64) (lockedVault liquidationtypes.LockedVault, found bool) + SetLockedVault(ctx sdktypes.Context, lockedVault liquidationtypes.LockedVault) + DeleteLockedVault(ctx sdktypes.Context, appID, id uint64) + CreateLockedVaultHistory(ctx sdktypes.Context, lockedVault liquidationtypes.LockedVault) error + UnLiquidateLockedBorrows(ctx sdktypes.Context, appID, id uint64, dutchAuction auctiontypes.DutchAuction) error } type AssetKeeper interface { - GetAsset(ctx sdk.Context, id uint64) (assettypes.Asset, bool) - GetPair(ctx sdk.Context, id uint64) (assettypes.Pair, bool) - GetApps(ctx sdk.Context) (apps []assettypes.AppData, found bool) - GetApp(ctx sdk.Context, id uint64) (app assettypes.AppData, found bool) - GetPairsVault(ctx sdk.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) + GetAsset(ctx sdktypes.Context, id uint64) (assettypes.Asset, bool) + GetPair(ctx sdktypes.Context, id uint64) (assettypes.Pair, bool) + GetApps(ctx sdktypes.Context) (apps []assettypes.AppData, found bool) + GetApp(ctx sdktypes.Context, id uint64) (app assettypes.AppData, found bool) + GetPairsVault(ctx sdktypes.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) } 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) - 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 - 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) - GetLengthOfVault(ctx sdk.Context) uint64 - SetLengthOfVault(ctx sdk.Context, length uint64) + GetAppExtendedPairVaultMappingData(ctx sdktypes.Context, appMappingID uint64, pairVaultsID uint64) (appExtendedPairVaultData vaulttypes.AppExtendedPairVaultMappingData, found bool) + SetAppExtendedPairVaultMappingData(ctx sdktypes.Context, appExtendedPairVaultData vaulttypes.AppExtendedPairVaultMappingData) + UpdateTokenMintedAmountLockerMapping(ctx sdktypes.Context, appMappingID uint64, extendedPairID uint64, amount sdktypes.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdktypes.Context, appMappingID uint64, extendedPairID uint64, amount sdktypes.Int, changeType bool) + DeleteUserVaultExtendedPairMapping(ctx sdktypes.Context, from string, appMapping uint64, extendedPairVault uint64) + CreateNewVault(ctx sdktypes.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdktypes.Int, AmountOut sdktypes.Int) error + GetUserAppExtendedPairMappingData(ctx sdktypes.Context, from string, appMapping uint64, extendedPairVault uint64) (userVaultAssetData vaulttypes.OwnerAppExtendedPairVaultMappingData, found bool) + GetUserAppMappingData(ctx sdktypes.Context, from string, appMapping uint64) (userVaultAssetData []vaulttypes.OwnerAppExtendedPairVaultMappingData, found bool) + // CheckUserAppToExtendedPairMapping(ctx sdktypes.Context, userVaultAssetData vaulttypes.UserVaultAssetMapping, extendedPairVaultID uint64, appMappingID uint64) (vaultID uint64, found bool) + SetVault(ctx sdktypes.Context, vault vaulttypes.Vault) + GetVault(ctx sdktypes.Context, id uint64) (vault vaulttypes.Vault, found bool) + GetAmountOfOtherToken(ctx sdktypes.Context, id1 uint64, rate1 sdktypes.Dec, amt1 sdktypes.Int, id2 uint64, rate2 sdktypes.Dec) (sdktypes.Dec, sdktypes.Int, error) + GetLengthOfVault(ctx sdktypes.Context) uint64 + SetLengthOfVault(ctx sdktypes.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 - // 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 - SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error - GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) + GetAppidToAssetCollectorMapping(ctx sdktypes.Context, appID, assetID uint64) (appAssetCollectorData types.AppToAssetIdCollectorMapping, found bool) + UpdateCollector(ctx sdktypes.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdktypes.Int) error + // SetCollectorLookupTable(ctx sdktypes.Context, records ...types.CollectorLookupTable) error + GetCollectorLookupTable(ctx sdktypes.Context, appID, assetID uint64) (collectorLookup types.CollectorLookupTableData, found bool) + GetAuctionMappingForApp(ctx sdktypes.Context, appID, assetID uint64) (collectorAuctionLookupTable types.AppAssetIdToAuctionLookupTable, found bool) + GetNetFeeCollectedData(ctx sdktypes.Context, appID, assetID uint64) (netFeeData types.AppAssetIdToFeeCollectedData, found bool) + GetAmountFromCollector(ctx sdktypes.Context, appID, assetID uint64, amount sdktypes.Int) (sdktypes.Int, error) + SetNetFeeCollectedData(ctx sdktypes.Context, appID, assetID uint64, fee sdktypes.Int) error + SetAuctionMappingForApp(ctx sdktypes.Context, records types.AppAssetIdToAuctionLookupTable) error + GetAllAuctionMappingForApp(ctx sdktypes.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 sdktypes.Context, appMappingID uint64, assetID uint64, address string, amount sdktypes.Int) error + BurnTokensForApp(ctx sdktypes.Context, appMappingID uint64, assetID uint64, amount sdktypes.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) - 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) - GetSnapshotOfPrices(ctx sdk.Context, appID, assetID uint64) (price uint64, found bool) + GetKillSwitchData(ctx sdktypes.Context, appID uint64) (esmtypes.KillSwitchParams, bool) + GetESMStatus(ctx sdktypes.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) + CalcDollarValueOfToken(ctx sdktypes.Context, rate uint64, amt sdktypes.Int, decimals sdktypes.Int) (price sdktypes.Dec) + SetAssetToAmount(ctx sdktypes.Context, assetToAmount esmtypes.AssetToAmount) + GetDataAfterCoolOff(ctx sdktypes.Context, id uint64) (esmDataAfterCoolOff esmtypes.DataAfterCoolOff, found bool) + SetDataAfterCoolOff(ctx sdktypes.Context, esmDataAfterCoolOff esmtypes.DataAfterCoolOff) + GetSnapshotOfPrices(ctx sdktypes.Context, appID, assetID uint64) (price uint64, found bool) } 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) - 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 - 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) - GetAllReserveStatsByAssetID(ctx sdk.Context, id uint64) (allReserveStats lendtypes.AllReserveStats, found bool) + GetBorrow(ctx sdktypes.Context, id uint64) (borrow lendtypes.BorrowAsset, found bool) + GetLendPair(ctx sdktypes.Context, id uint64) (pair lendtypes.Extended_Pair, found bool) + GetAssetRatesParams(ctx sdktypes.Context, assetID uint64) (assetRatesStats lendtypes.AssetRatesParams, found bool) + VerifyCollateralizationRatio(ctx sdktypes.Context, amountIn sdktypes.Int, assetIn assettypes.Asset, amountOut sdktypes.Int, assetOut assettypes.Asset, liquidationThreshold sdktypes.Dec) error + CalculateCollateralizationRatio(ctx sdktypes.Context, amountIn sdktypes.Int, assetIn assettypes.Asset, amountOut sdktypes.Int, assetOut assettypes.Asset) (sdktypes.Dec, error) + GetLend(ctx sdktypes.Context, id uint64) (lend lendtypes.LendAsset, found bool) + GetPool(ctx sdktypes.Context, id uint64) (pool lendtypes.Pool, found bool) + GetAddAuctionParamsData(ctx sdktypes.Context, appID uint64) (auctionParams lendtypes.AuctionParams, found bool) + ModuleBalance(ctx sdktypes.Context, moduleName string, denom string) sdktypes.Int + UpdateReserveBalances(ctx sdktypes.Context, assetID uint64, moduleName string, payment sdktypes.Coin, inc bool) error + SetLend(ctx sdktypes.Context, lend lendtypes.LendAsset) + SetAllReserveStatsByAssetID(ctx sdktypes.Context, allReserveStats lendtypes.AllReserveStats) + GetAllReserveStatsByAssetID(ctx sdktypes.Context, id uint64) (allReserveStats lendtypes.AllReserveStats, found bool) } diff --git a/x/auction/handler.go b/x/auction/handler.go index 148ee9339..612ac4d17 100644 --- a/x/auction/handler.go +++ b/x/auction/handler.go @@ -1,11 +1,10 @@ package auction import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/auction/keeper" "github.com/comdex-official/comdex/x/auction/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) func NewHandler(k keeper.Keeper) sdk.Handler { @@ -32,7 +31,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/debt.go b/x/auction/keeper/debt.go index b98a0b4da..b0cca99e7 100644 --- a/x/auction/keeper/debt.go +++ b/x/auction/keeper/debt.go @@ -1,15 +1,13 @@ package keeper import ( - "time" - + errorsmod "cosmossdk.io/errors" + auctiontypes "github.com/comdex-official/comdex/x/auction/types" + collectortypes "github.com/comdex-official/comdex/x/collector/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - auctiontypes "github.com/comdex-official/comdex/x/auction/types" - collectortypes "github.com/comdex-official/comdex/x/collector/types" + "time" ) func (k Keeper) DebtActivator(ctx sdk.Context, data collectortypes.AppAssetIdToAuctionLookupTable, killSwitchParams esmtypes.KillSwitchParams, status bool) error { @@ -293,7 +291,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 1adae3e5f..1e3fe28d3 100644 --- a/x/auction/keeper/debt_test.go +++ b/x/auction/keeper/debt_test.go @@ -400,7 +400,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.NewDec(beforeAuction.ExpectedMintedToken.Amount.Int64()).Mul(sdk.MustNewDecFromStr("1").Sub(beforeAuction.BidFactor)).TruncateInt())) + s.Require().True(afterAuction.ExpectedMintedToken.Amount.LTE(sdk.NewDecFromInt(beforeAuction.ExpectedMintedToken.Amount).Mul(sdk.MustNewDecFromStr("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 de4c4da4b..a200dc331 100644 --- a/x/auction/keeper/dutch.go +++ b/x/auction/keeper/dutch.go @@ -5,6 +5,7 @@ import ( "strconv" "time" + errorsmod "cosmossdk.io/errors" liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -102,7 +103,7 @@ func (k Keeper) StartDutchAuction( outFlowTokenPrice = twaData.Twa // set target amount for debt inFlowTokenTargetAmount := lockedVault.AmountOut - mulfactor := sdk.NewDec(inFlowTokenTargetAmount.Int64()).Mul(liquidationPenalty) + mulfactor := sdk.NewDecFromInt(inFlowTokenTargetAmount).Mul(liquidationPenalty) inFlowTokenTargetAmount = inFlowTokenTargetAmount.Add(mulfactor.TruncateInt()).Add(lockedVault.InterestAccumulated) inFlowTokenTarget := sdk.NewCoin(inFlowToken.Denom, inFlowTokenTargetAmount) // These prices are in uusd @@ -163,17 +164,17 @@ 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") + 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 @@ -194,7 +195,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, a return err } if inFlowTokenAmount.LTE(sdk.ZeroInt()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Calculated Auction Amount is Zero") + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "Calculated Auction Amount is Zero") } TargetReachedFlag := false @@ -247,13 +248,13 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, a if amountLeftInPUSD.LT(sdk.NewDecFromInt(dust)) && !amountLeftInPUSD.Equal(sdk.ZeroDec()) && !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()) { 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) diff --git a/x/auction/keeper/dutch_lend.go b/x/auction/keeper/dutch_lend.go index 4276211d0..b0d4ebf1f 100644 --- a/x/auction/keeper/dutch_lend.go +++ b/x/auction/keeper/dutch_lend.go @@ -4,6 +4,7 @@ import ( "strconv" "time" + errorsmod "cosmossdk.io/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" lendtypes "github.com/comdex-official/comdex/x/lend/types" @@ -135,17 +136,17 @@ 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") + 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 @@ -164,7 +165,7 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI return err } if inFlowTokenAmount.LTE(sdk.ZeroInt()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Calculated Auction Amount is Zero") + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "Calculated Auction Amount is Zero") } TargetReachedFlag := false @@ -216,12 +217,12 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI // Dust check for collateral if amountLeftInPUSD.LT(sdk.NewDecFromInt(dust)) && !amountLeftInPUSD.Equal(sdk.ZeroDec()) && !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) + 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 +239,7 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI // calculating additional auction bonus to the bidder - auctionBonus := sdk.NewDec(slice.Int64()).Mul(assetStats.LiquidationBonus) + auctionBonus := sdk.NewDecFromInt(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) @@ -288,7 +289,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 diff --git a/x/auction/keeper/dutch_lend_test.go b/x/auction/keeper/dutch_lend_test.go index 942919421..a8c6b9983 100644 --- a/x/auction/keeper/dutch_lend_test.go +++ b/x/auction/keeper/dutch_lend_test.go @@ -667,7 +667,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.NewDec(lockedVault[0].AmountOut.Int64()).Mul(s.GetAssetPrice(2)).Quo(sdk.NewDec(beforeAmtIn.Int64()).Mul(s.GetAssetPrice(1)))) + s.Require().Equal(lockedVault[0].CrAtLiquidation, sdk.NewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)).Quo(sdk.NewDecFromInt(beforeAmtIn).Mul(s.GetAssetPrice(1)))) } func (s *KeeperTestSuite) TestDutchActivatorLend() { @@ -808,8 +808,8 @@ func (s *KeeperTestSuite) TestLendDutchBid() { s.Require().NoError(err) userBid, err := k.GetDutchLendUserBidding(*ctx, userAddress1, appID, biddingID) - userReceivableAmount := sdk.NewDec(tc.msg.Amount.Amount.Int64()).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() - auctionBonus := sdk.NewDec(userReceivableAmount.Int64()).Mul(Dec("0.005")) + userReceivableAmount := sdk.NewDecFromInt(tc.msg.Amount.Amount).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() + auctionBonus := sdk.NewDecFromInt(userReceivableAmount).Mul(Dec("0.005")) userOutflowCoin := sdk.NewCoin("ucmdx", userReceivableAmount) userOutflowCoinFinal := sdk.NewCoin("ucmdx", userReceivableAmount.Add(auctionBonus.TruncateInt())) userInflowCoin := tc.msg.Amount @@ -937,8 +937,8 @@ func (s *KeeperTestSuite) TestLendDutchBid3() { s.Require().NoError(err) userBid, err := k.GetDutchLendUserBidding(*ctx, userAddress1, appID, biddingID) - userReceivableAmount := sdk.NewDec(tc.msg.Amount.Amount.Int64()).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() - auctionBonus := sdk.NewDec(userReceivableAmount.Int64()).Mul(Dec("0.005")) + userReceivableAmount := sdk.NewDecFromInt(tc.msg.Amount.Amount).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() + auctionBonus := sdk.NewDecFromInt(userReceivableAmount).Mul(Dec("0.005")) userOutflowCoin := sdk.NewCoin("uosmo", userReceivableAmount) userOutflowCoinFinal := sdk.NewCoin("uosmo", userReceivableAmount.Add(auctionBonus.TruncateInt())) userInflowCoin := tc.msg.Amount diff --git a/x/auction/keeper/dutch_test.go b/x/auction/keeper/dutch_test.go index c5a37d399..3098e2f1d 100644 --- a/x/auction/keeper/dutch_test.go +++ b/x/auction/keeper/dutch_test.go @@ -267,7 +267,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.NewDec(lockedVault[0].AmountIn.Int64()).Mul(s.GetAssetPrice(1)).Quo(sdk.NewDec(lockedVault[0].AmountOut.Int64()).Mul(s.GetAssetPrice(2)))) + 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)))) } func (s *KeeperTestSuite) AddAuctionParams() { @@ -317,7 +317,7 @@ func (s *KeeperTestSuite) TestDutchActivator() { s.Require().Equal(dutchAuction.InflowTokenCurrentAmount.Amount, sdk.ZeroInt()) inFlowTokenTargetAmount := lockedVault.AmountOut - mulfactor := sdk.NewDec(inFlowTokenTargetAmount.Int64()).Mul(dutchAuction.LiquidationPenalty) + mulfactor := sdk.NewDecFromInt(inFlowTokenTargetAmount).Mul(dutchAuction.LiquidationPenalty) inFlowTokenTargetAmount = inFlowTokenTargetAmount.Add(mulfactor.TruncateInt()).Add(lockedVault.InterestAccumulated) s.Require().Equal(dutchAuction.InflowTokenTargetAmount.Amount, inFlowTokenTargetAmount) @@ -439,7 +439,7 @@ func (s *KeeperTestSuite) TestDutchBid() { s.Require().NoError(err) userBid, err := k.GetDutchUserBidding(*ctx, userAddress1, appID, biddingID) - userReceivableAmount := sdk.NewDec(tc.msg.Amount.Amount.Int64()).Mul(beforeAuction.OutflowTokenCurrentPrice).Quo(beforeAuction.InflowTokenCurrentPrice).TruncateInt() + userReceivableAmount := sdk.NewDecFromInt(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) @@ -558,7 +558,7 @@ func (s *KeeperTestSuite) TestCloseDutchAuctionWithProtocolLoss() { // verify loss stats, found := k.GetProtocolStat(*ctx, appId, 2) s.Require().True(found) - loss := sdk.NewDec(afterAuction.InflowTokenTargetAmount.Sub(afterAuction.InflowTokenCurrentAmount).Amount.Int64()) + loss := sdk.NewDecFromInt(afterAuction.InflowTokenTargetAmount.Sub(afterAuction.InflowTokenCurrentAmount).Amount) s.Require().Equal(loss, stats.Loss) } diff --git a/x/auction/keeper/math.go b/x/auction/keeper/math.go index eec3f73ab..a90f35f3d 100644 --- a/x/auction/keeper/math.go +++ b/x/auction/keeper/math.go @@ -9,7 +9,7 @@ func Multiply(a, b sdk.Dec) sdk.Dec { } func (k Keeper) getOutflowTokenInitialPrice(price sdk.Int, buffer sdk.Dec) sdk.Dec { - result := buffer.Mul(sdk.NewDec(price.Int64())) + result := buffer.Mul(sdk.NewDecFromInt(price)) return result } @@ -20,7 +20,7 @@ func (k Keeper) getOutflowTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { func (k Keeper) getPriceFromLinearDecreaseFunction(top sdk.Dec, tau, dur sdk.Int) sdk.Dec { result1 := tau.Sub(dur) - result2 := top.Mul(sdk.NewDec(result1.Int64())) - result3 := result2.Quo(sdk.NewDec(tau.Int64())) + result2 := top.Mul(sdk.NewDecFromInt(result1)) + result3 := result2.Quo(sdk.NewDecFromInt(tau)) return result3 } diff --git a/x/auction/keeper/math_test.go b/x/auction/keeper/math_test.go index cf05ed45e..825ac8ef6 100644 --- a/x/auction/keeper/math_test.go +++ b/x/auction/keeper/math_test.go @@ -9,7 +9,7 @@ import ( func getBurnAmount(amount sdk.Int, liqPenalty sdk.Dec) sdk.Int { liqPenalty = liqPenalty.Add(sdk.NewDec(1)) - result := sdk.NewDec(amount.Int64()).Quo(liqPenalty).Ceil().TruncateInt() + result := sdk.NewDecFromInt(amount).Quo(liqPenalty).Ceil().TruncateInt() return result } diff --git a/x/auction/keeper/store.go b/x/auction/keeper/store.go index 624315159..3d5a202bd 100644 --- a/x/auction/keeper/store.go +++ b/x/auction/keeper/store.go @@ -1,6 +1,7 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protobuftypes "github.com/cosmos/gogoproto/types" @@ -16,14 +17,14 @@ func (k Keeper) SetProtocolStatistics(ctx sdk.Context, appID, assetID uint64, am ) stat, found := k.GetProtocolStat(ctx, appID, assetID) if found { - stat.Loss = stat.Loss.Add(sdk.NewDec(amount.Int64())) + stat.Loss = stat.Loss.Add(sdk.NewDecFromInt(amount)) value := k.cdc.MustMarshal(&stat) store.Set(key, value) } else { var stats auctiontypes.ProtocolStatistics stats.AppId = appID stats.AssetId = assetID - stats.Loss = sdk.NewDec(amount.Int64()) + stats.Loss = sdk.NewDecFromInt(amount) value := k.cdc.MustMarshal(&stats) store.Set(key, value) } @@ -135,7 +136,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,7 +150,7 @@ 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) { diff --git a/x/auction/keeper/surplus.go b/x/auction/keeper/surplus.go index ce39efd46..e178ca1e6 100644 --- a/x/auction/keeper/surplus.go +++ b/x/auction/keeper/surplus.go @@ -3,6 +3,7 @@ package keeper import ( "time" + errorsmod "cosmossdk.io/errors" esmtypes "github.com/comdex-official/comdex/x/esm/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -298,7 +299,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 4a0b65aa9..a9636f2f4 100644 --- a/x/auction/keeper/surplus_test.go +++ b/x/auction/keeper/surplus_test.go @@ -250,7 +250,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.NewDec(beforeAuction.Bid.Amount.Int64()).Mul(sdk.MustNewDecFromStr("1").Sub(beforeAuction.BidFactor)).TruncateInt())) + s.Require().True(afterAuction.Bid.Amount.GTE(sdk.NewDecFromInt(beforeAuction.Bid.Amount).Mul(sdk.MustNewDecFromStr("1").Sub(beforeAuction.BidFactor)).TruncateInt())) } s.Require().Equal(beforeCmstBalance, afterCmstBalance) s.Require().Equal(beforeHarborBalance.Sub(bid), afterHarborBalance) diff --git a/x/auction/types/codec.go b/x/auction/types/codec.go index 79d67cc61..dbc24b83b 100644 --- a/x/auction/types/codec.go +++ b/x/auction/types/codec.go @@ -34,6 +34,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } 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..7a0a005c5 100644 --- a/x/auction/types/msg.go +++ b/x/auction/types/msg.go @@ -3,6 +3,7 @@ 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 +41,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 +82,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 +119,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 +156,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/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index 6860d4205..d819dcd77 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -31,6 +31,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { queryAuction(), queryAuctions(), queryBids(), + queryBid(), queryAuctionParams(), queryUserLimitOrderBidsByAssetID(), queryLimitOrderBids(), @@ -167,6 +168,38 @@ func queryBids() *cobra.Command { return cmd } +func queryBid() *cobra.Command { + cmd := &cobra.Command{ + Use: "bid [bid-id]", + Short: "Query bid by bid id", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + bidID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.Bid( + context.Background(), + &types.QueryBidRequest{ + BidId: bidID, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + func queryAuctionParams() *cobra.Command { cmd := &cobra.Command{ Use: "auction-params", diff --git a/x/auctionsV2/handler.go b/x/auctionsV2/handler.go index b9a519b5f..4d243f7fb 100644 --- a/x/auctionsV2/handler.go +++ b/x/auctionsV2/handler.go @@ -1,6 +1,7 @@ package auctionsV2 import ( + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/auctionsV2/keeper" "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -32,7 +33,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 +44,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..fc002c2e3 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -336,6 +336,20 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auction) func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auction) error { + // logic to revoke debt auction, instead of restarting + // get the locked vault for that auction and check initiator type = "debt" + lockedVault, _ := k.LiquidationsV2.GetLockedVault(ctx, 2, englishAuction.LockedVaultId) + if lockedVault.InitiatorType == "debt" { + // delete auction and the associated locked vault if no bids + if englishAuction.ActiveBiddingId == 0 { + err := k.DeleteAuction(ctx, englishAuction) + if err != nil { + return err + } + k.LiquidationsV2.DeleteLockedVault(ctx, englishAuction.AppId, englishAuction.LockedVaultId) + } + } + auctionParams, _ := k.GetAuctionParams(ctx) englishAuction.EndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) err := k.SetAuction(ctx, englishAuction) @@ -431,7 +445,8 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio return types.ErrAuctionLookupTableNotFound } - auctionLookupTable.IsAuctionActive = false + // for v14 upgrade + // auctionLookupTable.IsAuctionActive = false err = k.collector.SetAuctionMappingForApp(ctx, auctionLookupTable) if err != nil { return err diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index c8294ce95..74bdcaca3 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -1,6 +1,7 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" 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" @@ -41,20 +42,20 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if bid.Amount.GTE(auctionData.DebtToken.Amount) { bid.Amount = auctionData.DebtToken.Amount fullBid = true - } - _, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - //From auction bonus quantity , use the available quantity to calculate the collateral value - _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, auctionData.BonusAmount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral - totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) - //If user has sent a bigger bid than the target amount , - if fullBid || !totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { + + if fullBid { + _, collateralTokenQuantity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + //From auction bonus quantity , use the available quantity to calculate the collateral value + _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, auctionData.BonusAmount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral + totalCollateralTokenQuanitity := collateralTokenQuantity.Add(collateralTokenQuanitityForBonus) + //If user has sent a bigger bid than the target amount , if !totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { //This means that there is less collateral available . leftOverCollateral := auctionData.CollateralToken.Amount - _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral.Sub(collateralTokenQuanitityForBonus), auctionData.DebtAssetId, debtPrice) + _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral, auctionData.DebtAssetId, debtPrice) bid.Amount = debtTokenAgainstLeftOverCollateral totalCollateralTokenQuanitity = leftOverCollateral //Amount to call from reserve account for adjusting the auction target debt @@ -64,7 +65,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Updating the protocol was in loss struct err := k.LiquidationsV2.WithdrawAppReserveFundsFn(ctx, auctionData.AppId, auctionData.DebtAssetId, debtGettingLeft) if err != nil { - return bidId, err + return 0, types.ErrorInsufficientReserveBalance } } //Take Debt Token from user , @@ -351,11 +352,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 { diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index a73917637..8b0838f85 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -148,6 +148,25 @@ func (q QueryServer) Bids(c context.Context, req *types.QueryBidsRequest) (*type }, nil } +func (q QueryServer) Bid(c context.Context, req *types.QueryBidRequest) (*types.QueryBidResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + ctx = sdk.UnwrapSDKContext(c) + item types.Bid + ) + item, err := q.GetUserBid(ctx, req.BidId) + if err != nil { + return nil, err + } + + return &types.QueryBidResponse{ + Bid: item, + }, nil +} + func (q QueryServer) AuctionParams(c context.Context, req *types.QueryAuctionParamsRequest) (*types.QueryAuctionParamsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "request cannot be empty") diff --git a/x/auctionsV2/keeper/maths.go b/x/auctionsV2/keeper/maths.go index 4c1cb1386..dd8a7a21c 100644 --- a/x/auctionsV2/keeper/maths.go +++ b/x/auctionsV2/keeper/maths.go @@ -7,14 +7,14 @@ func Multiply(a, b sdk.Dec) sdk.Dec { } func (k Keeper) GetCollalteralTokenInitialPrice(price sdk.Int, premium sdk.Dec) sdk.Dec { - result := premium.Mul(sdk.NewDec(price.Int64())) + result := premium.Mul(sdk.NewDecFromInt(price)) return result } func (k Keeper) GetPriceFromLinearDecreaseFunction(CollateralTokenAuctionPrice sdk.Dec, timeToReachZeroPrice, timeElapsed sdk.Int) sdk.Dec { timeDifference := timeToReachZeroPrice.Sub(timeElapsed) - resultantPrice := CollateralTokenAuctionPrice.Mul(sdk.NewDec(timeDifference.Int64())) - currentPrice := resultantPrice.Quo(sdk.NewDec(timeToReachZeroPrice.Int64())) + resultantPrice := CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(timeDifference)) + currentPrice := resultantPrice.Quo(sdk.NewDecFromInt(timeToReachZeroPrice)) return currentPrice } diff --git a/x/auctionsV2/keeper/msg_server_test.go b/x/auctionsV2/keeper/msg_server_test.go index b38b75ff3..df6be1c7b 100644 --- a/x/auctionsV2/keeper/msg_server_test.go +++ b/x/auctionsV2/keeper/msg_server_test.go @@ -289,8 +289,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.NewDec(beforeVault.AmountOut.Int64()).Mul(newDec("0.12")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDec(beforeVault.AmountOut.Int64()).Mul(newDec("0.12")).TruncateInt()) + 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].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) @@ -361,10 +361,9 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { s.Require().Equal(lockedVault[0].OriginalVaultId, beforeBorrow.ID) s.Require().Equal(lockedVault[0].ExtendedPairId, beforeBorrow.PairID) 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.NewDec(beforeBorrow.AmountOut.Amount.Int64()).Mul(newDec("0.05")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDec(beforeBorrow.AmountOut.Amount.Int64()).Mul(newDec("0.05")).TruncateInt()) + 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].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) diff --git a/x/auctionsV2/module.go b/x/auctionsV2/module.go index 8ba4e5e62..d39ff5358 100644 --- a/x/auctionsV2/module.go +++ b/x/auctionsV2/module.go @@ -62,7 +62,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // ValidateGenesis performs genesis state validation for the capability module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { var genState types.GenesisState if err := cdc.UnmarshalJSON(bz, &genState); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) @@ -71,7 +71,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod } // RegisterRESTRoutes registers the capability module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, rtr *mux.Router) { } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. diff --git a/x/auctionsV2/module_simulation.go b/x/auctionsV2/module_simulation.go index bda25b1ea..b1c922bb0 100644 --- a/x/auctionsV2/module_simulation.go +++ b/x/auctionsV2/module_simulation.go @@ -39,7 +39,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { return nil } @@ -53,7 +53,7 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP 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 { +func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) // this line is used by starport scaffolding # simapp/module/operation diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 35fa4a2a4..e98807e6f 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -221,7 +221,7 @@ type AuctionParams struct { 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"` - // For external apps + //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"` } diff --git a/x/auctionsV2/types/codec.go b/x/auctionsV2/types/codec.go index 3b77a28f0..360bc0a2e 100644 --- a/x/auctionsV2/types/codec.go +++ b/x/auctionsV2/types/codec.go @@ -40,6 +40,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 6bc42a077..2a9adfe68 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -24,4 +24,5 @@ var ( 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") + ErrorInsufficientReserveBalance = sdkerrors.Register(ModuleName, 717, "Insufficient Reserve Balance for this transaction") ) diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 9cc3cb233..03719e4e7 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -447,6 +447,94 @@ func (m *QueryBidsResponse) GetPagination() *query.PageResponse { return nil } +type QueryBidRequest struct { + BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` +} + +func (m *QueryBidRequest) Reset() { *m = QueryBidRequest{} } +func (m *QueryBidRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBidRequest) ProtoMessage() {} +func (*QueryBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{8} +} +func (m *QueryBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBidRequest.Merge(m, src) +} +func (m *QueryBidRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBidRequest proto.InternalMessageInfo + +func (m *QueryBidRequest) GetBidId() uint64 { + if m != nil { + return m.BidId + } + return 0 +} + +type QueryBidResponse struct { + Bid Bid `protobuf:"bytes,1,opt,name=bid,proto3" json:"bid" yaml:"bid"` +} + +func (m *QueryBidResponse) Reset() { *m = QueryBidResponse{} } +func (m *QueryBidResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBidResponse) ProtoMessage() {} +func (*QueryBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{9} +} +func (m *QueryBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBidResponse.Merge(m, src) +} +func (m *QueryBidResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBidResponse proto.InternalMessageInfo + +func (m *QueryBidResponse) GetBid() Bid { + if m != nil { + return m.Bid + } + return Bid{} +} + type QueryAuctionParamsRequest struct { } @@ -454,7 +542,7 @@ func (m *QueryAuctionParamsRequest) Reset() { *m = QueryAuctionParamsReq func (m *QueryAuctionParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryAuctionParamsRequest) ProtoMessage() {} func (*QueryAuctionParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{8} + return fileDescriptor_5270c3f1c79728ac, []int{10} } func (m *QueryAuctionParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -491,7 +579,7 @@ func (m *QueryAuctionParamsResponse) Reset() { *m = QueryAuctionParamsRe func (m *QueryAuctionParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryAuctionParamsResponse) ProtoMessage() {} func (*QueryAuctionParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{9} + return fileDescriptor_5270c3f1c79728ac, []int{11} } func (m *QueryAuctionParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -538,7 +626,7 @@ func (m *QueryUserLimitBidsByAssetIDRequest) Reset() { *m = QueryUserLim func (m *QueryUserLimitBidsByAssetIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryUserLimitBidsByAssetIDRequest) ProtoMessage() {} func (*QueryUserLimitBidsByAssetIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{10} + return fileDescriptor_5270c3f1c79728ac, []int{12} } func (m *QueryUserLimitBidsByAssetIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -606,7 +694,7 @@ func (m *QueryUserLimitBidsByAssetIDResponse) Reset() { *m = QueryUserLi func (m *QueryUserLimitBidsByAssetIDResponse) String() string { return proto.CompactTextString(m) } func (*QueryUserLimitBidsByAssetIDResponse) ProtoMessage() {} func (*QueryUserLimitBidsByAssetIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{11} + return fileDescriptor_5270c3f1c79728ac, []int{13} } func (m *QueryUserLimitBidsByAssetIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -666,7 +754,7 @@ func (m *QueryLimitBidsRequest) Reset() { *m = QueryLimitBidsRequest{} } func (m *QueryLimitBidsRequest) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidsRequest) ProtoMessage() {} func (*QueryLimitBidsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{12} + return fileDescriptor_5270c3f1c79728ac, []int{14} } func (m *QueryLimitBidsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -725,7 +813,7 @@ func (m *QueryLimitBidsResponse) Reset() { *m = QueryLimitBidsResponse{} func (m *QueryLimitBidsResponse) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidsResponse) ProtoMessage() {} func (*QueryLimitBidsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{13} + return fileDescriptor_5270c3f1c79728ac, []int{15} } func (m *QueryLimitBidsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -776,7 +864,7 @@ func (m *QueryLimitBidProtocolDataRequest) Reset() { *m = QueryLimitBidP func (m *QueryLimitBidProtocolDataRequest) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidProtocolDataRequest) ProtoMessage() {} func (*QueryLimitBidProtocolDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{14} + return fileDescriptor_5270c3f1c79728ac, []int{16} } func (m *QueryLimitBidProtocolDataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -821,7 +909,7 @@ func (m *QueryLimitBidProtocolDataResponse) Reset() { *m = QueryLimitBid func (m *QueryLimitBidProtocolDataResponse) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidProtocolDataResponse) ProtoMessage() {} func (*QueryLimitBidProtocolDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{15} + return fileDescriptor_5270c3f1c79728ac, []int{17} } func (m *QueryLimitBidProtocolDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -876,7 +964,7 @@ func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) String() string { } func (*QueryAuctionFeesCollectionFromLimitBidTxRequest) ProtoMessage() {} func (*QueryAuctionFeesCollectionFromLimitBidTxRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{16} + return fileDescriptor_5270c3f1c79728ac, []int{18} } func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -925,7 +1013,7 @@ func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) String() string { } func (*QueryAuctionFeesCollectionFromLimitBidTxResponse) ProtoMessage() {} func (*QueryAuctionFeesCollectionFromLimitBidTxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{17} + return fileDescriptor_5270c3f1c79728ac, []int{19} } func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -979,7 +1067,7 @@ func (m *QueryLimitBidProtocolDataWithUserRequest) Reset() { func (m *QueryLimitBidProtocolDataWithUserRequest) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidProtocolDataWithUserRequest) ProtoMessage() {} func (*QueryLimitBidProtocolDataWithUserRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{18} + return fileDescriptor_5270c3f1c79728ac, []int{20} } func (m *QueryLimitBidProtocolDataWithUserRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1035,7 +1123,7 @@ func (m *QueryLimitBidProtocolDataWithUserResponse) String() string { } func (*QueryLimitBidProtocolDataWithUserResponse) ProtoMessage() {} func (*QueryLimitBidProtocolDataWithUserResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{19} + return fileDescriptor_5270c3f1c79728ac, []int{21} } func (m *QueryLimitBidProtocolDataWithUserResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1089,7 +1177,7 @@ func (m *QueryBidsFilterRequest) Reset() { *m = QueryBidsFilterRequest{} func (m *QueryBidsFilterRequest) String() string { return proto.CompactTextString(m) } func (*QueryBidsFilterRequest) ProtoMessage() {} func (*QueryBidsFilterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{20} + return fileDescriptor_5270c3f1c79728ac, []int{22} } func (m *QueryBidsFilterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1156,7 +1244,7 @@ func (m *QueryBidsFilterResponse) Reset() { *m = QueryBidsFilterResponse func (m *QueryBidsFilterResponse) String() string { return proto.CompactTextString(m) } func (*QueryBidsFilterResponse) ProtoMessage() {} func (*QueryBidsFilterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{21} + return fileDescriptor_5270c3f1c79728ac, []int{23} } func (m *QueryBidsFilterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1215,7 +1303,7 @@ func (m *QueryAuctionsHistoryRequest) Reset() { *m = QueryAuctionsHistor func (m *QueryAuctionsHistoryRequest) String() string { return proto.CompactTextString(m) } func (*QueryAuctionsHistoryRequest) ProtoMessage() {} func (*QueryAuctionsHistoryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{22} + return fileDescriptor_5270c3f1c79728ac, []int{24} } func (m *QueryAuctionsHistoryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1267,7 +1355,7 @@ func (m *QueryAuctionsHistoryResponse) Reset() { *m = QueryAuctionsHisto func (m *QueryAuctionsHistoryResponse) String() string { return proto.CompactTextString(m) } func (*QueryAuctionsHistoryResponse) ProtoMessage() {} func (*QueryAuctionsHistoryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{23} + return fileDescriptor_5270c3f1c79728ac, []int{25} } func (m *QueryAuctionsHistoryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1319,6 +1407,8 @@ func init() { proto.RegisterType((*QueryAuctionsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionsResponse") proto.RegisterType((*QueryBidsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryBidsRequest") proto.RegisterType((*QueryBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryBidsResponse") + proto.RegisterType((*QueryBidRequest)(nil), "comdex.auctionsV2.v1beta1.QueryBidRequest") + proto.RegisterType((*QueryBidResponse)(nil), "comdex.auctionsV2.v1beta1.QueryBidResponse") proto.RegisterType((*QueryAuctionParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionParamsRequest") proto.RegisterType((*QueryAuctionParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionParamsResponse") proto.RegisterType((*QueryUserLimitBidsByAssetIDRequest)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsByAssetIDRequest") @@ -1342,107 +1432,111 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1597 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x6c, 0xdc, 0xc4, - 0x17, 0xcf, 0x6c, 0xf2, 0xcf, 0xc7, 0x4b, 0xd3, 0x36, 0x93, 0x34, 0x1f, 0x6e, 0xba, 0x49, 0xdc, - 0x3f, 0x69, 0xfa, 0x91, 0x75, 0x92, 0x7e, 0xaa, 0xa5, 0x29, 0xdd, 0xb6, 0xa1, 0x29, 0xa8, 0x14, - 0x2b, 0x6d, 0x25, 0xa4, 0xb2, 0xf2, 0xae, 0x9d, 0xc4, 0xaa, 0x77, 0xbd, 0x5d, 0x3b, 0xa5, 0x51, - 0x94, 0x03, 0x5c, 0x41, 0xa2, 0x12, 0x12, 0x27, 0x24, 0xd4, 0x0b, 0xe2, 0xc0, 0x09, 0x71, 0xe2, - 0x00, 0x12, 0x42, 0xa8, 0xe2, 0x14, 0x89, 0x0b, 0xe2, 0x10, 0x41, 0x0b, 0xe2, 0x54, 0x21, 0x72, - 0xe0, 0xc2, 0x05, 0x79, 0xe6, 0x79, 0x77, 0xed, 0x78, 0x6d, 0x6f, 0xd9, 0x54, 0x15, 0xa7, 0xac, - 0xed, 0x37, 0x6f, 0x7e, 0xbf, 0xf7, 0x7b, 0x6f, 0x66, 0xde, 0x04, 0x5e, 0xc8, 0x99, 0x79, 0x55, - 0xbb, 0x27, 0x29, 0xcb, 0x39, 0x5b, 0x37, 0x0b, 0xd6, 0x8d, 0x69, 0xe9, 0xee, 0x54, 0x56, 0xb3, - 0x95, 0x29, 0xe9, 0xce, 0xb2, 0x56, 0x5a, 0x49, 0x15, 0x4b, 0xa6, 0x6d, 0xd2, 0x41, 0x6e, 0x96, - 0xaa, 0x98, 0xa5, 0xd0, 0x4c, 0xe8, 0x5d, 0x34, 0x17, 0x4d, 0x66, 0x25, 0x39, 0xbf, 0xf8, 0x00, - 0x61, 0x68, 0xd1, 0x34, 0x17, 0x0d, 0x4d, 0x52, 0x8a, 0xba, 0xa4, 0x14, 0x0a, 0xa6, 0xad, 0xb0, - 0x71, 0xf8, 0xf5, 0x50, 0xce, 0xb4, 0xf2, 0xa6, 0x25, 0x65, 0x15, 0x4b, 0xe3, 0xf3, 0x94, 0x67, - 0x2d, 0x2a, 0x8b, 0x7a, 0x81, 0x19, 0xa3, 0xed, 0x58, 0x6d, 0x84, 0x45, 0xa5, 0xa4, 0xe4, 0x5d, - 0x9f, 0x07, 0x6a, 0xdb, 0xe1, 0x2b, 0x34, 0xdc, 0x5f, 0xdb, 0x30, 0xab, 0xab, 0xdc, 0x48, 0xec, - 0x05, 0xfa, 0xba, 0x83, 0xeb, 0x1a, 0x9b, 0x42, 0xd6, 0xee, 0x2c, 0x6b, 0x96, 0x2d, 0xde, 0x80, - 0x1e, 0xcf, 0x5b, 0xab, 0x68, 0x16, 0x2c, 0x8d, 0x9e, 0x83, 0x56, 0x0e, 0x65, 0x80, 0x8c, 0x90, - 0xf1, 0xce, 0xe9, 0xd1, 0x54, 0xcd, 0x70, 0xa5, 0xf8, 0xd0, 0x74, 0xcb, 0xc3, 0x8d, 0xe1, 0x26, - 0x19, 0x87, 0x89, 0x57, 0xd1, 0xef, 0x79, 0x6e, 0x8f, 0xd3, 0xd1, 0x7d, 0x00, 0xe8, 0x21, 0xa3, - 0xab, 0xcc, 0x77, 0x8b, 0xdc, 0x81, 0x6f, 0xe6, 0x54, 0x3a, 0x00, 0x6d, 0x4b, 0xba, 0x65, 0x9b, - 0xa5, 0x95, 0x81, 0xc4, 0x08, 0x19, 0x6f, 0x97, 0xdd, 0x47, 0xd1, 0x80, 0x5e, 0xaf, 0x3f, 0x04, - 0x3a, 0x0f, 0x6d, 0x38, 0x1c, 0x91, 0x8a, 0x21, 0x48, 0x71, 0x70, 0xba, 0xcf, 0x81, 0xba, 0xb9, - 0x31, 0xbc, 0x73, 0x45, 0xc9, 0x1b, 0xa7, 0x45, 0xb4, 0x14, 0x65, 0xd7, 0x95, 0xf8, 0x39, 0xf1, - 0x4e, 0xe7, 0x86, 0x8b, 0x8e, 0xc2, 0x0e, 0x17, 0xbf, 0xbd, 0x52, 0xd4, 0x90, 0x41, 0x27, 0xbe, - 0x9b, 0x5f, 0x29, 0x6a, 0xb5, 0x39, 0xd0, 0x5b, 0x00, 0x95, 0x5c, 0x18, 0x68, 0x66, 0x70, 0xc7, - 0x52, 0x3c, 0x71, 0x52, 0x4e, 0xe2, 0xa4, 0x78, 0x82, 0x56, 0x02, 0xbb, 0xa8, 0xe1, 0xc4, 0xe9, - 0x3d, 0x9b, 0x1b, 0xc3, 0xdd, 0x1c, 0x6e, 0xc5, 0x87, 0x28, 0x57, 0x39, 0x14, 0xd7, 0x09, 0xec, - 0xf1, 0x81, 0xc6, 0x20, 0xdd, 0x84, 0x76, 0x37, 0x1a, 0x03, 0x64, 0xa4, 0x39, 0x66, 0x94, 0xfa, - 0x31, 0x4a, 0xbb, 0x3c, 0x51, 0xb2, 0x44, 0xb9, 0xec, 0x8c, 0xbe, 0xe9, 0x61, 0x94, 0x60, 0x8c, - 0x0e, 0x44, 0x32, 0xe2, 0xa8, 0xe2, 0x50, 0xfa, 0x8a, 0xc0, 0x6e, 0x46, 0x29, 0xad, 0xab, 0x65, - 0x0d, 0xfa, 0xa0, 0x35, 0xab, 0xab, 0xaa, 0x56, 0x62, 0xd1, 0xef, 0x90, 0xf1, 0x89, 0x0e, 0x42, - 0x7b, 0x56, 0x57, 0xb9, 0x2e, 0x09, 0xa6, 0x4b, 0x5b, 0x56, 0x57, 0xfd, 0x9a, 0x34, 0x87, 0x69, - 0xd2, 0xd2, 0x68, 0x4d, 0x7e, 0x27, 0xd0, 0x5d, 0x45, 0x00, 0xf5, 0x38, 0xe8, 0x65, 0x90, 0xee, - 0xde, 0xdc, 0x18, 0xee, 0xe2, 0x8e, 0xf8, 0x7b, 0xb1, 0x4c, 0xea, 0x65, 0x68, 0xc9, 0xea, 0xaa, - 0x35, 0x90, 0x60, 0xb2, 0x25, 0x43, 0x64, 0x4b, 0xeb, 0x6a, 0xba, 0x07, 0x25, 0xeb, 0x2c, 0x3b, - 0xb3, 0x44, 0x99, 0x39, 0xf0, 0x49, 0xd5, 0xdc, 0x70, 0xa9, 0xf6, 0xc2, 0x60, 0x75, 0xf2, 0x79, - 0x57, 0x99, 0xf7, 0x08, 0x08, 0x41, 0x5f, 0x31, 0x1e, 0x05, 0xd8, 0xe9, 0x56, 0x95, 0x67, 0xd5, - 0x19, 0x8f, 0xce, 0x52, 0x5c, 0x7c, 0xf6, 0x21, 0xf1, 0x3d, 0x9e, 0x5c, 0x45, 0x6f, 0xa2, 0xdc, - 0xa5, 0x54, 0x5b, 0x8b, 0x7f, 0x10, 0x10, 0x19, 0x9c, 0xeb, 0x96, 0x56, 0x7a, 0x55, 0xcf, 0xeb, - 0xb6, 0x23, 0x4f, 0x7a, 0xe5, 0xbc, 0x65, 0x69, 0xf6, 0xdc, 0xc5, 0xa8, 0x44, 0x4b, 0x41, 0x4f, - 0xce, 0x34, 0x0c, 0xc5, 0xd6, 0x4a, 0x8a, 0x91, 0xb1, 0xcd, 0xdb, 0x1a, 0x5b, 0xcd, 0x78, 0xce, - 0x75, 0x57, 0x3e, 0xcd, 0x3b, 0x5f, 0xe6, 0x54, 0x2a, 0x42, 0x97, 0xaa, 0x65, 0xed, 0x8a, 0x65, - 0x33, 0x5f, 0x35, 0x9c, 0x97, 0xae, 0xcd, 0x36, 0xe7, 0xe1, 0xfb, 0xcd, 0xb0, 0x3f, 0x94, 0x71, - 0xfd, 0x99, 0xb9, 0x04, 0x3b, 0x6c, 0xd3, 0x56, 0x8c, 0x8c, 0x92, 0x37, 0x97, 0x0b, 0x36, 0xa3, - 0xdf, 0x91, 0xbe, 0xe4, 0x08, 0xf1, 0xd3, 0xc6, 0xf0, 0xd8, 0xa2, 0x6e, 0x2f, 0x2d, 0x67, 0x1d, - 0x01, 0x25, 0xdc, 0x1a, 0xf9, 0x9f, 0x09, 0x4b, 0xbd, 0x2d, 0x39, 0x35, 0x6a, 0xa5, 0xe6, 0x0a, - 0xf6, 0xe6, 0xc6, 0x70, 0x0f, 0x77, 0x5f, 0xed, 0x4b, 0x94, 0x3b, 0xd9, 0xe3, 0x79, 0xf6, 0x44, - 0x2d, 0xd8, 0x6d, 0x38, 0x90, 0x33, 0x66, 0x49, 0xd5, 0x4a, 0x19, 0x56, 0x0f, 0xcd, 0xac, 0x1e, - 0xc2, 0x12, 0x84, 0xb1, 0x7c, 0xcd, 0x19, 0xe1, 0x54, 0xc6, 0x30, 0x26, 0x48, 0x3f, 0x9f, 0xcd, - 0xef, 0x4f, 0x94, 0x77, 0x1a, 0xd5, 0xf6, 0xfe, 0x7a, 0x69, 0x69, 0x78, 0xbd, 0x7c, 0xef, 0xae, - 0xd6, 0x65, 0x35, 0xdc, 0xb4, 0xab, 0x91, 0x5e, 0x24, 0x76, 0x7a, 0x25, 0xa2, 0xd2, 0xab, 0xe1, - 0x5b, 0xcf, 0x13, 0x02, 0x7d, 0x7e, 0x32, 0x98, 0x51, 0x41, 0xe2, 0x91, 0x67, 0x2b, 0x5e, 0xe3, - 0xf7, 0xa5, 0xb7, 0x09, 0x8c, 0x78, 0xf8, 0x5e, 0x73, 0x8e, 0x58, 0x39, 0xd3, 0xb8, 0xa8, 0xd8, - 0x8a, 0xab, 0xa3, 0x37, 0xe6, 0xa4, 0xd1, 0x31, 0xff, 0x28, 0x01, 0xa3, 0x21, 0x18, 0x30, 0xfc, - 0x1f, 0x12, 0xe8, 0xe7, 0xf1, 0x72, 0xf6, 0xc6, 0x22, 0x9a, 0x64, 0x54, 0xc5, 0x56, 0x50, 0x86, - 0x93, 0x51, 0x32, 0xf8, 0x5c, 0xcf, 0x9a, 0x25, 0xbe, 0xa3, 0x8d, 0xa1, 0x2a, 0xc9, 0x6a, 0x55, - 0xb6, 0xcc, 0x22, 0xca, 0xbd, 0x46, 0x80, 0x97, 0x6d, 0x97, 0xe8, 0x3e, 0x01, 0xa9, 0x7a, 0xcb, - 0x99, 0xd5, 0x34, 0xeb, 0x82, 0x69, 0x18, 0x1a, 0x7f, 0x2a, 0x99, 0x79, 0x97, 0xdc, 0xfc, 0xbd, - 0x67, 0xa4, 0xd8, 0x6f, 0x09, 0x98, 0x8c, 0x0f, 0x09, 0x05, 0x5c, 0x27, 0x70, 0xd0, 0xdd, 0xce, - 0x16, 0x34, 0xcd, 0xca, 0xe4, 0xca, 0x23, 0x32, 0x0b, 0x25, 0x33, 0x9f, 0xa9, 0xc4, 0xdd, 0xbe, - 0x87, 0x92, 0xce, 0x44, 0xef, 0x9b, 0x61, 0x73, 0xa7, 0x4f, 0xa1, 0xb2, 0x93, 0xde, 0xdd, 0x34, - 0x72, 0x7a, 0x51, 0xde, 0xaf, 0x44, 0xbb, 0xdf, 0x76, 0xe9, 0x1f, 0x10, 0x18, 0xaf, 0x59, 0x19, - 0x37, 0x75, 0x7b, 0xc9, 0xd9, 0x04, 0xa3, 0x36, 0xf9, 0x5b, 0x01, 0x20, 0x1b, 0x98, 0x0b, 0x0f, - 0x13, 0x70, 0x30, 0x06, 0x46, 0x4c, 0x82, 0x2f, 0x09, 0x8c, 0xd6, 0xa8, 0xaf, 0xcc, 0x5b, 0xba, - 0xbd, 0x94, 0x59, 0xb6, 0x18, 0x01, 0x47, 0xfc, 0x73, 0x75, 0xd6, 0xb3, 0x3b, 0x59, 0xb9, 0xae, - 0x27, 0x51, 0xfd, 0xf1, 0xd0, 0xba, 0xae, 0xcc, 0x2b, 0xca, 0x43, 0x46, 0x88, 0xdf, 0x6d, 0x97, - 0xfb, 0x5b, 0x77, 0xf3, 0x71, 0x96, 0xfe, 0x59, 0xdd, 0xb0, 0xa3, 0xc5, 0x7d, 0x1e, 0x5b, 0x85, - 0x27, 0x04, 0xfa, 0xb7, 0xd0, 0xf8, 0x0f, 0x37, 0x0c, 0x1f, 0x13, 0xd8, 0xeb, 0x69, 0x57, 0x2f, - 0xf3, 0x38, 0xd7, 0xd1, 0x6a, 0x6f, 0x73, 0x8d, 0xfe, 0x42, 0x60, 0x28, 0x18, 0x21, 0xca, 0xa2, - 0x6c, 0xe9, 0xab, 0x8f, 0x44, 0xaf, 0xbc, 0xdc, 0x89, 0x9e, 0x53, 0x8c, 0xe7, 0xa0, 0xc3, 0x9e, - 0xfe, 0x82, 0xc2, 0xff, 0x18, 0x47, 0xfa, 0x2e, 0x81, 0x56, 0xde, 0x1f, 0xd1, 0x89, 0x10, 0x16, - 0x5b, 0xef, 0x90, 0x84, 0x54, 0x5c, 0x73, 0x0e, 0x4b, 0x14, 0xdf, 0xf9, 0xe1, 0xd7, 0x0f, 0x12, - 0x43, 0x54, 0x90, 0x7c, 0xf7, 0x56, 0xd2, 0xdd, 0x69, 0xbc, 0x01, 0xa3, 0x9f, 0x10, 0x68, 0xc3, - 0x80, 0xd1, 0x48, 0xff, 0xde, 0x4b, 0x26, 0x41, 0x8a, 0x6d, 0x8f, 0x80, 0x4e, 0x33, 0x40, 0xc7, - 0xe8, 0x74, 0x10, 0x20, 0xfc, 0x2d, 0xad, 0x56, 0x2e, 0xae, 0xd6, 0xa4, 0x55, 0x5c, 0x14, 0xd6, - 0xe8, 0x67, 0x04, 0xda, 0xdd, 0xfc, 0xa0, 0x71, 0x67, 0x2e, 0x87, 0x6e, 0x32, 0xfe, 0x00, 0xc4, - 0x7a, 0x96, 0x61, 0x3d, 0x49, 0x8f, 0x87, 0x60, 0xb5, 0x2a, 0x60, 0x9d, 0xd2, 0xa9, 0x86, 0xfb, - 0x80, 0x40, 0x0b, 0x3b, 0x22, 0x1f, 0x8e, 0x9a, 0xb9, 0xaa, 0x25, 0x11, 0x8e, 0xc4, 0x33, 0x46, - 0x88, 0x33, 0x0c, 0xe2, 0x29, 0x7a, 0x22, 0x08, 0xa2, 0xb3, 0xb6, 0x48, 0xab, 0x7c, 0xb1, 0x5a, - 0x63, 0x3f, 0xb6, 0x60, 0xfc, 0x94, 0x40, 0x97, 0xa7, 0xbd, 0xa7, 0xc7, 0x62, 0x86, 0xc9, 0x9b, - 0x97, 0xc7, 0xeb, 0x1c, 0x85, 0xf0, 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, + // 1664 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x6c, 0x1b, 0x45, + 0x14, 0xce, 0xd8, 0x69, 0x7e, 0x5e, 0x9a, 0xb6, 0x99, 0xfc, 0xbb, 0xa9, 0x93, 0x4c, 0x21, 0x4d, + 0x7f, 0xe2, 0x4d, 0xd2, 0x5f, 0xb5, 0x34, 0xa5, 0x6e, 0x1a, 0x9a, 0x82, 0x4a, 0x59, 0xa5, 0x2d, + 0x42, 0x2a, 0xd6, 0xda, 0xbb, 0x71, 0x56, 0x5d, 0x7b, 0x5d, 0xef, 0xa6, 0x34, 0x8a, 0x72, 0x80, + 0x13, 0x12, 0x48, 0x54, 0x42, 0xe2, 0x84, 0x84, 0x7a, 0x41, 0x1c, 0x38, 0x71, 0xe4, 0x40, 0x25, + 0x84, 0x50, 0xc5, 0x29, 0x12, 0x17, 0xc4, 0x21, 0x82, 0x16, 0xc4, 0xa9, 0x42, 0xe4, 0xc0, 0x85, + 0x0b, 0xda, 0xd9, 0xb7, 0xb6, 0xd7, 0x59, 0xef, 0xae, 0x8b, 0x53, 0x55, 0x9c, 0xe2, 0xdd, 0x7d, + 0xf3, 0xe6, 0xfb, 0xe6, 0x7b, 0x6f, 0xde, 0xbc, 0x09, 0xbc, 0x98, 0xd1, 0x73, 0xb2, 0x72, 0x57, + 0x90, 0x96, 0x33, 0xa6, 0xaa, 0xe7, 0x8d, 0xeb, 0xd3, 0xc2, 0x9d, 0xa9, 0xb4, 0x62, 0x4a, 0x53, + 0xc2, 0xed, 0x65, 0xa5, 0xb8, 0x92, 0x28, 0x14, 0x75, 0x53, 0xa7, 0x83, 0xb6, 0x59, 0xa2, 0x6c, + 0x96, 0x40, 0xb3, 0x58, 0x4f, 0x56, 0xcf, 0xea, 0xdc, 0x4a, 0xb0, 0x7e, 0xd9, 0x03, 0x62, 0x43, + 0x59, 0x5d, 0xcf, 0x6a, 0x8a, 0x20, 0x15, 0x54, 0x41, 0xca, 0xe7, 0x75, 0x53, 0xe2, 0xe3, 0xf0, + 0xeb, 0xa1, 0x8c, 0x6e, 0xe4, 0x74, 0x43, 0x48, 0x4b, 0x86, 0x62, 0xcf, 0x53, 0x9a, 0xb5, 0x20, + 0x65, 0xd5, 0x3c, 0x37, 0x46, 0xdb, 0xb1, 0xda, 0x08, 0x0b, 0x52, 0x51, 0xca, 0x39, 0x3e, 0x0f, + 0xd4, 0xb6, 0xc3, 0x57, 0x68, 0xb8, 0xbf, 0xb6, 0x61, 0x5a, 0x95, 0x6d, 0x23, 0xd6, 0x03, 0xf4, + 0x0d, 0x0b, 0xd7, 0x55, 0x3e, 0x85, 0xa8, 0xdc, 0x5e, 0x56, 0x0c, 0x93, 0x5d, 0x87, 0x6e, 0xd7, + 0x5b, 0xa3, 0xa0, 0xe7, 0x0d, 0x85, 0x9e, 0x83, 0x16, 0x1b, 0xca, 0x00, 0x19, 0x21, 0xe3, 0x1d, + 0xd3, 0xa3, 0x89, 0x9a, 0xcb, 0x95, 0xb0, 0x87, 0x26, 0x9b, 0x1f, 0x6e, 0x0c, 0x37, 0x89, 0x38, + 0x8c, 0x5d, 0x41, 0xbf, 0xe7, 0x6d, 0x7b, 0x9c, 0x8e, 0xee, 0x03, 0x40, 0x0f, 0x29, 0x55, 0xe6, + 0xbe, 0x9b, 0xc5, 0x76, 0x7c, 0x33, 0x2f, 0xd3, 0x01, 0x68, 0x5d, 0x52, 0x0d, 0x53, 0x2f, 0xae, + 0x0c, 0x44, 0x46, 0xc8, 0x78, 0x9b, 0xe8, 0x3c, 0x32, 0x0d, 0x7a, 0xdc, 0xfe, 0x10, 0xe8, 0x02, + 0xb4, 0xe2, 0x70, 0x44, 0xca, 0x7c, 0x90, 0xe2, 0xe0, 0x64, 0x9f, 0x05, 0x75, 0x73, 0x63, 0x78, + 0xd7, 0x8a, 0x94, 0xd3, 0x4e, 0x33, 0xb4, 0x64, 0xa2, 0xe3, 0x8a, 0x7d, 0x45, 0xdc, 0xd3, 0x39, + 0xcb, 0x45, 0x47, 0x61, 0xa7, 0x83, 0xdf, 0x5c, 0x29, 0x28, 0xc8, 0xa0, 0x03, 0xdf, 0x2d, 0xac, + 0x14, 0x94, 0xda, 0x1c, 0xe8, 0x4d, 0x80, 0x72, 0x2c, 0x0c, 0x44, 0x39, 0xdc, 0xb1, 0x84, 0x1d, + 0x38, 0x09, 0x2b, 0x70, 0x12, 0x76, 0x80, 0x96, 0x17, 0x36, 0xab, 0xe0, 0xc4, 0xc9, 0xde, 0xcd, + 0x8d, 0xe1, 0x2e, 0x1b, 0x6e, 0xd9, 0x07, 0x13, 0x2b, 0x1c, 0xb2, 0x75, 0x02, 0xbd, 0x55, 0xa0, + 0x71, 0x91, 0x6e, 0x40, 0x9b, 0xb3, 0x1a, 0x03, 0x64, 0x24, 0x1a, 0x72, 0x95, 0xfa, 0x71, 0x95, + 0x76, 0xbb, 0x56, 0xc9, 0x60, 0x62, 0xc9, 0x19, 0x7d, 0xdb, 0xc5, 0x28, 0xc2, 0x19, 0x1d, 0x08, + 0x64, 0x64, 0xa3, 0x0a, 0x43, 0xe9, 0x1b, 0x02, 0x7b, 0x38, 0xa5, 0xa4, 0x2a, 0x97, 0x34, 0xe8, + 0x83, 0x96, 0xb4, 0x2a, 0xcb, 0x4a, 0x91, 0xaf, 0x7e, 0xbb, 0x88, 0x4f, 0x74, 0x10, 0xda, 0xd2, + 0xaa, 0x6c, 0xeb, 0x12, 0xe1, 0xba, 0xb4, 0xa6, 0x55, 0xb9, 0x5a, 0x93, 0xa8, 0x9f, 0x26, 0xcd, + 0x8d, 0xd6, 0xe4, 0x0f, 0x02, 0x5d, 0x15, 0x04, 0x50, 0x8f, 0x83, 0x6e, 0x06, 0xc9, 0xae, 0xcd, + 0x8d, 0xe1, 0x4e, 0xdb, 0x91, 0xfd, 0x9e, 0x95, 0x48, 0xbd, 0x02, 0xcd, 0x69, 0x55, 0x36, 0x06, + 0x22, 0x5c, 0xb6, 0xb8, 0x8f, 0x6c, 0x49, 0x55, 0x4e, 0x76, 0xa3, 0x64, 0x1d, 0x25, 0x67, 0x06, + 0x13, 0xb9, 0x83, 0x2a, 0xa9, 0xa2, 0x0d, 0x97, 0x6a, 0x1c, 0x76, 0x3b, 0x44, 0x1d, 0xa1, 0x7a, + 0x39, 0xcd, 0x72, 0xa2, 0xef, 0x48, 0xab, 0xf2, 0xbc, 0xcc, 0xde, 0x2c, 0x6b, 0x5a, 0x5a, 0x91, + 0x59, 0x88, 0xa6, 0xd1, 0x2e, 0x98, 0x25, 0x45, 0x96, 0x50, 0x62, 0xc9, 0x44, 0x6b, 0x38, 0xdb, + 0x0b, 0x83, 0x95, 0x09, 0xe0, 0xde, 0xe9, 0x3e, 0x24, 0x10, 0xf3, 0xfa, 0x8a, 0x08, 0xf2, 0xb0, + 0xcb, 0xc9, 0x6c, 0xd7, 0xce, 0x37, 0x1e, 0x9c, 0x29, 0xb8, 0x01, 0xee, 0x43, 0x58, 0xbd, 0xae, + 0x7c, 0x41, 0x6f, 0x4c, 0xec, 0x94, 0x2a, 0xad, 0xd9, 0x9f, 0x04, 0x18, 0x87, 0x73, 0xcd, 0x50, + 0x8a, 0xaf, 0xa9, 0x39, 0xd5, 0xb4, 0x42, 0x24, 0xb9, 0x72, 0xde, 0x30, 0x14, 0x73, 0x7e, 0x36, + 0x28, 0xd8, 0x13, 0xd0, 0x9d, 0xd1, 0x35, 0x4d, 0x32, 0x95, 0xa2, 0xa4, 0xa5, 0x4c, 0xfd, 0x96, + 0xc2, 0x77, 0x54, 0x3b, 0xee, 0xbb, 0xca, 0x9f, 0x16, 0xac, 0x2f, 0xf3, 0x32, 0x65, 0xd0, 0x29, + 0x2b, 0x69, 0xb3, 0x6c, 0x19, 0xb5, 0x77, 0x2e, 0xeb, 0xa5, 0x63, 0xb3, 0xcd, 0xb9, 0xf0, 0x51, + 0x14, 0xf6, 0xfb, 0x32, 0xae, 0x3f, 0x3b, 0x96, 0x60, 0xa7, 0xa9, 0x9b, 0x92, 0x96, 0x92, 0x72, + 0xfa, 0x72, 0xde, 0xe4, 0xf4, 0xdb, 0x93, 0x17, 0x2d, 0x21, 0x7e, 0xde, 0x18, 0x1e, 0xcb, 0xaa, + 0xe6, 0xd2, 0x72, 0xda, 0x12, 0x50, 0xc0, 0xf2, 0x6c, 0xff, 0x99, 0x30, 0xe4, 0x5b, 0x82, 0xb5, + 0x4f, 0x18, 0x89, 0xf9, 0xbc, 0xb9, 0xb9, 0x31, 0xdc, 0x6d, 0xbb, 0xaf, 0xf4, 0xc5, 0xc4, 0x0e, + 0xfe, 0x78, 0x9e, 0x3f, 0x51, 0x03, 0xf6, 0x68, 0x16, 0xe4, 0x94, 0x5e, 0x94, 0x95, 0x62, 0x8a, + 0xe7, 0x64, 0x94, 0xe7, 0xa4, 0x5f, 0x80, 0x70, 0x96, 0xaf, 0x5b, 0x23, 0xac, 0xb8, 0x1d, 0xc6, + 0x00, 0xe9, 0xb7, 0x67, 0xab, 0xf6, 0xc7, 0xc4, 0x5d, 0x5a, 0xa5, 0x7d, 0x75, 0xce, 0x36, 0x37, + 0x3c, 0x67, 0x7f, 0x70, 0x2a, 0x46, 0x49, 0x0d, 0x27, 0xec, 0x6a, 0x84, 0x17, 0x09, 0x1d, 0x5e, + 0x91, 0xa0, 0xf0, 0x6a, 0x78, 0xf9, 0x7b, 0x42, 0xa0, 0xaf, 0x9a, 0x0c, 0x46, 0x94, 0x97, 0x78, + 0xe4, 0xd9, 0x8a, 0xd7, 0xf8, 0xda, 0xf8, 0x2e, 0x81, 0x11, 0x17, 0xdf, 0xab, 0xd6, 0x31, 0x2f, + 0xa3, 0x6b, 0xb3, 0x92, 0x29, 0x39, 0x3a, 0xba, 0xd7, 0x9c, 0x34, 0x7a, 0xcd, 0x3f, 0x8d, 0xc0, + 0xa8, 0x0f, 0x06, 0x5c, 0xfe, 0x4f, 0x08, 0xf4, 0xdb, 0xeb, 0x65, 0x95, 0x83, 0x02, 0x9a, 0xa4, + 0x64, 0xc9, 0x94, 0x50, 0x86, 0x93, 0x41, 0x32, 0x54, 0xb9, 0x9e, 0xd3, 0x8b, 0x76, 0x09, 0x19, + 0x43, 0x55, 0xe2, 0x95, 0xaa, 0x6c, 0x99, 0x85, 0x89, 0x3d, 0x9a, 0x87, 0x97, 0x6d, 0x97, 0xe8, + 0x1e, 0x01, 0xa1, 0xb2, 0xe4, 0xcc, 0x29, 0x8a, 0x71, 0x41, 0xd7, 0x34, 0xc5, 0x7e, 0x2a, 0xea, + 0x39, 0x87, 0xdc, 0xc2, 0xdd, 0x67, 0xa4, 0xd8, 0xef, 0x11, 0x98, 0x0c, 0x0f, 0x09, 0x05, 0x5c, + 0x27, 0x70, 0xd0, 0x29, 0x67, 0x8b, 0x8a, 0x62, 0xa4, 0x32, 0xa5, 0x11, 0xa9, 0xc5, 0xa2, 0x9e, + 0x4b, 0x95, 0xd7, 0xdd, 0xbc, 0x8b, 0x92, 0xce, 0x04, 0xd7, 0x4d, 0xbf, 0xb9, 0x93, 0xa7, 0x50, + 0xd9, 0x49, 0x77, 0x35, 0x0d, 0x9c, 0x9e, 0x89, 0xfb, 0xa5, 0x60, 0xf7, 0xdb, 0x2e, 0xfd, 0x7d, + 0x02, 0xe3, 0x35, 0x33, 0xe3, 0x86, 0x6a, 0x2e, 0x59, 0x45, 0x30, 0xa8, 0xc8, 0xdf, 0xf4, 0x00, + 0xd9, 0xc0, 0x58, 0x78, 0x18, 0x81, 0x83, 0x21, 0x30, 0x62, 0x10, 0x7c, 0x4d, 0x60, 0xb4, 0x46, + 0x7e, 0xa5, 0xde, 0x51, 0xcd, 0xa5, 0xd4, 0xb2, 0xc1, 0x09, 0x58, 0xe2, 0x9f, 0xab, 0x33, 0x9f, + 0x9d, 0xc9, 0x4a, 0x79, 0x3d, 0x89, 0xea, 0x8f, 0xfb, 0xe6, 0x75, 0x79, 0x5e, 0x26, 0x0e, 0x69, + 0x3e, 0x7e, 0xb7, 0x5d, 0xee, 0xef, 0x9c, 0xe2, 0x63, 0x6d, 0xfd, 0x73, 0xaa, 0x66, 0x06, 0x8b, + 0xfb, 0x3c, 0xb6, 0x2b, 0x4f, 0x08, 0xf4, 0x6f, 0xa1, 0xf1, 0x3f, 0x6e, 0x5a, 0x3e, 0x23, 0xb0, + 0xd7, 0xd5, 0x32, 0x5f, 0xb2, 0xd7, 0xb9, 0x8e, 0x76, 0x7f, 0x9b, 0x73, 0xf4, 0x57, 0x02, 0x43, + 0xde, 0x08, 0x51, 0x16, 0x69, 0x4b, 0x6f, 0x7f, 0x24, 0x78, 0xe7, 0xb5, 0x9d, 0xa8, 0x19, 0x49, + 0x7b, 0x0e, 0xba, 0xfc, 0xe9, 0x07, 0xdd, 0xb0, 0x83, 0x73, 0xa4, 0x1f, 0x10, 0x68, 0xb1, 0xfb, + 0x23, 0x3a, 0xe1, 0xc3, 0x62, 0xeb, 0x3d, 0x56, 0x2c, 0x11, 0xd6, 0xdc, 0x86, 0xc5, 0xd8, 0x7b, + 0x3f, 0xfe, 0xf6, 0x71, 0x64, 0x88, 0xc6, 0x84, 0xaa, 0xbb, 0x33, 0xe1, 0xce, 0x34, 0xde, 0xc2, + 0xd1, 0xcf, 0x09, 0xb4, 0xe2, 0x82, 0xd1, 0x40, 0xff, 0xee, 0x8b, 0xae, 0x98, 0x10, 0xda, 0x1e, + 0x01, 0x9d, 0xe6, 0x80, 0x8e, 0xd1, 0x69, 0x2f, 0x40, 0xf8, 0x5b, 0x58, 0x2d, 0x5f, 0x9e, 0xad, + 0x09, 0xab, 0xb8, 0x29, 0xac, 0xd1, 0x2f, 0x09, 0xb4, 0x39, 0xf1, 0x41, 0xc3, 0xce, 0x5c, 0x5a, + 0xba, 0xc9, 0xf0, 0x03, 0x10, 0xeb, 0x59, 0x8e, 0xf5, 0x24, 0x3d, 0xee, 0x83, 0xd5, 0x28, 0x83, + 0xb5, 0x52, 0xa7, 0x12, 0xee, 0x7d, 0x02, 0xcd, 0xfc, 0x88, 0x7c, 0x38, 0x68, 0xe6, 0x8a, 0x96, + 0x24, 0x76, 0x24, 0x9c, 0x31, 0x42, 0x9c, 0xe1, 0x10, 0x4f, 0xd1, 0x13, 0x5e, 0x10, 0xad, 0xbd, + 0x45, 0x58, 0xb5, 0x37, 0xab, 0x35, 0xfe, 0x63, 0x0b, 0xc6, 0xf7, 0x09, 0x44, 0x93, 0xaa, 0x4c, + 0x0f, 0x85, 0x98, 0xd5, 0x41, 0x78, 0x38, 0x94, 0x2d, 0x02, 0x1c, 0xe7, 0x00, 0x19, 0x1d, 0xa9, + 0x01, 0xd0, 0x86, 0xa5, 0xca, 0x6b, 0xf4, 0x0b, 0x02, 0x9d, 0xae, 0x9b, 0x06, 0x7a, 0x2c, 0xa4, + 0x62, 0xee, 0x14, 0x39, 0x5e, 0xe7, 0x28, 0x04, 0x7a, 0x88, 0x03, 0x7d, 0x81, 0x32, 0x1f, 0xb1, + 0xf1, 0x92, 0x83, 0xfe, 0x4d, 0xa0, 0xcf, 0xbb, 0xbb, 0xa7, 0x67, 0x83, 0x66, 0xf7, 0xbd, 0x07, + 0x89, 0xcd, 0x3c, 0xed, 0x70, 0x64, 0x71, 0x93, 0xb3, 0xb8, 0x41, 0xaf, 0x79, 0xb1, 0xb0, 0x4e, + 0x10, 0xfc, 0xf8, 0xc0, 0xfb, 0xb9, 0xaa, 0xe8, 0xf0, 0xe8, 0x83, 0xd7, 0x84, 0x55, 0x57, 0xb7, + 0xbb, 0x46, 0xbf, 0x25, 0xd0, 0x5e, 0x9a, 0x9d, 0x06, 0x66, 0x54, 0x75, 0xbf, 0x1d, 0x9b, 0xaa, + 0x63, 0x04, 0x32, 0xba, 0xca, 0x19, 0x5d, 0xa6, 0x97, 0xbc, 0x18, 0x55, 0xb3, 0x09, 0x45, 0xe2, + 0x7b, 0x02, 0x3d, 0x5e, 0xa7, 0x33, 0x7a, 0x26, 0x2c, 0x3a, 0x8f, 0x16, 0x34, 0xf6, 0xd2, 0xd3, + 0x0d, 0x46, 0x96, 0x47, 0x39, 0xcb, 0x09, 0x7a, 0xb8, 0x26, 0xcb, 0xad, 0xc7, 0x42, 0xfa, 0x0f, + 0x81, 0x41, 0xcf, 0x1e, 0x83, 0xb3, 0xb9, 0x1c, 0x32, 0x0f, 0x42, 0x74, 0x6b, 0xb1, 0x57, 0x1b, + 0xe2, 0x0b, 0xb9, 0x5e, 0xe4, 0x5c, 0xcf, 0xd1, 0xb3, 0x7e, 0x99, 0x16, 0xd8, 0x00, 0xd1, 0xbf, + 0x08, 0x0c, 0xf9, 0x1d, 0xb2, 0xe9, 0x85, 0xa7, 0x51, 0xa4, 0xaa, 0x67, 0x89, 0xcd, 0xfe, 0x37, + 0x27, 0x48, 0x79, 0x8e, 0x53, 0x7e, 0x99, 0xce, 0xd4, 0x21, 0x6f, 0xf9, 0xd4, 0x5f, 0xca, 0x52, + 0xab, 0x39, 0x81, 0xf2, 0x99, 0x95, 0x4e, 0x85, 0xa9, 0x15, 0xae, 0x63, 0x7a, 0x6c, 0xba, 0x9e, + 0x21, 0x61, 0x04, 0xb3, 0x12, 0x2f, 0xb5, 0xc8, 0x07, 0x04, 0xd4, 0x9a, 0x07, 0x04, 0x76, 0x57, + 0x1d, 0xef, 0xe8, 0x89, 0xb0, 0x45, 0xd9, 0x7d, 0x62, 0x8d, 0x9d, 0xac, 0x7b, 0x1c, 0x72, 0x39, + 0xc3, 0xb9, 0x1c, 0xa7, 0x47, 0xfd, 0x6a, 0x7a, 0x0a, 0x31, 0x57, 0xd5, 0xf6, 0xe4, 0x95, 0x87, + 0x8f, 0xe2, 0x64, 0xfd, 0x51, 0x9c, 0xfc, 0xf2, 0x28, 0x4e, 0xee, 0x3d, 0x8e, 0x37, 0xad, 0x3f, + 0x8e, 0x37, 0xfd, 0xf4, 0x38, 0xde, 0xf4, 0xd6, 0x31, 0xd7, 0x1d, 0xac, 0xe5, 0x78, 0x42, 0x5f, + 0x5c, 0x54, 0x33, 0xaa, 0xa4, 0x39, 0x13, 0xb9, 0xfe, 0x6f, 0xc9, 0x6f, 0x65, 0xd3, 0x2d, 0x5c, + 0xf0, 0xa3, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x93, 0x35, 0x72, 0xcc, 0x1d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1461,6 +1555,7 @@ type QueryClient interface { Auction(ctx context.Context, in *QueryAuctionRequest, opts ...grpc.CallOption) (*QueryAuctionResponse, error) Auctions(ctx context.Context, in *QueryAuctionsRequest, opts ...grpc.CallOption) (*QueryAuctionsResponse, error) Bids(ctx context.Context, in *QueryBidsRequest, opts ...grpc.CallOption) (*QueryBidsResponse, error) + Bid(ctx context.Context, in *QueryBidRequest, opts ...grpc.CallOption) (*QueryBidResponse, error) AuctionParams(ctx context.Context, in *QueryAuctionParamsRequest, opts ...grpc.CallOption) (*QueryAuctionParamsResponse, error) UserLimitBidsByAssetID(ctx context.Context, in *QueryUserLimitBidsByAssetIDRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsByAssetIDResponse, error) LimitBids(ctx context.Context, in *QueryLimitBidsRequest, opts ...grpc.CallOption) (*QueryLimitBidsResponse, error) @@ -1515,6 +1610,15 @@ func (c *queryClient) Bids(ctx context.Context, in *QueryBidsRequest, opts ...gr return out, nil } +func (c *queryClient) Bid(ctx context.Context, in *QueryBidRequest, opts ...grpc.CallOption) (*QueryBidResponse, error) { + out := new(QueryBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/Bid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) AuctionParams(ctx context.Context, in *QueryAuctionParamsRequest, opts ...grpc.CallOption) (*QueryAuctionParamsResponse, error) { out := new(QueryAuctionParamsResponse) err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/AuctionParams", in, out, opts...) @@ -1593,6 +1697,7 @@ type QueryServer interface { Auction(context.Context, *QueryAuctionRequest) (*QueryAuctionResponse, error) Auctions(context.Context, *QueryAuctionsRequest) (*QueryAuctionsResponse, error) Bids(context.Context, *QueryBidsRequest) (*QueryBidsResponse, error) + Bid(context.Context, *QueryBidRequest) (*QueryBidResponse, error) AuctionParams(context.Context, *QueryAuctionParamsRequest) (*QueryAuctionParamsResponse, error) UserLimitBidsByAssetID(context.Context, *QueryUserLimitBidsByAssetIDRequest) (*QueryUserLimitBidsByAssetIDResponse, error) LimitBids(context.Context, *QueryLimitBidsRequest) (*QueryLimitBidsResponse, error) @@ -1619,6 +1724,9 @@ func (*UnimplementedQueryServer) Auctions(ctx context.Context, req *QueryAuction func (*UnimplementedQueryServer) Bids(ctx context.Context, req *QueryBidsRequest) (*QueryBidsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Bids not implemented") } +func (*UnimplementedQueryServer) Bid(ctx context.Context, req *QueryBidRequest) (*QueryBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Bid not implemented") +} func (*UnimplementedQueryServer) AuctionParams(ctx context.Context, req *QueryAuctionParamsRequest) (*QueryAuctionParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuctionParams not implemented") } @@ -1720,6 +1828,24 @@ func _Query_Bids_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Query_Bid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Bid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/Bid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Bid(ctx, req.(*QueryBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_AuctionParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAuctionParamsRequest) if err := dec(in); err != nil { @@ -1884,6 +2010,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Bids", Handler: _Query_Bids_Handler, }, + { + MethodName: "Bid", + Handler: _Query_Bid_Handler, + }, { MethodName: "AuctionParams", Handler: _Query_AuctionParams_Handler, @@ -2260,6 +2390,67 @@ func (m *QueryBidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BidId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BidId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *QueryAuctionParamsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3130,6 +3321,29 @@ func (m *QueryBidsResponse) Size() (n int) { return n } +func (m *QueryBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BidId != 0 { + n += 1 + sovQuery(uint64(m.BidId)) + } + return n +} + +func (m *QueryBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Bid.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryAuctionParamsRequest) Size() (n int) { if m == nil { return 0 @@ -4282,6 +4496,158 @@ func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) + } + m.BidId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryAuctionParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index a44c803f9..8dc23a644 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -337,6 +337,60 @@ func local_request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler } +func request_Query_Bid_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBidRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bid_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bid_id") + } + + protoReq.BidId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bid_id", err) + } + + msg, err := client.Bid(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Bid_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBidRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bid_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bid_id") + } + + protoReq.BidId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bid_id", err) + } + + msg, err := server.Bid(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_AuctionParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAuctionParamsRequest var metadata runtime.ServerMetadata @@ -995,6 +1049,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Bid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Bid_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Bid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_AuctionParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1300,6 +1377,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Bid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Bid_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Bid_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_AuctionParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1472,6 +1569,8 @@ var ( pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auctions", "v2", "bids", "bidder", "bid_type", "history"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Bid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "bid", "bid_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AuctionParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "auction_params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_UserLimitBidsByAssetID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auctions", "v2", "userlimitorderbids", "bidder", "collateral_token_id", "debt_token_id"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1498,6 +1597,8 @@ var ( forward_Query_Bids_0 = runtime.ForwardResponseMessage + forward_Query_Bid_0 = runtime.ForwardResponseMessage + forward_Query_AuctionParams_0 = runtime.ForwardResponseMessage forward_Query_UserLimitBidsByAssetID_0 = runtime.ForwardResponseMessage diff --git a/x/bandoracle/client/cli/query.go b/x/bandoracle/client/cli/query.go index cff4e75ac..9e178c6a1 100644 --- a/x/bandoracle/client/cli/query.go +++ b/x/bandoracle/client/cli/query.go @@ -47,7 +47,7 @@ func CmdLastFetchPriceID() *cobra.Command { Use: "last-fetch-price-id", Short: "Query the last request id returned by FetchPrice ack packet", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -73,7 +73,7 @@ func CmdFetchPriceData() *cobra.Command { Use: "fetch_price_data", Short: "Query the FetchPriceData", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -99,7 +99,7 @@ func CmdDiscardData() *cobra.Command { Use: "discard_data", Short: "Query the DiscardData", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err diff --git a/x/bandoracle/handler.go b/x/bandoracle/handler.go index 7b0ea5d40..b2214379e 100644 --- a/x/bandoracle/handler.go +++ b/x/bandoracle/handler.go @@ -1,16 +1,13 @@ package bandoracle import ( + errorsmod "cosmossdk.io/errors" "fmt" - - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/pkg/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/comdex-official/comdex/x/bandoracle/keeper" "github.com/comdex-official/comdex/x/bandoracle/types" + 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 ... @@ -19,7 +16,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { 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) } } } @@ -31,7 +28,7 @@ func NewFetchPriceHandler(k keeper.Keeper) govtypes.Handler { return handleFetchPriceProposal(ctx, k, c) default: - return errors.Wrapf(types.ErrorUnknownProposalType, "%T", c) + return errorsmod.Wrapf(types.ErrorUnknownProposalType, "%T", c) } } } diff --git a/x/bandoracle/keeper/oracle.go b/x/bandoracle/keeper/oracle.go index a04e3b666..569f6a76b 100644 --- a/x/bandoracle/keeper/oracle.go +++ b/x/bandoracle/keeper/oracle.go @@ -1,19 +1,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" - + "time" // channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/comdex-official/comdex/x/bandoracle/types" protobuftypes "github.com/cosmos/gogoproto/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - - "github.com/comdex-official/comdex/x/bandoracle/types" ) func (k Keeper) SetFetchPriceResult(ctx sdk.Context, requestID types.OracleRequestID, result types.FetchPriceResult) { @@ -25,7 +22,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/keeper/query_server.go b/x/bandoracle/keeper/query_server.go index fcb4122bb..c92b89e94 100644 --- a/x/bandoracle/keeper/query_server.go +++ b/x/bandoracle/keeper/query_server.go @@ -2,10 +2,8 @@ package keeper import ( "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/bandoracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) var _ types.QueryServer = Keeper{} @@ -19,19 +17,19 @@ func (k Keeper) FetchPriceResult(c context.Context, req *types.QueryFetchPriceRe return &types.QueryFetchPriceResponse{Result: &result}, nil } -func (k Keeper) LastFetchPriceID(c context.Context, req *types.QueryLastFetchPriceIdRequest) (*types.QueryLastFetchPriceIdResponse, error) { +func (k Keeper) LastFetchPriceID(c context.Context, _ *types.QueryLastFetchPriceIdRequest) (*types.QueryLastFetchPriceIdResponse, error) { ctx := sdk.UnwrapSDKContext(c) id := k.GetLastFetchPriceID(ctx) return &types.QueryLastFetchPriceIdResponse{RequestId: id}, nil } -func (k Keeper) FetchPriceData(c context.Context, req *types.QueryFetchPriceDataRequest) (*types.QueryFetchPriceDataResponse, error) { +func (k Keeper) FetchPriceData(c context.Context, _ *types.QueryFetchPriceDataRequest) (*types.QueryFetchPriceDataResponse, error) { ctx := sdk.UnwrapSDKContext(c) data := k.GetFetchPriceMsg(ctx) return &types.QueryFetchPriceDataResponse{MsgFetchPriceData: data}, nil } -func (k Keeper) DiscardData(c context.Context, req *types.QueryDiscardDataRequest) (*types.QueryDiscardDataResponse, error) { +func (k Keeper) DiscardData(c context.Context, _ *types.QueryDiscardDataRequest) (*types.QueryDiscardDataResponse, error) { ctx := sdk.UnwrapSDKContext(c) dd := k.GetDiscardData(ctx) return &types.QueryDiscardDataResponse{DiscardData: dd}, nil diff --git a/x/bandoracle/module.go b/x/bandoracle/module.go index 3173cb7a2..1a5ba711a 100644 --- a/x/bandoracle/module.go +++ b/x/bandoracle/module.go @@ -60,10 +60,6 @@ func (AppModuleBasic) Name() string { return types.ModuleName } -func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterCodec(cdc) } diff --git a/x/bandoracle/module_ibc.go b/x/bandoracle/module_ibc.go index 5092fccc7..b94ee1898 100644 --- a/x/bandoracle/module_ibc.go +++ b/x/bandoracle/module_ibc.go @@ -1,7 +1,8 @@ package bandoracle import ( - + errorsmod "cosmossdk.io/errors" + "github.com/comdex-official/comdex/x/bandoracle/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" @@ -9,8 +10,6 @@ import ( 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" - - "github.com/comdex-official/comdex/x/bandoracle/types" ) // OnChanOpenInit implements the IBCModule interface. @@ -26,11 +25,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 +53,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 +83,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 +104,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 +125,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 +133,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 +155,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 +171,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 +180,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 +195,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/oracle.go b/x/bandoracle/oracle.go index 3d1e91766..8d02f5b61 100644 --- a/x/bandoracle/oracle.go +++ b/x/bandoracle/oracle.go @@ -1,13 +1,13 @@ package bandoracle import ( + errorsmod "cosmossdk.io/errors" "github.com/bandprotocol/bandchain-packet/obi" "github.com/bandprotocol/bandchain-packet/packet" + "github.com/comdex-official/comdex/x/bandoracle/types" 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" - - "github.com/comdex-official/comdex/x/bandoracle/types" ) func (im IBCModule) handleOraclePacket( @@ -18,7 +18,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 +30,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 +73,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/codec.go b/x/bandoracle/types/codec.go index 4faf682ab..5f6ee3f10 100644 --- a/x/bandoracle/types/codec.go +++ b/x/bandoracle/types/codec.go @@ -21,6 +21,5 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( Amino = codec.NewLegacyAmino() - // ModuleCdc = codec.NewAminoCodec(Amino) ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) 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/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/bandoracle/types/packet.pb.go b/x/bandoracle/types/packet.pb.go index dd7539059..ea52d293a 100644 --- a/x/bandoracle/types/packet.pb.go +++ b/x/bandoracle/types/packet.pb.go @@ -24,7 +24,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type BandoraclePacketData struct { // Types that are valid to be assigned to Packet: - // // *BandoraclePacketData_NoData Packet isBandoraclePacketData_Packet `protobuf_oneof:"packet"` } diff --git a/x/collector/client/cli/tx.go b/x/collector/client/cli/tx.go index 44a868ef6..064dba26c 100644 --- a/x/collector/client/cli/tx.go +++ b/x/collector/client/cli/tx.go @@ -2,11 +2,11 @@ package cli import ( "fmt" + "strconv" "github.com/comdex-official/comdex/x/collector/types" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "strconv" "github.com/spf13/cobra" @@ -24,6 +24,8 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand( txDeposit(), + txRefund(), + txUpdateDebtParams(), ) return cmd } @@ -59,3 +61,81 @@ func txDeposit() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } + +func txRefund() *cobra.Command { + cmd := &cobra.Command{ + Use: "refund", + Short: "refund cmst from collector to stAtom vault owners", + Long: `This transaction is exclusively designed for refunding CMST tokens from the collector module. Its sole purpose is to facilitate refunds to stAtom vault owners`, + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgRefund(ctx.GetFromAddress().String()) + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +func txUpdateDebtParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-debt-params [app_id] [asset_id] [slots] [debt_threshold] [lot_size] [debt_lot_size] [is_debt_auction]", + Short: "update debt params", + Long: `This transaction is exclusively designed for updating debt params`, + Args: cobra.ExactArgs(7), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + appID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + assetID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + slots, err := strconv.ParseUint(args[2], 10, 64) + if err != nil { + return err + } + + debtThreshold, ok := sdk.NewIntFromString(args[3]) + if !ok { + return fmt.Errorf("invalid debt threshold") + } + + lotSize, ok := sdk.NewIntFromString(args[4]) + if !ok { + return fmt.Errorf("invalid lot size") + } + + debtLotSize, ok := sdk.NewIntFromString(args[5]) + if !ok { + return fmt.Errorf("invalid debt lot size") + } + + isDebtAuction, err := strconv.ParseBool(args[6]) + if err != nil { + return err + } + + msg := types.NewMsgUpdateDebtparams(ctx.GetFromAddress().String(), appID, assetID, slots, debtThreshold, lotSize, debtLotSize, isDebtAuction) + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/collector/expected/keeper.go b/x/collector/expected/keeper.go index b88c6f13e..809379a5c 100644 --- a/x/collector/expected/keeper.go +++ b/x/collector/expected/keeper.go @@ -1,47 +1,51 @@ package expected import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auction/types" + esmtypes "github.com/comdex-official/comdex/x/esm/types" lockertypes "github.com/comdex-official/comdex/x/locker/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" + sdktypes "github.com/cosmos/cosmos-sdk/types" ) 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 sdktypes.Context, address sdktypes.AccAddress, name string, coins sdktypes.Coins) error + SendCoinsFromModuleToAccount(ctx sdktypes.Context, name string, address sdktypes.AccAddress, coins sdktypes.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 sdktypes.Context, senderModule, recipientModule string, amt sdktypes.Coins) error + GetBalance(ctx sdktypes.Context, addr sdktypes.AccAddress, denom string) sdktypes.Coin } type AssetKeeper interface { - HasAssetForDenom(ctx sdk.Context, id string) bool - HasAsset(ctx sdk.Context, id uint64) bool - GetAssetForDenom(ctx sdk.Context, denom string) (types.Asset, bool) - GetApp(ctx sdk.Context, id uint64) (types.AppData, bool) - GetAsset(ctx sdk.Context, id uint64) (types.Asset, bool) - GetMintGenesisTokenData(ctx sdk.Context, appID, assetID uint64) (mintData types.MintGenesisToken, found bool) + HasAssetForDenom(ctx sdktypes.Context, id string) bool + HasAsset(ctx sdktypes.Context, id uint64) bool + GetAssetForDenom(ctx sdktypes.Context, denom string) (types.Asset, bool) + GetApp(ctx sdktypes.Context, id uint64) (types.AppData, bool) + GetAsset(ctx sdktypes.Context, id uint64) (types.Asset, bool) + GetMintGenesisTokenData(ctx sdktypes.Context, appID, assetID uint64) (mintData types.MintGenesisToken, found bool) } type AuctionKeeper interface { - GetAuctionParams(ctx sdk.Context, appID uint64) (asset auctiontypes.AuctionParams, found bool) + GetAuctionParams(ctx sdktypes.Context, appID uint64) (asset auctiontypes.AuctionParams, found bool) } type LockerKeeper interface { - GetLockerLookupTable(ctx sdk.Context, appID, assetID uint64) (lockerLookupData lockertypes.LockerLookupTableData, found bool) - GetLocker(ctx sdk.Context, lockerID uint64) (locker lockertypes.Locker, found bool) - SetLocker(ctx sdk.Context, locker lockertypes.Locker) - SetLockerLookupTable(ctx sdk.Context, lockerLookupData lockertypes.LockerLookupTableData) - SetLockerTotalRewardsByAssetAppWise(ctx sdk.Context, lockerRewardsMapping lockertypes.LockerTotalRewardsByAssetAppWise) error - GetLockerTotalRewardsByAssetAppWise(ctx sdk.Context, appID, assetID uint64) (lockerRewardsMapping lockertypes.LockerTotalRewardsByAssetAppWise, found bool) + GetLockerLookupTable(ctx sdktypes.Context, appID, assetID uint64) (lockerLookupData lockertypes.LockerLookupTableData, found bool) + GetLocker(ctx sdktypes.Context, lockerID uint64) (locker lockertypes.Locker, found bool) + SetLocker(ctx sdktypes.Context, locker lockertypes.Locker) + SetLockerLookupTable(ctx sdktypes.Context, lockerLookupData lockertypes.LockerLookupTableData) + SetLockerTotalRewardsByAssetAppWise(ctx sdktypes.Context, lockerRewardsMapping lockertypes.LockerTotalRewardsByAssetAppWise) error + GetLockerTotalRewardsByAssetAppWise(ctx sdktypes.Context, appID, assetID uint64) (lockerRewardsMapping lockertypes.LockerTotalRewardsByAssetAppWise, found bool) } 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) - SetLockerRewardTracker(ctx sdk.Context, rewards rewardstypes.LockerRewardsTracker) - GetLockerRewardTracker(ctx sdk.Context, id, appID uint64) (rewards rewardstypes.LockerRewardsTracker, found bool) + GetReward(ctx sdktypes.Context, appID, assetID uint64) (rewards rewardstypes.InternalRewards, found bool) + CalculationOfRewards(ctx sdktypes.Context, amount sdktypes.Int, lsr sdktypes.Dec, bTime int64) (sdktypes.Dec, error) + SetLockerRewardTracker(ctx sdktypes.Context, rewards rewardstypes.LockerRewardsTracker) + GetLockerRewardTracker(ctx sdktypes.Context, id, appID uint64) (rewards rewardstypes.LockerRewardsTracker, found bool) +} + +type EsmKeeper interface { + GetParams(ctx sdktypes.Context) esmtypes.Params } diff --git a/x/collector/handler.go b/x/collector/handler.go index 88e5514b8..4bdb26885 100644 --- a/x/collector/handler.go +++ b/x/collector/handler.go @@ -1,13 +1,12 @@ package collector import ( + errorsmod "cosmossdk.io/errors" "fmt" "github.com/comdex-official/comdex/x/collector/keeper" - + "github.com/comdex-official/comdex/x/collector/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/comdex-official/comdex/x/collector/types" ) // NewHandler ... @@ -21,9 +20,15 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgDeposit: res, err := server.Deposit(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgRefund: + res, err := server.Refund(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgUpdateDebtParams: + res, err := server.UpdateDebtParams(sdk.WrapSDKContext(ctx), msg) + 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/keeper.go b/x/collector/keeper/keeper.go index 840095675..9c29712fe 100644 --- a/x/collector/keeper/keeper.go +++ b/x/collector/keeper/keeper.go @@ -1,17 +1,20 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "fmt" "github.com/cometbft/cometbft/libs/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" + protobuftypes "github.com/cosmos/gogoproto/types" "github.com/comdex-official/comdex/x/collector/expected" "github.com/comdex-official/comdex/x/collector/types" + esmtypes "github.com/comdex-official/comdex/x/esm/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" ) @@ -24,6 +27,7 @@ type ( auction expected.AuctionKeeper locker expected.LockerKeeper rewards expected.RewardsKeeper + esm expected.EsmKeeper paramStore paramtypes.Subspace bank expected.BankKeeper } @@ -37,6 +41,7 @@ func NewKeeper( auction expected.AuctionKeeper, locker expected.LockerKeeper, rewards expected.RewardsKeeper, + esm expected.EsmKeeper, ps paramtypes.Subspace, bank expected.BankKeeper, ) Keeper { @@ -53,6 +58,7 @@ func NewKeeper( auction: auction, locker: locker, rewards: rewards, + esm: esm, paramStore: ps, bank: bank, } @@ -65,3 +71,149 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { func (k Keeper) ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdk.Int { return k.bank.GetBalance(ctx, authtypes.NewModuleAddress(moduleName), denom).Amount } + +func (k Keeper) Deposit(ctx sdk.Context, Amount sdk.Coin, AppID uint64, addr string) error { + + asset, found := k.asset.GetAssetForDenom(ctx, Amount.Denom) + if !found { + return types.ErrorAssetDoesNotExist + } + // check if denom is cmst + if asset.Denom != "ucmst" { + return types.ErrorAssetDoesNotExist + } + // check if app id exists and app name is harbor + app, found := k.asset.GetApp(ctx, AppID) + if !found { + return types.ErrorAppDoesNotExist + } + if app.Name != "harbor" { + return types.ErrorAppDoesNotExist + } + + address, err := sdk.AccAddressFromBech32(addr) + if err != nil { + return err + } + + err = k.bank.SendCoinsFromAccountToModule(ctx, address, types.ModuleName, sdk.NewCoins(Amount)) + if err != nil { + return err + } + + err = k.SetNetFeeCollectedData(ctx, AppID, asset.Id, Amount.Amount) + if err != nil { + return err + } + + return nil +} + +func (k Keeper) UpdateDebtParams(ctx sdk.Context, appId, assetID, slots uint64, debtThreshold, lotSize, debtLotSize sdkmath.Int, isDebtAuction bool, addr string) error { + + // check if address is admin + getAdmin := k.esm.GetParams(ctx).Admin + + // check if address is admin in getAdmin array + if getAdmin[0] != addr { + return esmtypes.ErrorUnauthorized + } + + // check if app id exists and app name is harbor + app, found := k.asset.GetApp(ctx, appId) + if !found { + return types.ErrorAppDoesNotExist + } + if app.Name != "harbor" { + return types.ErrorAppDoesNotExist + } + + asset, found := k.asset.GetAsset(ctx, assetID) + if !found { + return types.ErrorAssetDoesNotExist + } + + if asset.Denom != "ucmst" { + return types.ErrorAssetDoesNotExist + } + + if slots == 0 { + return types.ErrorAmountCanNotBeZero + } + + if lotSize.IsZero() { + return types.ErrorAmountCanNotBeZero + } + + if debtLotSize.IsZero() { + return types.ErrorAmountCanNotBeZero + } + + // get CollectorLookupTableData + collectorLookupTable, found := k.GetCollectorLookupTable(ctx, appId, assetID) + if !found { + return types.ErrorDataDoesNotExists + } + + collectorLookupTable.DebtLotSize = debtLotSize + collectorLookupTable.DebtThreshold = debtThreshold + collectorLookupTable.LotSize = lotSize + + var ( + store = ctx.KVStore(k.storeKey) + key = types.CollectorLookupTableMappingKey(appId, assetID) + value = k.cdc.MustMarshal(&collectorLookupTable) + ) + + store.Set(key, value) + + // get AppAssetIdToAuctionLookupTable + appAssetIdToAuctionLookupTable, found := k.GetAuctionMappingForApp(ctx, appId, assetID) + if !found { + return types.ErrorAuctionParamsNotSet + } + + appAssetIdToAuctionLookupTable.IsDebtAuction = isDebtAuction + + // set SetAuctionMappingForApp + err := k.SetAuctionMappingForApp(ctx, appAssetIdToAuctionLookupTable) + if err != nil { + return err + } + + // set slots + k.SetSlots(ctx, slots) + + return nil +} + +func (k Keeper) SetSlots(ctx sdk.Context, slots uint64) { + var ( + store = ctx.KVStore(k.storeKey) + key = types.SlotsKeyPrefix + value = k.cdc.MustMarshal( + &protobuftypes.UInt64Value{ + Value: slots, + }, + ) + ) + + store.Set(key, value) +} + +func (k Keeper) GetSlots(ctx sdk.Context) uint64 { + var ( + store = ctx.KVStore(k.storeKey) + key = types.SlotsKeyPrefix + value = store.Get(key) + ) + + if value == nil { + return 1 + } + + var id protobuftypes.UInt64Value + k.cdc.MustUnmarshal(value, &id) + + return id.GetValue() +} diff --git a/x/collector/keeper/msg_server.go b/x/collector/keeper/msg_server.go index a1daa85bd..b47c90022 100644 --- a/x/collector/keeper/msg_server.go +++ b/x/collector/keeper/msg_server.go @@ -27,3 +27,30 @@ func (m msgServer) Deposit(goCtx context.Context, deposit *types.MsgDeposit) (*t return &types.MsgDepositResponse{}, nil } + +func (m msgServer) Refund(goCtx context.Context, refund *types.MsgRefund) (*types.MsgRefundResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + counter := m.keeper.GetRefundCounterStatus(ctx) + if counter != 0 { + return nil, types.ErrorRefundCompleted + } + + if err := m.keeper.Refund(ctx); err != nil { + return nil, err + } + + m.keeper.SetRefundCounterStatus(ctx, counter+1) + + return &types.MsgRefundResponse{}, nil +} + +func (m msgServer) UpdateDebtParams(goCtx context.Context, msg *types.MsgUpdateDebtParams) (*types.MsgUpdateDebtParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := m.keeper.UpdateDebtParams(ctx, msg.AppId, msg.AssetId, msg.Slots, msg.DebtThreshold, msg.LotSize, msg.DebtLotSize, msg.IsDebtAuction, msg.Addr); err != nil { + return nil, err + } + + return &types.MsgUpdateDebtParamsResponse{}, nil +} \ No newline at end of file diff --git a/x/collector/keeper/refund.go b/x/collector/keeper/refund.go index 3beccf913..7f23dce4e 100644 --- a/x/collector/keeper/refund.go +++ b/x/collector/keeper/refund.go @@ -129,46 +129,6 @@ func (k Keeper) Refund(ctx sdk.Context) error { return nil } -func (k Keeper) Deposit(ctx sdk.Context, Amount sdk.Coin, AppID uint64, addr string) error { - counter := k.GetRefundCounterStatus(ctx) - if counter != 0 { - return types.ErrorRefundCompleted - } - - asset, found := k.asset.GetAssetForDenom(ctx, Amount.Denom) - if !found { - return types.ErrorAssetDoesNotExist - } - if asset.Id != 3 { - return types.ErrorAppDoesNotExist - } - - if AppID != 2 { - return types.ErrorAppDoesNotExist - } - - address, _ := sdk.AccAddressFromBech32(addr) - - err := k.bank.SendCoinsFromAccountToModule(ctx, address, types.ModuleName, sdk.NewCoins(Amount)) - if err != nil { - return err - } - - err = k.SetNetFeeCollectedData(ctx, AppID, asset.Id, Amount.Amount) - if err != nil { - return nil - } - - err = k.Refund(ctx) - if err != nil { - return err - } - - k.SetRefundCounterStatus(ctx, counter+1) - - return nil -} - func (k Keeper) SetRefundCounterStatus(ctx sdk.Context, id uint64) { var ( store = ctx.KVStore(k.storeKey) diff --git a/x/collector/types/codec.go b/x/collector/types/codec.go index 6d35a30e3..772f1cb62 100644 --- a/x/collector/types/codec.go +++ b/x/collector/types/codec.go @@ -11,6 +11,8 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDeposit{}, "comdex/collector/MsgDeposit", nil) + cdc.RegisterConcrete(&MsgRefund{}, "comdex/collector/MsgRefund", nil) + cdc.RegisterConcrete(&MsgUpdateDebtParams{}, "comdex/collector/MsgUpdateDebtParams", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -20,6 +22,8 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgDeposit{}, + &MsgRefund{}, + &MsgUpdateDebtParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/collector/types/errors.go b/x/collector/types/errors.go index d772ef513..8aab2104f 100644 --- a/x/collector/types/errors.go +++ b/x/collector/types/errors.go @@ -23,4 +23,5 @@ var ( 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") + ErrorAmountCanNotBeZero = sdkerrors.Register(ModuleName, 418, "amount cannot be zero") ) diff --git a/x/collector/types/keys.go b/x/collector/types/keys.go index 83b98b65c..8d2dd4db1 100644 --- a/x/collector/types/keys.go +++ b/x/collector/types/keys.go @@ -23,12 +23,15 @@ const ( var ( TypeDepositRequest = ModuleName + ":deposit" + TypeRefundRequest = ModuleName + ":refund" + TypeUpdateDebtParamsRequest = ModuleName + ":update" AddCollectorLookupKey = []byte{0x01} AppIDToAssetCollectorMappingPrefix = []byte{0x03} AppIDToAuctionMappingPrefix = []byte{0x05} CollectorForDenomKeyPrefix = []byte{0x07} NetFeeCollectedDataPrefix = []byte{0x08} RefundCounterStatusPrefix = []byte{0x09} + SlotsKeyPrefix = []byte{0x10} ) func CollectorLookupTableMappingKey(appID, assetID uint64) []byte { diff --git a/x/collector/types/tx.go b/x/collector/types/tx.go index a7f010acf..5523e2b52 100644 --- a/x/collector/types/tx.go +++ b/x/collector/types/tx.go @@ -41,3 +41,83 @@ func (msg *MsgDeposit) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } + +func NewMsgRefund(addr string) *MsgRefund { + return &MsgRefund{ + Addr: addr, + } +} + +func (msg MsgRefund) Route() string { return ModuleName } +func (msg MsgRefund) Type() string { return TypeRefundRequest } + +func (msg *MsgRefund) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.GetAddr()) + if err != nil { + return err + } + return nil +} + +func (msg *MsgRefund) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.GetAddr()) + return []sdk.AccAddress{addr} +} + +func (msg *MsgRefund) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func NewMsgUpdateDebtparams(addr string, appID, assetID, slots uint64, debtThreshold, lotSize, debtLotSize sdk.Int, isDebtAuction bool) *MsgUpdateDebtParams { + return &MsgUpdateDebtParams{ + Addr: addr, + AppId: appID, + AssetId: assetID, + Slots: slots, + DebtThreshold: debtThreshold, + LotSize: lotSize, + DebtLotSize: debtLotSize, + IsDebtAuction: isDebtAuction, + } +} + +func (msg MsgUpdateDebtParams) Route() string { return ModuleName } +func (msg MsgUpdateDebtParams) Type() string { return TypeUpdateDebtParamsRequest } + +func (msg *MsgUpdateDebtParams) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.GetAddr()) + if err != nil { + return err + } + if msg.AppId == 0 { + return fmt.Errorf("app id should not be 0: %d ", msg.AppId) + } + if msg.AssetId == 0 { + return fmt.Errorf("asset id should not be 0: %d ", msg.AssetId) + } + if msg.Slots == 0 { + return fmt.Errorf("slots should not be 0: %d ", msg.Slots) + } + if msg.DebtThreshold.IsNegative() { + return fmt.Errorf("debt threshold should not be negative: %s ", msg.DebtThreshold) + } + if msg.LotSize.IsNegative() { + return fmt.Errorf("lot size should not be negative: %s ", msg.LotSize) + } + if msg.DebtLotSize.IsNegative() { + return fmt.Errorf("debt lot size should not be negative: %s ", msg.DebtLotSize) + } + return nil +} + +func (msg *MsgUpdateDebtParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.GetAddr()) + return []sdk.AccAddress{addr} +} + +func (msg *MsgUpdateDebtParams) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + diff --git a/x/collector/types/tx.pb.go b/x/collector/types/tx.pb.go index 41ae3d053..713b6fe24 100644 --- a/x/collector/types/tx.pb.go +++ b/x/collector/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" 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" @@ -125,34 +126,250 @@ func (m *MsgDepositResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo +type MsgRefund struct { + Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` +} + +func (m *MsgRefund) Reset() { *m = MsgRefund{} } +func (m *MsgRefund) String() string { return proto.CompactTextString(m) } +func (*MsgRefund) ProtoMessage() {} +func (*MsgRefund) Descriptor() ([]byte, []int) { + return fileDescriptor_b3c97bd7a906bd24, []int{2} +} +func (m *MsgRefund) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRefund) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRefund.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRefund) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRefund.Merge(m, src) +} +func (m *MsgRefund) XXX_Size() int { + return m.Size() +} +func (m *MsgRefund) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRefund.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRefund proto.InternalMessageInfo + +func (m *MsgRefund) GetAddr() string { + if m != nil { + return m.Addr + } + return "" +} + +type MsgRefundResponse struct { +} + +func (m *MsgRefundResponse) Reset() { *m = MsgRefundResponse{} } +func (m *MsgRefundResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRefundResponse) ProtoMessage() {} +func (*MsgRefundResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b3c97bd7a906bd24, []int{3} +} +func (m *MsgRefundResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRefundResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRefundResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRefundResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRefundResponse.Merge(m, src) +} +func (m *MsgRefundResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRefundResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRefundResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRefundResponse proto.InternalMessageInfo + +type MsgUpdateDebtParams struct { + Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AssetId uint64 `protobuf:"varint,3,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Slots uint64 `protobuf:"varint,4,opt,name=slots,proto3" json:"slots,omitempty"` + 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"` + LotSize github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=lot_size,json=lotSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"lot_size" yaml:"lot_size"` + DebtLotSize github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=debt_lot_size,json=debtLotSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_lot_size" yaml:"debt_lot_size"` + IsDebtAuction bool `protobuf:"varint,8,opt,name=is_debt_auction,json=isDebtAuction,proto3" json:"is_debt_auction,omitempty" yaml:"is_debt_auction"` +} + +func (m *MsgUpdateDebtParams) Reset() { *m = MsgUpdateDebtParams{} } +func (m *MsgUpdateDebtParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateDebtParams) ProtoMessage() {} +func (*MsgUpdateDebtParams) Descriptor() ([]byte, []int) { + return fileDescriptor_b3c97bd7a906bd24, []int{4} +} +func (m *MsgUpdateDebtParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateDebtParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateDebtParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateDebtParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateDebtParams.Merge(m, src) +} +func (m *MsgUpdateDebtParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateDebtParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateDebtParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateDebtParams proto.InternalMessageInfo + +func (m *MsgUpdateDebtParams) GetAddr() string { + if m != nil { + return m.Addr + } + return "" +} + +func (m *MsgUpdateDebtParams) GetAppId() uint64 { + if m != nil { + return m.AppId + } + return 0 +} + +func (m *MsgUpdateDebtParams) GetAssetId() uint64 { + if m != nil { + return m.AssetId + } + return 0 +} + +func (m *MsgUpdateDebtParams) GetSlots() uint64 { + if m != nil { + return m.Slots + } + return 0 +} + +func (m *MsgUpdateDebtParams) GetIsDebtAuction() bool { + if m != nil { + return m.IsDebtAuction + } + return false +} + +type MsgUpdateDebtParamsResponse struct { +} + +func (m *MsgUpdateDebtParamsResponse) Reset() { *m = MsgUpdateDebtParamsResponse{} } +func (m *MsgUpdateDebtParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateDebtParamsResponse) ProtoMessage() {} +func (*MsgUpdateDebtParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b3c97bd7a906bd24, []int{5} +} +func (m *MsgUpdateDebtParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateDebtParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateDebtParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateDebtParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateDebtParamsResponse.Merge(m, src) +} +func (m *MsgUpdateDebtParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateDebtParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateDebtParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateDebtParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgDeposit)(nil), "comdex.collector.v1beta1.MsgDeposit") proto.RegisterType((*MsgDepositResponse)(nil), "comdex.collector.v1beta1.MsgDepositResponse") + proto.RegisterType((*MsgRefund)(nil), "comdex.collector.v1beta1.MsgRefund") + proto.RegisterType((*MsgRefundResponse)(nil), "comdex.collector.v1beta1.MsgRefundResponse") + proto.RegisterType((*MsgUpdateDebtParams)(nil), "comdex.collector.v1beta1.MsgUpdateDebtParams") + proto.RegisterType((*MsgUpdateDebtParamsResponse)(nil), "comdex.collector.v1beta1.MsgUpdateDebtParamsResponse") } func init() { proto.RegisterFile("comdex/collector/v1beta1/tx.proto", fileDescriptor_b3c97bd7a906bd24) } var fileDescriptor_b3c97bd7a906bd24 = []byte{ - // 296 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x3d, 0x4f, 0x02, 0x31, - 0x18, 0xc7, 0xaf, 0x82, 0x18, 0xeb, 0xd6, 0x60, 0x72, 0x32, 0x54, 0x24, 0x0e, 0x0c, 0xda, 0x06, - 0x18, 0xdc, 0xd1, 0xc5, 0x81, 0xe5, 0x46, 0x13, 0x63, 0x7a, 0x6d, 0x39, 0x9b, 0xc0, 0x3d, 0x0d, - 0x2d, 0x06, 0xbf, 0x85, 0x1f, 0x8b, 0x91, 0xd1, 0xc9, 0x98, 0xbb, 0x2f, 0x62, 0xee, 0x0d, 0x5c, - 0x4c, 0xdc, 0xfe, 0x6d, 0x7e, 0xff, 0xe7, 0xd7, 0x17, 0x7c, 0x25, 0x61, 0xa9, 0xf4, 0x86, 0x4b, - 0x58, 0x2c, 0xb4, 0xf4, 0xb0, 0xe2, 0x6f, 0xa3, 0x58, 0x7b, 0x31, 0xe2, 0x7e, 0xc3, 0xec, 0x0a, - 0x3c, 0x90, 0xb0, 0x42, 0xd8, 0x1e, 0x61, 0x35, 0xd2, 0xa3, 0x12, 0xdc, 0x12, 0x1c, 0x8f, 0x85, - 0xd3, 0xfb, 0x9e, 0x04, 0x93, 0x56, 0xcd, 0x5e, 0x37, 0x81, 0x04, 0xca, 0xc8, 0x8b, 0x54, 0xed, - 0x0e, 0x2c, 0xc6, 0x33, 0x97, 0x3c, 0x68, 0x0b, 0xce, 0x78, 0x42, 0x70, 0x5b, 0x28, 0xb5, 0x0a, - 0x51, 0x1f, 0x0d, 0x4f, 0xa3, 0x32, 0x93, 0x3b, 0xdc, 0x11, 0x4b, 0x58, 0xa7, 0x3e, 0x3c, 0xea, - 0xa3, 0xe1, 0xd9, 0xf8, 0x82, 0x55, 0x22, 0x56, 0x88, 0x1a, 0x3b, 0xbb, 0x07, 0x93, 0x4e, 0xdb, - 0xdb, 0xaf, 0xcb, 0x20, 0xaa, 0x71, 0x72, 0x8e, 0x3b, 0xc2, 0xda, 0x17, 0xa3, 0xc2, 0x56, 0x1f, - 0x0d, 0xdb, 0xd1, 0xb1, 0xb0, 0xf6, 0x51, 0x0d, 0xba, 0x98, 0x1c, 0x8c, 0x91, 0x76, 0x16, 0x52, - 0xa7, 0xc7, 0x0a, 0xb7, 0x66, 0x2e, 0x21, 0xcf, 0xf8, 0xa4, 0x39, 0xcb, 0x35, 0xfb, 0xeb, 0xaa, - 0xec, 0xd0, 0xef, 0xdd, 0xfc, 0x87, 0x6a, 0x2c, 0xd3, 0xd9, 0x36, 0xa3, 0x68, 0x97, 0x51, 0xf4, - 0x9d, 0x51, 0xf4, 0x91, 0xd3, 0x60, 0x97, 0xd3, 0xe0, 0x33, 0xa7, 0xc1, 0xd3, 0x24, 0x31, 0xfe, - 0x75, 0x1d, 0x17, 0xd3, 0x78, 0x35, 0xf1, 0x16, 0xe6, 0x73, 0x23, 0x8d, 0x58, 0xd4, 0x6b, 0xfe, - 0xfb, 0x5f, 0xfc, 0xbb, 0xd5, 0x2e, 0xee, 0x94, 0x6f, 0x38, 0xf9, 0x09, 0x00, 0x00, 0xff, 0xff, - 0x9d, 0x9b, 0x83, 0x41, 0xb8, 0x01, 0x00, 0x00, + // 576 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xdd, 0x6a, 0x13, 0x4f, + 0x18, 0xc6, 0xb3, 0xf9, 0xee, 0x94, 0xfe, 0xfb, 0x77, 0x9a, 0xca, 0x76, 0xc5, 0x4d, 0x5c, 0x45, + 0x02, 0x9a, 0x5d, 0xda, 0x22, 0x82, 0x67, 0x8d, 0x45, 0x09, 0x18, 0x90, 0x55, 0x4f, 0x8a, 0x12, + 0x66, 0x77, 0x26, 0x9b, 0xd1, 0xdd, 0x9d, 0x25, 0x33, 0x91, 0xb4, 0x57, 0xe1, 0xf5, 0x78, 0x05, + 0x3d, 0xec, 0xa1, 0x78, 0x10, 0x24, 0xb9, 0x00, 0xa1, 0x57, 0x20, 0xfb, 0x9d, 0xd6, 0x58, 0x9a, + 0xa3, 0x9d, 0x77, 0x78, 0x9e, 0xf7, 0xf7, 0x0e, 0xf3, 0xec, 0x80, 0x07, 0x36, 0xf3, 0x30, 0x99, + 0x1a, 0x36, 0x73, 0x5d, 0x62, 0x0b, 0x36, 0x36, 0xbe, 0xee, 0x5b, 0x44, 0xa0, 0x7d, 0x43, 0x4c, + 0xf5, 0x60, 0xcc, 0x04, 0x83, 0x72, 0x2c, 0xd1, 0x33, 0x89, 0x9e, 0x48, 0x14, 0xd5, 0x66, 0xdc, + 0x63, 0xdc, 0xb0, 0x10, 0x27, 0x99, 0xcf, 0x66, 0xd4, 0x8f, 0x9d, 0x4a, 0xc3, 0x61, 0x0e, 0x8b, + 0x96, 0x46, 0xb8, 0x8a, 0x77, 0xb5, 0x00, 0x80, 0x3e, 0x77, 0x8e, 0x49, 0xc0, 0x38, 0x15, 0x10, + 0x82, 0x32, 0xc2, 0x78, 0x2c, 0x4b, 0x2d, 0xa9, 0xbd, 0x61, 0x46, 0x6b, 0xf8, 0x1c, 0x54, 0x91, + 0xc7, 0x26, 0xbe, 0x90, 0x8b, 0x2d, 0xa9, 0xbd, 0x79, 0xb0, 0xa7, 0xc7, 0x20, 0x3d, 0x04, 0xa5, + 0x74, 0xfd, 0x25, 0xa3, 0x7e, 0xb7, 0x7c, 0x3e, 0x6b, 0x16, 0xcc, 0x44, 0x0e, 0x77, 0x41, 0x15, + 0x05, 0xc1, 0x80, 0x62, 0xb9, 0xd4, 0x92, 0xda, 0x65, 0xb3, 0x82, 0x82, 0xa0, 0x87, 0xb5, 0x06, + 0x80, 0x39, 0xd1, 0x24, 0x3c, 0x60, 0x3e, 0x27, 0x5a, 0x13, 0x6c, 0xf4, 0xb9, 0x63, 0x92, 0xe1, + 0xc4, 0xc7, 0xab, 0xc6, 0xd0, 0x76, 0xc0, 0x9d, 0x4c, 0x90, 0xb9, 0x7e, 0x97, 0xc0, 0x4e, 0x9f, + 0x3b, 0x1f, 0x02, 0x8c, 0x04, 0x39, 0x26, 0x96, 0x78, 0x8b, 0xc6, 0xc8, 0xe3, 0x2b, 0xcf, 0x91, + 0x8f, 0x53, 0x5c, 0x1a, 0x07, 0xee, 0x81, 0x3a, 0xe2, 0x9c, 0x88, 0x7c, 0xce, 0x5a, 0x54, 0xf7, + 0x30, 0x6c, 0x80, 0x0a, 0x77, 0x99, 0xe0, 0x72, 0x39, 0x36, 0x44, 0x05, 0xf4, 0xc1, 0x7f, 0x98, + 0x58, 0x62, 0x20, 0x46, 0x63, 0xc2, 0x47, 0xcc, 0xc5, 0x72, 0x25, 0xa4, 0x74, 0x5f, 0x87, 0x87, + 0xff, 0x39, 0x6b, 0x3e, 0x76, 0xa8, 0x18, 0x4d, 0x2c, 0xdd, 0x66, 0x9e, 0x91, 0x5c, 0x49, 0xfc, + 0xe9, 0x70, 0xfc, 0xc5, 0x10, 0xa7, 0x01, 0xe1, 0x7a, 0xcf, 0x17, 0x97, 0xb3, 0xe6, 0xee, 0x29, + 0xf2, 0xdc, 0x17, 0xda, 0xd5, 0x6e, 0x9a, 0xb9, 0x15, 0x6e, 0xbc, 0x4f, 0x6b, 0xf8, 0x11, 0xd4, + 0x5d, 0x26, 0x06, 0x9c, 0x9e, 0x11, 0xb9, 0x1a, 0x91, 0x8e, 0xd6, 0x26, 0x6d, 0xc7, 0xa4, 0xb4, + 0x8f, 0x66, 0xd6, 0x5c, 0x26, 0xde, 0xd1, 0x33, 0x02, 0x3f, 0x83, 0x08, 0x37, 0xc8, 0x10, 0xb5, + 0x08, 0xf1, 0x6a, 0x6d, 0x44, 0x63, 0xe9, 0x30, 0x39, 0x67, 0x33, 0xac, 0xdf, 0x24, 0xac, 0x2e, + 0xd8, 0xa6, 0x7c, 0x10, 0x29, 0xd0, 0xc4, 0x16, 0x94, 0xf9, 0x72, 0xbd, 0x25, 0xb5, 0xeb, 0x5d, + 0xe5, 0x72, 0xd6, 0xbc, 0x1b, 0xfb, 0xaf, 0x09, 0x34, 0x73, 0x8b, 0xf2, 0xf0, 0x62, 0x8f, 0x92, + 0xfa, 0x3e, 0xb8, 0xb7, 0xe2, 0xc2, 0xd3, 0x40, 0x1c, 0x7c, 0x2f, 0x82, 0x52, 0x9f, 0x3b, 0xf0, + 0x13, 0xa8, 0xa5, 0x99, 0x7e, 0xa4, 0xff, 0xeb, 0x97, 0xd1, 0xf3, 0x1c, 0x2a, 0x4f, 0x6f, 0xa3, + 0x4a, 0x31, 0xf0, 0x04, 0x54, 0x93, 0xa8, 0x3e, 0xbc, 0xd1, 0x17, 0x8b, 0x94, 0x27, 0xb7, 0x10, + 0x65, 0xbd, 0xa7, 0xe0, 0xff, 0xbf, 0xf2, 0xdc, 0xb9, 0xb1, 0xc1, 0x75, 0xb9, 0xf2, 0x6c, 0x2d, + 0x79, 0x4a, 0xee, 0xf6, 0xcf, 0xe7, 0xaa, 0x74, 0x31, 0x57, 0xa5, 0x5f, 0x73, 0x55, 0xfa, 0xb6, + 0x50, 0x0b, 0x17, 0x0b, 0xb5, 0xf0, 0x63, 0xa1, 0x16, 0x4e, 0x0e, 0xaf, 0xc4, 0x20, 0x6c, 0xdd, + 0x61, 0xc3, 0x21, 0xb5, 0x29, 0x72, 0x93, 0xda, 0x58, 0x7e, 0xb5, 0xa2, 0x5c, 0x58, 0xd5, 0xe8, + 0x85, 0x39, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xe4, 0x4c, 0xeb, 0xd6, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -168,6 +385,8 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) + Refund(ctx context.Context, in *MsgRefund, opts ...grpc.CallOption) (*MsgRefundResponse, error) + UpdateDebtParams(ctx context.Context, in *MsgUpdateDebtParams, opts ...grpc.CallOption) (*MsgUpdateDebtParamsResponse, error) } type msgClient struct { @@ -187,9 +406,29 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca return out, nil } +func (c *msgClient) Refund(ctx context.Context, in *MsgRefund, opts ...grpc.CallOption) (*MsgRefundResponse, error) { + out := new(MsgRefundResponse) + err := c.cc.Invoke(ctx, "/comdex.collector.v1beta1.Msg/Refund", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateDebtParams(ctx context.Context, in *MsgUpdateDebtParams, opts ...grpc.CallOption) (*MsgUpdateDebtParamsResponse, error) { + out := new(MsgUpdateDebtParamsResponse) + err := c.cc.Invoke(ctx, "/comdex.collector.v1beta1.Msg/UpdateDebtParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) + Refund(context.Context, *MsgRefund) (*MsgRefundResponse, error) + UpdateDebtParams(context.Context, *MsgUpdateDebtParams) (*MsgUpdateDebtParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -199,6 +438,12 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") } +func (*UnimplementedMsgServer) Refund(ctx context.Context, req *MsgRefund) (*MsgRefundResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Refund not implemented") +} +func (*UnimplementedMsgServer) UpdateDebtParams(ctx context.Context, req *MsgUpdateDebtParams) (*MsgUpdateDebtParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDebtParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -222,6 +467,42 @@ func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _Msg_Refund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRefund) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Refund(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.collector.v1beta1.Msg/Refund", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Refund(ctx, req.(*MsgRefund)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateDebtParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateDebtParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateDebtParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.collector.v1beta1.Msg/UpdateDebtParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateDebtParams(ctx, req.(*MsgUpdateDebtParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.collector.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -230,6 +511,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Deposit", Handler: _Msg_Deposit_Handler, }, + { + MethodName: "Refund", + Handler: _Msg_Refund_Handler, + }, + { + MethodName: "UpdateDebtParams", + Handler: _Msg_UpdateDebtParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/collector/v1beta1/tx.proto", @@ -303,71 +592,294 @@ func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgRefund) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgDeposit) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgRefund) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRefund) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - if m.AppId != 0 { - n += 1 + sovTx(uint64(m.AppId)) + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintTx(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgDepositResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgRefundResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *MsgRefundResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRefundResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *MsgUpdateDebtParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *MsgUpdateDebtParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgDeposit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) + +func (m *MsgUpdateDebtParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsDebtAuction { + i-- + if m.IsDebtAuction { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + { + size := m.DebtLotSize.Size() + i -= size + if _, err := m.DebtLotSize.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.LotSize.Size() + i -= size + if _, err := m.LotSize.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.DebtThreshold.Size() + i -= size + if _, err := m.DebtThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.Slots != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Slots)) + i-- + dAtA[i] = 0x20 + } + if m.AssetId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x18 + } + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintTx(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateDebtParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateDebtParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateDebtParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Addr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + return n +} + +func (m *MsgDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRefund) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Addr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRefundResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateDebtParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Addr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + if m.AssetId != 0 { + n += 1 + sovTx(uint64(m.AssetId)) + } + if m.Slots != 0 { + n += 1 + sovTx(uint64(m.Slots)) + } + l = m.DebtThreshold.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.LotSize.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.DebtLotSize.Size() + n += 1 + l + sovTx(uint64(l)) + if m.IsDebtAuction { + n += 2 + } + return n +} + +func (m *MsgUpdateDebtParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MsgDeposit: wiretype end group for non-group") @@ -531,6 +1043,449 @@ func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgRefund) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRefund: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRefund: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRefundResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRefundResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRefundResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateDebtParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateDebtParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateDebtParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Slots", wireType) + } + m.Slots = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Slots |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DebtThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LotSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LotSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtLotSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DebtLotSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsDebtAuction", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsDebtAuction = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateDebtParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateDebtParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateDebtParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/esm/handler.go b/x/esm/handler.go index 9c3ec1987..fd0e68435 100644 --- a/x/esm/handler.go +++ b/x/esm/handler.go @@ -1,13 +1,12 @@ package esm import ( + errorsmod "cosmossdk.io/errors" "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/comdex-official/comdex/x/esm/keeper" "github.com/comdex-official/comdex/x/esm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func NewHandler(k keeper.Keeper) sdk.Handler { @@ -35,7 +34,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/keeper.go b/x/esm/keeper/keeper.go index 3191b00a2..c639f2959 100644 --- a/x/esm/keeper/keeper.go +++ b/x/esm/keeper/keeper.go @@ -30,6 +30,7 @@ type ( market expected.MarketKeeper tokenmint expected.Tokenmint collector expected.Collector + authority string } ) @@ -44,6 +45,7 @@ func NewKeeper( market expected.MarketKeeper, tokenmint expected.Tokenmint, collector expected.Collector, + authority string, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -61,6 +63,7 @@ func NewKeeper( market: market, tokenmint: tokenmint, collector: collector, + authority: authority, } } diff --git a/x/esm/keeper/msg_server.go b/x/esm/keeper/msg_server.go index e4a4f962e..5f60337b1 100644 --- a/x/esm/keeper/msg_server.go +++ b/x/esm/keeper/msg_server.go @@ -2,10 +2,12 @@ package keeper import ( "context" + "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/esm/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) // NewMsgServerImpl returns an implementation of the MsgServer interface @@ -81,3 +83,14 @@ func (m msgServer) MsgCollateralRedemption(c context.Context, req *types.MsgColl return nil, nil } + +func (m msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if m.keeper.authority != req.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", m.keeper.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + m.keeper.SetParams(ctx, req.Params) + + return &types.MsgUpdateParamsResponse{}, nil +} \ No newline at end of file diff --git a/x/esm/module.go b/x/esm/module.go index f40b057a5..7411bf9d4 100644 --- a/x/esm/module.go +++ b/x/esm/module.go @@ -47,12 +47,8 @@ func (AppModuleBasic) Name() string { return types.ModuleName } -func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) + types.RegisterLegacyAminoCodec(cdc) } // RegisterInterfaces registers the module's interface types diff --git a/x/esm/types/codec.go b/x/esm/types/codec.go index 8940e911a..6db43d492 100644 --- a/x/esm/types/codec.go +++ b/x/esm/types/codec.go @@ -2,19 +2,21 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/types/msgservice" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -func RegisterCodec(cdc *codec.LegacyAmino) { +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDepositESM{}, "comdex/esm/deposit-esm", nil) cdc.RegisterConcrete(&MsgExecuteESM{}, "comdex/esm/execute-esm", nil) cdc.RegisterConcrete(&MsgKillRequest{}, "comdex/esm/stop-all-actions", nil) cdc.RegisterConcrete(&MsgCollateralRedemptionRequest{}, "comdex/esm/redeem-collateral", nil) + cdc.RegisterConcrete(&Params{}, "comdex/esm/Params", nil) + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "comdex/esm/MsgUpdateParams") } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -27,6 +29,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgExecuteESM{}, &MsgKillRequest{}, &MsgCollateralRedemptionRequest{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } @@ -37,8 +40,7 @@ var ( ) func init() { - RegisterCodec(Amino) + RegisterLegacyAminoCodec(Amino) cryptocodec.RegisterCrypto(Amino) - // sdk.RegisterLegacyAminoCodec(Amino) Amino.Seal() } 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/message_update_params.go b/x/esm/types/message_update_params.go new file mode 100644 index 000000000..9c12198b2 --- /dev/null +++ b/x/esm/types/message_update_params.go @@ -0,0 +1,35 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +func (msg *MsgUpdateParams) Route() string { + return RouterKey +} + +func (msg *MsgUpdateParams) Type() string { + return "update-params" +} + +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + authority, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{authority} +} + +func (msg *MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (msg *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority is invalid") + } + return nil +} diff --git a/x/esm/types/params.go b/x/esm/types/params.go index 712dab3b9..a0c63fac1 100644 --- a/x/esm/types/params.go +++ b/x/esm/types/params.go @@ -2,10 +2,9 @@ package types import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + errorsmod "github.com/pkg/errors" ) var ( @@ -52,7 +51,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/esm/types/tx.pb.go b/x/esm/types/tx.pb.go index 78b26763e..b7c4aecf4 100644 --- a/x/esm/types/tx.pb.go +++ b/x/esm/types/tx.pb.go @@ -6,7 +6,9 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -397,6 +399,105 @@ func (m *MsgCollateralRedemptionResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCollateralRedemptionResponse proto.InternalMessageInfo +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.47 +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/esm parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_11f122646bf242d3, []int{8} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_11f122646bf242d3, []int{9} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgDepositESM)(nil), "comdex.esm.v1beta1.MsgDepositESM") proto.RegisterType((*MsgExecuteESM)(nil), "comdex.esm.v1beta1.MsgExecuteESM") @@ -406,45 +507,55 @@ func init() { proto.RegisterType((*MsgExecuteESMResponse)(nil), "comdex.esm.v1beta1.MsgExecuteESMResponse") proto.RegisterType((*MsgKillResponse)(nil), "comdex.esm.v1beta1.MsgKillResponse") proto.RegisterType((*MsgCollateralRedemptionResponse)(nil), "comdex.esm.v1beta1.MsgCollateralRedemptionResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "comdex.esm.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "comdex.esm.v1beta1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("comdex/esm/v1beta1/tx.proto", fileDescriptor_11f122646bf242d3) } var fileDescriptor_11f122646bf242d3 = []byte{ - // 525 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xb1, 0x6e, 0xd3, 0x40, - 0x1c, 0xc6, 0x73, 0x4d, 0x88, 0x94, 0x8b, 0xa0, 0x70, 0xa2, 0x4a, 0x70, 0x2b, 0x27, 0x75, 0x19, - 0xc2, 0x50, 0x5b, 0x4d, 0x07, 0x24, 0xc6, 0xb4, 0x15, 0x42, 0x95, 0x25, 0xe4, 0x2e, 0xa8, 0x0b, - 0xba, 0xd8, 0x17, 0xf7, 0x84, 0xcf, 0x67, 0x7c, 0x17, 0x48, 0x07, 0x16, 0x9e, 0x80, 0x85, 0x8d, - 0x91, 0x87, 0xe9, 0xd8, 0x91, 0x29, 0x42, 0xc9, 0x1b, 0xf4, 0x09, 0x90, 0x7d, 0x4e, 0x9c, 0x36, - 0x75, 0x50, 0xba, 0x25, 0xf7, 0x7d, 0xfe, 0xfd, 0xff, 0xf7, 0xf9, 0x93, 0xe1, 0xb6, 0xcb, 0x99, - 0x47, 0x46, 0x16, 0x11, 0xcc, 0xfa, 0x72, 0xd0, 0x27, 0x12, 0x1f, 0x58, 0x72, 0x64, 0x46, 0x31, - 0x97, 0x1c, 0x21, 0x25, 0x9a, 0x44, 0x30, 0x33, 0x13, 0xb5, 0xe7, 0x3e, 0xf7, 0x79, 0x2a, 0x5b, - 0xc9, 0x2f, 0xe5, 0xd4, 0x74, 0x97, 0x0b, 0xc6, 0x85, 0xd5, 0xc7, 0x82, 0xcc, 0x39, 0x2e, 0xa7, - 0x61, 0xa6, 0xef, 0xdc, 0x33, 0x26, 0xa1, 0xa6, 0xaa, 0xf1, 0x0d, 0x3e, 0xb6, 0x85, 0x7f, 0x4c, - 0x22, 0x2e, 0xa8, 0x3c, 0x39, 0xb3, 0xd1, 0x16, 0xac, 0xe2, 0x28, 0xfa, 0x48, 0xbd, 0x26, 0x68, - 0x83, 0x4e, 0xc5, 0x79, 0x84, 0xa3, 0xe8, 0x9d, 0x87, 0x76, 0x60, 0xcd, 0x53, 0x26, 0x1e, 0x37, - 0x37, 0xda, 0xa0, 0x53, 0x73, 0xf2, 0x03, 0xf4, 0x1a, 0x56, 0x31, 0xe3, 0xc3, 0x50, 0x36, 0xcb, - 0x6d, 0xd0, 0xa9, 0x77, 0x5f, 0x98, 0x6a, 0x29, 0x33, 0x59, 0x6a, 0xb6, 0xbf, 0x79, 0xc4, 0x69, - 0xd8, 0xab, 0x5c, 0x8d, 0x5b, 0x25, 0x27, 0xb3, 0x1b, 0xc7, 0xe9, 0xf8, 0x93, 0x11, 0x71, 0x87, - 0x92, 0x3c, 0x74, 0xbc, 0xf1, 0x1b, 0xc0, 0x27, 0xb6, 0xf0, 0x4f, 0x69, 0x10, 0x38, 0xe4, 0xf3, - 0x90, 0x08, 0x89, 0xf6, 0x60, 0x65, 0x10, 0x73, 0x96, 0x52, 0x6a, 0xbd, 0xcd, 0x9b, 0x71, 0xab, - 0x7e, 0x89, 0x59, 0xf0, 0xc6, 0x48, 0x4e, 0x0d, 0x27, 0x15, 0x11, 0x83, 0x4f, 0x3f, 0xd1, 0x20, - 0x38, 0xfb, 0x4a, 0xa5, 0x7b, 0xf1, 0x1e, 0xc7, 0x98, 0x89, 0x14, 0x5e, 0xef, 0xbe, 0x34, 0x97, - 0xf3, 0x37, 0x4f, 0xef, 0x78, 0x7b, 0xdb, 0x37, 0xe3, 0x56, 0x43, 0x61, 0xef, 0x72, 0x0c, 0x67, - 0x09, 0x6d, 0xfc, 0x04, 0x50, 0xb7, 0x85, 0x7f, 0xc4, 0x83, 0x00, 0x4b, 0x12, 0xe3, 0xc0, 0x21, - 0x1e, 0x61, 0x91, 0xa4, 0x3c, 0x9c, 0xad, 0x5d, 0x70, 0xfd, 0x3c, 0xdf, 0x8d, 0xb5, 0xf2, 0x9d, - 0xc7, 0x50, 0x5e, 0x11, 0x83, 0xd1, 0x80, 0x5b, 0xb7, 0x3a, 0xe0, 0x10, 0x11, 0xf1, 0x50, 0x90, - 0x4c, 0xc8, 0xdf, 0xce, 0x5c, 0x78, 0x06, 0x37, 0xe7, 0x79, 0x67, 0x47, 0xbb, 0xb0, 0x55, 0x78, - 0x37, 0x65, 0xe9, 0xfe, 0x2a, 0xc3, 0xb2, 0x2d, 0x7c, 0x74, 0x0e, 0xe1, 0x42, 0xe1, 0x76, 0xef, - 0x8b, 0xfa, 0xd6, 0x3e, 0xda, 0xab, 0xff, 0x5a, 0x66, 0x33, 0x12, 0xf6, 0x42, 0x9b, 0x8a, 0xd8, - 0xb9, 0xa5, 0x90, 0xbd, 0x7c, 0x6b, 0xf4, 0x21, 0x2d, 0x6b, 0xde, 0x02, 0x64, 0x14, 0x3c, 0xbb, - 0x50, 0x44, 0x6d, 0x6f, 0xa5, 0x27, 0x23, 0x7f, 0x07, 0xb0, 0x51, 0x90, 0x1e, 0xea, 0x16, 0x00, - 0x56, 0xd4, 0x48, 0x3b, 0x5c, 0xeb, 0x19, 0xb5, 0x44, 0xef, 0xed, 0xd5, 0x44, 0x07, 0xd7, 0x13, - 0x1d, 0xfc, 0x9d, 0xe8, 0xe0, 0xc7, 0x54, 0x2f, 0x5d, 0x4f, 0xf5, 0xd2, 0x9f, 0xa9, 0x5e, 0x3a, - 0xdf, 0xf7, 0xa9, 0xbc, 0x18, 0xf6, 0x13, 0xa8, 0xa5, 0xc0, 0xfb, 0x7c, 0x30, 0xa0, 0x2e, 0xc5, - 0x41, 0xf6, 0xdf, 0x52, 0xdf, 0x17, 0x79, 0x19, 0x11, 0xd1, 0xaf, 0xa6, 0x9f, 0x96, 0xc3, 0x7f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x68, 0x1c, 0x46, 0x79, 0xe1, 0x04, 0x00, 0x00, + // 648 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xc1, 0x4e, 0x13, 0x41, + 0x18, 0xee, 0x52, 0x6c, 0xd2, 0x41, 0x41, 0x27, 0x90, 0x96, 0x85, 0x6c, 0x61, 0xf1, 0x80, 0x1a, + 0x76, 0x43, 0x49, 0xd4, 0x70, 0xb3, 0x40, 0x8c, 0x21, 0x4d, 0xcc, 0x12, 0x13, 0xc3, 0x05, 0xa7, + 0xbb, 0xc3, 0x32, 0x71, 0x77, 0x67, 0xdc, 0x99, 0x22, 0x1c, 0xbc, 0xf0, 0x04, 0x26, 0xc6, 0x37, + 0xf0, 0x01, 0x3c, 0xf8, 0x10, 0x1c, 0x89, 0x27, 0x4f, 0xc4, 0xc0, 0xc1, 0x3b, 0x0f, 0x60, 0xcc, + 0xee, 0x4c, 0xbb, 0xa5, 0xed, 0x56, 0xf1, 0xd4, 0xee, 0x7c, 0xdf, 0x7c, 0xff, 0x3f, 0xdf, 0xf7, + 0xcf, 0x80, 0x39, 0x97, 0x86, 0x1e, 0x3e, 0xb2, 0x31, 0x0f, 0xed, 0xc3, 0xd5, 0x16, 0x16, 0x68, + 0xd5, 0x16, 0x47, 0x16, 0x8b, 0xa9, 0xa0, 0x10, 0x4a, 0xd0, 0xc2, 0x3c, 0xb4, 0x14, 0xa8, 0x4f, + 0xfb, 0xd4, 0xa7, 0x29, 0x6c, 0x27, 0xff, 0x24, 0x53, 0x37, 0x5c, 0xca, 0x43, 0xca, 0xed, 0x16, + 0xe2, 0xb8, 0xab, 0xe3, 0x52, 0x12, 0x29, 0x7c, 0x7e, 0x48, 0x99, 0x44, 0x55, 0xa2, 0xb5, 0x21, + 0x28, 0x43, 0x31, 0x0a, 0xb9, 0x22, 0x54, 0x94, 0x7c, 0xc8, 0x7d, 0xfb, 0x70, 0x35, 0xf9, 0x51, + 0xc0, 0xac, 0x04, 0xf6, 0x64, 0x43, 0xf2, 0x43, 0x42, 0xe6, 0x07, 0x70, 0xa7, 0xc9, 0xfd, 0x4d, + 0xcc, 0x28, 0x27, 0x62, 0x6b, 0xa7, 0x09, 0x67, 0x40, 0x09, 0x31, 0xb6, 0x47, 0xbc, 0xaa, 0xb6, + 0xa0, 0x2d, 0x8f, 0x3b, 0xb7, 0x10, 0x63, 0x2f, 0x3c, 0x38, 0x0f, 0xca, 0x9e, 0x24, 0xd1, 0xb8, + 0x3a, 0xb6, 0xa0, 0x2d, 0x97, 0x9d, 0x6c, 0x01, 0x3e, 0x01, 0x25, 0x14, 0xd2, 0x76, 0x24, 0xaa, + 0xc5, 0x05, 0x6d, 0x79, 0xa2, 0x3e, 0x6b, 0xa9, 0x22, 0xc9, 0x49, 0x3b, 0xa6, 0x58, 0x1b, 0x94, + 0x44, 0x8d, 0xf1, 0xd3, 0xf3, 0x5a, 0xc1, 0x51, 0x74, 0x73, 0x33, 0x2d, 0xbf, 0x75, 0x84, 0xdd, + 0xb6, 0xc0, 0xff, 0x5b, 0xde, 0xfc, 0xa2, 0x81, 0xc9, 0x26, 0xf7, 0xb7, 0x49, 0x10, 0x38, 0xf8, + 0x5d, 0x1b, 0x73, 0x01, 0x97, 0xc0, 0xf8, 0x7e, 0x4c, 0xc3, 0x54, 0xa5, 0xdc, 0x98, 0xba, 0x3a, + 0xaf, 0x4d, 0x1c, 0xa3, 0x30, 0x58, 0x37, 0x93, 0x55, 0xd3, 0x49, 0x41, 0x18, 0x82, 0xbb, 0x6f, + 0x49, 0x10, 0xec, 0xbc, 0x27, 0xc2, 0x3d, 0x78, 0x99, 0x5a, 0x99, 0x8a, 0x4f, 0xd4, 0xef, 0x5b, + 0x83, 0xa1, 0x5a, 0xdb, 0x7d, 0xdc, 0xc6, 0xdc, 0xd5, 0x79, 0xad, 0x22, 0x65, 0xfb, 0x75, 0x4c, + 0x67, 0x40, 0xda, 0xfc, 0xac, 0x01, 0xa3, 0xc9, 0xfd, 0x0d, 0x1a, 0x04, 0x48, 0xe0, 0x18, 0x05, + 0x0e, 0xf6, 0x70, 0xc8, 0x04, 0xa1, 0x51, 0xa7, 0xed, 0x9c, 0xe3, 0x67, 0xfe, 0x8e, 0xdd, 0xc8, + 0xdf, 0xae, 0x0d, 0xc5, 0x11, 0x36, 0x98, 0x15, 0x30, 0x73, 0x6d, 0x06, 0x1c, 0xcc, 0x19, 0x8d, + 0x38, 0x56, 0x40, 0x96, 0x4e, 0x17, 0xb8, 0x07, 0xa6, 0xba, 0x7e, 0xab, 0xa5, 0x45, 0x50, 0xcb, + 0x3d, 0x9b, 0xa2, 0x7c, 0xd2, 0xd2, 0x6d, 0xaf, 0x98, 0x87, 0x04, 0x96, 0x9e, 0xc0, 0xc7, 0xa0, + 0x8c, 0xda, 0xe2, 0x80, 0xc6, 0x44, 0x1c, 0xab, 0xb0, 0xaa, 0xdf, 0xbf, 0xad, 0x4c, 0xab, 0xf3, + 0x3d, 0xf3, 0xbc, 0x18, 0x73, 0xbe, 0x23, 0x62, 0x12, 0xf9, 0x4e, 0x46, 0x85, 0x4f, 0x41, 0x89, + 0xf5, 0x06, 0xa6, 0x0f, 0x0b, 0x4c, 0xc5, 0xa4, 0x2c, 0x91, 0xfc, 0xf5, 0xc9, 0x93, 0x5f, 0x5f, + 0x1f, 0x66, 0x4a, 0xe6, 0x2c, 0xa8, 0xf4, 0x35, 0xd5, 0x69, 0xb8, 0xfe, 0xbb, 0x08, 0x8a, 0x4d, + 0xee, 0xc3, 0x5d, 0x00, 0x7a, 0x6e, 0xc8, 0xe2, 0xb0, 0x52, 0xd7, 0x0c, 0xd4, 0x1f, 0xfc, 0x95, + 0xd2, 0xa9, 0x91, 0x68, 0xf7, 0x8c, 0x7f, 0x9e, 0x76, 0x46, 0xc9, 0xd5, 0x1e, 0x8c, 0x09, 0xbe, + 0x4e, 0x6f, 0x57, 0x36, 0xb6, 0xd0, 0xcc, 0xd9, 0xdb, 0x73, 0x73, 0xf4, 0xa5, 0x91, 0x1c, 0xa5, + 0x7c, 0xa2, 0xa5, 0xae, 0x0d, 0x8b, 0x1b, 0xd6, 0x73, 0x04, 0x46, 0xcc, 0xbd, 0xbe, 0x76, 0xa3, + 0x3d, 0xaa, 0x89, 0x37, 0xe0, 0xf6, 0xb5, 0x59, 0xca, 0xeb, 0xbc, 0x97, 0xa4, 0x3f, 0xfa, 0x07, + 0x52, 0xa7, 0x42, 0xe3, 0xf9, 0xe9, 0x85, 0xa1, 0x9d, 0x5d, 0x18, 0xda, 0xcf, 0x0b, 0x43, 0xfb, + 0x78, 0x69, 0x14, 0xce, 0x2e, 0x8d, 0xc2, 0x8f, 0x4b, 0xa3, 0xb0, 0xbb, 0xe2, 0x13, 0x71, 0xd0, + 0x6e, 0x25, 0x62, 0xb6, 0x14, 0x5c, 0xa1, 0xfb, 0xfb, 0xc4, 0x25, 0x28, 0x50, 0xdf, 0xb6, 0x7c, + 0xa9, 0xc5, 0x31, 0xc3, 0xbc, 0x55, 0x4a, 0x5f, 0xdb, 0xb5, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xca, 0x72, 0xfc, 0x2e, 0x49, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -463,6 +574,7 @@ type MsgClient interface { ExecuteESM(ctx context.Context, in *MsgExecuteESM, opts ...grpc.CallOption) (*MsgExecuteESMResponse, error) MsgKillSwitch(ctx context.Context, in *MsgKillRequest, opts ...grpc.CallOption) (*MsgKillResponse, error) MsgCollateralRedemption(ctx context.Context, in *MsgCollateralRedemptionRequest, opts ...grpc.CallOption) (*MsgCollateralRedemptionResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -509,12 +621,22 @@ func (c *msgClient) MsgCollateralRedemption(ctx context.Context, in *MsgCollater return out, nil } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/comdex.esm.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { DepositESM(context.Context, *MsgDepositESM) (*MsgDepositESMResponse, error) ExecuteESM(context.Context, *MsgExecuteESM) (*MsgExecuteESMResponse, error) MsgKillSwitch(context.Context, *MsgKillRequest) (*MsgKillResponse, error) MsgCollateralRedemption(context.Context, *MsgCollateralRedemptionRequest) (*MsgCollateralRedemptionResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -533,6 +655,9 @@ func (*UnimplementedMsgServer) MsgKillSwitch(ctx context.Context, req *MsgKillRe func (*UnimplementedMsgServer) MsgCollateralRedemption(ctx context.Context, req *MsgCollateralRedemptionRequest) (*MsgCollateralRedemptionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgCollateralRedemption not implemented") } +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -610,6 +735,24 @@ func _Msg_MsgCollateralRedemption_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.esm.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.esm.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -630,6 +773,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgCollateralRedemption", Handler: _Msg_MsgCollateralRedemption_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/esm/v1beta1/tx.proto", @@ -894,6 +1041,69 @@ func (m *MsgCollateralRedemptionResponse) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1010,6 +1220,30 @@ func (m *MsgCollateralRedemptionResponse) Size() (n int) { return n } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1703,6 +1937,171 @@ func (m *MsgCollateralRedemptionResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/lend/handler.go b/x/lend/handler.go index b55c5831b..6d8650015 100644 --- a/x/lend/handler.go +++ b/x/lend/handler.go @@ -1,16 +1,13 @@ package lend import ( + errorsmod "cosmossdk.io/errors" "fmt" - - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/pkg/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/comdex-official/comdex/x/lend/keeper" "github.com/comdex-official/comdex/x/lend/types" + 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 ... @@ -78,7 +75,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) } } } @@ -110,7 +107,7 @@ func NewLendHandler(k keeper.Keeper) govtypes.Handler { return handleEModePairsProposal(ctx, k, c) default: - return errors.Wrapf(types.ErrorUnknownProposalType, "%T", c) + return errorsmod.Wrapf(types.ErrorUnknownProposalType, "%T", c) } } } diff --git a/x/lend/keeper/iter.go b/x/lend/keeper/iter.go index fe0d709ae..4b21da948 100644 --- a/x/lend/keeper/iter.go +++ b/x/lend/keeper/iter.go @@ -1,12 +1,10 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/comdex-official/comdex/x/lend/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) // IterateLends To calculate pending rewards from last interaction @@ -192,7 +190,7 @@ 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 sdk.ZeroDec(), errorsmod.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) } yearsElapsed := sdk.NewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) amt, _ := sdk.NewDecFromStr(amount) @@ -211,7 +209,7 @@ 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 sdk.ZeroDec(), sdk.ZeroDec(), errorsmod.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) } yearsElapsed := sdk.NewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) amt, _ := sdk.NewDecFromStr(amount) @@ -237,7 +235,7 @@ 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 sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), errorsmod.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) } yearsElapsed := sdk.NewDec(secondsElapsed).QuoInt64(types.SecondsPerYear) amt, _ := sdk.NewDecFromStr(amount) diff --git a/x/lend/keeper/keeper.go b/x/lend/keeper/keeper.go index a2f14e8e2..aebebe91b 100644 --- a/x/lend/keeper/keeper.go +++ b/x/lend/keeper/keeper.go @@ -1,24 +1,21 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "fmt" + assettypes "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auction/types" - "strconv" - + 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" liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" 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" - - 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" + "strconv" ) type ( @@ -161,12 +158,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 +198,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 { @@ -314,18 +311,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) @@ -406,7 +403,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 +418,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 +479,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) @@ -623,7 +620,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,7 +632,7 @@ 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) @@ -700,7 +697,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.NewDec(AmountIn.Amount.Int64()).Mul(assetInRatesStatsLtv) + updatedAmtIn := sdk.NewDecFromInt(AmountIn.Amount).Mul(assetInRatesStatsLtv) updatedAmtInPrice, err := k.Market.CalcAssetPrice(ctx, lendPos.AssetID, updatedAmtIn.TruncateInt()) if err != nil { return err @@ -1073,14 +1070,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 @@ -1404,12 +1401,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 +1421,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) @@ -1531,7 +1528,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 { @@ -1699,7 +1696,7 @@ 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.NewDec(borrowPos.AmountIn.Amount.Int64()).Mul(assetInRatesStats.Ltv).TruncateInt()) + 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()) firstBridgedAsset, _ := k.Asset.GetAsset(ctx, firstTransitAssetID) diff --git a/x/lend/keeper/maths.go b/x/lend/keeper/maths.go index 30276f6ee..db8edfe84 100644 --- a/x/lend/keeper/maths.go +++ b/x/lend/keeper/maths.go @@ -14,10 +14,10 @@ func (k Keeper) GetUtilisationRatioByPoolIDAndAssetID(ctx sdk.Context, poolID, a if !found { return sdk.ZeroDec(), types.ErrAssetStatsNotFound } - if sdk.NewDec(moduleBalance.Int64()).Add(sdk.NewDec(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed).Int64())).IsZero() { + if sdk.NewDecFromInt(moduleBalance).Add(sdk.NewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed))).IsZero() { return sdk.ZeroDec(), nil } - utilizationRatio := (sdk.NewDec(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed).Int64())).Quo(sdk.NewDec(moduleBalance.Int64()).Add(sdk.NewDec(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed).Int64()))) + utilizationRatio := (sdk.NewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed))).Quo(sdk.NewDecFromInt(moduleBalance).Add(sdk.NewDecFromInt(assetStats.TotalBorrowed.Add(assetStats.TotalStableBorrowed)))) return utilizationRatio, nil } @@ -80,10 +80,10 @@ func (k Keeper) GetLendAPRByAssetIDAndPoolID(ctx sdk.Context, poolID, assetID ui func (k Keeper) GetAverageBorrowRate(ctx sdk.Context, poolID, assetID uint64) (sdk.Dec, error) { assetStats, _ := k.UpdateAPR(ctx, poolID, assetID) - factor1 := assetStats.BorrowApr.Mul(sdk.NewDec(assetStats.TotalBorrowed.Int64())) - factor2 := assetStats.StableBorrowApr.Mul(sdk.NewDec(assetStats.TotalStableBorrowed.Int64())) + factor1 := assetStats.BorrowApr.Mul(sdk.NewDecFromInt(assetStats.TotalBorrowed)) + factor2 := assetStats.StableBorrowApr.Mul(sdk.NewDecFromInt(assetStats.TotalStableBorrowed)) numerator := factor1.Add(factor2) - denominator := sdk.NewDec(assetStats.TotalStableBorrowed.Add(assetStats.TotalBorrowed).Int64()) + denominator := sdk.NewDecFromInt(assetStats.TotalStableBorrowed.Add(assetStats.TotalBorrowed)) if denominator.LTE(sdk.ZeroDec()) { return sdk.ZeroDec(), types.ErrAverageBorrowRate diff --git a/x/lend/keeper/msg_server_test.go b/x/lend/keeper/msg_server_test.go index cd0e7fe63..356aee900 100644 --- a/x/lend/keeper/msg_server_test.go +++ b/x/lend/keeper/msg_server_test.go @@ -2,14 +2,14 @@ package keeper_test import ( "fmt" - utils "github.com/comdex-official/comdex/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/pkg/errors" "time" + errorsmod "cosmossdk.io/errors" + utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/lend/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/pkg/errors" ) func (s *KeeperTestSuite) TestMsgLend() { @@ -159,7 +159,7 @@ 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"), + ExpErr: errorsmod.Wrapf(types.ErrBadOfferCoinAmount, "uasset2"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -168,7 +168,7 @@ 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"), + ExpErr: errorsmod.Wrapf(types.ErrInvalidAssetIDForPool, "4"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -177,7 +177,7 @@ 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"), + ExpErr: errorsmod.Wrapf(types.ErrorAssetRatesParamsNotFound, "4"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -359,7 +359,7 @@ 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"), + ExpErr: errorsmod.Wrap(types.ErrBadOfferCoinAmount, "uasset2"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -512,7 +512,7 @@ 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"), + ExpErr: errorsmod.Wrap(types.ErrBadOfferCoinAmount, "uasset2"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -851,7 +851,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, @@ -1288,7 +1288,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, @@ -1859,7 +1859,7 @@ 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"), + ExpErr: errorsmod.Wrapf(types.ErrBadOfferCoinAmount, "uasset2"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -1877,7 +1877,7 @@ 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"), + ExpErr: errorsmod.Wrap(types.ErrInvalidAssetIDForPool, "4"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, @@ -1886,7 +1886,7 @@ 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"), + ExpErr: errorsmod.Wrap(types.ErrorAssetRatesParamsNotFound, "4"), ExpResp: nil, QueryResponseIndex: 0, QueryResponse: nil, diff --git a/x/lend/module.go b/x/lend/module.go index 0c6c1243c..12eff5b0b 100644 --- a/x/lend/module.go +++ b/x/lend/module.go @@ -45,10 +45,6 @@ func (AppModuleBasic) Name() string { return types.ModuleName } -//func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { -// types.RegisterCodec(cdc) -//} - func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) } diff --git a/x/lend/types/codec.go b/x/lend/types/codec.go index b70c00e9f..484ae1383 100644 --- a/x/lend/types/codec.go +++ b/x/lend/types/codec.go @@ -81,6 +81,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/liquidation/handler.go b/x/liquidation/handler.go index b0c878234..57322b60d 100644 --- a/x/liquidation/handler.go +++ b/x/liquidation/handler.go @@ -1,11 +1,10 @@ package liquidation import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/liquidation/keeper" "github.com/comdex-official/comdex/x/liquidation/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) // NewHandler ... @@ -23,7 +22,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/liquidate_borrow_test.go b/x/liquidation/keeper/liquidate_borrow_test.go index cbcd5dc45..364dfff0b 100644 --- a/x/liquidation/keeper/liquidate_borrow_test.go +++ b/x/liquidation/keeper/liquidate_borrow_test.go @@ -662,5 +662,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.NewDec(lockedVault[0].AmountOut.Int64()).Mul(s.GetAssetPrice(2)).Quo(sdk.NewDec(beforeAmtIn.Int64()).Mul(s.GetAssetPrice(1)))) + s.Require().Equal(lockedVault[0].CrAtLiquidation, sdk.NewDecFromInt(lockedVault[0].AmountOut).Mul(s.GetAssetPrice(2)).Quo(sdk.NewDecFromInt(beforeAmtIn).Mul(s.GetAssetPrice(1)))) } diff --git a/x/liquidation/keeper/liquidate_vaults_test.go b/x/liquidation/keeper/liquidate_vaults_test.go index 38609d01e..ef2801139 100644 --- a/x/liquidation/keeper/liquidate_vaults_test.go +++ b/x/liquidation/keeper/liquidate_vaults_test.go @@ -264,7 +264,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.NewDec(lockedVault[0].AmountIn.Int64()).Mul(s.GetAssetPrice(1)).Quo(sdk.NewDec(lockedVault[0].AmountOut.Int64()).Mul(s.GetAssetPrice(2)))) + 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)))) } func (s *KeeperTestSuite) TestUpdateLockedVaults() { @@ -272,7 +272,7 @@ func (s *KeeperTestSuite) TestUpdateLockedVaults() { liquidationKeeper, ctx := &s.liquidationKeeper, &s.ctx lockedVault1 := liquidationKeeper.GetLockedVaults(*ctx) - s.Require().Equal(lockedVault1[0].CrAtLiquidation, sdk.NewDec(lockedVault1[0].AmountIn.Int64()).Mul(s.GetAssetPrice(1)).Quo(sdk.NewDec(lockedVault1[0].AmountOut.Int64()).Mul(s.GetAssetPrice(2)))) + 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)))) } func (s *KeeperTestSuite) TestSetFlags() { diff --git a/x/liquidation/types/codec.go b/x/liquidation/types/codec.go index c20d7f0ab..9de4455c8 100644 --- a/x/liquidation/types/codec.go +++ b/x/liquidation/types/codec.go @@ -30,6 +30,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } 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/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index befd39057..7d78a72e6 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -50,6 +50,7 @@ type VaultKeeper interface { 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) + GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) } type MarketKeeper interface { @@ -103,6 +104,8 @@ type RewardsKeeper interface { type AuctionsV2Keeper interface { AuctionActivator(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) error GetAuctionParams(ctx sdk.Context) (auctionParams auctiontypes.AuctionParams, found bool) + GetAuctions(ctx sdk.Context) (auctions []auctiontypes.Auction) + DeleteAuction(ctx sdk.Context, auction auctiontypes.Auction) error } type CollectorKeeper interface { @@ -115,4 +118,5 @@ type CollectorKeeper interface { SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error SetAuctionMappingForApp(ctx sdk.Context, records collectortypes.AppAssetIdToAuctionLookupTable) error GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []collectortypes.AppAssetIdToAuctionLookupTable, found bool) + GetSlots(ctx sdk.Context) uint64 } diff --git a/x/liquidationsV2/handler.go b/x/liquidationsV2/handler.go index b9568b37a..4d15748fa 100644 --- a/x/liquidationsV2/handler.go +++ b/x/liquidationsV2/handler.go @@ -1,10 +1,10 @@ package liquidationsV2 import ( + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/liquidationsV2/keeper" "github.com/comdex-official/comdex/x/liquidationsV2/types" 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" ) @@ -27,7 +27,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 +38,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/keeper.go b/x/liquidationsV2/keeper/keeper.go index 59c4431e6..438d0ac06 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -29,6 +29,7 @@ type Keeper struct { lend expected.LendKeeper auctionsV2 expected.AuctionsV2Keeper collector expected.CollectorKeeper + authority string } func NewKeeper( @@ -46,6 +47,7 @@ func NewKeeper( lend expected.LendKeeper, auctionsV2Keeper expected.AuctionsV2Keeper, collector expected.CollectorKeeper, + authority string, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -67,6 +69,7 @@ func NewKeeper( lend: lend, auctionsV2: auctionsV2Keeper, collector: collector, + authority: authority, } } diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index bc1fbf687..13a9f0fa5 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -370,8 +370,17 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse //Calculating Liquidation Fees feesToBeCollected := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationPenalty).TruncateInt() + // for upgrade: v14 + // this code is to deduct the bonus amount from amount in of lend position of the user + + debtToken, _ := k.market.GetTwa(ctx, pair.AssetOut) + debtPrice := sdk.NewDecFromInt(sdk.NewInt(int64(debtToken.Twa))) + + collateralToken, _ := k.market.GetTwa(ctx, pair.AssetIn) + collateralPrice := sdk.NewDecFromInt(sdk.NewInt(int64(collateralToken.Twa))) //Calculating auction bonus to be given auctionBonusToBeGiven := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationBonus).TruncateInt() + _, bonusTokenQuantity, _ := k.vault.GetAmountOfOtherToken(ctx, pair.AssetOut, debtPrice, auctionBonusToBeGiven, pair.AssetIn, collateralPrice) err := k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetIn.Denom, borrow.AmountIn.Amount))) if err != nil { @@ -383,7 +392,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse return err } - err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, sdk.NewCoin(assetIn.Denom, borrow.AmountIn.Amount), borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, isInternalkeeper, liquidator, "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) + err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, sdk.NewCoin(assetIn.Denom, borrow.AmountIn.Amount.Sub(bonusTokenQuantity)), borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, isInternalkeeper, liquidator, "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) if err != nil { return err } @@ -484,17 +493,44 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint debtAssetID := collector.SecondaryAssetId //harbor // for debt Auction + // code update for v14 upgrade + // implement logic for multiple lots of debt auction at once + // previous code: + // if netFeeCollectedData.NetFeesCollected.LTE(collector.DebtThreshold.Sub(collector.LotSize)) && auctionLookupTable.IsDebtAuction + // net = 200 debtThreshold = 500 , lotSize = 100 + // debt_lot_size = how much debt we want to recover from a single auction + // lot_size = check param + + // check if debt auction is already there, it won't create any additional debt auction for now + // as soon as after the end of 6 hours, the auctions with no bids will be revoked. + 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) - if err != nil { - return err + var auctionActive = false + auctions := k.auctionsV2.GetAuctions(ctx) + for _, auction := range auctions { + if !auction.AuctionType { + // get the locked vault for that auction and check initiator type = "debt" + lockedVault, _ := k.GetLockedVault(ctx, appID, auction.LockedVaultId) + if lockedVault.InitiatorType == "debt" { + auctionActive = true + break + } + } } - auctionLookupTable.IsAuctionActive = true - err1 := k.collector.SetAuctionMappingForApp(ctx, auctionLookupTable) - if err1 != nil { - return err1 + if !auctionActive { + actualSlots := ((collector.DebtThreshold).Sub(netFeeCollectedData.NetFeesCollected.Add(collector.LotSize))).Quo(collector.LotSize) + actualSlots = actualSlots.Add(sdk.NewInt(1)) + slots := k.collector.GetSlots(ctx) + if actualSlots.Uint64() < slots { + slots = actualSlots.Uint64() + } + collateralToken, debtToken := k.DebtTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) + for i := uint64(0); i < slots; i++ { + err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "debt", false, true, collateralAssetID, debtAssetID) + if err != nil { + return err + } + } } } @@ -721,8 +757,7 @@ func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData types.LockedVault, auctionData auctionsV2types.Auction) error { // send money back to the debt pool (assetOut pool) // liquidation penalty to the reserve and interest to the pool - // send token to the bidder - // if cross pool borrow, settle the transit asset to it's native pool + // if cross pool borrow, settle the transit asset to its native pool // close the borrow and update the stats borrowPos, _ := k.lend.GetBorrow(ctx, liquidationData.OriginalVaultId) diff --git a/x/liquidationsV2/keeper/msg_server.go b/x/liquidationsV2/keeper/msg_server.go index 893a4fc44..a0c7f8008 100644 --- a/x/liquidationsV2/keeper/msg_server.go +++ b/x/liquidationsV2/keeper/msg_server.go @@ -2,8 +2,10 @@ package keeper import ( "context" + "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "strconv" ) @@ -50,3 +52,14 @@ func (m msgServer) MsgLiquidateExternalKeeper(c context.Context, req *types.MsgL } return &types.MsgLiquidateExternalKeeperResponse{}, nil } + +func (m msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if m.keeper.authority != req.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", m.keeper.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + m.keeper.SetParams(ctx, req.Params) + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index 2f99083a4..1f4e447da 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -281,8 +281,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.NewDec(beforeVault.AmountOut.Int64()).Mul(newDec("0.12")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDec(beforeVault.AmountOut.Int64()).Mul(newDec("0.12")).TruncateInt()) + 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].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) @@ -335,10 +335,9 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { s.Require().Equal(lockedVault[0].OriginalVaultId, beforeBorrow.ID) s.Require().Equal(lockedVault[0].ExtendedPairId, beforeBorrow.PairID) 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.NewDec(beforeBorrow.AmountOut.Amount.Int64()).Mul(newDec("0.05")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDec(beforeBorrow.AmountOut.Amount.Int64()).Mul(newDec("0.05")).TruncateInt()) + 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].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) @@ -434,8 +433,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.NewDec(beforeVault.AmountOut.Int64()).Mul(newDec("0.12")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDec(beforeVault.AmountOut.Int64()).Mul(newDec("0.12")).TruncateInt()) + 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].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) @@ -531,10 +530,9 @@ func (s *KeeperTestSuite) TestLiquidateInternalKeeperForBorrow() { s.Require().Equal(lockedVault[0].OriginalVaultId, beforeBorrow.ID) s.Require().Equal(lockedVault[0].ExtendedPairId, beforeBorrow.PairID) 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.NewDec(beforeBorrow.AmountOut.Amount.Int64()).Mul(newDec("0.05")).TruncateInt())) - s.Require().Equal(lockedVault[0].FeeToBeCollected, sdk.NewDec(beforeBorrow.AmountOut.Amount.Int64()).Mul(newDec("0.05")).TruncateInt()) + 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].IsDebtCmst, false) s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) diff --git a/x/liquidationsV2/types/codec.go b/x/liquidationsV2/types/codec.go index b9480ac39..5125917ff 100644 --- a/x/liquidationsV2/types/codec.go +++ b/x/liquidationsV2/types/codec.go @@ -2,19 +2,20 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - - // this line is used by starport scaffolding # 1 "github.com/cosmos/cosmos-sdk/types/msgservice" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgLiquidateInternalKeeperRequest{}, "comdex/liquidationsV2/MsgLiquidateInternalKeeperRequest", nil) cdc.RegisterConcrete(&MsgAppReserveFundsRequest{}, "comdex/liquidationsV2/MsgAppReserveFundsRequest", nil) cdc.RegisterConcrete(&MsgLiquidateExternalKeeperRequest{}, "comdex/liquidationsV2/MsgLiquidateExternalKeeperRequest", nil) + cdc.RegisterConcrete(&Params{}, "comdex/liquidationsV2/Params", nil) + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "comdex/liquidationsV2/MsgUpdateParams") } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -27,6 +28,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgLiquidateInternalKeeperRequest{}, &MsgAppReserveFundsRequest{}, &MsgLiquidateExternalKeeperRequest{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } @@ -39,6 +41,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(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/message_update_params.go b/x/liquidationsV2/types/message_update_params.go new file mode 100644 index 000000000..9c12198b2 --- /dev/null +++ b/x/liquidationsV2/types/message_update_params.go @@ -0,0 +1,35 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +func (msg *MsgUpdateParams) Route() string { + return RouterKey +} + +func (msg *MsgUpdateParams) Type() string { + return "update-params" +} + +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + authority, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{authority} +} + +func (msg *MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (msg *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority is invalid") + } + return nil +} diff --git a/x/liquidationsV2/types/msg.go b/x/liquidationsV2/types/msg.go index 44d806138..3a0e5bd6a 100644 --- a/x/liquidationsV2/types/msg.go +++ b/x/liquidationsV2/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" ) func NewMsgLiquidateInternalKeeperRequest( @@ -26,7 +26,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 @@ -64,7 +64,7 @@ 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") + return errorsmod.Wrap(ErrVaultIDInvalid, "id cannot be zero") } return nil @@ -113,7 +113,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/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index 61eb1d844..e9fd4e764 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -6,8 +6,10 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -261,6 +263,91 @@ func (m *MsgLiquidateExternalKeeperResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgLiquidateExternalKeeperResponse proto.InternalMessageInfo +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.47 +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/liquidationsV2 parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_51c735c845851e88, []int{6} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51c735c845851e88, []int{7} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgLiquidateInternalKeeperRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperRequest") proto.RegisterType((*MsgLiquidateInternalKeeperResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperResponse") @@ -268,6 +355,8 @@ func init() { proto.RegisterType((*MsgAppReserveFundsResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgAppReserveFundsResponse") proto.RegisterType((*MsgLiquidateExternalKeeperRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateExternalKeeperRequest") proto.RegisterType((*MsgLiquidateExternalKeeperResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateExternalKeeperResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "comdex.liquidationsV2.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgUpdateParamsResponse") } func init() { @@ -275,54 +364,62 @@ func init() { } var fileDescriptor_51c735c845851e88 = []byte{ - // 739 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x53, 0xd3, 0x4e, - 0x18, 0x6e, 0x4a, 0x4b, 0xe9, 0xf2, 0xe3, 0x87, 0x04, 0x66, 0x2c, 0x19, 0x4d, 0x30, 0x38, 0xca, - 0x85, 0x64, 0xc0, 0x0b, 0x38, 0x1e, 0x6c, 0x41, 0x66, 0x50, 0xd0, 0x31, 0xc3, 0x78, 0xe0, 0xd2, - 0x49, 0x9b, 0xa5, 0xee, 0x90, 0x66, 0xd3, 0xec, 0x16, 0xe9, 0xc5, 0xab, 0xe3, 0x8d, 0xaf, 0xe0, - 0x8d, 0x8f, 0xc2, 0x91, 0xa3, 0x5e, 0x32, 0x1a, 0xbe, 0x41, 0x0e, 0x1e, 0x3c, 0x39, 0xbb, 0x9b, - 0xfe, 0xa5, 0x16, 0x8b, 0xa7, 0x36, 0xbb, 0xef, 0xf3, 0xee, 0xf3, 0x3c, 0xef, 0xfb, 0xee, 0x82, - 0x47, 0x55, 0x5c, 0x77, 0xe0, 0xa9, 0xe9, 0xa2, 0x46, 0x13, 0x39, 0x36, 0x45, 0xd8, 0x23, 0xef, - 0xd6, 0xcd, 0x93, 0xb5, 0x0a, 0xa4, 0xf6, 0x9a, 0x49, 0x4f, 0x0d, 0x3f, 0xc0, 0x14, 0xcb, 0xf7, - 0x45, 0x9c, 0xd1, 0x1f, 0x67, 0x24, 0x71, 0xca, 0x42, 0x0d, 0xd7, 0x30, 0x8f, 0x34, 0xd9, 0x3f, - 0x01, 0x52, 0xd4, 0x2a, 0x26, 0x75, 0x4c, 0xcc, 0x8a, 0x4d, 0x60, 0x27, 0x65, 0x15, 0x23, 0x4f, - 0xec, 0xeb, 0xe7, 0x12, 0x78, 0xb0, 0x4f, 0x6a, 0x7b, 0x49, 0x4e, 0xb8, 0xeb, 0x51, 0x18, 0x78, - 0xb6, 0xfb, 0x0a, 0x42, 0x1f, 0x06, 0x16, 0x6c, 0x34, 0x21, 0xa1, 0xf2, 0x32, 0xc8, 0x1c, 0x05, - 0xb8, 0x5e, 0x90, 0x96, 0xa4, 0x95, 0x7c, 0x69, 0x36, 0x0e, 0xb5, 0xe9, 0x96, 0x5d, 0x77, 0x9f, - 0xea, 0x6c, 0x55, 0xb7, 0xf8, 0xa6, 0xbc, 0x09, 0xa6, 0x5c, 0xd4, 0x28, 0xd3, 0x96, 0x0f, 0x0b, - 0xe9, 0x25, 0x69, 0x25, 0x53, 0x52, 0xa3, 0x50, 0xcb, 0xed, 0xa1, 0xc6, 0x41, 0xcb, 0x87, 0x71, - 0xa8, 0xcd, 0x0a, 0x4c, 0x3b, 0x48, 0xb7, 0x72, 0xae, 0xd8, 0x93, 0x97, 0x41, 0x1a, 0x39, 0x85, - 0x09, 0x0e, 0x9a, 0x8f, 0x42, 0x2d, 0xbd, 0xeb, 0xc4, 0xa1, 0x96, 0x17, 0xf1, 0xc8, 0xd1, 0xad, - 0x34, 0x72, 0xf4, 0x87, 0x40, 0x1f, 0xc5, 0x94, 0xf8, 0xd8, 0x23, 0x50, 0xff, 0x29, 0x81, 0xc5, - 0x7d, 0x52, 0x2b, 0xfa, 0xbe, 0x05, 0x09, 0x0c, 0x4e, 0xe0, 0x4e, 0xd3, 0x73, 0x48, 0x5b, 0xc8, - 0x1a, 0x98, 0xb4, 0x7d, 0xbf, 0x8c, 0x1c, 0x2e, 0x25, 0x53, 0x52, 0xa2, 0x50, 0xcb, 0x16, 0x7d, - 0x9f, 0x9f, 0x37, 0x23, 0xce, 0x13, 0x01, 0xba, 0x95, 0xb5, 0xd9, 0x3a, 0x93, 0x65, 0x13, 0x02, - 0x29, 0x03, 0xf5, 0xc8, 0x2a, 0xb2, 0x35, 0x0e, 0x4b, 0x64, 0xb5, 0x83, 0x74, 0x2b, 0x67, 0x8b, - 0x3d, 0x79, 0x07, 0xfc, 0x4f, 0xf1, 0x31, 0xf4, 0xca, 0x8d, 0xa6, 0xed, 0x51, 0x44, 0x5b, 0x5c, - 0xe2, 0xf4, 0xfa, 0xa2, 0x21, 0xaa, 0x62, 0xb0, 0xaa, 0xb4, 0x0b, 0x68, 0x6c, 0x61, 0xe4, 0x95, - 0x32, 0x17, 0xa1, 0x96, 0xb2, 0x66, 0x38, 0xec, 0x6d, 0x82, 0xea, 0xd8, 0x9f, 0x19, 0x61, 0xbf, - 0x7e, 0x0f, 0x28, 0xc3, 0x74, 0x27, 0xb6, 0x7c, 0xca, 0xf6, 0xd7, 0xf9, 0xc5, 0xe9, 0xad, 0xeb, - 0xdc, 0xf5, 0x30, 0xfd, 0xb7, 0x1e, 0x9a, 0x20, 0x8b, 0x3f, 0x78, 0x30, 0xe0, 0xfa, 0xf3, 0xa5, - 0x45, 0x86, 0x78, 0xc3, 0x16, 0xe2, 0x50, 0xfb, 0x4f, 0x20, 0xf8, 0xbe, 0x6e, 0x89, 0x38, 0xf9, - 0x4c, 0x02, 0x77, 0xaa, 0xd8, 0x75, 0x6d, 0x0a, 0x03, 0xdb, 0x2d, 0x73, 0x3b, 0xb8, 0xfc, 0x91, - 0xe6, 0xbd, 0x64, 0xe6, 0xc5, 0xa1, 0x76, 0x57, 0xa4, 0x1c, 0x4c, 0xa0, 0xff, 0x0a, 0xb5, 0xc7, - 0x35, 0x44, 0xdf, 0x37, 0x2b, 0x46, 0x15, 0xd7, 0xcd, 0x64, 0x34, 0xc4, 0xcf, 0x2a, 0x71, 0x8e, - 0x4d, 0xd6, 0x96, 0x84, 0xe7, 0xb2, 0x66, 0xbb, 0xe8, 0x03, 0x06, 0x96, 0x3f, 0x02, 0xe0, 0xc0, - 0x0a, 0x4d, 0xb8, 0x64, 0x6f, 0xe2, 0xb2, 0x9d, 0x70, 0x99, 0x13, 0x5c, 0xba, 0xd0, 0xb1, 0x58, - 0xe4, 0x19, 0x4e, 0x9c, 0xff, 0x1a, 0xcc, 0xf7, 0x08, 0xea, 0xb4, 0xe4, 0xa4, 0x68, 0xc9, 0x38, - 0xd4, 0x94, 0x6b, 0xaa, 0xbb, 0x2d, 0x39, 0xd7, 0x5d, 0x4d, 0x1a, 0x57, 0x7e, 0x06, 0x66, 0x38, - 0xa9, 0x4e, 0xa6, 0x1c, 0xcf, 0x54, 0x88, 0x43, 0x6d, 0xa1, 0x87, 0x73, 0x37, 0xc7, 0x34, 0xfb, - 0x6e, 0xa3, 0x37, 0x00, 0x40, 0x64, 0x1b, 0x56, 0xe8, 0x56, 0x9d, 0xd0, 0xc2, 0xd4, 0x92, 0xb4, - 0x32, 0x35, 0x02, 0xda, 0x13, 0x3b, 0x38, 0xc6, 0x83, 0x8d, 0x28, 0xfa, 0x75, 0xfd, 0xdb, 0x04, - 0x98, 0xd8, 0x27, 0x35, 0xf9, 0x8b, 0xc4, 0xdb, 0xfa, 0x0f, 0x53, 0x2f, 0x3f, 0x37, 0x46, 0x5e, - 0x8a, 0xc6, 0x8d, 0x57, 0x9b, 0x52, 0xfc, 0x87, 0x0c, 0x82, 0xab, 0xfc, 0x59, 0x02, 0xf2, 0xf5, - 0xd1, 0x93, 0x37, 0x6e, 0xce, 0x3c, 0xfc, 0x96, 0x52, 0x36, 0x6f, 0x81, 0x4c, 0xb8, 0x0c, 0xfa, - 0xd5, 0x6f, 0xef, 0x58, 0x7e, 0x0d, 0xbd, 0x22, 0xc6, 0xf2, 0x6b, 0x78, 0x6d, 0x4b, 0x87, 0x17, - 0x3f, 0xd4, 0xd4, 0x79, 0xa4, 0xa6, 0x2e, 0x22, 0x55, 0xba, 0x8c, 0x54, 0xe9, 0x7b, 0xa4, 0x4a, - 0x67, 0x57, 0x6a, 0xea, 0xf2, 0x4a, 0x4d, 0x7d, 0xbd, 0x52, 0x53, 0x87, 0x1b, 0x7d, 0xf3, 0xc1, - 0x8e, 0x5b, 0xc5, 0x47, 0x47, 0xa8, 0x8a, 0x6c, 0x37, 0xf9, 0x36, 0xaf, 0xbd, 0x97, 0x7c, 0x6a, - 0x2a, 0x93, 0xfc, 0x59, 0x7b, 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xa3, 0xde, 0x8d, 0x78, 0x55, - 0x07, 0x00, 0x00, + // 879 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xbf, 0x6f, 0xdb, 0x46, + 0x14, 0x16, 0x15, 0xc9, 0xb6, 0xce, 0x71, 0xdc, 0x5c, 0x0c, 0x58, 0x22, 0x5a, 0xd2, 0x65, 0xfa, + 0xc3, 0x08, 0x60, 0x12, 0x76, 0x81, 0xc0, 0x09, 0x3a, 0x54, 0x72, 0x1a, 0x20, 0x6d, 0xdc, 0x1f, + 0x6c, 0xda, 0x21, 0x8b, 0x70, 0x12, 0xcf, 0xcc, 0x21, 0x24, 0x8f, 0xe2, 0x9d, 0x5c, 0x7b, 0xe9, + 0xd0, 0xa5, 0xe8, 0x96, 0xbf, 0xa0, 0x40, 0xb7, 0x8c, 0x1d, 0xfa, 0x47, 0x78, 0x4c, 0x3b, 0x75, + 0x22, 0x5a, 0x79, 0xe8, 0xae, 0xa1, 0x43, 0xa7, 0xe2, 0x7e, 0xc8, 0x94, 0x64, 0x57, 0xaa, 0xdd, + 0xc9, 0xe6, 0xbd, 0xef, 0x7b, 0xef, 0x7b, 0xef, 0xbe, 0x7b, 0x10, 0x78, 0xa7, 0x4b, 0xe3, 0x00, + 0x1f, 0x79, 0x11, 0xe9, 0xf5, 0x49, 0x80, 0x38, 0xa1, 0x09, 0xfb, 0x6a, 0xc7, 0x3b, 0xdc, 0xee, + 0x60, 0x8e, 0xb6, 0x3d, 0x7e, 0xe4, 0xa6, 0x19, 0xe5, 0x14, 0xbe, 0xa1, 0x70, 0xee, 0x24, 0xce, + 0xd5, 0x38, 0x73, 0x2d, 0xa4, 0x21, 0x95, 0x48, 0x4f, 0xfc, 0xa7, 0x48, 0xa6, 0xd5, 0xa5, 0x2c, + 0xa6, 0xcc, 0xeb, 0x20, 0x86, 0xcf, 0x52, 0x76, 0x29, 0x49, 0x74, 0xfc, 0xce, 0xec, 0xe2, 0x29, + 0xca, 0x50, 0xcc, 0x34, 0x76, 0x5d, 0xe7, 0x8a, 0x59, 0xe8, 0x1d, 0x6e, 0x8b, 0x3f, 0x3a, 0xd0, + 0x50, 0x81, 0xb6, 0xaa, 0xae, 0x3e, 0x54, 0xc8, 0x79, 0x69, 0x80, 0x37, 0xf7, 0x59, 0xf8, 0x58, + 0xa7, 0xc7, 0x8f, 0x12, 0x8e, 0xb3, 0x04, 0x45, 0x1f, 0x63, 0x9c, 0xe2, 0xcc, 0xc7, 0xbd, 0x3e, + 0x66, 0x1c, 0xde, 0x06, 0x95, 0x83, 0x8c, 0xc6, 0x75, 0x63, 0xc3, 0xd8, 0xac, 0xb5, 0x56, 0x87, + 0xb9, 0xbd, 0x7c, 0x8c, 0xe2, 0xe8, 0xbe, 0x23, 0x4e, 0x1d, 0x5f, 0x06, 0xe1, 0x3d, 0xb0, 0x14, + 0x91, 0x5e, 0x9b, 0x1f, 0xa7, 0xb8, 0x5e, 0xde, 0x30, 0x36, 0x2b, 0x2d, 0x6b, 0x90, 0xdb, 0x8b, + 0x8f, 0x49, 0xef, 0xc9, 0x71, 0x8a, 0x87, 0xb9, 0xbd, 0xaa, 0x38, 0x23, 0x90, 0xe3, 0x2f, 0x46, + 0x2a, 0x06, 0x6f, 0x83, 0x32, 0x09, 0xea, 0xd7, 0x24, 0xe9, 0xd6, 0x20, 0xb7, 0xcb, 0x8f, 0x82, + 0x61, 0x6e, 0xd7, 0x14, 0x9e, 0x04, 0x8e, 0x5f, 0x26, 0x81, 0xf3, 0x16, 0x70, 0x66, 0x29, 0x65, + 0x29, 0x4d, 0x18, 0x76, 0xfe, 0x32, 0x40, 0x63, 0x9f, 0x85, 0xcd, 0x34, 0xf5, 0x31, 0xc3, 0xd9, + 0x21, 0x7e, 0xd8, 0x4f, 0x02, 0x36, 0x6a, 0x64, 0x1b, 0x2c, 0xa0, 0x34, 0x6d, 0x93, 0x40, 0xb6, + 0x52, 0x69, 0x99, 0x83, 0xdc, 0xae, 0x36, 0xd3, 0x54, 0xd6, 0x5b, 0x51, 0xf5, 0x14, 0xc0, 0xf1, + 0xab, 0x48, 0x9c, 0x8b, 0xb6, 0x10, 0x63, 0x98, 0x0b, 0xd2, 0x58, 0x5b, 0x4d, 0x71, 0x26, 0x69, + 0xba, 0xad, 0x11, 0xc8, 0xf1, 0x17, 0x91, 0x8a, 0xc1, 0x87, 0xe0, 0x06, 0xa7, 0xcf, 0x71, 0xd2, + 0xee, 0xf5, 0x51, 0xc2, 0x09, 0x3f, 0x96, 0x2d, 0x2e, 0xef, 0x34, 0x5c, 0x7d, 0x07, 0xe2, 0xd6, + 0x47, 0x06, 0x71, 0xf7, 0x28, 0x49, 0x5a, 0x95, 0x93, 0xdc, 0x2e, 0xf9, 0x2b, 0x92, 0xf6, 0xb9, + 0x66, 0x9d, 0x8d, 0xbf, 0x32, 0x63, 0xfc, 0xce, 0xeb, 0xc0, 0xbc, 0xa8, 0x6f, 0x3d, 0x96, 0xef, + 0xaa, 0x93, 0xf7, 0xfc, 0xe1, 0xd1, 0x95, 0xef, 0xb9, 0x98, 0x61, 0xf9, 0xbf, 0xce, 0xd0, 0x03, + 0x55, 0xfa, 0x75, 0x82, 0x33, 0xd9, 0x7f, 0xad, 0xd5, 0x10, 0x8c, 0x4f, 0xc5, 0xc1, 0x30, 0xb7, + 0xaf, 0x2b, 0x86, 0x8c, 0x3b, 0xbe, 0xc2, 0xc1, 0x17, 0x06, 0x78, 0xad, 0x4b, 0xa3, 0x08, 0x71, + 0x9c, 0xa1, 0xa8, 0x2d, 0xc7, 0x21, 0xdb, 0x9f, 0x39, 0xbc, 0x8f, 0xc4, 0xf0, 0x86, 0xb9, 0xbd, + 0xae, 0x52, 0x4e, 0x27, 0x70, 0xfe, 0xce, 0xed, 0x77, 0x43, 0xc2, 0x9f, 0xf5, 0x3b, 0x6e, 0x97, + 0xc6, 0xfa, 0x21, 0xe8, 0x3f, 0x5b, 0x2c, 0x78, 0xee, 0x09, 0x5b, 0x32, 0x99, 0xcb, 0x5f, 0x2d, + 0xd8, 0x4f, 0x04, 0x19, 0x7e, 0x03, 0x40, 0x80, 0x3b, 0x5c, 0x6b, 0xa9, 0xce, 0xd3, 0xf2, 0x40, + 0x6b, 0xb9, 0xa9, 0xb4, 0x14, 0xd4, 0x4b, 0xa9, 0xa8, 0x09, 0x9e, 0xaa, 0xff, 0x09, 0xb8, 0x35, + 0xd6, 0xd0, 0x99, 0x25, 0x17, 0x94, 0x25, 0x87, 0xb9, 0x6d, 0x9e, 0xeb, 0xba, 0xb0, 0xe4, 0xcd, + 0xe2, 0x54, 0x1b, 0x17, 0xbe, 0x0f, 0x56, 0xa4, 0xa8, 0xb3, 0x4c, 0x8b, 0x32, 0x53, 0x7d, 0x98, + 0xdb, 0x6b, 0x63, 0x9a, 0x8b, 0x1c, 0xcb, 0xe2, 0x7b, 0xc4, 0xde, 0x05, 0x80, 0xb0, 0x07, 0xb8, + 0xc3, 0xf7, 0x62, 0xc6, 0xeb, 0x4b, 0x1b, 0xc6, 0xe6, 0xd2, 0x0c, 0xea, 0x18, 0x76, 0xfa, 0x19, + 0x4f, 0x1b, 0x51, 0xfb, 0xf5, 0x07, 0x03, 0xac, 0xee, 0xb3, 0xf0, 0xcb, 0x54, 0x60, 0x3e, 0x93, + 0x5b, 0x0e, 0xde, 0x05, 0x35, 0xd4, 0xe7, 0xcf, 0x68, 0x26, 0x5e, 0x92, 0xb2, 0x68, 0xfd, 0xd7, + 0x9f, 0xb7, 0xd6, 0xf4, 0x1d, 0x34, 0x83, 0x20, 0xc3, 0x8c, 0x7d, 0xc1, 0x33, 0x92, 0x84, 0x7e, + 0x01, 0x85, 0x7b, 0x60, 0x41, 0xed, 0x49, 0x69, 0xd8, 0xe5, 0x9d, 0xb7, 0xdd, 0x99, 0x9b, 0xda, + 0x55, 0xe5, 0xf4, 0x53, 0xd4, 0xd4, 0xfb, 0x37, 0xbe, 0xfd, 0xf3, 0xa7, 0x3b, 0x45, 0x52, 0xa7, + 0x01, 0xd6, 0xa7, 0xf4, 0x8d, 0xb4, 0xef, 0xfc, 0x52, 0x01, 0xd7, 0xf6, 0x59, 0x08, 0x7f, 0x34, + 0xe4, 0x93, 0xfc, 0x97, 0x8d, 0x05, 0x3f, 0x98, 0x23, 0x63, 0xee, 0x5a, 0x36, 0x9b, 0xff, 0x23, + 0x83, 0xd2, 0x0a, 0xbf, 0x37, 0x00, 0x3c, 0xbf, 0x36, 0xe0, 0xee, 0xfc, 0xcc, 0x17, 0x6f, 0x58, + 0xf3, 0xde, 0x15, 0x98, 0x5a, 0xcb, 0xf4, 0xbc, 0x26, 0xad, 0x71, 0xa9, 0x79, 0x5d, 0xb8, 0xde, + 0x2e, 0x35, 0xaf, 0x8b, 0x7d, 0x09, 0x0f, 0xc1, 0xf5, 0x09, 0x4f, 0xba, 0xf3, 0x53, 0x8e, 0xe3, + 0xcd, 0xbb, 0x97, 0xc3, 0x8f, 0xea, 0xb6, 0x9e, 0x9e, 0xfc, 0x61, 0x95, 0x5e, 0x0e, 0xac, 0xd2, + 0xc9, 0xc0, 0x32, 0x5e, 0x0d, 0x2c, 0xe3, 0xf7, 0x81, 0x65, 0xbc, 0x38, 0xb5, 0x4a, 0xaf, 0x4e, + 0xad, 0xd2, 0x6f, 0xa7, 0x56, 0xe9, 0xe9, 0xee, 0xc4, 0x4e, 0x11, 0x35, 0xb6, 0xe8, 0xc1, 0x01, + 0xe9, 0x12, 0x14, 0xe9, 0x6f, 0xef, 0xdc, 0xcf, 0x08, 0xb9, 0x69, 0x3a, 0x0b, 0xf2, 0xa7, 0xc0, + 0x7b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xde, 0x79, 0xb6, 0xe4, 0xe9, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -340,6 +437,7 @@ type MsgClient interface { MsgLiquidateInternalKeeper(ctx context.Context, in *MsgLiquidateInternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateInternalKeeperResponse, error) MsgAppReserveFunds(ctx context.Context, in *MsgAppReserveFundsRequest, opts ...grpc.CallOption) (*MsgAppReserveFundsResponse, error) MsgLiquidateExternalKeeper(ctx context.Context, in *MsgLiquidateExternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateExternalKeeperResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -377,11 +475,21 @@ func (c *msgClient) MsgLiquidateExternalKeeper(ctx context.Context, in *MsgLiqui return out, nil } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { MsgLiquidateInternalKeeper(context.Context, *MsgLiquidateInternalKeeperRequest) (*MsgLiquidateInternalKeeperResponse, error) MsgAppReserveFunds(context.Context, *MsgAppReserveFundsRequest) (*MsgAppReserveFundsResponse, error) MsgLiquidateExternalKeeper(context.Context, *MsgLiquidateExternalKeeperRequest) (*MsgLiquidateExternalKeeperResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -397,6 +505,9 @@ func (*UnimplementedMsgServer) MsgAppReserveFunds(ctx context.Context, req *MsgA func (*UnimplementedMsgServer) MsgLiquidateExternalKeeper(ctx context.Context, req *MsgLiquidateExternalKeeperRequest) (*MsgLiquidateExternalKeeperResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgLiquidateExternalKeeper not implemented") } +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -456,6 +567,24 @@ func _Msg_MsgLiquidateExternalKeeper_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.liquidationsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -472,6 +601,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgLiquidateExternalKeeper", Handler: _Msg_MsgLiquidateExternalKeeper_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/liquidationsV2/v1beta1/tx.proto", @@ -718,6 +851,69 @@ func (m *MsgLiquidateExternalKeeperResponse) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -829,6 +1025,30 @@ func (m *MsgLiquidateExternalKeeperResponse) Size() (n int) { return n } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1515,6 +1735,171 @@ func (m *MsgLiquidateExternalKeeperResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/liquidity/amm/pool_test.go b/x/liquidity/amm/pool_test.go index 5031eb42e..7f8e02229 100644 --- a/x/liquidity/amm/pool_test.go +++ b/x/liquidity/amm/pool_test.go @@ -613,7 +613,7 @@ func TestCreateRangedPool(t *testing.T) { utils.ParseDec("1.0"), utils.ParseDec("1.001"), utils.ParseDec("1.0005"), "", - sdkmath.NewInt(1_000000000000000000), sdkmath.NewInt(999000936633622179), + sdkmath.NewInt(1_000000000000000000), sdkmath.NewInt(999000936633614182), }, { "small x asset", diff --git a/x/liquidity/client/testutil/suite.go b/x/liquidity/client/testutil/suite.go index db6526e71..16c5672eb 100644 --- a/x/liquidity/client/testutil/suite.go +++ b/x/liquidity/client/testutil/suite.go @@ -37,7 +37,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), ) diff --git a/x/liquidity/handler.go b/x/liquidity/handler.go index 92bbefab2..41d80cb0a 100644 --- a/x/liquidity/handler.go +++ b/x/liquidity/handler.go @@ -1,13 +1,13 @@ package liquidity import ( + errorsmod "cosmossdk.io/errors" + "github.com/comdex-official/comdex/x/liquidity/keeper" + "github.com/comdex-official/comdex/x/liquidity/types" 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" "github.com/pkg/errors" - - "github.com/comdex-official/comdex/x/liquidity/keeper" - "github.com/comdex-official/comdex/x/liquidity/types" ) // NewHandler returns a new msg handler. @@ -64,7 +64,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/keeper/grpc_query.go b/x/liquidity/keeper/grpc_query.go index 527923a7d..9da71d598 100644 --- a/x/liquidity/keeper/grpc_query.go +++ b/x/liquidity/keeper/grpc_query.go @@ -4,19 +4,16 @@ import ( "context" "strconv" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" + "github.com/comdex-official/comdex/x/liquidity/amm" + "github.com/comdex-official/comdex/x/liquidity/types" + rewardstypes "github.com/comdex-official/comdex/x/rewards/types" "github.com/cosmos/cosmos-sdk/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" - - "github.com/comdex-official/comdex/x/liquidity/amm" - "github.com/comdex-official/comdex/x/liquidity/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) // Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper. @@ -713,7 +710,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 +801,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..50b3b888d 100644 --- a/x/liquidity/keeper/grpc_query_test.go +++ b/x/liquidity/keeper/grpc_query_test.go @@ -1,15 +1,14 @@ 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" + "time" ) func (s *KeeperTestSuite) TestParams() { @@ -39,7 +38,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", @@ -1167,7 +1166,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/pair.go b/x/liquidity/keeper/pair.go index 9b107ab0d..6d7458644 100644 --- a/x/liquidity/keeper/pair.go +++ b/x/liquidity/keeper/pair.go @@ -3,10 +3,9 @@ package keeper import ( "strconv" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/liquidity/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) // getNextPairIdWithUpdate increments pair id by one and set it. @@ -28,15 +27,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 +52,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 +60,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..ee1e39332 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, diff --git a/x/liquidity/keeper/params.go b/x/liquidity/keeper/params.go index cb0563445..8eeaa7e65 100644 --- a/x/liquidity/keeper/params.go +++ b/x/liquidity/keeper/params.go @@ -1,15 +1,13 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "fmt" - "reflect" - + "github.com/comdex-official/comdex/x/liquidity/types" 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" - - "github.com/comdex-official/comdex/x/liquidity/types" + "reflect" ) // GetParams returns the parameters for the liquidity module. @@ -32,7 +30,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 +46,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..e79c5a5b4 100644 --- a/x/liquidity/keeper/params_test.go +++ b/x/liquidity/keeper/params_test.go @@ -1,13 +1,12 @@ package keeper_test import ( + errorsmod "cosmossdk.io/errors" "fmt" - "time" - 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" + "time" ) func (s *KeeperTestSuite) TestUpdateGenericParams() { @@ -28,7 +27,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..a39fb9682 100644 --- a/x/liquidity/keeper/pool.go +++ b/x/liquidity/keeper/pool.go @@ -4,14 +4,14 @@ 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" - "github.com/comdex-official/comdex/x/liquidity/amm" "github.com/comdex-official/comdex/x/liquidity/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" tokenminttypes "github.com/comdex-official/comdex/x/tokenmint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // getNextPoolIdWithUpdate increments pool id by one and set it. @@ -74,25 +74,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 +129,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 +155,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 +216,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 +273,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 +281,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 +308,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 +365,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 +380,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 +403,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 +435,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 +461,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 +579,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 +696,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 +830,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 +845,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 +897,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..37154e0db 100644 --- a/x/liquidity/keeper/pool_test.go +++ b/x/liquidity/keeper/pool_test.go @@ -1,12 +1,12 @@ package keeper_test import ( + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidity" "github.com/comdex-official/comdex/x/liquidity/amm" "github.com/comdex-official/comdex/x/liquidity/types" - - sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" _ "github.com/stretchr/testify/suite" @@ -45,7 +45,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 +56,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 +67,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 +78,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 +89,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 +100,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 +111,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 +124,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 +137,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, @@ -397,7 +397,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 +408,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 +419,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 +430,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 +441,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 +452,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, @@ -718,7 +718,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 +727,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 +736,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(), }, @@ -945,7 +945,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 +958,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 +971,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 +983,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 +995,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 +1031,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 +1043,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 +1057,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 +1071,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, diff --git a/x/liquidity/keeper/rewards.go b/x/liquidity/keeper/rewards.go index 3054cb7b6..5256e5342 100644 --- a/x/liquidity/keeper/rewards.go +++ b/x/liquidity/keeper/rewards.go @@ -6,15 +6,14 @@ 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" "github.com/comdex-official/comdex/x/liquidity/types" markettypes "github.com/comdex-official/comdex/x/market/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) CalcAssetPrice(ctx sdk.Context, id uint64, amt sdkmath.Int) (price sdkmath.LegacyDec, err error) { @@ -34,17 +33,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 +170,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 +305,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 +372,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 +399,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 +415,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..8bcddcabe 100644 --- a/x/liquidity/keeper/rewards_test.go +++ b/x/liquidity/keeper/rewards_test.go @@ -1,8 +1,7 @@ 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" @@ -10,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" _ "github.com/stretchr/testify/suite" + "time" ) func (s *KeeperTestSuite) TestFarm() { @@ -60,25 +60,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"), }, { @@ -213,31 +213,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{}, }, { @@ -335,7 +335,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 +404,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] @@ -1054,14 +1054,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) } diff --git a/x/liquidity/keeper/swap.go b/x/liquidity/keeper/swap.go index 7bd5313f4..395a2764a 100644 --- a/x/liquidity/keeper/swap.go +++ b/x/liquidity/keeper/swap.go @@ -6,12 +6,12 @@ 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" - "github.com/comdex-official/comdex/x/liquidity/amm" "github.com/comdex-official/comdex/x/liquidity/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func CalculateSwapFeeAmount(ctx sdk.Context, params types.GenericParams, calculatedOfferCoinAmt sdkmath.Int) sdkmath.Int { @@ -28,29 +28,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 +62,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 +80,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 +95,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 +110,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 +158,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 +192,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 +227,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 +272,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 +314,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 +352,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 +444,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 +494,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 +512,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 +562,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 +573,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 +583,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 +606,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 +706,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 +832,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..21611a4c4 100644 --- a/x/liquidity/keeper/swap_test.go +++ b/x/liquidity/keeper/swap_test.go @@ -4,6 +4,7 @@ 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 +50,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 +67,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 +84,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 +101,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 +118,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 +135,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 +152,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 +169,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 +186,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 +237,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{}, }, { @@ -1118,7 +1119,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 +1135,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 +1151,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 +1183,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 +1199,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 +1215,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 +1231,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 +1279,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{}, }, { @@ -1701,17 +1702,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", @@ -2334,7 +2335,7 @@ func (s *KeeperTestSuite) TestExhaustRangedPool() { ammPool := pool.AMMPool(rx.Amount, ry.Amount, sdkmath.Int{}) s.Require().True(coinEq(rx, utils.ParseCoin("997231denom2"))) s.Require().True(coinEq(ry, utils.ParseCoin("984671denom1"))) - s.Require().True(decEq(ammPool.Price(), utils.ParseDec("1.003719250732340753"))) + s.Require().True(decEq(ammPool.Price(), utils.ParseDec("1.003719250732340754"))) s.Require().True(coinsEq(utils.ParseCoins("31534denom2"), s.getBalances(sdk.MustAccAddressFromBech32(params.DustCollectorAddress)))) s.Require().True(coinsEq(utils.ParseCoins("12546884denom1,12666562denom2"), s.getBalances(orderer))) diff --git a/x/liquidity/types/codec.go b/x/liquidity/types/codec.go index accfe9c00..37f2e6ad4 100644 --- a/x/liquidity/types/codec.go +++ b/x/liquidity/types/codec.go @@ -71,6 +71,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/liquidity/types/msgs.go b/x/liquidity/types/msgs.go index 937a53af8..889ce6f27 100644 --- a/x/liquidity/types/msgs.go +++ b/x/liquidity/types/msgs.go @@ -3,10 +3,10 @@ package types import ( "time" + errorsmod "cosmossdk.io/errors" + "github.com/comdex-official/comdex/x/liquidity/amm" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/comdex-official/comdex/x/liquidity/amm" ) var ( @@ -67,16 +67,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 +123,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 @@ -189,24 +189,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 +253,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 +309,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 } @@ -375,34 +375,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 +412,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 } @@ -473,37 +473,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 } @@ -557,44 +557,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 +641,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 +692,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 +746,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 +796,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 +855,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 +913,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 +968,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/locker/handler.go b/x/locker/handler.go index bf581f109..f3acf223d 100644 --- a/x/locker/handler.go +++ b/x/locker/handler.go @@ -1,11 +1,10 @@ package locker import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/locker/keeper" "github.com/comdex-official/comdex/x/locker/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) // NewHandler ... @@ -32,7 +31,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/types/codec.go b/x/locker/types/codec.go index daca08c7c..475185723 100644 --- a/x/locker/types/codec.go +++ b/x/locker/types/codec.go @@ -38,6 +38,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/locker/types/msg.go b/x/locker/types/msg.go index 0b7425b6f..0112c906d 100644 --- a/x/locker/types/msg.go +++ b/x/locker/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 ( @@ -32,20 +32,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 @@ -84,23 +84,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 @@ -139,23 +139,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 +226,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 +270,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/market/handler.go b/x/market/handler.go index cd014088d..1d8567b24 100644 --- a/x/market/handler.go +++ b/x/market/handler.go @@ -1,18 +1,17 @@ package market import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" - + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/market/keeper" "github.com/comdex-official/comdex/x/market/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(_ keeper.Keeper) sdk.Handler { 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_test.go b/x/market/keeper/keeper_test.go index 116b29f89..8bd245db8 100644 --- a/x/market/keeper/keeper_test.go +++ b/x/market/keeper/keeper_test.go @@ -70,7 +70,7 @@ func TestFucn2(t *testing.T) { intPerBlockFactor := math.Pow(factor1.MustFloat64(), yearsElapsed.MustFloat64()) intAccPerBlock := intPerBlockFactor - rewardtypes.Float64One - amtFloat := sdk.NewDec(amount.Int64()).MustFloat64() + amtFloat := sdk.NewDecFromInt(amount).MustFloat64() newAmount := intAccPerBlock * amtFloat fmt.Println("yearsElapsed", yearsElapsed) diff --git a/x/market/module.go b/x/market/module.go index 1cef4485e..789b367bd 100644 --- a/x/market/module.go +++ b/x/market/module.go @@ -126,7 +126,7 @@ func (a AppModule) EndBlock(_ sdk.Context, _ abcitypes.RequestEndBlock) []abcity func (a AppModule) GenerateGenesisState(_ *module.SimulationState) {} -func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.WeightedProposalContent { +func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.WeightedProposalMsg { return nil } diff --git a/x/market/types/codec.go b/x/market/types/codec.go index 2f780d2ea..fd378de50 100644 --- a/x/market/types/codec.go +++ b/x/market/types/codec.go @@ -5,7 +5,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) diff --git a/x/market/types/errors.go b/x/market/types/errors.go index d3b6c9e87..b7db18544 100644 --- a/x/market/types/errors.go +++ b/x/market/types/errors.go @@ -1,11 +1,9 @@ package types -import ( - "github.com/cosmos/cosmos-sdk/types/errors" -) +import 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/handler.go b/x/rewards/handler.go index 31e59e51e..73650f1ba 100644 --- a/x/rewards/handler.go +++ b/x/rewards/handler.go @@ -1,13 +1,12 @@ package rewards import ( + errorsmod "cosmossdk.io/errors" "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/comdex-official/comdex/x/rewards/keeper" "github.com/comdex-official/comdex/x/rewards/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler ... @@ -39,7 +38,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/gauge.go b/x/rewards/keeper/gauge.go index e0a6f1577..da06862fe 100644 --- a/x/rewards/keeper/gauge.go +++ b/x/rewards/keeper/gauge.go @@ -4,10 +4,9 @@ import ( "fmt" "time" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - + errorsmod "cosmossdk.io/errors" "github.com/comdex-official/comdex/x/rewards/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) // ValidateMsgCreateCreateGauge validates types.MsgCreateGauge. @@ -59,13 +58,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 +74,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 +92,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)) } } @@ -170,7 +169,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 +210,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 { diff --git a/x/rewards/keeper/iter.go b/x/rewards/keeper/iter.go index 1d55b6530..4916216f7 100644 --- a/x/rewards/keeper/iter.go +++ b/x/rewards/keeper/iter.go @@ -1,15 +1,13 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "fmt" - "math" - "strconv" - - 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" + sdk "github.com/cosmos/cosmos-sdk/types" + "math" + "strconv" ) func (k Keeper) DistributeExtRewardLocker(ctx sdk.Context) error { @@ -58,11 +56,11 @@ func (k Keeper) DistributeExtRewardLocker(ctx sdk.Context) error { continue } } - userShare := (sdk.NewDec(locker.NetBalance.Int64())).Quo(sdk.NewDec(totalShare.Int64())) // getting share percentage - availableRewards := v.AvailableRewards // Available Rewards - Duration := v.DurationDays - int64(epoch.Count) // duration left (total duration - current count) + 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) - epochRewards := sdk.NewDec(availableRewards.Amount.Int64()).Quo(sdk.NewDec(Duration)) + epochRewards := sdk.NewDecFromInt(availableRewards.Amount).Quo(sdk.NewDec(Duration)) dailyRewards := userShare.Mul(epochRewards) user, _ := sdk.AccAddressFromBech32(locker.Depositor) finalDailyRewards := dailyRewards.TruncateInt() @@ -139,9 +137,9 @@ func (k Keeper) DistributeExtRewardVault(ctx sdk.Context) error { continue } } - individualUserShare := sdk.NewDec(userVault.AmountOut.Int64()).Quo(sdk.NewDecFromInt(appExtPairVaultData.TokenMintedAmount)) // getting share percentage - Duration := v.DurationDays - int64(epoch.Count) // duration left (total duration - current count) - epochRewards := (sdk.NewDec(totalRewards.Amount.Int64())).Quo(sdk.NewDec(Duration)) + 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)) dailyRewards := individualUserShare.Mul(epochRewards) finalDailyRewards := dailyRewards.TruncateInt() @@ -183,7 +181,7 @@ func (k Keeper) CalculationOfRewards( secondsElapsed := currentTime - bTime if secondsElapsed < types.Int64Zero { - return sdk.ZeroDec(), sdkerrors.Wrap(types.ErrNegativeTimeElapsed, fmt.Sprintf("%d seconds", secondsElapsed)) + return sdk.ZeroDec(), 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 @@ -194,7 +192,7 @@ func (k Keeper) CalculationOfRewards( factor1 := a.Add(b) intPerBlockFactor := math.Pow(factor1.MustFloat64(), yearsElapsed.MustFloat64()) intAccPerBlock := intPerBlockFactor - types.Float64One - amtFloat := sdk.NewDec(amount.Int64()).MustFloat64() + amtFloat := sdk.NewDecFromInt(amount).MustFloat64() newAmount := intAccPerBlock * amtFloat // s := fmt.Sprint(newAmount) @@ -453,9 +451,9 @@ func (k Keeper) DistributeExtRewardStableVault(ctx sdk.Context) error { } } - individualUserShare := sdk.NewDec(eligibleRewardAmt.Int64()).Quo(sdk.NewDecFromInt(totalMintedData)) // getting share percentage - Duration := extRew.DurationDays - int64(epoch.Count) // duration left (total duration - current count) - epochRewards := (sdk.NewDec(totalRewards.Amount.Int64())).Quo(sdk.NewDec(Duration)) + 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)) dailyRewards := individualUserShare.Mul(epochRewards) finalDailyRewards := dailyRewards.TruncateInt() diff --git a/x/rewards/types/codec.go b/x/rewards/types/codec.go index 9382b7138..8dbaf295b 100644 --- a/x/rewards/types/codec.go +++ b/x/rewards/types/codec.go @@ -36,6 +36,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/tokenmint/client/cli/tx.go b/x/tokenmint/client/cli/tx.go index 4ac8021c6..5db202ddd 100644 --- a/x/tokenmint/client/cli/tx.go +++ b/x/tokenmint/client/cli/tx.go @@ -9,6 +9,7 @@ import ( "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/tokenmint/types" ) @@ -25,6 +26,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( txMint(), + txBurn(), ) return cmd @@ -57,3 +59,31 @@ func txMint() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } + +// Token burn txs cmd. +func txBurn() *cobra.Command { + cmd := &cobra.Command{ + Use: "tokenburn [app_id] [coins]", + Short: "burn harbor token", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + appID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + burnCoins, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return fmt.Errorf("invalid burn coins: %w", err) + } + msg := types.NewMsgBurnHarborTokensRequest(ctx.GetFromAddress().String(), appID, burnCoins) + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/tokenmint/handler.go b/x/tokenmint/handler.go index 2d157377a..226618cb1 100644 --- a/x/tokenmint/handler.go +++ b/x/tokenmint/handler.go @@ -1,13 +1,12 @@ package tokenmint import ( + errorsmod "cosmossdk.io/errors" "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/comdex-official/comdex/x/tokenmint/keeper" "github.com/comdex-official/comdex/x/tokenmint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler ... @@ -21,9 +20,12 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgMintNewTokensRequest: res, err := server.MsgMintNewTokens(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgBurnHarborTokensRequest: + res, err := server.MsgBurnHarborTokens(sdk.WrapSDKContext(ctx), msg) + 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/keeper/msg_server.go b/x/tokenmint/keeper/msg_server.go index b82aac85d..a2884fbe1 100644 --- a/x/tokenmint/keeper/msg_server.go +++ b/x/tokenmint/keeper/msg_server.go @@ -95,3 +95,27 @@ func (k msgServer) MsgMintNewTokens(c context.Context, msg *types.MsgMintNewToke return &types.MsgMintNewTokensResponse{}, nil } + +func (k msgServer) MsgBurnHarborTokens(c context.Context, msg *types.MsgBurnHarborTokensRequest) (*types.MsgBurnHarborTokensResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + burner, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return nil, err + } + if msg.BurnCoins.Denom != "uharbor" { + return &types.MsgBurnHarborTokensResponse{}, types.ErrorInvalidDenom + } + appData, found := k.asset.GetApp(ctx, msg.AppId) + if !found || appData.Name != "harbor" { + return &types.MsgBurnHarborTokensResponse{}, types.ErrorAppMappingDoesNotExists + } + if appData.GenesisToken[0].Recipient != msg.From { + return &types.MsgBurnHarborTokensResponse{}, types.ErrorInvalidFrom + } + err = k.BurnGovTokensForApp(ctx, msg.AppId, burner, msg.BurnCoins) + if err != nil { + return &types.MsgBurnHarborTokensResponse{}, err + } + + return &types.MsgBurnHarborTokensResponse{}, nil +} diff --git a/x/tokenmint/keeper/params.go b/x/tokenmint/keeper/params.go index 793dbce54..629d3bf29 100644 --- a/x/tokenmint/keeper/params.go +++ b/x/tokenmint/keeper/params.go @@ -7,10 +7,10 @@ import ( ) // GetParams get all parameters as types.Params. -func (k Keeper) GetParams(ctx sdk.Context) types.Params { +func (k Keeper) GetParams(_ sdk.Context) types.Params { return types.NewParams() } // SetParams set the params. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { +func (k Keeper) SetParams(_ sdk.Context, params types.Params) { } diff --git a/x/tokenmint/keeper/query_server.go b/x/tokenmint/keeper/query_server.go index 09d4caeee..d0c892e4b 100644 --- a/x/tokenmint/keeper/query_server.go +++ b/x/tokenmint/keeper/query_server.go @@ -20,7 +20,7 @@ func NewQueryServer(k Keeper) types.QueryServer { } } -func (q QueryServer) QueryAllTokenMintedForAllApps(c context.Context, req *types.QueryAllTokenMintedForAllAppsRequest) (*types.QueryAllTokenMintedForAllAppsResponse, error) { +func (q QueryServer) QueryAllTokenMintedForAllApps(c context.Context, _ *types.QueryAllTokenMintedForAllAppsRequest) (*types.QueryAllTokenMintedForAllAppsResponse, error) { ctx := sdk.UnwrapSDKContext(c) totalMintedData := q.GetTotalTokenMinted(ctx) diff --git a/x/tokenmint/module.go b/x/tokenmint/module.go index 55f67e3aa..41d0d477d 100644 --- a/x/tokenmint/module.go +++ b/x/tokenmint/module.go @@ -60,7 +60,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // ValidateGenesis performs genesis state validation for the capability module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { var genState types.GenesisState if err := cdc.UnmarshalJSON(bz, &genState); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) @@ -69,7 +69,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod } // RegisterRESTRoutes registers the capability module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, rtr *mux.Router) { } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. diff --git a/x/tokenmint/types/codec.go b/x/tokenmint/types/codec.go index 707f44761..3f54a416f 100644 --- a/x/tokenmint/types/codec.go +++ b/x/tokenmint/types/codec.go @@ -10,12 +10,14 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgMintNewTokensRequest{}, "comdex/tokenmint/MsgMintNewTokensRequest", nil) + cdc.RegisterConcrete(&MsgBurnHarborTokensRequest{}, "comdex/tokenmint/MsgBurnHarborTokensRequest", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgMintNewTokensRequest{}, + &MsgBurnHarborTokensRequest{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) @@ -29,6 +31,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/tokenmint/types/errors.go b/x/tokenmint/types/errors.go index 08df2cb8c..2a0f958f0 100644 --- a/x/tokenmint/types/errors.go +++ b/x/tokenmint/types/errors.go @@ -3,17 +3,18 @@ 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") + ErrorInvalidDenom = errorsmod.Register(ModuleName, 1210, "invalid denom, should be uharbor") ) diff --git a/x/tokenmint/types/keys.go b/x/tokenmint/types/keys.go index 7a371dd56..f5ae65ead 100644 --- a/x/tokenmint/types/keys.go +++ b/x/tokenmint/types/keys.go @@ -17,6 +17,7 @@ func KeyPrefix(p string) []byte { } var TypeMsgMintNewTokensRequest = ModuleName + ":mintnewtokens" +var TypeMsgBurnHarborTokensRequest = ModuleName + ":burntokens" var TokenMintKeyPrefix = []byte{0x10} diff --git a/x/tokenmint/types/msg.go b/x/tokenmint/types/msg.go index 743382100..720930771 100644 --- a/x/tokenmint/types/msg.go +++ b/x/tokenmint/types/msg.go @@ -1,11 +1,15 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ sdk.Msg = (*MsgMintNewTokensRequest)(nil) +var ( + _ sdk.Msg = (*MsgMintNewTokensRequest)(nil) + _ sdk.Msg = (*MsgBurnHarborTokensRequest)(nil) +) func NewMsgMintNewTokensRequest(from string, appID uint64, assetID uint64) *MsgMintNewTokensRequest { return &MsgMintNewTokensRequest{ @@ -25,16 +29,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 @@ -52,3 +56,49 @@ func (m *MsgMintNewTokensRequest) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{from} } + +func NewMsgBurnHarborTokensRequest(from string, appID uint64, burnCoin sdk.Coin) *MsgBurnHarborTokensRequest { + return &MsgBurnHarborTokensRequest{ + From: from, + AppId: appID, + BurnCoins: burnCoin, + } +} + +func (m *MsgBurnHarborTokensRequest) Route() string { + return RouterKey +} + +func (m *MsgBurnHarborTokensRequest) Type() string { + return TypeMsgBurnHarborTokensRequest +} + +func (m *MsgBurnHarborTokensRequest) ValidateBasic() error { + if m.From == "" { + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") + } + if m.AppId == 0 { + return errorsmod.Wrap(ErrorInvalidAppID, "app id can not be zero or negative") + } + if !m.BurnCoins.IsValid() { + return errorsmod.Wrapf(errors.ErrInvalidCoins, "bid amount %s", m.BurnCoins) + } + if _, err := sdk.AccAddressFromBech32(m.From); err != nil { + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) + } + + return nil +} + +func (m *MsgBurnHarborTokensRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +func (m *MsgBurnHarborTokensRequest) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(m.From) + if err != nil { + panic(err) + } + + return []sdk.AccAddress{from} +} diff --git a/x/tokenmint/types/tx.pb.go b/x/tokenmint/types/tx.pb.go index 097c83ea4..558405fae 100644 --- a/x/tokenmint/types/tx.pb.go +++ b/x/tokenmint/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -104,36 +105,121 @@ func (m *MsgMintNewTokensResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMintNewTokensResponse proto.InternalMessageInfo +type MsgBurnHarborTokensRequest 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"` + BurnCoins types.Coin `protobuf:"bytes,3,opt,name=burn_coins,json=burnCoins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"burn_coins"` +} + +func (m *MsgBurnHarborTokensRequest) Reset() { *m = MsgBurnHarborTokensRequest{} } +func (m *MsgBurnHarborTokensRequest) String() string { return proto.CompactTextString(m) } +func (*MsgBurnHarborTokensRequest) ProtoMessage() {} +func (*MsgBurnHarborTokensRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_877e0eff92180c18, []int{2} +} +func (m *MsgBurnHarborTokensRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnHarborTokensRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnHarborTokensRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBurnHarborTokensRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnHarborTokensRequest.Merge(m, src) +} +func (m *MsgBurnHarborTokensRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnHarborTokensRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnHarborTokensRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnHarborTokensRequest proto.InternalMessageInfo + +type MsgBurnHarborTokensResponse struct { +} + +func (m *MsgBurnHarborTokensResponse) Reset() { *m = MsgBurnHarborTokensResponse{} } +func (m *MsgBurnHarborTokensResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBurnHarborTokensResponse) ProtoMessage() {} +func (*MsgBurnHarborTokensResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_877e0eff92180c18, []int{3} +} +func (m *MsgBurnHarborTokensResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnHarborTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnHarborTokensResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBurnHarborTokensResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnHarborTokensResponse.Merge(m, src) +} +func (m *MsgBurnHarborTokensResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnHarborTokensResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnHarborTokensResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnHarborTokensResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgMintNewTokensRequest)(nil), "comdex.tokenmint.v1beta1.MsgMintNewTokensRequest") proto.RegisterType((*MsgMintNewTokensResponse)(nil), "comdex.tokenmint.v1beta1.MsgMintNewTokensResponse") + proto.RegisterType((*MsgBurnHarborTokensRequest)(nil), "comdex.tokenmint.v1beta1.MsgBurnHarborTokensRequest") + proto.RegisterType((*MsgBurnHarborTokensResponse)(nil), "comdex.tokenmint.v1beta1.MsgBurnHarborTokensResponse") } func init() { proto.RegisterFile("comdex/tokenmint/v1beta1/tx.proto", fileDescriptor_877e0eff92180c18) } var fileDescriptor_877e0eff92180c18 = []byte{ - // 327 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0xcb, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, - 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x80, - 0x28, 0xd1, 0x83, 0x2b, 0xd1, 0x83, 0x2a, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd2, - 0x07, 0xb1, 0x20, 0xea, 0x95, 0x16, 0x32, 0x72, 0x89, 0xfb, 0x16, 0xa7, 0xfb, 0x66, 0xe6, 0x95, - 0xf8, 0xa5, 0x96, 0x87, 0x80, 0x74, 0x15, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x29, - 0x73, 0xb1, 0xa4, 0x15, 0xe5, 0xe7, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0xf1, 0x7f, 0xba, - 0x27, 0xcf, 0x5d, 0x99, 0x98, 0x9b, 0x63, 0xa5, 0x04, 0x12, 0x55, 0x0a, 0x02, 0x4b, 0x0a, 0x19, - 0x72, 0xb1, 0x25, 0x16, 0x14, 0xc4, 0x67, 0xa6, 0x48, 0x30, 0x29, 0x30, 0x6a, 0xb0, 0x38, 0x49, - 0x3d, 0xba, 0x27, 0xcf, 0xea, 0x58, 0x50, 0xe0, 0x99, 0xf2, 0xe9, 0x9e, 0x3c, 0x2f, 0x44, 0x3d, - 0x44, 0x81, 0x52, 0x10, 0x6b, 0x22, 0x48, 0x5c, 0x48, 0x8f, 0x8b, 0x23, 0xb1, 0xb8, 0x38, 0xb5, - 0x04, 0xa4, 0x89, 0x19, 0xac, 0x49, 0xf8, 0xd3, 0x3d, 0x79, 0x7e, 0xa8, 0x5a, 0xa8, 0x8c, 0x52, - 0x10, 0x3b, 0x98, 0xe9, 0x99, 0xa2, 0x24, 0xc5, 0x25, 0x81, 0xe9, 0xc4, 0xe2, 0x82, 0xfc, 0xbc, - 0xe2, 0x54, 0xa3, 0x06, 0x46, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x4a, 0x2e, 0x01, 0x74, 0x35, - 0x42, 0x86, 0x7a, 0xb8, 0x02, 0x43, 0x0f, 0x87, 0x97, 0xa5, 0x8c, 0x48, 0xd1, 0x02, 0x71, 0x82, - 0x53, 0xe8, 0x89, 0x87, 0x72, 0x0c, 0x2b, 0x1e, 0xc9, 0x31, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, - 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, - 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x71, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, 0xc8, 0x6c, 0x7d, 0x88, - 0xf9, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x72, 0xa4, 0x96, - 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x23, 0xc8, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x9d, - 0xb1, 0xb2, 0x47, 0xf5, 0x01, 0x00, 0x00, + // 456 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0xbb, 0x6e, 0xd4, 0x40, + 0x14, 0xf5, 0xe4, 0x05, 0x99, 0x08, 0x05, 0x39, 0x48, 0x2c, 0x46, 0x8c, 0x83, 0x69, 0xb6, 0xc9, + 0x98, 0xdd, 0x40, 0x43, 0x87, 0x69, 0x48, 0xb1, 0x14, 0x16, 0x34, 0x34, 0x91, 0x1f, 0xb3, 0x66, + 0x48, 0x3c, 0x63, 0x7c, 0x67, 0x21, 0xdb, 0x22, 0xd1, 0xf3, 0x0b, 0x74, 0x88, 0x2f, 0xd9, 0x32, + 0x25, 0x95, 0x09, 0xde, 0x3f, 0xd8, 0x2f, 0x40, 0x33, 0x63, 0x22, 0x1e, 0x59, 0xa4, 0x34, 0x54, + 0xbe, 0x9e, 0x7b, 0xce, 0xf5, 0xb9, 0xe7, 0x78, 0xf0, 0xdd, 0x4c, 0x96, 0x39, 0x3b, 0x09, 0x95, + 0x3c, 0x62, 0xa2, 0xe4, 0x42, 0x85, 0x6f, 0x07, 0x29, 0x53, 0xc9, 0x20, 0x54, 0x27, 0xb4, 0xaa, + 0xa5, 0x92, 0x6e, 0xcf, 0x42, 0xe8, 0x39, 0x84, 0x76, 0x10, 0xef, 0x46, 0x21, 0x0b, 0x69, 0x40, + 0xa1, 0xae, 0x2c, 0xde, 0x23, 0x99, 0x84, 0x52, 0x42, 0x98, 0x26, 0xc0, 0xce, 0xa7, 0x65, 0x92, + 0x0b, 0xdb, 0x0f, 0x3e, 0x21, 0x7c, 0x73, 0x04, 0xc5, 0x88, 0x0b, 0xf5, 0x8c, 0xbd, 0x7b, 0xae, + 0xa7, 0x42, 0xcc, 0xde, 0x4c, 0x18, 0x28, 0xf7, 0x1e, 0x5e, 0x1b, 0xd7, 0xb2, 0xec, 0xa1, 0x5d, + 0xd4, 0xdf, 0x8c, 0xb6, 0x17, 0x8d, 0xbf, 0x35, 0x4d, 0xca, 0xe3, 0x47, 0x81, 0x3e, 0x0d, 0x62, + 0xd3, 0x74, 0x07, 0x78, 0x23, 0xa9, 0xaa, 0x43, 0x9e, 0xf7, 0x56, 0x76, 0x51, 0x7f, 0x2d, 0xf2, + 0xda, 0xc6, 0x5f, 0x7f, 0x5c, 0x55, 0x07, 0xf9, 0xa2, 0xf1, 0xaf, 0x59, 0xbc, 0x05, 0x04, 0xf1, + 0x7a, 0xa2, 0xcf, 0x5d, 0x8a, 0xaf, 0x26, 0x00, 0x4c, 0x69, 0xd2, 0xaa, 0x21, 0xed, 0x2c, 0x1a, + 0x7f, 0xbb, 0xc3, 0x76, 0x9d, 0x20, 0xbe, 0x62, 0xca, 0x83, 0x3c, 0xf0, 0x70, 0xef, 0x6f, 0x89, + 0x50, 0x49, 0x01, 0x2c, 0x38, 0x43, 0xd8, 0x1b, 0x41, 0x11, 0x4d, 0x6a, 0xf1, 0x34, 0xa9, 0x53, + 0x59, 0xff, 0x9f, 0x15, 0x5e, 0x63, 0x9c, 0x4e, 0x6a, 0x71, 0xa8, 0x9d, 0x04, 0xb3, 0xc4, 0xd6, + 0xf0, 0x16, 0xb5, 0x5e, 0x53, 0xed, 0xf5, 0xcf, 0x58, 0xe8, 0x13, 0xc9, 0x45, 0x74, 0x7f, 0xd6, + 0xf8, 0xce, 0x97, 0x6f, 0x7e, 0xbf, 0xe0, 0xea, 0xd5, 0x24, 0xa5, 0x99, 0x2c, 0xc3, 0x2e, 0x18, + 0xfb, 0xd8, 0x83, 0xfc, 0x28, 0x54, 0xd3, 0x8a, 0x81, 0x21, 0x40, 0xbc, 0xa9, 0xc7, 0x9b, 0x32, + 0xb8, 0x83, 0x6f, 0x5f, 0xb8, 0xa1, 0x75, 0x60, 0xf8, 0x61, 0x05, 0xaf, 0x8e, 0xa0, 0x70, 0xa7, + 0xf8, 0xfa, 0x9f, 0x2e, 0xb9, 0x03, 0xba, 0xec, 0x77, 0xa1, 0x4b, 0x42, 0xf7, 0x86, 0x97, 0xa1, + 0x58, 0x09, 0xee, 0x7b, 0x84, 0x77, 0x2e, 0x90, 0xe8, 0x3e, 0xf8, 0xe7, 0xac, 0x25, 0x99, 0x79, + 0x0f, 0x2f, 0xc9, 0xb2, 0x22, 0xa2, 0x17, 0xb3, 0xef, 0xc4, 0xf9, 0xdc, 0x12, 0x67, 0xd6, 0x12, + 0x74, 0xda, 0x12, 0x74, 0xd6, 0x12, 0xf4, 0x71, 0x4e, 0x9c, 0xd3, 0x39, 0x71, 0xbe, 0xce, 0x89, + 0xf3, 0x72, 0xff, 0x37, 0xf7, 0xf5, 0x27, 0xf6, 0xe4, 0x78, 0xcc, 0x33, 0x9e, 0x1c, 0x77, 0xef, + 0xe1, 0xaf, 0x77, 0xcf, 0xc4, 0x91, 0x6e, 0x98, 0x7b, 0xb2, 0xff, 0x23, 0x00, 0x00, 0xff, 0xff, + 0xcb, 0x24, 0x51, 0x74, 0x9c, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -149,6 +235,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { MsgMintNewTokens(ctx context.Context, in *MsgMintNewTokensRequest, opts ...grpc.CallOption) (*MsgMintNewTokensResponse, error) + MsgBurnHarborTokens(ctx context.Context, in *MsgBurnHarborTokensRequest, opts ...grpc.CallOption) (*MsgBurnHarborTokensResponse, error) } type msgClient struct { @@ -168,9 +255,19 @@ func (c *msgClient) MsgMintNewTokens(ctx context.Context, in *MsgMintNewTokensRe return out, nil } +func (c *msgClient) MsgBurnHarborTokens(ctx context.Context, in *MsgBurnHarborTokensRequest, opts ...grpc.CallOption) (*MsgBurnHarborTokensResponse, error) { + out := new(MsgBurnHarborTokensResponse) + err := c.cc.Invoke(ctx, "/comdex.tokenmint.v1beta1.Msg/MsgBurnHarborTokens", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { MsgMintNewTokens(context.Context, *MsgMintNewTokensRequest) (*MsgMintNewTokensResponse, error) + MsgBurnHarborTokens(context.Context, *MsgBurnHarborTokensRequest) (*MsgBurnHarborTokensResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -180,6 +277,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) MsgMintNewTokens(ctx context.Context, req *MsgMintNewTokensRequest) (*MsgMintNewTokensResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgMintNewTokens not implemented") } +func (*UnimplementedMsgServer) MsgBurnHarborTokens(ctx context.Context, req *MsgBurnHarborTokensRequest) (*MsgBurnHarborTokensResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgBurnHarborTokens not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -203,6 +303,24 @@ func _Msg_MsgMintNewTokens_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Msg_MsgBurnHarborTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBurnHarborTokensRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgBurnHarborTokens(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.tokenmint.v1beta1.Msg/MsgBurnHarborTokens", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgBurnHarborTokens(ctx, req.(*MsgBurnHarborTokensRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.tokenmint.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -211,6 +329,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgMintNewTokens", Handler: _Msg_MsgMintNewTokens_Handler, }, + { + MethodName: "MsgBurnHarborTokens", + Handler: _Msg_MsgBurnHarborTokens_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/tokenmint/v1beta1/tx.proto", @@ -279,6 +401,74 @@ func (m *MsgMintNewTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *MsgBurnHarborTokensRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurnHarborTokensRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnHarborTokensRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.BurnCoins.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintTx(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBurnHarborTokensResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurnHarborTokensResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnHarborTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -318,6 +508,33 @@ func (m *MsgMintNewTokensResponse) Size() (n int) { return n } +func (m *MsgBurnHarborTokensRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + l = m.BurnCoins.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgBurnHarborTokensResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -494,6 +711,190 @@ func (m *MsgMintNewTokensResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgBurnHarborTokensRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBurnHarborTokensRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnHarborTokensRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BurnCoins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BurnCoins.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBurnHarborTokensResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBurnHarborTokensResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnHarborTokensResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/vault/client/cli/tx.go b/x/vault/client/cli/tx.go index f71f0c89a..414d131a2 100644 --- a/x/vault/client/cli/tx.go +++ b/x/vault/client/cli/tx.go @@ -36,6 +36,7 @@ func GetTxCmd() *cobra.Command { DepositStableMint(), WithdrawStableMint(), CalculateInterest(), + StableMintWithdrawControl(), ) return cmd @@ -500,3 +501,34 @@ func CalculateInterest() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } + +func StableMintWithdrawControl() *cobra.Command { + cmd := &cobra.Command{ + Use: "stablemint-control [appID]", + Short: "control stable mint vault withdrawal", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + appID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + msg := types.NewMsgWithdrawStableMintControlRequest(ctx.FromAddress, appID) + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} \ No newline at end of file diff --git a/x/vault/client/testutil/suite.go b/x/vault/client/testutil/suite.go index 2a0a5b7c6..d3394f3a2 100644 --- a/x/vault/client/testutil/suite.go +++ b/x/vault/client/testutil/suite.go @@ -2,28 +2,23 @@ package testutil import ( "fmt" - "testing" - - "github.com/stretchr/testify/suite" - chain "github.com/comdex-official/comdex/app" + "github.com/comdex-official/comdex/testutil/network" "github.com/comdex-official/comdex/x/vault/client/cli" vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" "github.com/comdex-official/comdex/x/vault/types" - - "github.com/comdex-official/comdex/testutil/network" + dbm "github.com/cometbft/cometbft-db" + tmcli "github.com/cometbft/cometbft/libs/cli" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "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" 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" + "github.com/stretchr/testify/suite" + "testing" ) type VaultIntegrationTestSuite struct { @@ -41,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), ) diff --git a/x/vault/expected/keeper.go b/x/vault/expected/keeper.go index b0ba1b0d8..d4669f4bf 100644 --- a/x/vault/expected/keeper.go +++ b/x/vault/expected/keeper.go @@ -1,11 +1,11 @@ package expected import ( - sdk "github.com/cosmos/cosmos-sdk/types" - + sdkmath "cosmossdk.io/math" assettypes "github.com/comdex-official/comdex/x/asset/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) type BankKeeper interface { @@ -29,11 +29,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 { @@ -41,14 +41,15 @@ type EsmKeeper interface { GetESMStatus(ctx sdk.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) GetSnapshotOfPrices(ctx sdk.Context, appID, assetID uint64) (price uint64, found bool) GetESMTriggerParams(ctx sdk.Context, id uint64) (esmTriggerParams esmtypes.ESMTriggerParams, found bool) + GetParams(ctx sdk.Context) esmtypes.Params } 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/handler.go b/x/vault/handler.go index 9838f7164..78744e5de 100644 --- a/x/vault/handler.go +++ b/x/vault/handler.go @@ -48,6 +48,9 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgVaultInterestCalcRequest: res, err := server.MsgVaultInterestCalc(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgWithdrawStableMintControlRequest: + res, err := server.MsgWithdrawStableMintControl(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, errors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } diff --git a/x/vault/keeper/msg_server.go b/x/vault/keeper/msg_server.go index b5d726343..e9fa791bc 100644 --- a/x/vault/keeper/msg_server.go +++ b/x/vault/keeper/msg_server.go @@ -164,7 +164,7 @@ func (k msgServer) MsgCreate(c context.Context, msg *types.MsgCreateRequest) (*t newVault.AmountIn = msg.AmountIn // closingFeeVal := msg.AmountOut.Mul(sdk.Int(extendedPairVault.ClosingFee)).Quo(sdk.Int(sdk.OneDec())) - closingFeeVal := sdk.NewDec(msg.AmountOut.Int64()).Mul(extendedPairVault.ClosingFee).TruncateInt() + closingFeeVal := sdk.NewDecFromInt(msg.AmountOut).Mul(extendedPairVault.ClosingFee).TruncateInt() newVault.ClosingFeeAccumulated = closingFeeVal newVault.AmountOut = msg.AmountOut @@ -1267,6 +1267,10 @@ func (k msgServer) MsgDepositStableMint(c context.Context, msg *types.MsgDeposit func (k msgServer) MsgWithdrawStableMint(c context.Context, msg *types.MsgWithdrawStableMintRequest) (*types.MsgWithdrawStableMintResponse, error) { ctx := sdk.UnwrapSDKContext(c) + getControl := k.GetWithdrawStableMintControl(ctx) + if getControl { + return nil, types.ErrorWithdrawStableMintVault + } esmStatus, found := k.esm.GetESMStatus(ctx, msg.AppId) status := false if found { @@ -1451,3 +1455,35 @@ func (k msgServer) MsgVaultInterestCalc(c context.Context, msg *types.MsgVaultIn return &types.MsgVaultInterestCalcResponse{}, nil } + +func (k msgServer) MsgWithdrawStableMintControl(c context.Context, msg *types.MsgWithdrawStableMintControlRequest) (*types.MsgWithdrawStableMintControlResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + // check if address is admin + getAdmin := k.esm.GetParams(ctx).Admin + + // check if address is admin in getAdmin array + if getAdmin[0] != msg.From { + return nil, esmtypes.ErrorUnauthorized + } + + appMapping, found := k.asset.GetApp(ctx, msg.AppId) + if !found { + return nil, types.ErrorAppMappingDoesNotExist + } + // check app name is harbor + if appMapping.Name != "harbor" { + return nil, types.ErrorAppMappingDoesNotExist + } + + // check GetWithdrawStableMintControl value + control := k.GetWithdrawStableMintControl(ctx) + + if control { + k.SetWithdrawStableMintControl(ctx, false) + } else { + k.SetWithdrawStableMintControl(ctx, true) + } + + return &types.MsgWithdrawStableMintControlResponse{}, nil +} diff --git a/x/vault/keeper/vault.go b/x/vault/keeper/vault.go index 002cf130b..d25e1adfa 100644 --- a/x/vault/keeper/vault.go +++ b/x/vault/keeper/vault.go @@ -652,12 +652,12 @@ 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.NewDec(individualVote.Int64()).Quo(sdk.NewDec(totalVote.Int64())) - shareByExtPair := votingR.Mul(sdk.NewDec(amount.Int64())) + votingR := sdk.NewDecFromInt(individualVote).Quo(sdk.NewDecFromInt(totalVote)) + shareByExtPair := votingR.Mul(sdk.NewDecFromInt(amount)) if !found || extPairVaultMappingData.TokenMintedAmount.IsZero() { continue } - perUserShareByAmtDec := shareByExtPair.Quo(sdk.NewDec(extPairVaultMappingData.TokenMintedAmount.Int64())) + perUserShareByAmtDec := shareByExtPair.Quo(sdk.NewDecFromInt(extPairVaultMappingData.TokenMintedAmount)) vaultsData, _ = k.GetAppExtendedPairVaultMappingData(ctx, appID, extP) for _, vaultID := range vaultsData.VaultIds { @@ -823,3 +823,34 @@ func (k Keeper) GetStableMintVaultRewardsOfAllApps(ctx sdk.Context) (mappingData return mappingData } + +func (k Keeper) SetWithdrawStableMintControl(ctx sdk.Context, control bool) { + var ( + store = k.Store(ctx) + key = types.StableVaultControlKeyPrefix + value = k.cdc.MustMarshal( + &protobuftypes.BoolValue{ + Value: control, + }, + ) + ) + + store.Set(key, value) +} + +func (k Keeper) GetWithdrawStableMintControl(ctx sdk.Context) bool { + var ( + store = k.Store(ctx) + key = types.StableVaultControlKeyPrefix + value = store.Get(key) + ) + + if value == nil { + return false + } + + var id protobuftypes.BoolValue + k.cdc.MustUnmarshal(value, &id) + + return id.GetValue() +} \ No newline at end of file diff --git a/x/vault/module.go b/x/vault/module.go index e7fe7ccec..c5723dfda 100644 --- a/x/vault/module.go +++ b/x/vault/module.go @@ -115,7 +115,7 @@ func (a AppModule) EndBlock(_ sdk.Context, _ abcitypes.RequestEndBlock) []abcity func (a AppModule) GenerateGenesisState(_ *module.SimulationState) {} -func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.WeightedProposalContent { +func (a AppModule) ProposalContents(_ module.SimulationState) []simulation.WeightedProposalMsg { return nil } diff --git a/x/vault/types/codec.go b/x/vault/types/codec.go index 73c162e50..5b58d8963 100644 --- a/x/vault/types/codec.go +++ b/x/vault/types/codec.go @@ -21,6 +21,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDepositStableMintRequest{}, "comdex/vault/MsgDepositStableMintRequest", nil) cdc.RegisterConcrete(&MsgWithdrawStableMintRequest{}, "comdex/vault/MsgWithdrawStableMintRequest", nil) cdc.RegisterConcrete(&MsgVaultInterestCalcRequest{}, "comdex/vault/MsgVaultInterestCalcRequest", nil) + cdc.RegisterConcrete(&MsgWithdrawStableMintControlRequest{}, "comdex/vault/MsgWithdrawStableMintControlRequest", nil) } func RegisterInterfaces(registry codectypes.InterfaceRegistry) { @@ -37,6 +38,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgDepositStableMintRequest{}, &MsgWithdrawStableMintRequest{}, &MsgVaultInterestCalcRequest{}, + &MsgWithdrawStableMintControlRequest{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) @@ -50,6 +52,5 @@ var ( func init() { RegisterLegacyAminoCodec(amino) cryptocodec.RegisterCrypto(amino) - // sdk.RegisterLegacyAminoCodec(amino) amino.Seal() } diff --git a/x/vault/types/errors.go b/x/vault/types/errors.go index 725eb9df9..3acd8c95c 100644 --- a/x/vault/types/errors.go +++ b/x/vault/types/errors.go @@ -32,4 +32,5 @@ var ( 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") + ErrorWithdrawStableMintVault = errors.Register(ModuleName, 1328, "Temporary suspension of withdrawals from the Stable Mint Vault") ) diff --git a/x/vault/types/keys.go b/x/vault/types/keys.go index ffd88ae7e..cdb13bee5 100644 --- a/x/vault/types/keys.go +++ b/x/vault/types/keys.go @@ -12,17 +12,18 @@ const ( ) var ( - TypeMsgCreateRequest = ModuleName + ":create" - TypeMsgDepositRequest = ModuleName + ":deposit" - TypeMsgWithdrawRequest = ModuleName + ":withdraw" - TypeMsgDrawRequest = ModuleName + ":draw" - TypeMsgRepayRequest = ModuleName + ":repay" - TypeMsgLiquidateRequest = ModuleName + ":liquidate" - TypeMsgDepositDrawRequest = ModuleName + ":deposit_draw" - TypeMsgCreateStableMintRequest = ModuleName + ":create_stablemint" - TypeMsgDepositStableMintRequest = ModuleName + ":deposit_stablemint" - TypeMsgWithdrawStableMintRequest = ModuleName + ":withdraw_stablemint" - TypeMsgVaultInterestCalcRequest = ModuleName + ":calculate_interest" + TypeMsgCreateRequest = ModuleName + ":create" + TypeMsgDepositRequest = ModuleName + ":deposit" + TypeMsgWithdrawRequest = ModuleName + ":withdraw" + TypeMsgDrawRequest = ModuleName + ":draw" + TypeMsgRepayRequest = ModuleName + ":repay" + TypeMsgLiquidateRequest = ModuleName + ":liquidate" + TypeMsgDepositDrawRequest = ModuleName + ":deposit_draw" + TypeMsgCreateStableMintRequest = ModuleName + ":create_stablemint" + TypeMsgDepositStableMintRequest = ModuleName + ":deposit_stablemint" + TypeMsgWithdrawStableMintRequest = ModuleName + ":withdraw_stablemint" + TypeMsgVaultInterestCalcRequest = ModuleName + ":calculate_interest" + TypeMsgWithdrawStableMintControlRequest = ModuleName + ":withdraw_stablemint_control" ) var ( @@ -34,6 +35,7 @@ var ( StableVaultIDPrefix = []byte{0x16} VaultLengthPrefix = []byte{0x17} StableVaultRewardsKeyPrefix = []byte{0x18} + StableVaultControlKeyPrefix = []byte{0x19} ) func VaultKey(vaultID uint64) []byte { diff --git a/x/vault/types/msg.go b/x/vault/types/msg.go index 8709aa9c4..daaeeff20 100644 --- a/x/vault/types/msg.go +++ b/x/vault/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 ( @@ -16,6 +16,7 @@ var ( _ sdk.Msg = (*MsgDepositStableMintRequest)(nil) _ sdk.Msg = (*MsgWithdrawStableMintRequest)(nil) _ sdk.Msg = (*MsgVaultInterestCalcRequest)(nil) + _ sdk.Msg = (*MsgWithdrawStableMintControlRequest)(nil) ) func NewMsgCreateRequest( @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -616,3 +617,46 @@ func (m *MsgVaultInterestCalcRequest) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{from} } + +func NewMsgWithdrawStableMintControlRequest( + from sdk.AccAddress, + appID uint64, +) *MsgWithdrawStableMintControlRequest { + return &MsgWithdrawStableMintControlRequest{ + From: from.String(), + AppId: appID, + } +} + +func (m *MsgWithdrawStableMintControlRequest) Route() string { + return RouterKey +} + +func (m *MsgWithdrawStableMintControlRequest) Type() string { + return TypeMsgWithdrawStableMintControlRequest +} + +func (m *MsgWithdrawStableMintControlRequest) ValidateBasic() error { + if m.From == "" { + return errorsmod.Wrap(ErrorInvalidFrom, "from cannot be empty") + } + if _, err := sdk.AccAddressFromBech32(m.From); err != nil { + return errorsmod.Wrapf(ErrorInvalidFrom, "%s", err) + } + + return nil +} + +func (m *MsgWithdrawStableMintControlRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +func (m *MsgWithdrawStableMintControlRequest) GetSigners() []sdk.AccAddress { + + from, err := sdk.AccAddressFromBech32(m.From) + if err != nil { + panic(err) + } + + return []sdk.AccAddress{from} +} diff --git a/x/vault/types/tx.pb.go b/x/vault/types/tx.pb.go index 81222ee83..a4da4603d 100644 --- a/x/vault/types/tx.pb.go +++ b/x/vault/types/tx.pb.go @@ -872,6 +872,80 @@ func (m *MsgVaultInterestCalcResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVaultInterestCalcResponse proto.InternalMessageInfo +type MsgWithdrawStableMintControlRequest 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"` +} + +func (m *MsgWithdrawStableMintControlRequest) Reset() { *m = MsgWithdrawStableMintControlRequest{} } +func (m *MsgWithdrawStableMintControlRequest) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawStableMintControlRequest) ProtoMessage() {} +func (*MsgWithdrawStableMintControlRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4b7a3c3b9b1a607e, []int{22} +} +func (m *MsgWithdrawStableMintControlRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawStableMintControlRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawStableMintControlRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawStableMintControlRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawStableMintControlRequest.Merge(m, src) +} +func (m *MsgWithdrawStableMintControlRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawStableMintControlRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawStableMintControlRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawStableMintControlRequest proto.InternalMessageInfo + +type MsgWithdrawStableMintControlResponse struct { +} + +func (m *MsgWithdrawStableMintControlResponse) Reset() { *m = MsgWithdrawStableMintControlResponse{} } +func (m *MsgWithdrawStableMintControlResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawStableMintControlResponse) ProtoMessage() {} +func (*MsgWithdrawStableMintControlResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4b7a3c3b9b1a607e, []int{23} +} +func (m *MsgWithdrawStableMintControlResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawStableMintControlResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawStableMintControlResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawStableMintControlResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawStableMintControlResponse.Merge(m, src) +} +func (m *MsgWithdrawStableMintControlResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawStableMintControlResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawStableMintControlResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawStableMintControlResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateRequest)(nil), "comdex.vault.v1beta1.MsgCreateRequest") proto.RegisterType((*MsgCreateResponse)(nil), "comdex.vault.v1beta1.MsgCreateResponse") @@ -895,68 +969,73 @@ func init() { proto.RegisterType((*MsgWithdrawStableMintResponse)(nil), "comdex.vault.v1beta1.MsgWithdrawStableMintResponse") proto.RegisterType((*MsgVaultInterestCalcRequest)(nil), "comdex.vault.v1beta1.MsgVaultInterestCalcRequest") proto.RegisterType((*MsgVaultInterestCalcResponse)(nil), "comdex.vault.v1beta1.MsgVaultInterestCalcResponse") + proto.RegisterType((*MsgWithdrawStableMintControlRequest)(nil), "comdex.vault.v1beta1.MsgWithdrawStableMintControlRequest") + proto.RegisterType((*MsgWithdrawStableMintControlResponse)(nil), "comdex.vault.v1beta1.MsgWithdrawStableMintControlResponse") } 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, 0x2f, 0x1c, 0xa2, 0xb6, 0xae, 0x94, 0xa8, - 0x55, 0x25, 0x64, 0xf0, 0x84, 0x58, 0x05, 0x8f, 0x8b, 0xc7, 0x69, 0x52, 0xa9, 0x52, 0x1f, 0xa1, - 0x0f, 0xd0, 0x07, 0x68, 0xf7, 0x49, 0x72, 0xda, 0xcd, 0xee, 0x29, 0xda, 0x83, 0xb5, 0x21, 0x6f, - 0xc0, 0x61, 0x8f, 0xab, 0x15, 0xe3, 0x21, 0xd8, 0x60, 0x70, 0xd0, 0x92, 0x43, 0xb4, 0x9c, 0x80, - 0x6f, 0xbe, 0x7f, 0xfe, 0x7d, 0xe3, 0x6f, 0xbe, 0x01, 0xe4, 0xeb, 0xb8, 0x65, 0xa0, 0x73, 0xf5, - 0x4c, 0x77, 0x9b, 0x44, 0x3d, 0x2b, 0xd6, 0x10, 0xd1, 0x8b, 0x2a, 0x39, 0x57, 0xec, 0x36, 0x26, - 0x18, 0x66, 0xfd, 0x65, 0x85, 0x2e, 0x2b, 0x6c, 0x59, 0xc8, 0x36, 0x70, 0x03, 0x53, 0x05, 0xb5, - 0xf7, 0xcd, 0xd7, 0x95, 0xdf, 0xf0, 0x60, 0xed, 0xd0, 0x69, 0x94, 0xdb, 0x48, 0x27, 0x48, 0x43, - 0xbf, 0xbb, 0xc8, 0x21, 0xf0, 0x53, 0x90, 0x3c, 0x69, 0xe3, 0x56, 0x8e, 0xdb, 0xe6, 0x0a, 0xa9, - 0xd2, 0x6a, 0xd7, 0x93, 0x56, 0x2e, 0xf4, 0x56, 0xf3, 0x6b, 0xb9, 0x27, 0x95, 0x35, 0xba, 0x08, - 0x0b, 0x60, 0x49, 0xb7, 0xed, 0xaa, 0x69, 0xe4, 0xf8, 0x6d, 0xae, 0x90, 0x2c, 0x65, 0xba, 0x9e, - 0x94, 0xf6, 0xd5, 0x7c, 0xb9, 0xac, 0x2d, 0xea, 0xb6, 0x5d, 0x31, 0xe0, 0x11, 0xd8, 0x44, 0xe7, - 0x04, 0x59, 0x06, 0x32, 0xaa, 0xb6, 0x6e, 0xb6, 0xab, 0x34, 0xb1, 0x9e, 0xe5, 0x02, 0xb5, 0xfc, - 0xa4, 0xeb, 0x49, 0x79, 0xdf, 0x32, 0x5a, 0x4f, 0xd6, 0xd6, 0xfb, 0x0b, 0x3f, 0xe8, 0x66, 0xfb, - 0xa8, 0x27, 0xae, 0x18, 0xb0, 0x0a, 0x52, 0x7a, 0x0b, 0xbb, 0x16, 0xa9, 0x9a, 0x56, 0x2e, 0x49, - 0x73, 0x2d, 0x5d, 0x7a, 0x52, 0xe2, 0xa5, 0x27, 0xed, 0x34, 0x4c, 0x72, 0xea, 0xd6, 0x94, 0x3a, - 0x6e, 0xa9, 0x75, 0xec, 0xb4, 0xb0, 0xc3, 0x3e, 0x76, 0x1d, 0xe3, 0x37, 0x95, 0x5c, 0xd8, 0xc8, - 0x51, 0x2a, 0x16, 0xe9, 0x7a, 0xd2, 0x1a, 0x4b, 0xb9, 0xef, 0x48, 0xd6, 0x96, 0xfd, 0xef, 0x15, - 0x0b, 0xd6, 0x00, 0x60, 0x72, 0xec, 0x92, 0xdc, 0x22, 0x8d, 0x50, 0x9e, 0x3a, 0x42, 0x26, 0x14, - 0x01, 0xbb, 0x44, 0xd6, 0x58, 0xde, 0xdf, 0xbb, 0x44, 0x5e, 0x07, 0x99, 0x00, 0x7f, 0xc7, 0xc6, - 0x96, 0x83, 0xe4, 0xe7, 0x3c, 0x95, 0x7e, 0x87, 0x6c, 0xec, 0x98, 0xe4, 0x91, 0x95, 0xe5, 0x1b, - 0x90, 0x76, 0x1d, 0x14, 0x70, 0x97, 0xa4, 0xee, 0x72, 0x5d, 0x4f, 0xca, 0xfa, 0xee, 0x42, 0xcb, - 0xb2, 0xb6, 0xd2, 0xfb, 0xdd, 0xb7, 0x3e, 0x06, 0x4b, 0x3e, 0x1c, 0xc6, 0xfb, 0xdb, 0xa9, 0x79, - 0xa7, 0x83, 0xbc, 0x65, 0x8d, 0xb9, 0x93, 0xb3, 0x00, 0x06, 0x91, 0x32, 0xd2, 0x2f, 0x78, 0x2a, - 0x3e, 0x36, 0xc9, 0xa9, 0xd1, 0xd6, 0xff, 0x98, 0xa3, 0x9e, 0x05, 0xea, 0x0d, 0xb0, 0x1e, 0x62, - 0xca, 0x58, 0x3f, 0xe5, 0xc1, 0x87, 0xbd, 0x12, 0xcc, 0x39, 0xcf, 0x88, 0x73, 0x06, 0xac, 0xde, - 0xf1, 0x64, 0x8c, 0x9f, 0xf1, 0x54, 0xa6, 0x21, 0x5b, 0xbf, 0x98, 0x43, 0x9e, 0x05, 0x64, 0x48, - 0x0f, 0x48, 0x06, 0x94, 0x51, 0x7e, 0xcd, 0x51, 0xca, 0xe5, 0x26, 0x76, 0xd0, 0xfb, 0x44, 0x99, - 0xc1, 0x60, 0xcf, 0xcd, 0x60, 0x5c, 0xf3, 0x20, 0x37, 0xe8, 0xac, 0x07, 0x96, 0x31, 0x7f, 0xc1, - 0x67, 0xb5, 0xf7, 0xb6, 0xc0, 0x47, 0x11, 0x64, 0x19, 0xf7, 0x7f, 0x79, 0x20, 0xdc, 0x8d, 0x0e, - 0x3f, 0x11, 0xbd, 0xd6, 0x44, 0x87, 0xa6, 0xf5, 0xd8, 0xa6, 0x85, 0x01, 0xbb, 0xe4, 0xbb, 0xb1, - 0x3b, 0x18, 0x62, 0x97, 0x07, 0x5b, 0x91, 0x74, 0x18, 0xbd, 0x1b, 0x9e, 0xae, 0x33, 0xb6, 0x73, - 0x7c, 0x43, 0x5b, 0x0f, 0x96, 0xc0, 0xaa, 0x43, 0xa1, 0x0c, 0x32, 0x5d, 0xa4, 0x99, 0x0a, 0x5d, - 0x4f, 0xda, 0xf4, 0x6d, 0x86, 0x14, 0x64, 0x2d, 0xed, 0x4b, 0xfa, 0xdd, 0x42, 0x04, 0x1f, 0x47, - 0x23, 0x66, 0x35, 0xe8, 0xf0, 0x54, 0xa1, 0x3f, 0x28, 0xcc, 0x8b, 0xf0, 0x10, 0x45, 0x90, 0x40, - 0x7e, 0x0c, 0x63, 0x56, 0x85, 0x27, 0x1c, 0x7d, 0x13, 0x7c, 0x7d, 0x8b, 0xa0, 0x36, 0x72, 0x48, - 0x59, 0x6f, 0xd6, 0x1f, 0xa8, 0x08, 0x23, 0xad, 0x76, 0x61, 0x9a, 0x03, 0xc8, 0xdf, 0x52, 0x11, - 0xb9, 0xfa, 0x0f, 0xb3, 0xf7, 0x7f, 0x0a, 0x2c, 0x1c, 0x3a, 0x0d, 0xf8, 0x2b, 0x48, 0xdd, 0xbd, - 0xfd, 0x70, 0x47, 0x89, 0xba, 0x11, 0x2b, 0xc3, 0xf7, 0x5e, 0xe1, 0x8b, 0x58, 0x3d, 0x3f, 0x0a, - 0xac, 0x02, 0x30, 0xd8, 0xd8, 0x70, 0xbc, 0x59, 0xf8, 0x02, 0x27, 0x14, 0xe2, 0x15, 0x59, 0x80, - 0x1a, 0x58, 0x09, 0x14, 0x0d, 0x8e, 0x37, 0x1c, 0xba, 0xb8, 0x08, 0x5f, 0xde, 0x43, 0x93, 0xc5, - 0x38, 0x02, 0x1f, 0xb0, 0xe9, 0x11, 0x7e, 0x36, 0x3e, 0xb1, 0x80, 0xef, 0xcf, 0x63, 0xb4, 0x98, - 0xdf, 0x9f, 0xc1, 0x72, 0x7f, 0x60, 0x82, 0xe3, 0x4d, 0x82, 0x13, 0xaa, 0xb0, 0x13, 0xa7, 0x16, - 0x72, 0x4d, 0xc7, 0x8f, 0x09, 0xae, 0x83, 0x63, 0xd9, 0x04, 0xd7, 0xa1, 0x29, 0x06, 0x92, 0xe0, - 0x8d, 0x9b, 0x1d, 0xb5, 0x50, 0x89, 0x2b, 0x58, 0x78, 0xda, 0x11, 0xd4, 0x7b, 0xeb, 0xb3, 0xa8, - 0x7f, 0xd2, 0x9b, 0xd2, 0xf0, 0x21, 0x05, 0xbf, 0x8a, 0xd9, 0x88, 0x23, 0x9d, 0x52, 0x28, 0x4e, - 0x61, 0xc1, 0x62, 0xff, 0x05, 0xb2, 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, + // 935 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x98, 0x4f, 0x8f, 0xdb, 0x44, + 0x14, 0xc0, 0x63, 0x6f, 0x76, 0xe9, 0xbe, 0xd5, 0xb2, 0xdd, 0xd9, 0xb4, 0x0a, 0x2e, 0xb1, 0x8b, + 0x5b, 0x42, 0x38, 0xd4, 0x26, 0xdb, 0x13, 0x15, 0x12, 0x6a, 0xc2, 0x25, 0x87, 0x15, 0x60, 0xa4, + 0xad, 0x40, 0x48, 0x91, 0x13, 0xcf, 0xa6, 0x16, 0x89, 0xc7, 0xd8, 0xe3, 0xb2, 0x8b, 0x84, 0xc4, + 0x47, 0xe0, 0xc2, 0x8d, 0x0f, 0x80, 0xf8, 0x16, 0xdc, 0xf6, 0x04, 0x85, 0x53, 0xc5, 0xc1, 0xa2, + 0xd9, 0x6f, 0x90, 0x03, 0x47, 0x84, 0x32, 0x9e, 0x6c, 0xec, 0xc4, 0x8e, 0x1b, 0xc8, 0x1e, 0x2a, + 0x72, 0x4a, 0x3c, 0xf3, 0xfe, 0xcd, 0xef, 0x8d, 0xdf, 0xbc, 0x31, 0x54, 0xba, 0x64, 0x60, 0xe1, + 0x53, 0xfd, 0x89, 0x19, 0xf4, 0xa9, 0xfe, 0xa4, 0xde, 0xc1, 0xd4, 0xac, 0xeb, 0xf4, 0x54, 0x73, + 0x3d, 0x42, 0x09, 0x2a, 0x45, 0xd3, 0x1a, 0x9b, 0xd6, 0xf8, 0xb4, 0x54, 0xea, 0x91, 0x1e, 0x61, + 0x02, 0xfa, 0xf8, 0x5f, 0x24, 0xab, 0xfe, 0x2d, 0xc2, 0xf5, 0x23, 0xbf, 0xd7, 0xf4, 0xb0, 0x49, + 0xb1, 0x81, 0xbf, 0x0c, 0xb0, 0x4f, 0xd1, 0x1d, 0x28, 0x9e, 0x78, 0x64, 0x50, 0x16, 0x6e, 0x0b, + 0xb5, 0xed, 0xc6, 0xde, 0x28, 0x54, 0x76, 0xce, 0xcc, 0x41, 0xff, 0x81, 0x3a, 0x1e, 0x55, 0x0d, + 0x36, 0x89, 0x6a, 0xb0, 0x65, 0xba, 0x6e, 0xdb, 0xb6, 0xca, 0xe2, 0x6d, 0xa1, 0x56, 0x6c, 0xec, + 0x8f, 0x42, 0x65, 0x37, 0x12, 0x8b, 0xc6, 0x55, 0x63, 0xd3, 0x74, 0xdd, 0x96, 0x85, 0x8e, 0xe1, + 0x26, 0x3e, 0xa5, 0xd8, 0xb1, 0xb0, 0xd5, 0x76, 0x4d, 0xdb, 0x6b, 0xb3, 0xc0, 0xc6, 0x9a, 0x1b, + 0x4c, 0xf3, 0x8d, 0x51, 0xa8, 0x54, 0x22, 0xcd, 0x74, 0x39, 0xd5, 0x38, 0x98, 0x4c, 0x7c, 0x64, + 0xda, 0xde, 0xf1, 0x78, 0xb8, 0x65, 0xa1, 0x36, 0x6c, 0x9b, 0x03, 0x12, 0x38, 0xb4, 0x6d, 0x3b, + 0xe5, 0x22, 0x8b, 0xb5, 0x71, 0x1e, 0x2a, 0x85, 0x3f, 0x42, 0xa5, 0xda, 0xb3, 0xe9, 0xe3, 0xa0, + 0xa3, 0x75, 0xc9, 0x40, 0xef, 0x12, 0x7f, 0x40, 0x7c, 0xfe, 0x73, 0xcf, 0xb7, 0xbe, 0xd0, 0xe9, + 0x99, 0x8b, 0x7d, 0xad, 0xe5, 0xd0, 0x51, 0xa8, 0x5c, 0xe7, 0x21, 0x4f, 0x0c, 0xa9, 0xc6, 0xb5, + 0xe8, 0x7f, 0xcb, 0x41, 0x1d, 0x00, 0x3e, 0x4e, 0x02, 0x5a, 0xde, 0x64, 0x1e, 0x9a, 0x4b, 0x7b, + 0xd8, 0x4f, 0x78, 0x20, 0x01, 0x55, 0x0d, 0x1e, 0xf7, 0x87, 0x01, 0x55, 0x0f, 0x60, 0x3f, 0xc6, + 0xdf, 0x77, 0x89, 0xe3, 0x63, 0xf5, 0x37, 0x91, 0x8d, 0x7e, 0x80, 0x5d, 0xe2, 0xdb, 0xf4, 0x25, + 0x4b, 0xcb, 0x7b, 0xb0, 0x1b, 0xf8, 0x38, 0x66, 0xae, 0xc8, 0xcc, 0x95, 0x47, 0xa1, 0x52, 0x8a, + 0xcc, 0x25, 0xa6, 0x55, 0x63, 0x67, 0xfc, 0x3c, 0xd1, 0x7e, 0x04, 0x5b, 0x11, 0x1c, 0xce, 0xfb, + 0xfd, 0xa5, 0x79, 0xef, 0xc6, 0x79, 0xab, 0x06, 0x37, 0xa7, 0x96, 0x00, 0xc5, 0x91, 0x72, 0xd2, + 0xbf, 0x8b, 0x6c, 0xf8, 0x91, 0x4d, 0x1f, 0x5b, 0x9e, 0xf9, 0xd5, 0x1a, 0xf5, 0x2a, 0x50, 0xdf, + 0x80, 0x83, 0x04, 0x53, 0xce, 0xfa, 0x17, 0x11, 0x5e, 0x1d, 0xa7, 0x60, 0xcd, 0x79, 0x45, 0x9c, + 0xf7, 0x61, 0xef, 0x92, 0x27, 0x67, 0xfc, 0xab, 0xc8, 0xc6, 0x0c, 0xec, 0x9a, 0x67, 0x6b, 0xc8, + 0xab, 0x80, 0x8c, 0xd8, 0x01, 0xc9, 0x81, 0x72, 0xca, 0x7f, 0x09, 0x8c, 0x72, 0xb3, 0x4f, 0x7c, + 0xfc, 0x7f, 0xa2, 0xcc, 0x61, 0xf0, 0x75, 0x73, 0x18, 0xcf, 0x44, 0x28, 0x4f, 0x2b, 0xeb, 0x43, + 0xc7, 0x5a, 0xbf, 0xe0, 0xab, 0xda, 0x7b, 0xb7, 0xe0, 0xb5, 0x14, 0xb2, 0x9c, 0xfb, 0x0f, 0x22, + 0x48, 0x97, 0xad, 0xc3, 0x27, 0xd4, 0xec, 0xf4, 0xf1, 0x91, 0xed, 0xbc, 0x6c, 0xdd, 0xc2, 0x94, + 0x5d, 0xf1, 0xbf, 0xb1, 0x7b, 0x38, 0xc3, 0xae, 0x02, 0xb7, 0x52, 0xe9, 0x70, 0x7a, 0xcf, 0x45, + 0x36, 0xcf, 0xd9, 0xae, 0xf1, 0xcd, 0x6c, 0x3d, 0xd4, 0x80, 0x3d, 0x9f, 0x41, 0x99, 0x46, 0xba, + 0xc9, 0x22, 0x95, 0x46, 0xa1, 0x72, 0x33, 0xd2, 0x99, 0x11, 0x50, 0x8d, 0xdd, 0x68, 0x64, 0x52, + 0x2d, 0x64, 0x78, 0x3d, 0x1d, 0x31, 0xcf, 0xc1, 0x50, 0x64, 0x02, 0x93, 0x46, 0x61, 0x9d, 0x84, + 0xab, 0x48, 0x82, 0x02, 0x95, 0x0c, 0xc6, 0x3c, 0x0b, 0x3f, 0x09, 0xec, 0x4d, 0x88, 0xe4, 0x1d, + 0x8a, 0x3d, 0xec, 0xd3, 0xa6, 0xd9, 0xef, 0x5e, 0x51, 0x12, 0xe6, 0x4a, 0xed, 0xc6, 0x32, 0x07, + 0x50, 0xb4, 0xa5, 0x52, 0x62, 0xe5, 0x8b, 0xa1, 0x70, 0x27, 0x75, 0xb5, 0x4d, 0xe2, 0x50, 0x8f, + 0xf4, 0xaf, 0x66, 0x4d, 0x6a, 0x15, 0xee, 0x2e, 0xf6, 0x1a, 0x45, 0x77, 0xf8, 0x33, 0xc0, 0xc6, + 0x91, 0xdf, 0x43, 0x9f, 0xc3, 0xf6, 0x65, 0x6d, 0x42, 0x55, 0x2d, 0xed, 0xbe, 0xae, 0xcd, 0xde, + 0xca, 0xa5, 0xb7, 0x72, 0xe5, 0x22, 0x2f, 0xa8, 0x0d, 0x30, 0x7d, 0xed, 0x50, 0xb6, 0x5a, 0xf2, + 0x7a, 0x29, 0xd5, 0xf2, 0x05, 0xb9, 0x83, 0x0e, 0xec, 0xc4, 0x96, 0x8b, 0xb2, 0x15, 0x67, 0xae, + 0x55, 0xd2, 0xdb, 0x2f, 0x20, 0xc9, 0x7d, 0x1c, 0xc3, 0x2b, 0xbc, 0xb7, 0x45, 0x77, 0xb3, 0x03, + 0x8b, 0xd9, 0x7e, 0x33, 0x47, 0x8a, 0xdb, 0xfd, 0x14, 0xae, 0x4d, 0xda, 0x39, 0x94, 0xad, 0x12, + 0xef, 0x9f, 0xa5, 0x6a, 0x9e, 0x58, 0xc2, 0x34, 0x6b, 0x8e, 0x16, 0x98, 0x8e, 0x37, 0x8d, 0x0b, + 0x4c, 0x27, 0x7a, 0x2c, 0x44, 0xe3, 0xdf, 0x03, 0x78, 0x23, 0x80, 0xb4, 0xbc, 0x84, 0x25, 0x7b, + 0x31, 0x49, 0x7f, 0x61, 0x79, 0xee, 0xf5, 0x6b, 0x76, 0x8f, 0x9b, 0x3d, 0x42, 0xd1, 0x3b, 0x39, + 0x1b, 0x71, 0xae, 0x8e, 0x4b, 0xf5, 0x25, 0x34, 0xb8, 0xef, 0x6f, 0xa0, 0x94, 0x76, 0x76, 0xa0, + 0x7a, 0xde, 0x22, 0xe6, 0xbd, 0x1f, 0x2e, 0xa3, 0xc2, 0xdd, 0x7f, 0x2b, 0xc0, 0x8d, 0xd4, 0x57, + 0x1a, 0x1d, 0xe6, 0xee, 0xe1, 0xf9, 0x08, 0xee, 0x2f, 0xa5, 0x93, 0x20, 0x30, 0x57, 0xea, 0x16, + 0x10, 0xc8, 0x2a, 0xe1, 0x0b, 0x08, 0x64, 0x56, 0x52, 0xf4, 0xbd, 0x90, 0x71, 0x38, 0xf3, 0xa2, + 0x86, 0xde, 0x5d, 0x62, 0x51, 0xc9, 0xf2, 0x2b, 0x3d, 0xf8, 0x37, 0xaa, 0x51, 0x5c, 0x8d, 0x8f, + 0xcf, 0x9f, 0xcb, 0x85, 0x1f, 0x87, 0x72, 0xe1, 0x7c, 0x28, 0x0b, 0x4f, 0x87, 0xb2, 0xf0, 0xe7, + 0x50, 0x16, 0xbe, 0xbb, 0x90, 0x0b, 0x4f, 0x2f, 0xe4, 0xc2, 0xb3, 0x0b, 0xb9, 0xf0, 0x99, 0x9e, + 0x38, 0x76, 0xc7, 0x7e, 0xee, 0x91, 0x93, 0x13, 0xbb, 0x6b, 0x9b, 0x7d, 0xfe, 0xac, 0x4f, 0xbe, + 0x9d, 0xb2, 0x33, 0xb8, 0xb3, 0xc5, 0xbe, 0x85, 0xde, 0xff, 0x27, 0x00, 0x00, 0xff, 0xff, 0x2e, + 0xe3, 0x43, 0x19, 0x58, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -982,6 +1061,7 @@ type MsgClient interface { MsgDepositStableMint(ctx context.Context, in *MsgDepositStableMintRequest, opts ...grpc.CallOption) (*MsgDepositStableMintResponse, error) MsgWithdrawStableMint(ctx context.Context, in *MsgWithdrawStableMintRequest, opts ...grpc.CallOption) (*MsgWithdrawStableMintResponse, error) MsgVaultInterestCalc(ctx context.Context, in *MsgVaultInterestCalcRequest, opts ...grpc.CallOption) (*MsgVaultInterestCalcResponse, error) + MsgWithdrawStableMintControl(ctx context.Context, in *MsgWithdrawStableMintControlRequest, opts ...grpc.CallOption) (*MsgWithdrawStableMintControlResponse, error) } type msgClient struct { @@ -1091,6 +1171,15 @@ func (c *msgClient) MsgVaultInterestCalc(ctx context.Context, in *MsgVaultIntere return out, nil } +func (c *msgClient) MsgWithdrawStableMintControl(ctx context.Context, in *MsgWithdrawStableMintControlRequest, opts ...grpc.CallOption) (*MsgWithdrawStableMintControlResponse, error) { + out := new(MsgWithdrawStableMintControlResponse) + err := c.cc.Invoke(ctx, "/comdex.vault.v1beta1.Msg/MsgWithdrawStableMintControl", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { MsgCreate(context.Context, *MsgCreateRequest) (*MsgCreateResponse, error) @@ -1104,6 +1193,7 @@ type MsgServer interface { MsgDepositStableMint(context.Context, *MsgDepositStableMintRequest) (*MsgDepositStableMintResponse, error) MsgWithdrawStableMint(context.Context, *MsgWithdrawStableMintRequest) (*MsgWithdrawStableMintResponse, error) MsgVaultInterestCalc(context.Context, *MsgVaultInterestCalcRequest) (*MsgVaultInterestCalcResponse, error) + MsgWithdrawStableMintControl(context.Context, *MsgWithdrawStableMintControlRequest) (*MsgWithdrawStableMintControlResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1143,6 +1233,9 @@ func (*UnimplementedMsgServer) MsgWithdrawStableMint(ctx context.Context, req *M func (*UnimplementedMsgServer) MsgVaultInterestCalc(ctx context.Context, req *MsgVaultInterestCalcRequest) (*MsgVaultInterestCalcResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgVaultInterestCalc not implemented") } +func (*UnimplementedMsgServer) MsgWithdrawStableMintControl(ctx context.Context, req *MsgWithdrawStableMintControlRequest) (*MsgWithdrawStableMintControlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgWithdrawStableMintControl not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1346,6 +1439,24 @@ func _Msg_MsgVaultInterestCalc_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_MsgWithdrawStableMintControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawStableMintControlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgWithdrawStableMintControl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.vault.v1beta1.Msg/MsgWithdrawStableMintControl", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgWithdrawStableMintControl(ctx, req.(*MsgWithdrawStableMintControlRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.vault.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -1394,6 +1505,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgVaultInterestCalc", Handler: _Msg_MsgVaultInterestCalc_Handler, }, + { + MethodName: "MsgWithdrawStableMintControl", + Handler: _Msg_MsgWithdrawStableMintControl_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/vault/v1beta1/tx.proto", @@ -2232,6 +2347,64 @@ func (m *MsgVaultInterestCalcResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *MsgWithdrawStableMintControlRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawStableMintControlRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawStableMintControlRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintTx(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawStableMintControlResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawStableMintControlResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawStableMintControlResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -2595,6 +2768,31 @@ func (m *MsgVaultInterestCalcResponse) Size() (n int) { return n } +func (m *MsgWithdrawStableMintControlRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + return n +} + +func (m *MsgWithdrawStableMintControlResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4963,6 +5161,157 @@ func (m *MsgVaultInterestCalcResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgWithdrawStableMintControlRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawStableMintControlRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawStableMintControlRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawStableMintControlResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawStableMintControlResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawStableMintControlResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/vault/types/vault.go b/x/vault/types/vault.go index ca2bb3652..959227e5f 100644 --- a/x/vault/types/vault.go +++ b/x/vault/types/vault.go @@ -2,9 +2,8 @@ package types import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "github.com/pkg/errors" ) const ( @@ -28,7 +27,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")