diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39921ed28..bede870f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,13 +4,14 @@ on: push: tags: - "*" + release: + types: + - created branches: - - "main" - "releases/v3.x" - "chore/fix-ci" pull_request: branches: - - "main" - "releases/v3.x" - "chore/fix-ci" workflow_dispatch: @@ -22,7 +23,8 @@ on: jobs: docker: - runs-on: self-hosted + runs-on: + group: Neutron-Core env: DOCKER_BUILDKIT: 1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8fce320a6..0560f62e9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ permissions: jobs: golangci: name: lint - runs-on: self-hosted + runs-on: ubuntu-latest steps: - uses: actions/setup-go@v4 with: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 3bf73312b..4fa60b7e6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: tests: name: Test - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Set up Go 1.22 uses: actions/setup-go@v4 diff --git a/.github/workflows/test_trigger.yml b/.github/workflows/test_trigger.yml index 6b2102ae8..f58802c71 100644 --- a/.github/workflows/test_trigger.yml +++ b/.github/workflows/test_trigger.yml @@ -14,7 +14,7 @@ on: jobs: dispatch: name: Dispatch Tests Workflow - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Evaluate PR Merged Status and Labels run: | diff --git a/Dockerfile.builder b/Dockerfile.builder index a4bf34db0..ded10401f 100644 --- a/Dockerfile.builder +++ b/Dockerfile.builder @@ -7,13 +7,15 @@ ARG RUNNER_IMAGE="gcr.io/distroless/static" # Builder # -------------------------------------------------------- -FROM golang:${GO_VERSION}-alpine3.18 as builder +FROM golang:${GO_VERSION}-alpine3.20 as builder ARG GIT_VERSION ARG GIT_COMMIT ARG BUILD_TAGS ARG ENABLED_PROPOSALS +ENV GOTOOLCHAIN go1.22.6 + RUN apk add --no-cache \ ca-certificates \ build-base \ diff --git a/Makefile b/Makefile index 1e2805b22..9c8a00e2d 100644 --- a/Makefile +++ b/Makefile @@ -202,15 +202,14 @@ test-sim-multi-seed-short: runsim ############################################################################### lint: - golangci-lint run - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofmt -d -s + golangci-lint run --skip-files ".*.pb.go" + find . -name '*.go' -not -name "*.pb.go" -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofmt -d -s format: @go install mvdan.cc/gofumpt@latest @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name "*.pb.go" -not -name "*.pb.gw.go" -not -name "*.pulsar.go" -not -path "./crypto/keys/secp256k1/*" | xargs gofumpt -w -l - golangci-lint run --fix - goimports -w -local github.com/neutron-org . + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name "*.pb.go" -not -name "*.pb.gw.go" -not -name "*.pulsar.go" -not -path "./crypto/keys/secp256k1/*" | xargs -I % sh -c 'gofumpt -w -l % && goimports -w -local github.com/neutron-org %' + golangci-lint run --fix --skip-files ".*.pb.go" .PHONY: format diff --git a/app/ante_handler.go b/app/ante_handler.go index 5cbc05a07..07a356968 100644 --- a/app/ante_handler.go +++ b/app/ante_handler.go @@ -9,14 +9,15 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" consumerante "github.com/cosmos/interchain-security/v5/app/consumer/ante" ibcconsumerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/consumer/keeper" feemarketante "github.com/skip-mev/feemarket/x/feemarket/ante" - globalfeeante "github.com/neutron-org/neutron/v4/x/globalfee/ante" - globalfeekeeper "github.com/neutron-org/neutron/v4/x/globalfee/keeper" + globalfeeante "github.com/neutron-org/neutron/v5/x/globalfee/ante" + globalfeekeeper "github.com/neutron-org/neutron/v5/x/globalfee/keeper" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC @@ -24,6 +25,7 @@ import ( type HandlerOptions struct { ante.HandlerOptions + BankKeeper bankkeeper.Keeper AccountKeeper feemarketante.AccountKeeper IBCKeeper *ibckeeper.Keeper ConsumerKeeper ibcconsumerkeeper.Keeper @@ -70,6 +72,9 @@ func NewAnteHandler(options HandlerOptions, logger log.Logger) (sdk.AnteHandler, ante.NewValidateMemoDecorator(options.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), feemarketante.NewFeeMarketCheckDecorator( + options.AccountKeeper, + options.BankKeeper, + options.FeegrantKeeper, options.FeeMarketKeeper, NewFeeDecoratorWithSwitch(options), ), diff --git a/app/app.go b/app/app.go index 91f8204c5..8d5fab53e 100644 --- a/app/app.go +++ b/app/app.go @@ -10,18 +10,20 @@ import ( "path/filepath" "time" - "github.com/neutron-org/neutron/v4/x/dynamicfees" - dynamicfeestypes "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + dynamicfeestypes "github.com/neutron-org/neutron/v5/x/dynamicfees/types" "github.com/skip-mev/feemarket/x/feemarket" feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees" + ibcratelimit "github.com/neutron-org/neutron/v5/x/ibc-rate-limit" + "cosmossdk.io/client/v2/autocli" "cosmossdk.io/core/appmodule" authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" - appconfig "github.com/neutron-org/neutron/v4/app/config" + appconfig "github.com/neutron-org/neutron/v5/app/config" "github.com/skip-mev/slinky/abci/strategies/aggregator" "github.com/skip-mev/slinky/x/oracle" @@ -36,9 +38,9 @@ import ( oracleclient "github.com/skip-mev/slinky/service/clients/oracle" servicemetrics "github.com/skip-mev/slinky/service/metrics" - v401 "github.com/neutron-org/neutron/v4/app/upgrades/v4.0.1" - "github.com/neutron-org/neutron/v4/x/globalfee" - globalfeetypes "github.com/neutron-org/neutron/v4/x/globalfee/types" + v500 "github.com/neutron-org/neutron/v5/app/upgrades/v5.0.0" + "github.com/neutron-org/neutron/v5/x/globalfee" + globalfeetypes "github.com/neutron-org/neutron/v5/x/globalfee/types" "cosmossdk.io/log" db "github.com/cosmos/cosmos-db" @@ -56,11 +58,11 @@ import ( genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" tendermint "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" - "github.com/neutron-org/neutron/v4/docs" + "github.com/neutron-org/neutron/v5/docs" - "github.com/neutron-org/neutron/v4/app/upgrades" + "github.com/neutron-org/neutron/v5/app/upgrades" - "github.com/neutron-org/neutron/v4/x/cron" + "github.com/neutron-org/neutron/v5/x/cron" "cosmossdk.io/x/evidence" evidencekeeper "cosmossdk.io/x/evidence/keeper" @@ -131,6 +133,9 @@ import ( ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + ibcratelimitkeeper "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/keeper" + ibcratelimittypes "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" + //nolint:staticcheck ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" @@ -140,12 +145,12 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - cronkeeper "github.com/neutron-org/neutron/v4/x/cron/keeper" - crontypes "github.com/neutron-org/neutron/v4/x/cron/types" + cronkeeper "github.com/neutron-org/neutron/v5/x/cron/keeper" + crontypes "github.com/neutron-org/neutron/v5/x/cron/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory" - tokenfactorykeeper "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" - tokenfactorytypes "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory" + tokenfactorykeeper "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" + tokenfactorytypes "github.com/neutron-org/neutron/v5/x/tokenfactory/types" "github.com/cosmos/admin-module/v2/x/adminmodule" adminmodulecli "github.com/cosmos/admin-module/v2/x/adminmodule/client/cli" @@ -154,50 +159,47 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - appparams "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/wasmbinding" - "github.com/neutron-org/neutron/v4/x/contractmanager" - contractmanagermodulekeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - contractmanagermoduletypes "github.com/neutron-org/neutron/v4/x/contractmanager/types" - dynamicfeeskeeper "github.com/neutron-org/neutron/v4/x/dynamicfees/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner" - feeburnerkeeper "github.com/neutron-org/neutron/v4/x/feeburner/keeper" - feeburnertypes "github.com/neutron-org/neutron/v4/x/feeburner/types" - "github.com/neutron-org/neutron/v4/x/feerefunder" - feekeeper "github.com/neutron-org/neutron/v4/x/feerefunder/keeper" - ibchooks "github.com/neutron-org/neutron/v4/x/ibc-hooks" - ibchookstypes "github.com/neutron-org/neutron/v4/x/ibc-hooks/types" - "github.com/neutron-org/neutron/v4/x/interchainqueries" - interchainqueriesmodulekeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - interchainqueriesmoduletypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs" - interchaintxskeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" - interchaintxstypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" - transferSudo "github.com/neutron-org/neutron/v4/x/transfer" - wrapkeeper "github.com/neutron-org/neutron/v4/x/transfer/keeper" - - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" + appparams "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/wasmbinding" + "github.com/neutron-org/neutron/v5/x/contractmanager" + contractmanagermodulekeeper "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + contractmanagermoduletypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" + dynamicfeeskeeper "github.com/neutron-org/neutron/v5/x/dynamicfees/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner" + feeburnerkeeper "github.com/neutron-org/neutron/v5/x/feeburner/keeper" + feeburnertypes "github.com/neutron-org/neutron/v5/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feerefunder" + feekeeper "github.com/neutron-org/neutron/v5/x/feerefunder/keeper" + ibchooks "github.com/neutron-org/neutron/v5/x/ibc-hooks" + ibchookstypes "github.com/neutron-org/neutron/v5/x/ibc-hooks/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries" + interchainqueriesmodulekeeper "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + interchainqueriesmoduletypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs" + interchaintxskeeper "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" + interchaintxstypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" + transferSudo "github.com/neutron-org/neutron/v5/x/transfer" + wrapkeeper "github.com/neutron-org/neutron/v5/x/transfer/keeper" + + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" ccvconsumer "github.com/cosmos/interchain-security/v5/x/ccv/consumer" ccvconsumerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/consumer/keeper" ccvconsumertypes "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types" storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" pfmkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper" pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" - "github.com/neutron-org/neutron/v4/x/dex" - dexkeeper "github.com/neutron-org/neutron/v4/x/dex/keeper" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" - - "github.com/neutron-org/neutron/v4/x/ibcswap" - ibcswapkeeper "github.com/neutron-org/neutron/v4/x/ibcswap/keeper" - ibcswaptypes "github.com/neutron-org/neutron/v4/x/ibcswap/types" + "github.com/neutron-org/neutron/v5/x/dex" + dexkeeper "github.com/neutron-org/neutron/v5/x/dex/keeper" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" - globalfeekeeper "github.com/neutron-org/neutron/v4/x/globalfee/keeper" - gmpmiddleware "github.com/neutron-org/neutron/v4/x/gmp" + globalfeekeeper "github.com/neutron-org/neutron/v5/x/globalfee/keeper" + gmpmiddleware "github.com/neutron-org/neutron/v5/x/gmp" // Block-sdk imports blocksdkabci "github.com/skip-mev/block-sdk/v2/abci" @@ -216,7 +218,6 @@ import ( oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper" oracletypes "github.com/skip-mev/slinky/x/oracle/types" - "github.com/cosmos/cosmos-sdk/crypto/keyring" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" ) @@ -225,7 +226,9 @@ const ( ) var ( - Upgrades = []upgrades.Upgrade{v401.Upgrade} + Upgrades = []upgrades.Upgrade{ + v500.Upgrade, + } // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string @@ -272,14 +275,15 @@ var ( ), ibchooks.AppModuleBasic{}, packetforward.AppModuleBasic{}, + ibcratelimit.AppModuleBasic{}, auction.AppModuleBasic{}, globalfee.AppModule{}, feemarket.AppModuleBasic{}, dex.AppModuleBasic{}, - ibcswap.AppModuleBasic{}, oracle.AppModuleBasic{}, marketmap.AppModuleBasic{}, dynamicfees.AppModuleBasic{}, + consensus.AppModuleBasic{}, ) // module account permissions @@ -297,7 +301,6 @@ var ( tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, crontypes.ModuleName: nil, dextypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - ibcswaptypes.ModuleName: {authtypes.Burner}, oracletypes.ModuleName: nil, marketmaptypes.ModuleName: nil, feemarkettypes.FeeCollectorName: nil, @@ -369,13 +372,14 @@ type App struct { CronKeeper cronkeeper.Keeper PFMKeeper *pfmkeeper.Keeper DexKeeper dexkeeper.Keeper - SwapKeeper ibcswapkeeper.Keeper GlobalFeeKeeper globalfeekeeper.Keeper PFMModule packetforward.AppModule - HooksTransferIBCModule *ibchooks.IBCMiddleware - HooksICS4Wrapper ibchooks.ICS4Middleware + TransferStack *ibchooks.IBCMiddleware + Ics20WasmHooks *ibchooks.WasmHooks + RateLimitingICS4Wrapper *ibcratelimit.ICS4Wrapper + HooksICS4Wrapper ibchooks.ICS4Middleware // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -390,7 +394,8 @@ type App struct { ConsensusParamsKeeper consensusparamkeeper.Keeper - WasmKeeper wasmkeeper.Keeper + WasmKeeper wasmkeeper.Keeper + ContractKeeper *wasmkeeper.PermissionedKeeper // slinky MarketMapKeeper *marketmapkeeper.Keeper @@ -411,9 +416,9 @@ type App struct { checkTxHandler checktx.CheckTx } -// AutoCLIOpts returns options based upon the modules in the neutron v4 app. +// AutoCLIOpts returns options based upon the modules in the neutron v5 app. func (app *App) AutoCLIOpts(initClientCtx client.Context) autocli.AppOptions { - modules := make(map[string]appmodule.AppModule, 0) + modules := make(map[string]appmodule.AppModule) for _, m := range app.mm.Modules { if moduleWithName, ok := m.(module.HasName); ok { moduleName := moduleWithName.Name() @@ -423,18 +428,12 @@ func (app *App) AutoCLIOpts(initClientCtx client.Context) autocli.AppOptions { } } - cliKR, err := keyring.NewAutoCLIKeyring(initClientCtx.Keyring) - if err != nil { - panic(err) - } - return autocli.AppOptions{ Modules: modules, ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.mm.Modules), AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), - Keyring: cliKR, ClientCtx: initClientCtx, } } @@ -487,7 +486,7 @@ func New( icahosttypes.StoreKey, capabilitytypes.StoreKey, interchainqueriesmoduletypes.StoreKey, contractmanagermoduletypes.StoreKey, interchaintxstypes.StoreKey, wasmtypes.StoreKey, feetypes.StoreKey, feeburnertypes.StoreKey, adminmoduletypes.StoreKey, ccvconsumertypes.StoreKey, tokenfactorytypes.StoreKey, pfmtypes.StoreKey, - crontypes.StoreKey, ibchookstypes.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, dextypes.StoreKey, auctiontypes.StoreKey, + crontypes.StoreKey, ibcratelimittypes.ModuleName, ibchookstypes.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, dextypes.StoreKey, auctiontypes.StoreKey, oracletypes.StoreKey, marketmaptypes.StoreKey, feemarkettypes.StoreKey, dynamicfeestypes.StoreKey, globalfeetypes.StoreKey, ) tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey, dextypes.TStoreKey) @@ -519,6 +518,7 @@ func New( scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + app.ScopedTransferKeeper = scopedTransferKeeper scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName) scopedInterTxKeeper := app.CapabilityKeeper.ScopeToModule(interchaintxstypes.ModuleName) scopedCCVConsumerKeeper := app.CapabilityKeeper.ScopeToModule(ccvconsumertypes.ModuleName) @@ -600,30 +600,7 @@ func New( appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), &app.ConsumerKeeper, app.UpgradeKeeper, scopedIBCKeeper, authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), ) - app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( - appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), - app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 feerefunder - app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, - scopedICAControllerKeeper, app.MsgServiceRouter(), - authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), - ) - - app.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), - app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 feerefunder - app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, - app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), - authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), - ) - - app.ContractManagerKeeper = *contractmanagermodulekeeper.NewKeeper( - appCodec, - keys[contractmanagermoduletypes.StoreKey], - keys[contractmanagermoduletypes.MemStoreKey], - &app.WasmKeeper, - authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), - ) - + // Feekeeper needs to be initialized before middlewares injection app.FeeKeeper = feekeeper.NewKeeper( appCodec, keys[feetypes.StoreKey], @@ -634,55 +611,45 @@ func New( ) feeModule := feerefunder.NewAppModule(appCodec, *app.FeeKeeper, app.AccountKeeper, app.BankKeeper) - app.FeeBurnerKeeper = feeburnerkeeper.NewKeeper( + app.ContractManagerKeeper = *contractmanagermodulekeeper.NewKeeper( appCodec, - keys[feeburnertypes.StoreKey], - keys[feeburnertypes.MemStoreKey], - app.AccountKeeper, - &app.BankKeeper, + keys[contractmanagermoduletypes.StoreKey], + keys[contractmanagermoduletypes.MemStoreKey], + &app.WasmKeeper, authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), ) - feeBurnerModule := feeburner.NewAppModule(appCodec, *app.FeeBurnerKeeper) - app.GlobalFeeKeeper = globalfeekeeper.NewKeeper(appCodec, keys[globalfeetypes.StoreKey], authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String()) + app.WireICS20PreWasmKeeper(appCodec) + app.PFMModule = packetforward.NewAppModule(app.PFMKeeper, app.GetSubspace(pfmtypes.ModuleName)) - // PFMKeeper must be created before TransferKeeper - app.PFMKeeper = pfmkeeper.NewKeeper( - appCodec, - app.keys[pfmtypes.StoreKey], - app.TransferKeeper.Keeper, - app.IBCKeeper.ChannelKeeper, - app.FeeBurnerKeeper, - &app.BankKeeper, + app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( + appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, + scopedICAControllerKeeper, app.MsgServiceRouter(), authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), ) - wasmHooks := ibchooks.NewWasmHooks(nil, sdk.GetConfig().GetBech32AccountAddrPrefix()) // The contract keeper needs to be set later - app.HooksICS4Wrapper = ibchooks.NewICS4Middleware( + + app.ICAHostKeeper = icahostkeeper.NewKeeper( + appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), app.IBCKeeper.ChannelKeeper, - app.PFMKeeper, - &wasmHooks, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, + app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), + authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), ) + app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter()) - // Create Transfer Keepers - app.TransferKeeper = wrapkeeper.NewKeeper( + app.FeeBurnerKeeper = feeburnerkeeper.NewKeeper( appCodec, - keys[ibctransfertypes.StoreKey], - app.GetSubspace(ibctransfertypes.ModuleName), - app.HooksICS4Wrapper, // essentially still app.IBCKeeper.ChannelKeeper under the hood because no hook overrides - app.IBCKeeper.ChannelKeeper, - app.IBCKeeper.PortKeeper, + keys[feeburnertypes.StoreKey], + keys[feeburnertypes.MemStoreKey], app.AccountKeeper, &app.BankKeeper, - scopedTransferKeeper, - app.FeeKeeper, - contractmanager.NewSudoLimitWrapper(app.ContractManagerKeeper, &app.WasmKeeper), authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), ) + feeBurnerModule := feeburner.NewAppModule(appCodec, *app.FeeBurnerKeeper) - app.PFMKeeper.SetTransferKeeper(app.TransferKeeper.Keeper) - - transferModule := transferSudo.NewAppModule(app.TransferKeeper) + app.GlobalFeeKeeper = globalfeekeeper.NewKeeper(appCodec, keys[globalfeetypes.StoreKey], authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String()) // Create evidence Keeper for to register the IBC light client misbehaviour evidence route evidenceKeeper := evidencekeeper.NewKeeper( @@ -752,15 +719,6 @@ func New( dexModule := dex.NewAppModule(appCodec, app.DexKeeper, app.BankKeeper) - app.SwapKeeper = ibcswapkeeper.NewKeeper( - appCodec, - app.MsgServiceRouter(), - app.IBCKeeper.ChannelKeeper, - app.BankKeeper, - ) - - swapModule := ibcswap.NewAppModule(app.SwapKeeper) - wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOpts) if err != nil { @@ -772,7 +730,7 @@ func New( // NOTE: we need staking feature here even if there is no staking module anymore because cosmwasm-std in the CosmWasm SDK requires this feature // NOTE: cosmwasm_1_2 feature enables GovMsg::VoteWeighted, which doesn't work with Neutron, because it uses its own custom governance, // however, cosmwasm_1_2 also enables WasmMsg::Instantiate2, which works as one could expect - supportedFeatures := []string{"iterator", "stargate", "staking", "neutron", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0"} + supportedFeatures := []string{"iterator", "stargate", "staking", "neutron", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0", "cosmwasm_2_1"} // register the proposal types adminRouterLegacy := govv1beta1.NewRouter() @@ -844,8 +802,10 @@ func New( app.TransferKeeper, &app.AdminmoduleKeeper, app.FeeBurnerKeeper, - app.FeeKeeper, &app.BankKeeper, - app.TokenFactoryKeeper, &app.CronKeeper, + app.FeeKeeper, + &app.BankKeeper, + app.TokenFactoryKeeper, + &app.CronKeeper, &app.ContractManagerKeeper, &app.DexKeeper, app.OracleKeeper, @@ -866,7 +826,7 @@ func New( &app.BankKeeper, nil, nil, - app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 feerefunder + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, scopedWasmKeeper, @@ -879,19 +839,10 @@ func New( authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), wasmOpts..., ) - wasmHooks.ContractKeeper = &app.WasmKeeper app.CronKeeper.WasmMsgServer = wasmkeeper.NewMsgServerImpl(&app.WasmKeeper) cronModule := cron.NewAppModule(appCodec, app.CronKeeper) - transferIBCModule := transferSudo.NewIBCModule( - app.TransferKeeper, - contractmanager.NewSudoLimitWrapper(app.ContractManagerKeeper, &app.WasmKeeper), - ) - // receive call order: wasmHooks#OnRecvPacketOverride(transferIbcModule#OnRecvPacket()) - ibcHooksMiddleware := ibchooks.NewIBCMiddleware(&transferIBCModule, &app.HooksICS4Wrapper) - app.HooksTransferIBCModule = &ibcHooksMiddleware - // Create static IBC router, add transfer route, then set and seal it ibcRouter := ibcporttypes.NewRouter() @@ -904,27 +855,27 @@ func New( icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) - interchainQueriesModule := interchainqueries.NewAppModule(appCodec, app.InterchainQueriesKeeper, app.AccountKeeper, app.BankKeeper) + interchainQueriesModule := interchainqueries.NewAppModule( + appCodec, + keys[interchainqueriesmoduletypes.StoreKey], + app.InterchainQueriesKeeper, + app.AccountKeeper, + app.BankKeeper, + ) interchainTxsModule := interchaintxs.NewAppModule(appCodec, app.InterchainTxsKeeper, app.AccountKeeper, app.BankKeeper) contractManagerModule := contractmanager.NewAppModule(appCodec, app.ContractManagerKeeper) + ibcRateLimitmodule := ibcratelimit.NewAppModule(appCodec, app.RateLimitingICS4Wrapper.IbcratelimitKeeper, app.RateLimitingICS4Wrapper) ibcHooksModule := ibchooks.NewAppModule(app.AccountKeeper) - app.PFMModule = packetforward.NewAppModule(app.PFMKeeper, app.GetSubspace(pfmtypes.ModuleName)) - - var ibcStack ibcporttypes.IBCModule = packetforward.NewIBCMiddleware( - app.HooksTransferIBCModule, - app.PFMKeeper, - 0, - pfmkeeper.DefaultForwardTransferPacketTimeoutTimestamp, - pfmkeeper.DefaultRefundTransferPacketTimeoutTimestamp, - ) + transferModule := transferSudo.NewAppModule(app.TransferKeeper) + app.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper) - ibcStack = ibcswap.NewIBCMiddleware(ibcStack, app.SwapKeeper) - ibcStack = gmpmiddleware.NewIBCMiddleware(ibcStack) + app.RateLimitingICS4Wrapper.ContractKeeper = app.ContractKeeper + app.Ics20WasmHooks.ContractKeeper = &app.WasmKeeper ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerStack). AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). - AddRoute(ibctransfertypes.ModuleName, ibcStack). + AddRoute(ibctransfertypes.ModuleName, app.TransferStack). AddRoute(interchaintxstypes.ModuleName, icaControllerStack). AddRoute(wasmtypes.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper)). AddRoute(ccvconsumertypes.ModuleName, consumerModule) @@ -964,17 +915,18 @@ func New( feeBurnerModule, contractManagerModule, adminModule, + ibcRateLimitmodule, ibcHooksModule, tokenfactory.NewAppModule(appCodec, *app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper), cronModule, globalfee.NewAppModule(app.GlobalFeeKeeper, app.GetSubspace(globalfee.ModuleName), app.AppCodec(), app.keys[globalfee.ModuleName]), feemarket.NewAppModule(appCodec, *app.FeeMarkerKeeper), dynamicfees.NewAppModule(appCodec, *app.DynamicFeesKeeper), - swapModule, dexModule, marketmapModule, oracleModule, auction.NewAppModule(appCodec, app.AuctionKeeper), + consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), // always be last to make sure that it checks for all invariants and not only part of them crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), ) @@ -1012,6 +964,7 @@ func New( feetypes.ModuleName, feeburnertypes.ModuleName, adminmoduletypes.ModuleName, + ibcratelimittypes.ModuleName, ibchookstypes.ModuleName, pfmtypes.ModuleName, crontypes.ModuleName, @@ -1019,8 +972,8 @@ func New( oracletypes.ModuleName, globalfee.ModuleName, feemarkettypes.ModuleName, - ibcswaptypes.ModuleName, dextypes.ModuleName, + consensusparamtypes.ModuleName, ) app.mm.SetOrderEndBlockers( @@ -1048,6 +1001,7 @@ func New( feetypes.ModuleName, feeburnertypes.ModuleName, adminmoduletypes.ModuleName, + ibcratelimittypes.ModuleName, ibchookstypes.ModuleName, pfmtypes.ModuleName, crontypes.ModuleName, @@ -1055,8 +1009,8 @@ func New( oracletypes.ModuleName, globalfee.ModuleName, feemarkettypes.ModuleName, - ibcswaptypes.ModuleName, dextypes.ModuleName, + consensusparamtypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -1089,6 +1043,7 @@ func New( feetypes.ModuleName, feeburnertypes.ModuleName, adminmoduletypes.ModuleName, + ibcratelimittypes.ModuleName, ibchookstypes.ModuleName, // after auth keeper pfmtypes.ModuleName, crontypes.ModuleName, @@ -1096,9 +1051,9 @@ func New( feemarkettypes.ModuleName, oracletypes.ModuleName, marketmaptypes.ModuleName, - ibcswaptypes.ModuleName, dextypes.ModuleName, dynamicfeestypes.ModuleName, + consensusparamtypes.ModuleName, ) app.mm.RegisterInvariants(&app.CrisisKeeper) @@ -1123,6 +1078,7 @@ func New( ibc.NewAppModule(app.IBCKeeper), params.NewAppModule(app.ParamsKeeper), transferModule, + ibcRateLimitmodule, consumerModule, icaModule, app.PFMModule, @@ -1141,7 +1097,6 @@ func New( // initialize BaseApp app.SetInitChainer(app.InitChainer) - app.SetPreBlocker(app.PreBlocker) app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) @@ -1159,11 +1114,11 @@ func New( anteHandler, err := NewAnteHandler( HandlerOptions{ HandlerOptions: ante.HandlerOptions{ - BankKeeper: app.BankKeeper, FeegrantKeeper: app.FeeGrantKeeper, SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, + BankKeeper: app.BankKeeper, AccountKeeper: app.AccountKeeper, IBCKeeper: app.IBCKeeper, GlobalFeeKeeper: app.GlobalFeeKeeper, @@ -1182,7 +1137,6 @@ func New( postHandlerOptions := PostHandlerOptions{ AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper, - FeeGrantKeeper: app.FeeGrantKeeper, FeeMarketKeeper: app.FeeMarkerKeeper, } postHandler, err := NewPostHandler(postHandlerOptions) @@ -1198,7 +1152,7 @@ func New( baseLane.WithOptions(opts...) // set the block-sdk prepare / process-proposal handlers - blockSdkProposalHandler := blocksdkabci.NewProposalHandler( + blockSdkProposalHandler := blocksdkabci.NewDefaultProposalHandler( app.Logger(), app.GetTxConfig().TxDecoder(), app.GetTxConfig().TxEncoder(), @@ -1265,6 +1219,7 @@ func New( mempool, app.GetTxConfig().TxDecoder(), app.BaseApp.CheckTx, + app.BaseApp, ) app.SetCheckTx(parityCheckTx.CheckTx()) @@ -1295,6 +1250,8 @@ func New( ), ) + app.SetPreBlocker(app.oraclePreBlockHandler.WrappedPreBlocker(app.mm)) + // Create the vote extensions handler that will be used to extend and verify // vote extensions (i.e. oracle data). veCodec := compression.NewCompressionVoteExtensionCodec( @@ -1410,6 +1367,8 @@ func (app *App) setupUpgradeHandlers() { MarketmapKeeper: app.MarketMapKeeper, FeeMarketKeeper: app.FeeMarkerKeeper, DynamicfeesKeeper: app.DynamicFeesKeeper, + DexKeeper: &app.DexKeeper, + IbcRateLimitKeeper: app.RateLimitingICS4Wrapper.IbcratelimitKeeper, GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName), CcvConsumerSubspace: app.GetSubspace(ccvconsumertypes.ModuleName), }, @@ -1459,17 +1418,6 @@ func (app *App) Name() string { return app.BaseApp.Name() } // GetBaseApp returns the base app of the application func (app *App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } -// PreBlocker application updates every pre block -func (app *App) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { - rsp, err := app.mm.PreBlock(ctx) - if err != nil { - return nil, err - } - - _, err = app.oraclePreBlockHandler.PreBlocker()(ctx, req) - return rsp, err -} - // BeginBlocker application updates every begin block func (app *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { return app.mm.BeginBlock(ctx) @@ -1698,3 +1646,90 @@ func overrideWasmVariables() { wasmtypes.MaxWasmSize = 1_677_722 // ~1.6 mb (1024 * 1024 * 1.6) wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize } + +// WireICS20PreWasmKeeper Create the IBC Transfer Stack from bottom to top: +// * SendPacket. Originates from the transferKeeper and goes up the stack: +// transferKeeper.SendPacket -> ibc_rate_limit.SendPacket -> ibc_hooks.SendPacket -> channel.SendPacket +// * RecvPacket, message that originates from core IBC and goes down to app, the flow is the other way +// channel.RecvPacket -> ibc_hooks.OnRecvPacket -> ibc_rate_limit.OnRecvPacket -> gmp.OnRecvPacket -> pfm.OnRecvPacket -> transfer.OnRecvPacket +// +// Note that the forward middleware is only integrated on the "receive" direction. It can be safely skipped when sending. +// Note also that the forward middleware is called "router", but we are using the name "pfm" (packet forward middleware) for clarity +// This may later be renamed upstream: https://github.com/ibc-apps/middleware/packet-forward-middleware/issues/10 +// +// After this, the wasm keeper is required to be set on both +// app.Ics20WasmHooks AND app.RateLimitingICS4Wrapper +func (app *App) WireICS20PreWasmKeeper( + appCodec codec.Codec, +) { + // PFMKeeper must be created before TransferKeeper + app.PFMKeeper = pfmkeeper.NewKeeper( + appCodec, + app.keys[pfmtypes.StoreKey], + app.TransferKeeper.Keeper, // set later + app.IBCKeeper.ChannelKeeper, + app.FeeBurnerKeeper, + &app.BankKeeper, + app.IBCKeeper.ChannelKeeper, + authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), + ) + + wasmHooks := ibchooks.NewWasmHooks(nil, sdk.GetConfig().GetBech32AccountAddrPrefix()) // The contract keeper needs to be set later + app.Ics20WasmHooks = &wasmHooks + app.HooksICS4Wrapper = ibchooks.NewICS4Middleware( + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.ChannelKeeper, + &wasmHooks, + ) + + ibcratelimitKeeper := ibcratelimitkeeper.NewKeeper(appCodec, app.keys[ibcratelimittypes.ModuleName], authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String()) + // ChannelKeeper wrapper for rate limiting SendPacket(). The wasmKeeper needs to be added after it's created + rateLimitingICS4Wrapper := ibcratelimit.NewICS4Middleware( + app.HooksICS4Wrapper, + &app.AccountKeeper, + // wasm keeper we set later, right after wasmkeeper init. line 868 + nil, + &app.BankKeeper, + &ibcratelimitKeeper, + ) + app.RateLimitingICS4Wrapper = &rateLimitingICS4Wrapper + + // Create Transfer Keepers + app.TransferKeeper = wrapkeeper.NewKeeper( + appCodec, + app.keys[ibctransfertypes.StoreKey], + app.GetSubspace(ibctransfertypes.ModuleName), + app.RateLimitingICS4Wrapper, + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + app.AccountKeeper, + &app.BankKeeper, + app.ScopedTransferKeeper, + app.FeeKeeper, + contractmanager.NewSudoLimitWrapper(app.ContractManagerKeeper, &app.WasmKeeper), + authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), + ) + + app.PFMKeeper.SetTransferKeeper(app.TransferKeeper.Keeper) + + // Packet Forward Middleware + // Initialize packet forward middleware router + var ibcStack ibcporttypes.IBCModule = packetforward.NewIBCMiddleware( + transferSudo.NewIBCModule( + app.TransferKeeper, + contractmanager.NewSudoLimitWrapper(app.ContractManagerKeeper, &app.WasmKeeper), + ), + app.PFMKeeper, + 0, + pfmkeeper.DefaultForwardTransferPacketTimeoutTimestamp, + pfmkeeper.DefaultRefundTransferPacketTimeoutTimestamp, + ) + + ibcStack = gmpmiddleware.NewIBCMiddleware(ibcStack) + // RateLimiting IBC Middleware + rateLimitingTransferModule := ibcratelimit.NewIBCModule(ibcStack, app.RateLimitingICS4Wrapper) + + // Hooks Middleware + hooksTransferModule := ibchooks.NewIBCMiddleware(&rateLimitingTransferModule, &app.HooksICS4Wrapper) + app.TransferStack = &hooksTransferModule +} diff --git a/app/encoding.go b/app/encoding.go index 7ff2d3085..d102f4380 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -3,7 +3,7 @@ package app import ( "github.com/cosmos/cosmos-sdk/std" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" ) // MakeEncodingConfig creates an EncodingConfig for testing diff --git a/app/lane.go b/app/lane.go index dc19fc27f..d29dfe72f 100644 --- a/app/lane.go +++ b/app/lane.go @@ -30,7 +30,6 @@ func (app *App) CreateLanes() *blocksdkbase.BaseLane { baseLane := base_lane.NewDefaultLane(basecfg, blocksdkbase.DefaultMatchHandler()) baseLane.LaneMempool = blocksdkbase.NewMempool( blocksdkbase.NewDefaultTxPriority(), - basecfg.TxEncoder, basecfg.SignerExtractor, basecfg.MaxTxs, ) diff --git a/app/post_handler.go b/app/post_handler.go index a273c8338..1ec96bc58 100644 --- a/app/post_handler.go +++ b/app/post_handler.go @@ -13,7 +13,6 @@ type PostHandlerOptions struct { AccountKeeper feemarketpost.AccountKeeper BankKeeper feemarketpost.BankKeeper FeeMarketKeeper feemarketpost.FeeMarketKeeper - FeeGrantKeeper feemarketpost.FeeGrantKeeper } // NewPostHandler returns a PostHandler chain with the fee deduct decorator. @@ -34,7 +33,6 @@ func NewPostHandler(options PostHandlerOptions) (sdk.PostHandler, error) { feemarketpost.NewFeeMarketDeductDecorator( options.AccountKeeper, options.BankKeeper, - options.FeeGrantKeeper, options.FeeMarketKeeper, ), } diff --git a/app/proposals_allowlisting.go b/app/proposals_allowlisting.go index 7e6875579..d51f2a7fb 100644 --- a/app/proposals_allowlisting.go +++ b/app/proposals_allowlisting.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -18,17 +19,19 @@ import ( feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" - dynamicfeestypes "github.com/neutron-org/neutron/v4/x/dynamicfees/types" - globalfeetypes "github.com/neutron-org/neutron/v4/x/globalfee/types" + ibcratelimittypes "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" - contractmanagertypes "github.com/neutron-org/neutron/v4/x/contractmanager/types" - crontypes "github.com/neutron-org/neutron/v4/x/cron/types" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" - feeburnertypes "github.com/neutron-org/neutron/v4/x/feeburner/types" - feerefundertypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - interchainqueriestypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - interchaintxstypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" - tokenfactorytypes "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + dynamicfeestypes "github.com/neutron-org/neutron/v5/x/dynamicfees/types" + globalfeetypes "github.com/neutron-org/neutron/v5/x/globalfee/types" + + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" + crontypes "github.com/neutron-org/neutron/v5/x/cron/types" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" + feeburnertypes "github.com/neutron-org/neutron/v5/x/feeburner/types" + feerefundertypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + interchainqueriestypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" + interchaintxstypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" + tokenfactorytypes "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func IsConsumerProposalAllowlisted(content govtypes.Content) bool { @@ -63,6 +66,7 @@ func isSdkMessageWhitelisted(msg sdk.Msg) bool { *wasmtypes.MsgUpdateParams, *wasmtypes.MsgPinCodes, *wasmtypes.MsgUnpinCodes, + *consensustypes.MsgUpdateParams, *upgradetypes.MsgSoftwareUpgrade, *upgradetypes.MsgCancelUpgrade, *ibcclienttypes.MsgRecoverClient, @@ -73,6 +77,8 @@ func isSdkMessageWhitelisted(msg sdk.Msg) bool { *feeburnertypes.MsgUpdateParams, *feerefundertypes.MsgUpdateParams, *crontypes.MsgUpdateParams, + *crontypes.MsgAddSchedule, + *crontypes.MsgRemoveSchedule, *contractmanagertypes.MsgUpdateParams, *dextypes.MsgUpdateParams, *banktypes.MsgUpdateParams, @@ -89,7 +95,8 @@ func isSdkMessageWhitelisted(msg sdk.Msg) bool { *feemarkettypes.MsgParams, *dynamicfeestypes.MsgUpdateParams, *ibctransfertypes.MsgUpdateParams, - *globalfeetypes.MsgUpdateParams: + *globalfeetypes.MsgUpdateParams, + *ibcratelimittypes.MsgUpdateParams: return true } return false diff --git a/app/proposals_allowlisting_test.go b/app/proposals_allowlisting_test.go index e7fc0ad5f..806d7badd 100644 --- a/app/proposals_allowlisting_test.go +++ b/app/proposals_allowlisting_test.go @@ -3,15 +3,15 @@ package app_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" cmttypes "github.com/cometbft/cometbft/types" ibctesting "github.com/cosmos/ibc-go/v8/testing" icssimapp "github.com/cosmos/interchain-security/v5/testutil/ibc_testing" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil" + "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/testutil" ) func TestConsumerWhitelistingKeys(t *testing.T) { diff --git a/app/upgrades/types.go b/app/upgrades/types.go index d94491025..8c52a43b2 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -17,13 +17,16 @@ import ( feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" - dynamicfeeskeeper "github.com/neutron-org/neutron/v4/x/dynamicfees/keeper" + dexkeeper "github.com/neutron-org/neutron/v5/x/dex/keeper" + ibcratelimitkeeper "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/keeper" - contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - cronkeeper "github.com/neutron-org/neutron/v4/x/cron/keeper" - feeburnerkeeper "github.com/neutron-org/neutron/v4/x/feeburner/keeper" - icqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - tokenfactorykeeper "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" + dynamicfeeskeeper "github.com/neutron-org/neutron/v5/x/dynamicfees/keeper" + + contractmanagerkeeper "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + cronkeeper "github.com/neutron-org/neutron/v5/x/cron/keeper" + feeburnerkeeper "github.com/neutron-org/neutron/v5/x/feeburner/keeper" + icqkeeper "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + tokenfactorykeeper "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" transferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" @@ -64,6 +67,8 @@ type UpgradeKeepers struct { MarketmapKeeper *marketmapkeeper.Keeper FeeMarketKeeper *feemarketkeeper.Keeper DynamicfeesKeeper *dynamicfeeskeeper.Keeper + DexKeeper *dexkeeper.Keeper + IbcRateLimitKeeper *ibcratelimitkeeper.Keeper // subspaces GlobalFeeSubspace paramtypes.Subspace CcvConsumerSubspace paramtypes.Subspace diff --git a/app/upgrades/v4.0.1/constants.go b/app/upgrades/v4.0.1/constants.go deleted file mode 100644 index 6e78acb3b..000000000 --- a/app/upgrades/v4.0.1/constants.go +++ /dev/null @@ -1,38 +0,0 @@ -package v400 - -import ( - storetypes "cosmossdk.io/store/types" - feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" - marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" - oracletypes "github.com/skip-mev/slinky/x/oracle/types" - - dynamicfeestypes "github.com/neutron-org/neutron/v4/x/dynamicfees/types" - - "github.com/neutron-org/neutron/v4/app/upgrades" - globalfeetypes "github.com/neutron-org/neutron/v4/x/globalfee/types" -) - -const ( - // UpgradeName defines the on-chain upgrade name. - UpgradeName = "v4.0.1" - - // MarketMapAuthorityMultisig defines the address of a market-map authority governed by a - // multi-sig of contributors. - MarketMapAuthorityMultisig = "neutron1ua63s43u2p4v38pxhcxmps0tj2gudyw2hfeetz" - - DecimalsAdjustment = 1_000_000_000_000 -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: storetypes.StoreUpgrades{ - Added: []string{ - globalfeetypes.ModuleName, - marketmaptypes.ModuleName, - oracletypes.ModuleName, - feemarkettypes.ModuleName, - dynamicfeestypes.ModuleName, - }, - }, -} diff --git a/app/upgrades/v4.0.1/upgrades.go b/app/upgrades/v4.0.1/upgrades.go deleted file mode 100644 index 2897e2fb0..000000000 --- a/app/upgrades/v4.0.1/upgrades.go +++ /dev/null @@ -1,259 +0,0 @@ -package v400 - -import ( - "context" - "fmt" - "sort" - - appparams "github.com/neutron-org/neutron/v4/app/params" - - "cosmossdk.io/errors" - "cosmossdk.io/math" - - feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" - feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" - - dynamicfeeskeeper "github.com/neutron-org/neutron/v4/x/dynamicfees/keeper" - dynamicfeestypes "github.com/neutron-org/neutron/v4/x/dynamicfees/types" - - upgradetypes "cosmossdk.io/x/upgrade/types" - comettypes "github.com/cometbft/cometbft/proto/tendermint/types" - adminmoduletypes "github.com/cosmos/admin-module/v2/x/adminmodule/types" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" - "github.com/cosmos/cosmos-sdk/x/consensus/types" - marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" - marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" - - slinkyconstants "github.com/skip-mev/slinky/cmd/constants" - - "github.com/neutron-org/neutron/v4/app/upgrades" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - keepers *upgrades.UpgradeKeepers, - _ upgrades.StoreKeys, - _ codec.Codec, -) upgradetypes.UpgradeHandler { - return func(c context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - ctx := sdk.UnwrapSDKContext(c) - - ctx.Logger().Info("Starting module migrations...") - vm, err := mm.RunMigrations(ctx, configurator, vm) - if err != nil { - return vm, err - } - - ctx.Logger().Info("Setting consensus params...") - err = enableVoteExtensions(ctx, keepers.ConsensusKeeper) - if err != nil { - return nil, err - } - - ctx.Logger().Info("Setting marketmap params...") - err = setMarketMapParams(ctx, keepers.MarketmapKeeper) - if err != nil { - return nil, err - } - - ctx.Logger().Info("Setting dynamicfees/feemarket params...") - err = setFeeMarketParams(ctx, keepers.FeeMarketKeeper) - if err != nil { - return nil, err - } - - err = setDynamicFeesParams(ctx, keepers.DynamicfeesKeeper) - if err != nil { - return nil, err - } - - ctx.Logger().Info("Setting marketmap and oracle state...") - err = setMarketState(ctx, keepers.MarketmapKeeper) - if err != nil { - return nil, err - } - - ctx.Logger().Info(fmt.Sprintf("Migration {%s} applied", UpgradeName)) - return vm, nil - } -} - -func setMarketMapParams(ctx sdk.Context, marketmapKeeper *marketmapkeeper.Keeper) error { - marketmapParams := marketmaptypes.Params{ - MarketAuthorities: []string{authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), MarketMapAuthorityMultisig}, - Admin: authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), - } - return marketmapKeeper.SetParams(ctx, marketmapParams) -} - -// NtrnPrices describes prices of any token in NTRN for dynamic fee resolver -// there are several 18decimals coins, we need to adjust all the coins with the same base (6 decimals) prior to do any math -// by dividing by 10^12 -var NtrnPrices = sdk.NewDecCoins( - // Token,Denom,TWAP30D (USD),Price in NTRN (30d TWAP of DENOM / 30d TWAP of NTRN),Price + 30% premium - // wstETH,factory/neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry/wstETH,3616.34,5779.670768739013,7513.571999360713 - // 18 decimals coin - sdk.NewDecCoinFromDec("factory/neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry/wstETH", math.LegacyMustNewDecFromStr("7513.571999360713").QuoInt64(DecimalsAdjustment)), - - // stATOM,ibc/B7864B03E1B9FD4F049243E92ABD691586F682137037A9F3FCA5222815620B3C,10.268,16.410420329231,21.333546427991 - sdk.NewDecCoinFromDec("ibc/B7864B03E1B9FD4F049243E92ABD691586F682137037A9F3FCA5222815620B3C", math.LegacyMustNewDecFromStr("21.333546427991")), - - // stTIA,ibc/6569E05DEE32B339D9286A52BE33DFCEFC97267F23EF9CFDE0C055140967A9A5,8.52,13.61674924085,17.70177401312 - sdk.NewDecCoinFromDec("ibc/6569E05DEE32B339D9286A52BE33DFCEFC97267F23EF9CFDE0C055140967A9A5", math.LegacyMustNewDecFromStr("17.70177401312")), - - // stkATOM,ibc/3649CE0C8A2C79048D8C6F31FF18FA69C9BC7EB193512E0BD03B733011290445,9.656,15.432315806297,20.062010548187 - sdk.NewDecCoinFromDec("ibc/3649CE0C8A2C79048D8C6F31FF18FA69C9BC7EB193512E0BD03B733011290445", math.LegacyMustNewDecFromStr("20.062010548187")), - - // USDC.noble,ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81,1,1.598210004795,2.077673006235 - sdk.NewDecCoinFromDec("ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81", math.LegacyMustNewDecFromStr("2.077673006235")), - - // USDC.axl,ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349,1,1.598210004795,2.077673006235 - sdk.NewDecCoinFromDec("ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349", math.LegacyMustNewDecFromStr("2.077673006235")), - - // USDT,ibc/57503D7852EF4E1899FE6D71C5E81D7C839F76580F86F21E39348FC2BC9D7CE2,1,1.598210004795,2.077673006235 - sdk.NewDecCoinFromDec("ibc/57503D7852EF4E1899FE6D71C5E81D7C839F76580F86F21E39348FC2BC9D7CE2", math.LegacyMustNewDecFromStr("2.077673006235")), - - // http://astro.cw/,ibc/5751B8BCDA688FD0A8EC0B292EEF1CDEAB4B766B63EC632778B196D317C40C3A,0.0693,0.110755953332,0.143982739322 - sdk.NewDecCoinFromDec("ibc/5751B8BCDA688FD0A8EC0B292EEF1CDEAB4B766B63EC632778B196D317C40C3A", math.LegacyMustNewDecFromStr("0.143982739322")), - - // ASTRO,factory/neutron1ffus553eet978k024lmssw0czsxwr97mggyv85lpcsdkft8v9ufsz3sa07/astro,0.0693,0.110755953332,0.143982739322 - sdk.NewDecCoinFromDec("factory/neutron1ffus553eet978k024lmssw0czsxwr97mggyv85lpcsdkft8v9ufsz3sa07/astro", math.LegacyMustNewDecFromStr("0.143982739322")), - - // MARS,ibc/9598CDEB7C6DB7FC21E746C8E0250B30CD5154F39CA111A9D4948A4362F638BD,0.0652,0.104203292313,0.135464280003 - sdk.NewDecCoinFromDec("ibc/9598CDEB7C6DB7FC21E746C8E0250B30CD5154F39CA111A9D4948A4362F638BD", math.LegacyMustNewDecFromStr("0.135464280003")), - - // APOLLO,factory/neutron154gg0wtm2v4h9ur8xg32ep64e8ef0g5twlsgvfeajqwghdryvyqsqhgk8e/APOLLO,0.06079,0.097155186191,0.126301742051 - sdk.NewDecCoinFromDec("factory/neutron154gg0wtm2v4h9ur8xg32ep64e8ef0g5twlsgvfeajqwghdryvyqsqhgk8e/APOLLO", math.LegacyMustNewDecFromStr("0.126301742051")), - - // TIA,ibc/773B4D0A3CD667B2275D5A4A7A2F0909C0BA0F4059C0B9181E680DDF4965DCC7,8.52,13.61674924085,17.70177401312 - sdk.NewDecCoinFromDec("ibc/773B4D0A3CD667B2275D5A4A7A2F0909C0BA0F4059C0B9181E680DDF4965DCC7", math.LegacyMustNewDecFromStr("17.70177401312")), - - // ATOM,ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9,7.559,12.080869426243,15.705130254103 - sdk.NewDecCoinFromDec("ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", math.LegacyMustNewDecFromStr("15.705130254103")), - - // axlWETH,ibc/A585C2D15DCD3B010849B453A2CFCB5E213208A5AB665691792684C26274304D,3616.34,5779.670768739013,7513.571999360713 - // 18 decimals coin - sdk.NewDecCoinFromDec("ibc/A585C2D15DCD3B010849B453A2CFCB5E213208A5AB665691792684C26274304D", math.LegacyMustNewDecFromStr("7513.571999360713").QuoInt64(DecimalsAdjustment)), - - // OSMO,ibc/376222D6D9DAE23092E29740E56B758580935A6D77C24C2ABD57A6A78A1F3955,0.6699,1.070640882212,1.391833146872 - sdk.NewDecCoinFromDec("ibc/376222D6D9DAE23092E29740E56B758580935A6D77C24C2ABD57A6A78A1F3955", math.LegacyMustNewDecFromStr("1.391833146872")), - - // DYM,ibc/4A6A46D4263F2ED3DCE9CF866FE15E6903FB5E12D87EB8BDC1B6B1A1E2D397B4,2.329,3.722231101167,4.838900431527 - // 18 decimals coin - sdk.NewDecCoinFromDec("ibc/4A6A46D4263F2ED3DCE9CF866FE15E6903FB5E12D87EB8BDC1B6B1A1E2D397B4", math.LegacyMustNewDecFromStr("4.838900431527").QuoInt64(DecimalsAdjustment)), - - // DYDX,ibc/2CB87BCE0937B1D1DFCEE79BE4501AAF3C265E923509AEAC410AD85D27F35130,1.71,2.732939108199,3.552820840659 - // 18 decimals coin - sdk.NewDecCoinFromDec("ibc/2CB87BCE0937B1D1DFCEE79BE4501AAF3C265E923509AEAC410AD85D27F35130", math.LegacyMustNewDecFromStr("3.552820840659").QuoInt64(DecimalsAdjustment)), - - // KUJI,ibc/1053E271314D36FECBC915B51474F8B3962597CE88FF3E4A74795B0E3F367A8B,1.22,1.949816205849,2.534761067589 - sdk.NewDecCoinFromDec("ibc/1053E271314D36FECBC915B51474F8B3962597CE88FF3E4A74795B0E3F367A8B", math.LegacyMustNewDecFromStr("2.534761067589")), - - // STARS,ibc/A139C0E0B5E87CBA8EAEEB12B9BEE13AC7C814CFBBFA87BBCADD67E31003466C,0.0138,0.022055298066,0.028671887496 - sdk.NewDecCoinFromDec("ibc/A139C0E0B5E87CBA8EAEEB12B9BEE13AC7C814CFBBFA87BBCADD67E31003466C", math.LegacyMustNewDecFromStr("0.028671887496")), - - // AXL,ibc/C0E66D1C81D8AAF0E6896E05190FDFBC222367148F86AC3EA679C28327A763CD,0.802,1.281764423845,1.666293750985 - sdk.NewDecCoinFromDec("ibc/C0E66D1C81D8AAF0E6896E05190FDFBC222367148F86AC3EA679C28327A763CD", math.LegacyMustNewDecFromStr("1.666293750985")), - - // STRD,ibc/3552CECB7BCE1891DB6070D37EC6E954C972B1400141308FCD85FD148BD06DE5,1.542,2.464439827393,3.203771775613 - sdk.NewDecCoinFromDec("ibc/3552CECB7BCE1891DB6070D37EC6E954C972B1400141308FCD85FD148BD06DE5", math.LegacyMustNewDecFromStr("3.203771775613")), -) - -func setDynamicFeesParams(ctx sdk.Context, dfKeeper *dynamicfeeskeeper.Keeper) error { - dfParams := dynamicfeestypes.Params{ - NtrnPrices: NtrnPrices, - } - err := dfKeeper.SetParams(ctx, dfParams) - if err != nil { - return errors.Wrap(err, "failed to set dynamic fees params") - } - - return nil -} - -func setFeeMarketParams(ctx sdk.Context, feemarketKeeper *feemarketkeeper.Keeper) error { - feemarketParams := feemarkettypes.Params{ - Alpha: math.LegacyZeroDec(), - Beta: math.LegacyZeroDec(), - Delta: math.LegacyZeroDec(), - MinBaseGasPrice: math.LegacyMustNewDecFromStr("0.0053"), - MinLearningRate: math.LegacyMustNewDecFromStr("0.08"), - MaxLearningRate: math.LegacyMustNewDecFromStr("0.08"), - MaxBlockUtilization: 30_000_000, - Window: 1, - FeeDenom: appparams.DefaultDenom, - Enabled: true, - DistributeFees: true, - } - feemarketState := feemarkettypes.NewState(feemarketParams.Window, feemarketParams.MinBaseGasPrice, feemarketParams.MinLearningRate) - err := feemarketKeeper.SetParams(ctx, feemarketParams) - if err != nil { - return errors.Wrap(err, "failed to set feemarket params") - } - err = feemarketKeeper.SetState(ctx, feemarketState) - if err != nil { - return errors.Wrap(err, "failed to set feemarket state") - } - - return nil -} - -func setMarketState(ctx sdk.Context, mmKeeper *marketmapkeeper.Keeper) error { - markets := marketMapToDeterministicallyOrderedMarkets(slinkyconstants.CoreMarketMap) - for _, market := range markets { - if err := mmKeeper.CreateMarket(ctx, market); err != nil { - return err - } - - if err := mmKeeper.Hooks().AfterMarketCreated(ctx, market); err != nil { - return err - } - - } - return nil -} - -func marketMapToDeterministicallyOrderedMarkets(mm marketmaptypes.MarketMap) []marketmaptypes.Market { - markets := make([]marketmaptypes.Market, 0, len(mm.Markets)) - for _, market := range mm.Markets { - markets = append(markets, market) - } - - // order the markets alphabetically by their ticker.String() - sort.Slice(markets, func(i, j int) bool { - return markets[i].Ticker.String() < markets[j].Ticker.String() - }) - - return markets -} - -func enableVoteExtensions(ctx sdk.Context, consensusKeeper *consensuskeeper.Keeper) error { - oldParams, err := consensusKeeper.Params(ctx, &types.QueryParamsRequest{}) - if err != nil { - return err - } - - oldParams.Params.Version = &comettypes.VersionParams{App: 0} - if err := consensusKeeper.ParamsStore.Set(ctx, *oldParams.Params); err != nil { - return err - } - - // we need to enable VoteExtensions for Slinky - oldParams.Params.Abci = &comettypes.ABCIParams{VoteExtensionsEnableHeight: ctx.BlockHeight() + 4} - - updateParamsMsg := types.MsgUpdateParams{ - Authority: authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), - Block: oldParams.Params.Block, - Evidence: oldParams.Params.Evidence, - Validator: oldParams.Params.Validator, - Abci: oldParams.Params.Abci, - } - - _, err = consensusKeeper.UpdateParams(ctx, &updateParamsMsg) - return err -} diff --git a/app/upgrades/v4.0.1/upgrades_test.go b/app/upgrades/v4.0.1/upgrades_test.go deleted file mode 100644 index 987cf20bb..000000000 --- a/app/upgrades/v4.0.1/upgrades_test.go +++ /dev/null @@ -1,145 +0,0 @@ -package v400_test - -import ( - "sort" - "testing" - - marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" - - slinkyconstants "github.com/skip-mev/slinky/cmd/constants" - slinkytypes "github.com/skip-mev/slinky/pkg/types" - - upgradetypes "cosmossdk.io/x/upgrade/types" - comettypes "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/x/consensus/types" - "github.com/stretchr/testify/require" - - "github.com/stretchr/testify/suite" - - v400 "github.com/neutron-org/neutron/v4/app/upgrades/v4.0.1" - "github.com/neutron-org/neutron/v4/testutil" -) - -type UpgradeTestSuite struct { - testutil.IBCConnectionTestSuite -} - -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(UpgradeTestSuite)) -} - -func (suite *UpgradeTestSuite) SetupTest() { - suite.IBCConnectionTestSuite.SetupTest() -} - -func (suite *UpgradeTestSuite) TestOracleUpgrade() { - app := suite.GetNeutronZoneApp(suite.ChainA) - ctx := suite.ChainA.GetContext() - t := suite.T() - - oldParams, err := app.ConsensusParamsKeeper.Params(ctx, &types.QueryParamsRequest{}) - suite.Require().NoError(err) - // it is automatically tracked in upgrade handler, we need to set it manually for tests - oldParams.Params.Version = &comettypes.VersionParams{App: 0} - // we need to properly set consensus params for tests or we get a panic - suite.Require().NoError(app.ConsensusParamsKeeper.ParamsStore.Set(ctx, *oldParams.Params)) - - markets := slinkyconstants.CoreMarketMap.Markets - suite.Require().NoError(err) - - upgrade := upgradetypes.Plan{ - Name: v400.UpgradeName, - Info: "some text here", - Height: 100, - } - require.NoError(t, app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) - - params, err := app.MarketMapKeeper.GetParams(ctx) - suite.Require().NoError(err) - suite.Require().Equal(params.MarketAuthorities[0], "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z") - suite.Require().Equal(params.MarketAuthorities[1], "neutron1ua63s43u2p4v38pxhcxmps0tj2gudyw2hfeetz") - suite.Require().Equal(params.Admin, "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z") - - // check that the market map was properly set - mm, err := app.MarketMapKeeper.GetAllMarkets(ctx) - gotMM := marketmaptypes.MarketMap{Markets: mm} - suite.Require().NoError(err) - suite.Require().True(slinkyconstants.CoreMarketMap.Equal(gotMM)) - - numCps, err := app.OracleKeeper.GetNumCurrencyPairs(ctx) - suite.Require().NoError(err) - suite.Require().Equal(numCps, uint64(len(markets))) - - // check that all currency pairs have been initialized in the oracle module - tickers := make([]slinkytypes.CurrencyPair, 0, len(markets)) - for _, market := range markets { - decimals, err := app.OracleKeeper.GetDecimalsForCurrencyPair(ctx, market.Ticker.CurrencyPair) - suite.Require().NoError(err) - suite.Require().Equal(market.Ticker.Decimals, decimals) - - price, err := app.OracleKeeper.GetPriceWithNonceForCurrencyPair(ctx, market.Ticker.CurrencyPair) - suite.Require().NoError(err) - suite.Require().Equal(uint64(0), price.Nonce()) // no nonce because no updates yet - suite.Require().Equal(uint64(0), price.BlockHeight) // no block height because no price written yet - - suite.Require().True(market.Ticker.Enabled) - - tickers = append(tickers, market.Ticker.CurrencyPair) - } - - // check IDs for inserted currency pairs, sort currency-pairs alphabetically - sort.Slice(tickers, func(i, j int) bool { - return tickers[i].String() < tickers[j].String() - }) - - for i, cp := range tickers { - id, found := app.OracleKeeper.GetIDForCurrencyPair(ctx, cp) - suite.Require().True(found) - suite.Require().Equal(uint64(i), id) - } -} - -func (suite *UpgradeTestSuite) TestEnableVoteExtensionsUpgrade() { - app := suite.GetNeutronZoneApp(suite.ChainA) - ctx := suite.ChainA.GetContext() - t := suite.T() - - oldParams, err := app.ConsensusParamsKeeper.Params(ctx, &types.QueryParamsRequest{}) - suite.Require().NoError(err) - - // VoteExtensionsEnableHeight must be updated after the upgrade on upgrade height - // but the rest of params must be the same - oldParams.Params.Abci = &comettypes.ABCIParams{VoteExtensionsEnableHeight: ctx.BlockHeight() + 4} - // it is automatically tracked in upgrade handler, we need to set it manually for tests - oldParams.Params.Version = &comettypes.VersionParams{App: 0} - // we need to properly set consensus params for tests or we get a panic - suite.Require().NoError(app.ConsensusParamsKeeper.ParamsStore.Set(ctx, *oldParams.Params)) - - upgrade := upgradetypes.Plan{ - Name: v400.UpgradeName, - Info: "some text here", - Height: ctx.BlockHeight(), - } - require.NoError(t, app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) - - newParams, err := app.ConsensusParamsKeeper.Params(ctx, &types.QueryParamsRequest{}) - suite.Require().NoError(err) - - suite.Require().Equal(oldParams, newParams) -} - -func (suite *UpgradeTestSuite) TestDynamicFeesUpgrade() { - app := suite.GetNeutronZoneApp(suite.ChainA) - ctx := suite.ChainA.GetContext() - t := suite.T() - - upgrade := upgradetypes.Plan{ - Name: v400.UpgradeName, - Info: "some text here", - Height: 100, - } - require.NoError(t, app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) - - params := app.DynamicFeesKeeper.GetParams(ctx) - suite.Require().Equal(params.NtrnPrices, v400.NtrnPrices) -} diff --git a/app/upgrades/v5.0.0/constants.go b/app/upgrades/v5.0.0/constants.go new file mode 100644 index 000000000..046428ab9 --- /dev/null +++ b/app/upgrades/v5.0.0/constants.go @@ -0,0 +1,30 @@ +package v500 + +import ( + storetypes "cosmossdk.io/store/types" + + "github.com/neutron-org/neutron/v5/app/upgrades" + ibcratelimittypes "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +const ( + // UpgradeName defines the on-chain upgrade name. + UpgradeName = "v5.0.0" + + MarketMapAuthorityMultisig = "neutron1anjpluecd0tdc0n8xzc3l5hua4h93wyq0x7v56" + // MainnetRateLimitContract defines the RL contract addr which we set as a contract address in ibc-rate-limit middleware + // https://neutron.celat.one/neutron-1/contracts/neutron15aqgplxcavqhurr0g5wwtdw6025dknkqwkfh0n46gp2qjl6236cs2yd3nl + MainnetRateLimitContract = "neutron15aqgplxcavqhurr0g5wwtdw6025dknkqwkfh0n46gp2qjl6236cs2yd3nl" + + // TestnetRateLimitContract defines the RL contract addr which we set as a contract address in ibc-rate-limit middleware + // https://neutron.celat.one/pion-1/contracts/neutron1ajezjq09w2ajc2j9656edmqaxsqpwmwmwrmmk5lnahmyvf2k68usqdytcx + TestnetRateLimitContract = "neutron1ajezjq09w2ajc2j9656edmqaxsqpwmwmwrmmk5lnahmyvf2k68usqdytcx" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{ + Added: []string{ibcratelimittypes.ModuleName}, + }, +} diff --git a/app/upgrades/v5.0.0/upgrades.go b/app/upgrades/v5.0.0/upgrades.go new file mode 100644 index 000000000..ab3b82543 --- /dev/null +++ b/app/upgrades/v5.0.0/upgrades.go @@ -0,0 +1,156 @@ +package v500 + +import ( + "context" + "fmt" + + "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" + adminmoduletypes "github.com/cosmos/admin-module/v2/x/adminmodule/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" + + "github.com/neutron-org/neutron/v5/app/upgrades" + dexkeeper "github.com/neutron-org/neutron/v5/x/dex/keeper" + ibcratelimitkeeper "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/keeper" + ibcratelimittypes "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *upgrades.UpgradeKeepers, + _ upgrades.StoreKeys, + _ codec.Codec, +) upgradetypes.UpgradeHandler { + return func(c context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx := sdk.UnwrapSDKContext(c) + + ctx.Logger().Info("Starting module migrations...") + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + ctx.Logger().Info("Running dex upgrades...") + // Only pause dex for mainnet + if ctx.ChainID() == "neutron-1" { + err = upgradeDexPause(ctx, *keepers.DexKeeper) + if err != nil { + return nil, err + } + } + + err = upgradePools(ctx, *keepers.DexKeeper) + if err != nil { + return nil, err + } + + err = setMarketMapParams(ctx, keepers.MarketmapKeeper) + if err != nil { + return nil, err + } + + ctx.Logger().Info("Running ibc-rate-limit upgrades...") + + err = upgradeIbcRateLimitSetContract(ctx, *keepers.IbcRateLimitKeeper) + if err != nil { + return nil, err + } + + ctx.Logger().Info(fmt.Sprintf("Migration {%s} applied", UpgradeName)) + return vm, nil + } +} + +func upgradeDexPause(ctx sdk.Context, k dexkeeper.Keeper) error { + // Set the dex to paused + ctx.Logger().Info("Pausing dex...") + + params := k.GetParams(ctx) + params.Paused = true + + if err := k.SetParams(ctx, params); err != nil { + return err + } + + ctx.Logger().Info("Dex is paused") + + return nil +} + +func upgradePools(ctx sdk.Context, k dexkeeper.Keeper) error { + // Due to an issue with autoswap logic any pools with multiple shareholders must be withdrawn to ensure correct accounting + ctx.Logger().Info("Migrating Pools...") + + allSharesholders := k.GetAllPoolShareholders(ctx) + + for poolID, shareholders := range allSharesholders { + if len(shareholders) > 1 { + pool, found := k.GetPoolByID(ctx, poolID) + if !found { + return fmt.Errorf("cannot find pool with ID %d", poolID) + } + for _, shareholder := range shareholders { + addr := sdk.MustAccAddressFromBech32(shareholder.Address) + pairID := pool.LowerTick0.Key.TradePairId.MustPairID() + tick := pool.CenterTickIndexToken1() + fee := pool.Fee() + nShares := shareholder.Shares + + reserve0Removed, reserve1Removed, sharesBurned, err := k.WithdrawCore(ctx, pairID, addr, addr, []math.Int{nShares}, []int64{tick}, []uint64{fee}) + if err != nil { + return fmt.Errorf("user %s failed to withdraw from pool %d", addr, poolID) + } + + ctx.Logger().Info( + "Withdrew user from pool", + "User", addr.String(), + "Pool", poolID, + "SharesBurned", sharesBurned.String(), + "Reserve0Withdrawn", reserve0Removed.String(), + "Reserve1Withdrawn", reserve1Removed.String(), + ) + + } + } + } + + ctx.Logger().Info("Finished migrating Pools...") + + return nil +} + +func upgradeIbcRateLimitSetContract(ctx sdk.Context, k ibcratelimitkeeper.Keeper) error { + // Set the dex to paused + ctx.Logger().Info("Setting ibc rate limiting contract...") + + switch ctx.ChainID() { + case "neutron-1": + if err := k.SetParams(ctx, ibcratelimittypes.Params{ContractAddress: MainnetRateLimitContract}); err != nil { + return err + } + case "pion-1": + if err := k.SetParams(ctx, ibcratelimittypes.Params{ContractAddress: TestnetRateLimitContract}); err != nil { + return err + } + default: + return fmt.Errorf("unknown chain id %s", ctx.ChainID()) + } + + ctx.Logger().Info("Rate limit contract is set") + + return nil +} + +func setMarketMapParams(ctx sdk.Context, marketmapKeeper *marketmapkeeper.Keeper) error { + marketmapParams := marketmaptypes.Params{ + MarketAuthorities: []string{authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), MarketMapAuthorityMultisig}, + Admin: authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), + } + return marketmapKeeper.SetParams(ctx, marketmapParams) +} diff --git a/app/upgrades/v5.0.0/upgrades_test.go b/app/upgrades/v5.0.0/upgrades_test.go new file mode 100644 index 000000000..f8403d210 --- /dev/null +++ b/app/upgrades/v5.0.0/upgrades_test.go @@ -0,0 +1,256 @@ +package v500_test + +import ( + "fmt" + "testing" + + "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + v500 "github.com/neutron-org/neutron/v5/app/upgrades/v5.0.0" + "github.com/neutron-org/neutron/v5/testutil/common/sample" + + "github.com/neutron-org/neutron/v5/testutil" + dexkeeper "github.com/neutron-org/neutron/v5/x/dex/keeper" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" +) + +type UpgradeTestSuite struct { + testutil.IBCConnectionTestSuite +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(UpgradeTestSuite)) +} + +func (suite *UpgradeTestSuite) SetupTest() { + suite.IBCConnectionTestSuite.SetupTest() +} + +func (suite *UpgradeTestSuite) TestOracleUpgrade() { + app := suite.GetNeutronZoneApp(suite.ChainA) + ctx := suite.ChainA.GetContext().WithChainID("neutron-1") + t := suite.T() + + upgrade := upgradetypes.Plan{ + Name: v500.UpgradeName, + Info: "some text here", + Height: 100, + } + require.NoError(t, app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) + + params, err := app.MarketMapKeeper.GetParams(ctx) + suite.Require().NoError(err) + suite.Require().Equal(params.MarketAuthorities[0], "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z") + suite.Require().Equal(params.MarketAuthorities[1], v500.MarketMapAuthorityMultisig) + suite.Require().Equal(params.Admin, "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z") +} + +func (suite *UpgradeTestSuite) TestUpgradeDexPause() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + ctx = suite.ChainA.GetContext().WithChainID("neutron-1") + msgServer = dexkeeper.NewMsgServerImpl(app.DexKeeper) + ) + + params := app.DexKeeper.GetParams(ctx) + + suite.False(params.Paused) + + upgrade := upgradetypes.Plan{ + Name: v500.UpgradeName, + Info: "some text here", + Height: 100, + } + suite.NoError(app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) + + params = app.DexKeeper.GetParams(ctx) + + suite.True(params.Paused) + + _, err := msgServer.Deposit(ctx, &dextypes.MsgDeposit{ + Creator: sample.AccAddress(), + Receiver: sample.AccAddress(), + TokenA: "TokenA", + TokenB: "TokenB", + TickIndexesAToB: []int64{1}, + Fees: []uint64{1}, + AmountsA: []math.Int{math.OneInt()}, + AmountsB: []math.Int{math.ZeroInt()}, + Options: []*dextypes.DepositOptions{{}}, + }) + + suite.ErrorIs(err, dextypes.ErrDexPaused) +} + +func (suite *UpgradeTestSuite) TestPoolMigrationSingleShareHolder() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + ctx = suite.ChainA.GetContext().WithChainID("neutron-1") + alice = []byte("alice") + pairID = &dextypes.PairID{Token0: "TokenA", Token1: "TokenB"} + depositAmount = math.NewInt(10_000) + ) + + // create a pool with 1 shareholder + FundAccount(app.BankKeeper, ctx, alice, sdk.NewCoins(sdk.NewCoin("TokenA", depositAmount))) + shares, err := suite.makeDeposit(ctx, app.DexKeeper, alice, pairID, depositAmount, math.ZeroInt(), 0, 1) + suite.NoError(err) + + // run upgrade + upgrade := upgradetypes.Plan{ + Name: v500.UpgradeName, + Info: "some text here", + Height: 100, + } + suite.NoError(app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) + + // assert pool and shareholder balance are unchanged + poolID, err := dextypes.ParsePoolIDFromDenom(shares[0].Denom) + suite.NoError(err) + + pool, _ := app.DexKeeper.GetPoolByID(ctx, poolID) + + suite.True(pool.LowerTick0.ReservesMakerDenom.Equal(depositAmount), "Pool value changed") + aliceBalance := app.BankKeeper.GetAllBalances(ctx, alice) + suite.True(aliceBalance.Equal(shares)) +} + +func (suite *UpgradeTestSuite) TestPoolMigrationMultiShareHolder() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + ctx = suite.ChainA.GetContext().WithChainID("neutron-1") + alice = []byte("alice") + bob = []byte("bob") + pairID = &dextypes.PairID{Token0: "TokenA", Token1: "TokenB"} + depositAmount = math.NewInt(10_000) + initialBalance = sdk.NewCoins(sdk.NewCoin("TokenA", depositAmount)) + ) + FundAccount(app.BankKeeper, ctx, alice, initialBalance) + FundAccount(app.BankKeeper, ctx, bob, initialBalance) + + // create a pool with 2 shareholders + shares, err := suite.makeDeposit(ctx, app.DexKeeper, alice, pairID, depositAmount, math.ZeroInt(), 0, 1) + suite.NoError(err) + aliceBalance := app.BankKeeper.GetAllBalances(ctx, alice) + suite.True(aliceBalance.Equal(shares)) + + shares, err = suite.makeDeposit(ctx, app.DexKeeper, bob, pairID, depositAmount, math.ZeroInt(), 0, 1) + suite.NoError(err) + bobBalance := app.BankKeeper.GetAllBalances(ctx, bob) + suite.True(bobBalance.Equal(shares)) + + // run upgrade + upgrade := upgradetypes.Plan{ + Name: v500.UpgradeName, + Info: "some text here", + Height: 100, + } + suite.NoError(app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) + + // assert that all users have withdrawn from the pool + poolID, err := dextypes.ParsePoolIDFromDenom(shares[0].Denom) + suite.NoError(err) + + pool, _ := app.DexKeeper.GetPoolByID(ctx, poolID) + suite.True(pool.LowerTick0.ReservesMakerDenom.Equal(math.ZeroInt()), "Pool not withdrawn") + + // AND funds are returned to the users + aliceBalance = app.BankKeeper.GetAllBalances(ctx, alice) + suite.True(aliceBalance.Equal(initialBalance)) + + bobBalance = app.BankKeeper.GetAllBalances(ctx, bob) + suite.True(bobBalance.Equal(initialBalance)) +} + +func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) { + if err := bankKeeper.MintCoins(ctx, dextypes.ModuleName, amounts); err != nil { + panic(err) + } + + if err := bankKeeper.SendCoinsFromModuleToAccount(ctx, dextypes.ModuleName, addr, amounts); err != nil { + panic(err) + } +} + +func (suite *UpgradeTestSuite) makeDeposit( + ctx sdk.Context, + k dexkeeper.Keeper, + addr sdk.AccAddress, + pairID *dextypes.PairID, + amount0, amount1 math.Int, + tick int64, + fee uint64, +) (sharesIssued sdk.Coins, err error) { + deposit0, deposit1, sharesIssued, _, err := k.DepositCore(ctx, pairID, addr, addr, []math.Int{amount0}, []math.Int{amount1}, []int64{tick}, []uint64{fee}, []*dextypes.DepositOptions{{}}) + suite.True(deposit0[0].Equal(amount0)) + suite.True(deposit1[0].Equal(amount1)) + + return sharesIssued, err +} + +func (suite *UpgradeTestSuite) TestUpgradeSetRateLimitContractMainnet() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + ctx = suite.ChainA.GetContext().WithChainID("neutron-1") + ) + + params := app.RateLimitingICS4Wrapper.IbcratelimitKeeper.GetParams(ctx) + + suite.Equal(params.ContractAddress, "") + + upgrade := upgradetypes.Plan{ + Name: v500.UpgradeName, + Info: "some text here", + Height: 100, + } + suite.NoError(app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) + + params = app.RateLimitingICS4Wrapper.IbcratelimitKeeper.GetParams(ctx) + + suite.Equal(params.ContractAddress, v500.MainnetRateLimitContract) +} + +func (suite *UpgradeTestSuite) TestUpgradeSetRateLimitContractTestnet() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + ctx = suite.ChainA.GetContext().WithChainID("pion-1") + ) + + params := app.RateLimitingICS4Wrapper.IbcratelimitKeeper.GetParams(ctx) + + suite.Equal(params.ContractAddress, "") + + upgrade := upgradetypes.Plan{ + Name: v500.UpgradeName, + Info: "some text here", + Height: 100, + } + suite.NoError(app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade)) + + params = app.RateLimitingICS4Wrapper.IbcratelimitKeeper.GetParams(ctx) + + suite.Equal(params.ContractAddress, v500.TestnetRateLimitContract) +} + +func (suite *UpgradeTestSuite) TestUpgradeSetRateLimitContractUnknownChain() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + ctx = suite.ChainA.GetContext().WithChainID("unknown-chain") + ) + + params := app.RateLimitingICS4Wrapper.IbcratelimitKeeper.GetParams(ctx) + + suite.Equal(params.ContractAddress, "") + + upgrade := upgradetypes.Plan{ + Name: v500.UpgradeName, + Info: "some text here", + Height: 100, + } + suite.EqualError(app.UpgradeKeeper.ApplyUpgrade(ctx, upgrade), fmt.Sprintf("unknown chain id %s", ctx.ChainID())) +} diff --git a/cmd/neutrond/consumer.go b/cmd/neutrond/consumer.go index 6ef10a887..469658269 100644 --- a/cmd/neutrond/consumer.go +++ b/cmd/neutrond/consumer.go @@ -18,7 +18,7 @@ import ( ccvconsumertypes "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/testutil/consumer" + "github.com/neutron-org/neutron/v5/testutil/consumer" ) func AddConsumerSectionCmd(defaultNodeHome string) *cobra.Command { diff --git a/cmd/neutrond/main.go b/cmd/neutrond/main.go index c417d7abb..da06d4cc0 100644 --- a/cmd/neutrond/main.go +++ b/cmd/neutrond/main.go @@ -3,11 +3,11 @@ package main import ( "os" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/neutron-org/neutron/v4/app" + "github.com/neutron-org/neutron/v5/app" ) func main() { diff --git a/cmd/neutrond/root.go b/cmd/neutrond/root.go index 112182eba..883178e3b 100644 --- a/cmd/neutrond/root.go +++ b/cmd/neutrond/root.go @@ -24,7 +24,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/version" @@ -40,8 +39,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/app/params" ) // NewRootCmd creates a new root command for neutrond. It is called once in the @@ -52,6 +51,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { // create a temporary application for use in constructing query + tx commands initAppOptions := viper.New() tempDir := tempDir() + // cleanup temp dir after we are done with the tempApp, so we don't leave behind a + // new temporary directory for every invocation. See https://github.com/CosmWasm/wasmd/issues/2017 + defer os.RemoveAll(tempDir) initAppOptions.Set(flags.FlagHome, tempDir) tempApplication := app.New( log.NewNopLogger(), @@ -113,6 +115,8 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { }, } + genAutoCompleteCmd(rootCmd) + initRootCmd(rootCmd, encodingConfig) initClientCtx, err := config.ReadDefaultValuesFromDefaultClientConfig(initClientCtx) if err != nil { @@ -124,7 +128,6 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { autoCliOpts := tempApplication.AutoCliOpts() initClientCtx, _ = config.ReadFromClientConfig(initClientCtx) - autoCliOpts.Keyring, _ = keyring.NewAutoCLIKeyring(initClientCtx.Keyring) autoCliOpts.ClientCtx = initClientCtx if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { @@ -139,7 +142,6 @@ func tempDir() string { if err != nil { dir = app.DefaultNodeHome } - defer os.RemoveAll(dir) return dir } @@ -385,3 +387,35 @@ func setCustomEnvVariablesFromClientToml(ctx client.Context) { // memo setEnvFromConfig("note", "NEUTROND_NOTE") } + +func genAutoCompleteCmd(rootCmd *cobra.Command) { + rootCmd.AddCommand(&cobra.Command{ + Use: "enable-cli-autocomplete [bash|zsh|fish|powershell]", + Short: "Generates cli completion scripts", + Long: `To configure your shell to load completions for each session, add to your profile: + +# bash example +echo '. <(neutrond enable-cli-autocomplete bash)' >> ~/.bash_profile +source ~/.bash_profile + +# zsh example +echo '. <(neutrond enable-cli-autocomplete zsh)' >> ~/.zshrc +source ~/.zshrc +`, + DisableFlagsInUseLine: true, + ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, + Args: cobra.ExactArgs(1), + Run: func(cmd *cobra.Command, args []string) { + switch args[0] { + case "bash": + _ = cmd.Root().GenBashCompletion(os.Stdout) + case "zsh": + _ = cmd.Root().GenZshCompletion(os.Stdout) + case "fish": + _ = cmd.Root().GenFishCompletion(os.Stdout, true) + case "powershell": + _ = cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout) + } + }, + }) +} diff --git a/contracts/neutron_chain_manager.wasm b/contracts/neutron_chain_manager.wasm index e136f67ec..5b1fd4f49 100644 Binary files a/contracts/neutron_chain_manager.wasm and b/contracts/neutron_chain_manager.wasm differ diff --git a/docs/static/swagger.yaml b/docs/static/swagger.yaml index 26bf7a1b0..c1c094a97 100644 --- a/docs/static/swagger.yaml +++ b/docs/static/swagger.yaml @@ -15075,16 +15075,8 @@ definitions: type: array soft_opt_out_threshold: title: >- - The threshold for the percentage of validators at the bottom of - the set who - - can opt out of running the consumer chain without being punished. - For - - example, a value of 0.05 means that the validators in the bottom - 5% of the - - set can opt out + !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see + docs/docs/adrs/adr-015-partial-set-security.md type: string transfer_timeout_period: title: Sent transfer related IBC packets will timeout after this duration @@ -15396,15 +15388,8 @@ definitions: type: array soft_opt_out_threshold: title: >- - The threshold for the percentage of validators at the bottom of the - set who - - can opt out of running the consumer chain without being punished. For - - example, a value of 0.05 means that the validators in the bottom 5% of - the - - set can opt out + !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see + docs/docs/adrs/adr-015-partial-set-security.md type: string transfer_timeout_period: title: Sent transfer related IBC packets will timeout after this duration @@ -15491,6 +15476,39 @@ definitions: format: uint64 type: string type: object + neutron.contractmanager.QueryFailureResponse: + description: QueryFailureResponse is response type for the Query/Failure RPC method. + properties: + failure: + properties: + address: + title: Address of the failed contract + type: string + error: + title: >- + Redacted error response of the sudo call. Full error is emitted as + an event + type: string + id: + format: uint64 + title: Id of the failure under specific address + type: string + sudo_payload: + format: byte + title: Serialized MessageSudoCallback with Packet and Ack(if exists) + type: string + title: >- + Failure message contains information about ACK failures and can be + used to + + replay ACK in case of requirement. + + Note that Failure means that sudo handler to cosmwasm contract failed + for + + some reason + type: object + type: object neutron.contractmanager.QueryFailuresResponse: description: QueryFailuresResponse is response type for the Query/Failures RPC method. properties: @@ -15563,17 +15581,28 @@ definitions: type: string type: object type: object + neutron.cron.ExecutionStage: + default: EXECUTION_STAGE_END_BLOCKER + description: |- + - EXECUTION_STAGE_END_BLOCKER: Execution at the end of the block + - EXECUTION_STAGE_BEGIN_BLOCKER: Execution at the beginning of the block + enum: + - EXECUTION_STAGE_END_BLOCKER + - EXECUTION_STAGE_BEGIN_BLOCKER + title: Defines when messages will be executed in the block + type: string neutron.cron.MsgExecuteContract: properties: contract: - title: Contract is the address of the smart contract + title: The address of the smart contract type: string msg: - title: Msg is json encoded message to be passed to the contract + title: JSON encoded message to be passed to the contract type: string + title: Defines the contract and the message to pass type: object neutron.cron.Params: - description: Params defines the parameters for the module. + description: Defines the parameters for the module. properties: limit: format: uint64 @@ -15584,9 +15613,20 @@ definitions: type: string type: object neutron.cron.QueryGetScheduleResponse: + description: The response type for the Query/Params RPC method. properties: schedule: properties: + execution_stage: + title: Stage when messages will be executed + default: EXECUTION_STAGE_END_BLOCKER + description: |- + - EXECUTION_STAGE_END_BLOCKER: Execution at the end of the block + - EXECUTION_STAGE_BEGIN_BLOCKER: Execution at the beginning of the block + enum: + - EXECUTION_STAGE_END_BLOCKER + - EXECUTION_STAGE_BEGIN_BLOCKER + type: string last_execute_height: format: uint64 title: Last execution's block height @@ -15595,13 +15635,16 @@ definitions: items: properties: contract: - title: Contract is the address of the smart contract + title: The address of the smart contract type: string msg: - title: Msg is json encoded message to be passed to the contract + title: JSON encoded message to be passed to the contract type: string + title: Defines the contract and the message to pass type: object - title: Msgs that will be executed every period amount of time + title: >- + Msgs that will be executed every certain number of blocks, + specified in the `period` field type: array name: title: Name of schedule @@ -15610,9 +15653,11 @@ definitions: format: uint64 title: Period in blocks type: string + title: Defines the schedule for execution type: object type: object neutron.cron.QueryParamsResponse: + description: The response type for the Query/Params RPC method. properties: params: description: params holds all the parameters of this module. @@ -15627,6 +15672,7 @@ definitions: type: object type: object neutron.cron.QuerySchedulesResponse: + description: The response type for the Query/Params RPC method. properties: pagination: description: |- @@ -15657,6 +15703,16 @@ definitions: schedules: items: properties: + execution_stage: + title: Stage when messages will be executed + default: EXECUTION_STAGE_END_BLOCKER + description: |- + - EXECUTION_STAGE_END_BLOCKER: Execution at the end of the block + - EXECUTION_STAGE_BEGIN_BLOCKER: Execution at the beginning of the block + enum: + - EXECUTION_STAGE_END_BLOCKER + - EXECUTION_STAGE_BEGIN_BLOCKER + type: string last_execute_height: format: uint64 title: Last execution's block height @@ -15665,13 +15721,16 @@ definitions: items: properties: contract: - title: Contract is the address of the smart contract + title: The address of the smart contract type: string msg: - title: Msg is json encoded message to be passed to the contract + title: JSON encoded message to be passed to the contract type: string + title: Defines the contract and the message to pass type: object - title: Msgs that will be executed every period amount of time + title: >- + Msgs that will be executed every certain number of blocks, + specified in the `period` field type: array name: title: Name of schedule @@ -15680,11 +15739,22 @@ definitions: format: uint64 title: Period in blocks type: string + title: Defines the schedule for execution type: object type: array type: object neutron.cron.Schedule: properties: + execution_stage: + title: Stage when messages will be executed + default: EXECUTION_STAGE_END_BLOCKER + description: |- + - EXECUTION_STAGE_END_BLOCKER: Execution at the end of the block + - EXECUTION_STAGE_BEGIN_BLOCKER: Execution at the beginning of the block + enum: + - EXECUTION_STAGE_END_BLOCKER + - EXECUTION_STAGE_BEGIN_BLOCKER + type: string last_execute_height: format: uint64 title: Last execution's block height @@ -15693,13 +15763,16 @@ definitions: items: properties: contract: - title: Contract is the address of the smart contract + title: The address of the smart contract type: string msg: - title: Msg is json encoded message to be passed to the contract + title: JSON encoded message to be passed to the contract type: string + title: Defines the contract and the message to pass type: object - title: Msgs that will be executed every period amount of time + title: >- + Msgs that will be executed every certain number of blocks, specified + in the `period` field type: array name: title: Name of schedule @@ -15708,6 +15781,14 @@ definitions: format: uint64 title: Period in blocks type: string + title: Defines the schedule for execution + type: object + neutron.dex.DepositOptions: + properties: + disable_autoswap: + type: boolean + fail_tx_on_bel: + type: boolean type: object neutron.dex.DepositRecord: properties: @@ -15750,9 +15831,24 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The + actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -15775,9 +15871,24 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The + actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -15791,6 +15902,14 @@ definitions: format: int64 type: string type: object + neutron.dex.FailedDeposit: + properties: + deposit_idx: + format: uint64 + type: string + error: + type: string + type: object neutron.dex.LimitOrderTranche: properties: expiration_time: @@ -15820,7 +15939,15 @@ definitions: tranche_key: type: string type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the opposite token. + (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future release, + `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -15860,6 +15987,7 @@ definitions: - GOOD_TIL_TIME type: string shares_cancelled: + title: 'TODO: remove this in next release. It is no longer used' type: string shares_owned: type: string @@ -15887,110 +16015,496 @@ definitions: - JUST_IN_TIME - GOOD_TIL_TIME type: string - neutron.dex.MultiHopRoute: + neutron.dex.MsgCancelLimitOrder: properties: - hops: + creator: + type: string + tranche_key: + type: string + type: object + neutron.dex.MsgCancelLimitOrderResponse: + properties: + maker_coin_out: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of maker reserves that were canceled + taker_coin_out: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of taker reserves that were withdrawn + type: object + neutron.dex.MsgDeposit: + properties: + amounts_a: items: type: string type: array - type: object - neutron.dex.PairID: - properties: - token0: + amounts_b: + items: + type: string + type: array + creator: type: string - token1: + fees: + items: + format: uint64 + type: string + type: array + options: + items: + properties: + disable_autoswap: + type: boolean + fail_tx_on_bel: + type: boolean + type: object + type: array + receiver: + type: string + tick_indexes_a_to_b: + items: + format: int64 + type: string + type: array + token_a: + type: string + token_b: type: string type: object - neutron.dex.Params: - description: Params defines the parameters for the module. + neutron.dex.MsgDepositResponse: properties: - fee_tiers: + failed_deposits: + items: + properties: + deposit_idx: + format: uint64 + type: string + error: + type: string + type: object + type: array + reserve0_deposited: items: - format: uint64 type: string type: array - good_til_purge_allowance: - format: uint64 + reserve1_deposited: + items: + type: string + type: array + shares_issued: + items: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array + type: object + neutron.dex.MsgMultiHopSwap: + properties: + amount_in: type: string - max_jits_per_block: - format: uint64 + creator: type: string - paused: + exit_limit_price: + type: string + pick_best_route: + description: >- + If pickBestRoute == true then all routes are run and the route with + the + + best price is chosen otherwise, the first succesful route is used. type: boolean + receiver: + type: string + routes: + items: + properties: + hops: + items: + type: string + type: array + type: object + type: array type: object - neutron.dex.Pool: + neutron.dex.MsgMultiHopSwapResponse: properties: - id: - format: uint64 - type: string - lower_tick0: + coin_out: + description: |- + 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. properties: - key: - properties: - fee: - format: uint64 - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: + amount: type: string - reserves_maker_denom: + denom: type: string type: object - upper_tick1: + dust: + items: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array + route: properties: - key: - properties: - fee: - format: uint64 - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: - type: string - reserves_maker_denom: - type: string + hops: + items: + type: string + type: array type: object type: object - neutron.dex.PoolMetadata: + neutron.dex.MsgPlaceLimitOrder: properties: - fee: - format: uint64 - type: string - id: - format: uint64 + amount_in: type: string - pair_id: - properties: - token0: - type: string - token1: - type: string - type: object - tick: - format: int64 + creator: + type: string + expiration_time: + description: expirationTime is only valid iff orderType == GOOD_TIL_TIME. + format: date-time + type: string + limit_sell_price: + type: string + max_amount_out: + type: string + min_average_sell_price: + title: >- + min_average_sell_price is an optional parameter that sets a required + minimum average price for the entire trade. + + if the min_average_sell_price is not met the trade will fail. + + If min_average_sell_price is omitted limit_sell_price will be used + instead + type: string + order_type: + default: GOOD_TIL_CANCELLED + enum: + - GOOD_TIL_CANCELLED + - FILL_OR_KILL + - IMMEDIATE_OR_CANCEL + - JUST_IN_TIME + - GOOD_TIL_TIME + type: string + receiver: + type: string + tick_index_in_to_out: + description: >- + DEPRECATED: tick_index_in_to_out will be removed in future release; + limit_sell_price should be used instead. + format: int64 + type: string + token_in: + type: string + token_out: + type: string + type: object + neutron.dex.MsgPlaceLimitOrderResponse: + properties: + coin_in: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of coin used for the limit order + taker_coin_in: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + Total amount of the token in that was immediately swapped for + takerOutCoin + taker_coin_out: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + Total amount of coin received from the taker portion of the limit + order + + This is the amount of coin immediately available in the users account + after + + executing the limit order. It does not include any future proceeds + from the + + maker portion which will have withdrawn in the future + trancheKey: + type: string + type: object + neutron.dex.MsgWithdrawFilledLimitOrder: + properties: + creator: + type: string + tranche_key: + type: string + type: object + neutron.dex.MsgWithdrawFilledLimitOrderResponse: + properties: + maker_coin_out: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + Total amount of maker reserves that were withdrawn --only applies to + inactive LimitOrders + taker_coin_out: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of taker reserves that were withdrawn + type: object + neutron.dex.MsgWithdrawal: + properties: + creator: + type: string + fees: + items: + format: uint64 + type: string + type: array + receiver: + type: string + shares_to_remove: + items: + type: string + type: array + tick_indexes_a_to_b: + items: + format: int64 + type: string + type: array + token_a: + type: string + token_b: + type: string + type: object + neutron.dex.MsgWithdrawalResponse: + properties: + reserve0_withdrawn: + type: string + reserve1_withdrawn: + type: string + shares_burned: + items: + description: |- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array + type: object + neutron.dex.MultiHopRoute: + properties: + hops: + items: + type: string + type: array + type: object + neutron.dex.PairID: + properties: + token0: + type: string + token1: + type: string + type: object + neutron.dex.Params: + description: Params defines the parameters for the module. + properties: + fee_tiers: + items: + format: uint64 + type: string + type: array + good_til_purge_allowance: + format: uint64 + type: string + max_jits_per_block: + format: uint64 + type: string + paused: + type: boolean + type: object + neutron.dex.Pool: + properties: + id: + format: uint64 + type: string + lower_tick0: + properties: + key: + properties: + fee: + format: uint64 + type: string + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The actual + field value is unused. + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + type: object + upper_tick1: + properties: + key: + properties: + fee: + format: uint64 + type: string + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The actual + field value is unused. + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + type: object + type: object + neutron.dex.PoolMetadata: + properties: + fee: + format: uint64 + type: string + id: + format: uint64 + type: string + pair_id: + properties: + token0: + type: string + token1: + type: string + type: object + tick: + format: int64 type: string type: object neutron.dex.PoolReserves: @@ -16011,9 +16525,23 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal implementation + detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The actual + field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future release, + `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16066,7 +16594,16 @@ definitions: tranche_key: type: string type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB + ) + type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16137,7 +16674,16 @@ definitions: tranche_key: type: string type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB + ) + type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16193,6 +16739,7 @@ definitions: - GOOD_TIL_TIME type: string shares_cancelled: + title: 'TODO: remove this in next release. It is no longer used' type: string shares_owned: type: string @@ -16256,6 +16803,7 @@ definitions: - GOOD_TIL_TIME type: string shares_cancelled: + title: 'TODO: remove this in next release. It is no longer used' type: string shares_owned: type: string @@ -16399,9 +16947,24 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is worth + 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The + actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16468,7 +17031,16 @@ definitions: tranche_key: type: string type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) + type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16497,9 +17069,25 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. + + It is being kept strictly for backwards compatibility. The + actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16551,9 +17139,25 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 + is worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. + + It is being kept strictly for backwards compatibility. + The actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16576,9 +17180,25 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 + is worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. + + It is being kept strictly for backwards compatibility. + The actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16723,7 +17343,15 @@ definitions: tranche_key: type: string type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16766,7 +17394,15 @@ definitions: tranche_key: type: string type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16794,6 +17430,7 @@ definitions: - GOOD_TIL_TIME type: string shares_cancelled: + title: 'TODO: remove this in next release. It is no longer used' type: string shares_owned: type: string @@ -16857,9 +17494,23 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The actual + field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -16911,38 +17562,327 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The + actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + type: object + upper_tick1: + properties: + key: + properties: + fee: + format: uint64 + type: string + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) + type: string + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The + actual field value is unused. + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + type: object + type: object + type: object + neutron.dex.QuerySimulateCancelLimitOrderResponse: + properties: + resp: + properties: + maker_coin_out: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of maker reserves that were canceled + taker_coin_out: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of taker reserves that were withdrawn + type: object + type: object + neutron.dex.QuerySimulateDepositResponse: + properties: + resp: + properties: + failed_deposits: + items: + properties: + deposit_idx: + format: uint64 + type: string + error: + type: string + type: object + type: array + reserve0_deposited: + items: + type: string + type: array + reserve1_deposited: + items: + type: string + type: array + shares_issued: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array + type: object + type: object + neutron.dex.QuerySimulateMultiHopSwapResponse: + properties: + resp: + properties: + coin_out: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + dust: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array + route: + properties: + hops: + items: + type: string + type: array + type: object + type: object + type: object + neutron.dex.QuerySimulatePlaceLimitOrderResponse: + properties: + resp: + properties: + coin_in: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of coin used for the limit order + taker_coin_in: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + Total amount of the token in that was immediately swapped for + takerOutCoin + taker_coin_out: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + Total amount of coin received from the taker portion of the limit + order + + This is the amount of coin immediately available in the users + account after + + executing the limit order. It does not include any future proceeds + from the + + maker portion which will have withdrawn in the future + trancheKey: + type: string + type: object + type: object + neutron.dex.QuerySimulateWithdrawFilledLimitOrderResponse: + properties: + resp: + properties: + maker_coin_out: + description: >- + 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. + properties: + amount: type: string - reserves_maker_denom: + denom: type: string type: object - upper_tick1: + title: >- + Total amount of maker reserves that were withdrawn --only applies + to inactive LimitOrders + taker_coin_out: + description: >- + 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. properties: - key: - properties: - fee: - format: uint64 - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: + amount: type: string - reserves_maker_denom: + denom: type: string type: object + title: Total amount of taker reserves that were withdrawn + type: object + type: object + neutron.dex.QuerySimulateWithdrawalResponse: + properties: + resp: + properties: + reserve0_withdrawn: + type: string + reserve1_withdrawn: + type: string + shares_burned: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array type: object type: object neutron.dex.TickLiquidity: @@ -16976,7 +17916,15 @@ definitions: tranche_key: type: string type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -17005,9 +17953,23 @@ definitions: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the opposite + token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future release. + + It is being kept strictly for backwards compatibility. The actual + field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -17495,6 +18457,22 @@ definitions: type: object type: object type: object + neutron.ibcratelimit.v1beta1.Params: + description: Params defines the parameters for the ibc-rate-limit module. + properties: + contract_address: + type: string + type: object + neutron.ibcratelimit.v1beta1.QueryParamsResponse: + description: aramsResponse is the response type for the Query/Params RPC method. + properties: + params: + description: params defines the parameters of the module. + properties: + contract_address: + type: string + type: object + type: object neutron.interchainqueries.Block: properties: header: @@ -17647,6 +18625,16 @@ definitions: neutron.interchainqueries.Params: description: Params defines the parameters for the module. properties: + max_kv_query_keys_count: + format: uint64 + title: Maximum amount of keys in a registered key value query + type: string + max_transactions_filters: + format: uint64 + title: >- + max_transactions_filters defines maximum allowed amount of tx filters + in msgRegisterInterchainQuery + type: string query_deposit: description: Amount of coins deposited for the query. items: @@ -17692,6 +18680,16 @@ definitions: params: description: params holds all the parameters of this module. properties: + max_kv_query_keys_count: + format: uint64 + title: Maximum amount of keys in a registered key value query + type: string + max_transactions_filters: + format: uint64 + title: >- + max_transactions_filters defines maximum allowed amount of tx + filters in msgRegisterInterchainQuery + type: string query_deposit: description: Amount of coins deposited for the query. items: @@ -18726,7 +19724,7 @@ definitions: osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse: description: |- QueryBeforeSendHookAddressResponse defines the response structure for the - DenomBeforeSendHook gRPC query. + BeforeSendHookAddress gRPC query. properties: contract_addr: type: string @@ -18761,6 +19759,14 @@ definitions: type: string type: array type: object + osmosis.tokenfactory.v1beta1.QueryFullDenomResponse: + description: |- + QueryFullDenomResponse defines the response structure for the + FullDenom gRPC query. + properties: + full_denom: + type: string + type: object osmosis.tokenfactory.v1beta1.QueryParamsResponse: description: QueryParamsResponse is the response type for the Query/Params RPC method. properties: @@ -23472,7 +24478,7 @@ definitions: type: object info: title: Neutron - version: v4 + version: v5 paths: /block-sdk/auction/v1/params: get: @@ -36194,22 +37200,209 @@ paths: type: array raw_log: description: >- - The output of the application's logger (raw string). May - be + The output of the application's logger (raw string). May + be + + non-deterministic. + type: string + timestamp: + description: >- + Time of the previous block. For heights > 1, it's the + weighted median of + + the timestamps of the valid votes in the block.LastCommit. + For height == 1, + + it's genesis time. + type: string + tx: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + description: The request transaction bytes. + txhash: + description: The transaction hash. + type: string + type: object + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: GetTx fetches a tx by hash. + tags: + - Service + /cosmos/upgrade/v1beta1/applied_plan/{name}: + get: + operationId: AppliedPlan + parameters: + - description: name is the name of the applied plan to query for. + in: path + name: name + required: true + type: string + responses: + '200': + description: A successful response. + schema: + description: >- + QueryAppliedPlanResponse is the response type for the + Query/AppliedPlan RPC + + method. + properties: + height: + description: height is the block height at which the plan was applied. + format: int64 + type: string + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: AppliedPlan queries a previously applied upgrade plan by its name. + tags: + - Query + /cosmos/upgrade/v1beta1/authority: + get: + description: 'Since: cosmos-sdk 0.46' + operationId: Authority + responses: + '200': + description: A successful response. + schema: + description: 'Since: cosmos-sdk 0.46' + properties: + address: + type: string + title: QueryAuthorityResponse is the response type for Query/Authority + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: Returns the account with authority to conduct upgrades + tags: + - Query + /cosmos/upgrade/v1beta1/current_plan: + get: + operationId: CurrentPlan + responses: + '200': + description: A successful response. + schema: + description: >- + QueryCurrentPlanResponse is the response type for the + Query/CurrentPlan RPC + + method. + properties: + plan: + description: plan is the current upgrade plan. + properties: + height: + description: The height at which the upgrade must be performed. + format: int64 + type: string + info: + title: >- + Any application specific upgrade info to be included + on-chain + + such as a git commit that validators could automatically + upgrade to + type: string + name: + description: >- + Sets the name for the upgrade. This name will be used by + the upgraded - non-deterministic. + version of the software to apply any special "on-upgrade" + commands during + + the first BeginBlock method after the upgrade is applied. + It is also used + + to detect whether a software version can handle a given + upgrade. If no + + upgrade handler with this name has been set in the + software, it will be + + assumed that the software is out-of-date when the upgrade + Time or Height is + + reached and the software will exit. type: string - timestamp: + time: description: >- - Time of the previous block. For heights > 1, it's the - weighted median of + Deprecated: Time based upgrades have been deprecated. Time + based upgrade logic - the timestamps of the valid votes in the block.LastCommit. - For height == 1, + has been removed from the SDK. - it's genesis time. + If this field is not empty, an error will be thrown. + format: date-time type: string - tx: + upgraded_client_state: properties: type_url: type: string @@ -36217,10 +37410,13 @@ paths: format: byte type: string type: object - description: The request transaction bytes. - txhash: - description: The transaction hash. - type: string + description: >- + Deprecated: UpgradedClientState field has been deprecated. + IBC upgrade logic has been + + moved to the IBC module in the sub module 02-client. + + If this field is not empty, an error will be thrown. type: object type: object default: @@ -36245,16 +37441,90 @@ paths: message: type: string type: object - summary: GetTx fetches a tx by hash. + summary: CurrentPlan queries the current upgrade plan. tags: - - Service - /cosmos/upgrade/v1beta1/applied_plan/{name}: + - Query + /cosmos/upgrade/v1beta1/module_versions: get: - operationId: AppliedPlan + description: 'Since: cosmos-sdk 0.43' + operationId: ModuleVersions parameters: - - description: name is the name of the applied plan to query for. + - description: |- + module_name is a field to query a specific module + consensus version from state. Leaving this empty will + fetch the full list of module versions from state. + in: query + name: module_name + required: false + type: string + responses: + '200': + description: A successful response. + schema: + description: >- + QueryModuleVersionsResponse is the response type for the + Query/ModuleVersions + + RPC method. + + + Since: cosmos-sdk 0.43 + properties: + module_versions: + description: >- + module_versions is a list of module names with their consensus + versions. + items: + description: |- + ModuleVersion specifies a module and its consensus version. + + Since: cosmos-sdk 0.43 + properties: + name: + title: name of the app module + type: string + version: + format: uint64 + title: consensus version of the app module + type: string + type: object + type: array + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: ModuleVersions queries the list of module versions from state. + tags: + - Query + /cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}: + get: + operationId: UpgradedConsensusState + parameters: + - description: |- + last height of the current chain must be sent in request + as this is the height under which next consensus state is stored + format: int64 in: path - name: name + name: last_height required: true type: string responses: @@ -36262,54 +37532,185 @@ paths: description: A successful response. schema: description: >- - QueryAppliedPlanResponse is the response type for the - Query/AppliedPlan RPC + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState - method. + RPC method. properties: - height: - description: height is the block height at which the plan was applied. - format: int64 + upgraded_consensus_state: + format: byte + title: 'Since: cosmos-sdk 0.43' type: string type: object default: description: An unexpected error response. schema: properties: - code: - format: int32 - type: integer - details: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: >- + UpgradedConsensusState queries the consensus state that will serve + + as a trusted kernel for the next version of this chain. It will only be + + stored at the last height of this chain. + + UpgradedConsensusState RPC not supported with legacy querier + + This rpc is deprecated now that IBC has its own replacement + + (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + tags: + - Query + /cosmwasm/wasm/v1/code: + get: + operationId: Codes + parameters: + - description: |- + 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. + format: byte + in: query + name: pagination.key + required: false + type: string + - description: >- + 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. + format: uint64 + in: query + name: pagination.offset + required: false + type: string + - description: >- + 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. + format: uint64 + in: query + name: pagination.limit + required: false + type: string + - description: >- + 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. + in: query + name: pagination.count_total + required: false + type: boolean + - description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + name: pagination.reverse + required: false + type: boolean + responses: + '200': + description: A successful response. + schema: + properties: + code_infos: items: properties: - type_url: + code_id: + format: uint64 type: string - value: + creator: + type: string + data_hash: format: byte type: string + instantiate_permission: + description: AccessConfig access control type. + properties: + addresses: + items: + type: string + type: array + permission: + default: ACCESS_TYPE_UNSPECIFIED + description: >- + - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified + placeholder for empty value + - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden + - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted + - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses + enum: + - ACCESS_TYPE_UNSPECIFIED + - ACCESS_TYPE_NOBODY + - ACCESS_TYPE_EVERYBODY + - ACCESS_TYPE_ANY_OF_ADDRESSES + title: AccessType permission types + type: string + type: object + title: CodeInfoResponse contains code meta data from CodeInfo type: object type: array - error: - type: string - message: - type: string - type: object - summary: AppliedPlan queries a previously applied upgrade plan by its name. - tags: - - Query - /cosmos/upgrade/v1beta1/authority: - get: - description: 'Since: cosmos-sdk 0.46' - operationId: Authority - responses: - '200': - description: A successful response. - schema: - description: 'Since: cosmos-sdk 0.46' - properties: - address: - type: string - title: QueryAuthorityResponse is the response type for Query/Authority + pagination: + description: >- + 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; + } + properties: + next_key: + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + format: byte + type: string + total: + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + type: string + type: object + title: >- + QueryCodesResponse is the response type for the Query/Codes RPC + method type: object default: description: An unexpected error response. @@ -36333,85 +37734,64 @@ paths: message: type: string type: object - summary: Returns the account with authority to conduct upgrades + summary: Codes gets the metadata for all stored wasm codes tags: - Query - /cosmos/upgrade/v1beta1/current_plan: + /cosmwasm/wasm/v1/code/{code_id}: get: - operationId: CurrentPlan + operationId: Code + parameters: + - format: uint64 + in: path + name: code_id + required: true + type: string responses: '200': description: A successful response. schema: - description: >- - QueryCurrentPlanResponse is the response type for the - Query/CurrentPlan RPC - - method. properties: - plan: - description: plan is the current upgrade plan. + code_info: properties: - height: - description: The height at which the upgrade must be performed. - format: int64 - type: string - info: - title: >- - Any application specific upgrade info to be included - on-chain - - such as a git commit that validators could automatically - upgrade to + code_id: + format: uint64 type: string - name: - description: >- - Sets the name for the upgrade. This name will be used by - the upgraded - - version of the software to apply any special "on-upgrade" - commands during - - the first BeginBlock method after the upgrade is applied. - It is also used - - to detect whether a software version can handle a given - upgrade. If no - - upgrade handler with this name has been set in the - software, it will be - - assumed that the software is out-of-date when the upgrade - Time or Height is - - reached and the software will exit. + creator: type: string - time: - description: >- - Deprecated: Time based upgrades have been deprecated. Time - based upgrade logic - - has been removed from the SDK. - - If this field is not empty, an error will be thrown. - format: date-time + data_hash: + format: byte type: string - upgraded_client_state: + instantiate_permission: + description: AccessConfig access control type. properties: - type_url: - type: string - value: - format: byte + addresses: + items: + type: string + type: array + permission: + default: ACCESS_TYPE_UNSPECIFIED + description: >- + - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified + placeholder for empty value + - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden + - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted + - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses + enum: + - ACCESS_TYPE_UNSPECIFIED + - ACCESS_TYPE_NOBODY + - ACCESS_TYPE_EVERYBODY + - ACCESS_TYPE_ANY_OF_ADDRESSES + title: AccessType permission types type: string type: object - description: >- - Deprecated: UpgradedClientState field has been deprecated. - IBC upgrade logic has been - - moved to the IBC module in the sub module 02-client. - - If this field is not empty, an error will be thrown. + title: CodeInfoResponse contains code meta data from CodeInfo type: object + data: + format: byte + type: string + title: >- + QueryCodeResponse is the response type for the Query/Code RPC + method type: object default: description: An unexpected error response. @@ -36435,54 +37815,115 @@ paths: message: type: string type: object - summary: CurrentPlan queries the current upgrade plan. + summary: Code gets the binary code and metadata for a singe wasm code tags: - Query - /cosmos/upgrade/v1beta1/module_versions: + /cosmwasm/wasm/v1/code/{code_id}/contracts: get: - description: 'Since: cosmos-sdk 0.43' - operationId: ModuleVersions + operationId: ContractsByCode parameters: + - format: uint64 + in: path + name: code_id + required: true + type: string - description: |- - module_name is a field to query a specific module - consensus version from state. Leaving this empty will - fetch the full list of module versions from state. + 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. + format: byte + in: query + name: pagination.key + required: false + type: string + - description: >- + 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. + format: uint64 + in: query + name: pagination.offset + required: false + type: string + - description: >- + 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. + format: uint64 + in: query + name: pagination.limit + required: false + type: string + - description: >- + 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. + in: query + name: pagination.count_total + required: false + type: boolean + - description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 in: query - name: module_name + name: pagination.reverse required: false - type: string + type: boolean responses: '200': description: A successful response. schema: - description: >- - QueryModuleVersionsResponse is the response type for the - Query/ModuleVersions - - RPC method. - - - Since: cosmos-sdk 0.43 properties: - module_versions: - description: >- - module_versions is a list of module names with their consensus - versions. + contracts: items: - description: |- - ModuleVersion specifies a module and its consensus version. - - Since: cosmos-sdk 0.43 - properties: - name: - title: name of the app module - type: string - version: - format: uint64 - title: consensus version of the app module - type: string - type: object + type: string + title: contracts are a set of contract addresses type: array + pagination: + description: >- + 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; + } + properties: + next_key: + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + format: byte + type: string + total: + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + type: string + type: object + title: |- + QueryContractsByCodeResponse is the response type for the + Query/ContractsByCode RPC method type: object default: description: An unexpected error response. @@ -36506,35 +37947,62 @@ paths: message: type: string type: object - summary: ModuleVersions queries the list of module versions from state. + summary: ContractsByCode lists all smart contracts for a code id tags: - Query - /cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}: + /cosmwasm/wasm/v1/codes/params: get: - operationId: UpgradedConsensusState - parameters: - - description: |- - last height of the current chain must be sent in request - as this is the height under which next consensus state is stored - format: int64 - in: path - name: last_height - required: true - type: string + operationId: Params responses: '200': description: A successful response. schema: description: >- - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState - - RPC method. + QueryParamsResponse is the response type for the Query/Params RPC + method. properties: - upgraded_consensus_state: - format: byte - title: 'Since: cosmos-sdk 0.43' - type: string + params: + description: params defines the parameters of the module. + properties: + code_upload_access: + description: AccessConfig access control type. + properties: + addresses: + items: + type: string + type: array + permission: + default: ACCESS_TYPE_UNSPECIFIED + description: >- + - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified + placeholder for empty value + - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden + - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted + - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses + enum: + - ACCESS_TYPE_UNSPECIFIED + - ACCESS_TYPE_NOBODY + - ACCESS_TYPE_EVERYBODY + - ACCESS_TYPE_ANY_OF_ADDRESSES + title: AccessType permission types + type: string + type: object + instantiate_default_permission: + default: ACCESS_TYPE_UNSPECIFIED + description: >- + - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified + placeholder for empty value + - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden + - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted + - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses + enum: + - ACCESS_TYPE_UNSPECIFIED + - ACCESS_TYPE_NOBODY + - ACCESS_TYPE_EVERYBODY + - ACCESS_TYPE_ANY_OF_ADDRESSES + title: AccessType permission types + type: string + type: object type: object default: description: An unexpected error response. @@ -36558,23 +38026,12 @@ paths: message: type: string type: object - summary: >- - UpgradedConsensusState queries the consensus state that will serve - - as a trusted kernel for the next version of this chain. It will only be - - stored at the last height of this chain. - - UpgradedConsensusState RPC not supported with legacy querier - - This rpc is deprecated now that IBC has its own replacement - - (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + summary: Params gets the module params tags: - Query - /cosmwasm/wasm/v1/code: + /cosmwasm/wasm/v1/codes/pinned: get: - operationId: Codes + operationId: PinnedCodes parameters: - description: |- key is a value returned in PageResponse.next_key to begin @@ -36637,42 +38094,10 @@ paths: description: A successful response. schema: properties: - code_infos: + code_ids: items: - properties: - code_id: - format: uint64 - type: string - creator: - type: string - data_hash: - format: byte - type: string - instantiate_permission: - description: AccessConfig access control type. - properties: - addresses: - items: - type: string - type: array - permission: - default: ACCESS_TYPE_UNSPECIFIED - description: >- - - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified - placeholder for empty value - - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden - - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted - - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses - enum: - - ACCESS_TYPE_UNSPECIFIED - - ACCESS_TYPE_NOBODY - - ACCESS_TYPE_EVERYBODY - - ACCESS_TYPE_ANY_OF_ADDRESSES - title: AccessType permission types - type: string - type: object - title: CodeInfoResponse contains code meta data from CodeInfo - type: object + format: uint64 + type: string type: array pagination: description: >- @@ -36681,30 +38106,98 @@ paths: corresponding request message has used PageRequest. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - properties: - next_key: - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - format: byte - type: string - total: - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + properties: + next_key: + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + format: byte + type: string + total: + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + type: string + type: object + title: |- + QueryPinnedCodesResponse is the response type for the + Query/PinnedCodes RPC method + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: PinnedCodes gets the pinned code ids + tags: + - Query + /cosmwasm/wasm/v1/contract/build_address: + get: + operationId: BuildAddress + parameters: + - description: CodeHash is the hash of the code. + in: query + name: code_hash + required: false + type: string + - description: CreatorAddress is the address of the contract instantiator. + in: query + name: creator_address + required: false + type: string + - description: Salt is a hex encoded salt. + in: query + name: salt + required: false + type: string + - description: >- + InitArgs are optional json encoded init args to be used in contract + address + + building if provided. + format: byte + in: query + name: init_args + required: false + type: string + responses: + '200': + description: A successful response. + schema: + description: >- + QueryBuildAddressResponse is the response type for the + Query/BuildAddress RPC - was set, its value is undefined otherwise - type: string - type: object - title: >- - QueryCodesResponse is the response type for the Query/Codes RPC - method + method. + properties: + address: + title: Address is the contract address + type: string type: object default: description: An unexpected error response. @@ -36728,16 +38221,16 @@ paths: message: type: string type: object - summary: Codes gets the metadata for all stored wasm codes + summary: BuildAddress builds a contract address tags: - Query - /cosmwasm/wasm/v1/code/{code_id}: + /cosmwasm/wasm/v1/contract/{address}: get: - operationId: Code + operationId: ContractInfo parameters: - - format: uint64 + - description: address is the address of the contract to query in: path - name: code_id + name: address required: true type: string responses: @@ -36745,46 +38238,63 @@ paths: description: A successful response. schema: properties: - code_info: + address: + title: address is the address of the contract + type: string + contract_info: properties: + admin: + title: Admin is an optional address that can execute migrations + type: string code_id: format: uint64 + title: CodeID is the reference to the stored Wasm code type: string + created: + description: Created Tx position when the contract was instantiated. + properties: + block_height: + format: uint64 + title: BlockHeight is the block the contract was created at + type: string + tx_index: + format: uint64 + title: >- + TxIndex is a monotonic counter within the block + (actual transaction index, + + or gas consumed) + type: string + type: object creator: + title: Creator address who initially instantiated the contract type: string - data_hash: - format: byte - type: string - instantiate_permission: - description: AccessConfig access control type. + extension: properties: - addresses: - items: - type: string - type: array - permission: - default: ACCESS_TYPE_UNSPECIFIED - description: >- - - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified - placeholder for empty value - - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden - - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted - - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses - enum: - - ACCESS_TYPE_UNSPECIFIED - - ACCESS_TYPE_NOBODY - - ACCESS_TYPE_EVERYBODY - - ACCESS_TYPE_ANY_OF_ADDRESSES - title: AccessType permission types + type_url: + type: string + value: + format: byte type: string type: object - title: CodeInfoResponse contains code meta data from CodeInfo + description: >- + Extension is an extension point to store custom metadata + within the + + persistence model. + ibc_port_id: + type: string + label: + description: >- + Label is optional metadata to be stored with a contract + instance. + type: string + title: ContractInfo stores a WASM contract instance type: object - data: - format: byte - type: string title: >- - QueryCodeResponse is the response type for the Query/Code RPC + QueryContractInfoResponse is the response type for the + Query/ContractInfo RPC + method type: object default: @@ -36809,16 +38319,16 @@ paths: message: type: string type: object - summary: Code gets the binary code and metadata for a singe wasm code + summary: ContractInfo gets the contract meta data tags: - Query - /cosmwasm/wasm/v1/code/{code_id}/contracts: + /cosmwasm/wasm/v1/contract/{address}/history: get: - operationId: ContractsByCode + operationId: ContractHistory parameters: - - format: uint64 + - description: address is the address of the contract to query in: path - name: code_id + name: address required: true type: string - description: |- @@ -36882,10 +38392,52 @@ paths: description: A successful response. schema: properties: - contracts: + entries: items: - type: string - title: contracts are a set of contract addresses + description: ContractCodeHistoryEntry metadata to a contract. + properties: + code_id: + format: uint64 + title: CodeID is the reference to the stored WASM code + type: string + msg: + format: byte + type: string + operation: + default: CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED + description: >- + - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: + ContractCodeHistoryOperationTypeUnspecified placeholder + for empty value + - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: ContractCodeHistoryOperationTypeInit on chain contract instantiation + - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: ContractCodeHistoryOperationTypeMigrate code migration + - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: ContractCodeHistoryOperationTypeGenesis based on genesis data + enum: + - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED + - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT + - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE + - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS + title: >- + ContractCodeHistoryOperationType actions that caused a + code change + type: string + updated: + description: Updated Tx position when the operation was executed. + properties: + block_height: + format: uint64 + title: BlockHeight is the block the contract was created at + type: string + tx_index: + format: uint64 + title: >- + TxIndex is a monotonic counter within the block + (actual transaction index, + + or gas consumed) + type: string + type: object + type: object type: array pagination: description: >- @@ -36916,8 +38468,8 @@ paths: type: string type: object title: |- - QueryContractsByCodeResponse is the response type for the - Query/ContractsByCode RPC method + QueryContractHistoryResponse is the response type for the + Query/ContractHistory RPC method type: object default: description: An unexpected error response. @@ -36941,62 +38493,88 @@ paths: message: type: string type: object - summary: ContractsByCode lists all smart contracts for a code id + summary: ContractHistory gets the contract code history tags: - Query - /cosmwasm/wasm/v1/codes/params: + /cosmwasm/wasm/v1/contract/{address}/raw/{query_data}: get: - operationId: Params + operationId: RawContractState + parameters: + - description: address is the address of the contract + in: path + name: address + required: true + type: string + - format: byte + in: path + name: query_data + required: true + type: string + responses: + '200': + description: A successful response. + schema: + properties: + data: + format: byte + title: Data contains the raw store data + type: string + title: |- + QueryRawContractStateResponse is the response type for the + Query/RawContractState RPC method + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: RawContractState gets single key from the raw store data of a contract + tags: + - Query + /cosmwasm/wasm/v1/contract/{address}/smart/{query_data}: + get: + operationId: SmartContractState + parameters: + - description: address is the address of the contract + in: path + name: address + required: true + type: string + - description: QueryData contains the query data passed to the contract + format: byte + in: path + name: query_data + required: true + type: string responses: '200': description: A successful response. schema: - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. properties: - params: - description: params defines the parameters of the module. - properties: - code_upload_access: - description: AccessConfig access control type. - properties: - addresses: - items: - type: string - type: array - permission: - default: ACCESS_TYPE_UNSPECIFIED - description: >- - - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified - placeholder for empty value - - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden - - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted - - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses - enum: - - ACCESS_TYPE_UNSPECIFIED - - ACCESS_TYPE_NOBODY - - ACCESS_TYPE_EVERYBODY - - ACCESS_TYPE_ANY_OF_ADDRESSES - title: AccessType permission types - type: string - type: object - instantiate_default_permission: - default: ACCESS_TYPE_UNSPECIFIED - description: >- - - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified - placeholder for empty value - - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden - - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted - - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses - enum: - - ACCESS_TYPE_UNSPECIFIED - - ACCESS_TYPE_NOBODY - - ACCESS_TYPE_EVERYBODY - - ACCESS_TYPE_ANY_OF_ADDRESSES - title: AccessType permission types - type: string - type: object + data: + format: byte + title: Data contains the json data returned from the smart contract + type: string + title: |- + QuerySmartContractStateResponse is the response type for the + Query/SmartContractState RPC method type: object default: description: An unexpected error response. @@ -37020,13 +38598,18 @@ paths: message: type: string type: object - summary: Params gets the module params + summary: SmartContractState get smart query result from the contract tags: - Query - /cosmwasm/wasm/v1/codes/pinned: + /cosmwasm/wasm/v1/contract/{address}/state: get: - operationId: PinnedCodes + operationId: AllContractState parameters: + - description: address is the address of the contract + in: path + name: address + required: true + type: string - description: |- key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key @@ -37088,10 +38671,19 @@ paths: description: A successful response. schema: properties: - code_ids: + models: items: - format: uint64 - type: string + properties: + key: + format: byte + title: hex-encode key to read it better (this is often ascii) + type: string + value: + format: byte + title: base64-encode raw value + type: string + title: Model is a struct that holds a KV pair + type: object type: array pagination: description: >- @@ -37118,178 +38710,12 @@ paths: total is total number of results available if PageRequest.count_total - was set, its value is undefined otherwise - type: string - type: object - title: |- - QueryPinnedCodesResponse is the response type for the - Query/PinnedCodes RPC method - type: object - default: - description: An unexpected error response. - schema: - properties: - code: - format: int32 - type: integer - details: - items: - properties: - type_url: - type: string - value: - format: byte - type: string - type: object - type: array - error: - type: string - message: - type: string - type: object - summary: PinnedCodes gets the pinned code ids - tags: - - Query - /cosmwasm/wasm/v1/contract/build_address: - get: - operationId: BuildAddress - parameters: - - description: CodeHash is the hash of the code. - in: query - name: code_hash - required: false - type: string - - description: CreatorAddress is the address of the contract instantiator. - in: query - name: creator_address - required: false - type: string - - description: Salt is a hex encoded salt. - in: query - name: salt - required: false - type: string - - description: >- - InitArgs are optional json encoded init args to be used in contract - address - - building if provided. - format: byte - in: query - name: init_args - required: false - type: string - responses: - '200': - description: A successful response. - schema: - description: >- - QueryBuildAddressResponse is the response type for the - Query/BuildAddress RPC - - method. - properties: - address: - title: Address is the contract address - type: string - type: object - default: - description: An unexpected error response. - schema: - properties: - code: - format: int32 - type: integer - details: - items: - properties: - type_url: - type: string - value: - format: byte - type: string - type: object - type: array - error: - type: string - message: - type: string - type: object - summary: BuildAddress builds a contract address - tags: - - Query - /cosmwasm/wasm/v1/contract/{address}: - get: - operationId: ContractInfo - parameters: - - description: address is the address of the contract to query - in: path - name: address - required: true - type: string - responses: - '200': - description: A successful response. - schema: - properties: - address: - title: address is the address of the contract - type: string - contract_info: - properties: - admin: - title: Admin is an optional address that can execute migrations - type: string - code_id: - format: uint64 - title: CodeID is the reference to the stored Wasm code - type: string - created: - description: Created Tx position when the contract was instantiated. - properties: - block_height: - format: uint64 - title: BlockHeight is the block the contract was created at - type: string - tx_index: - format: uint64 - title: >- - TxIndex is a monotonic counter within the block - (actual transaction index, - - or gas consumed) - type: string - type: object - creator: - title: Creator address who initially instantiated the contract - type: string - extension: - properties: - type_url: - type: string - value: - format: byte - type: string - type: object - description: >- - Extension is an extension point to store custom metadata - within the - - persistence model. - ibc_port_id: - type: string - label: - description: >- - Label is optional metadata to be stored with a contract - instance. - type: string - title: ContractInfo stores a WASM contract instance - type: object - title: >- - QueryContractInfoResponse is the response type for the - Query/ContractInfo RPC - - method + was set, its value is undefined otherwise + type: string + type: object + title: |- + QueryAllContractStateResponse is the response type for the + Query/AllContractState RPC method type: object default: description: An unexpected error response. @@ -37313,16 +38739,16 @@ paths: message: type: string type: object - summary: ContractInfo gets the contract meta data + summary: AllContractState gets all raw store data for a single contract tags: - Query - /cosmwasm/wasm/v1/contract/{address}/history: + /cosmwasm/wasm/v1/contracts/creator/{creator_address}: get: - operationId: ContractHistory + operationId: ContractsByCreator parameters: - - description: address is the address of the contract to query + - description: CreatorAddress is the address of contract creator in: path - name: address + name: creator_address required: true type: string - description: |- @@ -37385,53 +38811,14 @@ paths: '200': description: A successful response. schema: + description: |- + QueryContractsByCreatorResponse is the response type for the + Query/ContractsByCreator RPC method. properties: - entries: + contract_addresses: items: - description: ContractCodeHistoryEntry metadata to a contract. - properties: - code_id: - format: uint64 - title: CodeID is the reference to the stored WASM code - type: string - msg: - format: byte - type: string - operation: - default: CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - description: >- - - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: - ContractCodeHistoryOperationTypeUnspecified placeholder - for empty value - - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: ContractCodeHistoryOperationTypeInit on chain contract instantiation - - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: ContractCodeHistoryOperationTypeMigrate code migration - - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: ContractCodeHistoryOperationTypeGenesis based on genesis data - enum: - - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - title: >- - ContractCodeHistoryOperationType actions that caused a - code change - type: string - updated: - description: Updated Tx position when the operation was executed. - properties: - block_height: - format: uint64 - title: BlockHeight is the block the contract was created at - type: string - tx_index: - format: uint64 - title: >- - TxIndex is a monotonic counter within the block - (actual transaction index, - - or gas consumed) - type: string - type: object - type: object + type: string + title: ContractAddresses result set type: array pagination: description: >- @@ -37461,9 +38848,6 @@ paths: was set, its value is undefined otherwise type: string type: object - title: |- - QueryContractHistoryResponse is the response type for the - Query/ContractHistory RPC method type: object default: description: An unexpected error response. @@ -37487,35 +38871,44 @@ paths: message: type: string type: object - summary: ContractHistory gets the contract code history + summary: ContractsByCreator gets the contracts by creator tags: - Query - /cosmwasm/wasm/v1/contract/{address}/raw/{query_data}: + /feemarket/v1/gas_price/{denom}: get: - operationId: RawContractState + operationId: GasPrice parameters: - - description: address is the address of the contract - in: path - name: address - required: true - type: string - - format: byte + - description: denom we are querying gas price in in: path - name: query_data + name: denom required: true type: string responses: '200': description: A successful response. schema: + description: >- + GasPriceResponse is the response type for the Query/GasPrice RPC + method. + + Returns a gas price in specified denom. properties: - data: - format: byte - title: Data contains the raw store data - type: string - title: |- - QueryRawContractStateResponse is the response type for the - Query/RawContractState RPC method + price: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object type: object default: description: An unexpected error response. @@ -37539,36 +38932,179 @@ paths: message: type: string type: object - summary: RawContractState gets single key from the raw store data of a contract + summary: |- + GasPrice returns the current feemarket module gas price + for specified denom. tags: - Query - /cosmwasm/wasm/v1/contract/{address}/smart/{query_data}: + /feemarket/v1/gas_prices: get: - operationId: SmartContractState - parameters: - - description: address is the address of the contract - in: path - name: address - required: true - type: string - - description: QueryData contains the query data passed to the contract - format: byte - in: path - name: query_data - required: true - type: string + operationId: GasPrices responses: '200': description: A successful response. schema: + description: >- + GasPricesResponse is the response type for the Query/GasPrices RPC + method. + + Returns a gas price in all available denoms. properties: - data: - format: byte - title: Data contains the json data returned from the smart contract + prices: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: type: string - title: |- - QuerySmartContractStateResponse is the response type for the - Query/SmartContractState RPC method + message: + type: string + type: object + summary: |- + GasPrices returns the current feemarket module list of gas prices + in all available denoms. + tags: + - Query + /feemarket/v1/params: + get: + operationId: Params + responses: + '200': + description: A successful response. + schema: + description: >- + ParamsResponse is the response type for the Query/Params RPC + method. + properties: + params: + description: >- + Params contains the required set of parameters for the EIP1559 + fee market + + plugin implementation. + properties: + alpha: + description: >- + Alpha is the amount we additively increase the learning + rate + + when it is above or below the target +/- threshold. + + + Must be > 0. + type: string + beta: + description: >- + Beta is the amount we multiplicatively decrease the + learning rate + + when it is within the target +/- threshold. + + + Must be [0, 1]. + type: string + delta: + description: >- + Delta is the amount we additively increase/decrease the + gas price when the + + net block utilization difference in the window is + above/below the target + + utilization. + type: string + distribute_fees: + description: >- + DistributeFees is a boolean that determines whether the + fees are burned or + + distributed to all stakers. + type: boolean + enabled: + description: >- + Enabled is a boolean that determines whether the EIP1559 + fee market is + + enabled. + type: boolean + fee_denom: + description: >- + FeeDenom is the denom that will be used for all fee + payments. + type: string + gamma: + description: >- + Gamma is the threshold for the learning rate. If the + learning rate is + + above or below the target +/- threshold, we additively + increase the + + learning rate by Alpha. Otherwise, we multiplicatively + decrease the + + learning rate by Beta. + + + Must be [0, 0.5]. + type: string + max_block_utilization: + description: MaxBlockUtilization is the maximum block utilization. + format: uint64 + type: string + max_learning_rate: + description: MaxLearningRate is the upper bound for the learning rate. + type: string + min_base_gas_price: + description: >- + MinBaseGasPrice determines the initial gas price of the + module and the + + global minimum for the network. + type: string + min_learning_rate: + description: MinLearningRate is the lower bound for the learning rate. + type: string + window: + description: >- + Window defines the window size for calculating an adaptive + learning rate + + over a moving window of blocks. + format: uint64 + type: string + type: object type: object default: description: An unexpected error response. @@ -37592,124 +39128,58 @@ paths: message: type: string type: object - summary: SmartContractState get smart query result from the contract + summary: Params returns the current feemarket module parameters. tags: - Query - /cosmwasm/wasm/v1/contract/{address}/state: + /feemarket/v1/state: get: - operationId: AllContractState - parameters: - - description: address is the address of the contract - in: path - name: address - required: true - type: string - - description: |- - 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. - format: byte - in: query - name: pagination.key - required: false - type: string - - description: >- - 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. - format: uint64 - in: query - name: pagination.offset - required: false - type: string - - description: >- - 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. - format: uint64 - in: query - name: pagination.limit - required: false - type: string - - description: >- - 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. - in: query - name: pagination.count_total - required: false - type: boolean - - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - name: pagination.reverse - required: false - type: boolean + operationId: State responses: '200': description: A successful response. schema: + description: StateResponse is the response type for the Query/State RPC method. properties: - models: - items: - properties: - key: - format: byte - title: hex-encode key to read it better (this is often ascii) - type: string - value: - format: byte - title: base64-encode raw value - type: string - title: Model is a struct that holds a KV pair - type: object - type: array - pagination: + state: description: >- - PageResponse is to be embedded in gRPC response messages where - the + State is utilized to track the current state of the fee + market. This includes - corresponding request message has used PageRequest. + the current base fee, learning rate, and block utilization + within the - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } + specified AIMD window. properties: - next_key: - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - format: byte + base_gas_price: + description: >- + BaseGasPrice is the current base fee. This is denominated + in the fee per + + gas unit. type: string - total: + index: + description: >- + Index is the index of the current block in the block + utilization window. format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise type: string + learning_rate: + description: LearningRate is the current learning rate. + type: string + window: + description: >- + Window contains a list of the last blocks' utilization + values. This is used + + to calculate the next base fee. This stores the number of + units of gas + + consumed per block. + items: + format: uint64 + type: string + type: array type: object - title: |- - QueryAllContractStateResponse is the response type for the - Query/AllContractState RPC method type: object default: description: An unexpected error response. @@ -37733,114 +39203,74 @@ paths: message: type: string type: object - summary: AllContractState gets all raw store data for a single contract + summary: State returns the current feemarket module state. tags: - Query - /cosmwasm/wasm/v1/contracts/creator/{creator_address}: + /gaia/globalfee/v1beta1/params: get: - operationId: ContractsByCreator - parameters: - - description: CreatorAddress is the address of contract creator - in: path - name: creator_address - required: true - type: string - - description: |- - 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. - format: byte - in: query - name: pagination.key - required: false - type: string - - description: >- - 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 + operationId: Params + responses: + '200': + description: A successful response. + schema: + description: |- + QueryMinimumGasPricesResponse is the response type for the + Query/MinimumGasPrices RPC method. + properties: + params: + description: Params defines the set of module parameters. + properties: + bypass_min_fee_msg_types: + description: >- + bypass_min_fee_msg_types defines a list of message type + urls - be set. - format: uint64 - in: query - name: pagination.offset - required: false - type: string - - description: >- - limit is the total number of results to be returned in the result - page. + that are free of fee charge. + items: + type: string + type: array + max_total_bypass_min_fee_msg_gas_usage: + description: >- + max_total_bypass_min_fee_msg_gas_usage defines the total + maximum gas usage - If left empty it will default to a value to be set by each app. - format: uint64 - in: query - name: pagination.limit - required: false - type: string - - description: >- - count_total is set to true to indicate that the result set should - include + allowed for a transaction containing only messages of + types in bypass_min_fee_msg_types - a count of the total number of items available for pagination in - UIs. + to bypass fee charge. + format: uint64 + type: string + minimum_gas_prices: + items: + description: >- + DecCoin defines a token with a denomination and a + decimal amount. - count_total is only respected when offset is used. It is ignored - when key - is set. - in: query - name: pagination.count_total - required: false - type: boolean - - description: >- - reverse is set to true if results are to be returned in the - descending order. + NOTE: The amount field is an Dec which implements the + custom method + signatures required by gogoproto. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + minimum_gas_prices stores the minimum gas price(s) for all + TX on the chain. - Since: cosmos-sdk 0.43 - in: query - name: pagination.reverse - required: false - type: boolean - responses: - '200': - description: A successful response. - schema: - description: |- - QueryContractsByCreatorResponse is the response type for the - Query/ContractsByCreator RPC method. - properties: - contract_addresses: - items: - type: string - title: ContractAddresses result set - type: array - pagination: - description: >- - PageResponse is to be embedded in gRPC response messages where - the + When multiple coins are defined then they are accepted + alternatively. - corresponding request message has used PageRequest. + The list must be sorted by denoms asc. No duplicate denoms + or zero amount - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - properties: - next_key: - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - format: byte - type: string - total: - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + values allowed. For more information see - was set, its value is undefined otherwise - type: string + https://docs.cosmos.network/main/modules/auth#concepts + type: array type: object type: object default: @@ -37865,42 +39295,23 @@ paths: message: type: string type: object - summary: ContractsByCreator gets the contracts by creator tags: - Query - /feemarket/v1/gas_price/{denom}: + /ibc/apps/packetforward/v1/params: get: - operationId: GasPrice - parameters: - - description: denom we are querying gas price in - in: path - name: denom - required: true - type: string + operationId: Params responses: '200': description: A successful response. schema: description: >- - GasPriceResponse is the response type for the Query/GasPrice RPC + QueryParamsResponse is the response type for the Query/Params RPC method. - - Returns a gas price in specified denom. properties: - price: - description: >- - 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. + params: + description: params defines the parameters of the module. properties: - amount: - type: string - denom: + fee_percentage: type: string type: object type: object @@ -37926,42 +39337,31 @@ paths: message: type: string type: object - summary: |- - GasPrice returns the current feemarket module gas price - for specified denom. + summary: Params queries all parameters of the packetforward module. tags: - Query - /feemarket/v1/gas_prices: + /ibc/apps/transfer/v1/denom_hashes/{trace}: get: - operationId: GasPrices + operationId: DenomHash + parameters: + - description: The denomination trace ([port_id]/[channel_id])+/[denom] + in: path + name: trace + required: true + type: string responses: '200': description: A successful response. schema: description: >- - GasPricesResponse is the response type for the Query/GasPrices RPC - method. + QueryDenomHashResponse is the response type for the + Query/DenomHash RPC - Returns a gas price in all available denoms. + method. properties: - prices: - items: - description: >- - 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. - properties: - amount: - type: string - denom: - type: string - type: object - type: array + hash: + description: hash (in hex format) of the denomination trace information. + type: string type: object default: description: An unexpected error response. @@ -37985,118 +39385,126 @@ paths: message: type: string type: object - summary: |- - GasPrices returns the current feemarket module list of gas prices - in all available denoms. + summary: DenomHash queries a denomination hash information. tags: - Query - /feemarket/v1/params: + /ibc/apps/transfer/v1/denom_traces: get: - operationId: Params - responses: - '200': - description: A successful response. - schema: - description: >- - ParamsResponse is the response type for the Query/Params RPC - method. - properties: - params: - description: >- - Params contains the required set of parameters for the EIP1559 - fee market - - plugin implementation. - properties: - alpha: - description: >- - Alpha is the amount we additively increase the learning - rate - - when it is above or below the target +/- threshold. - - - Must be > 0. - type: string - beta: - description: >- - Beta is the amount we multiplicatively decrease the - learning rate - - when it is within the target +/- threshold. + operationId: DenomTraces + parameters: + - description: |- + 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. + format: byte + in: query + name: pagination.key + required: false + type: string + - description: >- + 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 - Must be [0, 1]. - type: string - delta: - description: >- - Delta is the amount we additively increase/decrease the - gas price when the + be set. + format: uint64 + in: query + name: pagination.offset + required: false + type: string + - description: >- + limit is the total number of results to be returned in the result + page. - net block utilization difference in the window is - above/below the target + If left empty it will default to a value to be set by each app. + format: uint64 + in: query + name: pagination.limit + required: false + type: string + - description: >- + count_total is set to true to indicate that the result set should + include - utilization. - type: string - distribute_fees: - description: >- - DistributeFees is a boolean that determines whether the - fees are burned or + a count of the total number of items available for pagination in + UIs. - distributed to all stakers. - type: boolean - enabled: - description: >- - Enabled is a boolean that determines whether the EIP1559 - fee market is + count_total is only respected when offset is used. It is ignored + when key - enabled. - type: boolean - fee_denom: - description: >- - FeeDenom is the denom that will be used for all fee - payments. - type: string - gamma: - description: >- - Gamma is the threshold for the learning rate. If the - learning rate is + is set. + in: query + name: pagination.count_total + required: false + type: boolean + - description: >- + reverse is set to true if results are to be returned in the + descending order. - above or below the target +/- threshold, we additively - increase the - learning rate by Alpha. Otherwise, we multiplicatively - decrease the + Since: cosmos-sdk 0.43 + in: query + name: pagination.reverse + required: false + type: boolean + responses: + '200': + description: A successful response. + schema: + description: >- + QueryConnectionsResponse is the response type for the + Query/DenomTraces RPC - learning rate by Beta. + method. + properties: + denom_traces: + description: denom_traces returns all denominations trace information. + items: + description: >- + DenomTrace contains the base denomination for ICS20 fungible + tokens and the + source tracing information path. + properties: + base_denom: + description: base denomination of the relayed fungible token. + type: string + path: + description: >- + path defines the chain of port/channel identifiers used + for tracing the - Must be [0, 0.5]. - type: string - max_block_utilization: - description: MaxBlockUtilization is the maximum block utilization. - format: uint64 - type: string - max_learning_rate: - description: MaxLearningRate is the upper bound for the learning rate. - type: string - min_base_gas_price: - description: >- - MinBaseGasPrice determines the initial gas price of the - module and the + source of the fungible token. + type: string + type: object + type: array + pagination: + description: >- + PageResponse is to be embedded in gRPC response messages where + the - global minimum for the network. - type: string - min_learning_rate: - description: MinLearningRate is the lower bound for the learning rate. - type: string - window: - description: >- - Window defines the window size for calculating an adaptive - learning rate + corresponding request message has used PageRequest. - over a moving window of blocks. + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + properties: + next_key: + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + format: byte + type: string + total: format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise type: string type: object type: object @@ -38122,57 +39530,45 @@ paths: message: type: string type: object - summary: Params returns the current feemarket module parameters. + summary: DenomTraces queries all denomination traces. tags: - Query - /feemarket/v1/state: + /ibc/apps/transfer/v1/denom_traces/{hash}: get: - operationId: State + operationId: DenomTrace + parameters: + - description: >- + hash (in hex format) or denom (full denom with ibc prefix) of the + denomination trace information. + in: path + name: hash + required: true + type: string responses: '200': description: A successful response. schema: - description: StateResponse is the response type for the Query/State RPC method. + description: >- + QueryDenomTraceResponse is the response type for the + Query/DenomTrace RPC + + method. properties: - state: + denom_trace: description: >- - State is utilized to track the current state of the fee - market. This includes - - the current base fee, learning rate, and block utilization - within the - - specified AIMD window. + denom_trace returns the requested denomination trace + information. properties: - base_gas_price: - description: >- - BaseGasPrice is the current base fee. This is denominated - in the fee per - - gas unit. - type: string - index: - description: >- - Index is the index of the current block in the block - utilization window. - format: uint64 - type: string - learning_rate: - description: LearningRate is the current learning rate. + base_denom: + description: base denomination of the relayed fungible token. type: string - window: + path: description: >- - Window contains a list of the last blocks' utilization - values. This is used - - to calculate the next base fee. This stores the number of - units of gas + path defines the chain of port/channel identifiers used + for tracing the - consumed per block. - items: - format: uint64 - type: string - type: array + source of the fungible token. + type: string type: object type: object default: @@ -38197,74 +39593,37 @@ paths: message: type: string type: object - summary: State returns the current feemarket module state. + summary: DenomTrace queries a denomination trace information. tags: - Query - /gaia/globalfee/v1beta1/params: + /ibc/apps/transfer/v1/params: get: operationId: Params responses: '200': description: A successful response. schema: - description: |- - QueryMinimumGasPricesResponse is the response type for the - Query/MinimumGasPrices RPC method. + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. properties: params: - description: Params defines the set of module parameters. + description: params defines the parameters of the module. properties: - bypass_min_fee_msg_types: + receive_enabled: description: >- - bypass_min_fee_msg_types defines a list of message type - urls + receive_enabled enables or disables all cross-chain token + transfers to this - that are free of fee charge. - items: - type: string - type: array - max_total_bypass_min_fee_msg_gas_usage: + chain. + type: boolean + send_enabled: description: >- - max_total_bypass_min_fee_msg_gas_usage defines the total - maximum gas usage - - allowed for a transaction containing only messages of - types in bypass_min_fee_msg_types - - to bypass fee charge. - format: uint64 - type: string - minimum_gas_prices: - items: - description: >- - 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. - properties: - amount: - type: string - denom: - type: string - type: object - title: >- - minimum_gas_prices stores the minimum gas price(s) for all - TX on the chain. - - When multiple coins are defined then they are accepted - alternatively. - - The list must be sorted by denoms asc. No duplicate denoms - or zero amount - - values allowed. For more information see + send_enabled enables or disables all cross-chain token + transfers from this - https://docs.cosmos.network/main/modules/auth#concepts - type: array + chain. + type: boolean type: object type: object default: @@ -38289,24 +39648,46 @@ paths: message: type: string type: object + summary: Params queries all parameters of the ibc-transfer module. tags: - Query - /ibc/apps/packetforward/v1/params: + /interchain_security/ccv/consumer/next-fee-distribution: get: - operationId: Params + operationId: QueryNextFeeDistribution responses: '200': description: A successful response. schema: - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. properties: - params: - description: params defines the parameters of the module. + data: properties: - fee_percentage: + currentHeight: + format: int64 + title: current block height at the time of querying + type: string + distribution_fraction: + title: ratio between consumer and provider fee distribution + type: string + lastHeight: + format: int64 + title: block height at which last distribution took place + type: string + nextHeight: + format: int64 + title: block height at which next distribution will take place + type: string + toConsumer: + title: amount distributed (kept) by consumer chain + type: string + toProvider: + title: amount distributed to provider chain + type: string + total: + title: total accruead fees at the time of querying type: string + title: >- + NextFeeDistributionEstimate holds information about next fee + distribution type: object type: object default: @@ -38331,174 +39712,131 @@ paths: message: type: string type: object - summary: Params queries all parameters of the packetforward module. + summary: >- + ConsumerGenesis queries the genesis state needed to start a consumer + chain + + whose proposal has been accepted tags: - Query - /ibc/apps/transfer/v1/denom_hashes/{trace}: + /interchain_security/ccv/consumer/params: get: - operationId: DenomHash - parameters: - - description: The denomination trace ([port_id]/[channel_id])+/[denom] - in: path - name: trace - required: true - type: string + operationId: QueryParams responses: '200': description: A successful response. schema: description: >- - QueryDenomHashResponse is the response type for the - Query/DenomHash RPC - + QueryParamsResponse is response type for the Query/Params RPC method. properties: - hash: - description: hash (in hex format) of the denomination trace information. - type: string - type: object - default: - description: An unexpected error response. - schema: - properties: - code: - format: int32 - type: integer - details: - items: - properties: - type_url: - type: string - value: - format: byte - type: string - type: object - type: array - error: - type: string - message: - type: string - type: object - summary: DenomHash queries a denomination hash information. - tags: - - Query - /ibc/apps/transfer/v1/denom_traces: - get: - operationId: DenomTraces - parameters: - - description: |- - 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. - format: byte - in: query - name: pagination.key - required: false - type: string - - description: >- - offset is a numeric offset that can be used when key is unavailable. + params: + description: params holds all the parameters of this module. + properties: + blocks_per_distribution_transmission: + description: >- + ///////////////////// - It is less efficient than using key. Only one of offset or key - should + Distribution Params - be set. - format: uint64 - in: query - name: pagination.offset - required: false - type: string - - description: >- - limit is the total number of results to be returned in the result - page. + Number of blocks between ibc-token-transfers from the + consumer chain to - If left empty it will default to a value to be set by each app. - format: uint64 - in: query - name: pagination.limit - required: false - type: string - - description: >- - count_total is set to true to indicate that the result set should - include + the provider chain. Note that at this transmission event a + fraction of - a count of the total number of items available for pagination in - UIs. + the accumulated tokens are divided and sent consumer + redistribution - count_total is only respected when offset is used. It is ignored - when key + address. + format: int64 + type: string + ccv_timeout_period: + title: >- + Sent CCV related IBC packets will timeout after this + duration + type: string + consumer_redistribution_fraction: + description: >- + The fraction of tokens allocated to the consumer + redistribution address - is set. - in: query - name: pagination.count_total - required: false - type: boolean - - description: >- - reverse is set to true if results are to be returned in the - descending order. + during distribution events. The fraction is a string + representing a + + decimal number. For example "0.75" would represent 75%. + type: string + distribution_transmission_channel: + description: >- + Channel, and provider-chain receiving address to send + distribution token + transfers over. These parameters is auto-set during the + consumer <-> - Since: cosmos-sdk 0.43 - in: query - name: pagination.reverse - required: false - type: boolean - responses: - '200': - description: A successful response. - schema: - description: >- - QueryConnectionsResponse is the response type for the - Query/DenomTraces RPC + provider handshake procedure. + type: string + enabled: + title: >- + TODO: Remove enabled flag and find a better way to setup + integration tests - method. - properties: - denom_traces: - description: denom_traces returns all denominations trace information. - items: - description: >- - DenomTrace contains the base denomination for ICS20 fungible - tokens and the + See: + https://github.com/cosmos/interchain-security/issues/339 + type: boolean + historical_entries: + description: >- + The number of historical info entries to persist in store. - source tracing information path. - properties: - base_denom: - description: base denomination of the relayed fungible token. - type: string - path: - description: >- - path defines the chain of port/channel identifiers used - for tracing the + This param is a part of the cosmos sdk staking module. In + the case of - source of the fungible token. + a ccv enabled consumer chain, the ccv module acts as the + staking module. + format: int64 + type: string + provider_fee_pool_addr_str: + type: string + provider_reward_denoms: + items: type: string - type: object - type: array - pagination: - description: >- - PageResponse is to be embedded in gRPC response messages where - the + title: >- + Provider-originated reward denoms. These are denoms coming + from the - corresponding request message has used PageRequest. + provider which are allowed to be used as rewards. e.g. + "uatom" + type: array + retry_delay_period: + description: >- + The period after which a consumer can retry sending a + throttled packet. + type: string + reward_denoms: + description: >- + Reward denoms. These are the denominations which are + allowed to be sent to - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - properties: - next_key: - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - format: byte + the provider as rewards. + items: + type: string + type: array + soft_opt_out_threshold: + title: >- + !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. + see docs/docs/adrs/adr-015-partial-set-security.md type: string - total: - format: uint64 + transfer_timeout_period: title: >- - total is total number of results available if - PageRequest.count_total + Sent transfer related IBC packets will timeout after this + duration + type: string + unbonding_period: + description: >- + Unbonding period for the consumer, - was set, its value is undefined otherwise + which should be smaller than that of the provider in + general. type: string type: object type: object @@ -38523,45 +39861,38 @@ paths: type: string message: type: string - type: object - summary: DenomTraces queries all denomination traces. - tags: - - Query - /ibc/apps/transfer/v1/denom_traces/{hash}: - get: - operationId: DenomTrace - parameters: - - description: >- - hash (in hex format) or denom (full denom with ibc prefix) of the - denomination trace information. - in: path - name: hash - required: true - type: string + type: object + summary: QueryParams queries the ccv/consumer module parameters. + tags: + - Query + /interchain_security/ccv/consumer/provider-info: + get: + operationId: QueryProviderInfo responses: '200': description: A successful response. schema: - description: >- - QueryDenomTraceResponse is the response type for the - Query/DenomTrace RPC - - method. properties: - denom_trace: - description: >- - denom_trace returns the requested denomination trace - information. + consumer: properties: - base_denom: - description: base denomination of the relayed fungible token. + chainID: type: string - path: - description: >- - path defines the chain of port/channel identifiers used - for tracing the - - source of the fungible token. + channelID: + type: string + clientID: + type: string + connectionID: + type: string + type: object + provider: + properties: + chainID: + type: string + channelID: + type: string + clientID: + type: string + connectionID: type: string type: object type: object @@ -38587,36 +39918,108 @@ paths: message: type: string type: object - summary: DenomTrace queries a denomination trace information. tags: - Query - /ibc/apps/transfer/v1/params: + /interchain_security/ccv/consumer/throttle_state: get: - operationId: Params + operationId: QueryThrottleState responses: '200': description: A successful response. schema: - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. properties: - params: - description: params defines the parameters of the module. - properties: - receive_enabled: - description: >- - receive_enabled enables or disables all cross-chain token - transfers to this + packet_data_queue: + items: + properties: + slashPacketData: + description: >- + This packet is sent from the consumer chain to the + provider chain - chain. - type: boolean - send_enabled: - description: >- - send_enabled enables or disables all cross-chain token - transfers from this + to request the slashing of a validator as a result of an + infraction - chain. + committed on the consumer chain. + properties: + infraction: + title: >- + tell if the slashing is for a downtime or a + double-signing infraction + default: INFRACTION_UNSPECIFIED + description: >- + Infraction indicates the infraction a validator + commited. + + - INFRACTION_UNSPECIFIED: UNSPECIFIED defines an empty infraction. + - INFRACTION_DOUBLE_SIGN: DOUBLE_SIGN defines a validator that double-signs a block. + - INFRACTION_DOWNTIME: DOWNTIME defines a validator that missed signing too many blocks. + enum: + - INFRACTION_UNSPECIFIED + - INFRACTION_DOUBLE_SIGN + - INFRACTION_DOWNTIME + type: string + validator: + properties: + address: + format: byte + type: string + power: + format: int64 + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + type: string + type: object + valset_update_id: + format: uint64 + title: map to the infraction block height on the provider + type: string + type: object + type: + default: CONSUMER_PACKET_TYPE_UNSPECIFIED + description: >- + ConsumerPacketType indicates interchain security + specific packet types. + + - CONSUMER_PACKET_TYPE_UNSPECIFIED: UNSPECIFIED packet type + - CONSUMER_PACKET_TYPE_SLASH: Slash packet + - CONSUMER_PACKET_TYPE_VSCM: VSCMatured packet + enum: + - CONSUMER_PACKET_TYPE_UNSPECIFIED + - CONSUMER_PACKET_TYPE_SLASH + - CONSUMER_PACKET_TYPE_VSCM + type: string + vscMaturedPacketData: + description: >- + This packet is sent from the consumer chain to the + provider chain + + to notify that a VSC packet reached maturity on the + consumer chain. + properties: + valset_update_id: + format: uint64 + title: the id of the VSC packet that reached maturity + type: string + type: object + title: >- + ConsumerPacketData contains a consumer packet data and a + type tag + type: object + type: array + slash_record: + description: >- + A record storing the state of a slash packet sent to the + provider chain + + which may bounce back and forth until handled by the provider. + + + Note this type is only used internally to the consumer CCV + module. + properties: + send_time: + format: date-time + type: string + waiting_on_reply: type: boolean type: object type: object @@ -38642,46 +40045,110 @@ paths: message: type: string type: object - summary: Params queries all parameters of the ibc-transfer module. + summary: >- + QueryThrottleState returns on-chain state relevant to throttled consumer + packets tags: - Query - /interchain_security/ccv/consumer/next-fee-distribution: + /neutron-org/neutron/feerefunder/info: get: - operationId: QueryNextFeeDistribution + operationId: FeeInfo + parameters: + - in: query + name: channel_id + required: false + type: string + - in: query + name: port_id + required: false + type: string + - format: uint64 + in: query + name: sequence + required: false + type: string responses: '200': description: A successful response. schema: properties: - data: + fee_info: properties: - currentHeight: - format: int64 - title: current block height at the time of querying - type: string - distribution_fraction: - title: ratio between consumer and provider fee distribution - type: string - lastHeight: - format: int64 - title: block height at which last distribution took place - type: string - nextHeight: - format: int64 - title: block height at which next distribution will take place - type: string - toConsumer: - title: amount distributed (kept) by consumer chain - type: string - toProvider: - title: amount distributed to provider chain - type: string - total: - title: total accruead fees at the time of querying + fee: + properties: + ack_fee: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: the packet acknowledgement fee + type: array + recv_fee: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: the packet receive fee + type: array + timeout_fee: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: the packet timeout fee + type: array + title: >- + Fee defines the ICS29 receive, acknowledgement and timeout + fees + type: object + packet_id: + properties: + channel_id: + type: string + port_id: + type: string + sequence: + format: uint64 + type: string + type: object + payer: type: string - title: >- - NextFeeDistributionEstimate holds information about next fee - distribution type: object type: object default: @@ -38706,16 +40173,11 @@ paths: message: type: string type: object - summary: >- - ConsumerGenesis queries the genesis state needed to start a consumer - chain - - whose proposal has been accepted tags: - Query - /interchain_security/ccv/consumer/params: + /neutron-org/neutron/feerefunder/params: get: - operationId: QueryParams + operationId: Params responses: '200': description: A successful response. @@ -38727,174 +40189,228 @@ paths: params: description: params holds all the parameters of this module. properties: - blocks_per_distribution_transmission: - description: >- - ///////////////////// + min_fee: + properties: + ack_fee: + items: + description: >- + Coin defines a token with a denomination and an + amount. - Distribution Params - Number of blocks between ibc-token-transfers from the - consumer chain to + NOTE: The amount field is an Int which implements + the custom method - the provider chain. Note that at this transmission event a - fraction of + signatures required by gogoproto. + properties: + amount: + type: string + denom: + type: string + type: object + title: the packet acknowledgement fee + type: array + recv_fee: + items: + description: >- + Coin defines a token with a denomination and an + amount. - the accumulated tokens are divided and sent consumer - redistribution - address. - format: int64 - type: string - ccv_timeout_period: - title: >- - Sent CCV related IBC packets will timeout after this - duration - type: string - consumer_redistribution_fraction: - description: >- - The fraction of tokens allocated to the consumer - redistribution address + NOTE: The amount field is an Int which implements + the custom method - during distribution events. The fraction is a string - representing a + signatures required by gogoproto. + properties: + amount: + type: string + denom: + type: string + type: object + title: the packet receive fee + type: array + timeout_fee: + items: + description: >- + Coin defines a token with a denomination and an + amount. - decimal number. For example "0.75" would represent 75%. - type: string - distribution_transmission_channel: - description: >- - Channel, and provider-chain receiving address to send - distribution token - transfers over. These parameters is auto-set during the - consumer <-> + NOTE: The amount field is an Int which implements + the custom method - provider handshake procedure. - type: string - enabled: + signatures required by gogoproto. + properties: + amount: + type: string + denom: + type: string + type: object + title: the packet timeout fee + type: array title: >- - TODO: Remove enabled flag and find a better way to setup - integration tests - - See: - https://github.com/cosmos/interchain-security/issues/339 - type: boolean - historical_entries: - description: >- - The number of historical info entries to persist in store. - - This param is a part of the cosmos sdk staking module. In - the case of - - a ccv enabled consumer chain, the ccv module acts as the - staking module. - format: int64 - type: string - provider_fee_pool_addr_str: - type: string - provider_reward_denoms: - items: + Fee defines the ICS29 receive, acknowledgement and timeout + fees + type: object + type: object + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: type: string - title: >- - Provider-originated reward denoms. These are denoms coming - from the + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: Parameters queries the parameters of the module. + tags: + - Query + /neutron/contractmanager/failures: + get: + operationId: Failures + parameters: + - description: address of the contract which Sudo call failed. + in: query + name: address + required: false + type: string + - description: |- + 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. + format: byte + in: query + name: pagination.key + required: false + type: string + - description: >- + offset is a numeric offset that can be used when key is unavailable. - provider which are allowed to be used as rewards. e.g. - "uatom" - type: array - retry_delay_period: - description: >- - The period after which a consumer can retry sending a - throttled packet. - type: string - reward_denoms: - description: >- - Reward denoms. These are the denominations which are - allowed to be sent to + It is less efficient than using key. Only one of offset or key + should - the provider as rewards. - items: - type: string - type: array - soft_opt_out_threshold: - title: >- - The threshold for the percentage of validators at the - bottom of the set who + be set. + format: uint64 + in: query + name: pagination.offset + required: false + type: string + - description: >- + 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. + format: uint64 + in: query + name: pagination.limit + required: false + type: string + - description: >- + count_total is set to true to indicate that the result set should + include - can opt out of running the consumer chain without being - punished. For + a count of the total number of items available for pagination in + UIs. - example, a value of 0.05 means that the validators in the - bottom 5% of the + count_total is only respected when offset is used. It is ignored + when key - set can opt out - type: string - transfer_timeout_period: - title: >- - Sent transfer related IBC packets will timeout after this - duration - type: string - unbonding_period: - description: >- - Unbonding period for the consumer, + is set. + in: query + name: pagination.count_total + required: false + type: boolean + - description: >- + reverse is set to true if results are to be returned in the + descending order. - which should be smaller than that of the provider in - general. - type: string - type: object - type: object - default: - description: An unexpected error response. + + Since: cosmos-sdk 0.43 + in: query + name: pagination.reverse + required: false + type: boolean + responses: + '200': + description: A successful response. schema: + description: >- + QueryFailuresResponse is response type for the Query/Failures RPC + method. properties: - code: - format: int32 - type: integer - details: + failures: items: properties: - type_url: + address: + title: Address of the failed contract type: string - value: + error: + title: >- + Redacted error response of the sudo call. Full error is + emitted as an event + type: string + id: + format: uint64 + title: Id of the failure under specific address + type: string + sudo_payload: format: byte + title: >- + Serialized MessageSudoCallback with Packet and Ack(if + exists) type: string + title: >- + Failure message contains information about ACK failures and + can be used to + + replay ACK in case of requirement. + + Note that Failure means that sudo handler to cosmwasm + contract failed for + + some reason type: object type: array - error: - type: string - message: - type: string - type: object - summary: QueryParams queries the ccv/consumer module parameters. - tags: - - Query - /interchain_security/ccv/consumer/provider-info: - get: - operationId: QueryProviderInfo - responses: - '200': - description: A successful response. - schema: - properties: - consumer: - properties: - chainID: - type: string - channelID: - type: string - clientID: - type: string - connectionID: - type: string - type: object - provider: + pagination: + description: >- + 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; + } properties: - chainID: - type: string - channelID: - type: string - clientID: + next_key: + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + format: byte type: string - connectionID: + total: + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise type: string type: object type: object @@ -38920,109 +40436,142 @@ paths: message: type: string type: object + summary: Queries a list of Failures occurred on the network. tags: - Query - /interchain_security/ccv/consumer/throttle_state: + /neutron/contractmanager/failures/{address}: get: - operationId: QueryThrottleState + operationId: AddressFailures + parameters: + - description: address of the contract which Sudo call failed. + in: path + name: address + required: true + type: string + - description: |- + 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. + format: byte + in: query + name: pagination.key + required: false + type: string + - description: >- + 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. + format: uint64 + in: query + name: pagination.offset + required: false + type: string + - description: >- + 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. + format: uint64 + in: query + name: pagination.limit + required: false + type: string + - description: >- + 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. + in: query + name: pagination.count_total + required: false + type: boolean + - description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + name: pagination.reverse + required: false + type: boolean responses: '200': description: A successful response. schema: + description: >- + QueryFailuresResponse is response type for the Query/Failures RPC + method. properties: - packet_data_queue: + failures: items: properties: - slashPacketData: - description: >- - This packet is sent from the consumer chain to the - provider chain - - to request the slashing of a validator as a result of an - infraction - - committed on the consumer chain. - properties: - infraction: - title: >- - tell if the slashing is for a downtime or a - double-signing infraction - default: INFRACTION_UNSPECIFIED - description: >- - Infraction indicates the infraction a validator - commited. - - - INFRACTION_UNSPECIFIED: UNSPECIFIED defines an empty infraction. - - INFRACTION_DOUBLE_SIGN: DOUBLE_SIGN defines a validator that double-signs a block. - - INFRACTION_DOWNTIME: DOWNTIME defines a validator that missed signing too many blocks. - enum: - - INFRACTION_UNSPECIFIED - - INFRACTION_DOUBLE_SIGN - - INFRACTION_DOWNTIME - type: string - validator: - properties: - address: - format: byte - type: string - power: - format: int64 - title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; - type: string - type: object - valset_update_id: - format: uint64 - title: map to the infraction block height on the provider - type: string - type: object - type: - default: CONSUMER_PACKET_TYPE_UNSPECIFIED - description: >- - ConsumerPacketType indicates interchain security - specific packet types. - - - CONSUMER_PACKET_TYPE_UNSPECIFIED: UNSPECIFIED packet type - - CONSUMER_PACKET_TYPE_SLASH: Slash packet - - CONSUMER_PACKET_TYPE_VSCM: VSCMatured packet - enum: - - CONSUMER_PACKET_TYPE_UNSPECIFIED - - CONSUMER_PACKET_TYPE_SLASH - - CONSUMER_PACKET_TYPE_VSCM + address: + title: Address of the failed contract + type: string + error: + title: >- + Redacted error response of the sudo call. Full error is + emitted as an event + type: string + id: + format: uint64 + title: Id of the failure under specific address + type: string + sudo_payload: + format: byte + title: >- + Serialized MessageSudoCallback with Packet and Ack(if + exists) type: string - vscMaturedPacketData: - description: >- - This packet is sent from the consumer chain to the - provider chain - - to notify that a VSC packet reached maturity on the - consumer chain. - properties: - valset_update_id: - format: uint64 - title: the id of the VSC packet that reached maturity - type: string - type: object title: >- - ConsumerPacketData contains a consumer packet data and a - type tag + Failure message contains information about ACK failures and + can be used to + + replay ACK in case of requirement. + + Note that Failure means that sudo handler to cosmwasm + contract failed for + + some reason type: object type: array - slash_record: + pagination: description: >- - A record storing the state of a slash packet sent to the - provider chain - - which may bounce back and forth until handled by the provider. + PageResponse is to be embedded in gRPC response messages where + the + corresponding request message has used PageRequest. - Note this type is only used internally to the consumer CCV - module. + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } properties: - send_time: - format: date-time + next_key: + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + format: byte + type: string + total: + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise type: string - waiting_on_reply: - type: boolean type: object type: object default: @@ -39047,110 +40596,62 @@ paths: message: type: string type: object - summary: >- - QueryThrottleState returns on-chain state relevant to throttled consumer - packets + summary: Queries Failures by contract address. tags: - Query - /neutron-org/neutron/feerefunder/info: + /neutron/contractmanager/failures/{address}/{failure_id}: get: - operationId: FeeInfo + operationId: AddressFailure parameters: - - in: query - name: channel_id - required: false - type: string - - in: query - name: port_id - required: false + - description: address of the contract which Sudo call failed. + in: path + name: address + required: true type: string - - format: uint64 - in: query - name: sequence - required: false + - description: ID of the failure for the given contract. + format: uint64 + in: path + name: failure_id + required: true type: string responses: '200': description: A successful response. schema: + description: >- + QueryFailureResponse is response type for the Query/Failure RPC + method. properties: - fee_info: + failure: properties: - fee: - properties: - ack_fee: - items: - description: >- - 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. - properties: - amount: - type: string - denom: - type: string - type: object - title: the packet acknowledgement fee - type: array - recv_fee: - items: - description: >- - 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. - properties: - amount: - type: string - denom: - type: string - type: object - title: the packet receive fee - type: array - timeout_fee: - items: - description: >- - Coin defines a token with a denomination and an - amount. + address: + title: Address of the failed contract + type: string + error: + title: >- + Redacted error response of the sudo call. Full error is + emitted as an event + type: string + id: + format: uint64 + title: Id of the failure under specific address + type: string + sudo_payload: + format: byte + title: >- + Serialized MessageSudoCallback with Packet and Ack(if + exists) + type: string + title: >- + Failure message contains information about ACK failures and + can be used to + replay ACK in case of requirement. - NOTE: The amount field is an Int which implements - the custom method + Note that Failure means that sudo handler to cosmwasm contract + failed for - signatures required by gogoproto. - properties: - amount: - type: string - denom: - type: string - type: object - title: the packet timeout fee - type: array - title: >- - Fee defines the ICS29 receive, acknowledgement and timeout - fees - type: object - packet_id: - properties: - channel_id: - type: string - port_id: - type: string - sequence: - format: uint64 - type: string - type: object - payer: - type: string + some reason type: object type: object default: @@ -39175,9 +40676,10 @@ paths: message: type: string type: object + summary: Queries a Failure by contract address and failure ID. tags: - Query - /neutron-org/neutron/feerefunder/params: + /neutron/contractmanager/params: get: operationId: Params responses: @@ -39191,69 +40693,55 @@ paths: params: description: params holds all the parameters of this module. properties: - min_fee: - properties: - ack_fee: - items: - description: >- - 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. - properties: - amount: - type: string - denom: - type: string - type: object - title: the packet acknowledgement fee - type: array - recv_fee: - items: - description: >- - 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. - properties: - amount: - type: string - denom: - type: string - type: object - title: the packet receive fee - type: array - timeout_fee: - items: - description: >- - 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. - properties: - amount: - type: string - denom: - type: string - type: object - title: the packet timeout fee - type: array - title: >- - Fee defines the ICS29 receive, acknowledgement and timeout - fees - type: object + sudo_call_gas_limit: + format: uint64 + type: string + type: object + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: Parameters queries the parameters of the module. + tags: + - Query + /neutron/cron/params: + get: + operationId: Params + responses: + '200': + description: A successful response. + schema: + description: The response type for the Query/Params RPC method. + properties: + params: + description: params holds all the parameters of this module. + properties: + limit: + format: uint64 + title: Limit of schedules executed in one block + type: string + security_address: + title: Security address that can remove schedules + type: string type: object type: object default: @@ -39278,24 +40766,13 @@ paths: message: type: string type: object - summary: Parameters queries the parameters of the module. + summary: Queries the parameters of the module. tags: - Query - /neutron/contractmanager/failures: + /neutron/cron/schedule: get: - operationId: Failures + operationId: Schedules parameters: - - description: address of the contract which Sudo call failed. - in: query - name: address - required: false - type: string - - description: ID of the failure for the given contract. - format: uint64 - in: query - name: failure_id - required: false - type: string - description: |- key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key @@ -39356,43 +40833,8 @@ paths: '200': description: A successful response. schema: - description: >- - QueryFailuresResponse is response type for the Query/Failures RPC - method. + description: The response type for the Query/Params RPC method. properties: - failures: - items: - properties: - address: - title: Address of the failed contract - type: string - error: - title: >- - Redacted error response of the sudo call. Full error is - emitted as an event - type: string - id: - format: uint64 - title: Id of the failure under specific address - type: string - sudo_payload: - format: byte - title: >- - Serialized MessageSudoCallback with Packet and Ack(if - exists) - type: string - title: >- - Failure message contains information about ACK failures and - can be used to - - replay ACK in case of requirement. - - Note that Failure means that sudo handler to cosmwasm - contract failed for - - some reason - type: object - type: array pagination: description: >- PageResponse is to be embedded in gRPC response messages where @@ -39421,6 +40863,49 @@ paths: was set, its value is undefined otherwise type: string type: object + schedules: + items: + properties: + execution_stage: + title: Stage when messages will be executed + default: EXECUTION_STAGE_END_BLOCKER + description: >- + - EXECUTION_STAGE_END_BLOCKER: Execution at the end of + the block + - EXECUTION_STAGE_BEGIN_BLOCKER: Execution at the beginning of the block + enum: + - EXECUTION_STAGE_END_BLOCKER + - EXECUTION_STAGE_BEGIN_BLOCKER + type: string + last_execute_height: + format: uint64 + title: Last execution's block height + type: string + msgs: + items: + properties: + contract: + title: The address of the smart contract + type: string + msg: + title: JSON encoded message to be passed to the contract + type: string + title: Defines the contract and the message to pass + type: object + title: >- + Msgs that will be executed every certain number of + blocks, specified in the `period` field + type: array + name: + title: Name of schedule + type: string + period: + format: uint64 + title: Period in blocks + type: string + title: Defines the schedule for execution + type: object + type: array type: object default: description: An unexpected error response. @@ -39444,149 +40929,288 @@ paths: message: type: string type: object - summary: Queries a list of Failures occurred on the network. + summary: Queries a list of Schedule items. tags: - Query - /neutron/contractmanager/failures/{address}: + /neutron/cron/schedule/{name}: get: - operationId: AddressFailures + operationId: Schedule parameters: - - description: address of the contract which Sudo call failed. - in: path - name: address + - in: path + name: name required: true type: string - - description: ID of the failure for the given contract. - format: uint64 - in: query - name: failure_id + responses: + '200': + description: A successful response. + schema: + description: The response type for the Query/Params RPC method. + properties: + schedule: + properties: + execution_stage: + title: Stage when messages will be executed + default: EXECUTION_STAGE_END_BLOCKER + description: >- + - EXECUTION_STAGE_END_BLOCKER: Execution at the end of the + block + - EXECUTION_STAGE_BEGIN_BLOCKER: Execution at the beginning of the block + enum: + - EXECUTION_STAGE_END_BLOCKER + - EXECUTION_STAGE_BEGIN_BLOCKER + type: string + last_execute_height: + format: uint64 + title: Last execution's block height + type: string + msgs: + items: + properties: + contract: + title: The address of the smart contract + type: string + msg: + title: JSON encoded message to be passed to the contract + type: string + title: Defines the contract and the message to pass + type: object + title: >- + Msgs that will be executed every certain number of blocks, + specified in the `period` field + type: array + name: + title: Name of schedule + type: string + period: + format: uint64 + title: Period in blocks + type: string + title: Defines the schedule for execution + type: object + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: Queries a Schedule by name. + tags: + - Query + /neutron/dex/estimate_multi_hop_swap: + get: + operationId: EstimateMultiHopSwap + parameters: + - description: 'DEPRECATED: Use QuerySimulateMultiHopSwap.' + in: query + name: creator + required: false + type: string + - in: query + name: receiver + required: false + type: string + - in: query + name: amount_in + required: false + type: string + - in: query + name: exit_limit_price + required: false + type: string + - description: >- + If pickBestRoute == true then all routes are run and the route with + the + + best price is chosen otherwise, the first succesful route is used. + in: query + name: pick_best_route + required: false + type: boolean + responses: + '200': + description: A successful response. + schema: + properties: + coin_out: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: DEPRECATED Queries the simulated result of a multihop swap + tags: + - Query + /neutron/dex/estimate_place_limit_order: + get: + operationId: EstimatePlaceLimitOrder + parameters: + - description: 'DEPRECATED: Use QuerySimulatePlaceLimitOrder.' + in: query + name: creator + required: false + type: string + - in: query + name: receiver + required: false + type: string + - in: query + name: token_in required: false type: string - - description: |- - 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. - format: byte - in: query - name: pagination.key + - in: query + name: token_out required: false type: string - - description: >- - 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. - format: uint64 + - format: int64 in: query - name: pagination.offset + name: tick_index_in_to_out required: false type: string - - description: >- - 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. - format: uint64 - in: query - name: pagination.limit + - in: query + name: amount_in required: false type: string - - description: >- - 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. + - default: GOOD_TIL_CANCELLED + enum: + - GOOD_TIL_CANCELLED + - FILL_OR_KILL + - IMMEDIATE_OR_CANCEL + - JUST_IN_TIME + - GOOD_TIL_TIME in: query - name: pagination.count_total + name: order_type required: false - type: boolean - - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 + type: string + - description: expirationTime is only valid iff orderType == GOOD_TIL_TIME. + format: date-time in: query - name: pagination.reverse + name: expiration_time required: false - type: boolean + type: string + - in: query + name: maxAmount_out + required: false + type: string responses: '200': description: A successful response. schema: - description: >- - QueryFailuresResponse is response type for the Query/Failures RPC - method. properties: - failures: - items: - properties: - address: - title: Address of the failed contract - type: string - error: - title: >- - Redacted error response of the sudo call. Full error is - emitted as an event - type: string - id: - format: uint64 - title: Id of the failure under specific address - type: string - sudo_payload: - format: byte - title: >- - Serialized MessageSudoCallback with Packet and Ack(if - exists) - type: string - title: >- - Failure message contains information about ACK failures and - can be used to + swap_in_coin: + description: >- + Coin defines a token with a denomination and an amount. - replay ACK in case of requirement. - Note that Failure means that sudo handler to cosmwasm - contract failed for + NOTE: The amount field is an Int which implements the custom + method - some reason - type: object - type: array - pagination: + signatures required by gogoproto. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + Total amount of the token in that was immediately swapped for + swapOutCoin + swap_out_coin: description: >- - PageResponse is to be embedded in gRPC response messages where - the + Coin defines a token with a denomination and an amount. - corresponding request message has used PageRequest. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. properties: - next_key: - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - format: byte + amount: type: string - total: - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + denom: + type: string + type: object + title: >- + Total amount of coin received from the taker portion of the + limit order - was set, its value is undefined otherwise + This is the amount of coin immediately available in the users + account after + + executing the limit order. It does not include any future + proceeds from the + + maker portion which will have withdrawn in the future + total_in_coin: + description: >- + 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. + properties: + amount: + type: string + denom: type: string type: object + title: >- + Total amount of coin used for the limit order + + You can derive makerLimitInCoin using the equation: + totalInCoin = + + swapInCoin + makerLimitInCoin type: object default: description: An unexpected error response. @@ -39610,24 +41234,13 @@ paths: message: type: string type: object - summary: Queries Failures by contract address. + summary: DEPRECATED Queries the simulated result of a PlaceLimit order tags: - Query - /neutron/contractmanager/failures/{address}/{failure_id}: + /neutron/dex/filled_limit_order_tranche: get: - operationId: AddressFailure + operationId: InactiveLimitOrderTrancheAll2 parameters: - - description: address of the contract which Sudo call failed. - in: path - name: address - required: true - type: string - - description: ID of the failure for the given contract. - format: uint64 - in: path - name: failure_id - required: true - type: string - description: |- key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key @@ -39688,41 +41301,56 @@ paths: '200': description: A successful response. schema: - description: >- - QueryFailuresResponse is response type for the Query/Failures RPC - method. properties: - failures: + inactive_limit_order_tranche: items: properties: - address: - title: Address of the failed contract - type: string - error: + expiration_time: + format: date-time title: >- - Redacted error response of the sudo call. Full error is - emitted as an event - type: string - id: - format: uint64 - title: Id of the failure under specific address + JIT orders also use expiration_time to handle deletion + but represent a special case + + All JIT orders have a expiration_time of 0 and an + exception is made to still treat these orders as live + + Order deletion still functions the same and the orders + will be deleted at the end of the block type: string - sudo_payload: - format: byte + key: + properties: + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + tranche_key: + type: string + type: object + maker_price: title: >- - Serialized MessageSudoCallback with Packet and Ack(if - exists) + This is the price of the LimitOrder denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 + is worth 10 TokenB ) + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + reserves_taker_denom: + type: string + total_maker_denom: + type: string + total_taker_denom: type: string - title: >- - Failure message contains information about ACK failures and - can be used to - - replay ACK in case of requirement. - - Note that Failure means that sudo handler to cosmwasm - contract failed for - - some reason type: object type: array pagination: @@ -39776,70 +41404,82 @@ paths: message: type: string type: object - summary: Queries a Failure by contract address and failure ID. + summary: Queries a list of InactiveLimitOrderTranche items. tags: - Query - /neutron/contractmanager/params: + /neutron/dex/filled_limit_order_tranche/{pair_id}/{token_in}/{tick_index}/{tranche_key}: get: - operationId: Params + operationId: InactiveLimitOrderTranche2 + parameters: + - in: path + name: pair_id + required: true + type: string + - in: path + name: token_in + required: true + type: string + - format: int64 + in: path + name: tick_index + required: true + type: string + - in: path + name: tranche_key + required: true + type: string responses: '200': description: A successful response. schema: - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. properties: - params: - description: params holds all the parameters of this module. + inactive_limit_order_tranche: properties: - sudo_call_gas_limit: - format: uint64 + expiration_time: + format: date-time + title: >- + JIT orders also use expiration_time to handle deletion but + represent a special case + + All JIT orders have a expiration_time of 0 and an + exception is made to still treat these orders as live + + Order deletion still functions the same and the orders + will be deleted at the end of the block type: string - type: object - type: object - default: - description: An unexpected error response. - schema: - properties: - code: - format: int32 - type: integer - details: - items: - properties: - type_url: - type: string - value: - format: byte - type: string - type: object - type: array - error: - type: string - message: - type: string - type: object - summary: Parameters queries the parameters of the module. - tags: - - Query - /neutron/cron/params: - get: - operationId: Params - responses: - '200': - description: A successful response. - schema: - properties: - params: - description: params holds all the parameters of this module. - properties: - limit: - format: uint64 - title: Limit of schedules executed in one block + key: + properties: + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + tranche_key: + type: string + type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) type: string - security_address: - title: Security address that can remove schedules + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + reserves_taker_denom: + type: string + total_maker_denom: + type: string + total_taker_denom: type: string type: object type: object @@ -39865,12 +41505,12 @@ paths: message: type: string type: object - summary: Queries the parameters of the module. + summary: Queries a InactiveLimitOrderTranche by index. tags: - Query - /neutron/cron/schedule: + /neutron/dex/inactive_limit_order_tranche: get: - operationId: Schedules + operationId: InactiveLimitOrderTrancheAll parameters: - description: |- key is a value returned in PageResponse.next_key to begin @@ -39933,6 +41573,57 @@ paths: description: A successful response. schema: properties: + inactive_limit_order_tranche: + items: + properties: + expiration_time: + format: date-time + title: >- + JIT orders also use expiration_time to handle deletion + but represent a special case + + All JIT orders have a expiration_time of 0 and an + exception is made to still treat these orders as live + + Order deletion still functions the same and the orders + will be deleted at the end of the block + type: string + key: + properties: + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + tranche_key: + type: string + type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 + is worth 10 TokenB ) + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + reserves_taker_denom: + type: string + total_maker_denom: + type: string + total_taker_denom: + type: string + type: object + type: array pagination: description: >- PageResponse is to be embedded in gRPC response messages where @@ -39961,36 +41652,6 @@ paths: was set, its value is undefined otherwise type: string type: object - schedules: - items: - properties: - last_execute_height: - format: uint64 - title: Last execution's block height - type: string - msgs: - items: - properties: - contract: - title: Contract is the address of the smart contract - type: string - msg: - title: >- - Msg is json encoded message to be passed to the - contract - type: string - type: object - title: Msgs that will be executed every period amount of time - type: array - name: - title: Name of schedule - type: string - period: - format: uint64 - title: Period in blocks - type: string - type: object - type: array type: object default: description: An unexpected error response. @@ -40014,15 +41675,28 @@ paths: message: type: string type: object - summary: Queries a list of Schedule items. + summary: Queries a list of InactiveLimitOrderTranche items. tags: - Query - /neutron/cron/schedule/{name}: + /neutron/dex/inactive_limit_order_tranche/{pair_id}/{token_in}/{tick_index}/{tranche_key}: get: - operationId: Schedule + operationId: InactiveLimitOrderTranche parameters: - in: path - name: name + name: pair_id + required: true + type: string + - in: path + name: token_in + required: true + type: string + - format: int64 + in: path + name: tick_index + required: true + type: string + - in: path + name: tranche_key required: true type: string responses: @@ -40030,32 +41704,53 @@ paths: description: A successful response. schema: properties: - schedule: + inactive_limit_order_tranche: properties: - last_execute_height: - format: uint64 - title: Last execution's block height + expiration_time: + format: date-time + title: >- + JIT orders also use expiration_time to handle deletion but + represent a special case + + All JIT orders have a expiration_time of 0 and an + exception is made to still treat these orders as live + + Order deletion still functions the same and the orders + will be deleted at the end of the block + type: string + key: + properties: + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + tranche_key: + type: string + type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. + type: string + reserves_maker_denom: type: string - msgs: - items: - properties: - contract: - title: Contract is the address of the smart contract - type: string - msg: - title: >- - Msg is json encoded message to be passed to the - contract - type: string - type: object - title: Msgs that will be executed every period amount of time - type: array - name: - title: Name of schedule + reserves_taker_denom: type: string - period: - format: uint64 - title: Period in blocks + total_maker_denom: + type: string + total_taker_denom: type: string type: object type: object @@ -40081,36 +41776,75 @@ paths: message: type: string type: object - summary: Queries a Schedule by name. + summary: Queries a InactiveLimitOrderTranche by index. tags: - Query - /neutron/dex/estimate_multi_hop_swap: + /neutron/dex/limit_order_tranche/{pair_id}/{token_in}: get: - operationId: EstimateMultiHopSwap + operationId: LimitOrderTrancheAll parameters: - - in: query - name: creator - required: false + - in: path + name: pair_id + required: true type: string - - in: query - name: receiver + - in: path + name: token_in + required: true + type: string + - description: |- + 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. + format: byte + in: query + name: pagination.key required: false type: string - - in: query - name: amount_in + - description: >- + 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. + format: uint64 + in: query + name: pagination.offset required: false type: string - - in: query - name: exit_limit_price + - description: >- + 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. + format: uint64 + in: query + name: pagination.limit required: false type: string - description: >- - If pickBestRoute == true then all routes are run and the route with - the + count_total is set to true to indicate that the result set should + include - best price is chosen otherwise, the first succesful route is used. + 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. in: query - name: pick_best_route + name: pagination.count_total + required: false + type: boolean + - description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + name: pagination.reverse required: false type: boolean responses: @@ -40118,19 +41852,83 @@ paths: description: A successful response. schema: properties: - coin_out: - description: >- - Coin defines a token with a denomination and an amount. + limit_order_tranche: + items: + properties: + expiration_time: + format: date-time + title: >- + JIT orders also use expiration_time to handle deletion + but represent a special case + All JIT orders have a expiration_time of 0 and an + exception is made to still treat these orders as live - NOTE: The amount field is an Int which implements the custom - method + Order deletion still functions the same and the orders + will be deleted at the end of the block + type: string + key: + properties: + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + tranche_key: + type: string + type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 + is worth 10 TokenB ) + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + reserves_taker_denom: + type: string + total_maker_denom: + type: string + total_taker_denom: + type: string + type: object + type: array + pagination: + description: >- + PageResponse is to be embedded in gRPC response messages where + the - signatures required by gogoproto. + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } properties: - amount: + next_key: + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + format: byte type: string - denom: + total: + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise type: string type: object type: object @@ -40156,130 +41954,86 @@ paths: message: type: string type: object - summary: Queries the simulated result of a multihop swap + summary: |- + Queries a list of LimitOrderTranche items for a given pairID / TokenIn + combination. tags: - Query - /neutron/dex/estimate_place_limit_order: + /neutron/dex/limit_order_tranche/{pair_id}/{token_in}/{tick_index}/{tranche_key}: get: - operationId: EstimatePlaceLimitOrder + operationId: LimitOrderTranche parameters: - - in: query - name: creator - required: false - type: string - - in: query - name: receiver - required: false + - in: path + name: pair_id + required: true type: string - - in: query + - in: path name: token_in - required: false - type: string - - in: query - name: token_out - required: false + required: true type: string - format: int64 - in: query - name: tick_index_in_to_out - required: false - type: string - - in: query - name: amount_in - required: false - type: string - - default: GOOD_TIL_CANCELLED - enum: - - GOOD_TIL_CANCELLED - - FILL_OR_KILL - - IMMEDIATE_OR_CANCEL - - JUST_IN_TIME - - GOOD_TIL_TIME - in: query - name: order_type - required: false - type: string - - description: expirationTime is only valid iff orderType == GOOD_TIL_TIME. - format: date-time - in: query - name: expiration_time - required: false + in: path + name: tick_index + required: true type: string - - in: query - name: maxAmount_out - required: false + - in: path + name: tranche_key + required: true type: string responses: '200': description: A successful response. schema: properties: - swap_in_coin: - description: >- - Coin defines a token with a denomination and an amount. - + limit_order_tranche: + properties: + expiration_time: + format: date-time + title: >- + JIT orders also use expiration_time to handle deletion but + represent a special case - NOTE: The amount field is an Int which implements the custom - method + All JIT orders have a expiration_time of 0 and an + exception is made to still treat these orders as live - signatures required by gogoproto. - properties: - amount: + Order deletion still functions the same and the orders + will be deleted at the end of the block + type: string + key: + properties: + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + tranche_key: + type: string + type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) type: string - denom: + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. type: string - type: object - title: >- - Total amount of the token in that was immediately swapped for - swapOutCoin - swap_out_coin: - description: >- - 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. - properties: - amount: + reserves_maker_denom: type: string - denom: + reserves_taker_denom: type: string - type: object - title: >- - Total amount of coin received from the taker portion of the - limit order - - This is the amount of coin immediately available in the users - account after - - executing the limit order. It does not include any future - proceeds from the - - maker portion which will have withdrawn in the future - total_in_coin: - description: >- - 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. - properties: - amount: + total_maker_denom: type: string - denom: + total_taker_denom: type: string type: object - title: >- - Total amount of coin used for the limit order - - You can derive makerLimitInCoin using the equation: - totalInCoin = - - swapInCoin + makerLimitInCoin type: object default: description: An unexpected error response. @@ -40303,12 +42057,12 @@ paths: message: type: string type: object - summary: Queries the simulated result of a PlaceLimit order + summary: Queries a LimitOrderTranche by index. tags: - Query - /neutron/dex/filled_limit_order_tranche: + /neutron/dex/limit_order_tranche_user: get: - operationId: InactiveLimitOrderTrancheAll2 + operationId: LimitOrderTrancheUserAll parameters: - description: |- key is a value returned in PageResponse.next_key to begin @@ -40371,45 +42125,38 @@ paths: description: A successful response. schema: properties: - inactive_limit_order_tranche: + limit_order_tranche_user: items: properties: - expiration_time: - format: date-time - title: >- - JIT orders also use expiration_time to handle deletion - but represent a special case - - All JIT orders have a expiration_time of 0 and an - exception is made to still treat these orders as live - - Order deletion still functions the same and the orders - will be deleted at the end of the block + address: type: string - key: - properties: - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - tranche_key: - type: string - type: object - price_taker_to_maker: + order_type: + default: GOOD_TIL_CANCELLED + enum: + - GOOD_TIL_CANCELLED + - FILL_OR_KILL + - IMMEDIATE_OR_CANCEL + - JUST_IN_TIME + - GOOD_TIL_TIME type: string - reserves_maker_denom: + shares_cancelled: + title: 'TODO: remove this in next release. It is no longer used' type: string - reserves_taker_denom: + shares_owned: type: string - total_maker_denom: + shares_withdrawn: type: string - total_taker_denom: + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + tranche_key: type: string type: object type: array @@ -40432,14 +42179,150 @@ paths: there are no more results. format: byte type: string - total: + total: + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + type: string + type: object + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: Queries a list of LimitOrderTranchUser items. + tags: + - Query + /neutron/dex/limit_order_tranche_user/{address}/{tranche_key}: + get: + operationId: LimitOrderTrancheUser + parameters: + - in: path + name: address + required: true + type: string + - in: path + name: tranche_key + required: true + type: string + - in: query + name: calc_withdrawable_shares + required: false + type: boolean + responses: + '200': + description: A successful response. + schema: + properties: + limit_order_tranche_user: + properties: + address: + type: string + order_type: + default: GOOD_TIL_CANCELLED + enum: + - GOOD_TIL_CANCELLED + - FILL_OR_KILL + - IMMEDIATE_OR_CANCEL + - JUST_IN_TIME + - GOOD_TIL_TIME + type: string + shares_cancelled: + title: 'TODO: remove this in next release. It is no longer used' + type: string + shares_owned: + type: string + shares_withdrawn: + type: string + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + tranche_key: + type: string + type: object + withdrawable_shares: + type: string + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: Queries a LimitOrderTrancheUser by index. + tags: + - Query + /neutron/dex/params: + get: + operationId: Params + responses: + '200': + description: A successful response. + schema: + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + properties: + params: + description: params holds all the parameters of this module. + properties: + fee_tiers: + items: + format: uint64 + type: string + type: array + good_til_purge_allowance: + format: uint64 + type: string + max_jits_per_block: format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise type: string + paused: + type: boolean type: object type: object default: @@ -40464,28 +42347,25 @@ paths: message: type: string type: object - summary: Queries a list of InactiveLimitOrderTranche items. + summary: Parameters queries the parameters of the module. tags: - Query - /neutron/dex/filled_limit_order_tranche/{pair_id}/{token_in}/{tick_index}/{tranche_key}: + /neutron/dex/pool/{pair_id}/{tick_index}/{fee}: get: - operationId: InactiveLimitOrderTranche2 + operationId: Pool parameters: - in: path name: pair_id required: true type: string - - in: path - name: token_in - required: true - type: string - format: int64 in: path name: tick_index required: true type: string - - in: path - name: tranche_key + - format: uint64 + in: path + name: fee required: true type: string responses: @@ -40493,206 +42373,93 @@ paths: description: A successful response. schema: properties: - inactive_limit_order_tranche: + pool: properties: - expiration_time: - format: date-time - title: >- - JIT orders also use expiration_time to handle deletion but - represent a special case - - All JIT orders have a expiration_time of 0 and an - exception is made to still treat these orders as live - - Order deletion still functions the same and the orders - will be deleted at the end of the block + id: + format: uint64 type: string - key: + lower_tick0: properties: - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: + key: properties: - maker_denom: + fee: + format: uint64 type: string - taker_denom: + tick_index_taker_to_maker: + format: int64 type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object type: object - tranche_key: + maker_price: + title: >- + This is the price of the PoolReserves denominated in + the opposite token. (ie. 1 TokenA with a maker_price + of 10 is worth 10 TokenB ) type: string - type: object - price_taker_to_maker: - type: string - reserves_maker_denom: - type: string - reserves_taker_denom: - type: string - total_maker_denom: - type: string - total_taker_denom: - type: string - type: object - type: object - default: - description: An unexpected error response. - schema: - properties: - code: - format: int32 - type: integer - details: - items: - properties: - type_url: - type: string - value: - format: byte - type: string - type: object - type: array - error: - type: string - message: - type: string - type: object - summary: Queries a InactiveLimitOrderTranche by index. - tags: - - Query - /neutron/dex/inactive_limit_order_tranche: - get: - operationId: InactiveLimitOrderTrancheAll - parameters: - - description: |- - 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. - format: byte - in: query - name: pagination.key - required: false - type: string - - description: >- - 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. - format: uint64 - in: query - name: pagination.offset - required: false - type: string - - description: >- - 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. - format: uint64 - in: query - name: pagination.limit - required: false - type: string - - description: >- - 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. - in: query - name: pagination.count_total - required: false - type: boolean - - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - name: pagination.reverse - required: false - type: boolean - responses: - '200': - description: A successful response. - schema: - properties: - inactive_limit_order_tranche: - items: - properties: - expiration_time: - format: date-time - title: >- - JIT orders also use expiration_time to handle deletion - but represent a special case - - All JIT orders have a expiration_time of 0 and an - exception is made to still treat these orders as live - - Order deletion still functions the same and the orders - will be deleted at the end of the block - type: string - key: - properties: - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - tranche_key: - type: string - type: object - price_taker_to_maker: - type: string - reserves_maker_denom: - type: string - reserves_taker_denom: - type: string - total_maker_denom: - type: string - total_taker_denom: - type: string - type: object - type: array - pagination: - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - properties: - next_key: - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - format: byte - type: string - total: - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + It is being kept strictly for backwards compatibility. + The actual field value is unused. + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + type: object + upper_tick1: + properties: + key: + properties: + fee: + format: uint64 + type: string + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in + the opposite token. (ie. 1 TokenA with a maker_price + of 10 is worth 10 TokenB ) + type: string + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. - was set, its value is undefined otherwise - type: string + It is being kept strictly for backwards compatibility. + The actual field value is unused. + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + type: object type: object type: object default: @@ -40717,28 +42484,16 @@ paths: message: type: string type: object - summary: Queries a list of InactiveLimitOrderTranche items. + summary: Queries a pool by pair, tick and fee tags: - Query - /neutron/dex/inactive_limit_order_tranche/{pair_id}/{token_in}/{tick_index}/{tranche_key}: + /neutron/dex/pool/{pool_id}: get: - operationId: InactiveLimitOrderTranche + operationId: PoolByID parameters: - - in: path - name: pair_id - required: true - type: string - - in: path - name: token_in - required: true - type: string - - format: int64 + - format: uint64 in: path - name: tick_index - required: true - type: string - - in: path - name: tranche_key + name: pool_id required: true type: string responses: @@ -40746,45 +42501,93 @@ paths: description: A successful response. schema: properties: - inactive_limit_order_tranche: + pool: properties: - expiration_time: - format: date-time - title: >- - JIT orders also use expiration_time to handle deletion but - represent a special case - - All JIT orders have a expiration_time of 0 and an - exception is made to still treat these orders as live - - Order deletion still functions the same and the orders - will be deleted at the end of the block + id: + format: uint64 type: string - key: + lower_tick0: properties: - tick_index_taker_to_maker: - format: int64 + key: + properties: + fee: + format: uint64 + type: string + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in + the opposite token. (ie. 1 TokenA with a maker_price + of 10 is worth 10 TokenB ) type: string - trade_pair_id: + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. + + It is being kept strictly for backwards compatibility. + The actual field value is unused. + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string + type: object + upper_tick1: + properties: + key: properties: - maker_denom: + fee: + format: uint64 type: string - taker_denom: + tick_index_taker_to_maker: + format: int64 type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object type: object - tranche_key: + maker_price: + title: >- + This is the price of the PoolReserves denominated in + the opposite token. (ie. 1 TokenA with a maker_price + of 10 is worth 10 TokenB ) + type: string + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. + + It is being kept strictly for backwards compatibility. + The actual field value is unused. + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. + type: string + reserves_maker_denom: type: string type: object - price_taker_to_maker: - type: string - reserves_maker_denom: - type: string - reserves_taker_denom: - type: string - total_maker_denom: - type: string - total_taker_denom: - type: string type: object type: object default: @@ -40809,21 +42612,13 @@ paths: message: type: string type: object - summary: Queries a InactiveLimitOrderTranche by index. + summary: Queries a pool by ID tags: - Query - /neutron/dex/limit_order_tranche/{pair_id}/{token_in}: + /neutron/dex/pool_metadata: get: - operationId: LimitOrderTrancheAll + operationId: PoolMetadataAll parameters: - - in: path - name: pair_id - required: true - type: string - - in: path - name: token_in - required: true - type: string - description: |- key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key @@ -40885,48 +42680,6 @@ paths: description: A successful response. schema: properties: - limit_order_tranche: - items: - properties: - expiration_time: - format: date-time - title: >- - JIT orders also use expiration_time to handle deletion - but represent a special case - - All JIT orders have a expiration_time of 0 and an - exception is made to still treat these orders as live - - Order deletion still functions the same and the orders - will be deleted at the end of the block - type: string - key: - properties: - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - tranche_key: - type: string - type: object - price_taker_to_maker: - type: string - reserves_maker_denom: - type: string - reserves_taker_denom: - type: string - total_maker_denom: - type: string - total_taker_denom: - type: string - type: object - type: array pagination: description: >- PageResponse is to be embedded in gRPC response messages where @@ -40955,6 +42708,27 @@ paths: was set, its value is undefined otherwise type: string type: object + pool_metadata: + items: + properties: + fee: + format: uint64 + type: string + id: + format: uint64 + type: string + pair_id: + properties: + token0: + type: string + token1: + type: string + type: object + tick: + format: int64 + type: string + type: object + type: array type: object default: description: An unexpected error response. @@ -40978,30 +42752,16 @@ paths: message: type: string type: object - summary: |- - Queries a list of LimitOrderTranche items for a given pairID / TokenIn - combination. + summary: Queries a list of PoolMetadata items. tags: - Query - /neutron/dex/limit_order_tranche/{pair_id}/{token_in}/{tick_index}/{tranche_key}: + /neutron/dex/pool_metadata/{id}: get: - operationId: LimitOrderTranche + operationId: PoolMetadata parameters: - - in: path - name: pair_id - required: true - type: string - - in: path - name: token_in - required: true - type: string - - format: int64 + - format: uint64 in: path - name: tick_index - required: true - type: string - - in: path - name: tranche_key + name: id required: true type: string responses: @@ -41009,44 +42769,23 @@ paths: description: A successful response. schema: properties: - limit_order_tranche: + Pool_metadata: properties: - expiration_time: - format: date-time - title: >- - JIT orders also use expiration_time to handle deletion but - represent a special case - - All JIT orders have a expiration_time of 0 and an - exception is made to still treat these orders as live - - Order deletion still functions the same and the orders - will be deleted at the end of the block - type: string - key: - properties: - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - tranche_key: - type: string - type: object - price_taker_to_maker: - type: string - reserves_maker_denom: - type: string - reserves_taker_denom: + fee: + format: uint64 type: string - total_maker_denom: + id: + format: uint64 type: string - total_taker_denom: + pair_id: + properties: + token0: + type: string + token1: + type: string + type: object + tick: + format: int64 type: string type: object type: object @@ -41072,13 +42811,21 @@ paths: message: type: string type: object - summary: Queries a LimitOrderTranche by index. + summary: Queries a PoolMetadata by ID tags: - Query - /neutron/dex/limit_order_tranche_user: + /neutron/dex/pool_reserves/{pair_id}/{token_in}: get: - operationId: LimitOrderTrancheUserAll + operationId: PoolReservesAll parameters: + - in: path + name: pair_id + required: true + type: string + - in: path + name: token_in + required: true + type: string - description: |- key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key @@ -41140,40 +42887,6 @@ paths: description: A successful response. schema: properties: - limit_order_tranche_user: - items: - properties: - address: - type: string - order_type: - default: GOOD_TIL_CANCELLED - enum: - - GOOD_TIL_CANCELLED - - FILL_OR_KILL - - IMMEDIATE_OR_CANCEL - - JUST_IN_TIME - - GOOD_TIL_TIME - type: string - shares_cancelled: - type: string - shares_owned: - type: string - shares_withdrawn: - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - tranche_key: - type: string - type: object - type: array pagination: description: >- PageResponse is to be embedded in gRPC response messages where @@ -41202,141 +42915,49 @@ paths: was set, its value is undefined otherwise type: string type: object - type: object - default: - description: An unexpected error response. - schema: - properties: - code: - format: int32 - type: integer - details: + pool_reserves: items: properties: - type_url: + key: + properties: + fee: + format: uint64 + type: string + tick_index_taker_to_maker: + format: int64 + type: string + trade_pair_id: + properties: + maker_denom: + type: string + taker_denom: + type: string + type: object + type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 + is worth 10 TokenB ) type: string - value: - format: byte + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. + + It is being kept strictly for backwards compatibility. + The actual field value is unused. type: string - type: object - type: array - error: - type: string - message: - type: string - type: object - summary: Queries a list of LimitOrderTranchUser items. - tags: - - Query - /neutron/dex/limit_order_tranche_user/{address}/{tranche_key}: - get: - operationId: LimitOrderTrancheUser - parameters: - - in: path - name: address - required: true - type: string - - in: path - name: tranche_key - required: true - type: string - - in: query - name: calc_withdrawable_shares - required: false - type: boolean - responses: - '200': - description: A successful response. - schema: - properties: - limit_order_tranche_user: - properties: - address: - type: string - order_type: - default: GOOD_TIL_CANCELLED - enum: - - GOOD_TIL_CANCELLED - - FILL_OR_KILL - - IMMEDIATE_OR_CANCEL - - JUST_IN_TIME - - GOOD_TIL_TIME - type: string - shares_cancelled: - type: string - shares_owned: - type: string - shares_withdrawn: - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - tranche_key: - type: string - type: object - withdrawable_shares: - type: string - type: object - default: - description: An unexpected error response. - schema: - properties: - code: - format: int32 - type: integer - details: - items: - properties: - type_url: + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. type: string - value: - format: byte + reserves_maker_denom: type: string type: object type: array - error: - type: string - message: - type: string - type: object - summary: Queries a LimitOrderTrancheUser by index. - tags: - - Query - /neutron/dex/params: - get: - operationId: Params - responses: - '200': - description: A successful response. - schema: - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - properties: - params: - description: params holds all the parameters of this module. - properties: - fee_tiers: - items: - format: uint64 - type: string - type: array - good_til_purge_allowance: - format: uint64 - type: string - max_jits_per_block: - format: uint64 - type: string - paused: - type: boolean - type: object type: object default: description: An unexpected error response. @@ -41360,17 +42981,21 @@ paths: message: type: string type: object - summary: Parameters queries the parameters of the module. + summary: Queries a list of PoolReserves items. tags: - Query - /neutron/dex/pool/{pair_id}/{tick_index}/{fee}: + /neutron/dex/pool_reserves/{pair_id}/{token_in}/{tick_index}/{fee}: get: - operationId: Pool + operationId: PoolReserves parameters: - in: path name: pair_id required: true type: string + - in: path + name: token_in + required: true + type: string - format: int64 in: path name: tick_index @@ -41378,69 +43003,54 @@ paths: type: string - format: uint64 in: path - name: fee - required: true - type: string - responses: - '200': - description: A successful response. - schema: - properties: - pool: - properties: - id: - format: uint64 - type: string - lower_tick0: - properties: - key: - properties: - fee: - format: uint64 - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: + name: fee + required: true + type: string + responses: + '200': + description: A successful response. + schema: + properties: + pool_reserves: + properties: + key: + properties: + fee: + format: uint64 type: string - reserves_maker_denom: + tick_index_taker_to_maker: + format: int64 type: string - type: object - upper_tick1: - properties: - key: + trade_pair_id: properties: - fee: - format: uint64 + maker_denom: type: string - tick_index_taker_to_maker: - format: int64 + taker_denom: type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: - type: string - reserves_maker_denom: - type: string type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in the + opposite token. (ie. 1 TokenA with a maker_price of 10 is + worth 10 TokenB ) + type: string + price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an internal + implementation detail and will be removed in a future + release. + + It is being kept strictly for backwards compatibility. The + actual field value is unused. + type: string + price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in future + release, `maker_price` should always be used. + type: string + reserves_maker_denom: + type: string type: object type: object default: @@ -41465,78 +43075,60 @@ paths: message: type: string type: object - summary: Queries a pool by pair, tick and fee + summary: Queries a PoolReserve by index tags: - Query - /neutron/dex/pool/{pool_id}: + /neutron/dex/simulate_cancel_limit_order: get: - operationId: PoolByID + operationId: SimulateCancelLimitOrder parameters: - - format: uint64 - in: path - name: pool_id - required: true + - in: query + name: msg.creator + required: false + type: string + - in: query + name: msg.tranche_key + required: false type: string responses: '200': description: A successful response. schema: properties: - pool: + resp: properties: - id: - format: uint64 - type: string - lower_tick0: + maker_coin_out: + description: >- + 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. properties: - key: - properties: - fee: - format: uint64 - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: + amount: type: string - reserves_maker_denom: + denom: type: string type: object - upper_tick1: + title: Total amount of maker reserves that were canceled + taker_coin_out: + description: >- + 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. properties: - key: - properties: - fee: - format: uint64 - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: + amount: type: string - reserves_maker_denom: + denom: type: string type: object + title: Total amount of taker reserves that were withdrawn type: object type: object default: @@ -41561,123 +43153,102 @@ paths: message: type: string type: object - summary: Queries a pool by ID + summary: Simulates MsgCancelLimitOrder tags: - Query - /neutron/dex/pool_metadata: + /neutron/dex/simulate_deposit: get: - operationId: PoolMetadataAll + operationId: SimulateDeposit parameters: - - description: |- - 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. - format: byte - in: query - name: pagination.key + - in: query + name: msg.creator required: false type: string - - description: >- - 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. - format: uint64 - in: query - name: pagination.offset + - in: query + name: msg.receiver required: false type: string - - description: >- - 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. - format: uint64 - in: query - name: pagination.limit + - in: query + name: msg.token_a required: false type: string - - description: >- - 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. + - in: query + name: msg.token_b + required: false + type: string + - collectionFormat: multi in: query - name: pagination.count_total + items: + type: string + name: msg.amounts_a required: false - type: boolean - - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 + type: array + - collectionFormat: multi in: query - name: pagination.reverse + items: + type: string + name: msg.amounts_b required: false - type: boolean + type: array + - collectionFormat: multi + in: query + items: + format: int64 + type: string + name: msg.tick_indexes_a_to_b + required: false + type: array + - collectionFormat: multi + in: query + items: + format: uint64 + type: string + name: msg.fees + required: false + type: array responses: '200': description: A successful response. schema: properties: - pagination: - description: >- - 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; - } + resp: properties: - next_key: - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - format: byte - type: string - total: - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - type: string - type: object - pool_metadata: - items: - properties: - fee: - format: uint64 + failed_deposits: + items: + properties: + deposit_idx: + format: uint64 + type: string + error: + type: string + type: object + type: array + reserve0_deposited: + items: type: string - id: - format: uint64 + type: array + reserve1_deposited: + items: type: string - pair_id: + type: array + shares_issued: + items: + description: >- + 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. properties: - token0: + amount: type: string - token1: + denom: type: string type: object - tick: - format: int64 - type: string - type: object - type: array + type: array + type: object type: object default: description: An unexpected error response. @@ -41701,41 +43272,84 @@ paths: message: type: string type: object - summary: Queries a list of PoolMetadata items. + summary: Simulates MsgDeposit tags: - Query - /neutron/dex/pool_metadata/{id}: + /neutron/dex/simulate_multi_hop_swap: get: - operationId: PoolMetadata + operationId: SimulateMultiHopSwap parameters: - - format: uint64 - in: path - name: id - required: true + - in: query + name: msg.creator + required: false + type: string + - in: query + name: msg.receiver + required: false + type: string + - in: query + name: msg.amount_in + required: false + type: string + - in: query + name: msg.exit_limit_price + required: false type: string + - description: >- + If pickBestRoute == true then all routes are run and the route with + the + + best price is chosen otherwise, the first succesful route is used. + in: query + name: msg.pick_best_route + required: false + type: boolean responses: '200': description: A successful response. schema: properties: - Pool_metadata: + resp: properties: - fee: - format: uint64 - type: string - id: - format: uint64 - type: string - pair_id: + coin_out: + description: >- + 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. properties: - token0: + amount: type: string - token1: + denom: type: string type: object - tick: - format: int64 - type: string + dust: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array + route: + properties: + hops: + items: + type: string + type: array + type: object type: object type: object default: @@ -41760,137 +43374,228 @@ paths: message: type: string type: object - summary: Queries a PoolMetadata by ID + summary: Simulates MsgMultiHopSwap tags: - Query - /neutron/dex/pool_reserves/{pair_id}/{token_in}: + /neutron/dex/simulate_place_limit_order: get: - operationId: PoolReservesAll + operationId: SimulatePlaceLimitOrder parameters: - - in: path - name: pair_id - required: true + - in: query + name: msg.creator + required: false type: string - - in: path - name: token_in - required: true + - in: query + name: msg.receiver + required: false type: string - - description: |- - 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. - format: byte - in: query - name: pagination.key + - in: query + name: msg.token_in + required: false + type: string + - in: query + name: msg.token_out required: false type: string - description: >- - 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. - format: uint64 + DEPRECATED: tick_index_in_to_out will be removed in future release; + limit_sell_price should be used instead. + format: int64 in: query - name: pagination.offset + name: msg.tick_index_in_to_out required: false type: string - - description: >- - 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. - format: uint64 + - in: query + name: msg.amount_in + required: false + type: string + - default: GOOD_TIL_CANCELLED + enum: + - GOOD_TIL_CANCELLED + - FILL_OR_KILL + - IMMEDIATE_OR_CANCEL + - JUST_IN_TIME + - GOOD_TIL_TIME in: query - name: pagination.limit + name: msg.order_type required: false type: string - - description: >- - 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. + - description: expirationTime is only valid iff orderType == GOOD_TIL_TIME. + format: date-time in: query - name: pagination.count_total + name: msg.expiration_time required: false - type: boolean + type: string + - in: query + name: msg.max_amount_out + required: false + type: string + - in: query + name: msg.limit_sell_price + required: false + type: string - description: >- - reverse is set to true if results are to be returned in the - descending order. + min_average_sell_price is an optional parameter that sets a required + minimum average price for the entire trade. + if the min_average_sell_price is not met the trade will fail. - Since: cosmos-sdk 0.43 + If min_average_sell_price is omitted limit_sell_price will be used + instead. in: query - name: pagination.reverse + name: msg.min_average_sell_price required: false - type: boolean + type: string responses: '200': description: A successful response. schema: properties: - pagination: - description: >- - PageResponse is to be embedded in gRPC response messages where - the + resp: + properties: + coin_in: + description: >- + Coin defines a token with a denomination and an amount. - corresponding request message has used PageRequest. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - properties: - next_key: - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - format: byte - type: string - total: - format: uint64 + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of coin used for the limit order + taker_coin_in: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object title: >- - total is total number of results available if - PageRequest.count_total + Total amount of the token in that was immediately swapped + for takerOutCoin + taker_coin_out: + description: >- + Coin defines a token with a denomination and an amount. - was set, its value is undefined otherwise + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + Total amount of coin received from the taker portion of + the limit order + + This is the amount of coin immediately available in the + users account after + + executing the limit order. It does not include any future + proceeds from the + + maker portion which will have withdrawn in the future + trancheKey: type: string type: object - pool_reserves: - items: - properties: - key: - properties: - fee: - format: uint64 - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: type: string - reserves_maker_denom: + value: + format: byte type: string type: object type: array + error: + type: string + message: + type: string + type: object + summary: Simulates MsgPlaceLimitOrder + tags: + - Query + /neutron/dex/simulate_withdraw_filled_limit_order: + get: + operationId: SimulateWithdrawFilledLimitOrder + parameters: + - in: query + name: msg.creator + required: false + type: string + - in: query + name: msg.tranche_key + required: false + type: string + responses: + '200': + description: A successful response. + schema: + properties: + resp: + properties: + maker_coin_out: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: >- + Total amount of maker reserves that were withdrawn --only + applies to inactive LimitOrders + taker_coin_out: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + title: Total amount of taker reserves that were withdrawn + type: object type: object default: description: An unexpected error response. @@ -41914,60 +43619,80 @@ paths: message: type: string type: object - summary: Queries a list of PoolReserves items. + summary: Simulates MsgWithdrawFilledLimitOrder tags: - Query - /neutron/dex/pool_reserves/{pair_id}/{token_in}/{tick_index}/{fee}: + /neutron/dex/simulate_withdrawal: get: - operationId: PoolReserves + operationId: SimulateWithdrawal parameters: - - in: path - name: pair_id - required: true + - in: query + name: msg.creator + required: false type: string - - in: path - name: token_in - required: true + - in: query + name: msg.receiver + required: false type: string - - format: int64 - in: path - name: tick_index - required: true + - in: query + name: msg.token_a + required: false type: string - - format: uint64 - in: path - name: fee - required: true + - in: query + name: msg.token_b + required: false type: string + - collectionFormat: multi + in: query + items: + type: string + name: msg.shares_to_remove + required: false + type: array + - collectionFormat: multi + in: query + items: + format: int64 + type: string + name: msg.tick_indexes_a_to_b + required: false + type: array + - collectionFormat: multi + in: query + items: + format: uint64 + type: string + name: msg.fees + required: false + type: array responses: '200': description: A successful response. schema: properties: - pool_reserves: + resp: properties: - key: - properties: - fee: - format: uint64 - type: string - tick_index_taker_to_maker: - format: int64 - type: string - trade_pair_id: - properties: - maker_denom: - type: string - taker_denom: - type: string - type: object - type: object - price_opposite_taker_to_maker: - type: string - price_taker_to_maker: + reserve0_withdrawn: type: string - reserves_maker_denom: + reserve1_withdrawn: type: string + shares_burned: + items: + description: >- + 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. + properties: + amount: + type: string + denom: + type: string + type: object + type: array type: object type: object default: @@ -41992,7 +43717,7 @@ paths: message: type: string type: object - summary: Queries a PoolReserve by index + summary: Simulates MsgWithdrawal tags: - Query /neutron/dex/tick_liquidity/{pair_id}/{token_in}: @@ -42129,7 +43854,16 @@ paths: tranche_key: type: string type: object + maker_price: + title: >- + This is the price of the LimitOrder denominated in + the opposite token. (ie. 1 TokenA with a maker_price + of 10 is worth 10 TokenB ) + type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -42158,9 +43892,25 @@ paths: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves denominated in + the opposite token. (ie. 1 TokenA with a maker_price + of 10 is worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an + internal implementation detail and will be removed + in a future release. + + It is being kept strictly for backwards + compatibility. The actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed in + future release, `maker_price` should always be used. type: string reserves_maker_denom: type: string @@ -42308,9 +44058,26 @@ paths: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves + denominated in the opposite token. (ie. 1 TokenA + with a maker_price of 10 is worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an + internal implementation detail and will be + removed in a future release. + + It is being kept strictly for backwards + compatibility. The actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed + in future release, `maker_price` should always + be used. type: string reserves_maker_denom: type: string @@ -42333,9 +44100,26 @@ paths: type: string type: object type: object + maker_price: + title: >- + This is the price of the PoolReserves + denominated in the opposite token. (ie. 1 TokenA + with a maker_price of 10 is worth 10 TokenB ) + type: string price_opposite_taker_to_maker: + description: >- + DEPRECATED: price_opposite_taker_maker was an + internal implementation detail and will be + removed in a future release. + + It is being kept strictly for backwards + compatibility. The actual field value is unused. type: string price_taker_to_maker: + description: >- + DEPRECATED: price_taker_to_maker will be removed + in future release, `maker_price` should always + be used. type: string reserves_maker_denom: type: string @@ -42488,6 +44272,7 @@ paths: - GOOD_TIL_TIME type: string shares_cancelled: + title: 'TODO: remove this in next release. It is no longer used' type: string shares_owned: type: string @@ -42741,6 +44526,53 @@ paths: summary: TotalBurnedNeutronsAmount queries total amount of burned neutron fees. tags: - Query + /neutron/ibc-rate-limit/v1beta1/params: + get: + operationId: Params + responses: + '200': + description: A successful response. + schema: + description: >- + aramsResponse is the response type for the Query/Params RPC + method. + properties: + params: + description: params defines the parameters of the module. + properties: + contract_address: + type: string + type: object + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: >- + Params defines a gRPC query method that returns the ibc-rate-limit + module's + + parameters. + tags: + - Query /neutron/interchainqueries/params: get: operationId: Params @@ -42755,6 +44587,16 @@ paths: params: description: params holds all the parameters of this module. properties: + max_kv_query_keys_count: + format: uint64 + title: Maximum amount of keys in a registered key value query + type: string + max_transactions_filters: + format: uint64 + title: >- + max_transactions_filters defines maximum allowed amount of + tx filters in msgRegisterInterchainQuery + type: string query_deposit: description: Amount of coins deposited for the query. items: @@ -43685,7 +45527,7 @@ paths: QueryBeforeSendHookAddressResponse defines the response structure for the - DenomBeforeSendHook gRPC query. + BeforeSendHookAddress gRPC query. properties: contract_addr: type: string @@ -43717,6 +45559,56 @@ paths: getting the address registered for the before send hook. tags: - Query + /osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/full_denom: + get: + operationId: FullDenom + parameters: + - in: path + name: creator + required: true + type: string + - in: path + name: subdenom + required: true + type: string + responses: + '200': + description: A successful response. + schema: + description: |- + QueryFullDenomResponse defines the response structure for the + FullDenom gRPC query. + properties: + full_denom: + type: string + type: object + default: + description: An unexpected error response. + schema: + properties: + code: + format: int32 + type: integer + details: + items: + properties: + type_url: + type: string + value: + format: byte + type: string + type: object + type: array + error: + type: string + message: + type: string + type: object + summary: |- + FullDenom defines a gRPC query method for getting full denom name + from the creator and subdenom strings. + tags: + - Query /osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}: get: operationId: DenomsFromCreator diff --git a/go.mod b/go.mod index e47c98848..24c48db9f 100644 --- a/go.mod +++ b/go.mod @@ -1,110 +1,72 @@ -module github.com/neutron-org/neutron/v4 +module github.com/neutron-org/neutron/v5 -go 1.22.3 +go 1.22.6 require ( - cosmossdk.io/client/v2 v2.0.0-beta.1 - cosmossdk.io/core v0.11.0 + cosmossdk.io/client/v2 v2.0.0-beta.4 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 - cosmossdk.io/log v1.3.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 - cosmossdk.io/x/tx v0.13.3 - cosmossdk.io/x/upgrade v0.1.3 - github.com/CosmWasm/wasmd v0.51.0 - github.com/CosmWasm/wasmvm/v2 v2.0.0 - github.com/cometbft/cometbft v0.38.7 + cosmossdk.io/x/tx v0.13.5 + cosmossdk.io/x/upgrade v0.1.4 + github.com/CosmWasm/wasmd v0.53.0 + github.com/CosmWasm/wasmvm/v2 v2.1.3 + github.com/cometbft/cometbft v0.38.11 github.com/cosmos/admin-module/v2 v2.0.0-20240430142959-8b3328d1b1a2 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.5.0 - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1 - github.com/cosmos/ibc-go/modules/capability v1.0.0 - github.com/cosmos/ibc-go/v8 v8.2.1 - github.com/cosmos/ics23/go v0.10.0 - github.com/cosmos/interchain-security/v5 v5.0.0 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2 + github.com/cosmos/ibc-go/modules/capability v1.0.1 + github.com/cosmos/ibc-go/v8 v8.5.1 + github.com/cosmos/ics23/go v0.11.0 + github.com/cosmos/interchain-security/v5 v5.1.1 github.com/gogo/protobuf v1.3.3 github.com/golang/mock v1.6.0 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/grpc-ecosystem/grpc-gateway/v2 v2.19.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 github.com/hashicorp/go-metrics v0.5.3 - github.com/iancoleman/orderedmap v0.3.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.19.1 - github.com/rs/zerolog v1.32.0 - github.com/skip-mev/block-sdk/v2 v2.1.2 - github.com/skip-mev/feemarket v1.0.3 - github.com/skip-mev/slinky v1.0.3 - github.com/spf13/cast v1.6.0 + github.com/prometheus/client_golang v1.20.5 + github.com/rs/zerolog v1.33.0 + github.com/skip-mev/block-sdk/v2 v2.1.5 + github.com/skip-mev/feemarket v1.1.1 + github.com/skip-mev/slinky v1.0.12 + github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 - google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 - google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.2 + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 + google.golang.org/grpc v1.67.1 + google.golang.org/protobuf v1.35.1 gopkg.in/yaml.v2 v2.4.0 ) require ( - github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/StackExchange/wmi v1.2.1 // indirect - github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect - github.com/blendle/zapdriver v1.3.1 // indirect - github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.12.1 // indirect - github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect - github.com/ethereum/c-kzg-4844 v1.0.0 // indirect - github.com/ethereum/go-ethereum v1.14.5 // indirect - github.com/gagliardetto/binary v0.8.0 // indirect - github.com/gagliardetto/solana-go v1.10.0 // indirect - github.com/gagliardetto/treeout v0.1.4 // indirect - github.com/go-ole/go-ole v1.3.0 // indirect - github.com/holiman/uint256 v1.2.4 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/logrusorgru/aurora v2.0.3+incompatible // indirect - github.com/mmcloughlin/addchain v0.4.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect - github.com/mr-tron/base58 v1.2.0 // indirect - github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 // indirect - github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect - github.com/supranational/blst v0.3.11 // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect - go.mongodb.org/mongo-driver v1.11.0 // indirect - go.uber.org/mock v0.4.0 // indirect - go.uber.org/ratelimit v0.2.0 // indirect - go.uber.org/zap v1.27.0 // indirect - rsc.io/tmplfunc v0.0.3 // indirect -) - -require ( - cloud.google.com/go v0.114.0 // indirect - cloud.google.com/go/auth v0.5.1 // indirect + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.6.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect - cloud.google.com/go/compute/metadata v0.3.0 // indirect - cloud.google.com/go/iam v1.1.8 // indirect + cloud.google.com/go/compute/metadata v0.5.0 // indirect + cloud.google.com/go/iam v1.1.9 // indirect cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/x/circuit v0.1.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/GeertJohan/go.rice v1.0.3 // 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 @@ -112,31 +74,28 @@ require ( github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/btcsuite/btcd v0.22.0-beta // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.1 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft-db v0.11.0 // indirect + github.com/cometbft/cometbft-db v0.12.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.2.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect - github.com/daaku/go.zipexe v1.0.2 // indirect github.com/danieljoos/wincred v1.2.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/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/distribution/reference v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect @@ -153,34 +112,36 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.2.1 // indirect + github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect + github.com/google/flatbuffers v1.12.1 // 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.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.4 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect github.com/gorilla/handlers v1.5.2 // indirect - github.com/gorilla/rpc v1.2.0 // indirect github.com/gorilla/websocket v1.5.3 // 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/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.4 // indirect + github.com/hashicorp/go-getter v1.7.5 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -190,7 +151,6 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.9 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect @@ -201,21 +161,24 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.52.2 // indirect - github.com/prometheus/procfs v0.13.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/shamaton/msgpack/v2 v2.2.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect @@ -225,25 +188,27 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/api v0.180.0 // indirect - google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/api v0.186.0 // indirect + google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect @@ -254,11 +219,13 @@ require ( replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.51.0 - github.com/cosmos/admin-module/v2 => github.com/neutron-org/admin-module/v2 v2.0.0 - github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.7-neutron + github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.53.0-neutron + github.com/cometbft/cometbft => github.com/neutron-org/cometbft v0.0.0-20241111105801-a7fe160b0b62 + github.com/cosmos/admin-module/v2 => github.com/neutron-org/admin-module/v2 v2.0.2 + github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.9-neutron.0.20240924163649-207f347e9c53 // explicitely replace iavl to v1.2.0 cause sometimes go mod tidy uses not right version github.com/cosmos/iavl => github.com/cosmos/iavl v1.2.0 + github.com/cosmos/interchain-security/v5 => github.com/cosmos/interchain-security/v5 v5.0.0-20240802125602-fa1e09444aae github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/prometheus/procfs => github.com/prometheus/procfs v0.12.0 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 diff --git a/go.sum b/go.sum index 7ae72b2af..3ad97338a 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY= -cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -46,8 +46,8 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw= -cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s= +cloud.google.com/go/auth v0.6.0 h1:5x+d6b5zdezZ7gmLWD1m/xNjnaQ2YDhmIz/HH3doy1g= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= @@ -72,8 +72,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= +cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -111,8 +111,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.8 h1:r7umDwhj+BQyz0ScZMp4QrGXjSTI3ZINnpgU2nlB/K0= -cloud.google.com/go/iam v1.1.8/go.mod h1:GvE6lyMmfxXauzNq8NbgJbeVQNspG+tcdL/W8QO1+zE= +cloud.google.com/go/iam v1.1.9 h1:oSkYLVtVme29uGYrOcKcvJRht7cHJpYD09GM9JaR0TE= +cloud.google.com/go/iam v1.1.9/go.mod h1:Nt1eDWNYH9nGQg3d/mY7U1hvfGmsaG9o/kLGoLoLXjQ= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -188,18 +188,18 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= -cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= +cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUrQIg= +cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -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/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= 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/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= @@ -212,62 +212,48 @@ cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= cosmossdk.io/x/nft v0.1.1 h1:pslAVS8P5NkW080+LWOamInjDcq+v2GSCo+BjN9sxZ8= cosmossdk.io/x/nft v0.1.1/go.mod h1:Kac6F6y2gsKvoxU+fy8uvxRTi4BIhLOor2zgCNQwVgY= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= +cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= -github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmvm/v2 v2.0.0 h1:IqNCI2G0mvs7K6ej17/I28805rVqnu+Y1cWDqIdwb08= -github.com/CosmWasm/wasmvm/v2 v2.0.0/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck= +github.com/CosmWasm/wasmvm/v2 v2.1.3 h1:CSJTauZqkHyb9yic6JVYCjiGUgxI2MJV2QzfSu8m49c= +github.com/CosmWasm/wasmvm/v2 v2.1.3/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= -github.com/GeertJohan/go.rice v1.0.3 h1:k5viR+xGtIhF61125vCE1cmJ5957RQGXG6dmbaWZSmI= -github.com/GeertJohan/go.rice v1.0.3/go.mod h1:XVdrU4pW00M4ikZed5q56tPf1v2KwnIKeIdc9CBYNt4= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= -github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= -github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= 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= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= -github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= @@ -289,8 +275,6 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= -github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= @@ -310,8 +294,6 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtE github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -319,9 +301,6 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -354,29 +333,23 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= 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.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= -github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= 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/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= +github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= 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-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= -github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= -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/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= -github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= -github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= +github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= +github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -392,37 +365,30 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1 h1:BHn+JWZILxkUT9IrlP1ctUfo9ENGi+EmiZ9om1XSHIw= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= -github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= -github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= -github.com/cosmos/ibc-go/v8 v8.2.1 h1:MTsnZZjxvGD4Fv5pYyx5UkELafSX0rlPt6IfsE2BpTQ= -github.com/cosmos/ibc-go/v8 v8.2.1/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= -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/interchain-security/v5 v5.0.0 h1:iwHu1nFbXuYfa13isEgm6hkHU+2t/t56YjcfyP3PnQA= -github.com/cosmos/interchain-security/v5 v5.0.0/go.mod h1:h/RkwOppo5AJj+1pkQyfjqU1MPdpohD/S6oEeAXpGZY= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2 h1:dyLNlDElY6+5zW/BT/dO/3Ad9FpQblfh+9dQpYQodbA= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= +github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd h1:Lx+/5dZ/nN6qPXP2Ofog6u1fmlkCFA1ElcOconnofEM= +github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd/go.mod h1:JWfpWVKJKiKtd53/KbRoKfxWl8FsT2GPcNezTOk0o5Q= +github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= +github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= +github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= +github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/interchain-security/v5 v5.0.0-20240802125602-fa1e09444aae h1:/EWV9qryltapge0v4ctvl2jV3Nne5nsbd+GYblj/jWA= +github.com/cosmos/interchain-security/v5 v5.0.0-20240802125602-fa1e09444aae/go.mod h1:P3TM8JmE9Q20Jfch3jnFcQ4IXJp5twueRnUudi6XEGI= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= -github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= -github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= -github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/daaku/go.zipexe v1.0.2 h1:Zg55YLYTr7M9wjKn8SY/WcpuuEi+kR2u4E8RhvpyXmk= -github.com/daaku/go.zipexe v1.0.2/go.mod h1:5xWogtqlYnfBXkSB1o9xysukNP9GTvaNkqzUZbt3Bw8= github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -430,8 +396,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs 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/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= 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.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -439,9 +403,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3 github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -477,20 +440,12 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= -github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.14.5 h1:szuFzO1MhJmweXjoM5nSAeDvjNUH3vIQoMzzQnfvjpw= -github.com/ethereum/go-ethereum v1.14.5/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc= -github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4= -github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0/go.mod h1:D9AJLVXSyZQXJQVk8oh1EwjISE+sJTn2duYIZC0dy3w= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= -github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -501,16 +456,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 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/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= -github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= -github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= -github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= -github.com/gagliardetto/solana-go v1.10.0 h1:lDuHGC+XLxw9j8fCHBZM9tv4trI0PVhev1m9NAMaIdM= -github.com/gagliardetto/solana-go v1.10.0/go.mod h1:afBEcIRrDLJst3lvAahTr63m6W2Ns6dajZxe2irF7Jg= -github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= -github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -543,9 +488,6 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 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.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= -github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= 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.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -566,22 +508,18 @@ github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= -github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= +github.com/golang/glog v1.2.2/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-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -619,7 +557,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu 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= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= @@ -628,6 +565,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -675,7 +614,6 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 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/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/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.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -695,8 +633,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= 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.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= -github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -706,8 +644,6 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk= -github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= @@ -720,21 +656,19 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= -github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= +github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -765,6 +699,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -775,20 +711,12 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= -github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= -github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= -github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= -github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -801,8 +729,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= 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/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= @@ -833,10 +759,7 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= @@ -844,7 +767,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -853,23 +775,16 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -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/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= 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/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= -github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= -github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= @@ -889,8 +804,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE 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.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= @@ -908,11 +821,6 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= -github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= -github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= -github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -920,13 +828,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= -github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= -github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -938,14 +843,15 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/neutron-org/admin-module/v2 v2.0.0 h1:MlkSc1821sQ+G5/cYOajuqZ5/lM53xTbixpTtXnHh0A= -github.com/neutron-org/admin-module/v2 v2.0.0/go.mod h1:RfOyabXsdJ5btcOKyKPZDYiZhtuKFubbJMOb8EJZtvA= -github.com/neutron-org/cosmos-sdk v0.50.7-neutron h1:L1TrOAySPz2xJSm9avp84u9HVkVH3oKZ2uVN5N6q4UI= -github.com/neutron-org/cosmos-sdk v0.50.7-neutron/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= -github.com/neutron-org/wasmd v0.51.0 h1:OBp5aG8xeEz199Crepwb3q6YtuJVL0sudsD7F2oyyfs= -github.com/neutron-org/wasmd v0.51.0/go.mod h1:7TSaj5HoolghujuVWeExqmcUKgpcYWEySGLSODbnnwY= +github.com/neutron-org/admin-module/v2 v2.0.2 h1:XDDFWjvkVBKRf3lBFCazT1zAXZ3dHX8GaZ4ol8Hdk8I= +github.com/neutron-org/admin-module/v2 v2.0.2/go.mod h1:RfOyabXsdJ5btcOKyKPZDYiZhtuKFubbJMOb8EJZtvA= +github.com/neutron-org/cometbft v0.0.0-20241111105801-a7fe160b0b62 h1:erXDgRxrEtWScO9i8ZYjr0cnjxTJ0BT+WrUsRMbMVSU= +github.com/neutron-org/cometbft v0.0.0-20241111105801-a7fe160b0b62/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/neutron-org/cosmos-sdk v0.50.9-neutron.0.20240924163649-207f347e9c53 h1:7FJOHOt9F0oea0b5jrn090u/zn7+LdBmT6ZDmrJtTqs= +github.com/neutron-org/cosmos-sdk v0.50.9-neutron.0.20240924163649-207f347e9c53/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= +github.com/neutron-org/wasmd v0.53.0-neutron h1:Dv1VP1+QjYeb6RMo03sxw0Pe42JU0MPxefwNaG22KVs= +github.com/neutron-org/wasmd v0.53.0-neutron/go.mod h1:FJl/aWjdpGof3usAMFQpDe07Rkx77PUzp0cygFMOvtw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nkovacs/streamquote v1.0.0/go.mod h1:BN+NaZ2CmdKqUuTUXUEm9j95B2TRbpOWpxbJYzzgUsc= 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= @@ -956,8 +862,6 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -975,8 +879,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -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/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -994,7 +898,6 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= @@ -1021,8 +924,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1037,8 +940,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= -github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1046,8 +949,6 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1058,12 +959,9 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -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/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= @@ -1074,10 +972,8 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shamaton/msgpack/v2 v2.2.0 h1:IP1m01pHwCrMa6ZccP9B3bqxEMKMSmMVAVKk54g3L/Y= +github.com/shamaton/msgpack/v2 v2.2.0/go.mod h1:6khjYnkx73f7VQU7wjcFS9DFjs+59naVWJv1TB7qdOI= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -1085,14 +981,14 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skip-mev/block-sdk/v2 v2.1.2 h1:fNKbrb+PVVzuU0JiSuWgBV4Afj5zZ1VeHQJp88wSl1g= -github.com/skip-mev/block-sdk/v2 v2.1.2/go.mod h1:kIq7SMva0/eHKTCiG/oI5XGxD4HNVK0t71TrUZqHcvA= +github.com/skip-mev/block-sdk/v2 v2.1.5 h1:3uoYG2ayP253wiohBPKdD3LrkJGd1Kgw914mmI1ZyOI= +github.com/skip-mev/block-sdk/v2 v2.1.5/go.mod h1:E8SvITZUdxkes3gI3+kgESZL+NLffkcLKnowUgYTOf4= github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610 h1:4JlsiRVt/YZOvrKH525T7sZXgEWUEjqSDMwE6fXNbdo= github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610/go.mod h1:kB8gFZX07CyJnw8q9iEZijI3qJTIe1K/Y++P5VGkrcg= -github.com/skip-mev/feemarket v1.0.3 h1:DpB1tj51MlFN5iOg1lN+fwWqSF62xdND46BqgTko0C4= -github.com/skip-mev/feemarket v1.0.3/go.mod h1:lszt7zGEEActbDYq1hOKogQvfCsnLEHH5113LwgmYcE= -github.com/skip-mev/slinky v1.0.3 h1:+7Yw+HHjYqJ7gb5nrG1k2bplNG+qEmn5wws+OesdY2M= -github.com/skip-mev/slinky v1.0.3/go.mod h1:EE3O71wIJ74OciYh62Fc5EysF07KArBEYb6lDmTIKVM= +github.com/skip-mev/feemarket v1.1.1 h1:L34K7N2J6o635kzNYRAvQ93+hAFtSiJ2t03jmaNx0zw= +github.com/skip-mev/feemarket v1.1.1/go.mod h1:DUa6djUsTeMOrbrcIZqWSVxU9IZNCXp96ruaojyBNpc= +github.com/skip-mev/slinky v1.0.12 h1:qmZHB6c5fgDhO/pv67YcZc2M25t3gZcceVmJtA9zjOo= +github.com/skip-mev/slinky v1.0.12/go.mod h1:8mxMdQ8MY8QAxgxLvUKTfDwX6XCAUeqZwkU/r+ZsELU= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1100,33 +996,21 @@ github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ 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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 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.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= -github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= -github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 h1:RN5mrigyirb8anBEtdjtHFIufXdacyTi6i4KBfeNXeo= -github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -1148,30 +1032,16 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= -github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= -github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= -github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= -github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= @@ -1179,20 +1049,8 @@ 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/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= -github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1205,11 +1063,9 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.mongodb.org/mongo-driver v1.11.0 h1:FZKhBSTydeuffHj9CBjXlR8vQLee1cQyTWYPA6/tqiE= -go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1238,10 +1094,7 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= @@ -1252,19 +1105,15 @@ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA= -go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= 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.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1275,10 +1124,8 @@ golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1290,8 +1137,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 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-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= 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-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1368,7 +1215,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1381,8 +1227,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1408,8 +1254,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 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= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1425,8 +1271,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/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.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1435,7 +1281,6 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1445,11 +1290,9 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1523,16 +1366,14 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= 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= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1543,8 +1384,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= 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= @@ -1671,8 +1512,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.180.0 h1:M2D87Yo0rGBPWpo1orwfCLehUUL6E7/TYe5gvMQWDh4= -google.golang.org/api v0.180.0/go.mod h1:51AiyoEg1MJPSZ9zvklA8VnRILPXxn1iVen9v25XHAE= +google.golang.org/api v0.186.0 h1:n2OPp+PPXX0Axh4GuSsL5QL8xQCTb2oDwyzPnQvqUug= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= 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.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1788,12 +1629,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda h1:wu/KJm9KJwpfHWhkkZGohVC6KRrc1oJNr4jwtQMOQXw= -google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw= -google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 h1:QW9+G6Fir4VcRXVH8x3LilNAb6cxBGLa6+GM4hRwexE= -google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1835,8 +1676,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= 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= @@ -1853,8 +1694,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= 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= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1869,8 +1710,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1906,8 +1745,6 @@ 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/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/network/hermes/config.toml b/network/hermes/config.toml index 4e311112d..2fc90b678 100644 --- a/network/hermes/config.toml +++ b/network/hermes/config.toml @@ -130,4 +130,5 @@ clock_drift = '5s' max_block_time = '10s' trusting_period = '14days' trust_threshold = { numerator = '1', denominator = '3' } -address_type = { derivation = 'cosmos' } \ No newline at end of file +address_type = { derivation = 'cosmos' } +dynamic_gas_price = { enabled = false, multiplier = 1.1, max = 0.6 } \ No newline at end of file diff --git a/network/init-gaiad.sh b/network/init-gaiad.sh index 59a437e75..018d1de03 100755 --- a/network/init-gaiad.sh +++ b/network/init-gaiad.sh @@ -8,8 +8,21 @@ CHAIN_DIR="$BASE_DIR/$CHAINID" STAKEDENOM=${STAKEDENOM:-stake} +function set_genesis_param_jq() { + param_path=$1 + param_value=$2 + jq "${param_path} = ${param_value}" > tmp_genesis_file.json < "$CHAIN_DIR/config/genesis.json" && mv tmp_genesis_file.json "$CHAIN_DIR/config/genesis.json" +} + echo "Creating and collecting gentx..." $BINARY genesis gentx val1 "7000000000$STAKEDENOM" --home "$CHAIN_DIR" --chain-id "$CHAINID" --keyring-backend test $BINARY genesis collect-gentxs --home "$CHAIN_DIR" sed -i -e 's/\*/\/cosmos.bank.v1beta1.MsgSend\", \"\/cosmos.staking.v1beta1.MsgDelegate\", \"\/cosmos.staking.v1beta1.MsgUndelegate/g' "$CHAIN_DIR/config/genesis.json" + +set_genesis_param_jq ".app_state.feemarket.params.enabled" "false" # feemarket +set_genesis_param_jq ".app_state.feemarket.params.fee_denom" "\"uatom\"" # feemarket +set_genesis_param_jq ".app_state.feemarket.state.base_gas_price" "\"0.0025\"" # feemarket +set_genesis_param_jq ".app_state.feemarket.params.min_base_gas_price" "\"0.0025\"" # feemarket + +set_genesis_param_jq ".app_state.ibc.client_genesis.params.allowed_clients" "[\"*\"]" # ibc \ No newline at end of file diff --git a/network/init-neutrond.sh b/network/init-neutrond.sh index 563572a2b..1e4ac6a08 100755 --- a/network/init-neutrond.sh +++ b/network/init-neutrond.sh @@ -53,6 +53,12 @@ CW4_GROUP_CONTRACT=$THIRD_PARTY_CONTRACTS_DIR/cw4_group.wasm NEUTRON_CHAIN_MANAGER_CONTRACT=$CONTRACTS_BINARIES_DIR/neutron_chain_manager.wasm +# Slinky genesis configs +USE_CORE_MARKETS=${USE_CORE_MARKETS:-true} +USE_RAYDIUM_MARKETS=${USE_RAYDIUM_MARKETS:-false} +USE_UNISWAPV3_BASE_MARKETS=${USE_UNISWAPV3_BASE_MARKETS:-false} +USE_COINGECKO_MARKETS=${USE_COINGECKO_MARKETS:-false} + echo "Add consumer section..." $BINARY add-consumer-section --home "$CHAIN_DIR" ### PARAMETERS SECTION @@ -719,12 +725,25 @@ function convert_bech32_base64_esc() { DAO_CONTRACT_ADDRESS_B64=$(convert_bech32_base64_esc "$DAO_CONTRACT_ADDRESS") echo $DAO_CONTRACT_ADDRESS_B64 +echo "Adding marketmap into genesis..." +go run network/slinky_genesis.go --use-core=$USE_CORE_MARKETS --use-raydium=$USE_RAYDIUM_MARKETS --use-uniswapv3-base=$USE_UNISWAPV3_BASE_MARKETS --use-coingecko=$USE_COINGECKO_MARKETS --temp-file=markets.json +MARKETS=$(cat markets.json) + +NUM_MARKETS=$(echo "$MARKETS" | jq '.markets | length + 1') + +NUM_MARKETS=$NUM_MARKETS; jq --arg num "$NUM_MARKETS" '.app_state["oracle"]["next_id"] = $num' "$GENESIS_PATH" > genesis_tmp.json && mv genesis_tmp.json "$GENESIS_PATH" +MARKETS=$MARKETS; jq --arg markets "$MARKETS" '.app_state["marketmap"]["market_map"] = ($markets | fromjson)' "$GENESIS_PATH" > genesis_tmp.json && mv genesis_tmp.json "$GENESIS_PATH" +MARKETS=$MARKETS; jq --arg markets "$MARKETS" '.app_state["oracle"]["currency_pair_genesis"] += [$markets | fromjson | .markets | values | .[].ticker.currency_pair | {"currency_pair": {"Base": .Base, "Quote": .Quote}, "currency_pair_price": null, "nonce": 0} ]' "$GENESIS_PATH" > genesis_tmp.json && mv genesis_tmp.json "$GENESIS_PATH" +MARKETS=$MARKETS; jq --arg markets "$MARKETS" '.app_state["oracle"]["currency_pair_genesis"] |= (to_entries | map(.value += {id: (.key + 1)} | .value))' "$GENESIS_PATH" > genesis_tmp.json && mv genesis_tmp.json "$GENESIS_PATH" + +rm markets.json + +echo "Setting the rest of Neutron genesis params..." set_genesis_param admins "[\"$NEUTRON_CHAIN_MANAGER_CONTRACT_ADDRESS\"]" # admin module set_genesis_param treasury_address "\"$DAO_CONTRACT_ADDRESS\"" # feeburner set_genesis_param fee_collector_address "\"$DAO_CONTRACT_ADDRESS\"," # tokenfactory set_genesis_param security_address "\"$SECURITY_SUBDAO_CORE_CONTRACT_ADDRESS\"," # cron set_genesis_param limit 5 # cron -#set_genesis_param allow_messages "[\"*\"]" # interchainaccounts set_genesis_param signed_blocks_window "\"$SLASHING_SIGNED_BLOCKS_WINDOW\"," # slashing set_genesis_param min_signed_per_window "\"$SLASHING_MIN_SIGNED\"," # slashing set_genesis_param slash_fraction_double_sign "\"$SLASHING_FRACTION_DOUBLE_SIGN\"," # slashing diff --git a/network/slinky_genesis.go b/network/slinky_genesis.go new file mode 100644 index 000000000..251dfa984 --- /dev/null +++ b/network/slinky_genesis.go @@ -0,0 +1,206 @@ +package main + +import ( + "encoding/json" + "flag" + "fmt" + + "github.com/skip-mev/slinky/cmd/constants/marketmaps" + "github.com/skip-mev/slinky/providers/apis/coinmarketcap" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" + "github.com/skip-mev/slinky/x/marketmap/types/tickermetadata" +) + +var ( + convertToCMC = flag.Bool("convert-to-cmc", false, "convert to coinmarketcap markets") + marketFile = flag.String("market-config-path", "", "market file to convert to coinmarketcap markets") + autoEnable = flag.Bool("auto-enable", false, "auto enable markets") + isMMDeployment = flag.Bool("is-mm-deployment", false, "is market map deployment") + useCore = flag.Bool("use-core", false, "use core markets") + useRaydium = flag.Bool("use-raydium", false, "use raydium markets") + useUniswapV3Base = flag.Bool("use-uniswapv3-base", false, "use uniswapv3 base markets") + useCoinGecko = flag.Bool("use-coingecko", false, "use coingecko markets") + useCoinMarketCap = flag.Bool("use-coinmarketcap", false, "use coinmarketcap markets") + useOsmosis = flag.Bool("use-osmosis", false, "use osmosis markets") + usePolymarket = flag.Bool("use-polymarket", false, "use polymarket markets") + tempFile = flag.String("temp-file", "markets.json", "temporary file to store the market map") +) + +func main() { + // Based on the flags, we determine what market.json to configure. By default, we use Core markets. + // If the user specifies a different market.json, we use that instead. + flag.Parse() + + if *isMMDeployment { + if *marketFile == "" { + fmt.Fprintf(flag.CommandLine.Output(), "market map config path (market-cfg-path) cannot be empty\n") + panic("market map config path (market-cfg-path) cannot be empty") + } + + marketMap, err := mmtypes.ReadMarketMapFromFile(*marketFile) + if err != nil { + fmt.Fprintf(flag.CommandLine.Output(), "failed to read market map from file: %s\n", err) + panic(err) + } + + if *convertToCMC { + marketMap = filterToOnlyCMCMarkets(marketMap) + } + + if *autoEnable { + marketMap = enableAllMarkets(marketMap) + } + + // Write the market map back to the original file. + if err := mmtypes.WriteMarketMapToFile(marketMap, *marketFile); err != nil { + fmt.Fprintf(flag.CommandLine.Output(), "failed to write market map to file: %s\n", err) + panic(err) + } + + return + } + + marketMap := mmtypes.MarketMap{ + Markets: make(map[string]mmtypes.Market), + } + + if *useCore { + fmt.Fprintf(flag.CommandLine.Output(), "Using core markets\n") + marketMap = mergeMarketMaps(marketMap, marketmaps.CoreMarketMap) + } + + if *useRaydium { + fmt.Fprintf(flag.CommandLine.Output(), "Using raydium markets\n") + marketMap = mergeMarketMaps(marketMap, marketmaps.RaydiumMarketMap) + } + + if *useUniswapV3Base { + fmt.Fprintf(flag.CommandLine.Output(), "Using uniswapv3 base markets\n") + marketMap = mergeMarketMaps(marketMap, marketmaps.UniswapV3BaseMarketMap) + } + + if *useCoinGecko { + fmt.Fprintf(flag.CommandLine.Output(), "Using coingecko markets\n") + marketMap = mergeMarketMaps(marketMap, marketmaps.CoinGeckoMarketMap) + } + + if *useCoinMarketCap { + fmt.Fprintf(flag.CommandLine.Output(), "Using coinmarketcap markets\n") + marketMap = mergeMarketMaps(marketMap, marketmaps.CoinMarketCapMarketMap) + } + + if *useOsmosis { + fmt.Fprintf(flag.CommandLine.Output(), "Using osmosis markets\n") + marketMap = mergeMarketMaps(marketMap, marketmaps.OsmosisMarketMap) + } + + if *usePolymarket { + fmt.Fprintf(flag.CommandLine.Output(), "Using polymarket markets\n") + marketMap = mergeMarketMaps(marketMap, marketmaps.PolymarketMarketMap) + } + + if err := marketMap.ValidateBasic(); err != nil { + fmt.Fprintf(flag.CommandLine.Output(), "failed to validate market map: %s\n", err) + panic(err) + } + + // Write the market map to the temporary file. + if *tempFile == "" { + fmt.Fprintf(flag.CommandLine.Output(), "temp file cannot be empty\n") + panic("temp file cannot be empty") + } + + if err := mmtypes.WriteMarketMapToFile(marketMap, *tempFile); err != nil { + fmt.Fprintf(flag.CommandLine.Output(), "failed to write market map to file: %s\n", err) + panic(err) + } +} + +// mergeMarketMaps merges the two market maps together. If a market already exists in one of the maps, we +// merge based on the provider set. +func mergeMarketMaps(this, other mmtypes.MarketMap) mmtypes.MarketMap { + for name, otherMarket := range other.Markets { + // If the market does not exist in this map, we add it. + thisMarket, ok := this.Markets[name] + if !ok { + this.Markets[name] = otherMarket + continue + } + + seen := make(map[string]struct{}) + for _, provider := range thisMarket.ProviderConfigs { + key := providerConfigToKey(provider) + seen[key] = struct{}{} + } + + for _, provider := range otherMarket.ProviderConfigs { + key := providerConfigToKey(provider) + if _, ok := seen[key]; !ok { + thisMarket.ProviderConfigs = append(thisMarket.ProviderConfigs, provider) + } + } + + this.Markets[name] = thisMarket + } + + return this +} + +func providerConfigToKey(cfg mmtypes.ProviderConfig) string { + return cfg.Name + cfg.OffChainTicker +} + +// filterToOnlyCMCMarkets is a helper function that filters out all markets that are not from CoinMarketCap. It +// mutates the marketmap to only include CoinMarketCap markets. Notably the CMC ID will be pricing in the base +// asset. +func filterToOnlyCMCMarkets(marketmap mmtypes.MarketMap) mmtypes.MarketMap { + res := mmtypes.MarketMap{ + Markets: make(map[string]mmtypes.Market), + } + + // Filter out all markets that are not from CoinMarketCap. + for _, market := range marketmap.Markets { + var meta tickermetadata.DyDx + if err := json.Unmarshal([]byte(market.Ticker.Metadata_JSON), &meta); err != nil { + continue + } + + var id string + for _, aggregateID := range meta.AggregateIDs { + if aggregateID.Venue == "coinmarketcap" { + id = aggregateID.ID + break + } + } + + if len(id) == 0 { + continue + } + + resTicker := market.Ticker + resTicker.MinProviderCount = 1 + + providers := []mmtypes.ProviderConfig{ + { + Name: coinmarketcap.Name, + OffChainTicker: id, + }, + } + + res.Markets[resTicker.CurrencyPair.String()] = mmtypes.Market{ + Ticker: resTicker, + ProviderConfigs: providers, + } + } + + return res +} + +// enableAllMarkets is a helper function that enables all markets in the market map. +func enableAllMarkets(marketmap mmtypes.MarketMap) mmtypes.MarketMap { + for name, market := range marketmap.Markets { + market.Ticker.Enabled = true + marketmap.Markets[name] = market + } + return marketmap +} diff --git a/proto/buf.lock b/proto/buf.lock index 1e2a4c482..78d1386c9 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -4,16 +4,30 @@ 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: 5a6ab7bc14314acaa912d5e53aef1c2f + digest: shake256:02c00c73493720055f9b57553a35b5550023a3c1914123b247956288a78fb913aff70e66552777ae14d759467e119079d484af081264a5dd607a94d9fbc8116b - remote: buf.build owner: cosmos repository: gogo-proto commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba + - remote: buf.build + owner: cosmos + repository: ibc + commit: 6b221c7d310545198c1dafe70287d254 + digest: shake256:c5ea4d89af1c47f4d02057892eacdcb863359178079d9599f30d853b374fe9e9bfb3d9ca6720361c3439999a885a4f87fff4cd41c6c26b1f1142d60c386f8323 + - remote: buf.build + owner: cosmos + repository: ics23 + commit: 55085f7c710a45f58fa09947208eb70b + digest: shake256:9bf0bc495b5a11c88d163d39ef521bc4b00bc1374a05758c91d82821bdc61f09e8c2c51dda8452529bf80137f34d852561eacbe9550a59015d51cecb0dacb628 - remote: buf.build owner: googleapis repository: googleapis - commit: 7e6f6e774e29406da95bd61cdcdbc8bc + commit: f0e53af8f2fc4556b94f482688b57223 + digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95 diff --git a/proto/buf.yaml b/proto/buf.yaml index e47ac91b8..39930f27c 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -5,6 +5,7 @@ deps: - buf.build/cosmos/cosmos-sdk:v0.50.0 - buf.build/cosmos/gogo-proto - buf.build/googleapis/googleapis + - buf.build/cosmos/ibc # - buf.build/osmosis-labs/osmosis breaking: use: diff --git a/proto/gaia/globalfee/v1beta1/genesis.proto b/proto/gaia/globalfee/v1beta1/genesis.proto index 269b15413..e2ed073be 100644 --- a/proto/gaia/globalfee/v1beta1/genesis.proto +++ b/proto/gaia/globalfee/v1beta1/genesis.proto @@ -4,7 +4,7 @@ package gaia.globalfee.v1beta1; import "gaia/globalfee/v1beta1/params.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/globalfee/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/globalfee/types"; // GenesisState - initial state of module message GenesisState { diff --git a/proto/gaia/globalfee/v1beta1/params.proto b/proto/gaia/globalfee/v1beta1/params.proto index bced7cd69..473f84ae5 100644 --- a/proto/gaia/globalfee/v1beta1/params.proto +++ b/proto/gaia/globalfee/v1beta1/params.proto @@ -4,7 +4,7 @@ package gaia.globalfee.v1beta1; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/globalfee/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/globalfee/types"; // Params defines the set of module parameters. message Params { diff --git a/proto/gaia/globalfee/v1beta1/query.proto b/proto/gaia/globalfee/v1beta1/query.proto index ea8879f61..05e3de0e0 100644 --- a/proto/gaia/globalfee/v1beta1/query.proto +++ b/proto/gaia/globalfee/v1beta1/query.proto @@ -5,7 +5,7 @@ import "gaia/globalfee/v1beta1/params.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/globalfee/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/globalfee/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/gaia/globalfee/v1beta1/tx.proto b/proto/gaia/globalfee/v1beta1/tx.proto index ffbdc0d8a..e5410bf35 100644 --- a/proto/gaia/globalfee/v1beta1/tx.proto +++ b/proto/gaia/globalfee/v1beta1/tx.proto @@ -7,7 +7,7 @@ import "cosmos_proto/cosmos.proto"; import "gaia/globalfee/v1beta1/params.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/globalfee/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/globalfee/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/neutron/contractmanager/failure.proto b/proto/neutron/contractmanager/failure.proto index 87e73b148..4ba42d797 100644 --- a/proto/neutron/contractmanager/failure.proto +++ b/proto/neutron/contractmanager/failure.proto @@ -3,7 +3,7 @@ package neutron.contractmanager; import "ibc/core/channel/v1/channel.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/contractmanager/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/contractmanager/types"; // Failure message contains information about ACK failures and can be used to // replay ACK in case of requirement. diff --git a/proto/neutron/contractmanager/genesis.proto b/proto/neutron/contractmanager/genesis.proto index 74728c4a7..564e35a3a 100644 --- a/proto/neutron/contractmanager/genesis.proto +++ b/proto/neutron/contractmanager/genesis.proto @@ -6,7 +6,7 @@ import "neutron/contractmanager/failure.proto"; import "neutron/contractmanager/params.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/neutron-org/neutron/v4/x/contractmanager/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/contractmanager/types"; // GenesisState defines the contractmanager module's genesis state. message GenesisState { diff --git a/proto/neutron/contractmanager/params.proto b/proto/neutron/contractmanager/params.proto index 3eb687a7e..309798cbf 100644 --- a/proto/neutron/contractmanager/params.proto +++ b/proto/neutron/contractmanager/params.proto @@ -3,7 +3,7 @@ package neutron.contractmanager; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/contractmanager/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/contractmanager/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/neutron/contractmanager/query.proto b/proto/neutron/contractmanager/query.proto index ca7f08d24..abda10bf6 100644 --- a/proto/neutron/contractmanager/query.proto +++ b/proto/neutron/contractmanager/query.proto @@ -8,7 +8,7 @@ import "neutron/contractmanager/failure.proto"; import "neutron/contractmanager/params.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/neutron-org/neutron/v4/x/contractmanager/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/contractmanager/types"; // Query defines the gRPC querier service. service Query { @@ -18,7 +18,7 @@ service Query { } // Queries a Failure by contract address and failure ID. - rpc AddressFailure(QueryFailuresRequest) returns (QueryFailuresResponse) { + rpc AddressFailure(QueryFailureRequest) returns (QueryFailureResponse) { option (google.api.http).get = "/neutron/contractmanager/failures/{address}/{failure_id}"; } @@ -46,11 +46,22 @@ message QueryParamsResponse { // QueryFailuresRequest is request type for the Query/Failures RPC method. message QueryFailuresRequest { + // address of the contract which Sudo call failed. + string address = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryFailureRequest is request type for the Query/Failures RPC method. +message QueryFailureRequest { // address of the contract which Sudo call failed. string address = 1; // ID of the failure for the given contract. uint64 failure_id = 2; - cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryFailureResponse is response type for the Query/Failure RPC method. +message QueryFailureResponse { + Failure failure = 1 [(gogoproto.nullable) = false]; } // QueryFailuresResponse is response type for the Query/Failures RPC method. diff --git a/proto/neutron/contractmanager/tx.proto b/proto/neutron/contractmanager/tx.proto index cf91f125c..6feb37d66 100644 --- a/proto/neutron/contractmanager/tx.proto +++ b/proto/neutron/contractmanager/tx.proto @@ -9,13 +9,15 @@ import "neutron/contractmanager/params.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/neutron-org/neutron/v4/x/contractmanager/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/contractmanager/types"; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + rpc ResubmitFailure(MsgResubmitFailure) returns (MsgResubmitFailureResponse); + // this line is used by starport scaffolding # proto/tx/rpc } @@ -43,3 +45,17 @@ message MsgUpdateParams { // // Since: 0.47 message MsgUpdateParamsResponse {} + +// MsgResubmitFailure - contract that has failed acknowledgement can resubmit its failure +message MsgResubmitFailure { + option (amino.name) = "contractmanager/MsgResubmitFailure"; + option (cosmos.msg.v1.signer) = "sender"; + + // sender is the contract which failure to acknowledge is resubmitted. + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // failure_id is id of failure to resubmit + uint64 failure_id = 2; +} + +message MsgResubmitFailureResponse {} diff --git a/proto/neutron/contractmanager/v1/failure.proto b/proto/neutron/contractmanager/v1/failure.proto index 595ec7993..36b86bac2 100644 --- a/proto/neutron/contractmanager/v1/failure.proto +++ b/proto/neutron/contractmanager/v1/failure.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package neutron.contractmanager.v1; -option go_package = "github.com/neutron-org/neutron/v4/x/contractmanager/types/v1"; +option go_package = "github.com/neutron-org/neutron/v5/x/contractmanager/types/v1"; // Deprecated. Used only for migration purposes. message Failure { diff --git a/proto/neutron/cron/genesis.proto b/proto/neutron/cron/genesis.proto index 61b27069a..9a570c257 100644 --- a/proto/neutron/cron/genesis.proto +++ b/proto/neutron/cron/genesis.proto @@ -6,9 +6,9 @@ import "neutron/cron/params.proto"; import "neutron/cron/schedule.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/neutron-org/neutron/v4/x/cron/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/cron/types"; -// GenesisState defines the cron module's genesis state. +// Defines the cron module's genesis state. message GenesisState { repeated Schedule scheduleList = 2 [(gogoproto.nullable) = false]; Params params = 1 [(gogoproto.nullable) = false]; diff --git a/proto/neutron/cron/params.proto b/proto/neutron/cron/params.proto index 9bea16a5b..0018d73ed 100644 --- a/proto/neutron/cron/params.proto +++ b/proto/neutron/cron/params.proto @@ -3,9 +3,9 @@ package neutron.cron; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/cron/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/cron/types"; -// Params defines the parameters for the module. +// Defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; // Security address that can remove schedules diff --git a/proto/neutron/cron/query.proto b/proto/neutron/cron/query.proto index 401e9ce9d..c75045c1e 100644 --- a/proto/neutron/cron/query.proto +++ b/proto/neutron/cron/query.proto @@ -8,9 +8,9 @@ import "neutron/cron/params.proto"; import "neutron/cron/schedule.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/neutron-org/neutron/v4/x/cron/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/cron/types"; -// Query defines the gRPC querier service. +// Defines the gRPC querier service. service Query { // Queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { @@ -30,25 +30,31 @@ service Query { // this line is used by starport scaffolding # 2 } +// The request type for the Query/Params RPC method. message QueryParamsRequest {} +// The response type for the Query/Params RPC method. message QueryParamsResponse { // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false]; } +// The request type for the Query/Schedule RPC method. message QueryGetScheduleRequest { string name = 1; } +// The response type for the Query/Params RPC method. message QueryGetScheduleResponse { Schedule schedule = 1 [(gogoproto.nullable) = false]; } +// The request type for the Query/Schedules RPC method. message QuerySchedulesRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; } +// The response type for the Query/Params RPC method. message QuerySchedulesResponse { repeated Schedule schedules = 1 [(gogoproto.nullable) = false]; cosmos.base.query.v1beta1.PageResponse pagination = 2; diff --git a/proto/neutron/cron/schedule.proto b/proto/neutron/cron/schedule.proto index 5df38de34..7cfa2caa6 100644 --- a/proto/neutron/cron/schedule.proto +++ b/proto/neutron/cron/schedule.proto @@ -3,27 +3,40 @@ package neutron.cron; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/cron/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/cron/types"; +// Defines when messages will be executed in the block +enum ExecutionStage { + // Execution at the end of the block + EXECUTION_STAGE_END_BLOCKER = 0; + // Execution at the beginning of the block + EXECUTION_STAGE_BEGIN_BLOCKER = 1; +} + +// Defines the schedule for execution message Schedule { // Name of schedule string name = 1; // Period in blocks uint64 period = 2; - // Msgs that will be executed every period amount of time + // Msgs that will be executed every certain number of blocks, specified in the `period` field repeated MsgExecuteContract msgs = 3 [(gogoproto.nullable) = false]; // Last execution's block height uint64 last_execute_height = 4; + // Stage when messages will be executed + ExecutionStage execution_stage = 5; } +// Defines the contract and the message to pass message MsgExecuteContract { - // Contract is the address of the smart contract + // The address of the smart contract string contract = 1; - // Msg is json encoded message to be passed to the contract + // JSON encoded message to be passed to the contract string msg = 2; } +// Defines the number of current schedules message ScheduleCount { - // Count is the number of current schedules + // The number of current schedules int32 count = 1; } diff --git a/proto/neutron/cron/tx.proto b/proto/neutron/cron/tx.proto index 6bb9d3bf7..be869cdd8 100644 --- a/proto/neutron/cron/tx.proto +++ b/proto/neutron/cron/tx.proto @@ -6,32 +6,72 @@ import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "neutron/cron/params.proto"; +import "neutron/cron/schedule.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/neutron-org/neutron/v4/x/cron/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/cron/types"; -// Msg defines the Msg service. +// Defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; + // Adds new schedule. + rpc AddSchedule(MsgAddSchedule) returns (MsgAddScheduleResponse); + // Removes schedule. + rpc RemoveSchedule(MsgRemoveSchedule) returns (MsgRemoveScheduleResponse); + // Updates the module parameters. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); // this line is used by starport scaffolding # proto/tx/rpc } +// The MsgAddSchedule request type. +message MsgAddSchedule { + option (amino.name) = "cron/MsgAddSchedule"; + option (cosmos.msg.v1.signer) = "authority"; + + // The address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Name of the schedule + string name = 2; + // Period in blocks + uint64 period = 3; + // Msgs that will be executed every certain number of blocks, specified in the `period` field + repeated MsgExecuteContract msgs = 4 [(gogoproto.nullable) = false]; + // Stage when messages will be executed + ExecutionStage execution_stage = 5; +} + +// Defines the response structure for executing a MsgAddSchedule message. +message MsgAddScheduleResponse {} + +// The MsgRemoveSchedule request type. +message MsgRemoveSchedule { + option (amino.name) = "cron/MsgRemoveSchedule"; + option (cosmos.msg.v1.signer) = "authority"; + + // The address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Name of the schedule + string name = 2; +} + +// Defines the response structure for executing a MsgRemoveSchedule message. +message MsgRemoveScheduleResponse {} + // this line is used by starport scaffolding # proto/tx/message -// MsgUpdateParams is the MsgUpdateParams request type. +// The MsgUpdateParams request type. // // Since: 0.47 message MsgUpdateParams { option (amino.name) = "cron/MsgUpdateParams"; option (cosmos.msg.v1.signer) = "authority"; - // Authority is the address of the governance account. + // The address of the governance account. string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // params defines the x/cron parameters to update. + // Defines the x/cron parameters to update. // // NOTE: All parameters must be supplied. Params params = 2 [ @@ -40,8 +80,7 @@ message MsgUpdateParams { ]; } -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. +// Defines the response structure for executing a MsgUpdateParams message. // // Since: 0.47 message MsgUpdateParamsResponse {} diff --git a/proto/neutron/cron/v1/schedule.proto b/proto/neutron/cron/v1/schedule.proto new file mode 100644 index 000000000..3593f5058 --- /dev/null +++ b/proto/neutron/cron/v1/schedule.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package neutron.cron.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/neutron-org/neutron/v5/x/cron/types/v1"; + +// Defines the schedule for execution +message Schedule { + // Name of schedule + string name = 1; + // Period in blocks + uint64 period = 2; + // Msgs that will be executed every certain number of blocks, specified in the `period` field + repeated MsgExecuteContract msgs = 3 [(gogoproto.nullable) = false]; + // Last execution's block height + uint64 last_execute_height = 4; +} + +// Defines the contract and the message to pass +message MsgExecuteContract { + // The address of the smart contract + string contract = 1; + // JSON encoded message to be passed to the contract + string msg = 2; +} + +// Defines the number of current schedules +message ScheduleCount { + // The number of current schedules + int32 count = 1; +} diff --git a/proto/neutron/dex/deposit_record.proto b/proto/neutron/dex/deposit_record.proto index 65227075c..e97ce4bf3 100644 --- a/proto/neutron/dex/deposit_record.proto +++ b/proto/neutron/dex/deposit_record.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "neutron/dex/pair_id.proto"; import "neutron/dex/pool.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message DepositRecord { PairID pair_id = 1; diff --git a/proto/neutron/dex/genesis.proto b/proto/neutron/dex/genesis.proto index 9630fdc02..97e70d559 100644 --- a/proto/neutron/dex/genesis.proto +++ b/proto/neutron/dex/genesis.proto @@ -11,7 +11,7 @@ import "neutron/dex/tick_liquidity.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; // GenesisState defines the dex module's genesis state. message GenesisState { diff --git a/proto/neutron/dex/limit_order_expiration.proto b/proto/neutron/dex/limit_order_expiration.proto index c678e21cc..e8ceb702f 100644 --- a/proto/neutron/dex/limit_order_expiration.proto +++ b/proto/neutron/dex/limit_order_expiration.proto @@ -4,7 +4,7 @@ package neutron.dex; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message LimitOrderExpiration { // see limitOrderTranche.proto for details on expiration_time diff --git a/proto/neutron/dex/limit_order_tranche.proto b/proto/neutron/dex/limit_order_tranche.proto index 9d05dcd96..8923ff8dc 100644 --- a/proto/neutron/dex/limit_order_tranche.proto +++ b/proto/neutron/dex/limit_order_tranche.proto @@ -6,7 +6,7 @@ import "google/protobuf/timestamp.proto"; import "neutron/dex/pair_id.proto"; import "neutron/dex/trade_pair_id.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message LimitOrderTrancheKey { TradePairID trade_pair_id = 1; @@ -49,10 +49,19 @@ message LimitOrderTranche { (gogoproto.stdtime) = true, (gogoproto.nullable) = true ]; + // DEPRECATED: price_taker_to_maker will be removed in future release, `maker_price` should always be used. string price_taker_to_maker = 7 [ (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v4/utils/math.PrecDec", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_taker_to_maker" + (gogoproto.jsontag) = "price_taker_to_maker", + deprecated = true + ]; + // This is the price of the LimitOrder denominated in the opposite token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + string maker_price = 8 [ + (gogoproto.moretags) = "yaml:\"maker_price\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "maker_price" ]; } diff --git a/proto/neutron/dex/limit_order_tranche_user.proto b/proto/neutron/dex/limit_order_tranche_user.proto index 5ceb413e5..64b6e5a8b 100644 --- a/proto/neutron/dex/limit_order_tranche_user.proto +++ b/proto/neutron/dex/limit_order_tranche_user.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "neutron/dex/trade_pair_id.proto"; import "neutron/dex/tx.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message LimitOrderTrancheUser { TradePairID trade_pair_id = 1; @@ -24,6 +24,7 @@ message LimitOrderTrancheUser { (gogoproto.nullable) = false, (gogoproto.jsontag) = "shares_withdrawn" ]; + // TODO: remove this in next release. It is no longer used string shares_cancelled = 7 [ (gogoproto.moretags) = "yaml:\"shares_cancelled\"", (gogoproto.customtype) = "cosmossdk.io/math.Int", diff --git a/proto/neutron/dex/pair_id.proto b/proto/neutron/dex/pair_id.proto index f32ba2f49..92ab73532 100644 --- a/proto/neutron/dex/pair_id.proto +++ b/proto/neutron/dex/pair_id.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message PairID { string token0 = 1; diff --git a/proto/neutron/dex/params.proto b/proto/neutron/dex/params.proto index 43c20db29..a25c48d61 100644 --- a/proto/neutron/dex/params.proto +++ b/proto/neutron/dex/params.proto @@ -3,7 +3,7 @@ package neutron.dex; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/neutron/dex/pool.proto b/proto/neutron/dex/pool.proto index 825182482..231a1df4b 100644 --- a/proto/neutron/dex/pool.proto +++ b/proto/neutron/dex/pool.proto @@ -4,7 +4,7 @@ package neutron.dex; import "gogoproto/gogo.proto"; import "neutron/dex/pool_reserves.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; // NOTE: This struct is never actually stored in the KV store. It is merely a // convenience wrapper for holding both sides of a pool. diff --git a/proto/neutron/dex/pool_metadata.proto b/proto/neutron/dex/pool_metadata.proto index b1b32da97..d84ada0c5 100644 --- a/proto/neutron/dex/pool_metadata.proto +++ b/proto/neutron/dex/pool_metadata.proto @@ -3,7 +3,7 @@ package neutron.dex; import "neutron/dex/pair_id.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message PoolMetadata { uint64 id = 1; diff --git a/proto/neutron/dex/pool_reserves.proto b/proto/neutron/dex/pool_reserves.proto index c633a551a..9b143dac6 100644 --- a/proto/neutron/dex/pool_reserves.proto +++ b/proto/neutron/dex/pool_reserves.proto @@ -4,7 +4,7 @@ package neutron.dex; import "gogoproto/gogo.proto"; import "neutron/dex/trade_pair_id.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message PoolReservesKey { TradePairID trade_pair_id = 1; @@ -20,16 +20,28 @@ message PoolReserves { (gogoproto.jsontag) = "reserves_maker_denom", (gogoproto.nullable) = false ]; + // DEPRECATED: price_taker_to_maker will be removed in future release, `maker_price` should always be used. string price_taker_to_maker = 3 [ (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v4/utils/math.PrecDec", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_taker_to_maker" + (gogoproto.jsontag) = "price_taker_to_maker", + deprecated = true ]; + // DEPRECATED: price_opposite_taker_maker was an internal implementation detail and will be removed in a future release. + // It is being kept strictly for backwards compatibility. The actual field value is unused. string price_opposite_taker_to_maker = 4 [ (gogoproto.moretags) = "yaml:\"price_opposite_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v4/utils/math.PrecDec", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_opposite_taker_to_maker" + (gogoproto.jsontag) = "price_opposite_taker_to_maker", + deprecated = true + ]; + // This is the price of the PoolReserves denominated in the opposite token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + string maker_price = 5 [ + (gogoproto.moretags) = "yaml:\"maker_price\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "maker_price" ]; } diff --git a/proto/neutron/dex/query.proto b/proto/neutron/dex/query.proto index ef524da0c..58ae794b4 100644 --- a/proto/neutron/dex/query.proto +++ b/proto/neutron/dex/query.proto @@ -19,7 +19,7 @@ import "neutron/dex/tx.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; // Query defines the gRPC querier service. service Query { @@ -96,14 +96,16 @@ service Query { option (google.api.http).get = "/neutron/dex/pool_reserves/{pair_id}/{token_in}/{tick_index}/{fee}"; } - // Queries the simulated result of a multihop swap + // DEPRECATED Queries the simulated result of a multihop swap rpc EstimateMultiHopSwap(QueryEstimateMultiHopSwapRequest) returns (QueryEstimateMultiHopSwapResponse) { option (google.api.http).get = "/neutron/dex/estimate_multi_hop_swap"; + option deprecated = true; } - // Queries the simulated result of a PlaceLimit order + // DEPRECATED Queries the simulated result of a PlaceLimit order rpc EstimatePlaceLimitOrder(QueryEstimatePlaceLimitOrderRequest) returns (QueryEstimatePlaceLimitOrderResponse) { option (google.api.http).get = "/neutron/dex/estimate_place_limit_order"; + option deprecated = true; } // Queries a pool by pair, tick and fee @@ -126,6 +128,36 @@ service Query { option (google.api.http).get = "/neutron/dex/pool_metadata"; } + // Simulates MsgDeposit + rpc SimulateDeposit(QuerySimulateDepositRequest) returns (QuerySimulateDepositResponse) { + option (google.api.http).get = "/neutron/dex/simulate_deposit"; + } + + // Simulates MsgWithdrawal + rpc SimulateWithdrawal(QuerySimulateWithdrawalRequest) returns (QuerySimulateWithdrawalResponse) { + option (google.api.http).get = "/neutron/dex/simulate_withdrawal"; + } + + // Simulates MsgPlaceLimitOrder + rpc SimulatePlaceLimitOrder(QuerySimulatePlaceLimitOrderRequest) returns (QuerySimulatePlaceLimitOrderResponse) { + option (google.api.http).get = "/neutron/dex/simulate_place_limit_order"; + } + + // Simulates MsgWithdrawFilledLimitOrder + rpc SimulateWithdrawFilledLimitOrder(QuerySimulateWithdrawFilledLimitOrderRequest) returns (QuerySimulateWithdrawFilledLimitOrderResponse) { + option (google.api.http).get = "/neutron/dex/simulate_withdraw_filled_limit_order"; + } + + // Simulates MsgCancelLimitOrder + rpc SimulateCancelLimitOrder(QuerySimulateCancelLimitOrderRequest) returns (QuerySimulateCancelLimitOrderResponse) { + option (google.api.http).get = "/neutron/dex/simulate_cancel_limit_order"; + } + + // Simulates MsgMultiHopSwap + rpc SimulateMultiHopSwap(QuerySimulateMultiHopSwapRequest) returns (QuerySimulateMultiHopSwapResponse) { + option (google.api.http).get = "/neutron/dex/simulate_multi_hop_swap"; + } + // this line is used by starport scaffolding # 2 } @@ -260,6 +292,7 @@ message QueryGetPoolReservesResponse { } message QueryEstimateMultiHopSwapRequest { + // DEPRECATED: Use QuerySimulateMultiHopSwap string creator = 1; string receiver = 2; repeated MultiHopRoute routes = 3; @@ -271,7 +304,7 @@ message QueryEstimateMultiHopSwapRequest { ]; string exit_limit_price = 5 [ (gogoproto.moretags) = "yaml:\"exit_limit_price\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v4/utils/math.PrecDec", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "exit_limit_price" ]; @@ -290,6 +323,7 @@ message QueryEstimateMultiHopSwapResponse { } message QueryEstimatePlaceLimitOrderRequest { + // DEPRECATED: Use QuerySimulatePlaceLimitOrder string creator = 1; string receiver = 2; string token_in = 3; @@ -378,4 +412,52 @@ message QueryAllPoolMetadataResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QuerySimulateDepositRequest { + MsgDeposit msg = 1; +} + +message QuerySimulateDepositResponse { + MsgDepositResponse resp = 1; +} + +message QuerySimulateWithdrawalRequest { + MsgWithdrawal msg = 1; +} + +message QuerySimulateWithdrawalResponse { + MsgWithdrawalResponse resp = 1; +} + +message QuerySimulatePlaceLimitOrderRequest { + MsgPlaceLimitOrder msg = 1; +} + +message QuerySimulatePlaceLimitOrderResponse { + MsgPlaceLimitOrderResponse resp = 1; +} + +message QuerySimulateWithdrawFilledLimitOrderRequest { + MsgWithdrawFilledLimitOrder msg = 1; +} + +message QuerySimulateWithdrawFilledLimitOrderResponse { + MsgWithdrawFilledLimitOrderResponse resp = 1; +} + +message QuerySimulateCancelLimitOrderRequest { + MsgCancelLimitOrder msg = 1; +} + +message QuerySimulateCancelLimitOrderResponse { + MsgCancelLimitOrderResponse resp = 1; +} + +message QuerySimulateMultiHopSwapRequest { + MsgMultiHopSwap msg = 1; +} + +message QuerySimulateMultiHopSwapResponse { + MsgMultiHopSwapResponse resp = 1; +} + // this line is used by starport scaffolding # 3 diff --git a/proto/neutron/dex/tick_liquidity.proto b/proto/neutron/dex/tick_liquidity.proto index 7d6609ca4..b6b40b73d 100644 --- a/proto/neutron/dex/tick_liquidity.proto +++ b/proto/neutron/dex/tick_liquidity.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "neutron/dex/limit_order_tranche.proto"; import "neutron/dex/pool_reserves.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message TickLiquidity { oneof liquidity { diff --git a/proto/neutron/dex/trade_pair_id.proto b/proto/neutron/dex/trade_pair_id.proto index c5c359e67..84f154fdb 100644 --- a/proto/neutron/dex/trade_pair_id.proto +++ b/proto/neutron/dex/trade_pair_id.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; message TradePairID { string maker_denom = 2; diff --git a/proto/neutron/dex/tx.proto b/proto/neutron/dex/tx.proto index 093591440..4b5bb18be 100644 --- a/proto/neutron/dex/tx.proto +++ b/proto/neutron/dex/tx.proto @@ -11,7 +11,7 @@ import "neutron/dex/params.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types"; // Msg defines the Msg service. service Msg { @@ -75,6 +75,12 @@ message MsgDepositResponse { (gogoproto.jsontag) = "reserve1_deposited" ]; repeated FailedDeposit failed_deposits = 3; + repeated cosmos.base.v1beta1.Coin shares_issued = 4 [ + (gogoproto.moretags) = "yaml:\"shares_issued\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_issued" + ]; } message MsgWithdrawal { @@ -95,7 +101,26 @@ message MsgWithdrawal { repeated uint64 fees = 7; } -message MsgWithdrawalResponse {} +message MsgWithdrawalResponse { + string reserve0_withdrawn = 1 [ + (gogoproto.moretags) = "yaml:\"reserve0_withdrawn\"", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserve0_withdrawn" + ]; + string reserve1_withdrawn = 2 [ + (gogoproto.moretags) = "yaml:\"reserve1_withdrawn\"", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserve1_withdrawn" + ]; + repeated cosmos.base.v1beta1.Coin shares_burned = 3 [ + (gogoproto.moretags) = "yaml:\"shares_burned\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_burned" + ]; +} enum LimitOrderType { GOOD_TIL_CANCELLED = 0; @@ -136,10 +161,19 @@ message MsgPlaceLimitOrder { ]; string limit_sell_price = 11 [ (gogoproto.moretags) = "yaml:\"limit_sell_price\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v4/utils/math.PrecDec", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", (gogoproto.nullable) = true, (gogoproto.jsontag) = "limit_sell_price" ]; + // min_average_sell_price is an optional parameter that sets a required minimum average price for the entire trade. + // if the min_average_sell_price is not met the trade will fail. + // If min_average_sell_price is omitted limit_sell_price will be used instead + string min_average_sell_price = 12 [ + (gogoproto.moretags) = "yaml:\"min_average_sell_price\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", + (gogoproto.nullable) = true, + (gogoproto.jsontag) = "min_average_sell_price" + ]; } message MsgPlaceLimitOrderResponse { @@ -161,6 +195,14 @@ message MsgPlaceLimitOrderResponse { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.jsontag) = "taker_coin_out" ]; + + // Total amount of the token in that was immediately swapped for takerOutCoin + cosmos.base.v1beta1.Coin taker_coin_in = 4 [ + (gogoproto.moretags) = "yaml:\"taker_coin_in\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "taker_coin_in" + ]; } message MsgWithdrawFilledLimitOrder { @@ -171,7 +213,22 @@ message MsgWithdrawFilledLimitOrder { string tranche_key = 2; } -message MsgWithdrawFilledLimitOrderResponse {} +message MsgWithdrawFilledLimitOrderResponse { + // Total amount of taker reserves that were withdrawn + cosmos.base.v1beta1.Coin taker_coin_out = 1 [ + (gogoproto.moretags) = "yaml:\"taker_coin_out\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "taker_coin_out" + ]; + // Total amount of maker reserves that were withdrawn --only applies to inactive LimitOrders + cosmos.base.v1beta1.Coin maker_coin_out = 2 [ + (gogoproto.moretags) = "yaml:\"maker_coin_out\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "maker_coin_out" + ]; +} message MsgCancelLimitOrder { option (amino.name) = "dex/MsgCancelLimitOrder"; @@ -181,7 +238,22 @@ message MsgCancelLimitOrder { string tranche_key = 2; } -message MsgCancelLimitOrderResponse {} +message MsgCancelLimitOrderResponse { + // Total amount of taker reserves that were withdrawn + cosmos.base.v1beta1.Coin taker_coin_out = 1 [ + (gogoproto.moretags) = "yaml:\"taker_coin_out\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "taker_coin_out" + ]; + // Total amount of maker reserves that were canceled + cosmos.base.v1beta1.Coin maker_coin_out = 2 [ + (gogoproto.moretags) = "yaml:\"maker_coin_out\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "maker_coin_out" + ]; +} message MultiHopRoute { repeated string hops = 1; @@ -202,7 +274,7 @@ message MsgMultiHopSwap { ]; string exit_limit_price = 5 [ (gogoproto.moretags) = "yaml:\"exit_limit_price\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v4/utils/math.PrecDec", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "exit_limit_price" ]; @@ -213,10 +285,18 @@ message MsgMultiHopSwap { message MsgMultiHopSwapResponse { cosmos.base.v1beta1.Coin coin_out = 1 [ + (gogoproto.moretags) = "yaml:\"coin_out\"", (gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.jsontag) = "coin_out" ]; + MultiHopRoute route = 2; + repeated cosmos.base.v1beta1.Coin dust = 3 [ + (gogoproto.moretags) = "yaml:\"dust\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "dust" + ]; } message MsgUpdateParams { diff --git a/proto/neutron/dex/v2/params.proto b/proto/neutron/dex/v2/params.proto index 64df63408..335763b2e 100644 --- a/proto/neutron/dex/v2/params.proto +++ b/proto/neutron/dex/v2/params.proto @@ -3,7 +3,7 @@ package neutron.dex.v2; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dex/types/v2"; +option go_package = "github.com/neutron-org/neutron/v5/x/dex/types/v2"; // Params defines the parameters for the module. message Params { @@ -11,7 +11,7 @@ message Params { repeated uint64 fee_tiers = 1; string max_true_taker_spread = 2 [ (gogoproto.moretags) = "yaml:\"max_true_taker_spread\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v4/utils/math.PrecDec", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v5/utils/math.PrecDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "max_true_taker_spread" ]; diff --git a/proto/neutron/dynamicfees/v1/genesis.proto b/proto/neutron/dynamicfees/v1/genesis.proto index dcdfe3d18..a889fb4f7 100644 --- a/proto/neutron/dynamicfees/v1/genesis.proto +++ b/proto/neutron/dynamicfees/v1/genesis.proto @@ -4,7 +4,7 @@ package neutron.dynamicfees.v1; import "gogoproto/gogo.proto"; import "neutron/dynamicfees/v1/params.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dynamicfees/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dynamicfees/types"; // GenesisState defines the dynamicfees module's genesis state. message GenesisState { diff --git a/proto/neutron/dynamicfees/v1/params.proto b/proto/neutron/dynamicfees/v1/params.proto index 1e87168e2..5cf191528 100644 --- a/proto/neutron/dynamicfees/v1/params.proto +++ b/proto/neutron/dynamicfees/v1/params.proto @@ -4,7 +4,7 @@ package neutron.dynamicfees.v1; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dynamicfees/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dynamicfees/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/neutron/dynamicfees/v1/query.proto b/proto/neutron/dynamicfees/v1/query.proto index aa717bf96..88eab2391 100644 --- a/proto/neutron/dynamicfees/v1/query.proto +++ b/proto/neutron/dynamicfees/v1/query.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "neutron/dynamicfees/v1/params.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dynamicfees/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dynamicfees/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/neutron/dynamicfees/v1/tx.proto b/proto/neutron/dynamicfees/v1/tx.proto index dd02203df..9653ca985 100644 --- a/proto/neutron/dynamicfees/v1/tx.proto +++ b/proto/neutron/dynamicfees/v1/tx.proto @@ -7,7 +7,7 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "neutron/dynamicfees/v1/params.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/dynamicfees/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/dynamicfees/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/neutron/feeburner/genesis.proto b/proto/neutron/feeburner/genesis.proto index 70fb5034b..7d778259b 100644 --- a/proto/neutron/feeburner/genesis.proto +++ b/proto/neutron/feeburner/genesis.proto @@ -6,7 +6,7 @@ import "neutron/feeburner/params.proto"; import "neutron/feeburner/total_burned_neutrons_amount.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/neutron-org/neutron/v4/x/feeburner/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feeburner/types"; // GenesisState defines the feeburner module's genesis state. message GenesisState { diff --git a/proto/neutron/feeburner/params.proto b/proto/neutron/feeburner/params.proto index e940844d7..332faf399 100644 --- a/proto/neutron/feeburner/params.proto +++ b/proto/neutron/feeburner/params.proto @@ -3,7 +3,7 @@ package neutron.feeburner; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/feeburner/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feeburner/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/neutron/feeburner/query.proto b/proto/neutron/feeburner/query.proto index 3dfd880b7..c605a2c2f 100644 --- a/proto/neutron/feeburner/query.proto +++ b/proto/neutron/feeburner/query.proto @@ -8,7 +8,7 @@ import "neutron/feeburner/params.proto"; import "neutron/feeburner/total_burned_neutrons_amount.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/neutron-org/neutron/v4/x/feeburner/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feeburner/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/neutron/feeburner/total_burned_neutrons_amount.proto b/proto/neutron/feeburner/total_burned_neutrons_amount.proto index 30935366f..304b99600 100644 --- a/proto/neutron/feeburner/total_burned_neutrons_amount.proto +++ b/proto/neutron/feeburner/total_burned_neutrons_amount.proto @@ -4,7 +4,7 @@ package neutron.feeburner; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/feeburner/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feeburner/types"; // TotalBurnedNeutronsAmount defines total amount of burned neutron fees message TotalBurnedNeutronsAmount { diff --git a/proto/neutron/feeburner/tx.proto b/proto/neutron/feeburner/tx.proto index 94240af8c..d1eb6132c 100644 --- a/proto/neutron/feeburner/tx.proto +++ b/proto/neutron/feeburner/tx.proto @@ -9,7 +9,7 @@ import "neutron/feeburner/params.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/neutron-org/neutron/v4/x/feeburner/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feeburner/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/neutron/feerefunder/fee.proto b/proto/neutron/feerefunder/fee.proto index 07540a281..90017bc68 100644 --- a/proto/neutron/feerefunder/fee.proto +++ b/proto/neutron/feerefunder/fee.proto @@ -4,7 +4,7 @@ package neutron.feerefunder; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/feerefunder/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feerefunder/types"; // Fee defines the ICS29 receive, acknowledgement and timeout fees message Fee { diff --git a/proto/neutron/feerefunder/genesis.proto b/proto/neutron/feerefunder/genesis.proto index 022f11c2f..d409c245d 100644 --- a/proto/neutron/feerefunder/genesis.proto +++ b/proto/neutron/feerefunder/genesis.proto @@ -6,7 +6,7 @@ import "neutron/feerefunder/fee.proto"; import "neutron/feerefunder/params.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/neutron-org/neutron/v4/x/feerefunder/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feerefunder/types"; // GenesisState defines the fee module's genesis state. message GenesisState { diff --git a/proto/neutron/feerefunder/params.proto b/proto/neutron/feerefunder/params.proto index cdbd7d651..4c72177b5 100644 --- a/proto/neutron/feerefunder/params.proto +++ b/proto/neutron/feerefunder/params.proto @@ -4,7 +4,7 @@ package neutron.feerefunder; import "gogoproto/gogo.proto"; import "neutron/feerefunder/fee.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/feerefunder/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feerefunder/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/neutron/feerefunder/query.proto b/proto/neutron/feerefunder/query.proto index a032f100c..75329df1f 100644 --- a/proto/neutron/feerefunder/query.proto +++ b/proto/neutron/feerefunder/query.proto @@ -8,7 +8,7 @@ import "neutron/feerefunder/genesis.proto"; import "neutron/feerefunder/params.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/neutron-org/neutron/v4/x/feerefunder/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feerefunder/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/neutron/feerefunder/tx.proto b/proto/neutron/feerefunder/tx.proto index 325796af0..d90c23297 100644 --- a/proto/neutron/feerefunder/tx.proto +++ b/proto/neutron/feerefunder/tx.proto @@ -9,7 +9,7 @@ import "neutron/feerefunder/params.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/neutron-org/neutron/v4/x/feerefunder/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/feerefunder/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/neutron/ibcratelimit/v1beta1/genesis.proto b/proto/neutron/ibcratelimit/v1beta1/genesis.proto new file mode 100644 index 000000000..f66c0fcd4 --- /dev/null +++ b/proto/neutron/ibcratelimit/v1beta1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package neutron.ibcratelimit.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "neutron/ibcratelimit/v1beta1/params.proto"; + +option go_package = "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types"; + +// GenesisState defines the ibc-rate-limit module's genesis state. +message GenesisState { + // params are all the parameters of the module + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/neutron/ibcratelimit/v1beta1/params.proto b/proto/neutron/ibcratelimit/v1beta1/params.proto new file mode 100644 index 000000000..8dee35a10 --- /dev/null +++ b/proto/neutron/ibcratelimit/v1beta1/params.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package neutron.ibcratelimit.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types"; + +// Params defines the parameters for the ibc-rate-limit module. +message Params { + string contract_address = 1 [ + (gogoproto.moretags) = "yaml:\"contract_address\"", + (gogoproto.nullable) = true + ]; +} diff --git a/proto/neutron/ibcratelimit/v1beta1/query.proto b/proto/neutron/ibcratelimit/v1beta1/query.proto new file mode 100644 index 000000000..79b560ff3 --- /dev/null +++ b/proto/neutron/ibcratelimit/v1beta1/query.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package neutron.ibcratelimit.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "neutron/ibcratelimit/v1beta1/params.proto"; + +option go_package = "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types"; + +// Query defines the gRPC querier service. +service Query { + // Params defines a gRPC query method that returns the ibc-rate-limit module's + // parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/neutron/ibc-rate-limit/v1beta1/params"; + } +} + +// ParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// aramsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/neutron/ibcratelimit/v1beta1/tx.proto b/proto/neutron/ibcratelimit/v1beta1/tx.proto new file mode 100644 index 000000000..71ff52e9c --- /dev/null +++ b/proto/neutron/ibcratelimit/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package neutron.ibcratelimit.v1beta1; + +import "amino/amino.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "neutron/ibcratelimit/v1beta1/params.proto"; + +option go_package = "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types"; + +// Msg defines the tokefactory module's gRPC message service. +service Msg { + option (cosmos.msg.v1.service) = true; + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.47 +message MsgUpdateParams { + option (amino.name) = "neutron/ibc-rate-limit/MsgUpdateParams"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/tokenfactory parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/neutron/interchainqueries/genesis.proto b/proto/neutron/interchainqueries/genesis.proto index b184be106..a39c3e4b7 100644 --- a/proto/neutron/interchainqueries/genesis.proto +++ b/proto/neutron/interchainqueries/genesis.proto @@ -6,7 +6,7 @@ import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; import "neutron/interchainqueries/params.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/interchainqueries/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types"; // Information about an Interchain Query registered in the interchainqueries module. message RegisteredQuery { diff --git a/proto/neutron/interchainqueries/params.proto b/proto/neutron/interchainqueries/params.proto index 2e8f26430..f6bdfe544 100644 --- a/proto/neutron/interchainqueries/params.proto +++ b/proto/neutron/interchainqueries/params.proto @@ -4,7 +4,7 @@ package neutron.interchainqueries; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/interchainqueries/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types"; // The parameters for the module. message Params { @@ -20,4 +20,10 @@ message Params { // Amount of tx hashes to be removed during a single EndBlock. Can vary to balance between // network cleaning speed and EndBlock duration. A zero value means no limit. uint64 tx_query_removal_limit = 3; + + // Maximum amount of keys in a registered key value query + uint64 max_kv_query_keys_count = 4; + + // max_transactions_filters defines maximum allowed amount of tx filters in msgRegisterInterchainQuery + uint64 max_transactions_filters = 5; } diff --git a/proto/neutron/interchainqueries/query.proto b/proto/neutron/interchainqueries/query.proto index 85836719a..cbb8ed718 100644 --- a/proto/neutron/interchainqueries/query.proto +++ b/proto/neutron/interchainqueries/query.proto @@ -8,7 +8,7 @@ import "neutron/interchainqueries/genesis.proto"; import "neutron/interchainqueries/params.proto"; import "neutron/interchainqueries/tx.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/interchainqueries/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types"; // Defines the Query interface of the module. service Query { diff --git a/proto/neutron/interchainqueries/tx.proto b/proto/neutron/interchainqueries/tx.proto index bb2c6309e..18ceb3dbc 100644 --- a/proto/neutron/interchainqueries/tx.proto +++ b/proto/neutron/interchainqueries/tx.proto @@ -11,7 +11,7 @@ import "neutron/interchainqueries/params.proto"; import "tendermint/abci/types.proto"; import "tendermint/crypto/proof.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/interchainqueries/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types"; // Defines the Msg interface of the module. service Msg { @@ -75,7 +75,8 @@ message MsgSubmitQueryResultRequest { string sender = 2; // The IBC client ID that corresponds to the IBC connection to the remote chain (where the // query result is coming from). - string client_id = 3; + // Deprecated: populating this field does not make any affect + string client_id = 3 [deprecated = true]; // The result of the Interchain Query execution. QueryResult result = 4; } diff --git a/proto/neutron/interchaintxs/v1/genesis.proto b/proto/neutron/interchaintxs/v1/genesis.proto index 940ad701a..4fcf1f727 100644 --- a/proto/neutron/interchaintxs/v1/genesis.proto +++ b/proto/neutron/interchaintxs/v1/genesis.proto @@ -4,7 +4,7 @@ package neutron.interchaintxs.v1; import "gogoproto/gogo.proto"; import "neutron/interchaintxs/v1/params.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/interchaintxs/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/interchaintxs/types"; // GenesisState defines the interchaintxs module's genesis state. message GenesisState { diff --git a/proto/neutron/interchaintxs/v1/params.proto b/proto/neutron/interchaintxs/v1/params.proto index 9d8febac7..0e8a08c02 100644 --- a/proto/neutron/interchaintxs/v1/params.proto +++ b/proto/neutron/interchaintxs/v1/params.proto @@ -4,7 +4,7 @@ package neutron.interchaintxs.v1; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/interchaintxs/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/interchaintxs/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/neutron/interchaintxs/v1/query.proto b/proto/neutron/interchaintxs/v1/query.proto index f77bf04b7..82c966942 100644 --- a/proto/neutron/interchaintxs/v1/query.proto +++ b/proto/neutron/interchaintxs/v1/query.proto @@ -6,7 +6,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "neutron/interchaintxs/v1/params.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/interchaintxs/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/interchaintxs/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/neutron/interchaintxs/v1/tx.proto b/proto/neutron/interchaintxs/v1/tx.proto index ef59d3075..18b973877 100644 --- a/proto/neutron/interchaintxs/v1/tx.proto +++ b/proto/neutron/interchaintxs/v1/tx.proto @@ -9,10 +9,11 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/api/http.proto"; import "google/protobuf/any.proto"; +import "ibc/core/channel/v1/channel.proto"; import "neutron/feerefunder/fee.proto"; import "neutron/interchaintxs/v1/params.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/interchaintxs/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/interchaintxs/types"; // Msg defines the Msg service. service Msg { @@ -36,6 +37,7 @@ message MsgRegisterInterchainAccount { (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; + ibc.core.channel.v1.Order ordering = 5; } // MsgRegisterInterchainAccountResponse is the response type for diff --git a/proto/neutron/transfer/v1/query.proto b/proto/neutron/transfer/v1/query.proto index 088eeb892..3f67dc6b6 100644 --- a/proto/neutron/transfer/v1/query.proto +++ b/proto/neutron/transfer/v1/query.proto @@ -5,7 +5,7 @@ package neutron.transfer; import "google/api/annotations.proto"; import "ibc/applications/transfer/v1/query.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/transfer/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/transfer/types"; // Query provides defines the gRPC querier service. service Query { diff --git a/proto/neutron/transfer/v1/tx.proto b/proto/neutron/transfer/v1/tx.proto index 49ff17e6f..9d40f3fb1 100644 --- a/proto/neutron/transfer/v1/tx.proto +++ b/proto/neutron/transfer/v1/tx.proto @@ -9,7 +9,7 @@ import "ibc/applications/transfer/v1/transfer.proto"; import "ibc/core/client/v1/client.proto"; import "neutron/feerefunder/fee.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/transfer/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/transfer/types"; // Msg defines the ibc/transfer Msg service. service Msg { diff --git a/proto/osmosis/tokenfactory/params.proto b/proto/osmosis/tokenfactory/params.proto index 563a17a4f..778867af2 100644 --- a/proto/osmosis/tokenfactory/params.proto +++ b/proto/osmosis/tokenfactory/params.proto @@ -5,7 +5,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/tokenfactory/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/tokenfactory/types"; // WhitelistedHook describes a beforeSendHook which is allowed to be added and executed // SetBeforeSendHook can only be called on denoms where the denom creator and diff --git a/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto index 863570e13..5b7d79ceb 100644 --- a/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto +++ b/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto @@ -4,7 +4,7 @@ package osmosis.tokenfactory.v1beta1; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/tokenfactory/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/tokenfactory/types"; // DenomAuthorityMetadata specifies metadata for addresses that have specific // capabilities over a token factory denom. Right now there is only one Admin diff --git a/proto/osmosis/tokenfactory/v1beta1/genesis.proto b/proto/osmosis/tokenfactory/v1beta1/genesis.proto index 82bb3c52a..6b7fd15d6 100644 --- a/proto/osmosis/tokenfactory/v1beta1/genesis.proto +++ b/proto/osmosis/tokenfactory/v1beta1/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "osmosis/tokenfactory/params.proto"; import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/tokenfactory/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/tokenfactory/types"; // GenesisState defines the tokenfactory module's genesis state. message GenesisState { diff --git a/proto/osmosis/tokenfactory/v1beta1/params.proto b/proto/osmosis/tokenfactory/v1beta1/params.proto index e7e8b1b7a..8374454d3 100644 --- a/proto/osmosis/tokenfactory/v1beta1/params.proto +++ b/proto/osmosis/tokenfactory/v1beta1/params.proto @@ -5,7 +5,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/tokenfactory/types/v1beta1"; +option go_package = "github.com/neutron-org/neutron/v5/x/tokenfactory/types/v1beta1"; // Params defines the parameters for the tokenfactory module. message Params { diff --git a/proto/osmosis/tokenfactory/v1beta1/query.proto b/proto/osmosis/tokenfactory/v1beta1/query.proto index d7b4d6f8d..4eeb459bd 100644 --- a/proto/osmosis/tokenfactory/v1beta1/query.proto +++ b/proto/osmosis/tokenfactory/v1beta1/query.proto @@ -6,7 +6,7 @@ import "google/api/annotations.proto"; import "osmosis/tokenfactory/params.proto"; import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/tokenfactory/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/tokenfactory/types"; // Query defines the gRPC querier service. service Query { @@ -37,6 +37,12 @@ service Query { "/osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/" "before_send_hook"; } + + // FullDenom defines a gRPC query method for getting full denom name + // from the creator and subdenom strings. + rpc FullDenom(QueryFullDenomRequest) returns (QueryFullDenomResponse) { + option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/full_denom"; + } } // QueryParamsRequest is the request type for the Query/Params RPC method. @@ -76,13 +82,28 @@ message QueryDenomsFromCreatorResponse { repeated string denoms = 1 [(gogoproto.moretags) = "yaml:\"denoms\""]; } +// QueryBeforeSendHookAddressRequest defines the request structure for the +// BeforeSendHookAddress gRPC query. message QueryBeforeSendHookAddressRequest { string creator = 1 [(gogoproto.moretags) = "yaml:\"creator\""]; string subdenom = 2 [(gogoproto.moretags) = "yaml:\"subdenom\""]; } // QueryBeforeSendHookAddressResponse defines the response structure for the -// DenomBeforeSendHook gRPC query. +// BeforeSendHookAddress gRPC query. message QueryBeforeSendHookAddressResponse { string contract_addr = 1 [(gogoproto.moretags) = "yaml:\"contract_addr\""]; } + +// QueryFullDenomRequest defines the request structure for the +// FullDenom gRPC query. +message QueryFullDenomRequest { + string creator = 1 [(gogoproto.moretags) = "yaml:\"creator\""]; + string subdenom = 2 [(gogoproto.moretags) = "yaml:\"subdenom\""]; +} + +// QueryFullDenomResponse defines the response structure for the +// FullDenom gRPC query. +message QueryFullDenomResponse { + string full_denom = 1 [(gogoproto.moretags) = "yaml:\"full_denom\""]; +} diff --git a/proto/osmosis/tokenfactory/v1beta1/tx.proto b/proto/osmosis/tokenfactory/v1beta1/tx.proto index e122fe71f..8b8c153bf 100644 --- a/proto/osmosis/tokenfactory/v1beta1/tx.proto +++ b/proto/osmosis/tokenfactory/v1beta1/tx.proto @@ -9,7 +9,7 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "osmosis/tokenfactory/params.proto"; -option go_package = "github.com/neutron-org/neutron/v4/x/tokenfactory/types"; +option go_package = "github.com/neutron-org/neutron/v5/x/tokenfactory/types"; // Msg defines the tokefactory module's gRPC message service. service Msg { diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index b9df9c41d..466e4eb21 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -27,5 +27,5 @@ done cd .. # move proto files to the right places -cp -r github.com/neutron-org/neutron/v4/x/* x/ -rm -rf github.com \ No newline at end of file +cp -r github.com/neutron-org/neutron/v5/x/* x/ +rm -rf github.com diff --git a/tests/e2e/interchain_security_test.go b/tests/e2e/interchain_security_test.go index 81201ab12..1473ed93f 100644 --- a/tests/e2e/interchain_security_test.go +++ b/tests/e2e/interchain_security_test.go @@ -9,9 +9,9 @@ import ( icssimapp "github.com/cosmos/interchain-security/v5/testutil/ibc_testing" "github.com/stretchr/testify/suite" - appConsumer "github.com/neutron-org/neutron/v4/app" - appparams "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil" + appConsumer "github.com/neutron-org/neutron/v5/app" + appparams "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil" ) // Executes the standard group of ccv tests against a consumer and provider app.go implementation. @@ -21,8 +21,9 @@ func TestCCVTestSuite(t *testing.T) { ccvSuite := e2e.NewCCVTestSuite[*appProvider.App, *appConsumer.App]( // Pass in ibctesting.AppIniters for provider and consumer. icssimapp.ProviderAppIniter, testutil.SetupValSetAppIniter, - // TODO: These three tests just don't work in IS, so skip them for now - []string{"TestSendRewardsRetries", "TestRewardsDistribution", "TestEndBlockRD"}) + // TODO: These test just doesn't work in IS, so skip it for now + []string{"TestRewardsDistribution"}, + ) // Run tests suite.Run(t, ccvSuite) diff --git a/tests/feemarket/go.mod b/tests/feemarket/go.mod index 01f5d008d..813997bf7 100644 --- a/tests/feemarket/go.mod +++ b/tests/feemarket/go.mod @@ -1,6 +1,6 @@ -module github.com/neutron-org/neutron/v4/tests/feemarket +module github.com/neutron-org/neutron/v5/tests/feemarket -go 1.22.3 +go 1.22.6 replace ( cosmossdk.io/core => cosmossdk.io/core v0.11.0 @@ -15,10 +15,10 @@ replace ( require ( cosmossdk.io/math v1.3.0 - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/skip-mev/feemarket v1.0.1 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/skip-mev/feemarket v1.1.0 github.com/skip-mev/feemarket/tests/e2e v1.10.0 - github.com/skip-mev/slinky v1.0.0 + github.com/skip-mev/slinky v1.0.10 github.com/strangelove-ventures/interchaintest/v8 v8.4.0 github.com/stretchr/testify v1.9.0 ) @@ -32,15 +32,15 @@ require ( cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/core v0.11.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/core v0.11.1 // indirect + cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/log v1.3.1 // indirect + cosmossdk.io/log v1.4.0 // indirect cosmossdk.io/store v1.1.0 // indirect cosmossdk.io/x/evidence v0.1.1 // indirect cosmossdk.io/x/feegrant v0.1.1 // indirect - cosmossdk.io/x/tx v0.13.3 // indirect - cosmossdk.io/x/upgrade v0.1.3 // indirect + cosmossdk.io/x/tx v0.13.4 // indirect + cosmossdk.io/x/upgrade v0.1.4 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -62,29 +62,29 @@ require ( github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.1 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.7 // indirect - github.com/cometbft/cometbft-db v0.11.0 // indirect + github.com/cometbft/cometbft v0.38.11 // indirect + github.com/cometbft/cometbft-db v0.12.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.5.0 // indirect + github.com/cosmos/gogoproto v1.6.0 // indirect github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect - github.com/cosmos/ibc-go/v8 v8.2.1 // indirect + github.com/cosmos/ibc-go/v8 v8.3.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/interchain-security/v5 v5.0.0 // indirect + github.com/cosmos/interchain-security/v5 v5.1.1 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect - github.com/danieljoos/wincred v1.2.0 // indirect + github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/base58 v1.0.4 // indirect @@ -92,9 +92,8 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker v24.0.9+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect @@ -102,7 +101,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/go-ethereum v1.14.4 // indirect + github.com/ethereum/go-ethereum v1.14.7 // indirect github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -112,8 +111,6 @@ require ( github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gobwas/httphead v0.1.0 // indirect - github.com/gobwas/pool v0.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect @@ -123,6 +120,7 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect + github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect @@ -131,14 +129,14 @@ require ( github.com/googleapis/gax-go/v2 v2.12.4 // indirect github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/mux v1.8.1 // indirect - github.com/gorilla/websocket v1.5.1 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.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/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.4 // indirect + github.com/hashicorp/go-getter v1.7.5 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-metrics v0.5.3 // indirect @@ -150,7 +148,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/holiman/uint256 v1.2.4 // indirect + github.com/holiman/uint256 v1.3.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845 // indirect @@ -159,7 +157,7 @@ require ( github.com/ipfs/go-cid v0.4.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.8 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -192,7 +190,6 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect - github.com/opencontainers/runc v1.1.12 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect @@ -207,7 +204,7 @@ require ( github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect @@ -215,8 +212,8 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.6.0 // indirect - github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/cast v1.7.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect @@ -228,7 +225,7 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect @@ -237,23 +234,23 @@ require ( go.opentelemetry.io/otel/trace v1.26.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/api v0.180.0 // indirect google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect + google.golang.org/grpc v1.65.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -271,3 +268,5 @@ require ( pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) + +replace github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.8-neutron diff --git a/tests/feemarket/go.sum b/tests/feemarket/go.sum index 331dc0e1e..e47067c01 100644 --- a/tests/feemarket/go.sum +++ b/tests/feemarket/go.sum @@ -188,18 +188,18 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= -cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= +cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUrQIg= +cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -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/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= 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/log v1.4.0 h1:Ttt9d6fQ0GlktwhcysOeNiIjixW7l0rYBocmoXOb11k= +cosmossdk.io/log v1.4.0/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= @@ -210,10 +210,10 @@ cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -246,7 +246,6 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -268,7 +267,6 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= @@ -309,7 +307,6 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -344,25 +341,25 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -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/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= 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/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= +github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= 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-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= -github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= -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/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= +github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -373,35 +370,32 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= 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.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= -github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.6.0 h1:Xm0F/96O5Ox4g6xGgjA41rWaaPjYtOdTi59uBcV2qEE= +github.com/cosmos/gogoproto v1.6.0/go.mod h1:Y+g956rcUf2vr4uwtCcK/1Xx9BWVluCtcI9vsh0GHmk= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= -github.com/cosmos/ibc-go/v8 v8.2.1 h1:MTsnZZjxvGD4Fv5pYyx5UkELafSX0rlPt6IfsE2BpTQ= -github.com/cosmos/ibc-go/v8 v8.2.1/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= +github.com/cosmos/ibc-go/v8 v8.3.2 h1:8X1oHHKt2Bh9hcExWS89rntLaCKZp2EjFTUSxKlPhGI= +github.com/cosmos/ibc-go/v8 v8.3.2/go.mod h1:WVVIsG39jGrF9Cjggjci6LzySyWGloz194sjTxiGNIE= 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/interchain-security/v5 v5.0.0 h1:iwHu1nFbXuYfa13isEgm6hkHU+2t/t56YjcfyP3PnQA= -github.com/cosmos/interchain-security/v5 v5.0.0/go.mod h1:h/RkwOppo5AJj+1pkQyfjqU1MPdpohD/S6oEeAXpGZY= +github.com/cosmos/interchain-security/v5 v5.1.1 h1:xmRRMeE4xoc+JAZUh0XzXFYWaGBtzFFj5SETuOgnEnY= +github.com/cosmos/interchain-security/v5 v5.1.1/go.mod h1:vmeTcTxFCl1eV0o6xpl/IRT7Basz0szVVGzbppnInMg= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= -github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= +github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= +github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= @@ -423,9 +417,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etly github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -463,8 +456,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.14.4 h1:AI1778nnI9vb3eCcLo6XTw/lqp6ilVHQmbWmJOUHGU8= -github.com/ethereum/go-ethereum v1.14.4/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc= +github.com/ethereum/go-ethereum v1.14.7 h1:EHpv3dE8evQmpVEQ/Ne2ahB06n2mQptdwqaMNhAT29g= +github.com/ethereum/go-ethereum v1.14.7/go.mod h1:Mq0biU2jbdmKSZoqOj29017ygFrMnB5/Rifwp980W4o= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= @@ -528,12 +521,10 @@ github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4 github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= 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/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= -github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= -github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= @@ -594,6 +585,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -676,8 +669,8 @@ 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.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 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.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -700,8 +693,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= -github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= +github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -744,8 +737,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= -github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= +github.com/holiman/uint256 v1.3.0 h1:4wdcm/tnd0xXdu7iS3ruNvxkWwrb4aeBQv19ayYn8F4= +github.com/holiman/uint256 v1.3.0/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -793,10 +786,9 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= -github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -823,7 +815,6 @@ github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0U github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= @@ -909,6 +900,8 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/neutron-org/cosmos-sdk v0.50.8-neutron h1:L+4obYi/KkkmS05gBlXNF+FhipHYTl0iO3EkmpMBXkE= +github.com/neutron-org/cosmos-sdk v0.50.8-neutron/go.mod h1:Zb+DgHtiByNwgj71IlJBXwOq6dLhtyAq3AgqpXm/jHo= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -939,8 +932,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -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/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -958,7 +951,6 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= @@ -1032,9 +1024,8 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -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/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -1057,14 +1048,14 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610 h1:4JlsiRVt/YZOvrKH525T7sZXgEWUEjqSDMwE6fXNbdo= github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610/go.mod h1:kB8gFZX07CyJnw8q9iEZijI3qJTIe1K/Y++P5VGkrcg= -github.com/skip-mev/feemarket v1.0.1 h1:Bkn7ELhaqYppki1c9eWQw3fEYsGXXeHng9VxD4AdMBY= -github.com/skip-mev/feemarket v1.0.1/go.mod h1:52iSehc6mb98xPhRYRqg4crAIxz32RWTbK/LXOwRuf4= +github.com/skip-mev/feemarket v1.1.0 h1:3z/3Mplmk4t1C/IjghC+OE361L9n8dR3Xr7bXIcS7ec= +github.com/skip-mev/feemarket v1.1.0/go.mod h1:CVsCaHxJDK4y271c1Dan6Z8G2QaOyWJLoSBnDEPon40= github.com/skip-mev/feemarket/tests/e2e v1.10.0 h1:oKAZSo+rynd2b7+T8/U+4C+h//rrTdjLICG2Awjk8YA= github.com/skip-mev/feemarket/tests/e2e v1.10.0/go.mod h1:57BURopGhr+L0zDkhj1E9jzP9W8rMzRb3b+MT+trlB4= github.com/skip-mev/interchaintest/v8 v8.0.1-0.20240611183342-72ec508eb966 h1:X5BD7m4QieHlORqGho1Af8r0O1GSWBRYO330xyu2kzQ= github.com/skip-mev/interchaintest/v8 v8.0.1-0.20240611183342-72ec508eb966/go.mod h1:nfPgRi1yjnzi+qF+0Fs9qN9kkS1Fk0oqgpKvqg5a200= -github.com/skip-mev/slinky v1.0.0 h1:4sgHF1H8yrqNn3Uhuw+B11aWIavXgaSiZBZU5/BF/fs= -github.com/skip-mev/slinky v1.0.0/go.mod h1:XRNy7m51XOLtEWN5l3TyKyYkNUL7KL2tuTsYe17LYGE= +github.com/skip-mev/slinky v1.0.10 h1:QBd/jBxUcV2dq3VERhf5h42cAA0s2awPZGWpHgh0t20= +github.com/skip-mev/slinky v1.0.10/go.mod h1:8mxMdQ8MY8QAxgxLvUKTfDwX6XCAUeqZwkU/r+ZsELU= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1074,22 +1065,16 @@ github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIK github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 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.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -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/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1135,7 +1120,6 @@ github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2n github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= @@ -1145,7 +1129,6 @@ github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o 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= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1157,8 +1140,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1207,7 +1190,6 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1217,8 +1199,8 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1230,8 +1212,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 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-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= 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-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1258,8 +1240,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1319,8 +1301,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1362,8 +1344,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1372,7 +1354,6 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1382,7 +1363,6 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1432,6 +1412,7 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1460,13 +1441,13 @@ golang.org/x/sys v0.1.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.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= 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= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1477,8 +1458,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= 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= @@ -1546,8 +1527,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= 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= @@ -1726,10 +1707,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda h1:wu/KJm9KJwpfHWhkkZGohVC6KRrc1oJNr4jwtQMOQXw= google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw= -google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 h1:QW9+G6Fir4VcRXVH8x3LilNAb6cxBGLa6+GM4hRwexE= -google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f h1:b1Ln/PG8orm0SsBbHZWke8dDp2lrCD4jSmfglFpTZbk= +google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade h1:oCRSWfwGXQsqlVdErcyTt4A93Y8fo0/9D4b1gnI++qo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1771,8 +1752,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= 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= @@ -1789,8 +1770,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tests/ibc/gmp_swap_forward_test.go b/tests/ibc/gmp_swap_forward_test.go deleted file mode 100644 index 7fd92d904..000000000 --- a/tests/ibc/gmp_swap_forward_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package ibc_test - -import ( - "encoding/json" - - "cosmossdk.io/math" - - "github.com/neutron-org/neutron/v4/x/dex/types" - "github.com/neutron-org/neutron/v4/x/gmp" - swaptypes "github.com/neutron-org/neutron/v4/x/ibcswap/types" -) - -// TestGMPSwap_Success asserts that the swap middleware works as intended when the original message is sent via GMP -func (s *IBCTestSuite) TestGMPSwapAndForward_Success() { - // Send an IBC transfer from provider to Neutron, so we can initialize a pool with the IBC denom token + native Neutron token - s.IBCTransferProviderToNeutron(s.providerAddr, s.neutronAddr, nativeDenom, ibcTransferAmount, "") - - // Assert that the funds are gone from the acc on provider and present in the acc on Neutron - newProviderBalNative := genesisWalletAmount.Sub(ibcTransferAmount) - s.assertProviderBalance(s.providerAddr, nativeDenom, newProviderBalNative) - - s.assertNeutronBalance(s.neutronAddr, s.providerToNeutronDenom, ibcTransferAmount) - - // deposit stake<>ibcTransferToken to initialize the pool on Neutron - depositAmount := math.NewInt(100_000) - postDepositNeutronBalNative := genesisWalletAmount.Sub(depositAmount) - s.neutronDeposit( - nativeDenom, - s.providerToNeutronDenom, - depositAmount, - depositAmount, - 0, - 1, - s.neutronAddr) - - // Compose the IBC transfer memo metadata to be used in the swap and forward - swapAmount := math.NewInt(100000) - expectedOut := math.NewInt(99990) - - swapMetadata := swaptypes.PacketMetadata{ - Swap: &swaptypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: s.neutronAddr.String(), - Receiver: s.neutronAddr.String(), - TokenIn: s.providerToNeutronDenom, - TokenOut: nativeDenom, - AmountIn: swapAmount, - TickIndexInToOut: 2, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - }, - } - swapMetadataBz, err := json.Marshal(swapMetadata) - - s.Require().NoError(err) - - gmpMetadata := gmp.Message{ - SourceChain: "axelar", - SourceAddress: "alice", - Payload: swapMetadataBz, - Type: gmp.TypeGeneralMessageWithToken, - } - - gmpMetadataBz, err := json.Marshal(gmpMetadata) - s.Require().NoError(err) - - // Send an IBC transfer from chainA to chainB with GMP payload containing the swap metadata - - s.IBCTransferProviderToNeutron(s.providerAddr, s.neutronAddr, nativeDenom, ibcTransferAmount, string(gmpMetadataBz)) - - // Check that the funds are moved out of the acc on providerChain - s.assertProviderBalance( - s.providerAddr, - nativeDenom, - newProviderBalNative.Sub(ibcTransferAmount), - ) - - // Check that the swap funds are now present in the acc on Neutron - s.assertNeutronBalance(s.neutronAddr, nativeDenom, postDepositNeutronBalNative.Add(expectedOut)) - - // Check that the overrideReceiver did not keep anything - overrideAddr := s.ReceiverOverrideAddr(s.neutronTransferPath.EndpointA.ChannelID, s.providerAddr.String()) - s.assertNeutronBalance(overrideAddr, s.providerToNeutronDenom, math.ZeroInt()) - s.assertNeutronBalance(overrideAddr, s.providerToNeutronDenom, math.ZeroInt()) - - // Check that nothing is credited to the original creator - s.assertNeutronBalance(s.neutronAddr, s.providerToNeutronDenom, math.ZeroInt()) -} diff --git a/tests/ibc/ibc_setup_test.go b/tests/ibc/ibc_setup_test.go index 54264e685..98017cb12 100644 --- a/tests/ibc/ibc_setup_test.go +++ b/tests/ibc/ibc_setup_test.go @@ -5,7 +5,6 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" @@ -18,14 +17,12 @@ import ( ccv "github.com/cosmos/interchain-security/v5/x/ccv/types" "github.com/stretchr/testify/suite" - appparams "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" + appparams "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil" ) var ( nativeDenom = appparams.DefaultDenom - ibcTransferAmount = math.NewInt(100_000) genesisWalletAmount, _ = math.NewIntFromString("10000000000000000000") ) @@ -338,38 +335,3 @@ func (s *IBCTestSuite) assertChainBBalance(addr sdk.AccAddress, denom string, ex func (s *IBCTestSuite) assertChainCBalance(addr sdk.AccAddress, denom string, expectedAmt math.Int) { s.assertBalance(s.bundleC.App.GetTestBankKeeper(), s.bundleC.Chain, addr, denom, expectedAmt) } - -func (s *IBCTestSuite) ReceiverOverrideAddr(channel, sender string) sdk.AccAddress { - addr, err := packetforward.GetReceiver(channel, sender) - if err != nil { - panic("Cannot calc receiver override: " + err.Error()) - } - return sdk.MustAccAddressFromBech32(addr) -} - -func (s *IBCTestSuite) neutronDeposit( - token0 string, - token1 string, - depositAmount0 math.Int, - depositAmount1 math.Int, - tickIndex int64, - fee uint64, - creator sdk.AccAddress, -) { - // create deposit msg - msgDeposit := dextypes.NewMsgDeposit( - creator.String(), - creator.String(), - token0, - token1, - []math.Int{depositAmount0}, - []math.Int{depositAmount1}, - []int64{tickIndex}, - []uint64{fee}, - []*dextypes.DepositOptions{{DisableAutoswap: false}}, - ) - - // execute deposit msg - _, err := s.neutronChain.SendMsgs(msgDeposit) - s.Assert().NoError(err, "Deposit Failed") -} diff --git a/tests/ibc/swap_forward_test.go b/tests/ibc/swap_forward_test.go deleted file mode 100644 index 2385da68d..000000000 --- a/tests/ibc/swap_forward_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package ibc_test - -import ( - "encoding/json" - "time" - - "cosmossdk.io/math" - pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" - - "github.com/neutron-org/neutron/v4/x/dex/types" - swaptypes "github.com/neutron-org/neutron/v4/x/ibcswap/types" -) - -// TestSwapAndForward_Fails asserts that the IBC swap middleware fails gracefully when provided with a package-forward memo -func (s *IBCTestSuite) TestSwapAndForward_Fails() { - // Send an IBC transfer from provider chain to neutron, so we can initialize a pool with the IBC denom token + native Neutron token - s.IBCTransferProviderToNeutron( - s.providerAddr, - s.neutronAddr, - nativeDenom, - ibcTransferAmount, - "", - ) - newProviderBalNative := genesisWalletAmount.Sub(ibcTransferAmount) - - // deposit stake<>ibcTransferToken to initialize the pool on Neutron - depositAmount := math.NewInt(100_000) - s.neutronDeposit( - nativeDenom, - s.providerToNeutronDenom, - depositAmount, - depositAmount, - 0, - 1, - s.neutronAddr) - - postDepositNeutronBalNative := genesisWalletAmount.Sub(depositAmount) - - // Compose the IBC transfer memo metadata to be used in the swap and forward - swapAmount := math.NewInt(100000) - chainBAddr := s.bundleB.Chain.SenderAccount.GetAddress() - - retries := uint8(0) - - forwardMetadata := pfmtypes.PacketMetadata{ - Forward: &pfmtypes.ForwardMetadata{ - Receiver: chainBAddr.String(), - Port: s.neutronChainBPath.EndpointA.ChannelConfig.PortID, - Channel: s.neutronChainBPath.EndpointA.ChannelID, - Timeout: pfmtypes.Duration(5 * time.Minute), - Retries: &retries, - Next: nil, - }, - } - - bz, err := json.Marshal(forwardMetadata) - s.Assert().NoError(err) - - nextJSON := new(swaptypes.JSONObject) - err = json.Unmarshal(bz, nextJSON) - s.Assert().NoError(err) - - metadata := swaptypes.PacketMetadata{ - Swap: &swaptypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: s.neutronAddr.String(), - Receiver: s.neutronAddr.String(), - TokenIn: s.providerToNeutronDenom, - TokenOut: nativeDenom, - AmountIn: swapAmount, - TickIndexInToOut: 2, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nextJSON, - }, - } - - metadataBz, err := json.Marshal(metadata) - s.Require().NoError(err) - - // Send (failing) IBC transfer with PFM data - s.IBCTransferProviderToNeutron( - s.providerAddr, - s.neutronAddr, - nativeDenom, - ibcTransferAmount, - string(metadataBz), - ) - - // Check that the funds are not present in the account on Neutron - s.assertNeutronBalance(s.neutronAddr, nativeDenom, postDepositNeutronBalNative) - s.assertNeutronBalance(s.neutronAddr, s.providerToNeutronDenom, math.ZeroInt()) - - // Check that the refund takes place and the funds are moved back to the account on Gaia - s.assertProviderBalance(s.providerAddr, nativeDenom, newProviderBalNative) -} diff --git a/tests/ibc/swap_test.go b/tests/ibc/swap_test.go deleted file mode 100644 index bd8f47ca7..000000000 --- a/tests/ibc/swap_test.go +++ /dev/null @@ -1,173 +0,0 @@ -package ibc_test - -import ( - "encoding/json" - - "cosmossdk.io/math" - - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" - swaptypes "github.com/neutron-org/neutron/v4/x/ibcswap/types" -) - -// TestIBCSwapMiddleware_Success asserts that the IBC swap middleware works as intended with Neutron running as a -// consumer chain connected to the Cosmos Hub. -func (s *IBCTestSuite) TestIBCSwapMiddleware_Success() { - // Send an IBC transfer from provider to Neutron, so we can initialize a pool with the IBC denom token + native Neutron token - s.IBCTransferProviderToNeutron( - s.providerAddr, - s.neutronAddr, - nativeDenom, - ibcTransferAmount, - "", - ) - - // Assert that the funds are gone from the acc on provider and present in the acc on Neutron - newProviderBalNative := genesisWalletAmount.Sub(ibcTransferAmount) - s.assertProviderBalance(s.providerAddr, nativeDenom, newProviderBalNative) - - s.assertNeutronBalance(s.neutronAddr, s.providerToNeutronDenom, ibcTransferAmount) - - // deposit stake<>ibcTransferToken to initialize the pool on Neutron - depositAmount := math.NewInt(100_000) - s.neutronDeposit( - nativeDenom, - s.providerToNeutronDenom, - depositAmount, - depositAmount, - 0, - 1, - s.neutronAddr) - - // Assert that the deposit was successful and the funds are moved out of the Neutron user acc - s.assertNeutronBalance(s.neutronAddr, s.providerToNeutronDenom, math.ZeroInt()) - postDepositNeutronBalNative := genesisWalletAmount.Sub(depositAmount) - s.assertNeutronBalance(s.neutronAddr, nativeDenom, postDepositNeutronBalNative) - - // Send an IBC transfer from providerChain to Neutron with packet memo containing the swap metadata - swapAmount := math.NewInt(100000) - expectedOut := math.NewInt(99_990) - - metadata := swaptypes.PacketMetadata{ - Swap: &swaptypes.SwapMetadata{ - MsgPlaceLimitOrder: &dextypes.MsgPlaceLimitOrder{ - Creator: s.neutronAddr.String(), - Receiver: s.neutronAddr.String(), - TokenIn: s.providerToNeutronDenom, - TokenOut: nativeDenom, - AmountIn: swapAmount, - TickIndexInToOut: 2, - OrderType: dextypes.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - - metadataBz, err := json.Marshal(metadata) - s.Require().NoError(err) - - s.IBCTransferProviderToNeutron( - s.providerAddr, - s.neutronAddr, - nativeDenom, - ibcTransferAmount, - string(metadataBz), - ) - - // Check that the funds are moved out of the acc on providerChain - s.assertProviderBalance( - s.providerAddr, - nativeDenom, - newProviderBalNative.Sub(ibcTransferAmount), - ) - - // Check that the swap funds are now present in the acc on Neutron - s.assertNeutronBalance(s.neutronAddr, nativeDenom, postDepositNeutronBalNative.Add(expectedOut)) - - // Check that the overrideReceiver did not keep anything - overrideAddr := s.ReceiverOverrideAddr(s.neutronTransferPath.EndpointA.ChannelID, s.providerAddr.String()) - s.assertNeutronBalance(overrideAddr, s.providerToNeutronDenom, math.ZeroInt()) - s.assertNeutronBalance(overrideAddr, s.providerToNeutronDenom, math.ZeroInt()) - - // Check that nothing credited to the original creator - s.assertNeutronBalance(s.neutronAddr, s.providerToNeutronDenom, math.ZeroInt()) -} - -// TestIBCSwapMiddleware_FailRefund asserts that the IBC swap middleware works as intended with Neutron running as a -// consumer chain connected to the Cosmos Hub. The swap should fail and a refund to the src chain should take place. -func (s *IBCTestSuite) TestIBCSwapMiddleware_FailRefund() { - // Compose the swap metadata, this swap will fail because there is no pool initialized for this pair - swapAmount := math.NewInt(100000) - metadata := swaptypes.PacketMetadata{ - Swap: &swaptypes.SwapMetadata{ - MsgPlaceLimitOrder: &dextypes.MsgPlaceLimitOrder{ - Creator: s.neutronAddr.String(), - Receiver: s.neutronAddr.String(), - TokenIn: s.providerToNeutronDenom, - TokenOut: nativeDenom, - AmountIn: swapAmount, - TickIndexInToOut: 1, - OrderType: dextypes.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - - metadataBz, err := json.Marshal(metadata) - s.Require().NoError(err) - - // Send (failing) IBC transfer with swap metadata - s.IBCTransferProviderToNeutron( - s.providerAddr, - s.neutronAddr, - nativeDenom, - ibcTransferAmount, - string(metadataBz), - ) - - // Check that the funds are not present in the account on Neutron - s.assertNeutronBalance(s.neutronAddr, nativeDenom, genesisWalletAmount) - s.assertNeutronBalance(s.neutronAddr, s.providerToNeutronDenom, math.ZeroInt()) - - // Check that the refund takes place and the funds are moved back to the account on Gaia - s.assertProviderBalance(s.providerAddr, nativeDenom, genesisWalletAmount) -} - -func (s *IBCTestSuite) TestIBCSwapMiddleware_FailWithRefundAddr() { - // Compose the swap metadata, this swap will fail because there is no pool initialized for this pair - refundAddr := s.neutronChain.SenderAccounts[1].SenderAccount.GetAddress() - swapAmount := math.NewInt(100000) - metadata := swaptypes.PacketMetadata{ - Swap: &swaptypes.SwapMetadata{ - MsgPlaceLimitOrder: &dextypes.MsgPlaceLimitOrder{ - Creator: s.neutronAddr.String(), - Receiver: s.neutronAddr.String(), - TokenIn: s.providerToNeutronDenom, - TokenOut: nativeDenom, - AmountIn: swapAmount, - TickIndexInToOut: 1, - OrderType: dextypes.LimitOrderType_FILL_OR_KILL, - }, - NeutronRefundAddress: refundAddr.String(), - Next: nil, - }, - } - - metadataBz, err := json.Marshal(metadata) - s.Require().NoError(err) - - // Send (failing) IBC transfer with swap metadata - s.IBCTransferProviderToNeutron( - s.providerAddr, - s.neutronAddr, - nativeDenom, - ibcTransferAmount, - string(metadataBz), - ) - - // Check that the funds have been moved to the refund address - s.assertNeutronBalance(refundAddr, nativeDenom, genesisWalletAmount) - s.assertNeutronBalance(refundAddr, s.providerToNeutronDenom, ibcTransferAmount) - - // Check that no refund takes place and the funds are not in the account on provider - s.assertProviderBalance(s.providerAddr, nativeDenom, genesisWalletAmount.Sub(ibcTransferAmount)) -} diff --git a/tests/slinky/go.mod b/tests/slinky/go.mod index 5042c0f05..daf05f1b2 100644 --- a/tests/slinky/go.mod +++ b/tests/slinky/go.mod @@ -13,8 +13,8 @@ replace ( ) require ( - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/skip-mev/slinky v1.0.3 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/skip-mev/slinky v1.0.10 github.com/skip-mev/slinky/tests/integration v1.1.1-0.20240614013955-8d008bc600dd github.com/strangelove-ventures/interchaintest/v8 v8.4.0 github.com/stretchr/testify v1.9.0 @@ -29,16 +29,16 @@ require ( cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/core v0.11.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/core v0.11.1 // indirect + cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/log v1.3.1 // indirect + cosmossdk.io/log v1.4.0 // indirect cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/store v1.1.0 // indirect cosmossdk.io/x/evidence v0.1.1 // indirect cosmossdk.io/x/feegrant v0.1.1 // indirect - cosmossdk.io/x/tx v0.13.3 // indirect - cosmossdk.io/x/upgrade v0.1.3 // indirect + cosmossdk.io/x/tx v0.13.4 // indirect + cosmossdk.io/x/upgrade v0.1.4 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -64,23 +64,24 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.1 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.7 // indirect + github.com/cometbft/cometbft v0.38.10 // indirect github.com/cometbft/cometbft-db v0.12.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.5.0 // indirect + github.com/cosmos/gogoproto v1.6.0 // indirect github.com/cosmos/iavl v1.2.0 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect - github.com/cosmos/ibc-go/v8 v8.3.1 // indirect + github.com/cosmos/ibc-go/v8 v8.3.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/interchain-security/v5 v5.0.0 // indirect + github.com/cosmos/interchain-security/v5 v5.1.1 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -99,7 +100,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/go-ethereum v1.14.5 // indirect + github.com/ethereum/go-ethereum v1.14.7 // indirect github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -134,7 +135,7 @@ require ( github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.4 // indirect + github.com/hashicorp/go-getter v1.7.5 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-metrics v0.5.3 // indirect @@ -146,7 +147,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.2.0 // indirect - github.com/holiman/uint256 v1.2.4 // indirect + github.com/holiman/uint256 v1.3.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0 // indirect @@ -209,7 +210,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect @@ -232,22 +233,22 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.23.0 // indirect google.golang.org/api v0.183.0 // indirect google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/grpc v1.64.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect + google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect @@ -266,3 +267,5 @@ require ( pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) + +replace github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.8-neutron diff --git a/tests/slinky/go.sum b/tests/slinky/go.sum index 46887e81a..753505cc9 100644 --- a/tests/slinky/go.sum +++ b/tests/slinky/go.sum @@ -188,18 +188,18 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= -cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= +cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUrQIg= +cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -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/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= 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/log v1.4.0 h1:Ttt9d6fQ0GlktwhcysOeNiIjixW7l0rYBocmoXOb11k= +cosmossdk.io/log v1.4.0/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= @@ -210,10 +210,10 @@ cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -355,17 +355,19 @@ github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4Y github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= 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/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= +github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= 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-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= -github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= +github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= +github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -380,26 +382,24 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= 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.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= -github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.6.0 h1:Xm0F/96O5Ox4g6xGgjA41rWaaPjYtOdTi59uBcV2qEE= +github.com/cosmos/gogoproto v1.6.0/go.mod h1:Y+g956rcUf2vr4uwtCcK/1Xx9BWVluCtcI9vsh0GHmk= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= -github.com/cosmos/ibc-go/v8 v8.3.1 h1:cUNWvTCftKQIcpbf2y/jVzo2OY3g4GVFw6tTC/pQ+tA= -github.com/cosmos/ibc-go/v8 v8.3.1/go.mod h1:izwHZvn9lKrBn8xWj0aXWut6HKcwHMPD3uyuvOJoPSA= +github.com/cosmos/ibc-go/v8 v8.3.2 h1:8X1oHHKt2Bh9hcExWS89rntLaCKZp2EjFTUSxKlPhGI= +github.com/cosmos/ibc-go/v8 v8.3.2/go.mod h1:WVVIsG39jGrF9Cjggjci6LzySyWGloz194sjTxiGNIE= 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/interchain-security/v5 v5.0.0 h1:iwHu1nFbXuYfa13isEgm6hkHU+2t/t56YjcfyP3PnQA= -github.com/cosmos/interchain-security/v5 v5.0.0/go.mod h1:h/RkwOppo5AJj+1pkQyfjqU1MPdpohD/S6oEeAXpGZY= +github.com/cosmos/interchain-security/v5 v5.1.1 h1:xmRRMeE4xoc+JAZUh0XzXFYWaGBtzFFj5SETuOgnEnY= +github.com/cosmos/interchain-security/v5 v5.1.1/go.mod h1:vmeTcTxFCl1eV0o6xpl/IRT7Basz0szVVGzbppnInMg= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -470,8 +470,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.14.5 h1:szuFzO1MhJmweXjoM5nSAeDvjNUH3vIQoMzzQnfvjpw= -github.com/ethereum/go-ethereum v1.14.5/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc= +github.com/ethereum/go-ethereum v1.14.7 h1:EHpv3dE8evQmpVEQ/Ne2ahB06n2mQptdwqaMNhAT29g= +github.com/ethereum/go-ethereum v1.14.7/go.mod h1:Mq0biU2jbdmKSZoqOj29017ygFrMnB5/Rifwp980W4o= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= @@ -692,8 +692,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= -github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= +github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -736,8 +736,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= -github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= +github.com/holiman/uint256 v1.3.0 h1:4wdcm/tnd0xXdu7iS3ruNvxkWwrb4aeBQv19ayYn8F4= +github.com/holiman/uint256 v1.3.0/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -896,6 +896,8 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/neutron-org/cosmos-sdk v0.50.8-neutron h1:L+4obYi/KkkmS05gBlXNF+FhipHYTl0iO3EkmpMBXkE= +github.com/neutron-org/cosmos-sdk v0.50.8-neutron/go.mod h1:Zb+DgHtiByNwgj71IlJBXwOq6dLhtyAq3AgqpXm/jHo= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -1042,10 +1044,10 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skip-mev/chaintestutil v0.0.0-20240116134208-3e49bf514803 h1:VRRVYN3wsOIOqVT3e3nDh3vyUl6RvF9QwdK4BvgPP9c= -github.com/skip-mev/chaintestutil v0.0.0-20240116134208-3e49bf514803/go.mod h1:LF2koCTmygQnz11yjSfHvNP8axdyZ2lTEw0EwI+dnno= -github.com/skip-mev/slinky v1.0.3 h1:+7Yw+HHjYqJ7gb5nrG1k2bplNG+qEmn5wws+OesdY2M= -github.com/skip-mev/slinky v1.0.3/go.mod h1:EE3O71wIJ74OciYh62Fc5EysF07KArBEYb6lDmTIKVM= +github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610 h1:4JlsiRVt/YZOvrKH525T7sZXgEWUEjqSDMwE6fXNbdo= +github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610/go.mod h1:kB8gFZX07CyJnw8q9iEZijI3qJTIe1K/Y++P5VGkrcg= +github.com/skip-mev/slinky v1.0.10 h1:QBd/jBxUcV2dq3VERhf5h42cAA0s2awPZGWpHgh0t20= +github.com/skip-mev/slinky v1.0.10/go.mod h1:8mxMdQ8MY8QAxgxLvUKTfDwX6XCAUeqZwkU/r+ZsELU= github.com/skip-mev/slinky/tests/integration v1.1.1-0.20240614013955-8d008bc600dd h1:jqem8fOGfvzykGaAMe8daZh+SU+5GMBNaJJXOHpx/Wc= github.com/skip-mev/slinky/tests/integration v1.1.1-0.20240614013955-8d008bc600dd/go.mod h1:N78g29Sbbr8MdUm/wVx0B9kALvDLaF9Bn2fYIAUL7sI= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1059,8 +1061,8 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 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.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1193,8 +1195,8 @@ golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1206,8 +1208,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 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-20240604190554-fc45aab8b7f8 h1:LoYXNGAShUG3m/ehNk4iFctuhGX/+R1ZpfJ4/ia80JM= -golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= 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-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1234,8 +1236,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1296,8 +1298,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1339,8 +1341,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1435,13 +1437,13 @@ golang.org/x/sys v0.1.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.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= 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= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1521,8 +1523,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= @@ -1701,10 +1703,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 h1:HCZ6DlkKtCDAtD8ForECsY3tKuaR+p4R3grlK80uCCc= google.golang.org/genproto v0.0.0-20240604185151-ef581f913117/go.mod h1:lesfX/+9iA+3OdqeCpoDddJaNxVB1AB6tD7EfqMmprc= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f h1:b1Ln/PG8orm0SsBbHZWke8dDp2lrCD4jSmfglFpTZbk= +google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade h1:oCRSWfwGXQsqlVdErcyTt4A93Y8fo0/9D4b1gnI++qo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1746,8 +1748,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= 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= diff --git a/testutil/apptesting/test_suite.go b/testutil/apptesting/test_suite.go index c2078edb9..ba9b4e3b3 100644 --- a/testutil/apptesting/test_suite.go +++ b/testutil/apptesting/test_suite.go @@ -17,9 +17,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil" - dexmoduletypes "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/testutil" + dexmoduletypes "github.com/neutron-org/neutron/v5/x/dex/types" ) type KeeperTestHelper struct { diff --git a/testutil/consumer/test_helpers.go b/testutil/consumer/test_helpers.go index 0a1db0406..712e2f5c0 100644 --- a/testutil/consumer/test_helpers.go +++ b/testutil/consumer/test_helpers.go @@ -20,7 +20,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" - "github.com/neutron-org/neutron/v4/app" + "github.com/neutron-org/neutron/v5/app" ) // This function creates consumer module genesis state that is used as starting point for modifications diff --git a/testutil/contractmanager/keeper/contractmanager.go b/testutil/contractmanager/keeper/contractmanager.go index 5b537ea2c..dc5a3f54a 100644 --- a/testutil/contractmanager/keeper/contractmanager.go +++ b/testutil/contractmanager/keeper/contractmanager.go @@ -17,8 +17,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func ContractManagerKeeper(t testing.TB, wasmKeeper types.WasmKeeper) (*keeper.Keeper, sdk.Context) { diff --git a/testutil/contractmanager/network/network.go b/testutil/contractmanager/network/network.go index 914c654ce..878045594 100644 --- a/testutil/contractmanager/network/network.go +++ b/testutil/contractmanager/network/network.go @@ -23,10 +23,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil/consumer" + "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/testutil/consumer" ) type ( diff --git a/testutil/cron/keeper/cron.go b/testutil/cron/keeper/cron.go index fd9e321b5..0eb83d432 100644 --- a/testutil/cron/keeper/cron.go +++ b/testutil/cron/keeper/cron.go @@ -17,8 +17,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/cron/keeper" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/keeper" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func CronKeeper(t testing.TB, wasmMsgServer types.WasmMsgServer, accountKeeper types.AccountKeeper) (*keeper.Keeper, sdk.Context) { diff --git a/testutil/cron/network/network.go b/testutil/cron/network/network.go index 7a419741e..525370faf 100644 --- a/testutil/cron/network/network.go +++ b/testutil/cron/network/network.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" pruningtypes "cosmossdk.io/store/pruning/types" db "github.com/cosmos/cosmos-db" @@ -16,11 +16,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/neutron-org/neutron/v4/testutil/consumer" + "github.com/neutron-org/neutron/v5/testutil/consumer" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" - "github.com/neutron-org/neutron/v4/app" + "github.com/neutron-org/neutron/v5/app" tmrand "github.com/cometbft/cometbft/libs/rand" "github.com/cosmos/cosmos-sdk/baseapp" diff --git a/testutil/dex/keeper/dex.go b/testutil/dex/keeper/dex.go index 7c4ae1c81..6be5802a3 100644 --- a/testutil/dex/keeper/dex.go +++ b/testutil/dex/keeper/dex.go @@ -16,8 +16,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func DexKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { diff --git a/testutil/dynamicfees/keeper/keeper.go b/testutil/dynamicfees/keeper/keeper.go index 692fb2192..d14dec8d0 100644 --- a/testutil/dynamicfees/keeper/keeper.go +++ b/testutil/dynamicfees/keeper/keeper.go @@ -17,8 +17,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/dynamicfees/keeper" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/keeper" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) func DynamicFeesKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { diff --git a/testutil/feeburner/keeper/feeburner.go b/testutil/feeburner/keeper/feeburner.go index 205e1a95c..41c186be8 100644 --- a/testutil/feeburner/keeper/feeburner.go +++ b/testutil/feeburner/keeper/feeburner.go @@ -17,8 +17,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func FeeburnerKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { diff --git a/testutil/feerefunder/keeper/fee.go b/testutil/feerefunder/keeper/fee.go index c10a94367..b4ebfb1bc 100644 --- a/testutil/feerefunder/keeper/fee.go +++ b/testutil/feerefunder/keeper/fee.go @@ -16,8 +16,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/feerefunder/keeper" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/keeper" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) func FeeKeeper(t testing.TB, channelKeeper types.ChannelKeeper, bankKeeper types.BankKeeper) (*keeper.Keeper, sdk.Context) { diff --git a/testutil/globalfee/keeper/globalfee.go b/testutil/globalfee/keeper/globalfee.go index 584b7e548..27b8379c6 100644 --- a/testutil/globalfee/keeper/globalfee.go +++ b/testutil/globalfee/keeper/globalfee.go @@ -17,8 +17,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/globalfee/keeper" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/keeper" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) func GlobalFeeKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { diff --git a/testutil/integration_test_setup.go b/testutil/integration_test_setup.go index b79b2f5a9..dfdfc5806 100644 --- a/testutil/integration_test_setup.go +++ b/testutil/integration_test_setup.go @@ -23,7 +23,7 @@ import ( ibctesting "github.com/cosmos/ibc-go/v8/testing" consumertypes "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types" - "github.com/neutron-org/neutron/v4/testutil/consumer" + "github.com/neutron-org/neutron/v5/testutil/consumer" "github.com/stretchr/testify/require" ) diff --git a/testutil/interchainqueries/keeper/interchainqueries.go b/testutil/interchainqueries/keeper/interchainqueries.go index 587f7f0c7..0c3ded326 100644 --- a/testutil/interchainqueries/keeper/interchainqueries.go +++ b/testutil/interchainqueries/keeper/interchainqueries.go @@ -19,8 +19,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func InterchainQueriesKeeper( diff --git a/testutil/interchainqueries/network/network.go b/testutil/interchainqueries/network/network.go index de29f6782..ac9846444 100644 --- a/testutil/interchainqueries/network/network.go +++ b/testutil/interchainqueries/network/network.go @@ -23,10 +23,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil/consumer" + "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/testutil/consumer" ) type ( diff --git a/testutil/interchaintxs/keeper/interchaintxs.go b/testutil/interchaintxs/keeper/interchaintxs.go index 87e6f3685..30a2c7497 100644 --- a/testutil/interchaintxs/keeper/interchaintxs.go +++ b/testutil/interchaintxs/keeper/interchaintxs.go @@ -17,8 +17,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func InterchainTxsKeeper( diff --git a/testutil/interchaintxs/keeper/sudo_middleware.go b/testutil/interchaintxs/keeper/sudo_middleware.go index c0cc4f5fc..2f06c3c61 100644 --- a/testutil/interchaintxs/keeper/sudo_middleware.go +++ b/testutil/interchaintxs/keeper/sudo_middleware.go @@ -12,8 +12,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/contractmanager" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func NewSudoLimitWrapper(t testing.TB, cmKeeper types.ContractManagerKeeper, wasmKeeper types.WasmKeeper) (types.WasmKeeper, sdk.Context, *storetypes.KVStoreKey) { diff --git a/testutil/interchaintxs/network/network.go b/testutil/interchaintxs/network/network.go index f8fe9393d..a09fda763 100644 --- a/testutil/interchaintxs/network/network.go +++ b/testutil/interchaintxs/network/network.go @@ -23,11 +23,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" - "github.com/neutron-org/neutron/v4/testutil/consumer" + "github.com/neutron-org/neutron/v5/testutil/consumer" - "github.com/neutron-org/neutron/v4/app" + "github.com/neutron-org/neutron/v5/app" ) type ( diff --git a/testutil/mocks/contractmanager/types/expected_keepers.go b/testutil/mocks/contractmanager/types/expected_keepers.go index 92519c096..5d2ef0a4f 100644 --- a/testutil/mocks/contractmanager/types/expected_keepers.go +++ b/testutil/mocks/contractmanager/types/expected_keepers.go @@ -12,7 +12,7 @@ import ( types0 "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" - types1 "github.com/neutron-org/neutron/v4/x/contractmanager/types" + types1 "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) // MockWasmKeeper is a mock of WasmKeeper interface. diff --git a/testutil/mocks/interchainqueries/keeper/verify.go b/testutil/mocks/interchainqueries/keeper/verify.go index e5f90ace2..02f03e7d9 100644 --- a/testutil/mocks/interchainqueries/keeper/verify.go +++ b/testutil/mocks/interchainqueries/keeper/verify.go @@ -14,7 +14,7 @@ import ( tendermint "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" gomock "github.com/golang/mock/gomock" - types1 "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + types1 "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // MockHeaderVerifier is a mock of HeaderVerifier interface. diff --git a/testutil/mocks/interchainqueries/types/verify.go b/testutil/mocks/interchainqueries/types/verify.go index 7289f3c02..591728e1f 100644 --- a/testutil/mocks/interchainqueries/types/verify.go +++ b/testutil/mocks/interchainqueries/types/verify.go @@ -14,7 +14,7 @@ import ( types1 "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" gomock "github.com/golang/mock/gomock" - types2 "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + types2 "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // MockHeaderVerifier is a mock of HeaderVerifier interface. diff --git a/testutil/mocks/interchaintxs/types/expected_keepers.go b/testutil/mocks/interchaintxs/types/expected_keepers.go index 68866d0b4..0c1d7c3b1 100644 --- a/testutil/mocks/interchaintxs/types/expected_keepers.go +++ b/testutil/mocks/interchaintxs/types/expected_keepers.go @@ -15,7 +15,7 @@ import ( exported "github.com/cosmos/ibc-go/v8/modules/core/exported" gomock "github.com/golang/mock/gomock" - types3 "github.com/neutron-org/neutron/v4/x/feerefunder/types" + types3 "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) // MockAccountKeeper is a mock of AccountKeeper interface. diff --git a/testutil/mocks/transfer/types/expected_keepers.go b/testutil/mocks/transfer/types/expected_keepers.go index b1cc375eb..9e952f77b 100644 --- a/testutil/mocks/transfer/types/expected_keepers.go +++ b/testutil/mocks/transfer/types/expected_keepers.go @@ -12,7 +12,7 @@ import ( types0 "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" gomock "github.com/golang/mock/gomock" - types1 "github.com/neutron-org/neutron/v4/x/feerefunder/types" + types1 "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) // MockWasmKeeper is a mock of WasmKeeper interface. diff --git a/testutil/test_helpers.go b/testutil/test_helpers.go index 60e8d6c97..de7cb00ba 100644 --- a/testutil/test_helpers.go +++ b/testutil/test_helpers.go @@ -4,16 +4,24 @@ import ( "bytes" "encoding/json" "fmt" + "math/rand" "os" "path" "testing" "time" tmrand "github.com/cometbft/cometbft/libs/rand" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/utils" + "github.com/neutron-org/neutron/v5/utils" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "cosmossdk.io/log" cometbfttypes "github.com/cometbft/cometbft/abci/types" @@ -32,15 +40,15 @@ import ( icssimapp "github.com/cosmos/interchain-security/v5/testutil/ibc_testing" "github.com/stretchr/testify/suite" - appparams "github.com/neutron-org/neutron/v4/app/params" - tokenfactorytypes "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + appparams "github.com/neutron-org/neutron/v5/app/params" + tokenfactorytypes "github.com/neutron-org/neutron/v5/x/tokenfactory/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck appProvider "github.com/cosmos/interchain-security/v5/app/provider" e2e "github.com/cosmos/interchain-security/v5/testutil/integration" - "github.com/neutron-org/neutron/v4/app" - ictxstypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/app" + ictxstypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v5/x/ccv/types" @@ -67,6 +75,13 @@ var ( })) ) +const ( + One = 1 + Two = 2 + Three = 3 + Four = 4 +) + func init() { // ibctesting.DefaultTestingAppInit = SetupTestingApp() config.GetDefaultConfig() @@ -83,15 +98,19 @@ type IBCConnectionTestSuite struct { ChainProvider *ibctesting.TestChain ChainA *ibctesting.TestChain ChainB *ibctesting.TestChain + ChainC *ibctesting.TestChain ProviderApp e2e.ProviderApp ChainAApp e2e.ConsumerApp ChainBApp e2e.ConsumerApp - - CCVPathA *ibctesting.Path - CCVPathB *ibctesting.Path - Path *ibctesting.Path - TransferPath *ibctesting.Path + ChainCApp e2e.ConsumerApp + + CCVPathA *ibctesting.Path + CCVPathB *ibctesting.Path + CCVPathC *ibctesting.Path + Path *ibctesting.Path + TransferPath *ibctesting.Path + TransferPathAC *ibctesting.Path } func GetTestConsumerAdditionProp(chain *ibctesting.TestChain) *providertypes.ConsumerAdditionProposal { //nolint:staticcheck @@ -110,6 +129,11 @@ func GetTestConsumerAdditionProp(chain *ibctesting.TestChain) *providertypes.Con ccv.DefaultCCVTimeoutPeriod, ccv.DefaultTransferTimeoutPeriod, ccv.DefaultConsumerUnbondingPeriod, + 95, + 100, + 0, + nil, + nil, ).(*providertypes.ConsumerAdditionProposal) //nolint:staticcheck return prop @@ -123,18 +147,22 @@ func (suite *IBCConnectionTestSuite) SetupTest() { suite.ChainProvider = suite.Coordinator.GetChain(ibctesting.GetChainID(1)) suite.ChainA = suite.Coordinator.GetChain(ibctesting.GetChainID(2)) suite.ChainB = suite.Coordinator.GetChain(ibctesting.GetChainID(3)) + suite.ChainC = suite.Coordinator.GetChain(ibctesting.GetChainID(4)) suite.ProviderApp = suite.ChainProvider.App.(*appProvider.App) suite.ChainAApp = suite.ChainA.App.(*app.App) suite.ChainBApp = suite.ChainB.App.(*app.App) + suite.ChainCApp = suite.ChainC.App.(*app.App) providerKeeper := suite.ProviderApp.GetProviderKeeper() consumerKeeperA := suite.ChainAApp.GetConsumerKeeper() consumerKeeperB := suite.ChainBApp.GetConsumerKeeper() + consumerKeeperC := suite.ChainCApp.GetConsumerKeeper() // valsets must match providerValUpdates := cmttypes.TM2PB.ValidatorUpdates(suite.ChainProvider.Vals) consumerAValUpdates := cmttypes.TM2PB.ValidatorUpdates(suite.ChainA.Vals) consumerBValUpdates := cmttypes.TM2PB.ValidatorUpdates(suite.ChainB.Vals) + consumerCValUpdates := cmttypes.TM2PB.ValidatorUpdates(suite.ChainB.Vals) suite.Require().True(len(providerValUpdates) == len(consumerAValUpdates), "initial valset not matching") suite.Require().True(len(providerValUpdates) == len(consumerBValUpdates), "initial valset not matching") @@ -142,8 +170,10 @@ func (suite *IBCConnectionTestSuite) SetupTest() { addr1, _ := ccv.TMCryptoPublicKeyToConsAddr(providerValUpdates[i].PubKey) addr2, _ := ccv.TMCryptoPublicKeyToConsAddr(consumerAValUpdates[i].PubKey) addr3, _ := ccv.TMCryptoPublicKeyToConsAddr(consumerBValUpdates[i].PubKey) + addr4, _ := ccv.TMCryptoPublicKeyToConsAddr(consumerCValUpdates[i].PubKey) suite.Require().True(bytes.Equal(addr1, addr2), "validator mismatch") suite.Require().True(bytes.Equal(addr1, addr3), "validator mismatch") + suite.Require().True(bytes.Equal(addr1, addr4), "validator mismatch") } ct := suite.ChainProvider.GetContext() @@ -151,6 +181,7 @@ func (suite *IBCConnectionTestSuite) SetupTest() { suite.ChainProvider.NextBlock() suite.ChainA.NextBlock() suite.ChainB.NextBlock() + suite.ChainC.NextBlock() // create consumer client on provider chain and set as consumer client for consumer chainID in provider keeper. prop1 := GetTestConsumerAdditionProp(suite.ChainA) @@ -167,6 +198,13 @@ func (suite *IBCConnectionTestSuite) SetupTest() { ) suite.Require().NoError(err) + prop3 := GetTestConsumerAdditionProp(suite.ChainC) + err = providerKeeper.CreateConsumerClient( + ct, + prop3, + ) + suite.Require().NoError(err) + // move provider to next block to commit the state suite.ChainProvider.NextBlock() @@ -198,11 +236,27 @@ func (suite *IBCConnectionTestSuite) SetupTest() { } consumerKeeperB.InitGenesis(suite.ChainB.GetContext(), &genesisStateB) + // initialize the consumer chain with the genesis state stored on the provider + consumerGenesisC, found := providerKeeper.GetConsumerGenesis( + suite.ChainProvider.GetContext(), + suite.ChainC.ChainID, + ) + suite.Require().True(found, "consumer genesis not found") + + genesisStateC := consumertypes.GenesisState{ + Params: consumerGenesisC.Params, + Provider: consumerGenesisC.Provider, + NewChain: consumerGenesisC.NewChain, + } + consumerKeeperC.InitGenesis(suite.ChainC.GetContext(), &genesisStateC) + // create paths for the CCV channel suite.CCVPathA = ibctesting.NewPath(suite.ChainA, suite.ChainProvider) suite.CCVPathB = ibctesting.NewPath(suite.ChainB, suite.ChainProvider) + suite.CCVPathC = ibctesting.NewPath(suite.ChainC, suite.ChainProvider) SetupCCVPath(suite.CCVPathA, suite) SetupCCVPath(suite.CCVPathB, suite) + SetupCCVPath(suite.CCVPathC, suite) suite.SetupCCVChannels() @@ -218,6 +272,13 @@ func (suite *IBCConnectionTestSuite) ConfigureTransferChannel() { suite.Require().NoError(err) } +func (suite *IBCConnectionTestSuite) ConfigureTransferChannelAC() { + suite.TransferPathAC = NewTransferPath(suite.ChainA, suite.ChainC, suite.ChainProvider) + suite.Coordinator.SetupConnections(suite.TransferPathAC) + err := SetupTransferPath(suite.TransferPathAC) + suite.Require().NoError(err) +} + func (suite *IBCConnectionTestSuite) FundAcc(acc sdk.AccAddress, amounts sdk.Coins) { bankKeeper := suite.GetNeutronZoneApp(suite.ChainA).BankKeeper err := bankKeeper.MintCoins(suite.ChainA.GetContext(), tokenfactorytypes.ModuleName, amounts) @@ -293,7 +354,7 @@ func testHomeDir(chainID string) string { // NewCoordinator initializes Coordinator with interchain security dummy provider and 2 neutron consumer chains func NewProviderConsumerCoordinator(t *testing.T) *ibctesting.Coordinator { coordinator := ibctesting.NewCoordinator(t, 0) - chainID := ibctesting.GetChainID(1) + chainID := ibctesting.GetChainID(One) ibctesting.DefaultTestingAppInit = icssimapp.ProviderAppIniter coordinator.Chains[chainID] = ibctesting.NewTestChain(t, coordinator, chainID) @@ -301,12 +362,16 @@ func NewProviderConsumerCoordinator(t *testing.T) *ibctesting.Coordinator { _ = config.GetDefaultConfig() sdk.SetAddrCacheEnabled(false) - chainID = ibctesting.GetChainID(2) + chainID = ibctesting.GetChainID(Two) ibctesting.DefaultTestingAppInit = SetupTestingApp(cmttypes.TM2PB.ValidatorUpdates(providerChain.Vals)) coordinator.Chains[chainID] = ibctesting.NewTestChainWithValSet(t, coordinator, chainID, providerChain.Vals, providerChain.Signers) - chainID = ibctesting.GetChainID(3) + chainID = ibctesting.GetChainID(Three) + coordinator.Chains[chainID] = ibctesting.NewTestChainWithValSet(t, coordinator, + chainID, providerChain.Vals, providerChain.Signers) + + chainID = ibctesting.GetChainID(Four) coordinator.Chains[chainID] = ibctesting.NewTestChainWithValSet(t, coordinator, chainID, providerChain.Vals, providerChain.Signers) @@ -399,8 +464,13 @@ func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) erro return fmt.Errorf("not NeutronZoneApp") } - // TODO(pr0n00gler): are we sure it's okay? - if err := a.ICAControllerKeeper.RegisterInterchainAccount(ctx, endpoint.ConnectionID, icaOwner.String(), ""); err != nil { + icaMsgServer := icacontrollerkeeper.NewMsgServerImpl(&a.ICAControllerKeeper) + if _, err = icaMsgServer.RegisterInterchainAccount(ctx, &icacontrollertypes.MsgRegisterInterchainAccount{ + Owner: icaOwner.String(), + ConnectionId: endpoint.ConnectionID, + Version: TestVersion, + Ordering: channeltypes.ORDERED, + }); err != nil { return err } @@ -508,3 +578,114 @@ func SetupTransferPath(path *ibctesting.Path) error { return path.EndpointB.ChanOpenConfirm() } + +// SendMsgsNoCheck is an alternative to ibctesting.TestChain.SendMsgs so that it doesn't check for errors. That should be handled by the caller +func (suite *IBCConnectionTestSuite) SendMsgsNoCheck(chain *ibctesting.TestChain, msgs ...sdk.Msg) (*cometbfttypes.ExecTxResult, error) { + // ensure the suite has the latest time + suite.Coordinator.UpdateTimeForChain(chain) + + // increment acc sequence regardless of success or failure tx execution + defer func() { + err := chain.SenderAccount.SetSequence(chain.SenderAccount.GetSequence() + 1) + if err != nil { + panic(err) + } + }() + + resp, err := SignAndDeliver(chain.TB, chain.TxConfig, chain.App.GetBaseApp(), msgs, chain.ChainID, []uint64{chain.SenderAccount.GetAccountNumber()}, []uint64{chain.SenderAccount.GetSequence()}, chain.CurrentHeader.GetTime(), chain.NextVals.Hash(), chain.SenderPrivKey) + if err != nil { + return nil, err + } + + suite.commitBlock(resp, chain) + + suite.Coordinator.IncrementTime() + + require.Len(chain.TB, resp.TxResults, 1) + txResult := resp.TxResults[0] + + if txResult.Code != 0 { + return txResult, fmt.Errorf("%s/%d: %q", txResult.Codespace, txResult.Code, txResult.Log) + } + + suite.Coordinator.IncrementTime() + + return txResult, nil +} + +// SignAndDeliver signs and delivers a transaction without asserting the results. This overrides the function +// from ibctesting +func SignAndDeliver( + tb testing.TB, + txCfg client.TxConfig, + app *baseapp.BaseApp, + msgs []sdk.Msg, + chainID string, + accNums, accSeqs []uint64, + blockTime time.Time, + nextValHash []byte, + priv ...cryptotypes.PrivKey, +) (res *cometbfttypes.ResponseFinalizeBlock, err error) { + tb.Helper() + tx, err := sims.GenSignedMockTx( + // #nosec G404 - math/rand is acceptable for non-cryptographic purposes + rand.New(rand.NewSource(time.Now().UnixNano())), + txCfg, + msgs, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)}, + sims.DefaultGenTxGas, + chainID, + accNums, + accSeqs, + priv..., + ) + if err != nil { + return nil, err + } + + txBytes, err := txCfg.TxEncoder()(tx) + if err != nil { + return nil, err + } + + return app.FinalizeBlock(&cometbfttypes.RequestFinalizeBlock{ + Height: app.LastBlockHeight() + 1, + Time: blockTime, + NextValidatorsHash: nextValHash, + Txs: [][]byte{txBytes}, + }) +} + +func (suite *IBCConnectionTestSuite) ExecuteContract(contract, sender sdk.AccAddress, msg []byte, funds sdk.Coins) ([]byte, error) { + app := suite.GetNeutronZoneApp(suite.ChainA) + contractKeeper := keeper.NewDefaultPermissionKeeper(app.WasmKeeper) + return contractKeeper.Execute(suite.ChainA.GetContext(), contract, sender, msg, funds) +} + +func (suite *IBCConnectionTestSuite) commitBlock(res *cometbfttypes.ResponseFinalizeBlock, chain *ibctesting.TestChain) { + _, err := chain.App.Commit() + require.NoError(chain.TB, err) + + // set the last header to the current header + // use nil trusted fields + chain.LastHeader = chain.CurrentTMClientHeader() + + // val set changes returned from previous block get applied to the next validators + // of this block. See tendermint spec for details. + chain.Vals = chain.NextVals + + chain.NextVals = ibctesting.ApplyValSetChanges(chain, chain.Vals, res.ValidatorUpdates) + + // increment the current header + chain.CurrentHeader = cmtproto.Header{ + ChainID: chain.ChainID, + Height: chain.App.LastBlockHeight() + 1, + AppHash: chain.App.LastCommitID().Hash, + // NOTE: the time is increased by the coordinator to maintain time synchrony amongst + // chains. + Time: chain.CurrentHeader.Time, + ValidatorsHash: chain.Vals.Hash(), + NextValidatorsHash: chain.NextVals.Hash(), + ProposerAddress: chain.CurrentHeader.ProposerAddress, + } +} diff --git a/testutil/tokenfactory/keeper/tokenfactory.go b/testutil/tokenfactory/keeper/tokenfactory.go index d122324c1..f65b1ab31 100644 --- a/testutil/tokenfactory/keeper/tokenfactory.go +++ b/testutil/tokenfactory/keeper/tokenfactory.go @@ -14,9 +14,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func TokenFactoryKeeper( diff --git a/testutil/transfer/keeper/keeper.go b/testutil/transfer/keeper/keeper.go index 1c241a0c3..327316343 100644 --- a/testutil/transfer/keeper/keeper.go +++ b/testutil/transfer/keeper/keeper.go @@ -19,8 +19,8 @@ import ( transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" - keeper "github.com/neutron-org/neutron/v4/x/transfer/keeper" - "github.com/neutron-org/neutron/v4/x/transfer/types" + keeper "github.com/neutron-org/neutron/v5/x/transfer/keeper" + "github.com/neutron-org/neutron/v5/x/transfer/types" ) func TransferKeeper( diff --git a/third_party/proto/ibc/applications/fee/v1/ack.proto b/third_party/proto/ibc/applications/fee/v1/ack.proto deleted file mode 100644 index cc12f3b58..000000000 --- a/third_party/proto/ibc/applications/fee/v1/ack.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; - -// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware -message IncentivizedAcknowledgement { - // the underlying app acknowledgement bytes - bytes app_acknowledgement = 1 [(gogoproto.moretags) = "yaml:\"app_acknowledgement\""]; - // the relayer address which submits the recv packet message - string forward_relayer_address = 2 [(gogoproto.moretags) = "yaml:\"forward_relayer_address\""]; - // success flag of the base application callback - bool underlying_app_success = 3 [(gogoproto.moretags) = "yaml:\"underlying_app_successl\""]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/fee.proto b/third_party/proto/ibc/applications/fee/v1/fee.proto deleted file mode 100644 index 4ef626d41..000000000 --- a/third_party/proto/ibc/applications/fee/v1/fee.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// Fee defines the ICS29 receive, acknowledgement and timeout fees -message Fee { - // the packet receive fee - repeated cosmos.base.v1beta1.Coin recv_fee = 1 [ - (gogoproto.moretags) = "yaml:\"recv_fee\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // the packet acknowledgement fee - repeated cosmos.base.v1beta1.Coin ack_fee = 2 [ - (gogoproto.moretags) = "yaml:\"ack_fee\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // the packet timeout fee - repeated cosmos.base.v1beta1.Coin timeout_fee = 3 [ - (gogoproto.moretags) = "yaml:\"timeout_fee\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers -message PacketFee { - // fee encapsulates the recv, ack and timeout fees associated with an IBC packet - Fee fee = 1 [(gogoproto.nullable) = false]; - // the refund address for unspent fees - string refund_address = 2 [(gogoproto.moretags) = "yaml:\"refund_address\""]; - // optional list of relayers permitted to receive fees - repeated string relayers = 3; -} - -// PacketFees contains a list of type PacketFee -message PacketFees { - // list of packet fees - repeated PacketFee packet_fees = 1 [(gogoproto.moretags) = "yaml:\"packet_fees\"", (gogoproto.nullable) = false]; -} - -// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId -message IdentifiedPacketFees { - // unique packet identifier comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; - // list of packet fees - repeated PacketFee packet_fees = 2 [(gogoproto.moretags) = "yaml:\"packet_fees\"", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/genesis.proto b/third_party/proto/ibc/applications/fee/v1/genesis.proto deleted file mode 100644 index 245525ca1..000000000 --- a/third_party/proto/ibc/applications/fee/v1/genesis.proto +++ /dev/null @@ -1,66 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/fee/v1/fee.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// GenesisState defines the ICS29 fee middleware genesis state -message GenesisState { - // list of identified packet fees - repeated IdentifiedPacketFees identified_fees = 1 - [(gogoproto.moretags) = "yaml:\"identified_fees\"", (gogoproto.nullable) = false]; - // list of fee enabled channels - repeated FeeEnabledChannel fee_enabled_channels = 2 - [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; - // list of registered payees - repeated RegisteredPayee registered_payees = 3 - [(gogoproto.moretags) = "yaml:\"registered_payees\"", (gogoproto.nullable) = false]; - // list of registered counterparty payees - repeated RegisteredCounterpartyPayee registered_counterparty_payees = 4 - [(gogoproto.moretags) = "yaml:\"registered_counterparty_payees\"", (gogoproto.nullable) = false]; - // list of forward relayer addresses - repeated ForwardRelayerAddress forward_relayers = 5 - [(gogoproto.moretags) = "yaml:\"forward_relayers\"", (gogoproto.nullable) = false]; -} - -// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel -message FeeEnabledChannel { - // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; -} - -// RegisteredPayee contains the relayer address and payee address for a specific channel -message RegisteredPayee { - // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address - string relayer = 2; - // the payee address - string payee = 3; -} - -// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used -// for recv fee distribution) -message RegisteredCounterpartyPayee { - // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address - string relayer = 2; - // the counterparty payee address - string counterparty_payee = 3 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; -} - -// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements -message ForwardRelayerAddress { - // the forward relayer address - string address = 1; - // unique packet identifer comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/metadata.proto b/third_party/proto/ibc/applications/fee/v1/metadata.proto deleted file mode 100644 index 8d9879f35..000000000 --- a/third_party/proto/ibc/applications/fee/v1/metadata.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; - -// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring -// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning -message Metadata { - // fee_version defines the ICS29 fee version - string fee_version = 1 [(gogoproto.moretags) = "yaml:\"fee_version\""]; - // app_version defines the underlying application version, which may or may not be a JSON encoded bytestring - string app_version = 2 [(gogoproto.moretags) = "yaml:\"app_version\""]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/query.proto b/third_party/proto/ibc/applications/fee/v1/query.proto deleted file mode 100644 index 7d54bcd01..000000000 --- a/third_party/proto/ibc/applications/fee/v1/query.proto +++ /dev/null @@ -1,222 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/applications/fee/v1/fee.proto"; -import "ibc/applications/fee/v1/genesis.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// Query defines the ICS29 gRPC querier service. -service Query { - // IncentivizedPackets returns all incentivized packets and their associated fees - rpc IncentivizedPackets(QueryIncentivizedPacketsRequest) returns (QueryIncentivizedPacketsResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/incentivized_packets"; - } - - // IncentivizedPacket returns all packet fees for a packet given its identifier - rpc IncentivizedPacket(QueryIncentivizedPacketRequest) returns (QueryIncentivizedPacketResponse) { - option (google.api.http).get = - "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/" - "{packet_id.sequence}/incentivized_packet"; - } - - // Gets all incentivized packets for a specific channel - rpc IncentivizedPacketsForChannel(QueryIncentivizedPacketsForChannelRequest) - returns (QueryIncentivizedPacketsForChannelResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/incentivized_packets"; - } - - // TotalRecvFees returns the total receive fees for a packet given its identifier - rpc TotalRecvFees(QueryTotalRecvFeesRequest) returns (QueryTotalRecvFeesResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" - "sequences/{packet_id.sequence}/total_recv_fees"; - } - - // TotalAckFees returns the total acknowledgement fees for a packet given its identifier - rpc TotalAckFees(QueryTotalAckFeesRequest) returns (QueryTotalAckFeesResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" - "sequences/{packet_id.sequence}/total_ack_fees"; - } - - // TotalTimeoutFees returns the total timeout fees for a packet given its identifier - rpc TotalTimeoutFees(QueryTotalTimeoutFeesRequest) returns (QueryTotalTimeoutFeesResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/" - "sequences/{packet_id.sequence}/total_timeout_fees"; - } - - // Payee returns the registered payee address for a specific channel given the relayer address - rpc Payee(QueryPayeeRequest) returns (QueryPayeeResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/payee"; - } - - // CounterpartyPayee returns the registered counterparty payee for forward relaying - rpc CounterpartyPayee(QueryCounterpartyPayeeRequest) returns (QueryCounterpartyPayeeResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/counterparty_payee"; - } - - // FeeEnabledChannels returns a list of all fee enabled channels - rpc FeeEnabledChannels(QueryFeeEnabledChannelsRequest) returns (QueryFeeEnabledChannelsResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/fee_enabled"; - } - - // FeeEnabledChannel returns true if the provided port and channel identifiers belong to a fee enabled channel - rpc FeeEnabledChannel(QueryFeeEnabledChannelRequest) returns (QueryFeeEnabledChannelResponse) { - option (google.api.http).get = "/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/fee_enabled"; - } -} - -// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc -message QueryIncentivizedPacketsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; - // block height at which to query - uint64 query_height = 2; -} - -// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc -message QueryIncentivizedPacketsResponse { - // list of identified fees for incentivized packets - repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1 [(gogoproto.nullable) = false]; -} - -// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc -message QueryIncentivizedPacketRequest { - // unique packet identifier comprised of channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; - // block height at which to query - uint64 query_height = 2; -} - -// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc -message QueryIncentivizedPacketResponse { - // the identified fees for the incentivized packet - ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packet = 1 [(gogoproto.nullable) = false]; -} - -// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets -// for a specific channel -message QueryIncentivizedPacketsForChannelRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; - string port_id = 2; - string channel_id = 3; - // Height to query at - uint64 query_height = 4; -} - -// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC -message QueryIncentivizedPacketsForChannelResponse { - // Map of all incentivized_packets - repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1; -} - -// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc -message QueryTotalRecvFeesRequest { - // the packet identifier for the associated fees - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; -} - -// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc -message QueryTotalRecvFeesResponse { - // the total packet receive fees - repeated cosmos.base.v1beta1.Coin recv_fees = 1 [ - (gogoproto.moretags) = "yaml:\"recv_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc -message QueryTotalAckFeesRequest { - // the packet identifier for the associated fees - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; -} - -// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc -message QueryTotalAckFeesResponse { - // the total packet acknowledgement fees - repeated cosmos.base.v1beta1.Coin ack_fees = 1 [ - (gogoproto.moretags) = "yaml:\"ack_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc -message QueryTotalTimeoutFeesRequest { - // the packet identifier for the associated fees - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; -} - -// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc -message QueryTotalTimeoutFeesResponse { - // the total packet timeout fees - repeated cosmos.base.v1beta1.Coin timeout_fees = 1 [ - (gogoproto.moretags) = "yaml:\"timeout_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// QueryPayeeRequest defines the request type for the Payee rpc -message QueryPayeeRequest { - // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address to which the distribution address is registered - string relayer = 2; -} - -// QueryPayeeResponse defines the response type for the Payee rpc -message QueryPayeeResponse { - // the payee address to which packet fees are paid out - string payee_address = 1 [(gogoproto.moretags) = "yaml:\"payee_address\""]; -} - -// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc -message QueryCounterpartyPayeeRequest { - // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address to which the counterparty is registered - string relayer = 2; -} - -// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc -message QueryCounterpartyPayeeResponse { - // the counterparty payee address used to compensate forward relaying - string counterparty_payee = 1 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; -} - -// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc -message QueryFeeEnabledChannelsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; - // block height at which to query - uint64 query_height = 2; -} - -// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc -message QueryFeeEnabledChannelsResponse { - // list of fee enabled channels - repeated ibc.applications.fee.v1.FeeEnabledChannel fee_enabled_channels = 1 - [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; -} - -// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc -message QueryFeeEnabledChannelRequest { - // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; -} - -// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc -message QueryFeeEnabledChannelResponse { - // boolean flag representing the fee enabled channel status - bool fee_enabled = 1 [(gogoproto.moretags) = "yaml:\"fee_enabled\""]; -} diff --git a/third_party/proto/ibc/applications/fee/v1/tx.proto b/third_party/proto/ibc/applications/fee/v1/tx.proto deleted file mode 100644 index 63e591617..000000000 --- a/third_party/proto/ibc/applications/fee/v1/tx.proto +++ /dev/null @@ -1,112 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.fee.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/fee/v1/fee.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// Msg defines the ICS29 Msg service. -service Msg { - // RegisterPayee defines a rpc handler method for MsgRegisterPayee - // RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional - // payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on - // the source chain from which packets originate as this is where fee distribution takes place. This function may be - // called more than once by a relayer, in which case, the latest payee is always used. - rpc RegisterPayee(MsgRegisterPayee) returns (MsgRegisterPayeeResponse); - - // RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee - // RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty - // payee address before relaying. This ensures they will be properly compensated for forward relaying since - // the destination chain must include the registered counterparty payee address in the acknowledgement. This function - // may be called more than once by a relayer, in which case, the latest counterparty payee address is always used. - rpc RegisterCounterpartyPayee(MsgRegisterCounterpartyPayee) returns (MsgRegisterCounterpartyPayeeResponse); - - // PayPacketFee defines a rpc handler method for MsgPayPacketFee - // PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to - // incentivize the relaying of the packet at the next sequence - // NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows - // initiates the lifecycle of the incentivized packet - rpc PayPacketFee(MsgPayPacketFee) returns (MsgPayPacketFeeResponse); - - // PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync - // PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to - // incentivize the relaying of a known packet (i.e. at a particular sequence) - rpc PayPacketFeeAsync(MsgPayPacketFeeAsync) returns (MsgPayPacketFeeAsyncResponse); -} - -// MsgRegisterPayee defines the request type for the RegisterPayee rpc -message MsgRegisterPayee { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address - string relayer = 3; - // the payee address - string payee = 4; -} - -// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc -message MsgRegisterPayeeResponse {} - -// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc -message MsgRegisterCounterpartyPayee { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // the relayer address - string relayer = 3; - // the counterparty payee address - string counterparty_payee = 4 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; -} - -// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc -message MsgRegisterCounterpartyPayeeResponse {} - -// MsgPayPacketFee defines the request type for the PayPacketFee rpc -// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be -// paid for -message MsgPayPacketFee { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // fee encapsulates the recv, ack and timeout fees associated with an IBC packet - ibc.applications.fee.v1.Fee fee = 1 [(gogoproto.nullable) = false]; - // the source port unique identifier - string source_port_id = 2 [(gogoproto.moretags) = "yaml:\"source_port_id\""]; - // the source channel unique identifer - string source_channel_id = 3 [(gogoproto.moretags) = "yaml:\"source_channel_id\""]; - // account address to refund fee if necessary - string signer = 4; - // optional list of relayers permitted to the receive packet fees - repeated string relayers = 5; -} - -// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc -message MsgPayPacketFeeResponse {} - -// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc -// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) -message MsgPayPacketFeeAsync { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // unique packet identifier comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 1 - [(gogoproto.moretags) = "yaml:\"packet_id\"", (gogoproto.nullable) = false]; - // the packet fee associated with a particular IBC packet - PacketFee packet_fee = 2 [(gogoproto.moretags) = "yaml:\"packet_fee\"", (gogoproto.nullable) = false]; -} - -// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc -message MsgPayPacketFeeAsyncResponse {} diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto deleted file mode 100644 index 0974b9d9b..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.controller.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; - -import "gogoproto/gogo.proto"; - -// Params defines the set of on-chain interchain accounts parameters. -// The following parameters may be used to disable the controller submodule. -message Params { - // controller_enabled enables or disables the controller submodule. - bool controller_enabled = 1 [(gogoproto.moretags) = "yaml:\"controller_enabled\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto deleted file mode 100644 index 3779ed387..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.controller.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; - -import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; - -// Query provides defines the gRPC querier service. -service Query { - // InterchainAccount returns the interchain account address for a given owner address on a given connection - rpc InterchainAccount(QueryInterchainAccountRequest) returns (QueryInterchainAccountResponse) { - option (google.api.http).get = - "/ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}"; - } - - // Params queries all parameters of the ICA controller submodule. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ibc/apps/interchain_accounts/controller/v1/params"; - } -} - -// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. -message QueryInterchainAccountRequest { - string owner = 1; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; -} - -// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. -message QueryInterchainAccountResponse { - string address = 1; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto deleted file mode 100644 index 11fb3cfdc..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.controller.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/interchain_accounts/v1/packet.proto"; - -// Msg defines the 27-interchain-accounts/controller Msg service. -service Msg { - // RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. - rpc RegisterInterchainAccount(MsgRegisterInterchainAccount) returns (MsgRegisterInterchainAccountResponse); - // SendTx defines a rpc handler for MsgSendTx. - rpc SendTx(MsgSendTx) returns (MsgSendTxResponse); -} - -// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount -message MsgRegisterInterchainAccount { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string owner = 1; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string version = 3; -} - -// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount -message MsgRegisterInterchainAccountResponse { - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; -} - -// MsgSendTx defines the payload for Msg/SendTx -message MsgSendTx { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string owner = 1; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - ibc.applications.interchain_accounts.v1.InterchainAccountPacketData packet_data = 3 - [(gogoproto.moretags) = "yaml:\"packet_data\"", (gogoproto.nullable) = false]; - // Relative timeout timestamp provided will be added to the current block time during transaction execution. - // The timeout timestamp must be non-zero. - uint64 relative_timeout = 4 [(gogoproto.moretags) = "yaml:\"relative_timeout\""]; -} - -// MsgSendTxResponse defines the response for MsgSendTx -message MsgSendTxResponse { - uint64 sequence = 1; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto b/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto deleted file mode 100644 index f0fd73ede..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.genesis.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/genesis/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; -import "ibc/applications/interchain_accounts/host/v1/host.proto"; - -// GenesisState defines the interchain accounts genesis state -message GenesisState { - ControllerGenesisState controller_genesis_state = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"controller_genesis_state\""]; - HostGenesisState host_genesis_state = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"host_genesis_state\""]; -} - -// ControllerGenesisState defines the interchain accounts controller genesis state -message ControllerGenesisState { - repeated ActiveChannel active_channels = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"active_channels\""]; - repeated RegisteredInterchainAccount interchain_accounts = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interchain_accounts\""]; - repeated string ports = 3; - ibc.applications.interchain_accounts.controller.v1.Params params = 4 [(gogoproto.nullable) = false]; -} - -// HostGenesisState defines the interchain accounts host genesis state -message HostGenesisState { - repeated ActiveChannel active_channels = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"active_channels\""]; - repeated RegisteredInterchainAccount interchain_accounts = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interchain_accounts\""]; - string port = 3; - ibc.applications.interchain_accounts.host.v1.Params params = 4 [(gogoproto.nullable) = false]; -} - -// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to -// indicate if the channel is middleware enabled -message ActiveChannel { - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bool is_middleware_enabled = 4 [(gogoproto.moretags) = "yaml:\"is_middleware_enabled\""]; -} - -// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address -message RegisteredInterchainAccount { - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string account_address = 3 [(gogoproto.moretags) = "yaml:\"account_address\""]; -} \ No newline at end of file diff --git a/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto deleted file mode 100644 index 2247e2fe0..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.host.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; - -import "gogoproto/gogo.proto"; - -// Params defines the set of on-chain interchain accounts parameters. -// The following parameters may be used to disable the host submodule. -message Params { - // host_enabled enables or disables the host submodule. - bool host_enabled = 1 [(gogoproto.moretags) = "yaml:\"host_enabled\""]; - // allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. - repeated string allow_messages = 2 [(gogoproto.moretags) = "yaml:\"allow_messages\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto deleted file mode 100644 index 6f206a14c..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.host.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; - -import "google/api/annotations.proto"; -import "ibc/applications/interchain_accounts/host/v1/host.proto"; - -// Query provides defines the gRPC querier service. -service Query { - // Params queries all parameters of the ICA host submodule. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ibc/apps/interchain_accounts/host/v1/params"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto deleted file mode 100644 index 85d4e5828..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain -message InterchainAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "ibc.applications.interchain_accounts.v1.InterchainAccountI"; - - cosmos.auth.v1beta1.BaseAccount base_account = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; - string account_owner = 2 [(gogoproto.moretags) = "yaml:\"account_owner\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto deleted file mode 100644 index 5984ba4d6..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; - -import "gogoproto/gogo.proto"; - -// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring -// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning -message Metadata { - // version defines the ICS27 protocol version - string version = 1; - // controller_connection_id is the connection identifier associated with the controller chain - string controller_connection_id = 2 [(gogoproto.moretags) = "yaml:\"controller_connection_id\""]; - // host_connection_id is the connection identifier associated with the host chain - string host_connection_id = 3 [(gogoproto.moretags) = "yaml:\"host_connection_id\""]; - // address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step - // NOTE: the address field is empty on the OnChanOpenInit handshake step - string address = 4; - // encoding defines the supported codec format - string encoding = 5; - // tx_type defines the type of transactions the interchain account can execute - string tx_type = 6; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto deleted file mode 100644 index f75a1463e..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; - -// Type defines a classification of message issued from a controller chain to its associated interchain accounts -// host -enum Type { - option (gogoproto.goproto_enum_prefix) = false; - - // Default zero value enumeration - TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // Execute a transaction on an interchain accounts host chain - TYPE_EXECUTE_TX = 1 [(gogoproto.enumvalue_customname) = "EXECUTE_TX"]; -} - -// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. -message InterchainAccountPacketData { - Type type = 1; - bytes data = 2; - string memo = 3; -} - -// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. -message CosmosTx { - repeated google.protobuf.Any messages = 1; -} diff --git a/third_party/proto/ibc/applications/transfer/v1/authz.proto b/third_party/proto/ibc/applications/transfer/v1/authz.proto index df1ee24ed..e7561b070 100644 --- a/third_party/proto/ibc/applications/transfer/v1/authz.proto +++ b/third_party/proto/ibc/applications/transfer/v1/authz.proto @@ -11,14 +11,17 @@ import "cosmos/base/v1beta1/coin.proto"; // Allocation defines the spend limit for a particular port and channel message Allocation { // the port on which the packet will be sent - string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; + string source_port = 1; // the channel by which the packet will be sent - string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + string source_channel = 2; // spend limitation on the channel repeated cosmos.base.v1beta1.Coin spend_limit = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; // allow list of receivers, an empty allow list permits any receiver address repeated string allow_list = 4; + // allow list of packet data keys, an empty list prohibits all packet data keys; + // a list only with "*" permits any packet data key + repeated string allowed_packet_data = 5; } // TransferAuthorization allows the grantee to spend up to spend_limit coins from diff --git a/third_party/proto/ibc/applications/transfer/v1/genesis.proto b/third_party/proto/ibc/applications/transfer/v1/genesis.proto index 578c2242e..f7d707f6c 100644 --- a/third_party/proto/ibc/applications/transfer/v1/genesis.proto +++ b/third_party/proto/ibc/applications/transfer/v1/genesis.proto @@ -10,18 +10,11 @@ import "gogoproto/gogo.proto"; // GenesisState defines the ibc-transfer genesis state message GenesisState { - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - repeated DenomTrace denom_traces = 2 [ - (gogoproto.castrepeated) = "Traces", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"denom_traces\"" - ]; - Params params = 3 [(gogoproto.nullable) = false]; + string port_id = 1; + repeated DenomTrace denom_traces = 2 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false]; + Params params = 3 [(gogoproto.nullable) = false]; // total_escrowed contains the total amount of tokens escrowed // by the transfer module - repeated cosmos.base.v1beta1.Coin total_escrowed = 4 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"total_escrowed\"" - ]; + repeated cosmos.base.v1beta1.Coin total_escrowed = 4 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; } diff --git a/third_party/proto/ibc/applications/transfer/v1/transfer.proto b/third_party/proto/ibc/applications/transfer/v1/transfer.proto index 0c13a48ce..7f7723762 100644 --- a/third_party/proto/ibc/applications/transfer/v1/transfer.proto +++ b/third_party/proto/ibc/applications/transfer/v1/transfer.proto @@ -4,8 +4,6 @@ package ibc.applications.transfer.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; -import "gogoproto/gogo.proto"; - // DenomTrace contains the base denomination for ICS20 fungible tokens and the // source tracing information path. message DenomTrace { @@ -23,8 +21,8 @@ message DenomTrace { message Params { // send_enabled enables or disables all cross-chain token transfers from this // chain. - bool send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled\""]; + bool send_enabled = 1; // receive_enabled enables or disables all cross-chain token transfers to this // chain. - bool receive_enabled = 2 [(gogoproto.moretags) = "yaml:\"receive_enabled\""]; + bool receive_enabled = 2; } diff --git a/third_party/proto/ibc/applications/transfer/v1/tx.proto b/third_party/proto/ibc/applications/transfer/v1/tx.proto index 02466eab7..42c70d3be 100644 --- a/third_party/proto/ibc/applications/transfer/v1/tx.proto +++ b/third_party/proto/ibc/applications/transfer/v1/tx.proto @@ -4,46 +4,76 @@ package ibc.applications.transfer.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "cosmos/base/v1beta1/coin.proto"; import "ibc/core/client/v1/client.proto"; +import "ibc/applications/transfer/v1/transfer.proto"; // Msg defines the ibc/transfer Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Transfer defines a rpc handler method for MsgTransfer. rpc Transfer(MsgTransfer) returns (MsgTransferResponse); + + // UpdateParams defines a rpc handler for MsgUpdateParams. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between // ICS20 enabled chains. See ICS Spec here: // https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures message MsgTransfer { - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/MsgTransfer"; + option (cosmos.msg.v1.signer) = "sender"; + option (gogoproto.goproto_getters) = false; // the port on which the packet will be sent - string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; + string source_port = 1; // the channel by which the packet will be sent - string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + string source_channel = 2; // the tokens to be transferred - cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // the sender address string sender = 4; // the recipient address on the destination chain string receiver = 5; // Timeout height relative to the current block height. // The timeout is disabled when set to 0. - ibc.core.client.v1.Height timeout_height = 6 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + ibc.core.client.v1.Height timeout_height = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // Timeout timestamp in absolute nanoseconds since unix epoch. // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + uint64 timeout_timestamp = 7; // optional memo string memo = 8; } // MsgTransferResponse defines the Msg/Transfer response type. message MsgTransferResponse { + option (gogoproto.goproto_getters) = false; + // sequence number of the transfer packet sent uint64 sequence = 1; } + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the transfer 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. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/third_party/proto/ibc/core/channel/v1/channel.proto b/third_party/proto/ibc/core/channel/v1/channel.proto index eb073fd18..05a18fefb 100644 --- a/third_party/proto/ibc/core/channel/v1/channel.proto +++ b/third_party/proto/ibc/core/channel/v1/channel.proto @@ -21,9 +21,12 @@ message Channel { Counterparty counterparty = 3 [(gogoproto.nullable) = false]; // list of connection identifiers, in order, along which packets sent on // this channel will travel - repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; + repeated string connection_hops = 4; // opaque channel version, which is agreed upon during the handshake string version = 5; + // upgrade sequence indicates the latest upgrade attempt performed by this channel + // the value of 0 indicates the channel has never been upgraded + uint64 upgrade_sequence = 6; } // IdentifiedChannel defines a channel with additional port and channel @@ -39,17 +42,20 @@ message IdentifiedChannel { Counterparty counterparty = 3 [(gogoproto.nullable) = false]; // list of connection identifiers, in order, along which packets sent on // this channel will travel - repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; + repeated string connection_hops = 4; // opaque channel version, which is agreed upon during the handshake string version = 5; // port identifier string port_id = 6; // channel identifier string channel_id = 7; + // upgrade sequence indicates the latest upgrade attempt performed by this channel + // the value of 0 indicates the channel has never been upgraded + uint64 upgrade_sequence = 8; } // State defines if a channel is in one of the following states: -// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. +// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. enum State { option (gogoproto.goproto_enum_prefix) = false; @@ -65,6 +71,10 @@ enum State { // A channel has been closed and can no longer be used to send or receive // packets. STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; + // A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. + STATE_FLUSHING = 5 [(gogoproto.enumvalue_customname) = "FLUSHING"]; + // A channel has just completed flushing any in-flight packets. + STATE_FLUSHCOMPLETE = 6 [(gogoproto.enumvalue_customname) = "FLUSHCOMPLETE"]; } // Order defines if a channel is ORDERED or UNORDERED @@ -85,9 +95,9 @@ message Counterparty { option (gogoproto.goproto_getters) = false; // port on the counterparty chain which owns the other end of the channel. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel end on the counterparty chain - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; } // Packet defines a type that carries data across different chains through IBC @@ -99,20 +109,19 @@ message Packet { // with a later sequence number. uint64 sequence = 1; // identifies the port on the sending chain. - string source_port = 2 [(gogoproto.moretags) = "yaml:\"source_port\""]; + string source_port = 2; // identifies the channel end on the sending chain. - string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + string source_channel = 3; // identifies the port on the receiving chain. - string destination_port = 4 [(gogoproto.moretags) = "yaml:\"destination_port\""]; + string destination_port = 4; // identifies the channel end on the receiving chain. - string destination_channel = 5 [(gogoproto.moretags) = "yaml:\"destination_channel\""]; + string destination_channel = 5; // actual opaque bytes transferred directly to the application module bytes data = 6; // block height after which the packet times out - ibc.core.client.v1.Height timeout_height = 7 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + ibc.core.client.v1.Height timeout_height = 7 [(gogoproto.nullable) = false]; // block timestamp (in nanoseconds) after which the packet times out - uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + uint64 timeout_timestamp = 8; } // PacketState defines the generic type necessary to retrieve and store @@ -123,9 +132,9 @@ message PacketState { option (gogoproto.goproto_getters) = false; // channel port identifier. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel unique identifier. - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; // packet sequence. uint64 sequence = 3; // embedded data that represents packet state. @@ -139,9 +148,9 @@ message PacketId { option (gogoproto.goproto_getters) = false; // channel port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel unique identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; // packet sequence uint64 sequence = 3; } @@ -160,3 +169,19 @@ message Acknowledgement { string error = 22; } } + +// Timeout defines an execution deadline structure for 04-channel handlers. +// This includes packet lifecycle handlers as well as the upgrade handshake handlers. +// A valid Timeout contains either one or both of a timestamp and block height (sequence). +message Timeout { + // block height after which the packet or upgrade times out + ibc.core.client.v1.Height height = 1 [(gogoproto.nullable) = false]; + // block timestamp (in nanoseconds) after which the packet or upgrade times out + uint64 timestamp = 2; +} + +// Params defines the set of IBC channel parameters. +message Params { + // the relative timeout after which channel upgrades will time out. + Timeout upgrade_timeout = 1 [(gogoproto.nullable) = false]; +} diff --git a/third_party/proto/ibc/core/channel/v1/genesis.proto b/third_party/proto/ibc/core/channel/v1/genesis.proto index 813e98f36..665b2b156 100644 --- a/third_party/proto/ibc/core/channel/v1/genesis.proto +++ b/third_party/proto/ibc/core/channel/v1/genesis.proto @@ -13,20 +13,18 @@ message GenesisState { repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; - repeated PacketSequence send_sequences = 5 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"send_sequences\""]; - repeated PacketSequence recv_sequences = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"recv_sequences\""]; - repeated PacketSequence ack_sequences = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ack_sequences\""]; + repeated PacketSequence send_sequences = 5 [(gogoproto.nullable) = false]; + repeated PacketSequence recv_sequences = 6 [(gogoproto.nullable) = false]; + repeated PacketSequence ack_sequences = 7 [(gogoproto.nullable) = false]; // the sequence for the next generated channel identifier - uint64 next_channel_sequence = 8 [(gogoproto.moretags) = "yaml:\"next_channel_sequence\""]; + uint64 next_channel_sequence = 8; + Params params = 9 [(gogoproto.nullable) = false]; } // PacketSequence defines the genesis type necessary to retrieve and store // next send and receive sequences. message PacketSequence { - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string port_id = 1; + string channel_id = 2; uint64 sequence = 3; } diff --git a/third_party/proto/ibc/core/channel/v1/query.proto b/third_party/proto/ibc/core/channel/v1/query.proto index 0170a2aac..f89d21273 100644 --- a/third_party/proto/ibc/core/channel/v1/query.proto +++ b/third_party/proto/ibc/core/channel/v1/query.proto @@ -10,6 +10,7 @@ import "ibc/core/channel/v1/channel.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/upgrade.proto"; // Query provides defines the gRPC querier service service Query { @@ -98,6 +99,29 @@ service Query { option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" "ports/{port_id}/next_sequence"; } + + // NextSequenceSend returns the next send sequence for a given channel. + rpc NextSequenceSend(QueryNextSequenceSendRequest) returns (QueryNextSequenceSendResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/next_sequence_send"; + } + + // UpgradeError returns the error receipt if the upgrade handshake failed. + rpc UpgradeError(QueryUpgradeErrorRequest) returns (QueryUpgradeErrorResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/upgrade_error"; + } + + // Upgrade returns the upgrade for a given port and channel id. + rpc Upgrade(QueryUpgradeRequest) returns (QueryUpgradeResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/upgrade"; + } + + // ChannelParams queries all parameters of the ibc channel submodule. + rpc ChannelParams(QueryChannelParamsRequest) returns (QueryChannelParamsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/params"; + } } // QueryChannelRequest is the request type for the Query/Channel RPC method @@ -364,7 +388,7 @@ message QueryNextSequenceReceiveRequest { string channel_id = 2; } -// QuerySequenceResponse is the request type for the +// QuerySequenceResponse is the response type for the // Query/QueryNextSequenceReceiveResponse RPC method message QueryNextSequenceReceiveResponse { // next sequence receive number @@ -374,3 +398,62 @@ message QueryNextSequenceReceiveResponse { // height at which the proof was retrieved ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; } + +// QueryNextSequenceSendRequest is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryNextSequenceSendResponse is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendResponse { + // next sequence send number + uint64 next_sequence_send = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method +message QueryUpgradeErrorRequest { + string port_id = 1; + string channel_id = 2; +} + +// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method +message QueryUpgradeErrorResponse { + ErrorReceipt error_receipt = 1 [(gogoproto.nullable) = false]; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method +message QueryUpgradeRequest { + string port_id = 1; + string channel_id = 2; +} + +// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method +message QueryUpgradeResponse { + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. +message QueryChannelParamsRequest {} + +// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. +message QueryChannelParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} \ No newline at end of file diff --git a/third_party/proto/ibc/core/channel/v1/tx.proto b/third_party/proto/ibc/core/channel/v1/tx.proto index d0918eaff..3f30e8b8c 100644 --- a/third_party/proto/ibc/core/channel/v1/tx.proto +++ b/third_party/proto/ibc/core/channel/v1/tx.proto @@ -5,11 +5,15 @@ package ibc.core.channel.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "ibc/core/client/v1/client.proto"; import "ibc/core/channel/v1/channel.proto"; +import "ibc/core/channel/v1/upgrade.proto"; // Msg defines the ibc/channel Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); @@ -40,6 +44,33 @@ service Msg { // Acknowledgement defines a rpc handler method for MsgAcknowledgement. rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); + + // ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. + rpc ChannelUpgradeInit(MsgChannelUpgradeInit) returns (MsgChannelUpgradeInitResponse); + + // ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. + rpc ChannelUpgradeTry(MsgChannelUpgradeTry) returns (MsgChannelUpgradeTryResponse); + + // ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. + rpc ChannelUpgradeAck(MsgChannelUpgradeAck) returns (MsgChannelUpgradeAckResponse); + + // ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. + rpc ChannelUpgradeConfirm(MsgChannelUpgradeConfirm) returns (MsgChannelUpgradeConfirmResponse); + + // ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. + rpc ChannelUpgradeOpen(MsgChannelUpgradeOpen) returns (MsgChannelUpgradeOpenResponse); + + // ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. + rpc ChannelUpgradeTimeout(MsgChannelUpgradeTimeout) returns (MsgChannelUpgradeTimeoutResponse); + + // ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. + rpc ChannelUpgradeCancel(MsgChannelUpgradeCancel) returns (MsgChannelUpgradeCancelResponse); + + // UpdateChannelParams defines a rpc handler method for MsgUpdateParams. + rpc UpdateChannelParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + rpc PruneAcknowledgements(MsgPruneAcknowledgements) returns (MsgPruneAcknowledgementsResponse); } // ResponseResultType defines the possible outcomes of the execution of a message @@ -52,22 +83,27 @@ enum ResponseResultType { RESPONSE_RESULT_TYPE_NOOP = 1 [(gogoproto.enumvalue_customname) = "NOOP"]; // The message was executed successfully RESPONSE_RESULT_TYPE_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "SUCCESS"]; + // The message was executed unsuccessfully + RESPONSE_RESULT_TYPE_FAILURE = 3 [(gogoproto.enumvalue_customname) = "FAILURE"]; } // MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It // is called by a relayer on Chain A. message MsgChannelOpenInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; Channel channel = 2 [(gogoproto.nullable) = false]; string signer = 3; } // MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. message MsgChannelOpenInitResponse { - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + option (gogoproto.goproto_getters) = false; + + string channel_id = 1; string version = 2; } @@ -75,41 +111,46 @@ message MsgChannelOpenInitResponse { // on Chain B. The version field within the Channel field has been deprecated. Its // value will be ignored by core IBC. message MsgChannelOpenTry { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. - string previous_channel_id = 2 [deprecated = true, (gogoproto.moretags) = "yaml:\"previous_channel_id\""]; + string previous_channel_id = 2 [deprecated = true]; // NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. Channel channel = 3 [(gogoproto.nullable) = false]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; + string counterparty_version = 4; + bytes proof_init = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; } // MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. message MsgChannelOpenTryResponse { + option (gogoproto.goproto_getters) = false; + string version = 1; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; } // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. +// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel +// in the same block as executing this message otherwise the counterparty will +// be incapable of opening. message MsgChannelOpenAck { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; + string port_id = 1; + string channel_id = 2; + string counterparty_channel_id = 3; + string counterparty_version = 4; + bytes proof_try = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; } // MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. @@ -118,15 +159,15 @@ message MsgChannelOpenAckResponse {} // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. message MsgChannelOpenConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + string port_id = 1; + string channel_id = 2; + bytes proof_ack = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; } // MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response @@ -136,11 +177,12 @@ message MsgChannelOpenConfirmResponse {} // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. message MsgChannelCloseInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string port_id = 1; + string channel_id = 2; string signer = 3; } @@ -150,15 +192,16 @@ message MsgChannelCloseInitResponse {} // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. message MsgChannelCloseConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + string port_id = 1; + string channel_id = 2; + bytes proof_init = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; + uint64 counterparty_upgrade_sequence = 6; } // MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response @@ -167,14 +210,14 @@ message MsgChannelCloseConfirmResponse {} // MsgRecvPacket receives incoming IBC packet message MsgRecvPacket { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_commitment = 2 [(gogoproto.moretags) = "yaml:\"proof_commitment\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; + bytes proof_commitment = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + string signer = 4; } // MsgRecvPacketResponse defines the Msg/RecvPacket response type. @@ -186,15 +229,15 @@ message MsgRecvPacketResponse { // MsgTimeout receives timed-out packet message MsgTimeout { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 5; + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + uint64 next_sequence_recv = 4; + string signer = 5; } // MsgTimeoutResponse defines the Msg/Timeout response type. @@ -206,16 +249,17 @@ message MsgTimeoutResponse { // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. message MsgTimeoutOnClose { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; - bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 6; + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2; + bytes proof_close = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + uint64 next_sequence_recv = 5; + string signer = 6; + uint64 counterparty_upgrade_sequence = 7; } // MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. @@ -227,15 +271,15 @@ message MsgTimeoutOnCloseResponse { // MsgAcknowledgement receives incoming IBC acknowledgement message MsgAcknowledgement { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; Packet packet = 1 [(gogoproto.nullable) = false]; bytes acknowledgement = 2; - bytes proof_acked = 3 [(gogoproto.moretags) = "yaml:\"proof_acked\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + bytes proof_acked = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; } // MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. @@ -244,3 +288,182 @@ message MsgAcknowledgementResponse { ResponseResultType result = 1; } + +// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc +// WARNING: Initializing a channel upgrade in the same block as opening the channel +// may result in the counterparty being incapable of opening. +message MsgChannelUpgradeInit { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + UpgradeFields fields = 3 [(gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type +message MsgChannelUpgradeInitResponse { + option (gogoproto.goproto_getters) = false; + + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + uint64 upgrade_sequence = 2; +} + +// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc +message MsgChannelUpgradeTry { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + repeated string proposed_upgrade_connection_hops = 3; + UpgradeFields counterparty_upgrade_fields = 4 [(gogoproto.nullable) = false]; + uint64 counterparty_upgrade_sequence = 5; + bytes proof_channel = 6; + bytes proof_upgrade = 7; + ibc.core.client.v1.Height proof_height = 8 [(gogoproto.nullable) = false]; + string signer = 9; +} + +// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type +message MsgChannelUpgradeTryResponse { + option (gogoproto.goproto_getters) = false; + + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + uint64 upgrade_sequence = 2; + ResponseResultType result = 3; +} + +// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc +message MsgChannelUpgradeAck { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + Upgrade counterparty_upgrade = 3 [(gogoproto.nullable) = false]; + bytes proof_channel = 4; + bytes proof_upgrade = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type +message MsgChannelUpgradeAckResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc +message MsgChannelUpgradeConfirm { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + State counterparty_channel_state = 3; + Upgrade counterparty_upgrade = 4 [(gogoproto.nullable) = false]; + bytes proof_channel = 5; + bytes proof_upgrade = 6; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false]; + string signer = 8; +} + +// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type +message MsgChannelUpgradeConfirmResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc +message MsgChannelUpgradeOpen { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + State counterparty_channel_state = 3; + uint64 counterparty_upgrade_sequence = 4; + bytes proof_channel = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type +message MsgChannelUpgradeOpenResponse {} + +// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc +message MsgChannelUpgradeTimeout { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + Channel counterparty_channel = 3 [(gogoproto.nullable) = false]; + bytes proof_channel = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + string signer = 6; +} + +// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type +message MsgChannelUpgradeTimeoutResponse {} + +// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc +message MsgChannelUpgradeCancel { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + ErrorReceipt error_receipt = 3 [(gogoproto.nullable) = false]; + bytes proof_error_receipt = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + string signer = 6; +} + +// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type +message MsgChannelUpgradeCancelResponse {} + +// MsgUpdateParams is the MsgUpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + option (gogoproto.goproto_getters) = false; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1; + + // params defines the channel parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} + +// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. +message MsgPruneAcknowledgements { + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + uint64 limit = 3; + string signer = 4; +} + +// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. +message MsgPruneAcknowledgementsResponse { + // Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + uint64 total_pruned_sequences = 1; + // Number of sequences left after pruning. + uint64 total_remaining_sequences = 2; +} diff --git a/third_party/proto/ibc/core/channel/v1/upgrade.proto b/third_party/proto/ibc/core/channel/v1/upgrade.proto new file mode 100644 index 000000000..81530ed2a --- /dev/null +++ b/third_party/proto/ibc/core/channel/v1/upgrade.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Upgrade is a verifiable type which contains the relevant information +// for an attempted upgrade. It provides the proposed changes to the channel +// end, the timeout for this upgrade attempt and the next packet sequence +// which allows the counterparty to efficiently know the highest sequence it has received. +// The next sequence send is used for pruning and upgrading from unordered to ordered channels. +message Upgrade { + option (gogoproto.goproto_getters) = false; + + UpgradeFields fields = 1 [(gogoproto.nullable) = false]; + Timeout timeout = 2 [(gogoproto.nullable) = false]; + uint64 next_sequence_send = 3; +} + +// UpgradeFields are the fields in a channel end which may be changed +// during a channel upgrade. +message UpgradeFields { + option (gogoproto.goproto_getters) = false; + + Order ordering = 1; + repeated string connection_hops = 2; + string version = 3; +} + +// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the +// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the +// next sequence. +message ErrorReceipt { + option (gogoproto.goproto_getters) = false; + + // the channel upgrade sequence + uint64 sequence = 1; + // the error message detailing the cause of failure + string message = 2; +} diff --git a/third_party/proto/ibc/core/client/v1/client.proto b/third_party/proto/ibc/core/client/v1/client.proto index b9f6b1ca1..7a09e360a 100644 --- a/third_party/proto/ibc/core/client/v1/client.proto +++ b/third_party/proto/ibc/core/client/v1/client.proto @@ -4,18 +4,18 @@ package ibc.core.client.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; import "cosmos/upgrade/v1beta1/upgrade.proto"; import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; // IdentifiedClientState defines a client state with an additional client // identifier field. message IdentifiedClientState { // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; + google.protobuf.Any client_state = 2; } // ConsensusStateWithHeight defines a consensus state with an additional height @@ -24,26 +24,58 @@ message ConsensusStateWithHeight { // consensus state height Height height = 1 [(gogoproto.nullable) = false]; // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + google.protobuf.Any consensus_state = 2; } // ClientConsensusStates defines all the stored consensus states for a given // client. message ClientConsensusStates { // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // consensus states and their heights associated with the client - repeated ConsensusStateWithHeight consensus_states = 2 - [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; + repeated ConsensusStateWithHeight consensus_states = 2 [(gogoproto.nullable) = false]; +} + +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the RevisionHeight is incremented at each height while keeping +// RevisionNumber the same. However some consensus algorithms may choose to +// reset the height in certain conditions e.g. hard forks, state-machine +// breaking changes In these cases, the RevisionNumber is incremented so that +// height continues to be monitonically increasing even as the RevisionHeight +// gets reset +message Height { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // the revision that the client is currently on + uint64 revision_number = 1; + // the height within the given revision + uint64 revision_height = 2; +} + +// Params defines the set of IBC light client parameters. +message Params { + // allowed_clients defines the list of allowed client state types which can be created + // and interacted with. If a client type is removed from the allowed clients list, usage + // of this client will be disabled until it is added again to the list. + repeated string allowed_clients = 1; } -// ClientUpdateProposal is a governance proposal. If it passes, the substitute +// ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute // client's latest consensus state is copied over to the subject client. The proposal // handler may fail if the subject and the substitute do not match in client and // chain parameters (with exception to latest height, frozen height, and chain-id). +// +// Deprecated: Please use MsgRecoverClient in favour of this message type. message ClientUpdateProposal { - option (gogoproto.goproto_getters) = false; + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (gogoproto.goproto_getters) = false; + // the title of the update proposal string title = 1; // the description of the proposal @@ -57,11 +89,15 @@ message ClientUpdateProposal { // UpgradeProposal is a gov Content type for initiating an IBC breaking // upgrade. +// +// Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. message UpgradeProposal { + option deprecated = true; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = true; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; string description = 2; @@ -75,31 +111,3 @@ message UpgradeProposal { // planned chain upgrades google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; } - -// Height is a monotonically increasing data type -// that can be compared against another Height for the purposes of updating and -// freezing clients -// -// Normally the RevisionHeight is incremented at each height while keeping -// RevisionNumber the same. However some consensus algorithms may choose to -// reset the height in certain conditions e.g. hard forks, state-machine -// breaking changes In these cases, the RevisionNumber is incremented so that -// height continues to be monitonically increasing even as the RevisionHeight -// gets reset -message Height { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // the revision that the client is currently on - uint64 revision_number = 1 [(gogoproto.moretags) = "yaml:\"revision_number\""]; - // the height within the given revision - uint64 revision_height = 2 [(gogoproto.moretags) = "yaml:\"revision_height\""]; -} - -// Params defines the set of IBC light client parameters. -message Params { - // allowed_clients defines the list of allowed client state types which can be created - // and interacted with. If a client type is removed from the allowed clients list, usage - // of this client will be disabled until it is added again to the list. - repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""]; -} diff --git a/third_party/proto/ibc/core/client/v1/genesis.proto b/third_party/proto/ibc/core/client/v1/genesis.proto index b09ff1eaf..a16d5a709 100644 --- a/third_party/proto/ibc/core/client/v1/genesis.proto +++ b/third_party/proto/ibc/core/client/v1/genesis.proto @@ -11,21 +11,18 @@ import "gogoproto/gogo.proto"; message GenesisState { // client states with their corresponding identifiers repeated IdentifiedClientState clients = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; // consensus states from each client - repeated ClientConsensusStates clients_consensus = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "ClientsConsensusStates", - (gogoproto.moretags) = "yaml:\"clients_consensus\"" - ]; + repeated ClientConsensusStates clients_consensus = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "ClientsConsensusStates"]; // metadata from each client - repeated IdentifiedGenesisMetadata clients_metadata = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"clients_metadata\""]; - Params params = 4 [(gogoproto.nullable) = false]; - // create localhost on initialization - bool create_localhost = 5 [(gogoproto.moretags) = "yaml:\"create_localhost\""]; + repeated IdentifiedGenesisMetadata clients_metadata = 3 [(gogoproto.nullable) = false]; + Params params = 4 [(gogoproto.nullable) = false]; + // Deprecated: create_localhost has been deprecated. + // The localhost client is automatically created at genesis. + bool create_localhost = 5 [deprecated = true]; // the sequence for the next generated client identifier - uint64 next_client_sequence = 6 [(gogoproto.moretags) = "yaml:\"next_client_sequence\""]; + uint64 next_client_sequence = 6; } // GenesisMetadata defines the genesis type for metadata that clients may return @@ -42,7 +39,6 @@ message GenesisMetadata { // IdentifiedGenesisMetadata has the client metadata with the corresponding // client id. message IdentifiedGenesisMetadata { - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - repeated GenesisMetadata client_metadata = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_metadata\""]; + string client_id = 1; + repeated GenesisMetadata client_metadata = 2 [(gogoproto.nullable) = false]; } diff --git a/third_party/proto/ibc/core/client/v1/query.proto b/third_party/proto/ibc/core/client/v1/query.proto deleted file mode 100644 index 0032306ec..000000000 --- a/third_party/proto/ibc/core/client/v1/query.proto +++ /dev/null @@ -1,207 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/core/client/v1/client.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "gogoproto/gogo.proto"; - -// Query provides defines the gRPC querier service -service Query { - // ClientState queries an IBC light client. - rpc ClientState(QueryClientStateRequest) returns (QueryClientStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_states/{client_id}"; - } - - // ClientStates queries all the IBC light clients of a chain. - rpc ClientStates(QueryClientStatesRequest) returns (QueryClientStatesResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_states"; - } - - // ConsensusState queries a consensus state associated with a client state at - // a given height. - rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/consensus_states/" - "{client_id}/revision/{revision_number}/" - "height/{revision_height}"; - } - - // ConsensusStates queries all the consensus state associated with a given - // client. - rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) { - option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}"; - } - - // ConsensusStateHeights queries the height of every consensus states associated with a given client. - rpc ConsensusStateHeights(QueryConsensusStateHeightsRequest) returns (QueryConsensusStateHeightsResponse) { - option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}/heights"; - } - - // Status queries the status of an IBC client. - rpc ClientStatus(QueryClientStatusRequest) returns (QueryClientStatusResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_status/{client_id}"; - } - - // ClientParams queries all parameters of the ibc client submodule. - rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) { - option (google.api.http).get = "/ibc/core/client/v1/params"; - } - - // UpgradedClientState queries an Upgraded IBC light client. - rpc UpgradedClientState(QueryUpgradedClientStateRequest) returns (QueryUpgradedClientStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/upgraded_client_states"; - } - - // UpgradedConsensusState queries an Upgraded IBC consensus state. - rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/upgraded_consensus_states"; - } -} - -// QueryClientStateRequest is the request type for the Query/ClientState RPC -// method -message QueryClientStateRequest { - // client state unique identifier - string client_id = 1; -} - -// QueryClientStateResponse is the response type for the Query/ClientState RPC -// method. Besides the client state, it includes a proof and the height from -// which the proof was retrieved. -message QueryClientStateResponse { - // client state associated with the request identifier - google.protobuf.Any client_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryClientStatesRequest is the request type for the Query/ClientStates RPC -// method -message QueryClientStatesRequest { - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryClientStatesResponse is the response type for the Query/ClientStates RPC -// method. -message QueryClientStatesResponse { - // list of stored ClientStates of the chain. - repeated IdentifiedClientState client_states = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryConsensusStateRequest is the request type for the Query/ConsensusState -// RPC method. Besides the consensus state, it includes a proof and the height -// from which the proof was retrieved. -message QueryConsensusStateRequest { - // client identifier - string client_id = 1; - // consensus state revision number - uint64 revision_number = 2; - // consensus state revision height - uint64 revision_height = 3; - // latest_height overrrides the height field and queries the latest stored - // ConsensusState - bool latest_height = 4; -} - -// QueryConsensusStateResponse is the response type for the Query/ConsensusState -// RPC method -message QueryConsensusStateResponse { - // consensus state associated with the client identifier at the given height - google.protobuf.Any consensus_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates -// RPC method. -message QueryConsensusStatesRequest { - // client identifier - string client_id = 1; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryConsensusStatesResponse is the response type for the -// Query/ConsensusStates RPC method -message QueryConsensusStatesResponse { - // consensus states associated with the identifier - repeated ConsensusStateWithHeight consensus_states = 1 [(gogoproto.nullable) = false]; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights -// RPC method. -message QueryConsensusStateHeightsRequest { - // client identifier - string client_id = 1; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryConsensusStateHeightsResponse is the response type for the -// Query/ConsensusStateHeights RPC method -message QueryConsensusStateHeightsResponse { - // consensus state heights - repeated Height consensus_state_heights = 1 [(gogoproto.nullable) = false]; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC -// method -message QueryClientStatusRequest { - // client unique identifier - string client_id = 1; -} - -// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC -// method. It returns the current status of the IBC client. -message QueryClientStatusResponse { - string status = 1; -} - -// QueryClientParamsRequest is the request type for the Query/ClientParams RPC -// method. -message QueryClientParamsRequest {} - -// QueryClientParamsResponse is the response type for the Query/ClientParams RPC -// method. -message QueryClientParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} - -// QueryUpgradedClientStateRequest is the request type for the -// Query/UpgradedClientState RPC method -message QueryUpgradedClientStateRequest {} - -// QueryUpgradedClientStateResponse is the response type for the -// Query/UpgradedClientState RPC method. -message QueryUpgradedClientStateResponse { - // client state associated with the request identifier - google.protobuf.Any upgraded_client_state = 1; -} - -// QueryUpgradedConsensusStateRequest is the request type for the -// Query/UpgradedConsensusState RPC method -message QueryUpgradedConsensusStateRequest {} - -// QueryUpgradedConsensusStateResponse is the response type for the -// Query/UpgradedConsensusState RPC method. -message QueryUpgradedConsensusStateResponse { - // Consensus state associated with the request identifier - google.protobuf.Any upgraded_consensus_state = 1; -} diff --git a/third_party/proto/ibc/core/client/v1/tx.proto b/third_party/proto/ibc/core/client/v1/tx.proto deleted file mode 100644 index 752718c11..000000000 --- a/third_party/proto/ibc/core/client/v1/tx.proto +++ /dev/null @@ -1,100 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// Msg defines the ibc/client Msg service. -service Msg { - // CreateClient defines a rpc handler method for MsgCreateClient. - rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); - - // UpdateClient defines a rpc handler method for MsgUpdateClient. - rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); - - // UpgradeClient defines a rpc handler method for MsgUpgradeClient. - rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); - - // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. - rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); -} - -// MsgCreateClient defines a message to create an IBC client -message MsgCreateClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // light client state - google.protobuf.Any client_state = 1 [(gogoproto.moretags) = "yaml:\"client_state\""]; - // consensus state associated with the client that corresponds to a given - // height. - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // signer address - string signer = 3; -} - -// MsgCreateClientResponse defines the Msg/CreateClient response type. -message MsgCreateClientResponse {} - -// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -// the given client message. -message MsgUpdateClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // client message to update the light client - google.protobuf.Any client_message = 2; - // signer address - string signer = 3; -} - -// MsgUpdateClientResponse defines the Msg/UpdateClient response type. -message MsgUpdateClientResponse {} - -// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client -// state -message MsgUpgradeClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // upgraded client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; - // upgraded consensus state, only contains enough information to serve as a - // basis of trust in update logic - google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // proof that old chain committed to new client - bytes proof_upgrade_client = 4 [(gogoproto.moretags) = "yaml:\"proof_upgrade_client\""]; - // proof that old chain committed to new consensus state - bytes proof_upgrade_consensus_state = 5 [(gogoproto.moretags) = "yaml:\"proof_upgrade_consensus_state\""]; - // signer address - string signer = 6; -} - -// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. -message MsgUpgradeClientResponse {} - -// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -// light client misbehaviour. -// Warning: DEPRECATED -message MsgSubmitMisbehaviour { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\"", deprecated = true]; - // misbehaviour used for freezing the light client - google.protobuf.Any misbehaviour = 2 [deprecated = true]; - // signer address - string signer = 3 [deprecated = true]; -} - -// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response -// type. -message MsgSubmitMisbehaviourResponse {} diff --git a/third_party/proto/ibc/core/commitment/v1/commitment.proto b/third_party/proto/ibc/core/commitment/v1/commitment.proto index 60abc5d1c..b4753be2d 100644 --- a/third_party/proto/ibc/core/commitment/v1/commitment.proto +++ b/third_party/proto/ibc/core/commitment/v1/commitment.proto @@ -19,16 +19,14 @@ message MerkleRoot { // The constructed key from the Path and the key will be append(Path.KeyPath, // append(Path.KeyPrefix, key...)) message MerklePrefix { - bytes key_prefix = 1 [(gogoproto.moretags) = "yaml:\"key_prefix\""]; + bytes key_prefix = 1; } // MerklePath is the path used to verify commitment proofs, which can be an // arbitrary structured object (defined by a commitment type). // MerklePath is represented from root-to-leaf message MerklePath { - option (gogoproto.goproto_stringer) = false; - - repeated string key_path = 1 [(gogoproto.moretags) = "yaml:\"key_path\""]; + repeated string key_path = 1; } // MerkleProof is a wrapper type over a chain of CommitmentProofs. diff --git a/third_party/proto/ibc/core/connection/v1/connection.proto b/third_party/proto/ibc/core/connection/v1/connection.proto index 2cec817a0..852f3999b 100644 --- a/third_party/proto/ibc/core/connection/v1/connection.proto +++ b/third_party/proto/ibc/core/connection/v1/connection.proto @@ -17,7 +17,7 @@ import "ibc/core/commitment/v1/commitment.proto"; message ConnectionEnd { option (gogoproto.goproto_getters) = false; // client associated with this connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // IBC version which can be utilised to determine encodings or protocols for // channels or packets utilising this connection. repeated Version versions = 2; @@ -28,7 +28,7 @@ message ConnectionEnd { // delay period that must pass before a consensus state can be used for // packet-verification NOTE: delay period logic is only implemented by some // clients. - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 5; } // IdentifiedConnection defines a connection with additional connection @@ -36,9 +36,9 @@ message ConnectionEnd { message IdentifiedConnection { option (gogoproto.goproto_getters) = false; // connection identifier. - string id = 1 [(gogoproto.moretags) = "yaml:\"id\""]; + string id = 1; // client associated with this connection. - string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 2; // IBC version which can be utilised to determine encodings or protocols for // channels or packets utilising this connection repeated Version versions = 3; @@ -47,7 +47,7 @@ message IdentifiedConnection { // counterparty chain associated with this connection. Counterparty counterparty = 5 [(gogoproto.nullable) = false]; // delay period associated with this connection. - uint64 delay_period = 6 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 6; } // State defines if a connection is in one of the following states: @@ -72,10 +72,10 @@ message Counterparty { // identifies the client on the counterparty chain associated with a given // connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // identifies the connection end on the counterparty chain associated with a // given connection. - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 2; // commitment merkle prefix of the counterparty chain. ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false]; } @@ -89,7 +89,7 @@ message ClientPaths { // ConnectionPaths define all the connection paths for a given client state. message ConnectionPaths { // client state unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // list of connection paths repeated string paths = 2; } @@ -110,5 +110,5 @@ message Params { // maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the // largest amount of time that the chain might reasonably take to produce the next block under normal operating // conditions. A safe choice is 3-5x the expected time per block. - uint64 max_expected_time_per_block = 1 [(gogoproto.moretags) = "yaml:\"max_expected_time_per_block\""]; + uint64 max_expected_time_per_block = 1; } diff --git a/third_party/proto/ibc/core/connection/v1/genesis.proto b/third_party/proto/ibc/core/connection/v1/genesis.proto index 830bbe138..a5eb6b3a1 100644 --- a/third_party/proto/ibc/core/connection/v1/genesis.proto +++ b/third_party/proto/ibc/core/connection/v1/genesis.proto @@ -10,9 +10,8 @@ import "ibc/core/connection/v1/connection.proto"; // GenesisState defines the ibc connection submodule's genesis state. message GenesisState { repeated IdentifiedConnection connections = 1 [(gogoproto.nullable) = false]; - repeated ConnectionPaths client_connection_paths = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_connection_paths\""]; + repeated ConnectionPaths client_connection_paths = 2 [(gogoproto.nullable) = false]; // the sequence for the next generated connection identifier - uint64 next_connection_sequence = 3 [(gogoproto.moretags) = "yaml:\"next_connection_sequence\""]; + uint64 next_connection_sequence = 3; Params params = 4 [(gogoproto.nullable) = false]; } diff --git a/third_party/proto/ibc/core/connection/v1/query.proto b/third_party/proto/ibc/core/connection/v1/query.proto index d1e120c92..c0f1a6f57 100644 --- a/third_party/proto/ibc/core/connection/v1/query.proto +++ b/third_party/proto/ibc/core/connection/v1/query.proto @@ -106,7 +106,7 @@ message QueryClientConnectionsResponse { // Query/ConnectionClientState RPC method message QueryConnectionClientStateRequest { // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; } // QueryConnectionClientStateResponse is the response type for the @@ -124,7 +124,7 @@ message QueryConnectionClientStateResponse { // Query/ConnectionConsensusState RPC method message QueryConnectionConsensusStateRequest { // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; uint64 revision_number = 2; uint64 revision_height = 3; } diff --git a/third_party/proto/ibc/core/connection/v1/tx.proto b/third_party/proto/ibc/core/connection/v1/tx.proto index d2ef2b914..3ba8ff456 100644 --- a/third_party/proto/ibc/core/connection/v1/tx.proto +++ b/third_party/proto/ibc/core/connection/v1/tx.proto @@ -5,12 +5,15 @@ package ibc.core.connection.v1; option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "google/protobuf/any.proto"; import "ibc/core/client/v1/client.proto"; import "ibc/core/connection/v1/connection.proto"; // Msg defines the ibc/connection Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); @@ -23,18 +26,23 @@ service Msg { // ConnectionOpenConfirm defines a rpc handler method for // MsgConnectionOpenConfirm. rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); + + // UpdateConnectionParams defines a rpc handler method for + // MsgUpdateParams. + rpc UpdateConnectionParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgConnectionOpenInit defines the msg sent by an account on Chain A to // initialize a connection with Chain B. message MsgConnectionOpenInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; Counterparty counterparty = 2 [(gogoproto.nullable) = false]; Version version = 3; - uint64 delay_period = 4 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 4; string signer = 5; } @@ -45,28 +53,27 @@ message MsgConnectionOpenInitResponse {} // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. message MsgConnectionOpenTry { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. - string previous_connection_id = 2 [deprecated = true, (gogoproto.moretags) = "yaml:\"previous_connection_id\""]; - google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""]; - Counterparty counterparty = 4 [(gogoproto.nullable) = false]; - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; - repeated Version counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; - ibc.core.client.v1.Height proof_height = 7 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string previous_connection_id = 2 [deprecated = true]; + google.protobuf.Any client_state = 3; + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + uint64 delay_period = 5; + repeated Version counterparty_versions = 6; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false]; // proof of the initialization the connection on Chain A: `UNITIALIZED -> // INIT` - bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + bytes proof_init = 8; // proof of client state included in message - bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + bytes proof_client = 9; // proof of client consensus state - bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 11 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 12; + bytes proof_consensus = 10; + ibc.core.client.v1.Height consensus_height = 11 [(gogoproto.nullable) = false]; + string signer = 12; // optional proof data for host state machines that are unable to introspect their own consensus state bytes host_consensus_state_proof = 13; } @@ -77,25 +84,24 @@ message MsgConnectionOpenTryResponse {} // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. message MsgConnectionOpenAck { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string counterparty_connection_id = 2 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; - Version version = 3; - google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; - ibc.core.client.v1.Height proof_height = 5 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string connection_id = 1; + string counterparty_connection_id = 2; + Version version = 3; + google.protobuf.Any client_state = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; // proof of the initialization the connection on Chain B: `UNITIALIZED -> // TRYOPEN` - bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""]; + bytes proof_try = 6; // proof of client state included in message - bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + bytes proof_client = 7; // proof of client consensus state - bytes proof_consensus = 8 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 9 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 10; + bytes proof_consensus = 8; + ibc.core.client.v1.Height consensus_height = 9 [(gogoproto.nullable) = false]; + string signer = 10; // optional proof data for host state machines that are unable to introspect their own consensus state bytes host_consensus_state_proof = 11; } @@ -106,17 +112,35 @@ message MsgConnectionOpenAckResponse {} // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. message MsgConnectionOpenConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; // proof for the change of the connection state on Chain A: `INIT -> OPEN` - bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; + bytes proof_ack = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + string signer = 4; } // MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm // response type. message MsgConnectionOpenConfirmResponse {} + +// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the connection parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/third_party/proto/ibc/core/types/v1/genesis.proto b/third_party/proto/ibc/core/types/v1/genesis.proto index 51c227916..4b34f6889 100644 --- a/third_party/proto/ibc/core/types/v1/genesis.proto +++ b/third_party/proto/ibc/core/types/v1/genesis.proto @@ -12,12 +12,9 @@ import "ibc/core/channel/v1/genesis.proto"; // GenesisState defines the ibc module's genesis state. message GenesisState { // ICS002 - Clients genesis state - ibc.core.client.v1.GenesisState client_genesis = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_genesis\""]; + ibc.core.client.v1.GenesisState client_genesis = 1 [(gogoproto.nullable) = false]; // ICS003 - Connections genesis state - ibc.core.connection.v1.GenesisState connection_genesis = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"connection_genesis\""]; + ibc.core.connection.v1.GenesisState connection_genesis = 2 [(gogoproto.nullable) = false]; // ICS004 - Channel genesis state - ibc.core.channel.v1.GenesisState channel_genesis = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"channel_genesis\""]; + ibc.core.channel.v1.GenesisState channel_genesis = 3 [(gogoproto.nullable) = false]; } diff --git a/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto b/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto deleted file mode 100644 index 635db8521..000000000 --- a/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.localhost.v2; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/09-localhost;localhost"; - -import "ibc/core/client/v1/client.proto"; -import "gogoproto/gogo.proto"; - -// ClientState defines the 09-localhost client state -message ClientState { - option (gogoproto.goproto_getters) = false; - - // the latest block height - ibc.core.client.v1.Height latest_height = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto deleted file mode 100644 index fb2f076a4..000000000 --- a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ /dev/null @@ -1,189 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.solomachine.v2; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/migrations/v7"; - -import "ibc/core/connection/v1/connection.proto"; -import "ibc/core/channel/v1/channel.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// ClientState defines a solo machine client that tracks the current consensus -// state and if the client is frozen. -message ClientState { - option (gogoproto.goproto_getters) = false; - // latest sequence of the client state - uint64 sequence = 1; - // frozen sequence of the solo machine - bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; - ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // when set to true, will allow governance to update a solo machine client. - // The client will be unfrozen if it is frozen. - bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""]; -} - -// ConsensusState defines a solo machine consensus state. The sequence of a -// consensus state is contained in the "height" key used in storing the -// consensus state. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - // public key of the solo machine - google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; - // diversifier allows the same public key to be re-used across different solo - // machine clients (potentially on different chains) without being considered - // misbehaviour. - string diversifier = 2; - uint64 timestamp = 3; -} - -// Header defines a solo machine consensus header -message Header { - option (gogoproto.goproto_getters) = false; - // sequence to update solo machine public key at - uint64 sequence = 1; - uint64 timestamp = 2; - bytes signature = 3; - google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; - string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// Misbehaviour defines misbehaviour for a solo machine which consists -// of a sequence and two signatures over different messages at that sequence. -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - uint64 sequence = 2; - SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; -} - -// SignatureAndData contains a signature and the data signed over to create that -// signature. -message SignatureAndData { - option (gogoproto.goproto_getters) = false; - bytes signature = 1; - DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; - bytes data = 3; - uint64 timestamp = 4; -} - -// TimestampedSignatureData contains the signature data and the timestamp of the -// signature. -message TimestampedSignatureData { - option (gogoproto.goproto_getters) = false; - bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; - uint64 timestamp = 2; -} - -// SignBytes defines the signed bytes used for signature verification. -message SignBytes { - option (gogoproto.goproto_getters) = false; - - uint64 sequence = 1; - uint64 timestamp = 2; - string diversifier = 3; - // type of the data used - DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; - // marshaled data - bytes data = 5; -} - -// DataType defines the type of solo machine proof being created. This is done -// to preserve uniqueness of different data sign byte encodings. -enum DataType { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // Data type for client state verification - DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; - // Data type for consensus state verification - DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; - // Data type for connection state verification - DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; - // Data type for channel state verification - DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; - // Data type for packet commitment verification - DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; - // Data type for packet acknowledgement verification - DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; - // Data type for packet receipt absence verification - DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; - // Data type for next sequence recv verification - DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; - // Data type for header verification - DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; -} - -// HeaderData returns the SignBytes data for update verification. -message HeaderData { - option (gogoproto.goproto_getters) = false; - - // header public key - google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; - // header diversifier - string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// ClientStateData returns the SignBytes data for client state verification. -message ClientStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} - -// ConsensusStateData returns the SignBytes data for consensus state -// verification. -message ConsensusStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ConnectionStateData returns the SignBytes data for connection state -// verification. -message ConnectionStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.connection.v1.ConnectionEnd connection = 2; -} - -// ChannelStateData returns the SignBytes data for channel state -// verification. -message ChannelStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.channel.v1.Channel channel = 2; -} - -// PacketCommitmentData returns the SignBytes data for packet commitment -// verification. -message PacketCommitmentData { - bytes path = 1; - bytes commitment = 2; -} - -// PacketAcknowledgementData returns the SignBytes data for acknowledgement -// verification. -message PacketAcknowledgementData { - bytes path = 1; - bytes acknowledgement = 2; -} - -// PacketReceiptAbsenceData returns the SignBytes data for -// packet receipt absence verification. -message PacketReceiptAbsenceData { - bytes path = 1; -} - -// NextSequenceRecvData returns the SignBytes data for verification of the next -// sequence to be received. -message NextSequenceRecvData { - bytes path = 1; - uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; -} diff --git a/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto deleted file mode 100644 index 38f9328c7..000000000 --- a/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto +++ /dev/null @@ -1,99 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.solomachine.v3; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine;solomachine"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// ClientState defines a solo machine client that tracks the current consensus -// state and if the client is frozen. -message ClientState { - option (gogoproto.goproto_getters) = false; - // latest sequence of the client state - uint64 sequence = 1; - // frozen sequence of the solo machine - bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; - ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ConsensusState defines a solo machine consensus state. The sequence of a -// consensus state is contained in the "height" key used in storing the -// consensus state. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - // public key of the solo machine - google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; - // diversifier allows the same public key to be re-used across different solo - // machine clients (potentially on different chains) without being considered - // misbehaviour. - string diversifier = 2; - uint64 timestamp = 3; -} - -// Header defines a solo machine consensus header -message Header { - option (gogoproto.goproto_getters) = false; - - uint64 timestamp = 1; - bytes signature = 2; - google.protobuf.Any new_public_key = 3 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; - string new_diversifier = 4 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// Misbehaviour defines misbehaviour for a solo machine which consists -// of a sequence and two signatures over different messages at that sequence. -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - - uint64 sequence = 1; - SignatureAndData signature_one = 2 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 3 [(gogoproto.moretags) = "yaml:\"signature_two\""]; -} - -// SignatureAndData contains a signature and the data signed over to create that -// signature. -message SignatureAndData { - option (gogoproto.goproto_getters) = false; - - bytes signature = 1; - bytes path = 2; - bytes data = 3; - uint64 timestamp = 4; -} - -// TimestampedSignatureData contains the signature data and the timestamp of the -// signature. -message TimestampedSignatureData { - option (gogoproto.goproto_getters) = false; - - bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; - uint64 timestamp = 2; -} - -// SignBytes defines the signed bytes used for signature verification. -message SignBytes { - option (gogoproto.goproto_getters) = false; - - // the sequence number - uint64 sequence = 1; - // the proof timestamp - uint64 timestamp = 2; - // the public key diversifier - string diversifier = 3; - // the standardised path bytes - bytes path = 4; - // the marshaled data bytes - bytes data = 5; -} - -// HeaderData returns the SignBytes data for update verification. -message HeaderData { - option (gogoproto.goproto_getters) = false; - - // header public key - google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; - // header diversifier - string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} diff --git a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto deleted file mode 100644 index bb21775dc..000000000 --- a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto +++ /dev/null @@ -1,115 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.tendermint.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint;tendermint"; - -import "tendermint/types/validator.proto"; -import "tendermint/types/types.proto"; -import "cosmos/ics23/v1/proofs.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "ibc/core/client/v1/client.proto"; -import "ibc/core/commitment/v1/commitment.proto"; -import "gogoproto/gogo.proto"; - -// ClientState from Tendermint tracks the current validator set, latest height, -// and a possible frozen height. -message ClientState { - option (gogoproto.goproto_getters) = false; - - string chain_id = 1; - Fraction trust_level = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trust_level\""]; - // duration of the period since the LastestTimestamp during which the - // submitted headers are valid for upgrade - google.protobuf.Duration trusting_period = 3 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"trusting_period\""]; - // duration of the staking unbonding period - google.protobuf.Duration unbonding_period = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"unbonding_period\"" - ]; - // defines how much new (untrusted) header's Time can drift into the future. - google.protobuf.Duration max_clock_drift = 5 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"max_clock_drift\""]; - // Block height when the client was frozen due to a misbehaviour - ibc.core.client.v1.Height frozen_height = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"frozen_height\""]; - // Latest height the client was updated to - ibc.core.client.v1.Height latest_height = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"latest_height\""]; - - // Proof specifications used in verifying counterparty state - repeated cosmos.ics23.v1.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""]; - - // Path at which next upgraded client will be committed. - // Each element corresponds to the key for a single CommitmentProof in the - // chained proof. NOTE: ClientState must stored under - // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored - // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using - // the default upgrade module, upgrade_path should be []string{"upgrade", - // "upgradedIBCState"}` - repeated string upgrade_path = 9 [(gogoproto.moretags) = "yaml:\"upgrade_path\""]; - - // allow_update_after_expiry is deprecated - bool allow_update_after_expiry = 10 [deprecated = true, (gogoproto.moretags) = "yaml:\"allow_update_after_expiry\""]; - // allow_update_after_misbehaviour is deprecated - bool allow_update_after_misbehaviour = 11 - [deprecated = true, (gogoproto.moretags) = "yaml:\"allow_update_after_misbehaviour\""]; -} - -// ConsensusState defines the consensus state from Tendermint. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - - // timestamp that corresponds to the block height in which the ConsensusState - // was stored. - google.protobuf.Timestamp timestamp = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - // commitment root (i.e app hash) - ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; - bytes next_validators_hash = 3 [ - (gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes", - (gogoproto.moretags) = "yaml:\"next_validators_hash\"" - ]; -} - -// Misbehaviour is a wrapper over two conflicting Headers -// that implements Misbehaviour interface expected by ICS-02 -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - - // ClientID is deprecated - string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; - Header header_1 = 2 [(gogoproto.customname) = "Header1", (gogoproto.moretags) = "yaml:\"header_1\""]; - Header header_2 = 3 [(gogoproto.customname) = "Header2", (gogoproto.moretags) = "yaml:\"header_2\""]; -} - -// Header defines the Tendermint client consensus Header. -// It encapsulates all the information necessary to update from a trusted -// Tendermint ConsensusState. The inclusion of TrustedHeight and -// TrustedValidators allows this update to process correctly, so long as the -// ConsensusState for the TrustedHeight exists, this removes race conditions -// among relayers The SignedHeader and ValidatorSet are the new untrusted update -// fields for the client. The TrustedHeight is the height of a stored -// ConsensusState on the client that will be used to verify the new untrusted -// header. The Trusted ConsensusState must be within the unbonding period of -// current time in order to correctly verify, and the TrustedValidators must -// hash to TrustedConsensusState.NextValidatorsHash since that is the last -// trusted validator set at the TrustedHeight. -message Header { - .tendermint.types.SignedHeader signed_header = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"signed_header\""]; - - .tendermint.types.ValidatorSet validator_set = 2 [(gogoproto.moretags) = "yaml:\"validator_set\""]; - ibc.core.client.v1.Height trusted_height = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trusted_height\""]; - .tendermint.types.ValidatorSet trusted_validators = 4 [(gogoproto.moretags) = "yaml:\"trusted_validators\""]; -} - -// Fraction defines the protobuf message type for tmmath.Fraction that only -// supports positive values. -message Fraction { - uint64 numerator = 1; - uint64 denominator = 2; -} diff --git a/utils/bank.go b/utils/bank.go index 69dd997bf..5fa307fcb 100644 --- a/utils/bank.go +++ b/utils/bank.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" "github.com/cosmos/cosmos-sdk/types/query" ) diff --git a/utils/dcli/parsers.go b/utils/dcli/parsers.go index 7505304d1..6334dc70a 100644 --- a/utils/dcli/parsers.go +++ b/utils/dcli/parsers.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/pflag" - "github.com/neutron-org/neutron/v4/utils" + "github.com/neutron-org/neutron/v5/utils" ) // Parses arguments 1-1 from args diff --git a/utils/dcli/parsers_test.go b/utils/dcli/parsers_test.go index 3cdd7df25..79451f8f5 100644 --- a/utils/dcli/parsers_test.go +++ b/utils/dcli/parsers_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/utils/dcli" + "github.com/neutron-org/neutron/v5/utils/dcli" ) type testingStruct struct { diff --git a/wasmbinding/bindings/msg.go b/wasmbinding/bindings/msg.go index 03fc3640b..03d1626d4 100644 --- a/wasmbinding/bindings/msg.go +++ b/wasmbinding/bindings/msg.go @@ -7,10 +7,10 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" paramChange "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - icqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - transferwrappertypes "github.com/neutron-org/neutron/v4/x/transfer/types" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + icqtypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" + transferwrappertypes "github.com/neutron-org/neutron/v5/x/transfer/types" ) // ProtobufAny is a hack-struct to serialize protobuf Any message into JSON object @@ -81,6 +81,7 @@ type RegisterInterchainAccount struct { ConnectionId string `json:"connection_id"` InterchainAccountId string `json:"interchain_account_id"` RegisterFee sdk.Coins `json:"register_fee,omitempty"` + Ordering string `json:"ordering,omitempty"` } // RegisterInterchainAccountResponse holds response for RegisterInterchainAccount. @@ -195,9 +196,10 @@ type ForceTransfer struct { // AddSchedule adds new schedule to the cron module type AddSchedule struct { - Name string `json:"name"` - Period uint64 `json:"period"` - Msgs []MsgExecuteContract `json:"msgs"` + Name string `json:"name"` + Period uint64 `json:"period"` + Msgs []MsgExecuteContract `json:"msgs"` + ExecutionStage string `json:"execution_stage"` } // AddScheduleResponse holds response AddSchedule diff --git a/wasmbinding/bindings/query.go b/wasmbinding/bindings/query.go index 88615da60..9b60fe070 100644 --- a/wasmbinding/bindings/query.go +++ b/wasmbinding/bindings/query.go @@ -6,10 +6,10 @@ import ( "cosmossdk.io/math" marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" - contractmanagertypes "github.com/neutron-org/neutron/v4/x/contractmanager/types" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" - feerefundertypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" + feerefundertypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" @@ -18,7 +18,7 @@ import ( oracletypes "github.com/skip-mev/slinky/x/oracle/types" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // NeutronQuery contains neutron custom queries. diff --git a/wasmbinding/custom_querier.go b/wasmbinding/custom_querier.go index 4b37e2157..456918324 100644 --- a/wasmbinding/custom_querier.go +++ b/wasmbinding/custom_querier.go @@ -8,7 +8,7 @@ import ( wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/wasmbinding/bindings" + "github.com/neutron-org/neutron/v5/wasmbinding/bindings" ) // CustomQuerier returns a function that is an implementation of custom querier mechanism for specific messages diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index b24d59826..0f66daadd 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -7,22 +7,24 @@ import ( "strings" "time" + contractmanagerkeeper "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + "github.com/cosmos/gogoproto/proto" "golang.org/x/exp/maps" - dexkeeper "github.com/neutron-org/neutron/v4/x/dex/keeper" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" - dexutils "github.com/neutron-org/neutron/v4/x/dex/utils" - - contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" + dexkeeper "github.com/neutron-org/neutron/v5/x/dex/keeper" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" + dexutils "github.com/neutron-org/neutron/v5/x/dex/utils" "cosmossdk.io/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - crontypes "github.com/neutron-org/neutron/v4/x/cron/types" + crontypes "github.com/neutron-org/neutron/v5/x/cron/types" - cronkeeper "github.com/neutron-org/neutron/v4/x/cron/keeper" + cronkeeper "github.com/neutron-org/neutron/v5/x/cron/keeper" paramChange "github.com/cosmos/cosmos-sdk/x/params/types/proposal" @@ -35,19 +37,21 @@ import ( adminmodulekeeper "github.com/cosmos/admin-module/v2/x/adminmodule/keeper" admintypes "github.com/cosmos/admin-module/v2/x/adminmodule/types" + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" //nolint:staticcheck - "github.com/neutron-org/neutron/v4/wasmbinding/bindings" - icqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - icqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - ictxkeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" - ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" - transferwrapperkeeper "github.com/neutron-org/neutron/v4/x/transfer/keeper" - transferwrappertypes "github.com/neutron-org/neutron/v4/x/transfer/types" + "github.com/neutron-org/neutron/v5/wasmbinding/bindings" + icqkeeper "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + icqtypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" + ictxkeeper "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" + ictxtypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" + transferwrapperkeeper "github.com/neutron-org/neutron/v5/x/transfer/keeper" + transferwrappertypes "github.com/neutron-org/neutron/v5/x/transfer/types" - tokenfactorykeeper "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" - tokenfactorytypes "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + tokenfactorykeeper "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" + tokenfactorytypes "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func CustomMessageDecorator( @@ -63,35 +67,39 @@ func CustomMessageDecorator( ) func(messenger wasmkeeper.Messenger) wasmkeeper.Messenger { return func(old wasmkeeper.Messenger) wasmkeeper.Messenger { return &CustomMessenger{ - Keeper: *ictx, - Wrapped: old, - Ictxmsgserver: ictxkeeper.NewMsgServerImpl(*ictx), - Icqmsgserver: icqkeeper.NewMsgServerImpl(*icq), - transferKeeper: transferKeeper, - Adminserver: adminmodulekeeper.NewMsgServerImpl(*adminKeeper), - Bank: bankKeeper, - TokenFactory: tokenFactoryKeeper, - CronKeeper: cronKeeper, - AdminKeeper: adminKeeper, - ContractmanagerKeeper: contractmanagerKeeper, - DexMsgServer: dexkeeper.NewMsgServerImpl(*dexKeeper), + Keeper: *ictx, + Wrapped: old, + Ictxmsgserver: ictxkeeper.NewMsgServerImpl(*ictx), + Icqmsgserver: icqkeeper.NewMsgServerImpl(*icq), + transferKeeper: transferKeeper, + Adminserver: adminmodulekeeper.NewMsgServerImpl(*adminKeeper), + Bank: bankKeeper, + TokenFactory: tokenFactoryKeeper, + CronMsgServer: cronkeeper.NewMsgServerImpl(*cronKeeper), + CronQueryServer: cronKeeper, + AdminKeeper: adminKeeper, + ContractmanagerMsgServer: contractmanagerkeeper.NewMsgServerImpl(*contractmanagerKeeper), + ContractmanagerQueryServer: contractmanagerkeeper.NewQueryServerImpl(*contractmanagerKeeper), + DexMsgServer: dexkeeper.NewMsgServerImpl(*dexKeeper), } } } type CustomMessenger struct { - Keeper ictxkeeper.Keeper - Wrapped wasmkeeper.Messenger - Ictxmsgserver ictxtypes.MsgServer - Icqmsgserver icqtypes.MsgServer - transferKeeper transferwrapperkeeper.KeeperTransferWrapper - Adminserver admintypes.MsgServer - Bank *bankkeeper.BaseKeeper - TokenFactory *tokenfactorykeeper.Keeper - CronKeeper *cronkeeper.Keeper - AdminKeeper *adminmodulekeeper.Keeper - ContractmanagerKeeper *contractmanagerkeeper.Keeper - DexMsgServer dextypes.MsgServer + Keeper ictxkeeper.Keeper + Wrapped wasmkeeper.Messenger + Ictxmsgserver ictxtypes.MsgServer + Icqmsgserver icqtypes.MsgServer + transferKeeper transferwrapperkeeper.KeeperTransferWrapper + Adminserver admintypes.MsgServer + Bank *bankkeeper.BaseKeeper + TokenFactory *tokenfactorykeeper.Keeper + CronMsgServer crontypes.MsgServer + CronQueryServer crontypes.QueryServer + AdminKeeper *adminmodulekeeper.Keeper + ContractmanagerMsgServer contractmanagertypes.MsgServer + ContractmanagerQueryServer contractmanagertypes.QueryServer + DexMsgServer dextypes.MsgServer } var _ wasmkeeper.Messenger = (*CustomMessenger)(nil) @@ -756,12 +764,8 @@ func (m *CustomMessenger) burnTokens(ctx sdk.Context, contractAddr sdk.AccAddres // PerformBurn performs token burning after validating tokenBurn message. func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, burn *bindings.BurnTokens) error { - if burn.BurnFromAddress != "" && burn.BurnFromAddress != contractAddr.String() { - return wasmvmtypes.InvalidRequest{Err: "BurnFromAddress must be \"\""} - } - coin := sdk.Coin{Denom: burn.Denom, Amount: burn.Amount} - sdkMsg := tokenfactorytypes.NewMsgBurn(contractAddr.String(), coin) + sdkMsg := tokenfactorytypes.NewMsgBurnFrom(contractAddr.String(), coin, burn.BurnFromAddress) // Burn through token factory / message server msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) @@ -865,11 +869,25 @@ func (m *CustomMessenger) registerInterchainAccount(ctx sdk.Context, contractAdd } func (m *CustomMessenger) performRegisterInterchainAccount(ctx sdk.Context, contractAddr sdk.AccAddress, reg *bindings.RegisterInterchainAccount) (*ictxtypes.MsgRegisterInterchainAccountResponse, error) { + // parse incoming ordering. If nothing passed, use ORDERED by default + var orderValue channeltypes.Order + if reg.Ordering == "" { + orderValue = channeltypes.ORDERED + } else { + orderValueInt, ok := channeltypes.Order_value[reg.Ordering] + + if !ok { + return nil, fmt.Errorf("failed to register interchain account: incorrect order value passed: %s", reg.Ordering) + } + orderValue = channeltypes.Order(orderValueInt) + } + msg := ictxtypes.MsgRegisterInterchainAccount{ FromAddress: contractAddr.String(), ConnectionId: reg.ConnectionId, InterchainAccountId: reg.InterchainAccountId, RegisterFee: getRegisterFee(reg.RegisterFee), + Ordering: orderValue, } response, err := m.Ictxmsgserver.RegisterInterchainAccount(ctx, &msg) @@ -977,6 +995,8 @@ func (m *CustomMessenger) addSchedule(ctx sdk.Context, contractAddr sdk.AccAddre return nil, nil, nil, errors.Wrap(sdkerrors.ErrUnauthorized, "only admin can add schedule") } + authority := authtypes.NewModuleAddress(admintypes.ModuleName) + msgs := make([]crontypes.MsgExecuteContract, 0, len(addSchedule.Msgs)) for _, msg := range addSchedule.Msgs { msgs = append(msgs, crontypes.MsgExecuteContract{ @@ -985,13 +1005,20 @@ func (m *CustomMessenger) addSchedule(ctx sdk.Context, contractAddr sdk.AccAddre }) } - err := m.CronKeeper.AddSchedule(ctx, addSchedule.Name, addSchedule.Period, msgs) + _, err := m.CronMsgServer.AddSchedule(ctx, &crontypes.MsgAddSchedule{ + Authority: authority.String(), + Name: addSchedule.Name, + Period: addSchedule.Period, + Msgs: msgs, + ExecutionStage: crontypes.ExecutionStage(crontypes.ExecutionStage_value[addSchedule.ExecutionStage]), + }) if err != nil { ctx.Logger().Error("failed to addSchedule", "from_address", contractAddr.String(), + "name", addSchedule.Name, "error", err, ) - return nil, nil, nil, errors.Wrap(err, "marshal json failed") + return nil, nil, nil, errors.Wrapf(err, "failed to add %s schedule", addSchedule.Name) } ctx.Logger().Debug("schedule added", @@ -1004,12 +1031,30 @@ func (m *CustomMessenger) addSchedule(ctx sdk.Context, contractAddr sdk.AccAddre } func (m *CustomMessenger) removeSchedule(ctx sdk.Context, contractAddr sdk.AccAddress, removeSchedule *bindings.RemoveSchedule) ([]sdk.Event, [][]byte, [][]*types.Any, error) { - params := m.CronKeeper.GetParams(ctx) - if !m.isAdmin(ctx, contractAddr) && contractAddr.String() != params.SecurityAddress { + params, err := m.CronQueryServer.Params(ctx, &crontypes.QueryParamsRequest{}) + if err != nil { + ctx.Logger().Error("failed to removeSchedule", "error", err) + return nil, nil, nil, errors.Wrap(err, "failed to removeSchedule") + } + + if !m.isAdmin(ctx, contractAddr) && contractAddr.String() != params.Params.SecurityAddress { return nil, nil, nil, errors.Wrap(sdkerrors.ErrUnauthorized, "only admin or security dao can remove schedule") } - m.CronKeeper.RemoveSchedule(ctx, removeSchedule.Name) + authority := authtypes.NewModuleAddress(admintypes.ModuleName) + + _, err = m.CronMsgServer.RemoveSchedule(ctx, &crontypes.MsgRemoveSchedule{ + Authority: authority.String(), + Name: removeSchedule.Name, + }) + if err != nil { + ctx.Logger().Error("failed to removeSchedule", + "from_address", contractAddr.String(), + "name", removeSchedule.Name, + "error", err, + ) + return nil, nil, nil, errors.Wrapf(err, "failed to remove %s schedule", removeSchedule.Name) + } ctx.Logger().Debug("schedule removed", "from_address", contractAddr.String(), @@ -1019,12 +1064,18 @@ func (m *CustomMessenger) removeSchedule(ctx sdk.Context, contractAddr sdk.AccAd } func (m *CustomMessenger) resubmitFailure(ctx sdk.Context, contractAddr sdk.AccAddress, resubmitFailure *bindings.ResubmitFailure) ([]sdk.Event, [][]byte, [][]*types.Any, error) { - failure, err := m.ContractmanagerKeeper.GetFailure(ctx, contractAddr, resubmitFailure.FailureId) + failure, err := m.ContractmanagerQueryServer.AddressFailure(ctx, &contractmanagertypes.QueryFailureRequest{ + Address: contractAddr.String(), + FailureId: resubmitFailure.FailureId, + }) if err != nil { - return nil, nil, nil, errors.Wrap(sdkerrors.ErrNotFound, "no failure found to resubmit") + return nil, nil, nil, errors.Wrapf(err, "no failure with given FailureId found to resubmit") } - err = m.ContractmanagerKeeper.ResubmitFailure(ctx, contractAddr, failure) + _, err = m.ContractmanagerMsgServer.ResubmitFailure(ctx, &contractmanagertypes.MsgResubmitFailure{ + Sender: contractAddr.String(), + FailureId: resubmitFailure.FailureId, + }) if err != nil { ctx.Logger().Error("failed to resubmitFailure", "from_address", contractAddr.String(), @@ -1033,7 +1084,7 @@ func (m *CustomMessenger) resubmitFailure(ctx sdk.Context, contractAddr sdk.AccA return nil, nil, nil, errors.Wrap(err, "failed to resubmitFailure") } - resp := bindings.ResubmitFailureResponse{FailureId: failure.Id} + resp := bindings.ResubmitFailureResponse{FailureId: resubmitFailure.FailureId} data, err := json.Marshal(&resp) if err != nil { ctx.Logger().Error("json.Marshal: failed to marshal remove resubmitFailure response to JSON", @@ -1043,6 +1094,8 @@ func (m *CustomMessenger) resubmitFailure(ctx sdk.Context, contractAddr sdk.AccA return nil, nil, nil, errors.Wrap(err, "marshal json failed") } + // Return failure for reverse compatibility purposes. + // Maybe it'll be removed in the future because it was already deleted after resubmit before returning here. anyResp, err := types.NewAnyWithValue(failure) if err != nil { return nil, nil, nil, errors.Wrapf(err, "failed to convert {%T} to Any", failure) diff --git a/wasmbinding/queries.go b/wasmbinding/queries.go index 39b602658..9dcee9b2e 100644 --- a/wasmbinding/queries.go +++ b/wasmbinding/queries.go @@ -15,16 +15,16 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkquery "github.com/cosmos/cosmos-sdk/types/query" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" - contractmanagertypes "github.com/neutron-org/neutron/v4/x/contractmanager/types" + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper" - "github.com/neutron-org/neutron/v4/wasmbinding/bindings" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - icatypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/wasmbinding/bindings" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" + icatypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func (qp *QueryPlugin) GetInterchainQueryResult(ctx sdk.Context, queryID uint64) (*bindings.QueryRegisteredQueryResultResponse, error) { @@ -129,7 +129,7 @@ func (qp *QueryPlugin) GetMinIbcFee(ctx sdk.Context, _ *bindings.QueryMinIbcFeeR } func (qp *QueryPlugin) GetFailures(ctx sdk.Context, address string, pagination *sdkquery.PageRequest) (*bindings.FailuresResponse, error) { - res, err := qp.contractmanagerKeeper.AddressFailures(ctx, &contractmanagertypes.QueryFailuresRequest{ + res, err := qp.contractmanagerQueryServer.AddressFailures(ctx, &contractmanagertypes.QueryFailuresRequest{ Address: address, Pagination: pagination, }) @@ -201,7 +201,6 @@ func (qp *QueryPlugin) DexQuery(ctx sdk.Context, query bindings.DexQuery) (data data, err = dexQuery(ctx, query.TickLiquidityAll, qp.dexKeeper.TickLiquidityAll) case query.UserDepositsAll != nil: data, err = dexQuery(ctx, query.UserDepositsAll, qp.dexKeeper.UserDepositsAll) - default: return nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown neutron.dex query type"} } diff --git a/wasmbinding/query_plugin.go b/wasmbinding/query_plugin.go index d4735a36c..e8fc4794a 100644 --- a/wasmbinding/query_plugin.go +++ b/wasmbinding/query_plugin.go @@ -1,42 +1,43 @@ package wasmbinding import ( - contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - dexkeeper "github.com/neutron-org/neutron/v4/x/dex/keeper" - feeburnerkeeper "github.com/neutron-org/neutron/v4/x/feeburner/keeper" - feerefunderkeeper "github.com/neutron-org/neutron/v4/x/feerefunder/keeper" - icqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - icacontrollerkeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" + contractmanagerkeeper "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" + dexkeeper "github.com/neutron-org/neutron/v5/x/dex/keeper" + feeburnerkeeper "github.com/neutron-org/neutron/v5/x/feeburner/keeper" + feerefunderkeeper "github.com/neutron-org/neutron/v5/x/feerefunder/keeper" + icqkeeper "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + icacontrollerkeeper "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" - tokenfactorykeeper "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" + tokenfactorykeeper "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper" ) type QueryPlugin struct { - icaControllerKeeper *icacontrollerkeeper.Keeper - icqKeeper *icqkeeper.Keeper - feeBurnerKeeper *feeburnerkeeper.Keeper - feeRefunderKeeper *feerefunderkeeper.Keeper - tokenFactoryKeeper *tokenfactorykeeper.Keeper - contractmanagerKeeper *contractmanagerkeeper.Keeper - dexKeeper *dexkeeper.Keeper - oracleKeeper *oraclekeeper.Keeper - marketmapKeeper *marketmapkeeper.Keeper + icaControllerKeeper *icacontrollerkeeper.Keeper + icqKeeper *icqkeeper.Keeper + feeBurnerKeeper *feeburnerkeeper.Keeper + feeRefunderKeeper *feerefunderkeeper.Keeper + tokenFactoryKeeper *tokenfactorykeeper.Keeper + contractmanagerQueryServer contractmanagertypes.QueryServer + dexKeeper *dexkeeper.Keeper + oracleKeeper *oraclekeeper.Keeper + marketmapKeeper *marketmapkeeper.Keeper } // NewQueryPlugin returns a reference to a new QueryPlugin. func NewQueryPlugin(icaControllerKeeper *icacontrollerkeeper.Keeper, icqKeeper *icqkeeper.Keeper, feeBurnerKeeper *feeburnerkeeper.Keeper, feeRefunderKeeper *feerefunderkeeper.Keeper, tfk *tokenfactorykeeper.Keeper, contractmanagerKeeper *contractmanagerkeeper.Keeper, dexKeeper *dexkeeper.Keeper, oracleKeeper *oraclekeeper.Keeper, marketmapKeeper *marketmapkeeper.Keeper) *QueryPlugin { return &QueryPlugin{ - icaControllerKeeper: icaControllerKeeper, - icqKeeper: icqKeeper, - feeBurnerKeeper: feeBurnerKeeper, - feeRefunderKeeper: feeRefunderKeeper, - tokenFactoryKeeper: tfk, - contractmanagerKeeper: contractmanagerKeeper, - dexKeeper: dexKeeper, - oracleKeeper: oracleKeeper, - marketmapKeeper: marketmapKeeper, + icaControllerKeeper: icaControllerKeeper, + icqKeeper: icqKeeper, + feeBurnerKeeper: feeBurnerKeeper, + feeRefunderKeeper: feeRefunderKeeper, + tokenFactoryKeeper: tfk, + contractmanagerQueryServer: contractmanagerkeeper.NewQueryServerImpl(*contractmanagerKeeper), + dexKeeper: dexKeeper, + oracleKeeper: oracleKeeper, + marketmapKeeper: marketmapKeeper, } } diff --git a/wasmbinding/stargate_allowlist.go b/wasmbinding/stargate_allowlist.go index d94bf26ae..0f7c18f31 100644 --- a/wasmbinding/stargate_allowlist.go +++ b/wasmbinding/stargate_allowlist.go @@ -13,14 +13,14 @@ import ( marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" oracletypes "github.com/skip-mev/slinky/x/oracle/types" - dynamicfeestypes "github.com/neutron-org/neutron/v4/x/dynamicfees/types" - - crontypes "github.com/neutron-org/neutron/v4/x/cron/types" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" - feeburnertypes "github.com/neutron-org/neutron/v4/x/feeburner/types" - interchainqueriestypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - interchaintxstypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" - tokenfactorytypes "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + dynamicfeestypes "github.com/neutron-org/neutron/v5/x/dynamicfees/types" + + crontypes "github.com/neutron-org/neutron/v5/x/cron/types" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" + feeburnertypes "github.com/neutron-org/neutron/v5/x/feeburner/types" + interchainqueriestypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" + interchaintxstypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" + tokenfactorytypes "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func AcceptedStargateQueries() wasmkeeper.AcceptedQueries { @@ -36,12 +36,14 @@ func AcceptedStargateQueries() wasmkeeper.AcceptedQueries { "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata": &tokenfactorytypes.QueryDenomAuthorityMetadataResponse{}, "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator": &tokenfactorytypes.QueryDenomsFromCreatorResponse{}, "/osmosis.tokenfactory.v1beta1.Query/BeforeSendHookAddress": &tokenfactorytypes.QueryBeforeSendHookAddressResponse{}, + "/osmosis.tokenfactory.v1beta1.Query/FullDenom": &tokenfactorytypes.QueryFullDenomResponse{}, // interchain accounts "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount": &icacontrollertypes.QueryInterchainAccountResponse{}, // transfer - "/ibc.applications.transfer.v1.Query/DenomTrace": &ibctransfertypes.QueryDenomTraceResponse{}, + "/ibc.applications.transfer.v1.Query/DenomTrace": &ibctransfertypes.QueryDenomTraceResponse{}, + "/ibc.applications.transfer.v1.Query/EscrowAddress": &ibctransfertypes.QueryEscrowAddressResponse{}, // auth "/cosmos.auth.v1beta1.Query/Account": &authtypes.QueryAccountResponse{}, @@ -90,6 +92,12 @@ func AcceptedStargateQueries() wasmkeeper.AcceptedQueries { "/neutron.dex.Query/PoolByID": &dextypes.QueryPoolResponse{}, "/neutron.dex.Query/PoolMetadata": &dextypes.QueryGetPoolMetadataResponse{}, "/neutron.dex.Query/PoolMetadataAll": &dextypes.QueryAllPoolMetadataResponse{}, + "/neutron.dex.Query/SimulateDeposit": &dextypes.QuerySimulateDepositResponse{}, + "/neutron.dex.Query/SimulateWithdrawal": &dextypes.QuerySimulateWithdrawalResponse{}, + "/neutron.dex.Query/SimulatePlaceLimitOrder": &dextypes.QuerySimulatePlaceLimitOrderResponse{}, + "/neutron.dex.Query/SimulateWithdrawFilledLimitOrder": &dextypes.QuerySimulateWithdrawFilledLimitOrderResponse{}, + "/neutron.dex.Query/SimulateCancelLimitOrder": &dextypes.QuerySimulateCancelLimitOrderResponse{}, + "/neutron.dex.Query/SimulateMultiHopSwap": &dextypes.QuerySimulateMultiHopSwapResponse{}, // oracle "/slinky.oracle.v1.Query/GetAllCurrencyPairs": &oracletypes.GetAllCurrencyPairsResponse{}, @@ -100,6 +108,7 @@ func AcceptedStargateQueries() wasmkeeper.AcceptedQueries { "/slinky.marketmap.v1.Query/MarketMap": &marketmaptypes.MarketMapResponse{}, "/slinky.marketmap.v1.Query/LastUpdated": &marketmaptypes.LastUpdatedResponse{}, "/slinky.marketmap.v1.Query/Params": &marketmaptypes.ParamsResponse{}, + "/slinky.marketmap.v1.Query/Market": &marketmaptypes.MarketResponse{}, // feemarket "feemarket.feemarket.v1.Query/Params": &feemarkettypes.ParamsResponse{}, diff --git a/wasmbinding/test/custom_message_test.go b/wasmbinding/test/custom_message_test.go index 760417c16..457e63163 100644 --- a/wasmbinding/test/custom_message_test.go +++ b/wasmbinding/test/custom_message_test.go @@ -5,23 +5,29 @@ import ( "fmt" "testing" + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" + types2 "github.com/neutron-org/neutron/v5/x/cron/types" + "cosmossdk.io/math" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" admintypes "github.com/cosmos/admin-module/v2/x/adminmodule/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - keeper2 "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - feeburnertypes "github.com/neutron-org/neutron/v4/x/feeburner/types" + feeburnertypes "github.com/neutron-org/neutron/v5/x/feeburner/types" ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" "github.com/stretchr/testify/suite" - ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + ictxtypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" adminkeeper "github.com/cosmos/admin-module/v2/x/adminmodule/keeper" - "github.com/neutron-org/neutron/v4/app/params" + cronkeeper "github.com/neutron-org/neutron/v5/x/cron/keeper" + + contractmanagerkeeper "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + + "github.com/neutron-org/neutron/v5/app/params" "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/CosmWasm/wasmvm/v2/types" @@ -30,16 +36,16 @@ import ( ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/wasmbinding" - "github.com/neutron-org/neutron/v4/wasmbinding/bindings" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - icqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - icqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - ictxkeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" + "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/wasmbinding" + "github.com/neutron-org/neutron/v5/wasmbinding/bindings" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + icqkeeper "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + icqtypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" + ictxkeeper "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" - tokenfactorytypes "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + tokenfactorytypes "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) const FeeCollectorAddress = "neutron1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfsd2rhm7" @@ -65,15 +71,17 @@ func (suite *CustomMessengerTestSuite) SetupTest() { suite.messenger.Adminserver = adminkeeper.NewMsgServerImpl(suite.neutron.AdminmoduleKeeper) suite.messenger.Bank = &suite.neutron.BankKeeper suite.messenger.TokenFactory = suite.neutron.TokenFactoryKeeper - suite.messenger.CronKeeper = &suite.neutron.CronKeeper + suite.messenger.CronMsgServer = cronkeeper.NewMsgServerImpl(suite.neutron.CronKeeper) + suite.messenger.CronQueryServer = suite.neutron.CronKeeper suite.messenger.AdminKeeper = &suite.neutron.AdminmoduleKeeper - suite.messenger.ContractmanagerKeeper = &suite.neutron.ContractManagerKeeper + suite.messenger.ContractmanagerMsgServer = contractmanagerkeeper.NewMsgServerImpl(suite.neutron.ContractManagerKeeper) + suite.messenger.ContractmanagerQueryServer = contractmanagerkeeper.NewQueryServerImpl(suite.neutron.ContractManagerKeeper) suite.contractOwner = keeper.RandomAccountAddress(suite.T()) suite.contractKeeper = keeper.NewDefaultPermissionKeeper(&suite.neutron.WasmKeeper) err := suite.messenger.TokenFactory.SetParams(suite.ctx, tokenfactorytypes.NewParams( - sdk.NewCoins(sdk.NewInt64Coin(params.DefaultDenom, 10_000_000)), + sdk.NewCoins(sdk.NewInt64Coin(params.DefaultDenom, 100)), 0, FeeCollectorAddress, tokenfactorytypes.DefaultWhitelistedHooks, @@ -102,13 +110,23 @@ func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccount() { } bankKeeper := suite.neutron.BankKeeper + channelKeeper := suite.neutron.IBCKeeper.ChannelKeeper senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000)))) suite.NoError(err) // Dispatch RegisterInterchainAccount message - _, err = suite.executeNeutronMsg(suite.contractAddress, msg) + data, err := suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) + suite.NotEmpty(data) + + // default method should be ordered + var response ictxtypes.MsgRegisterInterchainAccountResponse + err = response.Unmarshal(data) + suite.NoError(err) + channel, found := channelKeeper.GetChannel(suite.ctx, response.PortId, response.ChannelId) + suite.True(found) + suite.Equal(channel.Ordering, ibcchanneltypes.ORDERED) } func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { @@ -130,6 +148,43 @@ func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { suite.ErrorIs(err, ictxtypes.ErrLongInterchainAccountID) } +func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountUnordered() { + err := suite.neutron.FeeBurnerKeeper.SetParams(suite.ctx, feeburnertypes.Params{ + NeutronDenom: "untrn", + TreasuryAddress: "neutron13jrwrtsyjjuynlug65r76r2zvfw5xjcq6532h2", + }) + suite.Require().NoError(err) + + // Craft RegisterInterchainAccount message + msg := bindings.NeutronMsg{ + RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ + ConnectionId: suite.Path.EndpointA.ConnectionID, + InterchainAccountId: testutil.TestInterchainID, + RegisterFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000))), + Ordering: ibcchanneltypes.Order_name[int32(ibcchanneltypes.UNORDERED)], + }, + } + + bankKeeper := suite.neutron.BankKeeper + channelKeeper := suite.neutron.IBCKeeper.ChannelKeeper + senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() + err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000)))) + suite.NoError(err) + + // Dispatch RegisterInterchainAccount message + data, err := suite.executeNeutronMsg(suite.contractAddress, msg) + suite.NoError(err) + suite.NotEmpty(data) + + // default method should be ordered + var response ictxtypes.MsgRegisterInterchainAccountResponse + err = response.Unmarshal(data) + suite.NoError(err) + channel, found := channelKeeper.GetChannel(suite.ctx, response.PortId, response.ChannelId) + suite.True(found) + suite.Equal(channel.Ordering, ibcchanneltypes.UNORDERED) +} + func (suite *CustomMessengerTestSuite) TestRegisterInterchainQuery() { err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) suite.Require().NoError(err) @@ -496,7 +551,7 @@ func (suite *CustomMessengerTestSuite) TestSubmitTx() { suite.NoError(err) var response ictxtypes.MsgSubmitTxResponse - err = json.Unmarshal(data, &response) + err = response.Unmarshal(data) suite.NoError(err) suite.Equal(uint64(1), response.SequenceId) suite.Equal("channel-2", response.Channel) @@ -547,11 +602,10 @@ func (suite *CustomMessengerTestSuite) TestSoftwareUpgradeProposal() { data, err := suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) - expected, err := json.Marshal(&admintypes.MsgSubmitProposalResponse{ - ProposalId: 1, - }) + var expected admintypes.MsgSubmitProposalResponse + err = expected.Unmarshal(data) suite.NoError(err) - suite.Equal(expected, data) + suite.Equal(expected.ProposalId, uint64(1)) // Test with other proposer that is not admin should return failure _, err = suite.executeNeutronMsg(anotherContract, msg) @@ -576,11 +630,10 @@ func (suite *CustomMessengerTestSuite) TestSoftwareUpgradeProposal() { data, err = suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) - expected, err = json.Marshal(&admintypes.MsgSubmitProposalResponse{ - ProposalId: 2, - }) + var expected2 admintypes.MsgSubmitProposalResponse + err = expected2.Unmarshal(data) suite.NoError(err) - suite.Equal(expected, data) + suite.Equal(expected2.ProposalId, uint64(2)) } func (suite *CustomMessengerTestSuite) TestTooMuchProposals() { @@ -671,6 +724,10 @@ func (suite *CustomMessengerTestSuite) TestAddRemoveSchedule() { }, } + schedule, ok := suite.neutron.CronKeeper.GetSchedule(suite.ctx, "schedule1") + suite.True(ok) + suite.Equal(types2.ExecutionStage_EXECUTION_STAGE_END_BLOCKER, schedule.ExecutionStage) + // Dispatch AddSchedule message _, err = suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) @@ -682,10 +739,11 @@ func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { ack := ibcchanneltypes.Acknowledgement{ Response: &ibcchanneltypes.Acknowledgement_Result{Result: []byte("Result")}, } - payload, err := keeper2.PrepareSudoCallbackMessage(packet, &ack) + payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) require.NoError(suite.T(), err) - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") + + failureID := suite.neutron.ContractManagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) + suite.neutron.ContractManagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") // Craft message msg := bindings.NeutronMsg{ @@ -698,18 +756,20 @@ func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { data, err := suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) - expected, err := json.Marshal(&bindings.ResubmitFailureResponse{}) + var expected contractmanagertypes.Failure + err = expected.Unmarshal(data) suite.NoError(err) - suite.Equal(expected, data) + suite.Equal(expected.Id, failureID) } func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { // Add failure packet := ibcchanneltypes.Packet{} - payload, err := keeper2.PrepareSudoCallbackMessage(packet, nil) + payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, nil) require.NoError(suite.T(), err) - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") + + failureID := suite.neutron.ContractManagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) + suite.neutron.ContractManagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") // Craft message msg := bindings.NeutronMsg{ @@ -722,9 +782,10 @@ func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { data, err := suite.executeNeutronMsg(suite.contractAddress, msg) suite.NoError(err) - expected, err := json.Marshal(&bindings.ResubmitFailureResponse{FailureId: failureID}) + var expected contractmanagertypes.Failure + err = expected.Unmarshal(data) suite.NoError(err) - suite.Equal(expected, data) + suite.Equal(expected.Id, failureID) } func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract() { @@ -733,10 +794,10 @@ func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract( ack := ibcchanneltypes.Acknowledgement{ Response: &ibcchanneltypes.Acknowledgement_Error{Error: "ErrorSudoPayload"}, } - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, testutil.TestOwnerAddress) - payload, err := keeper2.PrepareSudoCallbackMessage(packet, &ack) + failureID := suite.neutron.ContractManagerKeeper.GetNextFailureIDKey(suite.ctx, testutil.TestOwnerAddress) + payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) require.NoError(suite.T(), err) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, testutil.TestOwnerAddress, payload, "test error") + suite.neutron.ContractManagerKeeper.AddContractFailure(suite.ctx, testutil.TestOwnerAddress, payload, "test error") // Craft message msg := bindings.NeutronMsg{ @@ -747,7 +808,7 @@ func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract( // Dispatch _, err = suite.executeNeutronMsg(suite.contractAddress, msg) - suite.ErrorContains(err, "no failure found to resubmit: not found") + suite.ErrorContains(err, "no failure with given FailureId found to resubmit") } func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccAddress, fullMsg json.RawMessage) (data []byte, err error) { @@ -755,6 +816,10 @@ func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccA Custom: fullMsg, } + return suite.executeMsg(contractAddress, customMsg) +} + +func (suite *CustomMessengerTestSuite) executeMsg(contractAddress sdk.AccAddress, fullMsg types.CosmosMsg) (data []byte, err error) { type ExecuteMsg struct { ReflectMsg struct { Msgs []types.CosmosMsg `json:"msgs"` @@ -763,7 +828,7 @@ func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccA execMsg := ExecuteMsg{ReflectMsg: struct { Msgs []types.CosmosMsg `json:"msgs"` - }(struct{ Msgs []types.CosmosMsg }{Msgs: []types.CosmosMsg{customMsg}})} + }(struct{ Msgs []types.CosmosMsg }{Msgs: []types.CosmosMsg{fullMsg}})} msg, err := json.Marshal(execMsg) suite.NoError(err) diff --git a/wasmbinding/test/custom_query_test.go b/wasmbinding/test/custom_query_test.go index 99e5442e4..5d52a5fa1 100644 --- a/wasmbinding/test/custom_query_test.go +++ b/wasmbinding/test/custom_query_test.go @@ -8,9 +8,9 @@ import ( "cosmossdk.io/math" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/app/params" - feerefundertypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - tokenfactorytypes "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/app/params" + feerefundertypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + tokenfactorytypes "github.com/neutron-org/neutron/v5/x/tokenfactory/types" "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" @@ -19,11 +19,11 @@ import ( host "github.com/cosmos/ibc-go/v8/modules/core/24-host" ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/wasmbinding/bindings" - icqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/wasmbinding/bindings" + icqtypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" + ictxtypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) type CustomQuerierTestSuite struct { diff --git a/wasmbinding/testdata/reflect.wasm b/wasmbinding/testdata/reflect.wasm index 174232f4b..808c6572b 100644 Binary files a/wasmbinding/testdata/reflect.wasm and b/wasmbinding/testdata/reflect.wasm differ diff --git a/wasmbinding/wasm.go b/wasmbinding/wasm.go index 63559cfa1..2752118e4 100644 --- a/wasmbinding/wasm.go +++ b/wasmbinding/wasm.go @@ -4,21 +4,21 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - cronkeeper "github.com/neutron-org/neutron/v4/x/cron/keeper" - dexkeeper "github.com/neutron-org/neutron/v4/x/dex/keeper" - feeburnerkeeper "github.com/neutron-org/neutron/v4/x/feeburner/keeper" - feerefunderkeeper "github.com/neutron-org/neutron/v4/x/feerefunder/keeper" + contractmanagerkeeper "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + cronkeeper "github.com/neutron-org/neutron/v5/x/cron/keeper" + dexkeeper "github.com/neutron-org/neutron/v5/x/dex/keeper" + feeburnerkeeper "github.com/neutron-org/neutron/v5/x/feeburner/keeper" + feerefunderkeeper "github.com/neutron-org/neutron/v5/x/feerefunder/keeper" adminmodulekeeper "github.com/cosmos/admin-module/v2/x/adminmodule/keeper" marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper" - interchainqueriesmodulekeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - interchaintransactionsmodulekeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" - tokenfactorykeeper "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" - transfer "github.com/neutron-org/neutron/v4/x/transfer/keeper" + interchainqueriesmodulekeeper "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + interchaintransactionsmodulekeeper "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" + tokenfactorykeeper "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" + transfer "github.com/neutron-org/neutron/v5/x/transfer/keeper" ) // RegisterCustomPlugins returns wasmkeeper.Option that we can use to connect handlers for implemented custom queries and messages to the App diff --git a/x/contractmanager/client/cli/query.go b/x/contractmanager/client/cli/query.go index 7771015c6..7d9187cea 100644 --- a/x/contractmanager/client/cli/query.go +++ b/x/contractmanager/client/cli/query.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/contractmanager/client/cli/query_failure.go b/x/contractmanager/client/cli/query_failure.go index 9c320ece8..d990b4290 100644 --- a/x/contractmanager/client/cli/query_failure.go +++ b/x/contractmanager/client/cli/query_failure.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/spf13/cobra" - contractmanagertypes "github.com/neutron-org/neutron/v4/x/contractmanager/types" + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func CmdFailures() *cobra.Command { @@ -78,7 +78,7 @@ func CmdFailureDetails() *cobra.Command { queryClient := contractmanagertypes.NewQueryClient(clientCtx) if _, err = queryClient.AddressFailure( cmd.Context(), - &contractmanagertypes.QueryFailuresRequest{Address: address, FailureId: failureID}, + &contractmanagertypes.QueryFailureRequest{Address: address, FailureId: failureID}, ); err != nil { return err } diff --git a/x/contractmanager/client/cli/query_failure_test.go b/x/contractmanager/client/cli/query_failure_test.go index 7d1b94b74..b95e87ff6 100644 --- a/x/contractmanager/client/cli/query_failure_test.go +++ b/x/contractmanager/client/cli/query_failure_test.go @@ -6,9 +6,9 @@ import ( "strconv" "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" tmcli "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/client/flags" @@ -20,9 +20,9 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/testutil/contractmanager/network" - "github.com/neutron-org/neutron/v4/x/contractmanager/client/cli" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/testutil/contractmanager/network" + "github.com/neutron-org/neutron/v5/x/contractmanager/client/cli" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func networkWithFailureObjects(t *testing.T, n int) (*network.Network, []types.Failure) { diff --git a/x/contractmanager/client/cli/query_params.go b/x/contractmanager/client/cli/query_params.go index 04d930c1e..75b4bac5c 100644 --- a/x/contractmanager/client/cli/query_params.go +++ b/x/contractmanager/client/cli/query_params.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/contractmanager/genesis.go b/x/contractmanager/genesis.go index 14b43d835..73122a8ba 100644 --- a/x/contractmanager/genesis.go +++ b/x/contractmanager/genesis.go @@ -3,8 +3,8 @@ package contractmanager import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) // InitGenesis initializes the module's state from a provided genesis state. diff --git a/x/contractmanager/genesis_test.go b/x/contractmanager/genesis_test.go index 449f43d9b..f383b7ae0 100644 --- a/x/contractmanager/genesis_test.go +++ b/x/contractmanager/genesis_test.go @@ -3,17 +3,17 @@ package contractmanager_test import ( "testing" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" "github.com/stretchr/testify/require" - keepertest "github.com/neutron-org/neutron/v4/testutil/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + keepertest "github.com/neutron-org/neutron/v5/testutil/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func TestGenesis(t *testing.T) { diff --git a/x/contractmanager/ibc_middleware.go b/x/contractmanager/ibc_middleware.go index 70e51466d..53f9b7bf7 100644 --- a/x/contractmanager/ibc_middleware.go +++ b/x/contractmanager/ibc_middleware.go @@ -9,8 +9,8 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" sdk "github.com/cosmos/cosmos-sdk/types" - contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - contractmanagertypes "github.com/neutron-org/neutron/v4/x/contractmanager/types" + contractmanagerkeeper "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) type SudoLimitWrapper struct { diff --git a/x/contractmanager/ibc_middleware_test.go b/x/contractmanager/ibc_middleware_test.go index ea95a8b46..2cf1ad8b1 100644 --- a/x/contractmanager/ibc_middleware_test.go +++ b/x/contractmanager/ibc_middleware_test.go @@ -9,10 +9,10 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - test_keeper "github.com/neutron-org/neutron/v4/testutil/interchaintxs/keeper" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/contractmanager/types" - contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + test_keeper "github.com/neutron-org/neutron/v5/testutil/interchaintxs/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/contractmanager/types" + contractmanagerkeeper "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) var ( diff --git a/x/contractmanager/keeper/failure.go b/x/contractmanager/keeper/failure.go index 5ffe886b1..c41eadf5e 100644 --- a/x/contractmanager/keeper/failure.go +++ b/x/contractmanager/keeper/failure.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) // AddContractFailure adds a specific failure to the store. The provided address is used to determine @@ -88,8 +88,9 @@ func (k Keeper) GetFailure(ctx sdk.Context, contractAddr sdk.AccAddress, id uint return &res, nil } -// ResubmitFailure tries to call sudo handler for contract with same parameters as initially. -func (k Keeper) ResubmitFailure(ctx sdk.Context, contractAddr sdk.AccAddress, failure *types.Failure) error { +// resubmitFailure tries to call sudo handler for contract with same parameters as initially. +// if successful, removes the failure from storage +func (k Keeper) resubmitFailure(ctx sdk.Context, contractAddr sdk.AccAddress, failure *types.Failure) error { if failure.SudoPayload == nil { return errorsmod.Wrapf(types.ErrIncorrectFailureToResubmit, "cannot resubmit failure without sudo payload; failureId = %d", failure.Id) } diff --git a/x/contractmanager/keeper/failure_test.go b/x/contractmanager/keeper/failure_test.go index 8e3a62ff8..800f0fc7b 100644 --- a/x/contractmanager/keeper/failure_test.go +++ b/x/contractmanager/keeper/failure_test.go @@ -7,12 +7,12 @@ import ( "strconv" "testing" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" "github.com/golang/mock/gomock" - "github.com/neutron-org/neutron/v4/testutil" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/contractmanager/types" + "github.com/neutron-org/neutron/v5/testutil" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/contractmanager/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" @@ -20,9 +20,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - keepertest "github.com/neutron-org/neutron/v4/testutil/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + keepertest "github.com/neutron-org/neutron/v5/testutil/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) // Prevent strconv unused error @@ -150,10 +150,14 @@ func TestResubmitFailure(t *testing.T) { // case: successful resubmit with ack and ack = response wk.EXPECT().Sudo(ctx, contractAddr, msgSuc).Return([]byte{}, nil) + wk.EXPECT().HasContractInfo(ctx, contractAddr).Return(true) failure, err := k.GetFailure(ctx, contractAddr, failureID) require.NoError(t, err) - err = k.ResubmitFailure(ctx, contractAddr, failure) + _, err = k.ResubmitFailure(ctx, &types.MsgResubmitFailure{ + Sender: contractAddr.String(), + FailureId: failure.Id, + }) require.NoError(t, err) // failure should be deleted _, err = k.GetFailure(ctx, contractAddr, failureID) @@ -166,10 +170,14 @@ func TestResubmitFailure(t *testing.T) { k.AddContractFailure(ctx, contractAddr.String(), payload, "test error") wk.EXPECT().Sudo(ctx, contractAddr, msgSuc).Return(nil, fmt.Errorf("failed to sudo")) + wk.EXPECT().HasContractInfo(ctx, contractAddr).Return(true) failure2, err := k.GetFailure(ctx, contractAddr, failureID2) require.NoError(t, err) - err = k.ResubmitFailure(ctx, contractAddr, failure2) + _, err = k.ResubmitFailure(ctx, &types.MsgResubmitFailure{ + Sender: contractAddr.String(), + FailureId: failure2.Id, + }) require.ErrorContains(t, err, "cannot resubmit failure") // failure is still there failureAfter2, err := k.GetFailure(ctx, contractAddr, failureID2) @@ -184,10 +192,14 @@ func TestResubmitFailure(t *testing.T) { k.AddContractFailure(ctx, contractAddr.String(), payload, "test error") wk.EXPECT().Sudo(gomock.AssignableToTypeOf(ctx), contractAddr, msgErr).Return([]byte{}, nil) + wk.EXPECT().HasContractInfo(ctx, contractAddr).Return(true) failure3, err := k.GetFailure(ctx, contractAddr, failureID3) require.NoError(t, err) - err = k.ResubmitFailure(ctx, contractAddr, failure3) + _, err = k.ResubmitFailure(ctx, &types.MsgResubmitFailure{ + Sender: contractAddr.String(), + FailureId: failure3.Id, + }) require.NoError(t, err) // failure should be deleted _, err = k.GetFailure(ctx, contractAddr, failureID3) @@ -200,10 +212,14 @@ func TestResubmitFailure(t *testing.T) { k.AddContractFailure(ctx, contractAddr.String(), payload, "test error") wk.EXPECT().Sudo(gomock.AssignableToTypeOf(ctx), contractAddr, msgErr).Return(nil, fmt.Errorf("failed to sudo")) + wk.EXPECT().HasContractInfo(ctx, contractAddr).Return(true) failure4, err := k.GetFailure(ctx, contractAddr, failureID4) require.NoError(t, err) - err = k.ResubmitFailure(ctx, contractAddr, failure4) + _, err = k.ResubmitFailure(ctx, &types.MsgResubmitFailure{ + Sender: contractAddr.String(), + FailureId: failure4.Id, + }) require.ErrorContains(t, err, "cannot resubmit failure") // failure is still there failureAfter4, err := k.GetFailure(ctx, contractAddr, failureID4) @@ -218,10 +234,14 @@ func TestResubmitFailure(t *testing.T) { k.AddContractFailure(ctx, contractAddr.String(), payload, "test error") wk.EXPECT().Sudo(gomock.AssignableToTypeOf(ctx), contractAddr, msgTimeout).Return([]byte{}, nil) + wk.EXPECT().HasContractInfo(ctx, contractAddr).Return(true) failure5, err := k.GetFailure(ctx, contractAddr, failureID5) require.NoError(t, err) - err = k.ResubmitFailure(ctx, contractAddr, failure5) + _, err = k.ResubmitFailure(ctx, &types.MsgResubmitFailure{ + Sender: contractAddr.String(), + FailureId: failure5.Id, + }) require.NoError(t, err) // failure should be deleted _, err = k.GetFailure(ctx, contractAddr, failureID5) @@ -234,10 +254,14 @@ func TestResubmitFailure(t *testing.T) { k.AddContractFailure(ctx, contractAddr.String(), payload, "test error") wk.EXPECT().Sudo(gomock.AssignableToTypeOf(ctx), contractAddr, msgTimeout).Return(nil, fmt.Errorf("failed to sudo")) + wk.EXPECT().HasContractInfo(ctx, contractAddr).Return(true) failure6, err := k.GetFailure(ctx, contractAddr, failureID6) require.NoError(t, err) - err = k.ResubmitFailure(ctx, contractAddr, failure6) + _, err = k.ResubmitFailure(ctx, &types.MsgResubmitFailure{ + Sender: contractAddr.String(), + FailureId: failure6.Id, + }) require.ErrorContains(t, err, "cannot resubmit failure") // failure is still there failureAfter6, err := k.GetFailure(ctx, contractAddr, failureID6) diff --git a/x/contractmanager/keeper/grpc_query.go b/x/contractmanager/keeper/grpc_query.go index 332b980be..4e3cfa19e 100644 --- a/x/contractmanager/keeper/grpc_query.go +++ b/x/contractmanager/keeper/grpc_query.go @@ -1,7 +1,17 @@ package keeper import ( - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) var _ types.QueryServer = Keeper{} + +type queryServer struct { + Keeper +} + +// NewQueryServerImpl returns an implementation of the QueryServer interface +// for the provided Keeper. +func NewQueryServerImpl(keeper Keeper) types.QueryServer { + return &queryServer{Keeper: keeper} +} diff --git a/x/contractmanager/keeper/grpc_query_failure.go b/x/contractmanager/keeper/grpc_query_failure.go index 70f92bf5a..dfb82f13c 100644 --- a/x/contractmanager/keeper/grpc_query_failure.go +++ b/x/contractmanager/keeper/grpc_query_failure.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) const FailuresQueryMaxLimit uint64 = query.DefaultLimit @@ -59,7 +59,7 @@ func (k Keeper) AddressFailures(c context.Context, req *types.QueryFailuresReque return &types.QueryFailuresResponse{Failures: failures, Pagination: pageRes}, nil } -func (k Keeper) AddressFailure(c context.Context, req *types.QueryFailuresRequest) (*types.QueryFailuresResponse, error) { +func (k Keeper) AddressFailure(c context.Context, req *types.QueryFailureRequest) (*types.QueryFailureResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "request field must not be empty") } @@ -74,5 +74,5 @@ func (k Keeper) AddressFailure(c context.Context, req *types.QueryFailuresReques return nil, status.Error(codes.InvalidArgument, err.Error()) } - return &types.QueryFailuresResponse{Failures: []types.Failure{*resp}}, nil + return &types.QueryFailureResponse{Failure: *resp}, nil } diff --git a/x/contractmanager/keeper/grpc_query_failure_test.go b/x/contractmanager/keeper/grpc_query_failure_test.go index 88fee35b1..89d26889f 100644 --- a/x/contractmanager/keeper/grpc_query_failure_test.go +++ b/x/contractmanager/keeper/grpc_query_failure_test.go @@ -4,16 +4,16 @@ import ( "strconv" "testing" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/neutron-org/neutron/v4/testutil/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + keepertest "github.com/neutron-org/neutron/v5/testutil/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) // Prevent strconv unused error diff --git a/x/contractmanager/keeper/grpc_query_params.go b/x/contractmanager/keeper/grpc_query_params.go index d87dd6700..d7eae160a 100644 --- a/x/contractmanager/keeper/grpc_query_params.go +++ b/x/contractmanager/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/contractmanager/keeper/grpc_query_params_test.go b/x/contractmanager/keeper/grpc_query_params_test.go index 10cdb3027..7d7e01292 100644 --- a/x/contractmanager/keeper/grpc_query_params_test.go +++ b/x/contractmanager/keeper/grpc_query_params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/contractmanager/keeper/keeper.go b/x/contractmanager/keeper/keeper.go index 6d46ffe1f..02e92a200 100644 --- a/x/contractmanager/keeper/keeper.go +++ b/x/contractmanager/keeper/keeper.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) type ( diff --git a/x/contractmanager/keeper/migrations.go b/x/contractmanager/keeper/migrations.go index f9a2d6fb2..225414080 100644 --- a/x/contractmanager/keeper/migrations.go +++ b/x/contractmanager/keeper/migrations.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v2 "github.com/neutron-org/neutron/v4/x/contractmanager/migrations/v2" + v2 "github.com/neutron-org/neutron/v5/x/contractmanager/migrations/v2" ) // Migrator is a struct for handling in-place store migrations. diff --git a/x/contractmanager/keeper/msg_server.go b/x/contractmanager/keeper/msg_server.go index 25ae24790..8a651415c 100644 --- a/x/contractmanager/keeper/msg_server.go +++ b/x/contractmanager/keeper/msg_server.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) type msgServer struct { @@ -40,3 +40,32 @@ func (k Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) return &types.MsgUpdateParamsResponse{}, nil } + +// ResubmitFailure resubmits the failure after contract acknowledgement failed +func (k Keeper) ResubmitFailure(goCtx context.Context, req *types.MsgResubmitFailure) (*types.MsgResubmitFailureResponse, error) { + if err := req.Validate(); err != nil { + return nil, errors.Wrap(err, "failed to validate MsgResubmitFailure") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + sender, err := sdk.AccAddressFromBech32(req.Sender) + if err != nil { + return nil, errors.Wrap(err, "sender in resubmit request is not in correct address format") + } + + if !k.wasmKeeper.HasContractInfo(ctx, sender) { + return nil, errors.Wrap(types.ErrNotContractResubmission, "sender in resubmit request is not a smart contract") + } + + failure, err := k.GetFailure(ctx, sender, req.FailureId) + if err != nil { + return nil, errors.Wrap(sdkerrors.ErrNotFound, "no failure with given FailureId found to resubmit") + } + + if err := k.resubmitFailure(ctx, sender, failure); err != nil { + return nil, err + } + + return &types.MsgResubmitFailureResponse{}, nil +} diff --git a/x/contractmanager/keeper/msg_server_test.go b/x/contractmanager/keeper/msg_server_test.go index f15ffb263..cf92345f5 100644 --- a/x/contractmanager/keeper/msg_server_test.go +++ b/x/contractmanager/keeper/msg_server_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/testutil/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func TestMsgUpdateParamsValidate(t *testing.T) { diff --git a/x/contractmanager/keeper/params.go b/x/contractmanager/keeper/params.go index 6ae050c69..f7bd489cf 100644 --- a/x/contractmanager/keeper/params.go +++ b/x/contractmanager/keeper/params.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) // GetParams get all parameters as types.Params diff --git a/x/contractmanager/keeper/params_test.go b/x/contractmanager/keeper/params_test.go index 2a11eb22d..9fe57549e 100644 --- a/x/contractmanager/keeper/params_test.go +++ b/x/contractmanager/keeper/params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func TestGetParams(t *testing.T) { diff --git a/x/contractmanager/keeper/sudo.go b/x/contractmanager/keeper/sudo.go index 93d8642ce..d813f5567 100644 --- a/x/contractmanager/keeper/sudo.go +++ b/x/contractmanager/keeper/sudo.go @@ -14,7 +14,7 @@ import ( ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func (k Keeper) HasContractInfo(ctx context.Context, contractAddress sdk.AccAddress) bool { diff --git a/x/contractmanager/keeper/sudo_test.go b/x/contractmanager/keeper/sudo_test.go index 4de22fa97..5995a5293 100644 --- a/x/contractmanager/keeper/sudo_test.go +++ b/x/contractmanager/keeper/sudo_test.go @@ -5,16 +5,16 @@ import ( "fmt" "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - keepertest "github.com/neutron-org/neutron/v4/testutil/contractmanager/keeper" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/contractmanager/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/testutil" + keepertest "github.com/neutron-org/neutron/v5/testutil/contractmanager/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func init() { diff --git a/x/contractmanager/migrations/v2/store.go b/x/contractmanager/migrations/v2/store.go index d64c4f18e..a179a4d0e 100644 --- a/x/contractmanager/migrations/v2/store.go +++ b/x/contractmanager/migrations/v2/store.go @@ -5,7 +5,7 @@ import ( storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) // MigrateStore performs in-place store migrations. diff --git a/x/contractmanager/migrations/v2/store_test.go b/x/contractmanager/migrations/v2/store_test.go index 90f905e52..5206582ef 100644 --- a/x/contractmanager/migrations/v2/store_test.go +++ b/x/contractmanager/migrations/v2/store_test.go @@ -6,10 +6,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/testutil" - v2 "github.com/neutron-org/neutron/v4/x/contractmanager/migrations/v2" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" - typesv1 "github.com/neutron-org/neutron/v4/x/contractmanager/types/v1" + "github.com/neutron-org/neutron/v5/testutil" + v2 "github.com/neutron-org/neutron/v5/x/contractmanager/migrations/v2" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" + typesv1 "github.com/neutron-org/neutron/v5/x/contractmanager/types/v1" ) type V2ContractManagerMigrationTestSuite struct { diff --git a/x/contractmanager/module.go b/x/contractmanager/module.go index 7941d6f85..96ae997cd 100644 --- a/x/contractmanager/module.go +++ b/x/contractmanager/module.go @@ -21,9 +21,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/neutron-org/neutron/v4/x/contractmanager/client/cli" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/client/cli" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) var ( diff --git a/x/contractmanager/types/codec.go b/x/contractmanager/types/codec.go index 14f5aff7e..1ba0ec750 100644 --- a/x/contractmanager/types/codec.go +++ b/x/contractmanager/types/codec.go @@ -9,12 +9,14 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateParams{}, "neutron.contractmanager.v1.MsgUpdateParams", nil) + cdc.RegisterConcrete(&MsgResubmitFailure{}, "neutron.contractmanager.v1.MsgResubmitFailure", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, + &MsgResubmitFailure{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/contractmanager/types/errors.go b/x/contractmanager/types/errors.go index ba32da1fe..d18510513 100644 --- a/x/contractmanager/types/errors.go +++ b/x/contractmanager/types/errors.go @@ -9,4 +9,5 @@ var ( ErrIncorrectFailureToResubmit = errors.Register(ModuleName, 1101, "incorrect failure to resubmit") ErrFailedToResubmitFailure = errors.Register(ModuleName, 1102, "failed to resubmit failure") ErrSudoOutOfGas = errors.Register(ModuleName, 1103, "sudo handling went beyond the gas limit allowed by the module") + ErrNotContractResubmission = errors.Register(ModuleName, 1104, "failures resubmission is only allowed to be called by a smart contract") ) diff --git a/x/contractmanager/types/failure.pb.go b/x/contractmanager/types/failure.pb.go index 635899d81..50379216e 100644 --- a/x/contractmanager/types/failure.pb.go +++ b/x/contractmanager/types/failure.pb.go @@ -122,9 +122,9 @@ var fileDescriptor_fba0c26e85dad46e = []byte{ 0xfc, 0x22, 0x09, 0x16, 0xb0, 0x51, 0x10, 0x8e, 0x53, 0xf0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, - 0x43, 0xbd, 0xa3, 0x9b, 0x5f, 0x94, 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xe8, 0x57, 0x60, 0x04, 0x43, + 0x43, 0xbd, 0xa3, 0x9b, 0x5f, 0x94, 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xea, 0x57, 0x60, 0x04, 0x43, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x27, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x5c, 0xc6, 0x5f, 0x6f, 0x2e, 0x01, 0x00, 0x00, + 0xaf, 0x56, 0xad, 0x59, 0x2e, 0x01, 0x00, 0x00, } func (m *Failure) Marshal() (dAtA []byte, err error) { diff --git a/x/contractmanager/types/genesis.pb.go b/x/contractmanager/types/genesis.pb.go index fbf415eda..89a99d0a0 100644 --- a/x/contractmanager/types/genesis.pb.go +++ b/x/contractmanager/types/genesis.pb.go @@ -100,9 +100,9 @@ var fileDescriptor_cf4a1534315a7490 = []byte{ 0x44, 0x35, 0xd4, 0x18, 0x1e, 0x98, 0x66, 0x9f, 0xcc, 0xe2, 0x12, 0xa7, 0xe0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, - 0xce, 0xcf, 0xd5, 0x87, 0x9a, 0xac, 0x9b, 0x5f, 0x94, 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xe8, 0x57, + 0xce, 0xcf, 0xd5, 0x87, 0x9a, 0xac, 0x9b, 0x5f, 0x94, 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xea, 0x57, 0x60, 0x78, 0xbc, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x71, 0x63, 0x40, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x2d, 0x60, 0xd9, 0xc7, 0x9d, 0x01, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xde, 0xf0, 0x2b, 0xf1, 0x9d, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/contractmanager/types/genesis_test.go b/x/contractmanager/types/genesis_test.go index 4ecf069c8..ae4c201a0 100644 --- a/x/contractmanager/types/genesis_test.go +++ b/x/contractmanager/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/contractmanager/types/params.pb.go b/x/contractmanager/types/params.pb.go index a3294bbd0..dc4c2cef7 100644 --- a/x/contractmanager/types/params.pb.go +++ b/x/contractmanager/types/params.pb.go @@ -87,9 +87,9 @@ var fileDescriptor_121b05e48c7a8737 = []byte{ 0xdc, 0x13, 0x8b, 0x7d, 0x40, 0xe2, 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x38, 0x05, 0x9f, 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, 0x65, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, - 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xd4, 0x49, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0x89, + 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xd4, 0x49, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0xa9, 0x7e, 0x05, 0x86, 0x4f, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x4e, 0x33, 0x06, 0x04, - 0x00, 0x00, 0xff, 0xff, 0xa9, 0x1e, 0x26, 0x1c, 0xf1, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x5a, 0x8e, 0xd4, 0x2a, 0xf1, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/contractmanager/types/query.pb.go b/x/contractmanager/types/query.pb.go index b5b0f5543..b18090f3f 100644 --- a/x/contractmanager/types/query.pb.go +++ b/x/contractmanager/types/query.pb.go @@ -116,9 +116,7 @@ func (m *QueryParamsResponse) GetParams() Params { // QueryFailuresRequest is request type for the Query/Failures RPC method. type QueryFailuresRequest struct { // address of the contract which Sudo call failed. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // ID of the failure for the given contract. - FailureId uint64 `protobuf:"varint,2,opt,name=failure_id,json=failureId,proto3" json:"failure_id,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -162,18 +160,111 @@ func (m *QueryFailuresRequest) GetAddress() string { return "" } -func (m *QueryFailuresRequest) GetFailureId() uint64 { +func (m *QueryFailuresRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryFailureRequest is request type for the Query/Failures RPC method. +type QueryFailureRequest struct { + // address of the contract which Sudo call failed. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // ID of the failure for the given contract. + FailureId uint64 `protobuf:"varint,2,opt,name=failure_id,json=failureId,proto3" json:"failure_id,omitempty"` +} + +func (m *QueryFailureRequest) Reset() { *m = QueryFailureRequest{} } +func (m *QueryFailureRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFailureRequest) ProtoMessage() {} +func (*QueryFailureRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f9524a427f219917, []int{3} +} +func (m *QueryFailureRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFailureRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFailureRequest.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 *QueryFailureRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFailureRequest.Merge(m, src) +} +func (m *QueryFailureRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFailureRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFailureRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFailureRequest proto.InternalMessageInfo + +func (m *QueryFailureRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QueryFailureRequest) GetFailureId() uint64 { if m != nil { return m.FailureId } return 0 } -func (m *QueryFailuresRequest) GetPagination() *query.PageRequest { +// QueryFailureResponse is response type for the Query/Failure RPC method. +type QueryFailureResponse struct { + Failure Failure `protobuf:"bytes,1,opt,name=failure,proto3" json:"failure"` +} + +func (m *QueryFailureResponse) Reset() { *m = QueryFailureResponse{} } +func (m *QueryFailureResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFailureResponse) ProtoMessage() {} +func (*QueryFailureResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f9524a427f219917, []int{4} +} +func (m *QueryFailureResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFailureResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFailureResponse.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 *QueryFailureResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFailureResponse.Merge(m, src) +} +func (m *QueryFailureResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFailureResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFailureResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFailureResponse proto.InternalMessageInfo + +func (m *QueryFailureResponse) GetFailure() Failure { if m != nil { - return m.Pagination + return m.Failure } - return nil + return Failure{} } // QueryFailuresResponse is response type for the Query/Failures RPC method. @@ -186,7 +277,7 @@ func (m *QueryFailuresResponse) Reset() { *m = QueryFailuresResponse{} } func (m *QueryFailuresResponse) String() string { return proto.CompactTextString(m) } func (*QueryFailuresResponse) ProtoMessage() {} func (*QueryFailuresResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f9524a427f219917, []int{3} + return fileDescriptor_f9524a427f219917, []int{5} } func (m *QueryFailuresResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -233,6 +324,8 @@ func init() { proto.RegisterType((*QueryParamsRequest)(nil), "neutron.contractmanager.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "neutron.contractmanager.QueryParamsResponse") proto.RegisterType((*QueryFailuresRequest)(nil), "neutron.contractmanager.QueryFailuresRequest") + proto.RegisterType((*QueryFailureRequest)(nil), "neutron.contractmanager.QueryFailureRequest") + proto.RegisterType((*QueryFailureResponse)(nil), "neutron.contractmanager.QueryFailureResponse") proto.RegisterType((*QueryFailuresResponse)(nil), "neutron.contractmanager.QueryFailuresResponse") } @@ -241,41 +334,42 @@ func init() { } var fileDescriptor_f9524a427f219917 = []byte{ - // 531 bytes of a gzipped FileDescriptorProto + // 557 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0x33, 0x69, 0x1b, 0xdb, 0x29, 0x28, 0x8c, 0x11, 0x43, 0xd0, 0x4d, 0xba, 0x55, 0x1b, - 0xad, 0x99, 0xa1, 0xa9, 0x07, 0x15, 0x04, 0xcd, 0xa1, 0xe2, 0xad, 0xae, 0x9e, 0xbc, 0xc8, 0x24, - 0x19, 0xc7, 0x85, 0x66, 0x66, 0x3b, 0x33, 0x5b, 0x2c, 0xa5, 0x17, 0x6f, 0x82, 0x07, 0x41, 0xc1, - 0x2f, 0xa0, 0x1f, 0xc0, 0x6f, 0xd1, 0x63, 0xc1, 0x8b, 0x27, 0x91, 0xc4, 0x0f, 0x22, 0x99, 0x99, - 0xb4, 0x4d, 0xca, 0x36, 0xf1, 0xa0, 0xb7, 0xd9, 0xb7, 0xef, 0xff, 0xde, 0xef, 0xfd, 0xe7, 0xed, - 0xc2, 0x65, 0xc1, 0x52, 0xa3, 0xa4, 0x20, 0x6d, 0x29, 0x8c, 0xa2, 0x6d, 0xd3, 0xa5, 0x82, 0x72, - 0xa6, 0xc8, 0x76, 0xca, 0xd4, 0x2e, 0x4e, 0x94, 0x34, 0x12, 0x5d, 0xf6, 0x49, 0x78, 0x2c,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, 0x5b, 0x76, 0x87, - 0x65, 0xea, 0x52, 0xf1, 0xa3, 0x92, 0x3b, 0x77, 0xc8, 0x9b, 0x53, 0x75, 0xcd, 0x6e, 0xc2, 0x74, - 0xab, 0x60, 0x7f, 0x4a, 0xeb, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x96, 0xc1, 0xe7, 0xbe, 0x81, - 0x05, 0x00, 0x00, + 0x1c, 0xc5, 0x33, 0x69, 0x9b, 0xb6, 0x23, 0x28, 0x8c, 0x11, 0x43, 0xd0, 0x4d, 0xba, 0x55, 0x5b, + 0xad, 0x99, 0xa1, 0x2d, 0x82, 0x0a, 0x42, 0xcd, 0xa1, 0xe2, 0x45, 0xea, 0xea, 0x41, 0xbc, 0xc8, + 0x24, 0x19, 0xd7, 0x85, 0x66, 0x67, 0xbb, 0x33, 0x5b, 0x5a, 0x4a, 0x2f, 0x5e, 0xbc, 0x78, 0x10, + 0xf4, 0x23, 0xe8, 0xd9, 0xaf, 0xd1, 0x63, 0xc1, 0x8b, 0x27, 0x91, 0xc4, 0x0f, 0x22, 0x99, 0xf9, + 0x27, 0xed, 0xb6, 0xac, 0x9b, 0x5c, 0xbc, 0x6d, 0x26, 0xef, 0xbd, 0xff, 0x6f, 0xdf, 0xfc, 0x13, + 0xbc, 0x18, 0x8a, 0x44, 0xc7, 0x32, 0x64, 0x6d, 0x19, 0xea, 0x98, 0xb7, 0x75, 0x97, 0x87, 0xdc, + 0x17, 0x31, 0xdb, 0x49, 0x44, 0xbc, 0x4f, 0xa3, 0x58, 0x6a, 0x49, 0xae, 0x82, 0x88, 0x9e, 0x11, + 0x55, 0xef, 0xb4, 0xa5, 0xea, 0x4a, 0xc5, 0x5a, 0x5c, 0x09, 0xeb, 0x60, 0xbb, 0xab, 0x2d, 0xa1, + 0xf9, 0x2a, 0x8b, 0xb8, 0x1f, 0x84, 0x5c, 0x07, 0x32, 0xb4, 0x21, 0xd5, 0xb2, 0x2f, 0x7d, 0x69, + 0x1e, 0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0x32, 0xf6, 0x47, 0x91, + 0xbb, 0xf7, 0xd8, 0xde, 0xb9, 0x5c, 0xbd, 0x1f, 0x09, 0xd5, 0x2a, 0x99, 0x3f, 0xc7, 0xf5, 0xbf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x61, 0xf0, 0xb5, 0x09, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -293,7 +387,7 @@ type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a Failure by contract address and failure ID. - AddressFailure(ctx context.Context, in *QueryFailuresRequest, opts ...grpc.CallOption) (*QueryFailuresResponse, error) + AddressFailure(ctx context.Context, in *QueryFailureRequest, opts ...grpc.CallOption) (*QueryFailureResponse, error) // Queries Failures by contract address. AddressFailures(ctx context.Context, in *QueryFailuresRequest, opts ...grpc.CallOption) (*QueryFailuresResponse, error) // Queries a list of Failures occurred on the network. @@ -317,8 +411,8 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) AddressFailure(ctx context.Context, in *QueryFailuresRequest, opts ...grpc.CallOption) (*QueryFailuresResponse, error) { - out := new(QueryFailuresResponse) +func (c *queryClient) AddressFailure(ctx context.Context, in *QueryFailureRequest, opts ...grpc.CallOption) (*QueryFailureResponse, error) { + out := new(QueryFailureResponse) err := c.cc.Invoke(ctx, "/neutron.contractmanager.Query/AddressFailure", in, out, opts...) if err != nil { return nil, err @@ -349,7 +443,7 @@ type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a Failure by contract address and failure ID. - AddressFailure(context.Context, *QueryFailuresRequest) (*QueryFailuresResponse, error) + AddressFailure(context.Context, *QueryFailureRequest) (*QueryFailureResponse, error) // Queries Failures by contract address. AddressFailures(context.Context, *QueryFailuresRequest) (*QueryFailuresResponse, error) // Queries a list of Failures occurred on the network. @@ -363,7 +457,7 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) AddressFailure(ctx context.Context, req *QueryFailuresRequest) (*QueryFailuresResponse, error) { +func (*UnimplementedQueryServer) AddressFailure(ctx context.Context, req *QueryFailureRequest) (*QueryFailureResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddressFailure not implemented") } func (*UnimplementedQueryServer) AddressFailures(ctx context.Context, req *QueryFailuresRequest) (*QueryFailuresResponse, error) { @@ -396,7 +490,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } func _Query_AddressFailure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryFailuresRequest) + in := new(QueryFailureRequest) if err := dec(in); err != nil { return nil, err } @@ -408,7 +502,7 @@ func _Query_AddressFailure_Handler(srv interface{}, ctx context.Context, dec fun FullMethod: "/neutron.contractmanager.Query/AddressFailure", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AddressFailure(ctx, req.(*QueryFailuresRequest)) + return srv.(QueryServer).AddressFailure(ctx, req.(*QueryFailureRequest)) } return interceptor(ctx, in, info, handler) } @@ -562,6 +656,36 @@ func (m *QueryFailuresRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFailureRequest) 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 *QueryFailureRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFailureRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l if m.FailureId != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.FailureId)) i-- @@ -577,6 +701,39 @@ func (m *QueryFailuresRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryFailureResponse) 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 *QueryFailureResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFailureResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Failure.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 *QueryFailuresResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -667,9 +824,6 @@ func (m *QueryFailuresRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if m.FailureId != 0 { - n += 1 + sovQuery(uint64(m.FailureId)) - } if m.Pagination != nil { l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) @@ -677,6 +831,33 @@ func (m *QueryFailuresRequest) Size() (n int) { return n } +func (m *QueryFailureRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.FailureId != 0 { + n += 1 + sovQuery(uint64(m.FailureId)) + } + return n +} + +func (m *QueryFailureResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Failure.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryFailuresResponse) Size() (n int) { if m == nil { return 0 @@ -864,6 +1045,124 @@ func (m *QueryFailuresRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryFailuresRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryFailureRequest) 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: QueryFailureRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFailureRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) @@ -915,9 +1214,59 @@ func (m *QueryFailuresRequest) Unmarshal(dAtA []byte) error { break } } - case 3: + 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 *QueryFailureResponse) 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: QueryFailureResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFailureResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -944,10 +1293,7 @@ func (m *QueryFailuresRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Failure.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/contractmanager/types/query.pb.gw.go b/x/contractmanager/types/query.pb.gw.go index 2c201192b..90a96f6be 100644 --- a/x/contractmanager/types/query.pb.gw.go +++ b/x/contractmanager/types/query.pb.gw.go @@ -51,12 +51,8 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -var ( - filter_Query_AddressFailure_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0, "failure_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) - func request_Query_AddressFailure_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryFailuresRequest + var protoReq QueryFailureRequest var metadata runtime.ServerMetadata var ( @@ -88,20 +84,13 @@ func request_Query_AddressFailure_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "failure_id", err) } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AddressFailure_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.AddressFailure(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } func local_request_Query_AddressFailure_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryFailuresRequest + var protoReq QueryFailureRequest var metadata runtime.ServerMetadata var ( @@ -133,13 +122,6 @@ func local_request_Query_AddressFailure_0(ctx context.Context, marshaler runtime return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "failure_id", err) } - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AddressFailure_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := server.AddressFailure(ctx, &protoReq) return msg, metadata, err diff --git a/x/contractmanager/types/tx.go b/x/contractmanager/types/tx.go index 7b965fc04..581700ab0 100644 --- a/x/contractmanager/types/tx.go +++ b/x/contractmanager/types/tx.go @@ -33,3 +33,32 @@ func (msg *MsgUpdateParams) Validate() error { } return nil } + +var _ sdk.Msg = &MsgResubmitFailure{} + +func (msg *MsgResubmitFailure) Route() string { + return RouterKey +} + +func (msg *MsgResubmitFailure) Type() string { + return "resubmit-failure" +} + +func (msg *MsgResubmitFailure) GetSigners() []sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{sender} +} + +func (msg *MsgResubmitFailure) GetSignBytes() []byte { + return ModuleCdc.MustMarshalJSON(msg) +} + +func (msg *MsgResubmitFailure) Validate() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrap(err, "sender is invalid") + } + return nil +} diff --git a/x/contractmanager/types/tx.pb.go b/x/contractmanager/types/tx.pb.go index 3a69490ae..35061e6e3 100644 --- a/x/contractmanager/types/tx.pb.go +++ b/x/contractmanager/types/tx.pb.go @@ -130,15 +130,108 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgResubmitFailure - contract that has failed acknowledgement can resubmit its failure +type MsgResubmitFailure struct { + // sender is the contract which failure to acknowledge is resubmitted. + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // failure_id is id of failure to resubmit + FailureId uint64 `protobuf:"varint,2,opt,name=failure_id,json=failureId,proto3" json:"failure_id,omitempty"` +} + +func (m *MsgResubmitFailure) Reset() { *m = MsgResubmitFailure{} } +func (m *MsgResubmitFailure) String() string { return proto.CompactTextString(m) } +func (*MsgResubmitFailure) ProtoMessage() {} +func (*MsgResubmitFailure) Descriptor() ([]byte, []int) { + return fileDescriptor_4dc444ed708d435f, []int{2} +} +func (m *MsgResubmitFailure) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgResubmitFailure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgResubmitFailure.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 *MsgResubmitFailure) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgResubmitFailure.Merge(m, src) +} +func (m *MsgResubmitFailure) XXX_Size() int { + return m.Size() +} +func (m *MsgResubmitFailure) XXX_DiscardUnknown() { + xxx_messageInfo_MsgResubmitFailure.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgResubmitFailure proto.InternalMessageInfo + +func (m *MsgResubmitFailure) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgResubmitFailure) GetFailureId() uint64 { + if m != nil { + return m.FailureId + } + return 0 +} + +type MsgResubmitFailureResponse struct { +} + +func (m *MsgResubmitFailureResponse) Reset() { *m = MsgResubmitFailureResponse{} } +func (m *MsgResubmitFailureResponse) String() string { return proto.CompactTextString(m) } +func (*MsgResubmitFailureResponse) ProtoMessage() {} +func (*MsgResubmitFailureResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4dc444ed708d435f, []int{3} +} +func (m *MsgResubmitFailureResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgResubmitFailureResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgResubmitFailureResponse.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 *MsgResubmitFailureResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgResubmitFailureResponse.Merge(m, src) +} +func (m *MsgResubmitFailureResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgResubmitFailureResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgResubmitFailureResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgResubmitFailureResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "neutron.contractmanager.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "neutron.contractmanager.MsgUpdateParamsResponse") + proto.RegisterType((*MsgResubmitFailure)(nil), "neutron.contractmanager.MsgResubmitFailure") + proto.RegisterType((*MsgResubmitFailureResponse)(nil), "neutron.contractmanager.MsgResubmitFailureResponse") } func init() { proto.RegisterFile("neutron/contractmanager/tx.proto", fileDescriptor_4dc444ed708d435f) } var fileDescriptor_4dc444ed708d435f = []byte{ - // 351 bytes of a gzipped FileDescriptorProto + // 449 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xc8, 0x4b, 0x2d, 0x2d, 0x29, 0xca, 0xcf, 0xd3, 0x4f, 0xce, 0xcf, 0x2b, 0x29, 0x4a, 0x4c, 0x2e, 0xc9, 0x4d, 0xcc, 0x4b, 0x4c, 0x4f, 0x2d, 0xd2, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xaa, @@ -154,13 +247,20 @@ var fileDescriptor_4dc444ed708d435f = []byte{ 0x88, 0x45, 0x4e, 0x9c, 0x27, 0xee, 0xc9, 0x33, 0xac, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x08, 0xaa, 0xd3, 0xca, 0xa8, 0xe9, 0xf9, 0x06, 0x2d, 0x84, 0x99, 0x5d, 0xcf, 0x37, 0x68, 0xc9, 0xa3, 0x7b, 0x00, 0xcd, 0xbd, 0x4a, 0x92, 0x5c, 0xe2, 0x68, 0x42, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, - 0xa9, 0x46, 0x15, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x59, 0x5c, 0x3c, 0x28, 0x3e, 0xd4, 0xc0, - 0xe9, 0x32, 0x34, 0x83, 0xa4, 0x0c, 0x88, 0x55, 0x09, 0xb3, 0x52, 0x8a, 0xb5, 0x01, 0xe4, 0x21, - 0xa7, 0xe0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, - 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xb2, 0x4c, 0xcf, 0x2c, - 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0x1a, 0xae, 0x9b, 0x5f, 0x94, 0x0e, 0x63, - 0xeb, 0x97, 0x99, 0xe8, 0x57, 0x60, 0x26, 0xa6, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xa4, - 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb0, 0xe1, 0xbf, 0xee, 0x74, 0x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0xa6, 0xfa, 0x15, 0x98, 0x99, 0xaf, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, + 0x9c, 0xc8, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x38, 0x89, 0x6e, 0xe5, 0xa4, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -176,6 +276,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 { UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + ResubmitFailure(ctx context.Context, in *MsgResubmitFailure, opts ...grpc.CallOption) (*MsgResubmitFailureResponse, error) } type msgClient struct { @@ -195,9 +296,19 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) ResubmitFailure(ctx context.Context, in *MsgResubmitFailure, opts ...grpc.CallOption) (*MsgResubmitFailureResponse, error) { + out := new(MsgResubmitFailureResponse) + err := c.cc.Invoke(ctx, "/neutron.contractmanager.Msg/ResubmitFailure", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + ResubmitFailure(context.Context, *MsgResubmitFailure) (*MsgResubmitFailureResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -207,6 +318,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) ResubmitFailure(ctx context.Context, req *MsgResubmitFailure) (*MsgResubmitFailureResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResubmitFailure not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -230,6 +344,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_ResubmitFailure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgResubmitFailure) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ResubmitFailure(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.contractmanager.Msg/ResubmitFailure", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ResubmitFailure(ctx, req.(*MsgResubmitFailure)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "neutron.contractmanager.Msg", HandlerType: (*MsgServer)(nil), @@ -238,6 +370,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "ResubmitFailure", + Handler: _Msg_ResubmitFailure_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "neutron/contractmanager/tx.proto", @@ -306,6 +442,64 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgResubmitFailure) 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 *MsgResubmitFailure) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgResubmitFailure) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FailureId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.FailureId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgResubmitFailureResponse) 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 *MsgResubmitFailureResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgResubmitFailureResponse) 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 @@ -341,6 +535,31 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgResubmitFailure) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.FailureId != 0 { + n += 1 + sovTx(uint64(m.FailureId)) + } + return n +} + +func (m *MsgResubmitFailureResponse) 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 } @@ -512,6 +731,157 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgResubmitFailure) 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: MsgResubmitFailure: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgResubmitFailure: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FailureId", wireType) + } + m.FailureId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FailureId |= 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 *MsgResubmitFailureResponse) 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: MsgResubmitFailureResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgResubmitFailureResponse: 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/contractmanager/types/v1/failure.pb.go b/x/contractmanager/types/v1/failure.pb.go index 597eb369b..4eadc5395 100644 --- a/x/contractmanager/types/v1/failure.pb.go +++ b/x/contractmanager/types/v1/failure.pb.go @@ -127,9 +127,9 @@ var fileDescriptor_c0f2c436fd0f28b7 = []byte{ 0x09, 0xc9, 0xd9, 0x21, 0x95, 0x05, 0xa9, 0x4e, 0x61, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x93, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, - 0xf5, 0x87, 0x6e, 0x7e, 0x51, 0x3a, 0x8c, 0xad, 0x5f, 0x66, 0xa2, 0x5f, 0x81, 0x11, 0x04, 0x20, + 0xf5, 0x87, 0x6e, 0x7e, 0x51, 0x3a, 0x8c, 0xad, 0x5f, 0x66, 0xaa, 0x5f, 0x81, 0x11, 0x04, 0x20, 0x2b, 0x8a, 0xf5, 0xcb, 0x0c, 0x93, 0xd8, 0xc0, 0x21, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, - 0xd7, 0xff, 0xd9, 0x5a, 0x2d, 0x01, 0x00, 0x00, + 0x42, 0x2b, 0xa9, 0xcf, 0x2d, 0x01, 0x00, 0x00, } func (m *Failure) Marshal() (dAtA []byte, err error) { diff --git a/x/cron/client/cli/query.go b/x/cron/client/cli/query.go index 8dc195133..0b8d433e1 100644 --- a/x/cron/client/cli/query.go +++ b/x/cron/client/cli/query.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/cron/client/cli/query_params.go b/x/cron/client/cli/query_params.go index 3a8de94e3..0500a73ce 100644 --- a/x/cron/client/cli/query_params.go +++ b/x/cron/client/cli/query_params.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/cron/client/cli/query_schedule.go b/x/cron/client/cli/query_schedule.go index 4b11241c3..08142d832 100644 --- a/x/cron/client/cli/query_schedule.go +++ b/x/cron/client/cli/query_schedule.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func CmdListSchedule() *cobra.Command { diff --git a/x/cron/client/cli/query_schedule_test.go b/x/cron/client/cli/query_schedule_test.go index 7cec8578f..399ed6abe 100644 --- a/x/cron/client/cli/query_schedule_test.go +++ b/x/cron/client/cli/query_schedule_test.go @@ -12,10 +12,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - "github.com/neutron-org/neutron/v4/testutil/cron/network" - "github.com/neutron-org/neutron/v4/x/cron/client/cli" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/cron/network" + "github.com/neutron-org/neutron/v5/x/cron/client/cli" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func networkWithScheduleObjects(t *testing.T, n int) (*network.Network, []types.Schedule) { diff --git a/x/cron/client/cli/tx.go b/x/cron/client/cli/tx.go index 7e7182ef5..565daeb0d 100644 --- a/x/cron/client/cli/tx.go +++ b/x/cron/client/cli/tx.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) // GetTxCmd returns the transaction commands for this module diff --git a/x/cron/genesis.go b/x/cron/genesis.go index 974790399..78b82c5ae 100644 --- a/x/cron/genesis.go +++ b/x/cron/genesis.go @@ -3,15 +3,15 @@ package cron import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/cron/keeper" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/keeper" + "github.com/neutron-org/neutron/v5/x/cron/types" ) // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { // Set all the schedules for _, elem := range genState.ScheduleList { - err := k.AddSchedule(ctx, elem.Name, elem.Period, elem.Msgs) + err := k.AddSchedule(ctx, elem.Name, elem.Period, elem.Msgs, elem.ExecutionStage) if err != nil { panic(err) } diff --git a/x/cron/genesis_test.go b/x/cron/genesis_test.go index 4b9f2e474..c9efb9e10 100644 --- a/x/cron/genesis_test.go +++ b/x/cron/genesis_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - "github.com/neutron-org/neutron/v4/testutil/cron/keeper" - "github.com/neutron-org/neutron/v4/x/cron" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/cron/keeper" + "github.com/neutron-org/neutron/v5/x/cron" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func TestGenesis(t *testing.T) { diff --git a/x/cron/keeper/grpc_query.go b/x/cron/keeper/grpc_query.go index 865fab29f..50017a573 100644 --- a/x/cron/keeper/grpc_query.go +++ b/x/cron/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/cron/keeper/grpc_query_params.go b/x/cron/keeper/grpc_query_params.go index d2bad8b5d..a646a7abb 100644 --- a/x/cron/keeper/grpc_query_params.go +++ b/x/cron/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/cron/keeper/grpc_query_params_test.go b/x/cron/keeper/grpc_query_params_test.go index c84ef335c..64d1d4a13 100644 --- a/x/cron/keeper/grpc_query_params_test.go +++ b/x/cron/keeper/grpc_query_params_test.go @@ -3,11 +3,11 @@ package keeper_test import ( "testing" - testkeeper "github.com/neutron-org/neutron/v4/testutil/cron/keeper" + testkeeper "github.com/neutron-org/neutron/v5/testutil/cron/keeper" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/cron/keeper/grpc_query_schedule.go b/x/cron/keeper/grpc_query_schedule.go index 0e060c016..4b4d1d5ee 100644 --- a/x/cron/keeper/grpc_query_schedule.go +++ b/x/cron/keeper/grpc_query_schedule.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func (k Keeper) Schedules(c context.Context, req *types.QuerySchedulesRequest) (*types.QuerySchedulesResponse, error) { diff --git a/x/cron/keeper/grpc_query_schedule_test.go b/x/cron/keeper/grpc_query_schedule_test.go index b778f8fba..12bb5c1f3 100644 --- a/x/cron/keeper/grpc_query_schedule_test.go +++ b/x/cron/keeper/grpc_query_schedule_test.go @@ -10,10 +10,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - testutil_keeper "github.com/neutron-org/neutron/v4/testutil/cron/keeper" - cronkeeper "github.com/neutron-org/neutron/v4/x/cron/keeper" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + testutil_keeper "github.com/neutron-org/neutron/v5/testutil/cron/keeper" + cronkeeper "github.com/neutron-org/neutron/v5/x/cron/keeper" + "github.com/neutron-org/neutron/v5/x/cron/types" ) // Prevent strconv unused error @@ -133,8 +133,9 @@ func createNSchedule(t *testing.T, ctx sdk.Context, k *cronkeeper.Keeper, n int3 item.Period = 1000 item.Msgs = nil item.LastExecuteHeight = uint64(ctx.BlockHeight()) + item.ExecutionStage = types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER - err := k.AddSchedule(ctx, item.Name, item.Period, item.Msgs) + err := k.AddSchedule(ctx, item.Name, item.Period, item.Msgs, item.ExecutionStage) require.NoError(t, err) res[idx] = item diff --git a/x/cron/keeper/keeper.go b/x/cron/keeper/keeper.go index 2be2f49ee..18d45263d 100644 --- a/x/cron/keeper/keeper.go +++ b/x/cron/keeper/keeper.go @@ -17,7 +17,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) var ( @@ -66,10 +66,9 @@ func (k *Keeper) Logger(ctx sdk.Context) log.Logger { // ExecuteReadySchedules gets all schedules that are due for execution (with limit that is equal to Params.Limit) // and executes messages in each one -// NOTE that errors in contract calls rollback all already executed messages -func (k *Keeper) ExecuteReadySchedules(ctx sdk.Context) { +func (k *Keeper) ExecuteReadySchedules(ctx sdk.Context, executionStage types.ExecutionStage) { telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), LabelExecuteReadySchedules) - schedules := k.getSchedulesReadyForExecution(ctx) + schedules := k.getSchedulesReadyForExecution(ctx, executionStage) for _, schedule := range schedules { err := k.executeSchedule(ctx, schedule) @@ -77,9 +76,15 @@ func (k *Keeper) ExecuteReadySchedules(ctx sdk.Context) { } } -// AddSchedule adds new schedule to execution for every block `period`. +// AddSchedule adds a new schedule to be executed every certain number of blocks, specified in the `period`. // First schedule execution is supposed to be on `now + period` block. -func (k *Keeper) AddSchedule(ctx sdk.Context, name string, period uint64, msgs []types.MsgExecuteContract) error { +func (k *Keeper) AddSchedule( + ctx sdk.Context, + name string, + period uint64, + msgs []types.MsgExecuteContract, + executionStage types.ExecutionStage, +) error { if k.scheduleExists(ctx, name) { return fmt.Errorf("schedule already exists with name=%v", name) } @@ -89,7 +94,9 @@ func (k *Keeper) AddSchedule(ctx sdk.Context, name string, period uint64, msgs [ Period: period, Msgs: msgs, LastExecuteHeight: uint64(ctx.BlockHeight()), // let's execute newly added schedule on `now + period` block + ExecutionStage: executionStage, } + k.storeSchedule(ctx, schedule) k.changeTotalCount(ctx, 1) @@ -141,7 +148,7 @@ func (k *Keeper) GetScheduleCount(ctx sdk.Context) int32 { return k.getScheduleCount(ctx) } -func (k *Keeper) getSchedulesReadyForExecution(ctx sdk.Context) []types.Schedule { +func (k *Keeper) getSchedulesReadyForExecution(ctx sdk.Context, executionStage types.ExecutionStage) []types.Schedule { params := k.GetParams(ctx) store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ScheduleKey) count := uint64(0) @@ -155,7 +162,7 @@ func (k *Keeper) getSchedulesReadyForExecution(ctx sdk.Context) []types.Schedule var schedule types.Schedule k.cdc.MustUnmarshal(iterator.Value(), &schedule) - if k.intervalPassed(ctx, schedule) { + if k.intervalPassed(ctx, schedule) && schedule.ExecutionStage == executionStage { res = append(res, schedule) count++ diff --git a/x/cron/keeper/keeper_test.go b/x/cron/keeper/keeper_test.go index 8abe2060c..790068b94 100644 --- a/x/cron/keeper/keeper_test.go +++ b/x/cron/keeper/keeper_test.go @@ -12,10 +12,10 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - testutil_keeper "github.com/neutron-org/neutron/v4/testutil/cron/keeper" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/cron/types" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/testutil" + testutil_keeper "github.com/neutron-org/neutron/v5/testutil/cron/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) // ExecuteReadySchedules: @@ -44,7 +44,7 @@ func TestKeeperExecuteReadySchedules(t *testing.T) { schedules := []types.Schedule{ { Name: "1_unready1", - Period: 3, + Period: 10, Msgs: []types.MsgExecuteContract{ { Contract: "1_neutron", @@ -52,10 +52,11 @@ func TestKeeperExecuteReadySchedules(t *testing.T) { }, }, LastExecuteHeight: 4, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, }, { Name: "2_ready1", - Period: 3, + Period: 4, Msgs: []types.MsgExecuteContract{ { Contract: "2_neutron", @@ -63,10 +64,11 @@ func TestKeeperExecuteReadySchedules(t *testing.T) { }, }, LastExecuteHeight: 0, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, }, { Name: "3_ready2", - Period: 3, + Period: 4, Msgs: []types.MsgExecuteContract{ { Contract: "3_neutron", @@ -74,12 +76,14 @@ func TestKeeperExecuteReadySchedules(t *testing.T) { }, }, LastExecuteHeight: 0, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, }, { Name: "4_unready2", - Period: 3, + Period: 10, Msgs: []types.MsgExecuteContract{}, LastExecuteHeight: 4, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, }, { Name: "5_ready3", @@ -91,22 +95,34 @@ func TestKeeperExecuteReadySchedules(t *testing.T) { }, }, LastExecuteHeight: 0, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, + }, + { + Name: "6_ready4", + Period: 3, + Msgs: []types.MsgExecuteContract{ + { + Contract: "6_neutron", + Msg: "6_msg", + }, + }, + LastExecuteHeight: 0, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER, }, } for _, item := range schedules { ctx = ctx.WithBlockHeight(int64(item.LastExecuteHeight)) - err := k.AddSchedule(ctx, item.Name, item.Period, item.Msgs) + err := k.AddSchedule(ctx, item.Name, item.Period, item.Msgs, item.ExecutionStage) require.NoError(t, err) } count := k.GetScheduleCount(ctx) - require.Equal(t, count, int32(5)) + require.Equal(t, count, int32(6)) ctx = ctx.WithBlockHeight(5) - accountKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(addr) - accountKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(addr) + accountKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(addr).AnyTimes() wasmMsgServer.EXPECT().ExecuteContract(gomock.Any(), &wasmtypes.MsgExecuteContract{ Sender: testutil.TestOwnerAddress, Contract: "2_neutron", @@ -120,25 +136,26 @@ func TestKeeperExecuteReadySchedules(t *testing.T) { Funds: sdk.NewCoins(), }).Return(&wasmtypes.MsgExecuteContractResponse{}, nil) - k.ExecuteReadySchedules(ctx) + k.ExecuteReadySchedules(ctx, types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER) unready1, _ := k.GetSchedule(ctx, "1_unready1") ready1, _ := k.GetSchedule(ctx, "2_ready1") ready2, _ := k.GetSchedule(ctx, "3_ready2") unready2, _ := k.GetSchedule(ctx, "4_unready2") ready3, _ := k.GetSchedule(ctx, "5_ready3") + ready4, _ := k.GetSchedule(ctx, "6_ready4") require.Equal(t, uint64(4), unready1.LastExecuteHeight) require.Equal(t, uint64(5), ready1.LastExecuteHeight) require.Equal(t, uint64(5), ready2.LastExecuteHeight) require.Equal(t, uint64(4), unready2.LastExecuteHeight) require.Equal(t, uint64(0), ready3.LastExecuteHeight) + require.Equal(t, uint64(0), ready4.LastExecuteHeight) // let's make another call at the next height // Notice that now only one ready schedule left because we got limit of 2 at once ctx = ctx.WithBlockHeight(6) - accountKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(addr) wasmMsgServer.EXPECT().ExecuteContract(gomock.Any(), &wasmtypes.MsgExecuteContract{ Sender: testutil.TestOwnerAddress, Contract: "5_neutron", @@ -146,19 +163,46 @@ func TestKeeperExecuteReadySchedules(t *testing.T) { Funds: sdk.NewCoins(), }).Return(&wasmtypes.MsgExecuteContractResponse{}, nil) - k.ExecuteReadySchedules(ctx) + k.ExecuteReadySchedules(ctx, types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER) unready1, _ = k.GetSchedule(ctx, "1_unready1") ready1, _ = k.GetSchedule(ctx, "2_ready1") ready2, _ = k.GetSchedule(ctx, "3_ready2") unready2, _ = k.GetSchedule(ctx, "4_unready2") ready3, _ = k.GetSchedule(ctx, "5_ready3") + ready4, _ = k.GetSchedule(ctx, "6_ready4") require.Equal(t, uint64(4), unready1.LastExecuteHeight) require.Equal(t, uint64(5), ready1.LastExecuteHeight) require.Equal(t, uint64(5), ready2.LastExecuteHeight) require.Equal(t, uint64(4), unready2.LastExecuteHeight) require.Equal(t, uint64(6), ready3.LastExecuteHeight) + require.Equal(t, uint64(0), ready4.LastExecuteHeight) + + ctx = ctx.WithBlockHeight(7) + + wasmMsgServer.EXPECT().ExecuteContract(gomock.Any(), &wasmtypes.MsgExecuteContract{ + Sender: testutil.TestOwnerAddress, + Contract: "6_neutron", + Msg: []byte("6_msg"), + Funds: sdk.NewCoins(), + }).Return(&wasmtypes.MsgExecuteContractResponse{}, nil) + + k.ExecuteReadySchedules(ctx, types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER) + + unready1, _ = k.GetSchedule(ctx, "1_unready1") + ready1, _ = k.GetSchedule(ctx, "2_ready1") + ready2, _ = k.GetSchedule(ctx, "3_ready2") + unready2, _ = k.GetSchedule(ctx, "4_unready2") + ready3, _ = k.GetSchedule(ctx, "5_ready3") + ready4, _ = k.GetSchedule(ctx, "6_ready4") + + require.Equal(t, uint64(4), unready1.LastExecuteHeight) + require.Equal(t, uint64(5), ready1.LastExecuteHeight) + require.Equal(t, uint64(5), ready2.LastExecuteHeight) + require.Equal(t, uint64(4), unready2.LastExecuteHeight) + require.Equal(t, uint64(6), ready3.LastExecuteHeight) + require.Equal(t, uint64(7), ready4.LastExecuteHeight) } func TestAddSchedule(t *testing.T) { @@ -183,11 +227,19 @@ func TestAddSchedule(t *testing.T) { Contract: "c", Msg: "m", }, - }) + }, types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER) + require.NoError(t, err) + + err = k.AddSchedule(ctx, "b", 7, []types.MsgExecuteContract{ + { + Contract: "c", + Msg: "m", + }, + }, types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER) require.NoError(t, err) // second time with same name returns error - err = k.AddSchedule(ctx, "a", 5, []types.MsgExecuteContract{}) + err = k.AddSchedule(ctx, "a", 5, []types.MsgExecuteContract{}, types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER) require.Error(t, err) scheduleA, found := k.GetSchedule(ctx, "a") @@ -197,6 +249,12 @@ func TestAddSchedule(t *testing.T) { require.Equal(t, scheduleA.Msgs, []types.MsgExecuteContract{ {Contract: "c", Msg: "m"}, }) + require.Equal(t, scheduleA.ExecutionStage, types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER) + + schedules := k.GetAllSchedules(ctx) + require.Len(t, schedules, 2) + require.Equal(t, schedules[0].ExecutionStage, types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER) + require.Equal(t, schedules[1].ExecutionStage, types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER) // remove schedule works k.RemoveSchedule(ctx, "a") @@ -223,9 +281,10 @@ func TestGetAllSchedules(t *testing.T) { Period: 5, Msgs: nil, LastExecuteHeight: uint64(ctx.BlockHeight()), + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER, } expectedSchedules = append(expectedSchedules, s) - err := k.AddSchedule(ctx, s.Name, s.Period, s.Msgs) + err := k.AddSchedule(ctx, s.Name, s.Period, s.Msgs, s.ExecutionStage) require.NoError(t, err) } diff --git a/x/cron/keeper/migrations.go b/x/cron/keeper/migrations.go new file mode 100644 index 000000000..b4c394bb1 --- /dev/null +++ b/x/cron/keeper/migrations.go @@ -0,0 +1,22 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + v2 "github.com/neutron-org/neutron/v5/x/cron/migrations/v2" +) + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + keeper Keeper +} + +// NewMigrator returns a new Migrator. +func NewMigrator(keeper Keeper) Migrator { + return Migrator{keeper: keeper} +} + +// Migrate1to2 migrates from version 1 to 2. +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + return v2.MigrateStore(ctx, m.keeper.cdc, m.keeper.storeKey) +} diff --git a/x/cron/keeper/msg_server.go b/x/cron/keeper/msg_server.go index e49e578ab..ccb0bcbc4 100644 --- a/x/cron/keeper/msg_server.go +++ b/x/cron/keeper/msg_server.go @@ -7,34 +7,70 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) type msgServer struct { - Keeper + keeper Keeper } // NewMsgServerImpl returns an implementation of the MsgServer interface // for the provided Keeper. func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} + return &msgServer{keeper: keeper} } var _ types.MsgServer = msgServer{} +// AddSchedule adds new schedule +func (k msgServer) AddSchedule(goCtx context.Context, req *types.MsgAddSchedule) (*types.MsgAddScheduleResponse, error) { + if err := req.Validate(); err != nil { + return nil, errors.Wrap(err, "failed to validate MsgAddSchedule") + } + + authority := k.keeper.GetAuthority() + if authority != req.Authority { + return nil, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid authority; expected %s, got %s", authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := k.keeper.AddSchedule(ctx, req.Name, req.Period, req.Msgs, req.ExecutionStage); err != nil { + return nil, errors.Wrap(err, "failed to add schedule") + } + + return &types.MsgAddScheduleResponse{}, nil +} + +// RemoveSchedule removes schedule +func (k msgServer) RemoveSchedule(goCtx context.Context, req *types.MsgRemoveSchedule) (*types.MsgRemoveScheduleResponse, error) { + if err := req.Validate(); err != nil { + return nil, errors.Wrap(err, "failed to validate MsgRemoveSchedule") + } + + authority := k.keeper.GetAuthority() + if authority != req.Authority { + return nil, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid authority; expected %s, got %s", authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + k.keeper.RemoveSchedule(ctx, req.Name) + + return &types.MsgRemoveScheduleResponse{}, nil +} + // UpdateParams updates the module parameters -func (k Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { +func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if err := req.Validate(); err != nil { return nil, errors.Wrap(err, "failed to validate MsgUpdateParams") } - authority := k.GetAuthority() + authority := k.keeper.GetAuthority() if authority != req.Authority { return nil, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid authority; expected %s, got %s", authority, req.Authority) } ctx := sdk.UnwrapSDKContext(goCtx) - if err := k.SetParams(ctx, req.Params); err != nil { + if err := k.keeper.SetParams(ctx, req.Params); err != nil { return nil, err } diff --git a/x/cron/keeper/msg_server_test.go b/x/cron/keeper/msg_server_test.go index 17a3655ac..b8f318515 100644 --- a/x/cron/keeper/msg_server_test.go +++ b/x/cron/keeper/msg_server_test.go @@ -5,13 +5,172 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/testutil/cron/keeper" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/testutil" + testkeeper "github.com/neutron-org/neutron/v5/testutil/cron/keeper" + cronkeeper "github.com/neutron-org/neutron/v5/x/cron/keeper" + "github.com/neutron-org/neutron/v5/x/cron/types" ) +func TestMsgAddScheduleValidate(t *testing.T) { + k, ctx := testkeeper.CronKeeper(t, nil, nil) + msgServer := cronkeeper.NewMsgServerImpl(*k) + + tests := []struct { + name string + msg types.MsgAddSchedule + expectedErr string + }{ + { + "empty authority", + types.MsgAddSchedule{ + Authority: "", + Name: "name", + Period: 3, + Msgs: []types.MsgExecuteContract{ + { + Contract: "contract", + Msg: "msg", + }, + }, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, + }, + "authority is invalid", + }, + { + "invalid authority", + types.MsgAddSchedule{ + Authority: "invalid authority", + Name: "name", + Period: 3, + Msgs: []types.MsgExecuteContract{ + { + Contract: "contract", + Msg: "msg", + }, + }, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, + }, + "authority is invalid", + }, + { + "invalid name", + types.MsgAddSchedule{ + Authority: testutil.TestOwnerAddress, + Name: "", + Period: 3, + Msgs: []types.MsgExecuteContract{ + { + Contract: "contract", + Msg: "msg", + }, + }, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, + }, + "name is invalid", + }, + { + "invalid period", + types.MsgAddSchedule{ + Authority: testutil.TestOwnerAddress, + Name: "name", + Period: 0, + Msgs: []types.MsgExecuteContract{ + { + Contract: "contract", + Msg: "msg", + }, + }, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, + }, + "period is invalid", + }, + { + "empty msgs", + types.MsgAddSchedule{ + Authority: testutil.TestOwnerAddress, + Name: "name", + Period: 3, + Msgs: []types.MsgExecuteContract{}, + ExecutionStage: types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER, + }, + "msgs should not be empty", + }, + { + "invalid execution stage", + types.MsgAddSchedule{ + Authority: testutil.TestOwnerAddress, + Name: "name", + Period: 3, + Msgs: []types.MsgExecuteContract{ + { + Contract: "contract", + Msg: "msg", + }, + }, + ExecutionStage: 7, + }, + "execution stage is invalid", + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + resp, err := msgServer.AddSchedule(ctx, &tt.msg) + require.ErrorContains(t, err, tt.expectedErr) + require.Nil(t, resp) + }) + } +} + +func TestMsgRemoveScheduleValidate(t *testing.T) { + k, ctx := testkeeper.CronKeeper(t, nil, nil) + msgServer := cronkeeper.NewMsgServerImpl(*k) + + tests := []struct { + name string + msg types.MsgRemoveSchedule + expectedErr string + }{ + { + "empty authority", + types.MsgRemoveSchedule{ + Authority: "", + Name: "name", + }, + "authority is invalid", + }, + { + "invalid authority", + types.MsgRemoveSchedule{ + Authority: "invalid authority", + Name: "name", + }, + "authority is invalid", + }, + { + "invalid name", + types.MsgRemoveSchedule{ + Authority: testutil.TestOwnerAddress, + Name: "", + }, + "name is invalid", + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + resp, err := msgServer.RemoveSchedule(ctx, &tt.msg) + require.ErrorContains(t, err, tt.expectedErr) + require.Nil(t, resp) + }) + } +} + func TestMsgUpdateParamsValidate(t *testing.T) { - k, ctx := keeper.CronKeeper(t, nil, nil) + k, ctx := testkeeper.CronKeeper(t, nil, nil) + msgServer := cronkeeper.NewMsgServerImpl(*k) tests := []struct { name string @@ -57,7 +216,7 @@ func TestMsgUpdateParamsValidate(t *testing.T) { for _, tt := range tests { tt := tt t.Run(tt.name, func(t *testing.T) { - resp, err := k.UpdateParams(ctx, &tt.msg) + resp, err := msgServer.UpdateParams(ctx, &tt.msg) require.ErrorContains(t, err, tt.expectedErr) require.Nil(t, resp) }) diff --git a/x/cron/keeper/params.go b/x/cron/keeper/params.go index 5d0b64820..81b7321e4 100644 --- a/x/cron/keeper/params.go +++ b/x/cron/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) // GetParams get all parameters as types.Params diff --git a/x/cron/keeper/params_test.go b/x/cron/keeper/params_test.go index c31624ca9..be0630f66 100644 --- a/x/cron/keeper/params_test.go +++ b/x/cron/keeper/params_test.go @@ -3,15 +3,15 @@ package keeper_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" - "github.com/neutron-org/neutron/v4/testutil" + "github.com/neutron-org/neutron/v5/testutil" - testkeeper "github.com/neutron-org/neutron/v4/testutil/cron/keeper" + testkeeper "github.com/neutron-org/neutron/v5/testutil/cron/keeper" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func TestGetParams(t *testing.T) { diff --git a/x/cron/migrations/v2/store.go b/x/cron/migrations/v2/store.go new file mode 100644 index 000000000..dae71e591 --- /dev/null +++ b/x/cron/migrations/v2/store.go @@ -0,0 +1,56 @@ +package v2 + +import ( + "cosmossdk.io/errors" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/cron/types" +) + +// MigrateStore performs in-place store migrations. +// The migration adds execution stage for schedules. +func MigrateStore(ctx sdk.Context, cdc codec.BinaryCodec, storeKey storetypes.StoreKey) error { + return migrateSchedules(ctx, cdc, storeKey) +} + +type migrationUpdate struct { + key []byte + val []byte +} + +func migrateSchedules(ctx sdk.Context, cdc codec.BinaryCodec, storeKey storetypes.StoreKey) error { + ctx.Logger().Info("Migrating cron Schedules...") + + store := prefix.NewStore(ctx.KVStore(storeKey), types.ScheduleKey) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + schedulesToUpdate := make([]migrationUpdate, 0) + + for ; iterator.Valid(); iterator.Next() { + var schedule types.Schedule + cdc.MustUnmarshal(iterator.Value(), &schedule) + // Set execution in EndBlocker + schedule.ExecutionStage = types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER + + schedulesToUpdate = append(schedulesToUpdate, migrationUpdate{ + key: iterator.Key(), + val: cdc.MustMarshal(&schedule), + }) + } + + err := iterator.Close() + if err != nil { + return errors.Wrap(err, "iterator failed to close during migration") + } + + // Store the updated Schedules + for _, v := range schedulesToUpdate { + store.Set(v.key, v.val) + } + + ctx.Logger().Info("Finished migrating cron Schedules...") + + return nil +} diff --git a/x/cron/migrations/v2/store_test.go b/x/cron/migrations/v2/store_test.go new file mode 100644 index 000000000..a1a3c4fef --- /dev/null +++ b/x/cron/migrations/v2/store_test.go @@ -0,0 +1,60 @@ +package v2_test + +import ( + "testing" + + "cosmossdk.io/store/prefix" + "github.com/stretchr/testify/suite" + + "github.com/neutron-org/neutron/v5/testutil" + v2 "github.com/neutron-org/neutron/v5/x/cron/migrations/v2" + "github.com/neutron-org/neutron/v5/x/cron/types" + v1types "github.com/neutron-org/neutron/v5/x/cron/types/v1" +) + +type V2CronMigrationTestSuite struct { + testutil.IBCConnectionTestSuite +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(V2CronMigrationTestSuite)) +} + +func (suite *V2CronMigrationTestSuite) TestScheduleUpgrade() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + storeKey = app.GetKey(types.StoreKey) + ctx = suite.ChainA.GetContext() + cdc = app.AppCodec() + ) + + schedule := v1types.Schedule{ + Name: "name", + Period: 3, + Msgs: []v1types.MsgExecuteContract{ + { + Contract: "contract", + Msg: "msg", + }, + }, + LastExecuteHeight: 1, + } + + store := prefix.NewStore(ctx.KVStore(storeKey), types.ScheduleKey) + bz := cdc.MustMarshal(&schedule) + store.Set(types.GetScheduleKey(schedule.Name), bz) + + // Run migration + suite.NoError(v2.MigrateStore(ctx, cdc, storeKey)) + + // Check Schedule has correct ExecutionStage + newSchedule, _ := app.CronKeeper.GetSchedule(ctx, schedule.Name) + suite.Equal(newSchedule.Name, schedule.Name) + suite.Equal(newSchedule.Period, schedule.Period) + for i, msg := range newSchedule.Msgs { + suite.Equal(msg.Contract, schedule.Msgs[i].Contract) + suite.Equal(msg.Msg, schedule.Msgs[i].Msg) + } + suite.Equal(newSchedule.LastExecuteHeight, schedule.LastExecuteHeight) + suite.Equal(newSchedule.ExecutionStage, types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER) +} diff --git a/x/cron/module.go b/x/cron/module.go index 60dc09b91..e86ee8745 100644 --- a/x/cron/module.go +++ b/x/cron/module.go @@ -20,14 +20,16 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/neutron-org/neutron/v4/x/cron/client/cli" - "github.com/neutron-org/neutron/v4/x/cron/keeper" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/client/cli" + "github.com/neutron-org/neutron/v5/x/cron/keeper" + "github.com/neutron-org/neutron/v5/x/cron/types" ) var ( - _ appmodule.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ appmodule.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ appmodule.HasBeginBlocker = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} ) // ---------------------------------------------------------------------------- @@ -155,10 +157,13 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return types.ConsensusVersion } // BeginBlock contains the logic that is automatically triggered at the beginning of each block -func (am AppModule) BeginBlock(_ sdk.Context) {} +func (am AppModule) BeginBlock(ctx context.Context) error { + am.keeper.ExecuteReadySchedules(sdk.UnwrapSDKContext(ctx), types.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER) + return nil +} // EndBlock contains the logic that is automatically triggered at the end of each block -func (am AppModule) EndBlock(ctx context.Context) ([]abci.ValidatorUpdate, error) { - am.keeper.ExecuteReadySchedules(sdk.UnwrapSDKContext(ctx)) - return []abci.ValidatorUpdate{}, nil +func (am AppModule) EndBlock(ctx context.Context) error { + am.keeper.ExecuteReadySchedules(sdk.UnwrapSDKContext(ctx), types.ExecutionStage_EXECUTION_STAGE_END_BLOCKER) + return nil } diff --git a/x/cron/module_simulation.go b/x/cron/module_simulation.go index 63c9dd7ae..0ada92486 100644 --- a/x/cron/module_simulation.go +++ b/x/cron/module_simulation.go @@ -7,8 +7,8 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - cronsimulation "github.com/neutron-org/neutron/v4/x/cron/simulation" - "github.com/neutron-org/neutron/v4/x/cron/types" + cronsimulation "github.com/neutron-org/neutron/v5/x/cron/simulation" + "github.com/neutron-org/neutron/v5/x/cron/types" ) // avoid unused import issue diff --git a/x/cron/types/codec.go b/x/cron/types/codec.go index a52eff2c6..6772e97b9 100644 --- a/x/cron/types/codec.go +++ b/x/cron/types/codec.go @@ -15,6 +15,8 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, + &MsgAddSchedule{}, + &MsgRemoveSchedule{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/cron/types/genesis.pb.go b/x/cron/types/genesis.pb.go index 2d3546994..b3678689b 100644 --- a/x/cron/types/genesis.pb.go +++ b/x/cron/types/genesis.pb.go @@ -23,7 +23,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GenesisState defines the cron module's genesis state. +// Defines the cron module's genesis state. type GenesisState struct { ScheduleList []Schedule `protobuf:"bytes,2,rep,name=scheduleList,proto3" json:"scheduleList"` Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` @@ -96,9 +96,9 @@ var fileDescriptor_7c41f2dea8ad83c2 = []byte{ 0x1b, 0x00, 0x96, 0x83, 0xea, 0x84, 0xaa, 0x74, 0xf2, 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, - 0xa8, 0x39, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0x89, 0x7e, 0x05, 0xc4, 0x67, 0x25, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x7f, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9b, - 0x07, 0x7e, 0x51, 0x51, 0x01, 0x00, 0x00, + 0xa8, 0x39, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0xa9, 0x7e, 0x05, 0xc4, 0x67, 0x25, + 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x7f, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x5b, + 0x63, 0x56, 0x46, 0x51, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/cron/types/genesis_test.go b/x/cron/types/genesis_test.go index ac1e2c69c..04d14471f 100644 --- a/x/cron/types/genesis_test.go +++ b/x/cron/types/genesis_test.go @@ -3,11 +3,11 @@ package types_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/cron/types" + "github.com/neutron-org/neutron/v5/x/cron/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/cron/types/params.pb.go b/x/cron/types/params.pb.go index c71904ce8..6f0715acb 100644 --- a/x/cron/types/params.pb.go +++ b/x/cron/types/params.pb.go @@ -23,7 +23,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Params defines the parameters for the module. +// Defines the parameters for the module. type Params struct { // Security address that can remove schedules SecurityAddress string `protobuf:"bytes,1,opt,name=security_address,json=securityAddress,proto3" json:"security_address,omitempty"` @@ -95,9 +95,9 @@ var fileDescriptor_efa4f5c14a68f6e5 = []byte{ 0x2b, 0x96, 0x19, 0x0b, 0xe4, 0x19, 0x9c, 0x3c, 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, 0x2f, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xea, - 0x32, 0xdd, 0xfc, 0xa2, 0x74, 0x18, 0x5b, 0xbf, 0xcc, 0x44, 0xbf, 0x02, 0xe2, 0x8b, 0x92, 0xca, - 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x0b, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x83, 0x18, - 0x33, 0xb9, 0xe2, 0x00, 0x00, 0x00, + 0x32, 0xdd, 0xfc, 0xa2, 0x74, 0x18, 0x5b, 0xbf, 0xcc, 0x54, 0xbf, 0x02, 0xe2, 0x8b, 0x92, 0xca, + 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x0b, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x43, 0x7c, + 0x1b, 0xae, 0xe2, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/cron/types/query.pb.go b/x/cron/types/query.pb.go index c34c6c3f9..4d8b3eedb 100644 --- a/x/cron/types/query.pb.go +++ b/x/cron/types/query.pb.go @@ -30,6 +30,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// The request type for the Query/Params RPC method. type QueryParamsRequest struct { } @@ -66,6 +67,7 @@ func (m *QueryParamsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo +// The response type for the Query/Params RPC method. type QueryParamsResponse struct { // params holds all the parameters of this module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` @@ -111,6 +113,7 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +// The request type for the Query/Schedule RPC method. type QueryGetScheduleRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } @@ -155,6 +158,7 @@ func (m *QueryGetScheduleRequest) GetName() string { return "" } +// The response type for the Query/Params RPC method. type QueryGetScheduleResponse struct { Schedule Schedule `protobuf:"bytes,1,opt,name=schedule,proto3" json:"schedule"` } @@ -199,6 +203,7 @@ func (m *QueryGetScheduleResponse) GetSchedule() Schedule { return Schedule{} } +// The request type for the Query/Schedules RPC method. type QuerySchedulesRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -243,6 +248,7 @@ func (m *QuerySchedulesRequest) GetPagination() *query.PageRequest { return nil } +// The response type for the Query/Params RPC method. type QuerySchedulesResponse struct { Schedules []Schedule `protobuf:"bytes,1,rep,name=schedules,proto3" json:"schedules"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -307,38 +313,38 @@ func init() { func init() { proto.RegisterFile("neutron/cron/query.proto", fileDescriptor_e02f33367c9498fe) } var fileDescriptor_e02f33367c9498fe = []byte{ - // 495 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xbf, 0x6e, 0x13, 0x41, - 0x10, 0xc6, 0x7d, 0x26, 0x58, 0xf1, 0x40, 0x35, 0x18, 0x63, 0x8e, 0x70, 0x09, 0x07, 0x09, 0x08, - 0x29, 0xbb, 0x8a, 0xa1, 0x40, 0x94, 0x29, 0x08, 0x74, 0xc1, 0x50, 0xd1, 0xa0, 0xb5, 0x59, 0x5d, - 0x2c, 0xe2, 0xdd, 0xcb, 0xed, 0x9e, 0x45, 0x84, 0x90, 0x10, 0x4f, 0x80, 0x44, 0xcd, 0xfb, 0xa4, - 0x8c, 0x44, 0x43, 0x85, 0x90, 0x4d, 0xcf, 0x2b, 0x44, 0xb7, 0x7f, 0x1c, 0x5f, 0x7c, 0x8a, 0x1b, - 0x6b, 0x75, 0xf3, 0xcd, 0xf7, 0xfd, 0x76, 0x67, 0x0c, 0x1d, 0xc1, 0x73, 0x9d, 0x49, 0x41, 0x07, - 0xc5, 0xcf, 0x51, 0xce, 0xb3, 0x63, 0x92, 0x66, 0x52, 0x4b, 0xbc, 0xee, 0x2a, 0xa4, 0xa8, 0x84, - 0x8f, 0x07, 0x52, 0x8d, 0xa4, 0xa2, 0x7d, 0xa6, 0xb8, 0x95, 0xd1, 0xf1, 0x4e, 0x9f, 0x6b, 0xb6, - 0x43, 0x53, 0x96, 0x0c, 0x05, 0xd3, 0x43, 0x29, 0x6c, 0x67, 0xd8, 0x4a, 0x64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 0x29, 0xf6, 0xb9, 0x1c, 0xf7, 0x4a, 0x78, 0x75, 0x83, 0xf7, 0x70, 0x29, 0x9e, 0x0d, - 0x9e, 0xe7, 0xeb, 0xfe, 0xaf, 0xc3, 0x55, 0xc3, 0x87, 0x1f, 0xa1, 0x61, 0xe7, 0x84, 0x1b, 0x65, - 0x8a, 0xc5, 0x35, 0x08, 0xef, 0x5d, 0xa2, 0xb0, 0x21, 0xf1, 0xda, 0xb7, 0x5f, 0xff, 0x7e, 0xd4, - 0xdb, 0xd8, 0xa2, 0x15, 0x0b, 0x88, 0x5f, 0x03, 0x58, 0xf5, 0xb7, 0xc3, 0xcd, 0x0a, 0xb7, 0xc5, - 0xad, 0x08, 0xb7, 0x96, 0xc9, 0x5c, 0xf2, 0xa6, 0x49, 0x5e, 0xc7, 0xbb, 0xb4, 0x72, 0xbf, 0xe9, - 0xe7, 0x62, 0x9f, 0xbe, 0xe0, 0x18, 0x9a, 0xb3, 0x99, 0xe0, 0xfd, 0x0a, 0xef, 0x8b, 0x3b, 0x11, - 0x3e, 0xb8, 0x5c, 0xe4, 0xe2, 0x23, 0x13, 0xdf, 0xc1, 0x76, 0x75, 0xfc, 0xee, 0xcb, 0x93, 0x49, - 0x14, 0x9c, 0x4e, 0xa2, 0xe0, 0xef, 0x24, 0x0a, 0xbe, 0x4f, 0xa3, 0xda, 0xe9, 0x34, 0xaa, 0xfd, - 0x9e, 0x46, 0xb5, 0x77, 0x24, 0x19, 0xea, 0x83, 0xbc, 0x4f, 0x06, 0x72, 0xe4, 0x7b, 0xb7, 0x65, - 0x96, 0xcc, 0x7c, 0xc6, 0x4f, 0xe9, 0x27, 0x6b, 0xa6, 0x8f, 0x53, 0xae, 0xfa, 0x0d, 0xf3, 0x4f, - 0x7d, 0x72, 0x16, 0x00, 0x00, 0xff, 0xff, 0x89, 0x23, 0xc7, 0x75, 0x6b, 0x04, 0x00, 0x00, + // 496 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xc7, 0xb3, 0xb1, 0x86, 0xe6, 0xe9, 0xe9, 0x19, 0x63, 0x5c, 0xeb, 0xb6, 0xae, 0xb6, 0x8a, + 0xd0, 0x19, 0x1a, 0x11, 0xc4, 0x63, 0x0f, 0x56, 0x6f, 0x35, 0x7a, 0xf2, 0x22, 0x93, 0x38, 0x6c, + 0x83, 0xcd, 0xcc, 0x76, 0x67, 0x36, 0x58, 0x44, 0x10, 0xff, 0x02, 0xc1, 0xb3, 0xff, 0x4f, 0x8f, + 0x05, 0x2f, 0x9e, 0x44, 0x12, 0xef, 0xfe, 0x0b, 0x65, 0xe7, 0x47, 0x9a, 0x6d, 0x96, 0xe6, 0x12, + 0x86, 0x7d, 0xdf, 0xf7, 0xfd, 0x7e, 0x66, 0xde, 0x0b, 0x74, 0x04, 0xcf, 0x75, 0x26, 0x05, 0x1d, + 0x14, 0x3f, 0x47, 0x39, 0xcf, 0x8e, 0x49, 0x9a, 0x49, 0x2d, 0xf1, 0xba, 0xab, 0x90, 0xa2, 0x12, + 0x3e, 0x1e, 0x48, 0x35, 0x92, 0x8a, 0xf6, 0x99, 0xe2, 0x56, 0x46, 0xc7, 0x3b, 0x7d, 0xae, 0xd9, + 0x0e, 0x4d, 0x59, 0x32, 0x14, 0x4c, 0x0f, 0xa5, 0xb0, 0x9d, 0x61, 0x2b, 0x91, 0x89, 0x34, 0x47, + 0x5a, 0x9c, 0xdc, 0xd7, 0xb5, 0x44, 0xca, 0xe4, 0x90, 0x53, 0x96, 0x0e, 0x29, 0x13, 0x42, 0x6a, + 0xd3, 0xa2, 0x5c, 0xf5, 0x76, 0x89, 0x23, 0x65, 0x19, 0x1b, 0xf9, 0xd2, 0x9d, 0x52, 0x49, 0x0d, + 0x0e, 0xf8, 0x87, 0xfc, 0x90, 0xdb, 0x62, 0xdc, 0x02, 0x7c, 0x5d, 0xd0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x63, 0x8b, 0x56, 0x2c, 0x20, 0x7e, 0x0d, 0x60, 0xd5, 0xdf, 0x0e, 0x37, 0x2b, 0xdc, 0x16, + 0xb7, 0x22, 0xdc, 0x5a, 0x26, 0x73, 0xc9, 0x9b, 0x26, 0x79, 0x1d, 0xef, 0xd2, 0xca, 0xfd, 0xa6, + 0x9f, 0x8b, 0x7d, 0xfa, 0x82, 0x63, 0x68, 0xce, 0x66, 0x82, 0xf7, 0x2b, 0xbc, 0x2f, 0xee, 0x44, + 0xf8, 0xe0, 0x72, 0x91, 0x8b, 0x8f, 0x4c, 0x7c, 0x07, 0xdb, 0xd5, 0xf1, 0xbb, 0x2f, 0x4f, 0x26, + 0x51, 0x70, 0x3a, 0x89, 0x82, 0xbf, 0x93, 0x28, 0xf8, 0x3e, 0x8d, 0x6a, 0xa7, 0xd3, 0xa8, 0xf6, + 0x7b, 0x1a, 0xd5, 0xde, 0x91, 0x64, 0xa8, 0x0f, 0xf2, 0x3e, 0x19, 0xc8, 0x91, 0xef, 0xdd, 0x96, + 0x59, 0x32, 0xf3, 0x19, 0x3f, 0xa5, 0x9f, 0xac, 0x99, 0x3e, 0x4e, 0xb9, 0xea, 0x37, 0xcc, 0x3f, + 0xf5, 0xc9, 0x59, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0x47, 0xef, 0x62, 0x6b, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/cron/types/schedule.pb.go b/x/cron/types/schedule.pb.go index cda29cf72..42fb227f7 100644 --- a/x/cron/types/schedule.pb.go +++ b/x/cron/types/schedule.pb.go @@ -23,15 +23,46 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// Defines when messages will be executed in the block +type ExecutionStage int32 + +const ( + // Execution at the end of the block + ExecutionStage_EXECUTION_STAGE_END_BLOCKER ExecutionStage = 0 + // Execution at the beginning of the block + ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER ExecutionStage = 1 +) + +var ExecutionStage_name = map[int32]string{ + 0: "EXECUTION_STAGE_END_BLOCKER", + 1: "EXECUTION_STAGE_BEGIN_BLOCKER", +} + +var ExecutionStage_value = map[string]int32{ + "EXECUTION_STAGE_END_BLOCKER": 0, + "EXECUTION_STAGE_BEGIN_BLOCKER": 1, +} + +func (x ExecutionStage) String() string { + return proto.EnumName(ExecutionStage_name, int32(x)) +} + +func (ExecutionStage) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_49ace1b59de613ef, []int{0} +} + +// Defines the schedule for execution type Schedule struct { // Name of schedule Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Period in blocks Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` - // Msgs that will be executed every period amount of time + // Msgs that will be executed every certain number of blocks, specified in the `period` field Msgs []MsgExecuteContract `protobuf:"bytes,3,rep,name=msgs,proto3" json:"msgs"` // Last execution's block height LastExecuteHeight uint64 `protobuf:"varint,4,opt,name=last_execute_height,json=lastExecuteHeight,proto3" json:"last_execute_height,omitempty"` + // Stage when messages will be executed + ExecutionStage ExecutionStage `protobuf:"varint,5,opt,name=execution_stage,json=executionStage,proto3,enum=neutron.cron.ExecutionStage" json:"execution_stage,omitempty"` } func (m *Schedule) Reset() { *m = Schedule{} } @@ -95,10 +126,18 @@ func (m *Schedule) GetLastExecuteHeight() uint64 { return 0 } +func (m *Schedule) GetExecutionStage() ExecutionStage { + if m != nil { + return m.ExecutionStage + } + return ExecutionStage_EXECUTION_STAGE_END_BLOCKER +} + +// Defines the contract and the message to pass type MsgExecuteContract struct { - // Contract is the address of the smart contract + // The address of the smart contract Contract string `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"` - // Msg is json encoded message to be passed to the contract + // JSON encoded message to be passed to the contract Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` } @@ -149,8 +188,9 @@ func (m *MsgExecuteContract) GetMsg() string { return "" } +// Defines the number of current schedules type ScheduleCount struct { - // Count is the number of current schedules + // The number of current schedules Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` } @@ -195,6 +235,7 @@ func (m *ScheduleCount) GetCount() int32 { } func init() { + proto.RegisterEnum("neutron.cron.ExecutionStage", ExecutionStage_name, ExecutionStage_value) proto.RegisterType((*Schedule)(nil), "neutron.cron.Schedule") proto.RegisterType((*MsgExecuteContract)(nil), "neutron.cron.MsgExecuteContract") proto.RegisterType((*ScheduleCount)(nil), "neutron.cron.ScheduleCount") @@ -203,27 +244,32 @@ func init() { func init() { proto.RegisterFile("neutron/cron/schedule.proto", fileDescriptor_49ace1b59de613ef) } var fileDescriptor_49ace1b59de613ef = []byte{ - // 309 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0x41, 0x4b, 0xfb, 0x30, - 0x18, 0xc6, 0x9b, 0xff, 0xba, 0xb1, 0xe5, 0xaf, 0xa0, 0x71, 0x48, 0x99, 0x10, 0x4b, 0x41, 0xe8, - 0xc5, 0x14, 0xd4, 0x93, 0xc7, 0x0e, 0x61, 0x17, 0x2f, 0xf5, 0xe6, 0x65, 0x74, 0x59, 0x48, 0x0b, - 0x6b, 0x53, 0x9a, 0x54, 0xe6, 0xb7, 0xf0, 0x33, 0xf8, 0x69, 0x76, 0xdc, 0xd1, 0x93, 0x48, 0xfb, - 0x45, 0x24, 0x69, 0x26, 0x82, 0x97, 0xf0, 0x7b, 0x78, 0xde, 0x27, 0xef, 0xfb, 0x26, 0xf0, 0xa2, - 0x64, 0x8d, 0xaa, 0x45, 0x19, 0x51, 0x7d, 0x48, 0x9a, 0xb1, 0x75, 0xb3, 0x61, 0xa4, 0xaa, 0x85, - 0x12, 0xe8, 0xc8, 0x9a, 0x44, 0x9b, 0xb3, 0x29, 0x17, 0x5c, 0x18, 0x23, 0xd2, 0xd4, 0xd7, 0x04, - 0xef, 0x00,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x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x19, 0x38, - 0x8d, 0xa3, 0x01, 0x00, 0x00, + // 393 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xc1, 0xaa, 0xd3, 0x40, + 0x18, 0x85, 0x33, 0x36, 0x2d, 0xed, 0xa8, 0xb5, 0x8e, 0x45, 0x42, 0xab, 0x69, 0x2c, 0x08, 0x41, + 0x30, 0x81, 0x8a, 0x1b, 0x77, 0x26, 0x0e, 0x6d, 0x51, 0x5b, 0x48, 0x2b, 0x88, 0x9b, 0x90, 0xa6, + 0xc3, 0x24, 0xd0, 0x64, 0x4a, 0x66, 0x22, 0xf5, 0x2d, 0x7c, 0xac, 0x2e, 0xbb, 0x74, 0x25, 0xd2, + 0xae, 0x7c, 0x8b, 0x4b, 0x26, 0x69, 0xb9, 0xbd, 0x77, 0x13, 0xce, 0xe1, 0x7c, 0x87, 0x7f, 0xe6, + 0xcf, 0xc0, 0x7e, 0x4a, 0x72, 0x91, 0xb1, 0xd4, 0x0e, 0x8b, 0x0f, 0x0f, 0x23, 0xb2, 0xce, 0x37, + 0xc4, 0xda, 0x66, 0x4c, 0x30, 0xf4, 0xa8, 0x0a, 0xad, 0x22, 0xec, 0x75, 0x29, 0xa3, 0x4c, 0x06, + 0x76, 0xa1, 0x4a, 0x66, 0xf8, 0x1f, 0xc0, 0xe6, 0xa2, 0xaa, 0x21, 0x04, 0xd5, 0x34, 0x48, 0x88, + 0x06, 0x0c, 0x60, 0xb6, 0x3c, 0xa9, 0xd1, 0x73, 0xd8, 0xd8, 0x92, 0x2c, 0x66, 0x6b, 0xed, 0x81, + 0x01, 0x4c, 0xd5, 0xab, 0x1c, 0xfa, 0x00, 0xd5, 0x84, 0x53, 0xae, 0xd5, 0x8c, 0x9a, 0xf9, 0x70, + 0x64, 0x58, 0xb7, 0x67, 0x59, 0x5f, 0x39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f2, 0xc3, 0xa2, 0xb1, 0x88, 0xf2, + 0x95, 0x15, 0xb2, 0xc4, 0xae, 0x56, 0xf2, 0x96, 0x65, 0xf4, 0xac, 0xed, 0x9f, 0xef, 0xed, 0x5d, + 0xf9, 0x46, 0xc4, 0xaf, 0x2d, 0xe1, 0xab, 0x86, 0xfc, 0xfb, 0xef, 0x6e, 0x02, 0x00, 0x00, 0xff, + 0xff, 0xee, 0xcd, 0x08, 0xb7, 0x40, 0x02, 0x00, 0x00, } func (m *Schedule) Marshal() (dAtA []byte, err error) { @@ -246,6 +292,11 @@ func (m *Schedule) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ExecutionStage != 0 { + i = encodeVarintSchedule(dAtA, i, uint64(m.ExecutionStage)) + i-- + dAtA[i] = 0x28 + } if m.LastExecuteHeight != 0 { i = encodeVarintSchedule(dAtA, i, uint64(m.LastExecuteHeight)) i-- @@ -378,6 +429,9 @@ func (m *Schedule) Size() (n int) { if m.LastExecuteHeight != 0 { n += 1 + sovSchedule(uint64(m.LastExecuteHeight)) } + if m.ExecutionStage != 0 { + n += 1 + sovSchedule(uint64(m.ExecutionStage)) + } return n } @@ -549,6 +603,25 @@ func (m *Schedule) Unmarshal(dAtA []byte) error { break } } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionStage", wireType) + } + m.ExecutionStage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchedule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecutionStage |= ExecutionStage(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipSchedule(dAtA[iNdEx:]) diff --git a/x/cron/types/tx.go b/x/cron/types/tx.go index eb48677cb..27b4ceec4 100644 --- a/x/cron/types/tx.go +++ b/x/cron/types/tx.go @@ -1,10 +1,95 @@ package types import ( - errorsmod "cosmossdk.io/errors" + "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) +var _ sdk.Msg = &MsgAddSchedule{} + +func (msg *MsgAddSchedule) Route() string { + return RouterKey +} + +func (msg *MsgAddSchedule) Type() string { + return "add-schedule" +} + +func (msg *MsgAddSchedule) 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 *MsgAddSchedule) GetSignBytes() []byte { + return ModuleCdc.MustMarshalJSON(msg) +} + +func (msg *MsgAddSchedule) Validate() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errors.Wrap(err, "authority is invalid") + } + + if msg.Name == "" { + return errors.Wrap(sdkerrors.ErrInvalidRequest, "name is invalid") + } + + if msg.Period == 0 { + return errors.Wrap(sdkerrors.ErrInvalidRequest, "period is invalid") + } + + if len(msg.Msgs) == 0 { + return errors.Wrap(sdkerrors.ErrInvalidRequest, "msgs should not be empty") + } + + if _, ok := ExecutionStage_name[int32(msg.ExecutionStage)]; !ok { + return errors.Wrap(sdkerrors.ErrInvalidRequest, "execution stage is invalid") + } + + return nil +} + +//---------------------------------------------------------------- + +var _ sdk.Msg = &MsgRemoveSchedule{} + +func (msg *MsgRemoveSchedule) Route() string { + return RouterKey +} + +func (msg *MsgRemoveSchedule) Type() string { + return "remove-schedule" +} + +func (msg *MsgRemoveSchedule) 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 *MsgRemoveSchedule) GetSignBytes() []byte { + return ModuleCdc.MustMarshalJSON(msg) +} + +func (msg *MsgRemoveSchedule) Validate() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errors.Wrap(err, "authority is invalid") + } + + if msg.Name == "" { + return errors.Wrap(sdkerrors.ErrInvalidRequest, "name is invalid") + } + + return nil +} + +//---------------------------------------------------------------- + var _ sdk.Msg = &MsgUpdateParams{} func (msg *MsgUpdateParams) Route() string { @@ -29,11 +114,11 @@ func (msg *MsgUpdateParams) GetSignBytes() []byte { func (msg *MsgUpdateParams) Validate() error { if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { - return errorsmod.Wrap(err, "authority is invalid") + return errors.Wrap(err, "authority is invalid") } if _, err := sdk.AccAddressFromBech32(msg.Params.SecurityAddress); err != nil { - return errorsmod.Wrap(err, "security_address is invalid") + return errors.Wrap(err, "security_address is invalid") } return nil diff --git a/x/cron/types/tx.pb.go b/x/cron/types/tx.pb.go index 217bb879c..c5ffb7299 100644 --- a/x/cron/types/tx.pb.go +++ b/x/cron/types/tx.pb.go @@ -31,13 +31,224 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgUpdateParams is the MsgUpdateParams request type. +// The MsgAddSchedule request type. +type MsgAddSchedule struct { + // The address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // Name of the schedule + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Period in blocks + Period uint64 `protobuf:"varint,3,opt,name=period,proto3" json:"period,omitempty"` + // Msgs that will be executed every certain number of blocks, specified in the `period` field + Msgs []MsgExecuteContract `protobuf:"bytes,4,rep,name=msgs,proto3" json:"msgs"` + // Stage when messages will be executed + ExecutionStage ExecutionStage `protobuf:"varint,5,opt,name=execution_stage,json=executionStage,proto3,enum=neutron.cron.ExecutionStage" json:"execution_stage,omitempty"` +} + +func (m *MsgAddSchedule) Reset() { *m = MsgAddSchedule{} } +func (m *MsgAddSchedule) String() string { return proto.CompactTextString(m) } +func (*MsgAddSchedule) ProtoMessage() {} +func (*MsgAddSchedule) Descriptor() ([]byte, []int) { + return fileDescriptor_c9e0a673aba8d6fd, []int{0} +} +func (m *MsgAddSchedule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddSchedule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddSchedule.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 *MsgAddSchedule) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddSchedule.Merge(m, src) +} +func (m *MsgAddSchedule) XXX_Size() int { + return m.Size() +} +func (m *MsgAddSchedule) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddSchedule.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddSchedule proto.InternalMessageInfo + +func (m *MsgAddSchedule) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgAddSchedule) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgAddSchedule) GetPeriod() uint64 { + if m != nil { + return m.Period + } + return 0 +} + +func (m *MsgAddSchedule) GetMsgs() []MsgExecuteContract { + if m != nil { + return m.Msgs + } + return nil +} + +func (m *MsgAddSchedule) GetExecutionStage() ExecutionStage { + if m != nil { + return m.ExecutionStage + } + return ExecutionStage_EXECUTION_STAGE_END_BLOCKER +} + +// Defines the response structure for executing a MsgAddSchedule message. +type MsgAddScheduleResponse struct { +} + +func (m *MsgAddScheduleResponse) Reset() { *m = MsgAddScheduleResponse{} } +func (m *MsgAddScheduleResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAddScheduleResponse) ProtoMessage() {} +func (*MsgAddScheduleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c9e0a673aba8d6fd, []int{1} +} +func (m *MsgAddScheduleResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddScheduleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddScheduleResponse.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 *MsgAddScheduleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddScheduleResponse.Merge(m, src) +} +func (m *MsgAddScheduleResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAddScheduleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddScheduleResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddScheduleResponse proto.InternalMessageInfo + +// The MsgRemoveSchedule request type. +type MsgRemoveSchedule struct { + // The address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // Name of the schedule + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *MsgRemoveSchedule) Reset() { *m = MsgRemoveSchedule{} } +func (m *MsgRemoveSchedule) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveSchedule) ProtoMessage() {} +func (*MsgRemoveSchedule) Descriptor() ([]byte, []int) { + return fileDescriptor_c9e0a673aba8d6fd, []int{2} +} +func (m *MsgRemoveSchedule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveSchedule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveSchedule.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 *MsgRemoveSchedule) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveSchedule.Merge(m, src) +} +func (m *MsgRemoveSchedule) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveSchedule) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveSchedule.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveSchedule proto.InternalMessageInfo + +func (m *MsgRemoveSchedule) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgRemoveSchedule) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Defines the response structure for executing a MsgRemoveSchedule message. +type MsgRemoveScheduleResponse struct { +} + +func (m *MsgRemoveScheduleResponse) Reset() { *m = MsgRemoveScheduleResponse{} } +func (m *MsgRemoveScheduleResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveScheduleResponse) ProtoMessage() {} +func (*MsgRemoveScheduleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c9e0a673aba8d6fd, []int{3} +} +func (m *MsgRemoveScheduleResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveScheduleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveScheduleResponse.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 *MsgRemoveScheduleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveScheduleResponse.Merge(m, src) +} +func (m *MsgRemoveScheduleResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveScheduleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveScheduleResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveScheduleResponse proto.InternalMessageInfo + +// The MsgUpdateParams request type. // // Since: 0.47 type MsgUpdateParams struct { - // Authority is the address of the governance account. + // The address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/cron parameters to update. + // Defines the x/cron parameters to update. // // NOTE: All parameters must be supplied. Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` @@ -47,7 +258,7 @@ 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_c9e0a673aba8d6fd, []int{0} + return fileDescriptor_c9e0a673aba8d6fd, []int{4} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,8 +301,7 @@ func (m *MsgUpdateParams) GetParams() Params { return Params{} } -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. +// Defines the response structure for executing a MsgUpdateParams message. // // Since: 0.47 type MsgUpdateParamsResponse struct { @@ -101,7 +311,7 @@ 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_c9e0a673aba8d6fd, []int{1} + return fileDescriptor_c9e0a673aba8d6fd, []int{5} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -131,6 +341,10 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgAddSchedule)(nil), "neutron.cron.MsgAddSchedule") + proto.RegisterType((*MsgAddScheduleResponse)(nil), "neutron.cron.MsgAddScheduleResponse") + proto.RegisterType((*MsgRemoveSchedule)(nil), "neutron.cron.MsgRemoveSchedule") + proto.RegisterType((*MsgRemoveScheduleResponse)(nil), "neutron.cron.MsgRemoveScheduleResponse") proto.RegisterType((*MsgUpdateParams)(nil), "neutron.cron.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "neutron.cron.MsgUpdateParamsResponse") } @@ -138,28 +352,42 @@ func init() { func init() { proto.RegisterFile("neutron/cron/tx.proto", fileDescriptor_c9e0a673aba8d6fd) } var fileDescriptor_c9e0a673aba8d6fd = []byte{ - // 335 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0x4b, 0x2d, 0x2d, - 0x29, 0xca, 0xcf, 0xd3, 0x4f, 0x06, 0x11, 0x25, 0x15, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, - 0x3c, 0x50, 0x61, 0x3d, 0x90, 0xb0, 0x94, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, - 0x28, 0x90, 0x12, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, 0x4e, 0xd7, 0x2f, 0x33, - 0x04, 0x51, 0x50, 0x09, 0x49, 0x88, 0x44, 0x3c, 0x98, 0xa7, 0x0f, 0xe1, 0x40, 0xa5, 0x44, 0xd2, - 0xf3, 0xd3, 0xf3, 0x21, 0xe2, 0x20, 0x16, 0x4c, 0x03, 0x8a, 0x0b, 0x0a, 0x12, 0x8b, 0x12, 0x73, - 0xa1, 0x1a, 0x94, 0x56, 0x33, 0x72, 0xf1, 0xfb, 0x16, 0xa7, 0x87, 0x16, 0xa4, 0x24, 0x96, 0xa4, - 0x06, 0x80, 0x65, 0x84, 0xcc, 0xb8, 0x38, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, - 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0xda, 0xe4, 0x98, - 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x1c, 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0x84, 0x50, 0x2a, 0x64, - 0xce, 0xc5, 0x06, 0x31, 0x5b, 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x44, 0x0f, 0xd9, 0x8b, - 0x7a, 0x10, 0xd3, 0x9d, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, - 0x54, 0xb9, 0x95, 0x7a, 0xd3, 0xf3, 0x0d, 0x5a, 0x08, 0x83, 0xba, 0x9e, 0x6f, 0xd0, 0x12, 0x01, - 0x3b, 0x15, 0xcd, 0x65, 0x4a, 0x92, 0x5c, 0xe2, 0x68, 0x42, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, - 0xc5, 0xa9, 0x46, 0x49, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x21, 0x5c, 0x3c, 0x28, 0x7e, 0x91, - 0x45, 0x75, 0x03, 0x9a, 0x6e, 0x29, 0x55, 0xbc, 0xd2, 0x30, 0xc3, 0xa5, 0x58, 0x1b, 0x40, 0xee, - 0x75, 0xf2, 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, 0xbd, 0xf4, 0xcc, - 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, 0x89, 0xba, 0xf9, 0x45, 0xe9, 0x30, - 0xb6, 0x7e, 0x99, 0x89, 0x7e, 0x05, 0x34, 0xfe, 0x2b, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xa1, - 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x60, 0xa1, 0xa6, 0xeb, 0x1c, 0x02, 0x00, 0x00, + // 554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xbf, 0x6b, 0xdb, 0x40, + 0x14, 0xf6, 0xd9, 0x8e, 0xc1, 0xe7, 0xe0, 0x10, 0xd5, 0x75, 0x64, 0x25, 0x55, 0x8c, 0x68, 0x1b, + 0xd7, 0x10, 0x89, 0xba, 0xb4, 0x05, 0x6f, 0x71, 0x31, 0x74, 0x11, 0xb4, 0x72, 0xbb, 0x64, 0x09, + 0x8a, 0x74, 0x9c, 0x05, 0x95, 0x4e, 0xe8, 0x4e, 0xc6, 0xd9, 0x4a, 0xc7, 0x4c, 0xed, 0x5f, 0xd0, + 0xb5, 0xd0, 0xc5, 0x43, 0xff, 0x88, 0x8c, 0xa1, 0x53, 0xa7, 0x52, 0xec, 0xc1, 0xff, 0x46, 0xd1, + 0xaf, 0x44, 0x17, 0x41, 0x0a, 0x85, 0x2c, 0xa7, 0x7b, 0xef, 0xfb, 0xde, 0xd3, 0x77, 0xdf, 0x3d, + 0x0e, 0xde, 0xf7, 0x50, 0xc8, 0x02, 0xe2, 0x69, 0x56, 0xb4, 0xb0, 0xb9, 0xea, 0x07, 0x84, 0x11, + 0x61, 0x33, 0x4d, 0xab, 0x51, 0x5a, 0xda, 0x36, 0x5d, 0xc7, 0x23, 0x5a, 0xbc, 0x26, 0x04, 0x69, + 0xc7, 0x22, 0xd4, 0x25, 0x54, 0x73, 0x29, 0xd6, 0x66, 0x4f, 0xa3, 0x4f, 0x0a, 0x74, 0x12, 0xe0, + 0x24, 0x8e, 0xb4, 0x24, 0x48, 0xa1, 0x16, 0x26, 0x98, 0x24, 0xf9, 0x68, 0x97, 0x15, 0x70, 0x0a, + 0x7c, 0x33, 0x30, 0xdd, 0xac, 0x60, 0x97, 0x83, 0xa8, 0x35, 0x45, 0x76, 0xf8, 0x01, 0x25, 0xa0, + 0xf2, 0xb5, 0x0c, 0x9b, 0x3a, 0xc5, 0x47, 0xb6, 0x3d, 0x49, 0x01, 0xe1, 0x05, 0xac, 0x9b, 0x21, + 0x9b, 0x92, 0xc0, 0x61, 0x67, 0x22, 0xe8, 0x82, 0x5e, 0x7d, 0x24, 0xfe, 0xfc, 0x71, 0xd8, 0x4a, + 0x55, 0x1c, 0xd9, 0x76, 0x80, 0x28, 0x9d, 0xb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0x4f, 0xba, 0x8f, + 0xea, 0xd1, 0x85, 0x7d, 0x5b, 0x2f, 0xfa, 0xc0, 0x48, 0xe9, 0xc3, 0x83, 0xe2, 0x61, 0x5a, 0xd9, + 0x61, 0xf2, 0xca, 0x94, 0x0e, 0xdc, 0xb9, 0x91, 0xca, 0x0e, 0x32, 0xf8, 0x52, 0x86, 0x15, 0x9d, + 0x62, 0xe1, 0x2d, 0x6c, 0xe4, 0x47, 0x76, 0xaf, 0x30, 0x40, 0x39, 0x54, 0x7a, 0x78, 0x1b, 0x9a, + 0xb5, 0x16, 0x8e, 0x61, 0xf3, 0xc6, 0x4d, 0xee, 0x17, 0xea, 0x78, 0x82, 0x74, 0xf0, 0x0f, 0xc2, + 0x55, 0xef, 0x77, 0x70, 0x93, 0xf3, 0xfe, 0x41, 0xa1, 0x30, 0x0f, 0x4b, 0x8f, 0x6e, 0x85, 0xb3, + 0xae, 0xd2, 0xc6, 0xc7, 0xc8, 0xdf, 0xd1, 0xeb, 0x8b, 0xa5, 0x0c, 0x2e, 0x97, 0x32, 0xf8, 0xb3, + 0x94, 0xc1, 0xe7, 0x95, 0x5c, 0xba, 0x5c, 0xc9, 0xa5, 0x5f, 0x2b, 0xb9, 0x74, 0xac, 0x62, 0x87, + 0x4d, 0xc3, 0x53, 0xd5, 0x22, 0xae, 0x96, 0x76, 0x3c, 0x24, 0x01, 0xce, 0xf6, 0xda, 0xec, 0xb9, + 0x36, 0x4f, 0x9f, 0xac, 0x33, 0x1f, 0xd1, 0xd3, 0x5a, 0xfc, 0x26, 0x3c, 0xfb, 0x1b, 0x00, 0x00, + 0xff, 0xff, 0x37, 0xae, 0x51, 0x3e, 0xcf, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -174,6 +402,11 @@ 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 { + // Adds new schedule. + AddSchedule(ctx context.Context, in *MsgAddSchedule, opts ...grpc.CallOption) (*MsgAddScheduleResponse, error) + // Removes schedule. + RemoveSchedule(ctx context.Context, in *MsgRemoveSchedule, opts ...grpc.CallOption) (*MsgRemoveScheduleResponse, error) + // Updates the module parameters. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } @@ -185,6 +418,24 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) AddSchedule(ctx context.Context, in *MsgAddSchedule, opts ...grpc.CallOption) (*MsgAddScheduleResponse, error) { + out := new(MsgAddScheduleResponse) + err := c.cc.Invoke(ctx, "/neutron.cron.Msg/AddSchedule", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RemoveSchedule(ctx context.Context, in *MsgRemoveSchedule, opts ...grpc.CallOption) (*MsgRemoveScheduleResponse, error) { + out := new(MsgRemoveScheduleResponse) + err := c.cc.Invoke(ctx, "/neutron.cron.Msg/RemoveSchedule", in, out, opts...) + if err != nil { + return nil, err + } + 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, "/neutron.cron.Msg/UpdateParams", in, out, opts...) @@ -196,6 +447,11 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. type MsgServer interface { + // Adds new schedule. + AddSchedule(context.Context, *MsgAddSchedule) (*MsgAddScheduleResponse, error) + // Removes schedule. + RemoveSchedule(context.Context, *MsgRemoveSchedule) (*MsgRemoveScheduleResponse, error) + // Updates the module parameters. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } @@ -203,6 +459,12 @@ type MsgServer interface { type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) AddSchedule(ctx context.Context, req *MsgAddSchedule) (*MsgAddScheduleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddSchedule not implemented") +} +func (*UnimplementedMsgServer) RemoveSchedule(ctx context.Context, req *MsgRemoveSchedule) (*MsgRemoveScheduleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveSchedule not implemented") +} func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } @@ -211,6 +473,42 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_AddSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddSchedule) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddSchedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.cron.Msg/AddSchedule", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddSchedule(ctx, req.(*MsgAddSchedule)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveSchedule) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveSchedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.cron.Msg/RemoveSchedule", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveSchedule(ctx, req.(*MsgRemoveSchedule)) + } + 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 { @@ -233,6 +531,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "neutron.cron.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "AddSchedule", + Handler: _Msg_AddSchedule_Handler, + }, + { + MethodName: "RemoveSchedule", + Handler: _Msg_RemoveSchedule_Handler, + }, { MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, @@ -242,7 +548,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "neutron/cron/tx.proto", } -func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { +func (m *MsgAddSchedule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -252,26 +558,47 @@ func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAddSchedule) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAddSchedule) 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 + if m.ExecutionStage != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ExecutionStage)) + i-- + dAtA[i] = 0x28 + } + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 + if m.Period != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Period)) + i-- + dAtA[i] = 0x18 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } if len(m.Authority) > 0 { i -= len(m.Authority) copy(dAtA[i:], m.Authority) @@ -282,7 +609,7 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgAddScheduleResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -292,12 +619,12 @@ func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAddScheduleResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAddScheduleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -305,46 +632,633 @@ func (m *MsgUpdateParamsResponse) 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 *MsgRemoveSchedule) 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 *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgRemoveSchedule) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveSchedule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n + 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) Size() (n int) { - if m == nil { - return 0 +func (m *MsgRemoveScheduleResponse) 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 *MsgRemoveScheduleResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveScheduleResponse) 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 sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgAddSchedule) 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 = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Period != 0 { + n += 1 + sovTx(uint64(m.Period)) + } + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.ExecutionStage != 0 { + n += 1 + sovTx(uint64(m.ExecutionStage)) + } + return n +} + +func (m *MsgAddScheduleResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveSchedule) 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 = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRemoveScheduleResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + 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 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAddSchedule) 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: MsgAddSchedule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddSchedule: 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 Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + m.Period = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Period |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", 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 + } + m.Msgs = append(m.Msgs, MsgExecuteContract{}) + if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionStage", wireType) + } + m.ExecutionStage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecutionStage |= ExecutionStage(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 *MsgAddScheduleResponse) 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: MsgAddScheduleResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddScheduleResponse: 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 *MsgRemoveSchedule) 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: MsgRemoveSchedule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveSchedule: 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 Name", 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.Name = 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 *MsgRemoveScheduleResponse) 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: MsgRemoveScheduleResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveScheduleResponse: 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 *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) diff --git a/x/cron/types/v1/schedule.pb.go b/x/cron/types/v1/schedule.pb.go new file mode 100644 index 000000000..a37932a39 --- /dev/null +++ b/x/cron/types/v1/schedule.pb.go @@ -0,0 +1,842 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: neutron/cron/v1/schedule.proto + +package v1 + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Defines the schedule for execution +type Schedule struct { + // Name of schedule + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Period in blocks + Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` + // Msgs that will be executed every certain number of blocks, specified in the `period` field + Msgs []MsgExecuteContract `protobuf:"bytes,3,rep,name=msgs,proto3" json:"msgs"` + // Last execution's block height + LastExecuteHeight uint64 `protobuf:"varint,4,opt,name=last_execute_height,json=lastExecuteHeight,proto3" json:"last_execute_height,omitempty"` +} + +func (m *Schedule) Reset() { *m = Schedule{} } +func (m *Schedule) String() string { return proto.CompactTextString(m) } +func (*Schedule) ProtoMessage() {} +func (*Schedule) Descriptor() ([]byte, []int) { + return fileDescriptor_cd4938034d592826, []int{0} +} +func (m *Schedule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Schedule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Schedule.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 *Schedule) XXX_Merge(src proto.Message) { + xxx_messageInfo_Schedule.Merge(m, src) +} +func (m *Schedule) XXX_Size() int { + return m.Size() +} +func (m *Schedule) XXX_DiscardUnknown() { + xxx_messageInfo_Schedule.DiscardUnknown(m) +} + +var xxx_messageInfo_Schedule proto.InternalMessageInfo + +func (m *Schedule) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Schedule) GetPeriod() uint64 { + if m != nil { + return m.Period + } + return 0 +} + +func (m *Schedule) GetMsgs() []MsgExecuteContract { + if m != nil { + return m.Msgs + } + return nil +} + +func (m *Schedule) GetLastExecuteHeight() uint64 { + if m != nil { + return m.LastExecuteHeight + } + return 0 +} + +// Defines the contract and the message to pass +type MsgExecuteContract struct { + // The address of the smart contract + Contract string `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"` + // JSON encoded message to be passed to the contract + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (m *MsgExecuteContract) Reset() { *m = MsgExecuteContract{} } +func (m *MsgExecuteContract) String() string { return proto.CompactTextString(m) } +func (*MsgExecuteContract) ProtoMessage() {} +func (*MsgExecuteContract) Descriptor() ([]byte, []int) { + return fileDescriptor_cd4938034d592826, []int{1} +} +func (m *MsgExecuteContract) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecuteContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecuteContract.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 *MsgExecuteContract) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecuteContract.Merge(m, src) +} +func (m *MsgExecuteContract) XXX_Size() int { + return m.Size() +} +func (m *MsgExecuteContract) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecuteContract.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecuteContract proto.InternalMessageInfo + +func (m *MsgExecuteContract) GetContract() string { + if m != nil { + return m.Contract + } + return "" +} + +func (m *MsgExecuteContract) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +// Defines the number of current schedules +type ScheduleCount struct { + // The number of current schedules + Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (m *ScheduleCount) Reset() { *m = ScheduleCount{} } +func (m *ScheduleCount) String() string { return proto.CompactTextString(m) } +func (*ScheduleCount) ProtoMessage() {} +func (*ScheduleCount) Descriptor() ([]byte, []int) { + return fileDescriptor_cd4938034d592826, []int{2} +} +func (m *ScheduleCount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ScheduleCount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ScheduleCount.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 *ScheduleCount) XXX_Merge(src proto.Message) { + xxx_messageInfo_ScheduleCount.Merge(m, src) +} +func (m *ScheduleCount) XXX_Size() int { + return m.Size() +} +func (m *ScheduleCount) XXX_DiscardUnknown() { + xxx_messageInfo_ScheduleCount.DiscardUnknown(m) +} + +var xxx_messageInfo_ScheduleCount proto.InternalMessageInfo + +func (m *ScheduleCount) GetCount() int32 { + if m != nil { + return m.Count + } + return 0 +} + +func init() { + proto.RegisterType((*Schedule)(nil), "neutron.cron.v1.Schedule") + proto.RegisterType((*MsgExecuteContract)(nil), "neutron.cron.v1.MsgExecuteContract") + proto.RegisterType((*ScheduleCount)(nil), "neutron.cron.v1.ScheduleCount") +} + +func init() { proto.RegisterFile("neutron/cron/v1/schedule.proto", fileDescriptor_cd4938034d592826) } + +var fileDescriptor_cd4938034d592826 = []byte{ + // 316 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xc1, 0x4a, 0xc3, 0x30, + 0x18, 0xc7, 0x1b, 0xd7, 0x8d, 0x2d, 0x22, 0x6a, 0x1c, 0x52, 0x76, 0x88, 0x63, 0x22, 0xec, 0x62, + 0x42, 0x15, 0x8f, 0x5e, 0x36, 0x04, 0x41, 0xbc, 0xd4, 0x9b, 0x97, 0xb1, 0x65, 0x21, 0x1d, 0xac, + 0x4d, 0x69, 0xd2, 0x32, 0xdf, 0xc2, 0x97, 0xf0, 0x5d, 0x76, 0xdc, 0xd1, 0x93, 0x48, 0xfb, 0x22, + 0x92, 0x34, 0xf3, 0xa0, 0x97, 0xf0, 0xfb, 0xf3, 0xff, 0xfe, 0xf9, 0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e0, 0xbb, 0xc2, 0xe0, 0xbd, 0xc6, 0xde, 0xae, 0xc6, 0xde, 0x67, 0x8d, 0xbd, 0xd7, 0x50, + 0xac, 0x74, 0x5c, 0x2c, 0x08, 0x93, 0x09, 0x75, 0xfb, 0x5e, 0xcb, 0x5c, 0xec, 0x99, 0x96, 0x77, + 0x74, 0xd3, 0xfc, 0x87, 0x7e, 0xcb, 0xb8, 0xa2, 0x65, 0xb8, 0xe8, 0xd8, 0x67, 0xbe, 0xfd, 0x09, + 0x00, 0x00, 0xff, 0xff, 0x43, 0xbd, 0xcc, 0x86, 0xaf, 0x01, 0x00, 0x00, +} + +func (m *Schedule) 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 *Schedule) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Schedule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LastExecuteHeight != 0 { + i = encodeVarintSchedule(dAtA, i, uint64(m.LastExecuteHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSchedule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Period != 0 { + i = encodeVarintSchedule(dAtA, i, uint64(m.Period)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintSchedule(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExecuteContract) 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 *MsgExecuteContract) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecuteContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintSchedule(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x12 + } + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintSchedule(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ScheduleCount) 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 *ScheduleCount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ScheduleCount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Count != 0 { + i = encodeVarintSchedule(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintSchedule(dAtA []byte, offset int, v uint64) int { + offset -= sovSchedule(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Schedule) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovSchedule(uint64(l)) + } + if m.Period != 0 { + n += 1 + sovSchedule(uint64(m.Period)) + } + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { + l = e.Size() + n += 1 + l + sovSchedule(uint64(l)) + } + } + if m.LastExecuteHeight != 0 { + n += 1 + sovSchedule(uint64(m.LastExecuteHeight)) + } + return n +} + +func (m *MsgExecuteContract) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovSchedule(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovSchedule(uint64(l)) + } + return n +} + +func (m *ScheduleCount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Count != 0 { + n += 1 + sovSchedule(uint64(m.Count)) + } + return n +} + +func sovSchedule(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSchedule(x uint64) (n int) { + return sovSchedule(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Schedule) 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 ErrIntOverflowSchedule + } + 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: Schedule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Schedule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchedule + } + 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 ErrInvalidLengthSchedule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSchedule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + m.Period = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchedule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Period |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchedule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSchedule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSchedule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msgs = append(m.Msgs, MsgExecuteContract{}) + if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastExecuteHeight", wireType) + } + m.LastExecuteHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchedule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastExecuteHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSchedule(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSchedule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecuteContract) 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 ErrIntOverflowSchedule + } + 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: MsgExecuteContract: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteContract: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchedule + } + 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 ErrInvalidLengthSchedule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSchedule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchedule + } + 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 ErrInvalidLengthSchedule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSchedule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSchedule(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSchedule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ScheduleCount) 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 ErrIntOverflowSchedule + } + 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: ScheduleCount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ScheduleCount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchedule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSchedule(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSchedule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSchedule(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSchedule + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSchedule + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSchedule + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSchedule + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSchedule + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSchedule + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSchedule = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSchedule = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSchedule = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/dex/client/cli/query.go b/x/dex/client/cli/query.go index b71cad5e4..aadd90629 100644 --- a/x/dex/client/cli/query.go +++ b/x/dex/client/cli/query.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/dex/client/cli/query_inactive_limit_order_tranche.go b/x/dex/client/cli/query_inactive_limit_order_tranche.go index ccfc3fa70..a408fb76c 100644 --- a/x/dex/client/cli/query_inactive_limit_order_tranche.go +++ b/x/dex/client/cli/query_inactive_limit_order_tranche.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/cast" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdListInactiveLimitOrderTranche() *cobra.Command { diff --git a/x/dex/client/cli/query_limit_order_tranche.go b/x/dex/client/cli/query_limit_order_tranche.go index 79b6998ea..d297e6a9e 100644 --- a/x/dex/client/cli/query_limit_order_tranche.go +++ b/x/dex/client/cli/query_limit_order_tranche.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdListLimitOrderTranche() *cobra.Command { diff --git a/x/dex/client/cli/query_limit_order_tranche_user.go b/x/dex/client/cli/query_limit_order_tranche_user.go index 14dec5263..baac20134 100644 --- a/x/dex/client/cli/query_limit_order_tranche_user.go +++ b/x/dex/client/cli/query_limit_order_tranche_user.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdListLimitOrderTrancheUser() *cobra.Command { diff --git a/x/dex/client/cli/query_params.go b/x/dex/client/cli/query_params.go index 13397f53c..dd9911b4c 100644 --- a/x/dex/client/cli/query_params.go +++ b/x/dex/client/cli/query_params.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/dex/client/cli/query_pool.go b/x/dex/client/cli/query_pool.go index 5d09944ce..1e5f0b035 100644 --- a/x/dex/client/cli/query_pool.go +++ b/x/dex/client/cli/query_pool.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdShowPool() *cobra.Command { diff --git a/x/dex/client/cli/query_pool_metadata.go b/x/dex/client/cli/query_pool_metadata.go index f7a79027d..dc7cceb2f 100644 --- a/x/dex/client/cli/query_pool_metadata.go +++ b/x/dex/client/cli/query_pool_metadata.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdListPoolMetadata() *cobra.Command { diff --git a/x/dex/client/cli/query_pool_reserves.go b/x/dex/client/cli/query_pool_reserves.go index 608fd7985..c11e5dc2b 100644 --- a/x/dex/client/cli/query_pool_reserves.go +++ b/x/dex/client/cli/query_pool_reserves.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdListPoolReserves() *cobra.Command { diff --git a/x/dex/client/cli/query_tick_liquidity.go b/x/dex/client/cli/query_tick_liquidity.go index 4b61177e8..2a1527fcc 100644 --- a/x/dex/client/cli/query_tick_liquidity.go +++ b/x/dex/client/cli/query_tick_liquidity.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdListTickLiquidity() *cobra.Command { diff --git a/x/dex/client/cli/query_user_deposits.go b/x/dex/client/cli/query_user_deposits.go index 66fbf0ee5..3b7108e99 100644 --- a/x/dex/client/cli/query_user_deposits.go +++ b/x/dex/client/cli/query_user_deposits.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdListUserDeposits() *cobra.Command { diff --git a/x/dex/client/cli/query_user_limit_orders.go b/x/dex/client/cli/query_user_limit_orders.go index 2026e743c..f5baac22f 100644 --- a/x/dex/client/cli/query_user_limit_orders.go +++ b/x/dex/client/cli/query_user_limit_orders.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdListUserLimitOrders() *cobra.Command { diff --git a/x/dex/client/cli/tx.go b/x/dex/client/cli/tx.go index 374c6b102..c9445af21 100644 --- a/x/dex/client/cli/tx.go +++ b/x/dex/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/dex/client/cli/tx_cancel_limit_order.go b/x/dex/client/cli/tx_cancel_limit_order.go index 8d73a5111..5bdb9ee91 100644 --- a/x/dex/client/cli/tx_cancel_limit_order.go +++ b/x/dex/client/cli/tx_cancel_limit_order.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdCancelLimitOrder() *cobra.Command { diff --git a/x/dex/client/cli/tx_deposit.go b/x/dex/client/cli/tx_deposit.go index 29ad39c36..dc0f3aeae 100644 --- a/x/dex/client/cli/tx_deposit.go +++ b/x/dex/client/cli/tx_deposit.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdDeposit() *cobra.Command { diff --git a/x/dex/client/cli/tx_multi_hop_swap.go b/x/dex/client/cli/tx_multi_hop_swap.go index a6d61c037..bc5b5ca70 100644 --- a/x/dex/client/cli/tx_multi_hop_swap.go +++ b/x/dex/client/cli/tx_multi_hop_swap.go @@ -11,8 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) var _ = strconv.Itoa(0) diff --git a/x/dex/client/cli/tx_place_limit_order.go b/x/dex/client/cli/tx_place_limit_order.go index 8c4419dbd..2b59e8c76 100644 --- a/x/dex/client/cli/tx_place_limit_order.go +++ b/x/dex/client/cli/tx_place_limit_order.go @@ -12,8 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdPlaceLimitOrder() *cobra.Command { diff --git a/x/dex/client/cli/tx_withdrawl.go b/x/dex/client/cli/tx_withdrawl.go index fd4247265..2be86cac3 100644 --- a/x/dex/client/cli/tx_withdrawl.go +++ b/x/dex/client/cli/tx_withdrawl.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdWithdrawal() *cobra.Command { diff --git a/x/dex/client/cli/tx_withdrawl_filled_limit_order.go b/x/dex/client/cli/tx_withdrawl_filled_limit_order.go index 0e947779a..80a6a7438 100644 --- a/x/dex/client/cli/tx_withdrawl_filled_limit_order.go +++ b/x/dex/client/cli/tx_withdrawl_filled_limit_order.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CmdWithdrawFilledLimitOrder() *cobra.Command { diff --git a/x/dex/genesis.go b/x/dex/genesis.go index 5e838a40a..06f984946 100644 --- a/x/dex/genesis.go +++ b/x/dex/genesis.go @@ -3,9 +3,9 @@ package dex import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/dex/genesis_test.go b/x/dex/genesis_test.go index 06dae9b4e..ec0f48331 100644 --- a/x/dex/genesis_test.go +++ b/x/dex/genesis_test.go @@ -7,10 +7,10 @@ import ( "cosmossdk.io/math" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestGenesis(t *testing.T) { @@ -27,7 +27,6 @@ func TestGenesis(t *testing.T) { Address: "fakeAddr", SharesOwned: math.NewInt(10), SharesWithdrawn: math.NewInt(0), - SharesCancelled: math.NewInt(0), }, { TradePairId: &types.TradePairID{ @@ -39,7 +38,6 @@ func TestGenesis(t *testing.T) { Address: "fakeAddr", SharesOwned: math.NewInt(10), SharesWithdrawn: math.NewInt(0), - SharesCancelled: math.NewInt(0), }, }, TickLiquidityList: []*types.TickLiquidity{ diff --git a/x/dex/keeper/cancel_limit_order.go b/x/dex/keeper/cancel_limit_order.go new file mode 100644 index 000000000..5eb0e70dd --- /dev/null +++ b/x/dex/keeper/cancel_limit_order.go @@ -0,0 +1,123 @@ +package keeper + +import ( + "context" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +// CancelLimitOrderCore handles the logic for MsgCancelLimitOrder including bank operations and event emissions. +func (k Keeper) CancelLimitOrderCore( + goCtx context.Context, + trancheKey string, + callerAddr sdk.AccAddress, +) (makerCoinOut, takerCoinOut sdk.Coin, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + makerCoinOut, takerCoinOut, err = k.ExecuteCancelLimitOrder(ctx, trancheKey, callerAddr) + if err != nil { + return sdk.Coin{}, sdk.Coin{}, err + } + + coinsOut := sdk.NewCoins(makerCoinOut, takerCoinOut) + err = k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + types.ModuleName, + callerAddr, + coinsOut, + ) + if err != nil { + return sdk.Coin{}, sdk.Coin{}, err + } + + makerDenom := makerCoinOut.Denom + takerDenom := takerCoinOut.Denom + // This will never panic since PairID has already been successfully constructed during tranche creation + pairID := types.MustNewPairID(makerDenom, takerDenom) + ctx.EventManager().EmitEvent(types.CancelLimitOrderEvent( + callerAddr, + pairID.Token0, + pairID.Token1, + makerDenom, + takerDenom, + takerCoinOut.Amount, + makerCoinOut.Amount, + trancheKey, + )) + + return makerCoinOut, takerCoinOut, nil +} + +// ExecuteCancelLimitOrder handles the core logic for CancelLimitOrder -- removing remaining TokenIn from the +// LimitOrderTranche and returning it to the user, updating the number of canceled shares on the LimitOrderTrancheUser. +// IT DOES NOT PERFORM ANY BANKING OPERATIONS +func (k Keeper) ExecuteCancelLimitOrder( + ctx sdk.Context, + trancheKey string, + callerAddr sdk.AccAddress, +) (makerCoinOut, takerCoinOut sdk.Coin, error error) { + trancheUser, found := k.GetLimitOrderTrancheUser(ctx, callerAddr.String(), trancheKey) + if !found { + return sdk.Coin{}, sdk.Coin{}, sdkerrors.Wrapf(types.ErrValidLimitOrderTrancheNotFound, "%s", trancheKey) + } + + tradePairID, tickIndex := trancheUser.TradePairId, trancheUser.TickIndexTakerToMaker + tranche, wasFilled, found := k.FindLimitOrderTranche( + ctx, + &types.LimitOrderTrancheKey{ + TradePairId: tradePairID, + TickIndexTakerToMaker: tickIndex, + TrancheKey: trancheKey, + }, + ) + if !found { + return sdk.Coin{}, sdk.Coin{}, sdkerrors.Wrapf(types.ErrValidLimitOrderTrancheNotFound, "%s", trancheKey) + } + + makerAmountToReturn := tranche.RemoveTokenIn(trancheUser) + _, takerAmountOut := tranche.Withdraw(trancheUser) + + // Remove the canceled shares from the maker side of the limitOrder + tranche.TotalMakerDenom = tranche.TotalMakerDenom.Sub(trancheUser.SharesOwned) + + // Calculate total number of shares removed previously withdrawn by the user (denominated in takerDenom) + sharesWithdrawnTakerDenom := math_utils.NewPrecDecFromInt(trancheUser.SharesWithdrawn). + Quo(tranche.PriceTakerToMaker). + TruncateInt() + + // Calculate the total amount removed including prior withdrawals (denominated in takerDenom) + totalAmountOutTakerDenom := sharesWithdrawnTakerDenom.Add(takerAmountOut) + + // Decrease the tranche TotalTakerDenom by the amount being removed + tranche.TotalTakerDenom = tranche.TotalTakerDenom.Sub(totalAmountOutTakerDenom) + + // Set TrancheUser to 100% shares withdrawn + trancheUser.SharesWithdrawn = trancheUser.SharesOwned + + if !makerAmountToReturn.IsPositive() && !takerAmountOut.IsPositive() { + return sdk.Coin{}, sdk.Coin{}, sdkerrors.Wrapf(types.ErrCancelEmptyLimitOrder, "%s", tranche.Key.TrancheKey) + } + + // This will ALWAYS result in a deletion of the TrancheUser, but we still use UpdateTranche user so that the relevant events will be emitted + k.UpdateTrancheUser(ctx, trancheUser) + + // If there is still liquidity from other shareholders we will either save the tranche as active/inactive or delete it entirely + if wasFilled { + k.UpdateInactiveTranche(ctx, tranche) + } else { + k.UpdateTranche(ctx, tranche) + } + + if trancheUser.OrderType.HasExpiration() { + k.RemoveLimitOrderExpiration(ctx, *tranche.ExpirationTime, tranche.Key.KeyMarshal()) + } + + makerCoinOut = sdk.NewCoin(tradePairID.MakerDenom, makerAmountToReturn) + takerCoinOut = sdk.NewCoin(tradePairID.TakerDenom, takerAmountOut) + + return makerCoinOut, takerCoinOut, nil +} diff --git a/x/dex/keeper/core.go b/x/dex/keeper/core.go deleted file mode 100644 index 04e0d29fa..000000000 --- a/x/dex/keeper/core.go +++ /dev/null @@ -1,629 +0,0 @@ -package keeper - -import ( - "context" - "errors" - "fmt" - "time" - - sdkerrors "cosmossdk.io/errors" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/neutron-org/neutron/v4/utils" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" -) - -// NOTE: Currently we are using TruncateInt in multiple places for converting Decs back into math.Ints. -// This may create some accounting anomalies but seems preferable to other alternatives. -// See full ADR here: https://www.notion.so/dualityxyz/A-Modest-Proposal-For-Truncating-696a919d59254876a617f82fb9567895 - -// Handles core logic for MsgDeposit, checking and initializing data structures (tick, pair), calculating -// shares based on amount deposited, and sending funds to moduleAddress. -func (k Keeper) DepositCore( - goCtx context.Context, - pairID *types.PairID, - callerAddr sdk.AccAddress, - receiverAddr sdk.AccAddress, - amounts0 []math.Int, - amounts1 []math.Int, - tickIndices []int64, - fees []uint64, - options []*types.DepositOptions, -) (amounts0Deposit, amounts1Deposit []math.Int, sharesIssued sdk.Coins, failedDeposits []*types.FailedDeposit, err error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - totalAmountReserve0 := math.ZeroInt() - totalAmountReserve1 := math.ZeroInt() - amounts0Deposited := make([]math.Int, len(amounts0)) - amounts1Deposited := make([]math.Int, len(amounts1)) - sharesIssued = sdk.Coins{} - - for i := 0; i < len(amounts0); i++ { - amounts0Deposited[i] = math.ZeroInt() - amounts1Deposited[i] = math.ZeroInt() - } - - for i, amount0 := range amounts0 { - amount1 := amounts1[i] - tickIndex := tickIndices[i] - fee := fees[i] - option := options[i] - if option == nil { - option = &types.DepositOptions{} - } - autoswap := !option.DisableAutoswap - - if err := k.ValidateFee(ctx, fee); err != nil { - return nil, nil, nil, failedDeposits, err - } - - if k.IsPoolBehindEnemyLines(ctx, pairID, tickIndex, fee, amount0, amount1) { - err = sdkerrors.Wrapf(types.ErrDepositBehindEnemyLines, - "deposit failed at tick %d fee %d", tickIndex, fee) - if option.FailTxOnBel { - return nil, nil, nil, failedDeposits, err - } - failedDeposits = append(failedDeposits, &types.FailedDeposit{DepositIdx: uint64(i), Error: err.Error()}) - continue - } - - pool, err := k.GetOrInitPool( - ctx, - pairID, - tickIndex, - fee, - ) - if err != nil { - return nil, nil, nil, failedDeposits, err - } - - existingShares := k.bankKeeper.GetSupply(ctx, pool.GetPoolDenom()).Amount - - inAmount0, inAmount1, outShares := pool.Deposit(amount0, amount1, existingShares, autoswap) - - k.SetPool(ctx, pool) - - if inAmount0.IsZero() && inAmount1.IsZero() { - return nil, nil, nil, failedDeposits, types.ErrZeroTrueDeposit - } - - if outShares.IsZero() { - return nil, nil, nil, failedDeposits, types.ErrDepositShareUnderflow - } - - sharesIssued = append(sharesIssued, outShares) - - amounts0Deposited[i] = inAmount0 - amounts1Deposited[i] = inAmount1 - totalAmountReserve0 = totalAmountReserve0.Add(inAmount0) - totalAmountReserve1 = totalAmountReserve1.Add(inAmount1) - - ctx.EventManager().EmitEvent(types.CreateDepositEvent( - callerAddr, - receiverAddr, - pairID.Token0, - pairID.Token1, - tickIndex, - fee, - inAmount0, - inAmount1, - outShares.Amount, - )) - } - - // At this point shares issued is not sorted and may have duplicates - // we must sanitize to convert it to a valid set of coins - sharesIssued = utils.SanitizeCoins(sharesIssued) - - if totalAmountReserve0.IsPositive() { - coin0 := sdk.NewCoin(pairID.Token0, totalAmountReserve0) - if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, callerAddr, types.ModuleName, sdk.Coins{coin0}); err != nil { - return nil, nil, nil, failedDeposits, err - } - } - - if totalAmountReserve1.IsPositive() { - coin1 := sdk.NewCoin(pairID.Token1, totalAmountReserve1) - if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, callerAddr, types.ModuleName, sdk.Coins{coin1}); err != nil { - return nil, nil, nil, failedDeposits, err - } - } - - if err := k.MintShares(ctx, receiverAddr, sharesIssued); err != nil { - return nil, nil, nil, failedDeposits, err - } - - return amounts0Deposited, amounts1Deposited, sharesIssued, failedDeposits, nil -} - -// Handles core logic for MsgWithdrawal; calculating and withdrawing reserve0,reserve1 from a specified tick -// given a specified number of shares to remove. -// Calculates the amount of reserve0, reserve1 to withdraw based on the percentage of the desired -// number of shares to remove compared to the total number of shares at the given tick. -func (k Keeper) WithdrawCore( - goCtx context.Context, - pairID *types.PairID, - callerAddr sdk.AccAddress, - receiverAddr sdk.AccAddress, - sharesToRemoveList []math.Int, - tickIndicesNormalized []int64, - fees []uint64, -) error { - ctx := sdk.UnwrapSDKContext(goCtx) - totalReserve0ToRemove := math.ZeroInt() - totalReserve1ToRemove := math.ZeroInt() - - for i, fee := range fees { - sharesToRemove := sharesToRemoveList[i] - tickIndex := tickIndicesNormalized[i] - - pool, err := k.GetOrInitPool(ctx, pairID, tickIndex, fee) - if err != nil { - return err - } - - poolDenom := pool.GetPoolDenom() - - totalShares := k.bankKeeper.GetSupply(ctx, poolDenom).Amount - if totalShares.LT(sharesToRemove) { - return sdkerrors.Wrapf( - types.ErrInsufficientShares, - "%s does not have %s shares of type %s", - callerAddr, - sharesToRemove, - poolDenom, - ) - } - - outAmount0, outAmount1 := pool.Withdraw(sharesToRemove, totalShares) - k.SetPool(ctx, pool) - - if sharesToRemove.IsPositive() { - if err := k.BurnShares(ctx, callerAddr, sharesToRemove, poolDenom); err != nil { - return err - } - } - - totalReserve0ToRemove = totalReserve0ToRemove.Add(outAmount0) - totalReserve1ToRemove = totalReserve1ToRemove.Add(outAmount1) - - ctx.EventManager().EmitEvent(types.CreateWithdrawEvent( - callerAddr, - receiverAddr, - pairID.Token0, - pairID.Token1, - tickIndex, - fee, - outAmount0, - outAmount1, - sharesToRemove, - )) - } - - if totalReserve0ToRemove.IsPositive() { - coin0 := sdk.NewCoin(pairID.Token0, totalReserve0ToRemove) - - err := k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - types.ModuleName, - receiverAddr, - sdk.Coins{coin0}, - ) - ctx.EventManager().EmitEvents(types.GetEventsWithdrawnAmount(sdk.Coins{coin0})) - if err != nil { - return err - } - } - - // sends totalReserve1ToRemove to receiverAddr - if totalReserve1ToRemove.IsPositive() { - coin1 := sdk.NewCoin(pairID.Token1, totalReserve1ToRemove) - err := k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - types.ModuleName, - receiverAddr, - sdk.Coins{coin1}, - ) - ctx.EventManager().EmitEvents(types.GetEventsWithdrawnAmount(sdk.Coins{coin1})) - if err != nil { - return err - } - } - - return nil -} - -func (k Keeper) MultiHopSwapCore( - goCtx context.Context, - amountIn math.Int, - routes []*types.MultiHopRoute, - exitLimitPrice math_utils.PrecDec, - pickBestRoute bool, - callerAddr sdk.AccAddress, - receiverAddr sdk.AccAddress, -) (coinOut sdk.Coin, err error) { - ctx := sdk.UnwrapSDKContext(goCtx) - var routeErrors []error - initialInCoin := sdk.NewCoin(routes[0].Hops[0], amountIn) - stepCache := make(map[multihopCacheKey]StepResult) - var bestRoute struct { - write func() - coinOut sdk.Coin - route []string - dust sdk.Coins - } - bestRoute.coinOut = sdk.Coin{Amount: math.ZeroInt()} - - for _, route := range routes { - routeDust, routeCoinOut, writeRoute, err := k.RunMultihopRoute( - ctx, - *route, - initialInCoin, - exitLimitPrice, - stepCache, - ) - if err != nil { - routeErrors = append(routeErrors, err) - continue - } - - if !pickBestRoute || bestRoute.coinOut.Amount.LT(routeCoinOut.Amount) { - bestRoute.coinOut = routeCoinOut - bestRoute.write = writeRoute - bestRoute.route = route.Hops - bestRoute.dust = routeDust - } - if !pickBestRoute { - break - } - } - - if len(routeErrors) == len(routes) { - // All routes have failed - - allErr := errors.Join(append([]error{types.ErrAllMultiHopRoutesFailed}, routeErrors...)...) - - return sdk.Coin{}, allErr - } - - bestRoute.write() - err = k.bankKeeper.SendCoinsFromAccountToModule( - ctx, - callerAddr, - types.ModuleName, - sdk.Coins{initialInCoin}, - ) - if err != nil { - return sdk.Coin{}, err - } - - // send both dust and coinOut to receiver - // note that dust can be multiple coins collected from multiple hops. - err = k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - types.ModuleName, - receiverAddr, - bestRoute.dust.Add(bestRoute.coinOut), - ) - if err != nil { - return sdk.Coin{}, fmt.Errorf("failed to send out coin and dust to the receiver: %w", err) - } - - ctx.EventManager().EmitEvent(types.CreateMultihopSwapEvent( - callerAddr, - receiverAddr, - initialInCoin.Denom, - bestRoute.coinOut.Denom, - initialInCoin.Amount, - bestRoute.coinOut.Amount, - bestRoute.route, - bestRoute.dust, - )) - - return bestRoute.coinOut, nil -} - -// PlaceLimitOrderCore handles MsgPlaceLimitOrder, initializing (tick, pair) data structures if needed, calculating and -// storing information for a new limit order at a specific tick. -func (k Keeper) PlaceLimitOrderCore( - goCtx context.Context, - tokenIn string, - tokenOut string, - amountIn math.Int, - tickIndexInToOut int64, - orderType types.LimitOrderType, - goodTil *time.Time, - maxAmountOut *math.Int, - callerAddr sdk.AccAddress, - receiverAddr sdk.AccAddress, -) (trancheKey string, totalInCoin, swapInCoin, swapOutCoin sdk.Coin, err error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - var pairID *types.PairID - pairID, err = types.NewPairIDFromUnsorted(tokenIn, tokenOut) - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - - amountLeft := amountIn - - // This is ok because tokenOut is provided to the constructor of PairID above - takerTradePairID := pairID.MustTradePairIDFromMaker(tokenOut) - var limitPrice math_utils.PrecDec - limitPrice, err = types.CalcPrice(tickIndexInToOut) - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - - // Ensure that after rounding user will get at least 1 token out. - err = types.ValidateFairOutput(amountIn, limitPrice) - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - - var orderFilled bool - if orderType.IsTakerOnly() { - swapInCoin, swapOutCoin, err = k.TakerLimitOrderSwap(ctx, *takerTradePairID, amountIn, maxAmountOut, limitPrice, orderType) - } else { - swapInCoin, swapOutCoin, orderFilled, err = k.MakerLimitOrderSwap(ctx, *takerTradePairID, amountIn, limitPrice) - } - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - - totalIn := swapInCoin.Amount - amountLeft = amountLeft.Sub(swapInCoin.Amount) - - if swapOutCoin.IsPositive() { - err = k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - types.ModuleName, - receiverAddr, - sdk.Coins{swapOutCoin}, - ) - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - } - - // This is ok because pairID was constructed from tokenIn above. - makerTradePairID := pairID.MustTradePairIDFromMaker(tokenIn) - makerTickIndexTakerToMaker := tickIndexInToOut * -1 - var placeTranche *types.LimitOrderTranche - placeTranche, err = k.GetOrInitPlaceTranche( - ctx, - makerTradePairID, - makerTickIndexTakerToMaker, - goodTil, - orderType, - ) - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - - trancheKey = placeTranche.Key.TrancheKey - trancheUser := k.GetOrInitLimitOrderTrancheUser( - ctx, - makerTradePairID, - makerTickIndexTakerToMaker, - trancheKey, - orderType, - receiverAddr.String(), - ) - - sharesIssued := math.ZeroInt() - // FOR GTC, JIT & GoodTil try to place a maker limitOrder with remaining Amount - if amountLeft.IsPositive() && !orderFilled && - (orderType.IsGTC() || orderType.IsJIT() || orderType.IsGoodTil()) { - - // Ensure that the maker portion will generate at least 1 token of output - // NOTE: This does mean that a successful taker leg of the trade will be thrown away since the entire tx will fail. - // In most circumstances this seems preferable to executing the taker leg and exiting early before placing a maker - // order with the remaining liquidity. - err = types.ValidateFairOutput(amountLeft, limitPrice) - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - placeTranche.PlaceMakerLimitOrder(amountLeft) - trancheUser.SharesOwned = trancheUser.SharesOwned.Add(amountLeft) - - if orderType.HasExpiration() { - goodTilRecord := NewLimitOrderExpiration(placeTranche) - k.SetLimitOrderExpiration(ctx, goodTilRecord) - ctx.GasMeter().ConsumeGas(types.ExpiringLimitOrderGas, "Expiring LimitOrder Fee") - } - - k.SaveTranche(ctx, placeTranche) - - totalIn = totalIn.Add(amountLeft) - sharesIssued = amountLeft - } - - k.SaveTrancheUser(ctx, trancheUser) - - if totalIn.IsPositive() { - totalInCoin = sdk.NewCoin(tokenIn, totalIn) - - err = k.bankKeeper.SendCoinsFromAccountToModule( - ctx, - callerAddr, - types.ModuleName, - sdk.Coins{totalInCoin}, - ) - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - } - - if orderType.IsJIT() { - err = k.AssertCanPlaceJIT(ctx) - if err != nil { - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err - } - k.IncrementJITsInBlock(ctx) - } - - ctx.EventManager().EmitEvent(types.CreatePlaceLimitOrderEvent( - callerAddr, - receiverAddr, - pairID.Token0, - pairID.Token1, - tokenIn, - tokenOut, - totalIn, - tickIndexInToOut, - orderType.String(), - sharesIssued, - trancheKey, - )) - - return trancheKey, totalInCoin, swapInCoin, swapOutCoin, nil -} - -// CancelLimitOrderCore handles MsgCancelLimitOrder, removing a specified number of shares from a limit order -// and returning the respective amount in terms of the reserve to the user. -func (k Keeper) CancelLimitOrderCore( - goCtx context.Context, - trancheKey string, - callerAddr sdk.AccAddress, -) error { - ctx := sdk.UnwrapSDKContext(goCtx) - - trancheUser, found := k.GetLimitOrderTrancheUser(ctx, callerAddr.String(), trancheKey) - if !found { - return types.ErrActiveLimitOrderNotFound - } - - tradePairID, tickIndex := trancheUser.TradePairId, trancheUser.TickIndexTakerToMaker - tranche := k.GetLimitOrderTranche( - ctx, - &types.LimitOrderTrancheKey{ - TradePairId: tradePairID, - TickIndexTakerToMaker: tickIndex, - TrancheKey: trancheKey, - }, - ) - if tranche == nil { - return types.ErrActiveLimitOrderNotFound - } - - amountToCancel := tranche.RemoveTokenIn(trancheUser) - trancheUser.SharesCancelled = trancheUser.SharesCancelled.Add(amountToCancel) - - if amountToCancel.IsPositive() { - coinOut := sdk.NewCoin(tradePairID.MakerDenom, amountToCancel) - - err := k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - types.ModuleName, - callerAddr, - sdk.Coins{coinOut}, - ) - if err != nil { - return err - } - - k.SaveTrancheUser(ctx, trancheUser) - k.SaveTranche(ctx, tranche) - - if trancheUser.OrderType.HasExpiration() { - k.RemoveLimitOrderExpiration(ctx, *tranche.ExpirationTime, tranche.Key.KeyMarshal()) - } - } else { - return sdkerrors.Wrapf(types.ErrCancelEmptyLimitOrder, "%s", tranche.Key.TrancheKey) - } - - pairID := tradePairID.MustPairID() - ctx.EventManager().EmitEvent(types.CancelLimitOrderEvent( - callerAddr, - pairID.Token0, - pairID.Token1, - tradePairID.MakerDenom, - tradePairID.TakerDenom, - amountToCancel, - trancheKey, - )) - - return nil -} - -// WithdrawFilledLimitOrderCore handles MsgWithdrawFilledLimitOrder, calculates and sends filled liquidity from module to user -// for a limit order based on amount wished to receive. -func (k Keeper) WithdrawFilledLimitOrderCore( - goCtx context.Context, - trancheKey string, - callerAddr sdk.AccAddress, -) error { - ctx := sdk.UnwrapSDKContext(goCtx) - - trancheUser, found := k.GetLimitOrderTrancheUser( - ctx, - callerAddr.String(), - trancheKey, - ) - if !found { - return sdkerrors.Wrapf(types.ErrValidLimitOrderTrancheNotFound, "%s", trancheKey) - } - - tradePairID, tickIndex := trancheUser.TradePairId, trancheUser.TickIndexTakerToMaker - pairID := tradePairID.MustPairID() - - tranche, wasFilled, found := k.FindLimitOrderTranche( - ctx, - &types.LimitOrderTrancheKey{ - TradePairId: tradePairID, - TickIndexTakerToMaker: tickIndex, - TrancheKey: trancheKey, - }, - ) - - amountOutTokenOut := math.ZeroInt() - remainingTokenIn := math.ZeroInt() - // It's possible that a TrancheUser exists but tranche does not if LO was filled entirely through a swap - if found { - var amountOutTokenIn math.Int - amountOutTokenIn, amountOutTokenOut = tranche.Withdraw(trancheUser) - - if wasFilled { - // This is only relevant for inactive JIT and GoodTil limit orders - remainingTokenIn = tranche.RemoveTokenIn(trancheUser) - k.SaveInactiveTranche(ctx, tranche) - - // Treat the removed tokenIn as cancelled shares - trancheUser.SharesCancelled = trancheUser.SharesCancelled.Add(remainingTokenIn) - - } else { - k.SetLimitOrderTranche(ctx, tranche) - } - - trancheUser.SharesWithdrawn = trancheUser.SharesWithdrawn.Add(amountOutTokenIn) - } - - k.SaveTrancheUser(ctx, trancheUser) - - if amountOutTokenOut.IsPositive() || remainingTokenIn.IsPositive() { - coinTakerDenomOut := sdk.NewCoin(tradePairID.TakerDenom, amountOutTokenOut) - coinMakerDenomRefund := sdk.NewCoin(tradePairID.MakerDenom, remainingTokenIn) - coins := sdk.NewCoins(coinTakerDenomOut, coinMakerDenomRefund) - ctx.EventManager().EmitEvents(types.GetEventsWithdrawnAmount(sdk.NewCoins(coinTakerDenomOut))) - if err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, callerAddr, coins); err != nil { - return err - } - } else { - return types.ErrWithdrawEmptyLimitOrder - } - - ctx.EventManager().EmitEvent(types.WithdrawFilledLimitOrderEvent( - callerAddr, - pairID.Token0, - pairID.Token1, - tradePairID.MakerDenom, - tradePairID.TakerDenom, - amountOutTokenOut, - trancheKey, - )) - - return nil -} diff --git a/x/dex/keeper/core_helper.go b/x/dex/keeper/core_helper.go index a67b248e1..bcf72159e 100644 --- a/x/dex/keeper/core_helper.go +++ b/x/dex/keeper/core_helper.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "golang.org/x/exp/slices" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" - "github.com/neutron-org/neutron/v4/x/dex/utils" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) /////////////////////////////////////////////////////////////////////////////// @@ -142,16 +142,14 @@ func (k Keeper) MintShares(ctx sdk.Context, addr sdk.AccAddress, sharesCoins sdk func (k Keeper) BurnShares( ctx sdk.Context, addr sdk.AccAddress, - amount math.Int, - sharesID string, + coins sdk.Coins, ) error { - sharesCoins := sdk.Coins{sdk.NewCoin(sharesID, amount)} // transfer tokens to module - if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, types.ModuleName, sharesCoins); err != nil { + if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, types.ModuleName, coins); err != nil { return err } // burn tokens - err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sharesCoins) + err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, coins) return err } diff --git a/x/dex/keeper/core_helper_test.go b/x/dex/keeper/core_helper_test.go index c09d45d99..eeb01d698 100644 --- a/x/dex/keeper/core_helper_test.go +++ b/x/dex/keeper/core_helper_test.go @@ -8,9 +8,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - neutronapp "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/x/dex/types" + neutronapp "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/testutil" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // Test Suite /////////////////////////////////////////////////////////////// @@ -65,14 +66,15 @@ func (s *CoreHelpersTestSuite) setLPAtFee1Pool(tickIndex int64, amountA, amountB existingShares := s.app.BankKeeper.GetSupply(s.ctx, pool.GetPoolDenom()).Amount - totalShares := pool.CalcSharesMinted(amountAInt, amountBInt, existingShares) + depositAmountAsToken0 := types.CalcAmountAsToken0(amountAInt, amountBInt, pool.MustCalcPrice1To0Center()) + totalShares := pool.CalcSharesMinted(depositAmountAsToken0, existingShares, math_utils.ZeroPrecDec()) err = s.app.DexKeeper.MintShares(s.ctx, s.alice, sdk.NewCoins(totalShares)) s.Require().NoError(err) lowerTick.ReservesMakerDenom = amountAInt upperTick.ReservesMakerDenom = amountBInt - s.app.DexKeeper.SetPool(s.ctx, pool) + s.app.DexKeeper.UpdatePool(s.ctx, pool) } // FindNextTick //////////////////////////////////////////////////// diff --git a/x/dex/keeper/deposit.go b/x/dex/keeper/deposit.go new file mode 100644 index 000000000..8a5058d6e --- /dev/null +++ b/x/dex/keeper/deposit.go @@ -0,0 +1,167 @@ +package keeper + +import ( + "context" + + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/utils" + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +// DepositCore handles core logic for MsgDeposit including bank operations and event emissions +func (k Keeper) DepositCore( + goCtx context.Context, + pairID *types.PairID, + callerAddr sdk.AccAddress, + receiverAddr sdk.AccAddress, + amounts0 []math.Int, + amounts1 []math.Int, + tickIndices []int64, + fees []uint64, + options []*types.DepositOptions, +) (amounts0Deposit, amounts1Deposit []math.Int, sharesIssued sdk.Coins, failedDeposits []*types.FailedDeposit, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + amounts0Deposited, + amounts1Deposited, + totalAmountReserve0, + totalAmountReserve1, + sharesIssued, + events, + failedDeposits, + err := k.ExecuteDeposit(ctx, pairID, callerAddr, receiverAddr, amounts0, amounts1, tickIndices, fees, options) + if err != nil { + return nil, nil, nil, failedDeposits, err + } + + ctx.EventManager().EmitEvents(events) + + if totalAmountReserve0.IsPositive() { + coin0 := sdk.NewCoin(pairID.Token0, totalAmountReserve0) + if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, callerAddr, types.ModuleName, sdk.Coins{coin0}); err != nil { + return nil, nil, nil, nil, err + } + } + + if totalAmountReserve1.IsPositive() { + coin1 := sdk.NewCoin(pairID.Token1, totalAmountReserve1) + if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, callerAddr, types.ModuleName, sdk.Coins{coin1}); err != nil { + return nil, nil, nil, nil, err + } + } + + if err := k.MintShares(ctx, receiverAddr, sharesIssued); err != nil { + return nil, nil, nil, nil, err + } + + return amounts0Deposited, amounts1Deposited, sharesIssued, failedDeposits, nil +} + +// ExecuteDeposit handles core logic for deposits -- checking and initializing data structures (tick, pair), calculating +// shares based on amount deposited. IT DOES NOT PERFORM ANY BANKING OPERATIONS. +func (k Keeper) ExecuteDeposit( + ctx sdk.Context, + pairID *types.PairID, + callerAddr sdk.AccAddress, + receiverAddr sdk.AccAddress, + amounts0 []math.Int, + amounts1 []math.Int, + tickIndices []int64, + fees []uint64, + options []*types.DepositOptions) ( + amounts0Deposited, amounts1Deposited []math.Int, + totalAmountReserve0, totalAmountReserve1 math.Int, + sharesIssued sdk.Coins, + events sdk.Events, + failedDeposits []*types.FailedDeposit, + err error, +) { + totalAmountReserve0 = math.ZeroInt() + totalAmountReserve1 = math.ZeroInt() + amounts0Deposited = make([]math.Int, len(amounts0)) + amounts1Deposited = make([]math.Int, len(amounts1)) + sharesIssued = sdk.Coins{} + + for i := 0; i < len(amounts0); i++ { + amounts0Deposited[i] = math.ZeroInt() + amounts1Deposited[i] = math.ZeroInt() + } + + for i, amount0 := range amounts0 { + amount1 := amounts1[i] + tickIndex := tickIndices[i] + fee := fees[i] + option := options[i] + if option == nil { + option = &types.DepositOptions{} + } + autoswap := !option.DisableAutoswap + + if err := k.ValidateFee(ctx, fee); err != nil { + return nil, nil, math.ZeroInt(), math.ZeroInt(), nil, nil, nil, err + } + + if k.IsPoolBehindEnemyLines(ctx, pairID, tickIndex, fee, amount0, amount1) { + err = sdkerrors.Wrapf(types.ErrDepositBehindEnemyLines, + "deposit failed at tick %d fee %d", tickIndex, fee) + if option.FailTxOnBel { + return nil, nil, math.ZeroInt(), math.ZeroInt(), nil, nil, nil, err + } + failedDeposits = append(failedDeposits, &types.FailedDeposit{DepositIdx: uint64(i), Error: err.Error()}) + continue + } + + pool, err := k.GetOrInitPool( + ctx, + pairID, + tickIndex, + fee, + ) + if err != nil { + return nil, nil, math.ZeroInt(), math.ZeroInt(), nil, nil, nil, err + } + + existingShares := k.bankKeeper.GetSupply(ctx, pool.GetPoolDenom()).Amount + + inAmount0, inAmount1, outShares := pool.Deposit(amount0, amount1, existingShares, autoswap) + + // Save updates to both sides of the pool + k.UpdatePool(ctx, pool) + + if inAmount0.IsZero() && inAmount1.IsZero() { + return nil, nil, math.ZeroInt(), math.ZeroInt(), nil, nil, nil, types.ErrZeroTrueDeposit + } + + if outShares.IsZero() { + return nil, nil, math.ZeroInt(), math.ZeroInt(), nil, nil, nil, types.ErrDepositShareUnderflow + } + + sharesIssued = append(sharesIssued, outShares) + + amounts0Deposited[i] = inAmount0 + amounts1Deposited[i] = inAmount1 + totalAmountReserve0 = totalAmountReserve0.Add(inAmount0) + totalAmountReserve1 = totalAmountReserve1.Add(inAmount1) + + depositEvent := types.CreateDepositEvent( + callerAddr, + receiverAddr, + pairID.Token0, + pairID.Token1, + tickIndex, + fee, + inAmount0, + inAmount1, + outShares.Amount, + ) + events = append(events, depositEvent) + } + + // At this point shares issued is not sorted and may have duplicates + // we must sanitize to convert it to a valid set of coins + sharesIssued = utils.SanitizeCoins(sharesIssued) + return amounts0Deposited, amounts1Deposited, totalAmountReserve0, totalAmountReserve1, sharesIssued, events, failedDeposits, nil +} diff --git a/x/dex/keeper/deposit_record.go b/x/dex/keeper/deposit_record.go index 24796fadd..9a0eee1a4 100644 --- a/x/dex/keeper/deposit_record.go +++ b/x/dex/keeper/deposit_record.go @@ -3,8 +3,8 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" - "github.com/neutron-org/neutron/v4/x/dex/utils" + "github.com/neutron-org/neutron/v5/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) func (k Keeper) GetAllDepositsForAddress(ctx sdk.Context, addr sdk.AccAddress) []*types.DepositRecord { diff --git a/x/dex/keeper/deposit_record_test.go b/x/dex/keeper/deposit_record_test.go index fe268244a..733b7659c 100644 --- a/x/dex/keeper/deposit_record_test.go +++ b/x/dex/keeper/deposit_record_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestGetAllDeposits() { diff --git a/x/dex/keeper/grpc_query.go b/x/dex/keeper/grpc_query.go index e0b9f7713..f7f73e428 100644 --- a/x/dex/keeper/grpc_query.go +++ b/x/dex/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/dex/keeper/grpc_query_estimate_multi_hop_swap.go b/x/dex/keeper/grpc_query_estimate_multi_hop_swap.go index eb133dce9..9816fdc40 100644 --- a/x/dex/keeper/grpc_query_estimate_multi_hop_swap.go +++ b/x/dex/keeper/grpc_query_estimate_multi_hop_swap.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // TODO: This doesn't run ValidateBasic() checks. @@ -31,7 +31,7 @@ func (k Keeper) EstimateMultiHopSwap( callerAddr := sdk.MustAccAddressFromBech32(req.Creator) receiverAddr := sdk.MustAccAddressFromBech32(req.Receiver) - coinOut, err := k.MultiHopSwapCore( + coinOut, _, _, err := k.MultiHopSwapCore( cacheCtx, req.AmountIn, req.Routes, diff --git a/x/dex/keeper/grpc_query_estimate_multi_hop_swap_test.go b/x/dex/keeper/grpc_query_estimate_multi_hop_swap_test.go index 88312e2ef..aa3e18cfb 100644 --- a/x/dex/keeper/grpc_query_estimate_multi_hop_swap_test.go +++ b/x/dex/keeper/grpc_query_estimate_multi_hop_swap_test.go @@ -4,8 +4,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestEstimateMultiHopSwapSingleRoute() { @@ -46,7 +46,7 @@ func (s *DexTestSuite) TestEstimateMultiHopSwapInsufficientLiquiditySingleRoute( // THEN estimate multihopswap fails route := [][]string{{"TokenA", "TokenB", "TokenC", "TokenD"}} s.aliceEstimatesMultiHopSwapFails( - types.ErrLimitPriceNotSatisfied, + types.ErrNoLiquidity, route, 100, math_utils.MustNewPrecDecFromStr("0.9"), diff --git a/x/dex/keeper/grpc_query_estimate_place_limit_order.go b/x/dex/keeper/grpc_query_estimate_place_limit_order.go index 6a4447d0f..972cd26ab 100644 --- a/x/dex/keeper/grpc_query_estimate_place_limit_order.go +++ b/x/dex/keeper/grpc_query_estimate_place_limit_order.go @@ -6,7 +6,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // TODO: This doesn't run ValidateBasic() checks. @@ -53,6 +53,7 @@ func (k Keeper) EstimatePlaceLimitOrder( req.OrderType, req.ExpirationTime, req.MaxAmountOut, + nil, callerAddr, receiverAddr, ) diff --git a/x/dex/keeper/grpc_query_inactive_limit_order_tranche.go b/x/dex/keeper/grpc_query_inactive_limit_order_tranche.go index 4dcf03c91..88f408abe 100644 --- a/x/dex/keeper/grpc_query_inactive_limit_order_tranche.go +++ b/x/dex/keeper/grpc_query_inactive_limit_order_tranche.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (k Keeper) InactiveLimitOrderTrancheAll( diff --git a/x/dex/keeper/grpc_query_inactive_limit_order_tranche_test.go b/x/dex/keeper/grpc_query_inactive_limit_order_tranche_test.go index 51055eb65..d60d71d61 100644 --- a/x/dex/keeper/grpc_query_inactive_limit_order_tranche_test.go +++ b/x/dex/keeper/grpc_query_inactive_limit_order_tranche_test.go @@ -9,9 +9,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // Prevent strconv unused error diff --git a/x/dex/keeper/grpc_query_limit_order_tranche.go b/x/dex/keeper/grpc_query_limit_order_tranche.go index c97dab766..f6dff5f3d 100644 --- a/x/dex/keeper/grpc_query_limit_order_tranche.go +++ b/x/dex/keeper/grpc_query_limit_order_tranche.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // Returns all ACTIVE limit order tranches for a given pairID/tokenIn combination diff --git a/x/dex/keeper/grpc_query_limit_order_tranche_test.go b/x/dex/keeper/grpc_query_limit_order_tranche_test.go index 02ea87ec1..3ac15f4e2 100644 --- a/x/dex/keeper/grpc_query_limit_order_tranche_test.go +++ b/x/dex/keeper/grpc_query_limit_order_tranche_test.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestLimitOrderTrancheQuerySingle(t *testing.T) { diff --git a/x/dex/keeper/grpc_query_limit_order_tranche_user.go b/x/dex/keeper/grpc_query_limit_order_tranche_user.go index beb75ad48..d378a8fab 100644 --- a/x/dex/keeper/grpc_query_limit_order_tranche_user.go +++ b/x/dex/keeper/grpc_query_limit_order_tranche_user.go @@ -10,7 +10,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (k Keeper) LimitOrderTrancheUserAll( diff --git a/x/dex/keeper/grpc_query_limit_order_tranche_user_test.go b/x/dex/keeper/grpc_query_limit_order_tranche_user_test.go index 975052598..ed964cd7d 100644 --- a/x/dex/keeper/grpc_query_limit_order_tranche_user_test.go +++ b/x/dex/keeper/grpc_query_limit_order_tranche_user_test.go @@ -10,10 +10,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - "github.com/neutron-org/neutron/v4/testutil/common/sample" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/common/sample" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestLimitOrderTrancheUserQuerySingle(t *testing.T) { diff --git a/x/dex/keeper/grpc_query_params.go b/x/dex/keeper/grpc_query_params.go index 46adad5b8..81267f35c 100644 --- a/x/dex/keeper/grpc_query_params.go +++ b/x/dex/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // Returns dex params to the caller diff --git a/x/dex/keeper/grpc_query_params_test.go b/x/dex/keeper/grpc_query_params_test.go index 85caea3bd..d08543191 100644 --- a/x/dex/keeper/grpc_query_params_test.go +++ b/x/dex/keeper/grpc_query_params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/dex/keeper/grpc_query_pool.go b/x/dex/keeper/grpc_query_pool.go index 2c4cff921..dffd10df2 100644 --- a/x/dex/keeper/grpc_query_pool.go +++ b/x/dex/keeper/grpc_query_pool.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // Returns the pool that was requested by PairId, TickIndex and Fee (or errors) diff --git a/x/dex/keeper/grpc_query_pool_metadata.go b/x/dex/keeper/grpc_query_pool_metadata.go index b2bc94ab4..11546486d 100644 --- a/x/dex/keeper/grpc_query_pool_metadata.go +++ b/x/dex/keeper/grpc_query_pool_metadata.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (k Keeper) PoolMetadataAll(goCtx context.Context, req *types.QueryAllPoolMetadataRequest) (*types.QueryAllPoolMetadataResponse, error) { diff --git a/x/dex/keeper/grpc_query_pool_metadata_test.go b/x/dex/keeper/grpc_query_pool_metadata_test.go index d5b2d855d..56768b9cf 100644 --- a/x/dex/keeper/grpc_query_pool_metadata_test.go +++ b/x/dex/keeper/grpc_query_pool_metadata_test.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestPoolMetadataQuerySingle(t *testing.T) { diff --git a/x/dex/keeper/grpc_query_pool_reserves.go b/x/dex/keeper/grpc_query_pool_reserves.go index c9c14d55e..e8b843417 100644 --- a/x/dex/keeper/grpc_query_pool_reserves.go +++ b/x/dex/keeper/grpc_query_pool_reserves.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (k Keeper) PoolReservesAll( diff --git a/x/dex/keeper/grpc_query_pool_reserves_test.go b/x/dex/keeper/grpc_query_pool_reserves_test.go index 9cf21356f..cf1350082 100644 --- a/x/dex/keeper/grpc_query_pool_reserves_test.go +++ b/x/dex/keeper/grpc_query_pool_reserves_test.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestPoolReservesQuerySingle(t *testing.T) { diff --git a/x/dex/keeper/grpc_query_pool_test.go b/x/dex/keeper/grpc_query_pool_test.go index f154837aa..9d96cd845 100644 --- a/x/dex/keeper/grpc_query_pool_test.go +++ b/x/dex/keeper/grpc_query_pool_test.go @@ -7,9 +7,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestPoolQuerySingle(t *testing.T) { @@ -25,7 +25,7 @@ func TestPoolQuerySingle(t *testing.T) { desc: "First", request: &types.QueryPoolRequest{ PairId: "TokenA<>TokenB", - TickIndex: msgs[0].CenterTickIndex(), + TickIndex: msgs[0].CenterTickIndexToken1(), Fee: msgs[0].Fee(), }, response: &types.QueryPoolResponse{Pool: msgs[0]}, @@ -34,7 +34,7 @@ func TestPoolQuerySingle(t *testing.T) { desc: "Second", request: &types.QueryPoolRequest{ PairId: "TokenA<>TokenB", - TickIndex: msgs[1].CenterTickIndex(), + TickIndex: msgs[1].CenterTickIndexToken1(), Fee: msgs[1].Fee(), }, response: &types.QueryPoolResponse{Pool: msgs[1]}, diff --git a/x/dex/keeper/grpc_query_simulate_cancel_limit_order.go b/x/dex/keeper/grpc_query_simulate_cancel_limit_order.go new file mode 100644 index 000000000..7cb529f0e --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_cancel_limit_order.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (k Keeper) SimulateCancelLimitOrder( + goCtx context.Context, + req *types.QuerySimulateCancelLimitOrderRequest, +) (*types.QuerySimulateCancelLimitOrderResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + cacheCtx, _ := ctx.CacheContext() + + msg := req.Msg + + if err := msg.Validate(); err != nil { + return nil, err + } + + callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) + makerCoinOut, takerCoinOut, err := k.ExecuteCancelLimitOrder( + cacheCtx, + msg.TrancheKey, + callerAddr, + ) + if err != nil { + return nil, err + } + + return &types.QuerySimulateCancelLimitOrderResponse{ + Resp: &types.MsgCancelLimitOrderResponse{ + TakerCoinOut: takerCoinOut, + MakerCoinOut: makerCoinOut, + }, + }, nil +} diff --git a/x/dex/keeper/grpc_query_simulate_cancel_limit_order_test.go b/x/dex/keeper/grpc_query_simulate_cancel_limit_order_test.go new file mode 100644 index 000000000..0798f3ed3 --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_cancel_limit_order_test.go @@ -0,0 +1,52 @@ +package keeper_test + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (s *DexTestSuite) TestSimulateCancelLimitOrder() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(0, 20) + + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + + s.bobLimitSells("TokenB", -10, 20, types.LimitOrderType_FILL_OR_KILL) + + req := &types.QuerySimulateCancelLimitOrderRequest{ + Msg: &types.MsgCancelLimitOrder{ + Creator: s.alice.String(), + TrancheKey: trancheKey, + }, + } + + resp, err := s.App.DexKeeper.SimulateCancelLimitOrder(s.Ctx, req) + s.NoError(err) + + s.Equal(sdk.NewCoin("TokenB", math.NewInt(20_000_000)), resp.Resp.TakerCoinOut) + s.Equal(sdk.NewCoin("TokenA", math.NewInt(30_000_000)), resp.Resp.MakerCoinOut) + + s.assertDexBalances(30, 20) +} + +func (s *DexTestSuite) TestSimulateCancelLimitOrderFails() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(0, 60) + + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + + s.bobLimitSells("TokenB", -10, 60, types.LimitOrderType_IMMEDIATE_OR_CANCEL) + + req := &types.QuerySimulateCancelLimitOrderRequest{ + Msg: &types.MsgCancelLimitOrder{ + Creator: s.bob.String(), + TrancheKey: trancheKey, + }, + } + + resp, err := s.App.DexKeeper.SimulateCancelLimitOrder(s.Ctx, req) + s.ErrorIs(err, types.ErrValidLimitOrderTrancheNotFound) + s.Nil(resp) +} diff --git a/x/dex/keeper/grpc_query_simulate_deposit.go b/x/dex/keeper/grpc_query_simulate_deposit.go new file mode 100644 index 000000000..4b2eb0874 --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_deposit.go @@ -0,0 +1,62 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (k Keeper) SimulateDeposit( + goCtx context.Context, + req *types.QuerySimulateDepositRequest, +) (*types.QuerySimulateDepositResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + cacheCtx, _ := ctx.CacheContext() + + msg := req.Msg + msg.Creator = types.DummyAddress + msg.Receiver = types.DummyAddress + + if err := msg.Validate(); err != nil { + return nil, err + } + + callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) + receiverAddr := sdk.MustAccAddressFromBech32(msg.Receiver) + pairID, err := types.NewPairID(msg.TokenA, msg.TokenB) + if err != nil { + return nil, err + } + + // sort amounts + amounts0, amounts1 := SortAmounts(msg.TokenA, pairID.Token0, msg.AmountsA, msg.AmountsB) + + tickIndexes := NormalizeAllTickIndexes(msg.TokenA, pairID.Token0, msg.TickIndexesAToB) + + //nolint:dogsled + reserve0Deposited, reserve1Deposited, _, _, sharesIssued, _, failedDeposits, err := k.ExecuteDeposit( + cacheCtx, + pairID, + callerAddr, + receiverAddr, + amounts0, + amounts1, + tickIndexes, + msg.Fees, + msg.Options, + ) + if err != nil { + return nil, err + } + + return &types.QuerySimulateDepositResponse{ + Resp: &types.MsgDepositResponse{ + Reserve0Deposited: reserve0Deposited, + Reserve1Deposited: reserve1Deposited, + FailedDeposits: failedDeposits, + SharesIssued: sharesIssued, + }, + }, nil +} diff --git a/x/dex/keeper/grpc_query_simulate_deposit_test.go b/x/dex/keeper/grpc_query_simulate_deposit_test.go new file mode 100644 index 000000000..10000565f --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_deposit_test.go @@ -0,0 +1,78 @@ +package keeper_test + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (s *DexTestSuite) TestSimulateDeposit() { + req := &types.QuerySimulateDepositRequest{ + Msg: &types.MsgDeposit{ + TokenA: "TokenA", + TokenB: "TokenB", + AmountsA: []math.Int{math.OneInt(), math.OneInt()}, + AmountsB: []math.Int{math.ZeroInt(), math.ZeroInt()}, + TickIndexesAToB: []int64{0, 1}, + Fees: []uint64{1, 1}, + Options: []*types.DepositOptions{{}, {}}, + }, + } + resp, err := s.App.DexKeeper.SimulateDeposit(s.Ctx, req) + s.NoError(err) + s.Equal([]math.Int{math.OneInt(), math.OneInt()}, resp.Resp.Reserve0Deposited) + s.Equal([]math.Int{math.ZeroInt(), math.ZeroInt()}, resp.Resp.Reserve1Deposited) + + expectedShares := sdk.NewCoins( + sdk.NewCoin("neutron/pool/0", math.OneInt()), + sdk.NewCoin("neutron/pool/1", math.OneInt()), + ) + sharesIssued := sdk.NewCoins(resp.Resp.SharesIssued...) + s.True(sharesIssued.Equal(expectedShares)) + + s.assertDexBalances(0, 0) +} + +func (s *DexTestSuite) TestSimulateDepositPartialFailure() { + req := &types.QuerySimulateDepositRequest{ + Msg: &types.MsgDeposit{ + TokenA: "TokenA", + TokenB: "TokenB", + AmountsA: []math.Int{math.OneInt(), math.ZeroInt()}, + AmountsB: []math.Int{math.ZeroInt(), math.OneInt()}, + TickIndexesAToB: []int64{3, 0}, + Fees: []uint64{1, 1}, + Options: []*types.DepositOptions{{}, {}}, + }, + } + resp, err := s.App.DexKeeper.SimulateDeposit(s.Ctx, req) + s.NoError(err) + s.Equal(resp.Resp.Reserve0Deposited, []math.Int{math.OneInt(), math.ZeroInt()}) + s.Equal(resp.Resp.Reserve1Deposited, []math.Int{math.ZeroInt(), math.ZeroInt()}) + s.Equal(uint64(1), resp.Resp.FailedDeposits[0].DepositIdx) + s.Contains(resp.Resp.FailedDeposits[0].Error, types.ErrDepositBehindEnemyLines.Error()) + + expectedShares := sdk.NewCoins( + sdk.NewCoin("neutron/pool/0", math.OneInt()), + ) + sharesIssued := sdk.NewCoins(resp.Resp.SharesIssued...) + s.True(sharesIssued.Equal(expectedShares)) +} + +func (s *DexTestSuite) TestSimulateDepositFails() { + req := &types.QuerySimulateDepositRequest{ + Msg: &types.MsgDeposit{ + TokenA: "TokenA", + TokenB: "TokenB", + AmountsA: []math.Int{math.OneInt(), math.ZeroInt()}, + AmountsB: []math.Int{math.ZeroInt(), math.OneInt()}, + TickIndexesAToB: []int64{3, 0}, + Fees: []uint64{1, 1}, + Options: []*types.DepositOptions{{}, {FailTxOnBel: true}}, + }, + } + resp, err := s.App.DexKeeper.SimulateDeposit(s.Ctx, req) + s.Error(err, types.ErrDepositBehindEnemyLines) + s.Nil(resp) +} diff --git a/x/dex/keeper/grpc_query_simulate_multi_hop_swap.go b/x/dex/keeper/grpc_query_simulate_multi_hop_swap.go new file mode 100644 index 000000000..cf8e79cd7 --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_multi_hop_swap.go @@ -0,0 +1,44 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (k Keeper) SimulateMultiHopSwap( + goCtx context.Context, + req *types.QuerySimulateMultiHopSwapRequest, +) (*types.QuerySimulateMultiHopSwapResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + cacheCtx, _ := ctx.CacheContext() + + msg := req.Msg + msg.Creator = types.DummyAddress + msg.Receiver = types.DummyAddress + + if err := msg.Validate(); err != nil { + return nil, err + } + + bestRoute, _, err := k.CalulateMultiHopSwap( + cacheCtx, + msg.AmountIn, + msg.Routes, + msg.ExitLimitPrice, + msg.PickBestRoute, + ) + if err != nil { + return nil, err + } + + return &types.QuerySimulateMultiHopSwapResponse{ + Resp: &types.MsgMultiHopSwapResponse{ + CoinOut: bestRoute.coinOut, + Dust: bestRoute.dust, + Route: &types.MultiHopRoute{Hops: bestRoute.route}, + }, + }, nil +} diff --git a/x/dex/keeper/grpc_query_simulate_multi_hop_swap_test.go b/x/dex/keeper/grpc_query_simulate_multi_hop_swap_test.go new file mode 100644 index 000000000..60aac43eb --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_multi_hop_swap_test.go @@ -0,0 +1,107 @@ +package keeper_test + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (s *DexTestSuite) TestSimulateMultiHopSwapSingleRoute() { + // GIVEN liquidity in pools A<>B, B<>C, C<>D, + s.SetupMultiplePools( + NewPoolSetup("TokenA", "TokenB", 0, 100, 0, 1), + NewPoolSetup("TokenB", "TokenC", 0, 100, 0, 1), + NewPoolSetup("TokenC", "TokenD", 0, 100, 0, 1), + ) + + // WHEN alice multihopswaps A<>B => B<>C => C<>D, + route := &types.MultiHopRoute{Hops: []string{"TokenA", "TokenB", "TokenC", "TokenD"}} + req := &types.QuerySimulateMultiHopSwapRequest{ + Msg: &types.MsgMultiHopSwap{ + Routes: []*types.MultiHopRoute{route}, + AmountIn: math.NewInt(100_000_000), + ExitLimitPrice: math_utils.MustNewPrecDecFromStr("0.9"), + PickBestRoute: false, + }, + } + resp, err := s.App.DexKeeper.SimulateMultiHopSwap(s.Ctx, req) + s.NoError(err) + + // THEN alice would get out ~99 BIGTokenD + expectedOutCoin := sdk.NewCoin("TokenD", math.NewInt(99970003)) + s.Assert().True(resp.Resp.CoinOut.Equal(expectedOutCoin)) + s.Assert().Equal(route, resp.Resp.Route) + dust := sdk.NewCoins(resp.Resp.Dust...) + expectedDust := sdk.NewCoin("TokenA", math.OneInt()) + s.Assert().True(dust.Equal(sdk.NewCoins(expectedDust))) + + // Nothing changes on the dex + s.assertDexBalanceWithDenom("TokenA", 0) + s.assertDexBalanceWithDenom("TokenB", 100) + s.assertDexBalanceWithDenom("TokenC", 100) + s.assertDexBalanceWithDenom("TokenD", 100) +} + +func (s *DexTestSuite) TestSimulateMultiHopSwapMultiRoute() { + // GIVEN liquidity in pools A<>B, B<>C, C<>D, + s.SetupMultiplePools( + NewPoolSetup("TokenA", "TokenB", 0, 100, 0, 1), + NewPoolSetup("TokenB", "TokenC", 0, 100, 0, 1), + NewPoolSetup("TokenC", "TokenD", 0, 100, 0, 1), + NewPoolSetup("TokenB", "TokenD", 0, 150, -1000, 1), + ) + + // WHEN alice multihopswaps A<>B => B<>C => C<>D, + route1 := &types.MultiHopRoute{Hops: []string{"TokenA", "TokenB", "TokenC", "TokenD"}} + route2 := &types.MultiHopRoute{Hops: []string{"TokenA", "TokenB", "TokenD"}} + req := &types.QuerySimulateMultiHopSwapRequest{ + Msg: &types.MsgMultiHopSwap{ + Routes: []*types.MultiHopRoute{route1, route2}, + AmountIn: math.NewInt(100_000_000), + ExitLimitPrice: math_utils.MustNewPrecDecFromStr("0.9"), + PickBestRoute: true, + }, + } + resp, err := s.App.DexKeeper.SimulateMultiHopSwap(s.Ctx, req) + s.NoError(err) + + // THEN alice would get out ~110 BIGTokenD + expectedOutCoin := sdk.NewCoin("TokenD", math.NewInt(110494438)) + s.Assert().True(resp.Resp.CoinOut.Equal(expectedOutCoin)) + s.Assert().Equal(route2, resp.Resp.Route) + dust := sdk.NewCoins(resp.Resp.Dust...) + expectedDust := sdk.NewCoin("TokenA", math.OneInt()) + s.Assert().True(dust.Equal(sdk.NewCoins(expectedDust))) + + // Nothing changes on the dex + s.assertDexBalanceWithDenom("TokenA", 0) + s.assertDexBalanceWithDenom("TokenB", 100) + s.assertDexBalanceWithDenom("TokenC", 100) + s.assertDexBalanceWithDenom("TokenD", 250) +} + +func (s *DexTestSuite) TestSimulateMultiHopSwapFails() { + // GIVEN liquidity in pools A<>B, B<>C, C<>D, + s.SetupMultiplePools( + NewPoolSetup("TokenA", "TokenB", 0, 100, 0, 1), + NewPoolSetup("TokenB", "TokenC", 0, 100, 0, 1), + NewPoolSetup("TokenC", "TokenD", 0, 100, 0, 1), + ) + + // WHEN alice multihopswaps A<>B => B<>C => C<>D with a high limit price, + route := &types.MultiHopRoute{Hops: []string{"TokenA", "TokenB", "TokenC", "TokenD"}} + req := &types.QuerySimulateMultiHopSwapRequest{ + Msg: &types.MsgMultiHopSwap{ + Routes: []*types.MultiHopRoute{route}, + AmountIn: math.NewInt(100_000_000), + ExitLimitPrice: math_utils.MustNewPrecDecFromStr("2"), + PickBestRoute: false, + }, + } + // THEN her request fails + resp, err := s.App.DexKeeper.SimulateMultiHopSwap(s.Ctx, req) + s.Error(err, types.ErrLimitPriceNotSatisfied) + s.Nil(resp) +} diff --git a/x/dex/keeper/grpc_query_simulate_place_limit_order.go b/x/dex/keeper/grpc_query_simulate_place_limit_order.go new file mode 100644 index 000000000..f0478e7b7 --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_place_limit_order.go @@ -0,0 +1,70 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (k Keeper) SimulatePlaceLimitOrder( + goCtx context.Context, + req *types.QuerySimulatePlaceLimitOrderRequest, +) (*types.QuerySimulatePlaceLimitOrderResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + cacheCtx, _ := ctx.CacheContext() + + msg := req.Msg + msg.Creator = types.DummyAddress + msg.Receiver = types.DummyAddress + + if err := msg.Validate(); err != nil { + return nil, err + } + + err := msg.ValidateGoodTilExpiration(ctx.BlockTime()) + if err != nil { + return nil, err + } + + receiverAddr := sdk.MustAccAddressFromBech32(msg.Receiver) + takerTradePairID, err := types.NewTradePairID(msg.TokenIn, msg.TokenOut) + if err != nil { + return nil, err + } + tickIndex := msg.TickIndexInToOut + if msg.LimitSellPrice != nil { + limitBuyPrice := math_utils.OnePrecDec().Quo(*msg.LimitSellPrice) + tickIndex, err = types.CalcTickIndexFromPrice(limitBuyPrice) + if err != nil { + return nil, errors.Wrapf(err, "invalid LimitSellPrice %s", msg.LimitSellPrice.String()) + } + } + trancheKey, totalIn, takerCoinIn, takerCoinOut, _, _, err := k.ExecutePlaceLimitOrder( + cacheCtx, + takerTradePairID, + msg.AmountIn, + tickIndex, + msg.OrderType, + msg.ExpirationTime, + msg.MaxAmountOut, + msg.MinAverageSellPrice, + receiverAddr, + ) + if err != nil { + return nil, err + } + + coinIn := sdk.NewCoin(msg.TokenIn, totalIn) + return &types.QuerySimulatePlaceLimitOrderResponse{ + Resp: &types.MsgPlaceLimitOrderResponse{ + TrancheKey: trancheKey, + CoinIn: coinIn, + TakerCoinIn: takerCoinIn, + TakerCoinOut: takerCoinOut, + }, + }, nil +} diff --git a/x/dex/keeper/grpc_query_simulate_place_limit_order_test.go b/x/dex/keeper/grpc_query_simulate_place_limit_order_test.go new file mode 100644 index 000000000..7e0600010 --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_place_limit_order_test.go @@ -0,0 +1,86 @@ +package keeper_test + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (s *DexTestSuite) TestSimulatePlaceLimitOrderWithTick() { + s.SetupMultiplePools( + NewPoolSetup("TokenA", "TokenB", 0, 100, 0, 1), + ) + + req := &types.QuerySimulatePlaceLimitOrderRequest{ + Msg: &types.MsgPlaceLimitOrder{ + TokenIn: "TokenA", + TokenOut: "TokenB", + TickIndexInToOut: 5, + AmountIn: math.NewInt(20_000_000), + OrderType: types.LimitOrderType_FILL_OR_KILL, + }, + } + + resp, err := s.App.DexKeeper.SimulatePlaceLimitOrder(s.Ctx, req) + s.NoError(err) + + s.Equal(sdk.NewCoin("TokenA", math.NewInt(20_000_000)), resp.Resp.CoinIn) + s.Equal(sdk.NewCoin("TokenA", math.NewInt(20_000_000)), resp.Resp.TakerCoinIn) + s.Equal(sdk.NewCoin("TokenB", math.NewInt(19_998_000)), resp.Resp.TakerCoinOut) + + s.assertDexBalances(0, 100) +} + +func (s *DexTestSuite) TestSimulatePlaceLimitOrderWithPrice() { + s.SetupMultiplePools( + NewPoolSetup("TokenA", "TokenB", 0, 10, 0, 1), + NewPoolSetup("TokenA", "TokenB", 0, 10, 100, 1), + ) + + price := math_utils.MustNewPrecDecFromStr("0.995") + + req := &types.QuerySimulatePlaceLimitOrderRequest{ + Msg: &types.MsgPlaceLimitOrder{ + TokenIn: "TokenA", + TokenOut: "TokenB", + LimitSellPrice: &price, + AmountIn: math.NewInt(20_000_000), + OrderType: types.LimitOrderType_GOOD_TIL_CANCELLED, + }, + } + + resp, err := s.App.DexKeeper.SimulatePlaceLimitOrder(s.Ctx, req) + s.NoError(err) + + s.Equal(sdk.NewCoin("TokenA", math.NewInt(20_000_000)), resp.Resp.CoinIn) + s.Equal(sdk.NewCoin("TokenA", math.NewInt(10_001_000)), resp.Resp.TakerCoinIn) + s.Equal(sdk.NewCoin("TokenB", math.NewInt(10_000_000)), resp.Resp.TakerCoinOut) + + s.assertDexBalances(0, 20) +} + +func (s *DexTestSuite) TestSimulatePlaceLimitOrderFails() { + s.SetupMultiplePools( + NewPoolSetup("TokenA", "TokenB", 0, 100, 0, 1), + ) + + price := math_utils.MustNewPrecDecFromStr("1.1") + + req := &types.QuerySimulatePlaceLimitOrderRequest{ + Msg: &types.MsgPlaceLimitOrder{ + TokenIn: "TokenA", + TokenOut: "TokenB", + LimitSellPrice: &price, + AmountIn: math.NewInt(20_000_000), + OrderType: types.LimitOrderType_FILL_OR_KILL, + }, + } + + resp, err := s.App.DexKeeper.SimulatePlaceLimitOrder(s.Ctx, req) + s.ErrorIs(err, types.ErrFoKLimitOrderNotFilled) + s.Nil(resp) + + s.assertDexBalances(0, 100) +} diff --git a/x/dex/keeper/grpc_query_simulate_withdraw_filled_limit_order.go b/x/dex/keeper/grpc_query_simulate_withdraw_filled_limit_order.go new file mode 100644 index 000000000..6c074ef02 --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_withdraw_filled_limit_order.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (k Keeper) SimulateWithdrawFilledLimitOrder( + goCtx context.Context, + req *types.QuerySimulateWithdrawFilledLimitOrderRequest, +) (*types.QuerySimulateWithdrawFilledLimitOrderResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + cacheCtx, _ := ctx.CacheContext() + + msg := req.Msg + + if err := msg.Validate(); err != nil { + return nil, err + } + + callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) + takerCoinOut, makerCoinOut, err := k.ExecuteWithdrawFilledLimitOrder( + cacheCtx, + msg.TrancheKey, + callerAddr, + ) + if err != nil { + return nil, err + } + + return &types.QuerySimulateWithdrawFilledLimitOrderResponse{ + Resp: &types.MsgWithdrawFilledLimitOrderResponse{ + TakerCoinOut: takerCoinOut, + MakerCoinOut: makerCoinOut, + }, + }, nil +} diff --git a/x/dex/keeper/grpc_query_simulate_withdraw_filled_limit_order_test.go b/x/dex/keeper/grpc_query_simulate_withdraw_filled_limit_order_test.go new file mode 100644 index 000000000..0b241842e --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_withdraw_filled_limit_order_test.go @@ -0,0 +1,52 @@ +package keeper_test + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (s *DexTestSuite) TestSimulateWithdrawFilledLimitOrder() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(0, 20) + + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + + s.bobLimitSells("TokenB", -10, 20, types.LimitOrderType_FILL_OR_KILL) + + req := &types.QuerySimulateWithdrawFilledLimitOrderRequest{ + Msg: &types.MsgWithdrawFilledLimitOrder{ + Creator: s.alice.String(), + TrancheKey: trancheKey, + }, + } + + resp, err := s.App.DexKeeper.SimulateWithdrawFilledLimitOrder(s.Ctx, req) + s.NoError(err) + + s.Equal(sdk.NewCoin("TokenB", math.NewInt(20_000_000)), resp.Resp.TakerCoinOut) + s.Equal(sdk.NewCoin("TokenA", math.ZeroInt()), resp.Resp.MakerCoinOut) + + s.assertDexBalances(30, 20) +} + +func (s *DexTestSuite) TestSimulateWithdrawFilledLimitOrderFails() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(0, 20) + + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + + s.bobLimitSells("TokenB", -10, 20, types.LimitOrderType_FILL_OR_KILL) + + req := &types.QuerySimulateWithdrawFilledLimitOrderRequest{ + Msg: &types.MsgWithdrawFilledLimitOrder{ + Creator: s.bob.String(), + TrancheKey: trancheKey, + }, + } + + resp, err := s.App.DexKeeper.SimulateWithdrawFilledLimitOrder(s.Ctx, req) + s.ErrorIs(err, types.ErrValidLimitOrderTrancheNotFound) + s.Nil(resp) +} diff --git a/x/dex/keeper/grpc_query_simulate_withdrawal.go b/x/dex/keeper/grpc_query_simulate_withdrawal.go new file mode 100644 index 000000000..40e27f6e0 --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_withdrawal.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (k Keeper) SimulateWithdrawal( + goCtx context.Context, + req *types.QuerySimulateWithdrawalRequest, +) (*types.QuerySimulateWithdrawalResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + cacheCtx, _ := ctx.CacheContext() + + msg := req.Msg + + if err := msg.Validate(); err != nil { + return nil, err + } + + callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) + receiverAddr := sdk.MustAccAddressFromBech32(msg.Receiver) + pairID, err := types.NewPairID(msg.TokenA, msg.TokenB) + if err != nil { + return nil, err + } + + tickIndexes := NormalizeAllTickIndexes(msg.TokenA, pairID.Token0, msg.TickIndexesAToB) + + reserve0Withdrawn, reserve1Withdrawn, sharesBurned, _, err := k.ExecuteWithdraw( + cacheCtx, + pairID, + callerAddr, + receiverAddr, + msg.SharesToRemove, + tickIndexes, + msg.Fees, + ) + if err != nil { + return nil, err + } + + return &types.QuerySimulateWithdrawalResponse{ + Resp: &types.MsgWithdrawalResponse{ + Reserve0Withdrawn: reserve0Withdrawn, + Reserve1Withdrawn: reserve1Withdrawn, + SharesBurned: sharesBurned, + }, + }, nil +} diff --git a/x/dex/keeper/grpc_query_simulate_withdrawal_test.go b/x/dex/keeper/grpc_query_simulate_withdrawal_test.go new file mode 100644 index 000000000..52c44143c --- /dev/null +++ b/x/dex/keeper/grpc_query_simulate_withdrawal_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +func (s *DexTestSuite) TestSimulateWithdrawal() { + s.fundAliceBalances(20, 0) + + s.aliceDeposits(NewDeposit(10, 0, 0, 1), NewDeposit(10, 0, 1, 1)) + + req := &types.QuerySimulateWithdrawalRequest{ + Msg: &types.MsgWithdrawal{ + Creator: s.alice.String(), + Receiver: s.alice.String(), + TokenA: "TokenA", + TokenB: "TokenB", + SharesToRemove: []math.Int{math.NewInt(5), math.NewInt(9)}, + TickIndexesAToB: []int64{0, 1}, + Fees: []uint64{1, 1}, + }, + } + resp, err := s.App.DexKeeper.SimulateWithdrawal(s.Ctx, req) + s.NoError(err) + + s.Equal(math.NewInt(14), resp.Resp.Reserve0Withdrawn) + s.Equal(math.ZeroInt(), resp.Resp.Reserve1Withdrawn) + + expectedSharesBurned := sdk.NewCoins( + sdk.NewCoin("neutron/pool/0", math.NewInt(5)), + sdk.NewCoin("neutron/pool/1", math.NewInt(9)), + ) + sharesBurned := sdk.NewCoins(resp.Resp.SharesBurned...) + s.True(sharesBurned.Equal(expectedSharesBurned)) + + // Dex Balances Unchanged + + s.assertDexBalances(20, 0) +} + +func (s *DexTestSuite) TestSimulateWithdrawalFails() { + s.fundAliceBalances(20, 0) + + s.aliceDeposits(NewDeposit(10, 0, 0, 1), NewDeposit(10, 0, 1, 1)) + + req := &types.QuerySimulateWithdrawalRequest{ + Msg: &types.MsgWithdrawal{ + Creator: s.alice.String(), + Receiver: s.alice.String(), + TokenA: "TokenA", + TokenB: "TokenB", + SharesToRemove: []math.Int{math.NewInt(5), math.NewInt(200_000_000)}, + TickIndexesAToB: []int64{0, 1}, + Fees: []uint64{1, 1}, + }, + } + resp, err := s.App.DexKeeper.SimulateWithdrawal(s.Ctx, req) + s.Error(err, types.ErrInsufficientShares) + s.Nil(resp) +} diff --git a/x/dex/keeper/grpc_query_tick_liquidity.go b/x/dex/keeper/grpc_query_tick_liquidity.go index 37622ccdf..bec800114 100644 --- a/x/dex/keeper/grpc_query_tick_liquidity.go +++ b/x/dex/keeper/grpc_query_tick_liquidity.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // NOTE: For single queries of tick liquidity use explicty typed queries diff --git a/x/dex/keeper/grpc_query_tick_liquidity_test.go b/x/dex/keeper/grpc_query_tick_liquidity_test.go index 42bb71eb1..8e8982dc9 100644 --- a/x/dex/keeper/grpc_query_tick_liquidity_test.go +++ b/x/dex/keeper/grpc_query_tick_liquidity_test.go @@ -8,8 +8,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestTickLiquidityQueryPaginated(t *testing.T) { diff --git a/x/dex/keeper/grpc_query_user_deposits.go b/x/dex/keeper/grpc_query_user_deposits.go index f941278e3..6dcb83b8b 100644 --- a/x/dex/keeper/grpc_query_user_deposits.go +++ b/x/dex/keeper/grpc_query_user_deposits.go @@ -7,9 +7,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/utils" - "github.com/neutron-org/neutron/v4/x/dex/types" - dexutils "github.com/neutron-org/neutron/v4/x/dex/utils" + "github.com/neutron-org/neutron/v5/utils" + "github.com/neutron-org/neutron/v5/x/dex/types" + dexutils "github.com/neutron-org/neutron/v5/x/dex/utils" ) func (k Keeper) UserDepositsAll( diff --git a/x/dex/keeper/grpc_query_user_deposits_test.go b/x/dex/keeper/grpc_query_user_deposits_test.go index f29bb3c62..e9c6a8f73 100644 --- a/x/dex/keeper/grpc_query_user_deposits_test.go +++ b/x/dex/keeper/grpc_query_user_deposits_test.go @@ -12,10 +12,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - neutronapp "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil" - keepertest "github.com/neutron-org/neutron/v4/x/dex/keeper/internal/testutils" - "github.com/neutron-org/neutron/v4/x/dex/types" + neutronapp "github.com/neutron-org/neutron/v5/app" + "github.com/neutron-org/neutron/v5/testutil" + keepertest "github.com/neutron-org/neutron/v5/x/dex/keeper/internal/testutils" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func simulateDeposit(ctx sdk.Context, app *neutronapp.App, addr sdk.AccAddress, deposit *types.DepositRecord) *types.Pool { diff --git a/x/dex/keeper/inactive_limit_order_tranche.go b/x/dex/keeper/inactive_limit_order_tranche.go index d29aba18e..a8d5115d5 100644 --- a/x/dex/keeper/inactive_limit_order_tranche.go +++ b/x/dex/keeper/inactive_limit_order_tranche.go @@ -5,7 +5,7 @@ import ( storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // SetInactiveLimitOrderTranche set a specific inactiveLimitOrderTranche in the store from its index @@ -58,13 +58,14 @@ func (k Keeper) GetAllInactiveLimitOrderTranche(ctx sdk.Context) (list []*types. return } -func (k Keeper) SaveInactiveTranche(sdkCtx sdk.Context, tranche *types.LimitOrderTranche) { +// UpdateInactiveTranche handles the logic for all updates to InactiveLimitOrderTranches +// It will delete an InactiveTranche if there is no remaining MakerReserves or TakerReserves +func (k Keeper) UpdateInactiveTranche(sdkCtx sdk.Context, tranche *types.LimitOrderTranche) { if tranche.HasTokenIn() || tranche.HasTokenOut() { + // There are still reserves to be removed. Save the tranche as is. k.SetInactiveLimitOrderTranche(sdkCtx, tranche) } else { - k.RemoveInactiveLimitOrderTranche( - sdkCtx, - tranche.Key, - ) + // There is nothing left to remove, we can safely remove the tranche entirely. + k.RemoveInactiveLimitOrderTranche(sdkCtx, tranche.Key) } } diff --git a/x/dex/keeper/inactive_limit_order_tranche_test.go b/x/dex/keeper/inactive_limit_order_tranche_test.go index fbba221f1..2c86871a3 100644 --- a/x/dex/keeper/inactive_limit_order_tranche_test.go +++ b/x/dex/keeper/inactive_limit_order_tranche_test.go @@ -8,10 +8,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func createNInactiveLimitOrderTranche( diff --git a/x/dex/keeper/integration_cancellimitorder_test.go b/x/dex/keeper/integration_cancellimitorder_test.go index 0b95f17f4..9b5ef34ab 100644 --- a/x/dex/keeper/integration_cancellimitorder_test.go +++ b/x/dex/keeper/integration_cancellimitorder_test.go @@ -6,7 +6,7 @@ import ( sdkmath "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestCancelEntireLimitOrderAOneExists() { @@ -51,6 +51,18 @@ func (s *DexTestSuite) TestCancelEntireLimitOrderBOneExists() { s.assertDexBalances(0, 0) s.assertCurr1To0(math.MinInt64) s.assertCurr0To1(math.MaxInt64) + + // Tranche is deleted + tranche, _, found := s.App.DexKeeper.FindLimitOrderTranche( + s.Ctx, + &types.LimitOrderTrancheKey{ + TradePairId: types.MustNewTradePairID("TokenA", "TokenB"), + TickIndexTakerToMaker: 0, + TrancheKey: trancheKey, + }, + ) + s.Nil(tranche) + s.False(found) } func (s *DexTestSuite) TestCancelHigherEntireLimitOrderATwoExistDiffTicksSameDirection() { @@ -173,7 +185,7 @@ func (s *DexTestSuite) TestCancelTwiceFails() { s.assertAliceBalances(50, 50) s.assertDexBalances(0, 0) - s.aliceCancelsLimitSellFails(trancheKey, types.ErrActiveLimitOrderNotFound) + s.aliceCancelsLimitSellFails(trancheKey, types.ErrValidLimitOrderTrancheNotFound) } func (s *DexTestSuite) TestCancelPartiallyFilled() { @@ -191,9 +203,57 @@ func (s *DexTestSuite) TestCancelPartiallyFilled() { // WHEN alice cancels her limit order s.aliceCancelsLimitSell(trancheKey) - // Then alice gets back remaining 25 TokenA LO reserves - s.assertAliceBalances(25, 0) - s.assertDexBalances(0, 25) + // Then alice gets back remaining 25 TokenA LO reserves & 25 TokenB taker tokens + s.assertAliceBalances(25, 25) + s.assertDexBalances(0, 0) + + // Assert that the LimitOrderTrancheUser has been deleted + _, found := s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.alice.String(), trancheKey) + s.Assert().False(found) +} + +func (s *DexTestSuite) TestCancelWithdrawThenCancel() { + s.fundAliceBalances(10, 0) + s.fundBobBalances(0, 20) + + // GIVEN alice limit sells 10 TokenA + trancheKey := s.aliceLimitSells("TokenA", -6931, 10) + // Bob swaps some TokenB for 5 TokenA + s.bobLimitSellsWithMaxOut("TokenB", 7000, 20, 5) + + // WHEN alice withdraws + s.aliceWithdrawsLimitSell(trancheKey) + s.assertAliceBalancesInt(sdkmath.ZeroInt(), sdkmath.NewInt(9999181)) + + // THEN Alice cancel still works + s.aliceCancelsLimitSell(trancheKey) + s.assertAliceBalancesInt(sdkmath.NewInt(4999999), sdkmath.NewInt(9999181)) +} + +func (s *DexTestSuite) TestCancelPartiallyFilledWithdrawFails() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(0, 10) + + // GIVEN alice limit sells 50 TokenA + trancheKey := s.aliceLimitSells("TokenA", 2000, 50) + // Bob swaps 10 TokenB for TokenA + s.bobLimitSells("TokenB", -2001, 10, types.LimitOrderType_FILL_OR_KILL) + + s.assertDexBalancesInt(sdkmath.NewInt(37786095), sdkmath.NewInt(10000000)) + s.assertAliceBalances(0, 0) + + // WHEN alice cancels her limit order + s.aliceCancelsLimitSell(trancheKey) + + // Then alice gets back remaining ~37 BIGTokenA LO reserves & 10 BIGTokenB taker tokens + s.assertAliceBalancesInt(sdkmath.NewInt(37786094), sdkmath.NewInt(9999999)) + s.assertDexBalancesInt(sdkmath.OneInt(), sdkmath.OneInt()) + + // Assert that the LimitOrderTrancheUser has been deleted + _, found := s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.alice.String(), trancheKey) + s.Assert().False(found) + + s.aliceWithdrawLimitSellFails(types.ErrValidLimitOrderTrancheNotFound, trancheKey) } func (s *DexTestSuite) TestCancelPartiallyFilledMultiUser() { @@ -215,12 +275,119 @@ func (s *DexTestSuite) TestCancelPartiallyFilledMultiUser() { s.aliceCancelsLimitSell(trancheKey) s.carolCancelsLimitSell(trancheKey) - // THEN alice gets back ~41 BIGTokenA (125 * 1/3) - s.assertAliceBalancesInt(sdkmath.NewInt(41_666_666), sdkmath.ZeroInt()) + // THEN alice gets back ~41 BIGTokenA (125 * 1/3) & ~8.3 BIGTokenB Taker tokens (25 * 1/3) + s.assertAliceBalancesInt(sdkmath.NewInt(41_666_666), sdkmath.NewInt(8333333)) + + // Carol gets back 83 TokenA (125 * 2/3) & ~16.6 BIGTokenB Taker tokens (25 * 2/3) + s.assertCarolBalancesInt(sdkmath.NewInt(83_333_333), sdkmath.NewInt(16666667)) + s.assertDexBalancesInt(sdkmath.OneInt(), sdkmath.ZeroInt()) + + // Assert that the LimitOrderTrancheUsers has been deleted + _, found := s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.alice.String(), trancheKey) + s.Assert().False(found) + _, found = s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.carol.String(), trancheKey) + s.Assert().False(found) +} + +func (s *DexTestSuite) TestCancelPartiallyFilledMultiUser2() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(50, 0) + s.fundCarolBalances(0, 40) + + // // GIVEN alice and bob each limit sells 50 TokenA + trancheKey := s.aliceLimitSells("TokenA", 2000, 50) + s.bobLimitSells("TokenA", 2000, 50) + // carol swaps 20 TokenB for TokenA + s.carolLimitSells("TokenB", -2001, 20, types.LimitOrderType_FILL_OR_KILL) + + // WHEN alice cancels her limit order + s.aliceCancelsLimitSell(trancheKey) + + // THEN alice gets back remaining ~38 BIGTokenA LO reserves & 10 BIGTokenB taker tokens + s.assertAliceBalancesInt(sdkmath.NewInt(37786094), sdkmath.NewInt(9999999)) + s.assertDexBalancesInt(sdkmath.NewInt(37786096), sdkmath.NewInt(10000001)) + + // THEN carol swap through more of the limitorder + s.carolLimitSells("TokenB", -2001, 20, types.LimitOrderType_FILL_OR_KILL) + + // And bob can withdraw his portion + s.bobWithdrawsLimitSell(trancheKey) + s.assertBobBalancesInt(sdkmath.ZeroInt(), sdkmath.NewInt(30000000)) +} + +func (s *DexTestSuite) TestCancelFirstMultiCancel() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(50, 0) + s.fundCarolBalances(0, 40) + + // // GIVEN alice and bob each limit sells 50 TokenA + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + s.bobLimitSells("TokenA", 0, 50) + s.bobCancelsLimitSell(trancheKey) + // carol swaps 10 TokenB for TokenA + s.carolLimitSells("TokenB", -1, 10, types.LimitOrderType_FILL_OR_KILL) + + // WHEN alice cancels her limit order + s.aliceCancelsLimitSell(trancheKey) - // Carol gets back 83 TokenA (125 * 2/3) - s.assertCarolBalancesInt(sdkmath.NewInt(83_333_333), sdkmath.ZeroInt()) - s.assertDexBalancesInt(sdkmath.OneInt(), sdkmath.NewInt(25_000_000)) + // THEN alice gets back remaining 40 tokenA 10 TokenB taker tokens + s.assertAliceBalances(40, 10) +} + +func (s *DexTestSuite) TestCancelFirstMultiWithdraw() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(50, 0) + s.fundCarolBalances(0, 40) + + // // GIVEN alice and bob each limit sells 50 TokenA + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + s.bobLimitSells("TokenA", 0, 50) + s.bobCancelsLimitSell(trancheKey) + // carol swaps 10 TokenB for TokenA + s.carolLimitSells("TokenB", -1, 10, types.LimitOrderType_FILL_OR_KILL) + + // WHEN alice withdraws her limit order + s.aliceWithdrawsLimitSell(trancheKey) + + // THEN alice gets 10 TokenB + s.assertAliceBalances(0, 10) +} + +func (s *DexTestSuite) TestCancelMultiAfterFilled() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(50, 0) + s.fundCarolBalances(0, 100) + + // GIVEN alice and bob each limit sells 50 TokenA + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + s.bobLimitSells("TokenA", 0, 50) + + // carol swaps through the tranche + s.carolLimitSells("TokenB", -1, 100, types.LimitOrderType_IMMEDIATE_OR_CANCEL) + + // WHEN alice and bob cancel their limit order + s.aliceCancelsLimitSell(trancheKey) + s.assertAliceBalances(0, 50) + s.bobCancelsLimitSell(trancheKey) + s.assertBobBalances(0, 50) + + // THEN they get back the expected profit + s.assertAliceBalances(0, 50) + s.assertBobBalances(0, 50) + + // AND tranche and trancheUsers are deleted + + s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.alice.String(), trancheKey) + _, _, found := s.App.DexKeeper.FindLimitOrderTranche(s.Ctx, &types.LimitOrderTrancheKey{ + TradePairId: types.MustNewTradePairID("TokenB", "TokenA"), + TickIndexTakerToMaker: 0, + TrancheKey: trancheKey, + }) + s.False(found) + _, found = s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.alice.String(), trancheKey) + s.Assert().False(found) + _, found = s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.carol.String(), trancheKey) + s.Assert().False(found) } func (s *DexTestSuite) TestCancelGoodTil() { @@ -239,7 +406,7 @@ func (s *DexTestSuite) TestCancelGoodTil() { s.assertNLimitOrderExpiration(0) } -func (s *DexTestSuite) TestCancelGoodTilAfterExpirationFails() { +func (s *DexTestSuite) TestCancelGoodTilAfterExpiration() { s.fundAliceBalances(50, 0) tomorrow := time.Now().AddDate(0, 0, 1) // GIVEN alice limit sells 50 TokenA with goodTil date of tommrow @@ -250,8 +417,19 @@ func (s *DexTestSuite) TestCancelGoodTilAfterExpirationFails() { // WHEN expiration date has passed s.beginBlockWithTime(time.Now().AddDate(0, 0, 2)) - // THEN alice cancellation fails - s.aliceCancelsLimitSellFails(trancheKey, types.ErrActiveLimitOrderNotFound) + // THEN alice cancellation succeeds + s.aliceCancelsLimitSell(trancheKey) + + s.assertAliceBalances(50, 0) + + // TrancheUser and Tranche are removed + s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.alice.String(), trancheKey) + _, _, found := s.App.DexKeeper.FindLimitOrderTranche(s.Ctx, &types.LimitOrderTrancheKey{ + TradePairId: types.MustNewTradePairID("TokenB", "TokenA"), + TickIndexTakerToMaker: 0, + TrancheKey: trancheKey, + }) + s.False(found) } func (s *DexTestSuite) TestCancelJITSameBlock() { @@ -280,7 +458,81 @@ func (s *DexTestSuite) TestCancelJITNextBlock() { s.nextBlockWithTime(time.Now()) s.beginBlockWithTime(time.Now()) - // THEN alice cancellation fails - s.aliceCancelsLimitSellFails(trancheKey, types.ErrActiveLimitOrderNotFound) - s.assertAliceBalances(0, 0) + // THEN alice cancellation succeeds + s.aliceCancelsLimitSell(trancheKey) + + s.assertAliceBalances(50, 0) + + // TrancheUser and Tranche are removed + s.App.DexKeeper.GetLimitOrderTrancheUser(s.Ctx, s.alice.String(), trancheKey) + _, _, found := s.App.DexKeeper.FindLimitOrderTranche(s.Ctx, &types.LimitOrderTrancheKey{ + TradePairId: types.MustNewTradePairID("TokenB", "TokenA"), + TickIndexTakerToMaker: 0, + TrancheKey: trancheKey, + }) + s.False(found) +} + +func (s *DexTestSuite) TestWithdrawThenCancel() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(50, 0) + s.fundCarolBalances(0, 40) + + // // GIVEN alice and bob each limit sells 50 TokenA + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + s.bobLimitSells("TokenA", 0, 50) + + s.carolLimitSells("TokenB", -1, 10, types.LimitOrderType_FILL_OR_KILL) + + // WHEN alice withdraws and cancels her limit order + s.aliceWithdrawsLimitSell(trancheKey) + s.aliceCancelsLimitSell(trancheKey) + s.assertAliceBalances(45, 5) + + s.bobWithdrawsLimitSell(trancheKey) + s.assertBobBalances(0, 5) + s.bobCancelsLimitSell(trancheKey) + s.assertBobBalances(45, 5) +} + +func (s *DexTestSuite) TestWithdrawThenCancel2() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(50, 0) + s.fundCarolBalances(0, 40) + + // // GIVEN alice and bob each limit sells 50 TokenA + trancheKey := s.aliceLimitSells("TokenA", 0, 50) + s.bobLimitSells("TokenA", 0, 50) + + s.carolLimitSells("TokenB", -1, 10, types.LimitOrderType_FILL_OR_KILL) + + // WHEN alice withdraws and cancels her limit order + s.aliceWithdrawsLimitSell(trancheKey) + s.aliceCancelsLimitSell(trancheKey) + s.assertAliceBalances(45, 5) + + s.bobCancelsLimitSell(trancheKey) + s.assertBobBalances(45, 5) +} + +func (s *DexTestSuite) TestWithdrawThenCancelLowTick() { + s.fundAliceBalances(50, 0) + s.fundBobBalances(50, 0) + s.fundCarolBalances(0, 40) + + // // GIVEN alice and bob each limit sells 50 TokenA + trancheKey := s.aliceLimitSells("TokenA", 20000, 50) + s.bobLimitSells("TokenA", 20000, 50) + + s.carolLimitSells("TokenB", -20001, 10, types.LimitOrderType_FILL_OR_KILL) + + // WHEN alice withdraws and cancels her limit order + s.aliceWithdrawsLimitSell(trancheKey) + s.aliceCancelsLimitSell(trancheKey) + s.assertAliceBalancesInt(sdkmath.NewInt(13058413), sdkmath.NewInt(4999999)) + + s.bobWithdrawsLimitSell(trancheKey) + s.assertBobBalancesInt(sdkmath.ZeroInt(), sdkmath.NewInt(4999999)) + s.bobCancelsLimitSell(trancheKey) + s.assertBobBalancesInt(sdkmath.NewInt(13058413), sdkmath.NewInt(4999999)) } diff --git a/x/dex/keeper/integration_deposit_autoswap_unit_test.go b/x/dex/keeper/integration_deposit_autoswap_unit_test.go index 5e0b68773..8cf8ddb95 100644 --- a/x/dex/keeper/integration_deposit_autoswap_unit_test.go +++ b/x/dex/keeper/integration_deposit_autoswap_unit_test.go @@ -1,109 +1,111 @@ package keeper_test -import "github.com/neutron-org/neutron/v4/x/dex/types" +import ( + "cosmossdk.io/math" +) -func (s *DexTestSuite) TestAutoswapperWithdraws() { +func (s *DexTestSuite) TestAutoswapSingleSided0To1() { s.fundAliceBalances(50, 50) - s.fundBobBalances(50, 50) - - // GIVEN - // create spread around -1, 1 - bobDep0 := 10 - bobDep1 := 10 - tickIndex := 200 - fee := 5 - - bobSharesMinted := s.calcSharesMinted(int64(tickIndex), int64(bobDep0), int64(bobDep1)) - - s.bobDeposits(NewDeposit(bobDep0, bobDep1, tickIndex, fee)) - s.assertBobBalances(40, 40) - s.assertDexBalances(10, 10) - - // Alice deposits at a different balance ratio - s.aliceDeposits(NewDepositWithOptions(12, 5, tickIndex, fee, types.DepositOptions{DisableAutoswap: false})) - s.assertAliceBalances(38, 45) - s.assertDexBalances(22, 15) - - // Calculated expected amounts out - autoswapSharesMinted := s.calcAutoswapSharesMinted(int64(tickIndex), uint64(fee), 7, 0, 5, 5, bobSharesMinted.Int64(), bobSharesMinted.Int64()) - // totalShares := autoswapSharesMinted.Add(math.NewInt(20)) - - aliceExpectedBalance0, aliceExpectedBalance1, dexExpectedBalance0, dexExpectedBalance1 := s.calcExpectedBalancesAfterWithdrawOnePool(autoswapSharesMinted, s.alice, int64(tickIndex), uint64(fee)) - - s.aliceWithdraws(NewWithdrawalInt(autoswapSharesMinted, int64(tickIndex), uint64(fee))) - - s.assertAliceBalancesInt(aliceExpectedBalance0, aliceExpectedBalance1) - s.assertDexBalancesInt(dexExpectedBalance0, dexExpectedBalance1) + s.fundBobBalances(50, 0) + + // GIVEN a pool with double-sided liquidity + s.aliceDeposits(NewDeposit(50, 50, 2000, 2)) + s.assertAccountSharesInt(s.alice, 2000, 2, math.NewInt(111069527)) + + // WHEN bob deposits only TokenA + s.bobDeposits(NewDeposit(50, 0, 2000, 2)) + s.assertPoolLiquidity(100, 50, 2000, 2) + + // THEN his deposit is autoswapped + // He receives 49.985501 shares + // swapAmount = 27.491577 Token0 see pool.go for the math + // (50 - 27.491577) / ( 27.491577 / 1.0001^2000) = 1 ie. pool ratio is maintained + // depositValue = depositAmount - (autoswapedAmountAsToken0 * fee) + // = 50 - 27.491577 * (1 - 1.0001^-2) + // = 49.9945025092 + // SharesIssued = depositValue * existing shares / (existingValue + autoSwapFee) + // = 49.9945025092 * 111.069527 / (111.069527 + .005497490762642563860802206452577) + // = 49.992027 + + s.assertAccountSharesInt(s.bob, 2000, 2, math.NewInt(49992027)) } -func (s *DexTestSuite) TestAutoswapOtherDepositorWithdraws() { +func (s *DexTestSuite) TestAutoswapSingleSided1To0() { s.fundAliceBalances(50, 50) - s.fundBobBalances(50, 50) - - // GIVEN - // create spread around -1, 1 - bobDep0 := 10 - bobDep1 := 10 - tickIndex := 150 - fee := 10 - - bobSharesMinted := s.calcSharesMinted(int64(tickIndex), int64(bobDep0), int64(bobDep1)) - - s.bobDeposits(NewDeposit(bobDep0, bobDep1, tickIndex, fee)) - s.assertBobBalances(40, 40) - s.assertDexBalances(10, 10) - - // Alice deposits at a different balance ratio - s.aliceDeposits(NewDepositWithOptions(10, 7, tickIndex, fee, types.DepositOptions{DisableAutoswap: false})) - s.assertAliceBalances(40, 43) - s.assertDexBalances(20, 17) - - // Calculated expected amounts out - - bobExpectedBalance0, bobExpectedBalance1, dexExpectedBalance0, dexExpectedBalance1 := s.calcExpectedBalancesAfterWithdrawOnePool(bobSharesMinted, s.bob, int64(tickIndex), uint64(fee)) - - s.bobWithdraws(NewWithdrawalInt(bobSharesMinted, int64(tickIndex), uint64(fee))) - - s.assertBobBalancesInt(bobExpectedBalance0, bobExpectedBalance1) - s.assertDexBalancesInt(dexExpectedBalance0, dexExpectedBalance1) + s.fundBobBalances(0, 50) + + // GIVEN a pool with double-sided liquidity + s.aliceDeposits(NewDeposit(50, 50, 2000, 2)) + s.assertAccountSharesInt(s.alice, 2000, 2, math.NewInt(111069527)) + + // WHEN bob deposits only TokenB + s.bobDeposits(NewDeposit(0, 50, 2000, 2)) + s.assertPoolLiquidity(50, 100, 2000, 2) + + // THEN his deposit is autoswapped + // He receives 61.0 shares + // depositAmountAsToken0 = 50 * 1.0001^2000 = 61.06952725039 + // swapAmount = 22.508423 Token1 see pool.go for the math + // swapAmountAsToken0 = 27.4915750352 + // (22.508423 * 1.0001^2000) / (50 - 22.508423) = 1 ie. pool ratio is maintained + // depositValue = depositAmountAsToken0 - (autoswapedAmountAsToken0 * fee) + // = 61.06952725039 - 27.4915750352 * (1 - 1.0001^-2) + // = 61.06402976002 + // SharesIssued = depositValue * existing shares / (existingValue + autoSwapFee) + // = 61.06402976002 * 111.069527 / (111.069527 + 0.00549749037) + // = 61061007 + + s.assertAccountSharesInt(s.bob, 2000, 2, math.NewInt(61061007)) } -func (s *DexTestSuite) TestAutoswapBothWithdraws() { - s.fundAliceBalances(50, 50) +func (s *DexTestSuite) TestAutoswapDoubleSided0To1() { + s.fundAliceBalances(30, 50) s.fundBobBalances(50, 50) - // GIVEN - // create spread around -1, 1 - bobDep0 := 10 - bobDep1 := 10 - tickIndex := 10000 - fee := 5 - - s.bobDeposits(NewDeposit(bobDep0, bobDep1, tickIndex, fee)) - bobSharesMinted := s.getAccountShares(s.bob, "TokenA", "TokenB", int64(tickIndex), uint64(fee)) - s.assertBobBalances(40, 40) - s.assertDexBalances(10, 10) - - // Alice deposits at a different balance ratio - s.aliceDeposits(NewDepositWithOptions(10, 5, tickIndex, fee, types.DepositOptions{DisableAutoswap: false})) - s.assertAliceBalances(40, 45) - s.assertDexBalances(20, 15) - - // Calculated expected amounts out - autoswapSharesMinted := s.getAccountShares(s.alice, "TokenA", "TokenB", int64(tickIndex), uint64(fee)) - // totalShares := autoswapSharesMinted.Add(math.NewInt(20)) - - bobExpectedBalance0, bobExpectedBalance1, dexExpectedBalance0, dexExpectedBalance1 := s.calcExpectedBalancesAfterWithdrawOnePool(bobSharesMinted, s.bob, int64(tickIndex), uint64(fee)) - - s.bobWithdraws(NewWithdrawalInt(bobSharesMinted, int64(tickIndex), uint64(fee))) - - s.assertBobBalancesInt(bobExpectedBalance0, bobExpectedBalance1) - s.assertDexBalancesInt(dexExpectedBalance0, dexExpectedBalance1) - - aliceExpectedBalance0, aliceExpectedBalance1, dexExpectedBalance0, dexExpectedBalance1 := s.calcExpectedBalancesAfterWithdrawOnePool(autoswapSharesMinted, s.alice, int64(tickIndex), uint64(fee)) + // GIVEN a pool with double-sided liquidity at ratio 3:5 + s.aliceDeposits(NewDeposit(30, 50, -4000, 10)) + s.assertAccountSharesInt(s.alice, -4000, 10, math.NewInt(63516672)) + + // WHEN bob deposits a ratio of 1:1 tokenA and B + s.bobDeposits(NewDeposit(50, 50, -4000, 10)) + s.assertPoolLiquidity(80, 100, -4000, 10) + + // THEN his deposit is autoswapped + // He receives 83.5 shares + // swapAmount = 10.553662 Token0 see pool.go for the math + // (50 - 10.553662) / (50 + 10.553662 / 1.0001^-4000) = 3/5 ie. pool ratio is maintained + // depositValue = depositAmountAsToken0 - (autoswapedAmountAsToken0 * fee) + // = 83.5166725838 - 10.553662 * (1 - 1.0001^-10) + // = 83.506124724 + // SharesIssued = depositValue * existing shares / (existingValue + autoSwapFee) + // = 83.506124724 * 63.516672 / (63.516672 + .010547859) + // = 83.492258 + + s.assertAccountSharesInt(s.bob, -4000, 10, math.NewInt(83492258)) +} - s.aliceWithdraws(NewWithdrawalInt(autoswapSharesMinted, int64(tickIndex), uint64(fee))) +func (s *DexTestSuite) TestAutoswapDoubleSided1To0() { + s.fundAliceBalances(50, 30) + s.fundBobBalances(50, 50) - s.assertAliceBalancesInt(aliceExpectedBalance0, aliceExpectedBalance1) - s.assertDexBalancesInt(dexExpectedBalance0, dexExpectedBalance1) + // GIVEN a pool with double-sided liquidity + s.aliceDeposits(NewDeposit(50, 30, -4000, 10)) + s.assertAccountSharesInt(s.alice, -4000, 10, math.NewInt(70110003)) + + // WHEN bob deposits a ratio of 1:1 tokenA and B + s.bobDeposits(NewDeposit(50, 50, -4000, 10)) + s.assertPoolLiquidity(100, 80, -4000, 10) + + // THEN his deposit is autoswapped + // He receives 83.5 shares + // swapAmount = 14.263300 Token1 see pool.go for the math + // swapAmountAsToken0 = 9.5611671213 + // depositValue = depositAmountAsToken0 - (autoswapedAmountAsToken0 * fee) + // = 83.5166725838 - 9.5611671213 * (1 - 1.0001^-10) + // = 83.5071166732 + // SharesIssued = depositValue * existing shares / (existingValue + autoSwapFee) + // = 83.5071166732 * 70.110003 / (70.1100035503 + .009555910582) + // = 83.495735 + + s.assertAccountSharesInt(s.bob, -4000, 10, math.NewInt(83495735)) } diff --git a/x/dex/keeper/integration_deposit_doublesided_test.go b/x/dex/keeper/integration_deposit_doublesided_test.go index 3f54f9c16..57f9a2e0c 100644 --- a/x/dex/keeper/integration_deposit_doublesided_test.go +++ b/x/dex/keeper/integration_deposit_doublesided_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestDepositDoubleSidedInSpreadCurrTickAdjusted() { diff --git a/x/dex/keeper/integration_deposit_multi_test.go b/x/dex/keeper/integration_deposit_multi_test.go index a9a72c906..591942343 100644 --- a/x/dex/keeper/integration_deposit_multi_test.go +++ b/x/dex/keeper/integration_deposit_multi_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestDepositMultiCompleteFailure() { @@ -23,7 +23,7 @@ func (s *DexTestSuite) TestDepositMultiCompleteFailure() { s.assertAliceDepositFails( err, NewDeposit(5, 0, 2, 1), - NewDeposit(0, 5, 0, 1), // fails + NewDepositWithOptions(0, 5, 0, 1, types.DepositOptions{DisableAutoswap: true}), // fails ) } diff --git a/x/dex/keeper/integration_deposit_singlesided_test.go b/x/dex/keeper/integration_deposit_singlesided_test.go index 2e7fa8572..81a8e65e9 100644 --- a/x/dex/keeper/integration_deposit_singlesided_test.go +++ b/x/dex/keeper/integration_deposit_singlesided_test.go @@ -5,7 +5,7 @@ import ( sdkmath "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestDepositSingleSidedInSpread1To0() { @@ -271,13 +271,17 @@ func (s *DexTestSuite) TestDepositSingleSidedMultiA() { // WHEN // multi deposit - s.aliceDeposits( + resp := s.aliceDeposits( NewDeposit(10, 0, 0, 1), NewDeposit(10, 0, 0, 3), ) // THEN // assert 20 of token B deposited at tick 1 fee 0 and ticks unchanged + s.True(resp.Reserve0Deposited[0].Equal(sdkmath.NewInt(10000000))) + s.True(resp.Reserve0Deposited[1].Equal(sdkmath.NewInt(10000000))) + s.EqualValues([]sdkmath.Int{sdkmath.ZeroInt(), sdkmath.ZeroInt()}, resp.Reserve1Deposited) + s.EqualValues([]*types.FailedDeposit(nil), resp.FailedDeposits) s.assertAliceBalances(20, 50) s.assertDexBalances(30, 0) s.assertPoolLiquidity(20, 0, 0, 1) @@ -300,13 +304,17 @@ func (s *DexTestSuite) TestDepositSingleSidedMultiB() { // WHEN // multi deposit at - s.aliceDeposits( + resp := s.aliceDeposits( NewDeposit(0, 10, 0, 1), NewDeposit(0, 10, 0, 3), ) // THEN // assert 20 of token B deposited at tick 1 fee 0 and ticks unchanged + s.EqualValues([]sdkmath.Int{sdkmath.ZeroInt(), sdkmath.ZeroInt()}, resp.Reserve0Deposited) + s.True(resp.Reserve1Deposited[0].Equal(sdkmath.NewInt(10000000))) + s.True(resp.Reserve1Deposited[1].Equal(sdkmath.NewInt(10000000))) + s.EqualValues([]*types.FailedDeposit(nil), resp.FailedDeposits) s.assertAliceBalances(50, 20) s.assertDexBalances(0, 30) s.assertPoolLiquidity(0, 20, 0, 1) @@ -360,7 +368,7 @@ func (s *DexTestSuite) TestDepositSingleSidedZeroTrueAmountsFail() { // second deposit's ratio is different than pool after the first, so amounts will be rounded to 0,0 and tx will fail err := types.ErrZeroTrueDeposit - s.assertAliceDepositFails(err, NewDeposit(0, 5, 0, 1)) + s.assertAliceDepositFails(err, NewDepositWithOptions(0, 5, 0, 1, types.DepositOptions{DisableAutoswap: true})) } func (s *DexTestSuite) TestDepositNilOptions() { diff --git a/x/dex/keeper/integration_multihopswap_test.go b/x/dex/keeper/integration_multihopswap_test.go index 29ffdc6f0..0ca12fa6c 100644 --- a/x/dex/keeper/integration_multihopswap_test.go +++ b/x/dex/keeper/integration_multihopswap_test.go @@ -4,8 +4,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) type PoolSetup struct { @@ -195,7 +195,7 @@ func (s *DexTestSuite) TestMultiHopSwapInsufficientLiquiditySingleRoute() { // THEN alice multihopswap fails route := [][]string{{"TokenA", "TokenB", "TokenC", "TokenD"}} s.aliceMultiHopSwapFails( - types.ErrLimitPriceNotSatisfied, + types.ErrNoLiquidity, route, 100, math_utils.MustNewPrecDecFromStr("0.9"), diff --git a/x/dex/keeper/integration_placelimitorder_test.go b/x/dex/keeper/integration_placelimitorder_test.go index fcd074bdc..f63f9b8a3 100644 --- a/x/dex/keeper/integration_placelimitorder_test.go +++ b/x/dex/keeper/integration_placelimitorder_test.go @@ -7,8 +7,8 @@ import ( sdkmath "cosmossdk.io/math" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // Core tests w/ GTC limitOrders ////////////////////////////////////////////// @@ -243,6 +243,57 @@ func (s *DexTestSuite) TestPlaceLimitOrderInsufficientFunds() { s.assertAliceLimitSellFails(err, "TokenA", 0, 10) } +func (s *DexTestSuite) TestPlaceLimitOrderGTCWithDustMinAvgPriceFails() { + s.fundAliceBalances(1, 0) + s.fundBobBalances(0, 1) + // GIVEN LP liq at 148.37-148.42 (with dust) + s.bobDeposits( + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_000, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_001, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_002, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(10), 50_003, 1), + ) + // THEN alice GTC limitOrder minAvgPrice == limitPrice fails + limitPrice := math_utils.MustNewPrecDecFromStr("0.006737") + _, err := s.msgServer.PlaceLimitOrder(s.Ctx, &types.MsgPlaceLimitOrder{ + Creator: s.alice.String(), + Receiver: s.alice.String(), + TokenIn: "TokenA", + TokenOut: "TokenB", + LimitSellPrice: &limitPrice, + AmountIn: sdkmath.NewInt(2000), + OrderType: types.LimitOrderType_GOOD_TIL_CANCELLED, + MinAverageSellPrice: &limitPrice, + }) + s.ErrorIs(err, types.ErrLimitPriceNotSatisfied) +} + +func (s *DexTestSuite) TestPlaceLimitOrderGTCWithDustMinAvgPrice() { + s.fundAliceBalances(1, 0) + s.fundBobBalances(0, 1) + // GIVEN LP liq at 148.37-148.42 (with dust) + s.bobDeposits( + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_000, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_001, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_002, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(10), 50_003, 1), + ) + // THEN alice IoC limitOrder with lower min avg prices success + limitPrice := math_utils.MustNewPrecDecFromStr("0.006737") + minAvgPrice := math_utils.MustNewPrecDecFromStr("0.006728") + _, err := s.msgServer.PlaceLimitOrder(s.Ctx, &types.MsgPlaceLimitOrder{ + Creator: s.alice.String(), + Receiver: s.alice.String(), + TokenIn: "TokenA", + TokenOut: "TokenB", + LimitSellPrice: &limitPrice, + AmountIn: sdkmath.NewInt(2000), + OrderType: types.LimitOrderType_GOOD_TIL_CANCELLED, + MinAverageSellPrice: &minAvgPrice, + }) + s.NoError(err) +} + func (s *DexTestSuite) TestLimitOrderPartialFillDepositCancel() { s.fundAliceBalances(100, 100) s.fundBobBalances(100, 100) @@ -271,31 +322,19 @@ func (s *DexTestSuite) TestLimitOrderPartialFillDepositCancel() { s.aliceCancelsLimitSell(trancheKey0) - s.assertAliceBalances(100, 40) + s.assertAliceBalances(110, 40) s.assertBobBalances(90, 110) - s.assertDexBalances(10, 50) + s.assertDexBalances(0, 50) s.assertCurrentTicks(math.MinInt64, 0) s.bobLimitSells("TokenA", 10, 10, types.LimitOrderType_FILL_OR_KILL) - s.assertAliceBalances(100, 40) + s.assertAliceBalances(110, 40) s.assertBobBalances(80, 120) - s.assertDexBalances(20, 40) + s.assertDexBalances(10, 40) s.aliceCancelsLimitSell(trancheKey1) - s.assertAliceBalances(100, 80) - s.assertBobBalances(80, 120) - s.assertDexBalances(20, 0) - - s.aliceWithdrawsLimitSell(trancheKey0) - - s.assertAliceBalances(110, 80) - s.assertBobBalances(80, 120) - s.assertDexBalances(10, 0) - - s.aliceWithdrawsLimitSell(trancheKey1) - s.assertAliceBalances(120, 80) s.assertBobBalances(80, 120) s.assertDexBalances(0, 0) @@ -315,6 +354,90 @@ func (s *DexTestSuite) TestPlaceLimitOrderWithDustHitsTruePriceLimit() { s.assertAliceLimitSellFails(types.ErrLimitPriceNotSatisfied, "TokenA", 20005, 1, types.LimitOrderType_IMMEDIATE_OR_CANCEL) } +func (s *DexTestSuite) TestPlaceLimitOrderIOCWithDustMinAvgPriceFails() { + s.fundAliceBalances(1, 0) + s.fundBobBalances(0, 1) + // GIVEN LP liq at 148.37-148.42 (with dust) + s.bobDeposits( + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_000, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_001, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_002, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(10), 50_003, 1), + ) + // THEN alice IoC limitOrder minAvgPrice == limitPrice fails + _, err := s.aliceLimitSellsWithMinAvgPrice( + "TokenA", + math_utils.MustNewPrecDecFromStr("0.006730"), + 1, + math_utils.MustNewPrecDecFromStr("0.006730"), + types.LimitOrderType_IMMEDIATE_OR_CANCEL, + ) + s.ErrorIs(err, types.ErrLimitPriceNotSatisfied) +} + +func (s *DexTestSuite) TestPlaceLimitOrderIOCWithDustMinAvgPrice() { + s.fundAliceBalances(1, 0) + s.fundBobBalances(0, 1) + // GIVEN LP liq at 148.37-148.42 (with dust) + s.bobDeposits( + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_000, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_001, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(1), 50_002, 1), + NewDepositInt(sdkmath.ZeroInt(), sdkmath.NewInt(10), 50_003, 1), + ) + // THEN alice IoC limitOrder with lower min avg prices success + _, err := s.aliceLimitSellsWithMinAvgPrice( + "TokenA", + math_utils.MustNewPrecDecFromStr("0.006730"), + 1, + math_utils.MustNewPrecDecFromStr("0.006727"), + types.LimitOrderType_IMMEDIATE_OR_CANCEL, + ) + s.NoError(err) +} + +func (s *DexTestSuite) TestPlaceLimitOrderIOCMinAvgPriceGTSellPriceFails() { + s.fundAliceBalances(40, 0) + s.fundBobBalances(0, 40) + // GIVEN LP liq between taker price .995 and .992 + s.bobDeposits( + NewDeposit(0, 10, 50, 1), + NewDeposit(0, 10, 60, 1), + NewDeposit(0, 10, 70, 1), + NewDeposit(0, 10, 80, 1), + ) + // THEN alice places IOC limitOrder with very low MinAveragePrice Fails + _, err := s.aliceLimitSellsWithMinAvgPrice( + "TokenA", + math_utils.MustNewPrecDecFromStr("0.99"), + 40, + math_utils.MustNewPrecDecFromStr("0.995"), + types.LimitOrderType_IMMEDIATE_OR_CANCEL, + ) + s.ErrorIs(err, types.ErrLimitPriceNotSatisfied) +} + +func (s *DexTestSuite) TestPlaceLimitOrderIOCMinAvgPriceGTSellPrice() { + s.fundAliceBalances(40, 0) + s.fundBobBalances(0, 40) + // GIVEN LP liq between taker price .995 and .992 + s.bobDeposits( + NewDeposit(0, 10, 50, 1), + NewDeposit(0, 10, 60, 1), + NewDeposit(0, 10, 70, 1), + NewDeposit(0, 10, 80, 1), + ) + // THEN alice places IOC limitOrder with an achievable MinAveragePrice + _, err := s.aliceLimitSellsWithMinAvgPrice( + "TokenA", + math_utils.MustNewPrecDecFromStr("0.99"), + 40, + math_utils.MustNewPrecDecFromStr("0.993"), + types.LimitOrderType_IMMEDIATE_OR_CANCEL, + ) + s.NoError(err) +} + func (s *DexTestSuite) TestPlaceLimitOrderWithDust() { s.fundAliceBalances(1, 0) s.fundBobBalances(0, 1) @@ -540,7 +663,7 @@ func (s *DexTestSuite) TestPlaceLimitOrderIoCNoLiq() { s.fundAliceBalances(10, 0) // GIVEN no liquidity // Thenalice IoC limitOrder fails - s.assertAliceLimitSellFails(types.ErrLimitPriceNotSatisfied, "TokenA", 0, 10, types.LimitOrderType_IMMEDIATE_OR_CANCEL) + s.assertAliceLimitSellFails(types.ErrNoLiquidity, "TokenA", 0, 10, types.LimitOrderType_IMMEDIATE_OR_CANCEL) } func (s *DexTestSuite) TestPlaceLimitOrderIoCWithLPFills() { @@ -583,7 +706,7 @@ func (s *DexTestSuite) TestPlaceLimitOrderIoCWithLPNoFill() { // GIVEN LP of 5 tokenB at tick -1 s.bobDeposits(NewDeposit(0, 5, -1, 1)) // THEN alice IoC limitOrder for 10 tokenA below current 0To1 price fails - s.assertAliceLimitSellFails(types.ErrLimitPriceNotSatisfied, "TokenA", -1, 10, types.LimitOrderType_IMMEDIATE_OR_CANCEL) + s.assertAliceLimitSellFails(types.ErrNoLiquidity, "TokenA", -1, 10, types.LimitOrderType_IMMEDIATE_OR_CANCEL) } func (s *DexTestSuite) TestPlaceLimitOrderIoCTooSmallFails() { diff --git a/x/dex/keeper/integration_withdraw_multi_test.go b/x/dex/keeper/integration_withdraw_multi_test.go index 8dca0ba28..8857fa366 100644 --- a/x/dex/keeper/integration_withdraw_multi_test.go +++ b/x/dex/keeper/integration_withdraw_multi_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestWithdrawMultiFailure() { diff --git a/x/dex/keeper/integration_withdraw_test.go b/x/dex/keeper/integration_withdraw_test.go index fa146e61a..d9e5292c2 100644 --- a/x/dex/keeper/integration_withdraw_test.go +++ b/x/dex/keeper/integration_withdraw_test.go @@ -5,7 +5,7 @@ import ( sdkmath "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestPartialWithdrawOnlyA() { diff --git a/x/dex/keeper/integration_withdrawfilled_test.go b/x/dex/keeper/integration_withdrawfilled_test.go index 9ddfbf3bc..26e111875 100644 --- a/x/dex/keeper/integration_withdrawfilled_test.go +++ b/x/dex/keeper/integration_withdrawfilled_test.go @@ -6,7 +6,7 @@ import ( sdkmath "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (s *DexTestSuite) TestWithdrawFilledSimpleFull() { @@ -339,9 +339,6 @@ func (s *DexTestSuite) TestWithdrawPartiallyFilledCancelled() { // AND alice cancels the remainder s.aliceCancelsLimitSell(trancheKey) - - // THEN she can withdraw the unused portion - s.aliceWithdrawsLimitSell(trancheKey) s.assertAliceBalances(1, 1) // AND her LimitOrderTrancheUser is removed @@ -389,8 +386,27 @@ func (s *DexTestSuite) TestWithdrawPartiallyGTTFilledCancelled() { s.False(found, "Alice's LimitOrderTrancheUser not removed") } -// testcancel unfilled +func (s *DexTestSuite) TestWithdrawInactive() { + s.fundAliceBalances(10, 0) + s.fundBobBalances(0, 20) + + // GIVEN Alice places an expiring limit order of A + trancheKey := s.aliceLimitSellsGoodTil("TokenA", 0, 10, time.Now()) + + // Bob trades through half of it + s.bobLimitSells("TokenB", -1, 5) + + // Alice withdraws the profits + s.aliceWithdrawsLimitSell(trancheKey) + s.assertAliceBalances(0, 5) + + // bob swap through more + s.bobLimitSells("TokenB", -1, 4) -// test withdraw expired + // WHEN it is purged + s.App.DexKeeper.PurgeExpiredLimitOrders(s.Ctx, time.Now()) -// how does cancel withdraw work does it call into was filled + // THEN alice can withdraw the expected amount + s.aliceWithdrawsLimitSell(trancheKey) + s.assertAliceBalances(1, 9) +} diff --git a/x/dex/keeper/internal/testutils/test_helpers.go b/x/dex/keeper/internal/testutils/test_helpers.go index 4af8ec773..e1ea65424 100644 --- a/x/dex/keeper/internal/testutils/test_helpers.go +++ b/x/dex/keeper/internal/testutils/test_helpers.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - dexmoduletypes "github.com/neutron-org/neutron/v4/x/dex/types" + dexmoduletypes "github.com/neutron-org/neutron/v5/x/dex/types" ) func NewACoin(amt math.Int) sdk.Coin { diff --git a/x/dex/keeper/keeper.go b/x/dex/keeper/keeper.go index 797b74d48..e2c5b7f98 100644 --- a/x/dex/keeper/keeper.go +++ b/x/dex/keeper/keeper.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) type ( diff --git a/x/dex/keeper/limit_order_expiration.go b/x/dex/keeper/limit_order_expiration.go index f9127a38f..58b6584c8 100644 --- a/x/dex/keeper/limit_order_expiration.go +++ b/x/dex/keeper/limit_order_expiration.go @@ -7,7 +7,7 @@ import ( storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // Creates a new LimitOrderExpiration struct based on a LimitOrderTranche diff --git a/x/dex/keeper/limit_order_expiration_test.go b/x/dex/keeper/limit_order_expiration_test.go index e1fc1398e..8dadf9ee9 100644 --- a/x/dex/keeper/limit_order_expiration_test.go +++ b/x/dex/keeper/limit_order_expiration_test.go @@ -9,8 +9,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) const gasRequiredToPurgeOneLO uint64 = 9_000 @@ -163,7 +163,7 @@ func (s *DexTestSuite) TestPurgeExpiredLimitOrders() { updateEvent := s.FindEvent(ctx.EventManager().Events(), types.TickUpdateEventKey) eventAttrs := s.ExtractAttributes(updateEvent) // Event has Reserves == 0 - s.Equal(eventAttrs[types.TickUpdateEventReserves], "0") + s.Equal(eventAttrs[types.AttributeReserves], "0") } func (s *DexTestSuite) TestPurgeExpiredLimitOrdersAtBlockGasLimit() { @@ -230,5 +230,5 @@ func (s *DexTestSuite) TestPurgeExpiredLimitOrdersAtBlockGasLimitOnlyJIT() { s.Equal(0, len(expList)) // AND GoodTilPurgeHitGasLimit event is not been emitted - s.AssertEventValueNotEmitted(types.GoodTilPurgeHitGasLimitEventGas, "Hit gas limit purging JIT expirations") + s.AssertEventValueNotEmitted(types.EventTypeGoodTilPurgeHitGasLimit, "Hit gas limit purging JIT expirations") } diff --git a/x/dex/keeper/limit_order_tranche.go b/x/dex/keeper/limit_order_tranche.go index 5ffaee303..2c0dcae57 100644 --- a/x/dex/keeper/limit_order_tranche.go +++ b/x/dex/keeper/limit_order_tranche.go @@ -10,15 +10,16 @@ import ( storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" - "github.com/neutron-org/neutron/v4/x/dex/utils" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) func NewLimitOrderTranche( limitOrderTrancheKey *types.LimitOrderTrancheKey, goodTil *time.Time, ) (*types.LimitOrderTranche, error) { - priceTakerToMaker, err := limitOrderTrancheKey.PriceTakerToMaker() + price, err := limitOrderTrancheKey.Price() if err != nil { return nil, err } @@ -29,7 +30,8 @@ func NewLimitOrderTranche( TotalMakerDenom: math.ZeroInt(), TotalTakerDenom: math.ZeroInt(), ExpirationTime: goodTil, - PriceTakerToMaker: priceTakerToMaker, + MakerPrice: price, + PriceTakerToMaker: math_utils.OnePrecDec().Quo(price), }, nil } @@ -51,12 +53,27 @@ func (k Keeper) FindLimitOrderTranche( return nil, false, false } -func (k Keeper) SaveTranche(ctx sdk.Context, tranche *types.LimitOrderTranche) { - if tranche.HasTokenIn() { +// UpdateTranche handles the logic for all updates to active LimitOrderTranches in the KV Store. +// NOTE: This method should always be called even if not all logic branches are applicable. +// It avoids unnecessary repetition of logic and provides a single place to attach update event handlers. +func (k Keeper) UpdateTranche(ctx sdk.Context, tranche *types.LimitOrderTranche) { + switch { + + // Tranche still has TokenIn (ReservesMakerDenom) ==> Just save the update + case tranche.HasTokenIn(): k.SetLimitOrderTranche(ctx, tranche) - } else { + + // There is no TokenIn but there is still withdrawable TokenOut (ReservesTakerDenom) ==> Remove the active tranche and create a new inactive tranche + case tranche.HasTokenOut(): k.SetInactiveLimitOrderTranche(ctx, tranche) k.RemoveLimitOrderTranche(ctx, tranche.Key) + // We are removing liquidity from the orderbook so we emit an event + ctx.EventManager().EmitEvents(types.GetEventsDecTotalOrders(tranche.Key.TradePairId)) + + // There is no TokenIn or Token Out ==> We can delete the tranche entirely + default: + k.RemoveLimitOrderTranche(ctx, tranche.Key) + // We are removing liquidity from the orderbook so we emit an event ctx.EventManager().EmitEvents(types.GetEventsDecTotalOrders(tranche.Key.TradePairId)) } diff --git a/x/dex/keeper/limit_order_tranche_test.go b/x/dex/keeper/limit_order_tranche_test.go index 3c44f3822..35d69d394 100644 --- a/x/dex/keeper/limit_order_tranche_test.go +++ b/x/dex/keeper/limit_order_tranche_test.go @@ -8,10 +8,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func createNLimitOrderTranches( diff --git a/x/dex/keeper/limit_order_tranche_user.go b/x/dex/keeper/limit_order_tranche_user.go index 13ca0fc1c..b08f460ca 100644 --- a/x/dex/keeper/limit_order_tranche_user.go +++ b/x/dex/keeper/limit_order_tranche_user.go @@ -6,7 +6,7 @@ import ( storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (k Keeper) GetOrInitLimitOrderTrancheUser( @@ -25,7 +25,6 @@ func (k Keeper) GetOrInitLimitOrderTrancheUser( Address: receiver, SharesOwned: math.ZeroInt(), SharesWithdrawn: math.ZeroInt(), - SharesCancelled: math.ZeroInt(), TickIndexTakerToMaker: tickIndex, TradePairId: tradePairID, OrderType: orderType, @@ -88,12 +87,18 @@ func (k Keeper) RemoveLimitOrderTrancheUser(ctx sdk.Context, trancheUser *types. ) } -func (k Keeper) SaveTrancheUser(ctx sdk.Context, trancheUser *types.LimitOrderTrancheUser) { +// UpdateTrancheUser handles the logic for all updates to LimitOrderTrancheUsers in the KV Store. +// NOTE: This method should always be called even if not all logic branches are applicable. +// It avoids unnecessary repetition of logic and provides a single place to attach update event handlers. +func (k Keeper) UpdateTrancheUser(ctx sdk.Context, trancheUser *types.LimitOrderTrancheUser) { if trancheUser.IsEmpty() { + // The trancheUser has no remaining withdrawable shares and can be deleted k.RemoveLimitOrderTrancheUser(ctx, trancheUser) } else { + // The trancheUser has withdrawable shares; it should be saved k.SetLimitOrderTrancheUser(ctx, trancheUser) } + ctx.EventManager().EmitEvent(types.TrancheUserUpdateEvent(*trancheUser)) } // GetAllLimitOrderTrancheUser returns all LimitOrderTrancheUser diff --git a/x/dex/keeper/limit_order_tranche_user_test.go b/x/dex/keeper/limit_order_tranche_user_test.go index 9a4014f36..cfde55729 100644 --- a/x/dex/keeper/limit_order_tranche_user_test.go +++ b/x/dex/keeper/limit_order_tranche_user_test.go @@ -8,10 +8,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func createNLimitOrderTrancheUser(keeper *keeper.Keeper, ctx sdk.Context, n int) []*types.LimitOrderTrancheUser { @@ -24,7 +24,6 @@ func createNLimitOrderTrancheUser(keeper *keeper.Keeper, ctx sdk.Context, n int) TickIndexTakerToMaker: int64(i), SharesOwned: math.NewInt(100), SharesWithdrawn: math.ZeroInt(), - SharesCancelled: math.ZeroInt(), } items[i] = val keeper.SetLimitOrderTrancheUser(ctx, items[i]) @@ -43,7 +42,6 @@ func createNLimitOrderTrancheUserWithAddress(keeper *keeper.Keeper, ctx sdk.Cont TickIndexTakerToMaker: 0, SharesOwned: math.ZeroInt(), SharesWithdrawn: math.ZeroInt(), - SharesCancelled: math.ZeroInt(), } items[i] = val keeper.SetLimitOrderTrancheUser(ctx, items[i]) @@ -93,7 +91,7 @@ func (s *DexTestSuite) TestGetAllLimitOrders() { Address: s.alice.String(), SharesOwned: math.NewInt(10_000_000), SharesWithdrawn: math.NewInt(0), - SharesCancelled: math.NewInt(0), + SharesCancelled: math.ZeroInt(), }, LOList[0], ) @@ -104,7 +102,7 @@ func (s *DexTestSuite) TestGetAllLimitOrders() { Address: s.alice.String(), SharesOwned: math.NewInt(10_000_000), SharesWithdrawn: math.NewInt(0), - SharesCancelled: math.NewInt(0), + SharesCancelled: math.ZeroInt(), }, LOList[1], ) diff --git a/x/dex/keeper/liquidity.go b/x/dex/keeper/liquidity.go index 145657505..87de37680 100644 --- a/x/dex/keeper/liquidity.go +++ b/x/dex/keeper/liquidity.go @@ -4,8 +4,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (k Keeper) Swap( @@ -37,7 +37,7 @@ func (k Keeper) Swap( } // break as soon as we iterated past limitPrice - if limitPrice != nil && liq.Price().LT(*limitPrice) { + if limitPrice != nil && liq.Price().GT(*limitPrice) { break } @@ -52,11 +52,11 @@ func (k Keeper) Swap( // this avoids unnecessary iteration since outAmount will always be 0 going forward // this also catches the normal exit case where remainingTakerDenom == 0 - // NOTE: In theory this check should be: price * remainingTakerDenom < 1 + // NOTE: In theory this check should be: remainingTakerDenom / price < 1 // but due to rounding and inaccuracy of fixed decimal math, it is possible // for liq.swap to use the full the amount of taker liquidity and have a leftover // amount of the taker Denom > than 1 token worth of maker denom - if liq.Price().MulInt(remainingTakerDenom).LT(math_utils.NewPrecDec(2)) { + if math_utils.NewPrecDecFromInt(remainingTakerDenom).Quo(liq.Price()).LT(math_utils.NewPrecDec(2)) { orderFilled = true break } @@ -110,10 +110,11 @@ func (k Keeper) SwapWithCache( func (k Keeper) SaveLiquidity(sdkCtx sdk.Context, liquidityI types.Liquidity) { switch liquidity := liquidityI.(type) { case *types.LimitOrderTranche: - k.SaveTranche(sdkCtx, liquidity) - + // If there is still makerReserves we will save the tranche as active, if not, we will move it to inactive + k.UpdateTranche(sdkCtx, liquidity) case *types.PoolLiquidity: - k.SetPool(sdkCtx, liquidity.Pool) + // Save updated to both sides of the pool. If one of the sides is empty it will be deleted + k.UpdatePool(sdkCtx, liquidity.Pool) default: panic("Invalid liquidity type") } @@ -127,6 +128,7 @@ func (k Keeper) TakerLimitOrderSwap( amountIn math.Int, maxAmountOut *math.Int, limitPrice math_utils.PrecDec, + minAvgSellPrice math_utils.PrecDec, orderType types.LimitOrderType, ) (totalInCoin, totalOutCoin sdk.Coin, err error) { totalInCoin, totalOutCoin, orderFilled, err := k.SwapWithCache( @@ -145,12 +147,12 @@ func (k Keeper) TakerLimitOrderSwap( } if totalInCoin.Amount.IsZero() { - return sdk.Coin{}, sdk.Coin{}, types.ErrLimitPriceNotSatisfied + return sdk.Coin{}, sdk.Coin{}, types.ErrNoLiquidity } truePrice := math_utils.NewPrecDecFromInt(totalOutCoin.Amount).QuoInt(totalInCoin.Amount) - if truePrice.LT(limitPrice) { + if truePrice.LT(minAvgSellPrice) { return sdk.Coin{}, sdk.Coin{}, types.ErrLimitPriceNotSatisfied } @@ -164,6 +166,7 @@ func (k Keeper) MakerLimitOrderSwap( tradePairID types.TradePairID, amountIn math.Int, limitPrice math_utils.PrecDec, + minAvgSellPrice math_utils.PrecDec, ) (totalInCoin, totalOutCoin sdk.Coin, filled bool, err error) { totalInCoin, totalOutCoin, filled, err = k.SwapWithCache( ctx, @@ -178,11 +181,11 @@ func (k Keeper) MakerLimitOrderSwap( if totalInCoin.Amount.IsPositive() { remainingIn := amountIn.Sub(totalInCoin.Amount) - expectedOutMakerPortion := limitPrice.MulInt(remainingIn).Ceil() + expectedOutMakerPortion := math_utils.NewPrecDecFromInt(remainingIn).Quo(limitPrice) totalExpectedOut := expectedOutMakerPortion.Add(math_utils.NewPrecDecFromInt(totalOutCoin.Amount)) truePrice := totalExpectedOut.QuoInt(amountIn) - if truePrice.LT(limitPrice) { + if truePrice.LT(minAvgSellPrice) { return sdk.Coin{}, sdk.Coin{}, false, types.ErrLimitPriceNotSatisfied } } diff --git a/x/dex/keeper/liquidity_iterator.go b/x/dex/keeper/liquidity_iterator.go index 107216641..b85b5aeb5 100644 --- a/x/dex/keeper/liquidity_iterator.go +++ b/x/dex/keeper/liquidity_iterator.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) type LiquidityIterator struct { diff --git a/x/dex/keeper/liquidity_test.go b/x/dex/keeper/liquidity_test.go index df4fda66a..ce08905ba 100644 --- a/x/dex/keeper/liquidity_test.go +++ b/x/dex/keeper/liquidity_test.go @@ -6,7 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // TODO: In an ideal world, there should be enough lower level testing that the swap tests @@ -483,8 +483,8 @@ func (s *DexTestSuite) TestSwap1To0LOMaxAmountNotUsed() { tokenIn, tokenOut := s.swapWithMaxOut("TokenB", "TokenA", 8, 15) // THEN swap should return 8 BIGTokenB in and ~8 BIGTokenA out - s.assertSwapOutputInt(tokenIn, sdkmath.NewInt(8_000_000), tokenOut, sdkmath.NewInt(8_000_800)) - s.assertTickBalancesInt(sdkmath.NewInt(1_999_200), sdkmath.NewInt(8_000_000)) + s.assertSwapOutputInt(tokenIn, sdkmath.NewInt(8_000_000), tokenOut, sdkmath.NewInt(8_000_799)) + s.assertTickBalancesInt(sdkmath.NewInt(1_999_201), sdkmath.NewInt(8_000_000)) } func (s *DexTestSuite) TestSwap0To1LOMaxAmountUsedMultiTick() { @@ -556,7 +556,7 @@ func (s *DexTestSuite) addDeposit(deposit *Deposit) { s.Assert().NoError(err) pool.LowerTick0.ReservesMakerDenom = pool.LowerTick0.ReservesMakerDenom.Add(deposit.AmountA) pool.UpperTick1.ReservesMakerDenom = pool.UpperTick1.ReservesMakerDenom.Add(deposit.AmountB) - s.App.DexKeeper.SetPool(s.Ctx, pool) + s.App.DexKeeper.UpdatePool(s.Ctx, pool) } func (s *DexTestSuite) addDeposits(deposits ...*Deposit) { @@ -581,7 +581,7 @@ func (s *DexTestSuite) placeGTCLimitOrder( ) s.Assert().NoError(err) tranche.PlaceMakerLimitOrder(sdkmath.NewInt(amountIn).Mul(denomMultiple)) - s.App.DexKeeper.SaveTranche(s.Ctx, tranche) + s.App.DexKeeper.UpdateTranche(s.Ctx, tranche) } func (s *DexTestSuite) swapInt( diff --git a/x/dex/keeper/migrations.go b/x/dex/keeper/migrations.go index ef9a8c2bb..86912a78a 100644 --- a/x/dex/keeper/migrations.go +++ b/x/dex/keeper/migrations.go @@ -3,8 +3,9 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v3 "github.com/neutron-org/neutron/v4/x/dex/migrations/v3" - v4 "github.com/neutron-org/neutron/v4/x/dex/migrations/v4" + v3 "github.com/neutron-org/neutron/v5/x/dex/migrations/v3" + v4 "github.com/neutron-org/neutron/v5/x/dex/migrations/v4" + v5 "github.com/neutron-org/neutron/v5/x/dex/migrations/v5" ) // Migrator is a struct for handling in-place store migrations. @@ -22,7 +23,12 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error { return v3.MigrateStore(ctx, m.keeper.cdc, m.keeper.storeKey) } -// Migrate2to3 migrates from version 3 to 4. +// Migrate3to4 migrates from version 3 to 4. func (m Migrator) Migrate3to4(ctx sdk.Context) error { return v4.MigrateStore(ctx, m.keeper.cdc, m.keeper.storeKey) } + +// Migrate4to5 migrates from version 4 to 5. +func (m Migrator) Migrate4to5(ctx sdk.Context) error { + return v5.MigrateStore(ctx, m.keeper.cdc, m.keeper.storeKey) +} diff --git a/x/dex/keeper/msg_server.go b/x/dex/keeper/msg_server.go index 1211cc57b..03c5b80e2 100644 --- a/x/dex/keeper/msg_server.go +++ b/x/dex/keeper/msg_server.go @@ -8,7 +8,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dex/types" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) type MsgServer struct { @@ -38,7 +39,7 @@ func (k MsgServer) Deposit( callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) receiverAddr := sdk.MustAccAddressFromBech32(msg.Receiver) - pairID, err := types.NewPairIDFromUnsorted(msg.TokenA, msg.TokenB) + pairID, err := types.NewPairID(msg.TokenA, msg.TokenB) if err != nil { return nil, err } @@ -48,7 +49,7 @@ func (k MsgServer) Deposit( tickIndexes := NormalizeAllTickIndexes(msg.TokenA, pairID.Token0, msg.TickIndexesAToB) - Amounts0Deposit, Amounts1Deposit, _, failedDeposits, err := k.DepositCore( + Amounts0Deposit, Amounts1Deposit, sharesIssued, failedDeposits, err := k.DepositCore( goCtx, pairID, callerAddr, @@ -67,6 +68,7 @@ func (k MsgServer) Deposit( Reserve0Deposited: Amounts0Deposit, Reserve1Deposited: Amounts1Deposit, FailedDeposits: failedDeposits, + SharesIssued: sharesIssued, }, nil } @@ -85,14 +87,14 @@ func (k MsgServer) Withdrawal( callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) receiverAddr := sdk.MustAccAddressFromBech32(msg.Receiver) - pairID, err := types.NewPairIDFromUnsorted(msg.TokenA, msg.TokenB) + pairID, err := types.NewPairID(msg.TokenA, msg.TokenB) if err != nil { return nil, err } tickIndexes := NormalizeAllTickIndexes(msg.TokenA, pairID.Token0, msg.TickIndexesAToB) - err = k.WithdrawCore( + reserve0ToRemoved, reserve1ToRemoved, sharesBurned, err := k.WithdrawCore( goCtx, pairID, callerAddr, @@ -105,7 +107,11 @@ func (k MsgServer) Withdrawal( return nil, err } - return &types.MsgWithdrawalResponse{}, nil + return &types.MsgWithdrawalResponse{ + Reserve0Withdrawn: reserve0ToRemoved, + Reserve1Withdrawn: reserve1ToRemoved, + SharesBurned: sharesBurned, + }, nil } func (k MsgServer) PlaceLimitOrder( @@ -131,12 +137,13 @@ func (k MsgServer) PlaceLimitOrder( } tickIndex := msg.TickIndexInToOut if msg.LimitSellPrice != nil { - tickIndex, err = types.CalcTickIndexFromPrice(*msg.LimitSellPrice) + limitBuyPrice := math_utils.OnePrecDec().Quo(*msg.LimitSellPrice) + tickIndex, err = types.CalcTickIndexFromPrice(limitBuyPrice) if err != nil { return &types.MsgPlaceLimitOrderResponse{}, errors.Wrapf(err, "invalid LimitSellPrice %s", msg.LimitSellPrice.String()) } } - trancheKey, coinIn, _, coinOutSwap, err := k.PlaceLimitOrderCore( + trancheKey, coinIn, swapInCoin, coinOutSwap, err := k.PlaceLimitOrderCore( goCtx, msg.TokenIn, msg.TokenOut, @@ -145,6 +152,7 @@ func (k MsgServer) PlaceLimitOrder( msg.OrderType, msg.ExpirationTime, msg.MaxAmountOut, + msg.MinAverageSellPrice, callerAddr, receiverAddr, ) @@ -156,6 +164,7 @@ func (k MsgServer) PlaceLimitOrder( TrancheKey: trancheKey, CoinIn: coinIn, TakerCoinOut: coinOutSwap, + TakerCoinIn: swapInCoin, }, nil } @@ -173,7 +182,7 @@ func (k MsgServer) WithdrawFilledLimitOrder( callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) - err := k.WithdrawFilledLimitOrderCore( + takerCoinOut, makerCoinOut, err := k.WithdrawFilledLimitOrderCore( goCtx, msg.TrancheKey, callerAddr, @@ -182,7 +191,10 @@ func (k MsgServer) WithdrawFilledLimitOrder( return &types.MsgWithdrawFilledLimitOrderResponse{}, err } - return &types.MsgWithdrawFilledLimitOrderResponse{}, nil + return &types.MsgWithdrawFilledLimitOrderResponse{ + TakerCoinOut: takerCoinOut, + MakerCoinOut: makerCoinOut, + }, nil } func (k MsgServer) CancelLimitOrder( @@ -199,7 +211,7 @@ func (k MsgServer) CancelLimitOrder( callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) - err := k.CancelLimitOrderCore( + makerCoinOut, takerCoinOut, err := k.CancelLimitOrderCore( goCtx, msg.TrancheKey, callerAddr, @@ -208,7 +220,10 @@ func (k MsgServer) CancelLimitOrder( return &types.MsgCancelLimitOrderResponse{}, err } - return &types.MsgCancelLimitOrderResponse{}, nil + return &types.MsgCancelLimitOrderResponse{ + TakerCoinOut: takerCoinOut, + MakerCoinOut: makerCoinOut, + }, nil } func (k MsgServer) MultiHopSwap( @@ -226,7 +241,7 @@ func (k MsgServer) MultiHopSwap( callerAddr := sdk.MustAccAddressFromBech32(msg.Creator) receiverAddr := sdk.MustAccAddressFromBech32(msg.Receiver) - coinOut, err := k.MultiHopSwapCore( + coinOut, route, dust, err := k.MultiHopSwapCore( goCtx, msg.AmountIn, msg.Routes, @@ -238,7 +253,11 @@ func (k MsgServer) MultiHopSwap( if err != nil { return &types.MsgMultiHopSwapResponse{}, err } - return &types.MsgMultiHopSwapResponse{CoinOut: coinOut}, nil + return &types.MsgMultiHopSwapResponse{ + CoinOut: coinOut, + Route: &types.MultiHopRoute{Hops: route}, + Dust: dust, + }, nil } func (k MsgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { diff --git a/x/dex/keeper/msg_server_test.go b/x/dex/keeper/msg_server_test.go index 5c2aa8a52..5fb64f8d6 100644 --- a/x/dex/keeper/msg_server_test.go +++ b/x/dex/keeper/msg_server_test.go @@ -13,13 +13,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/testutil/apptesting" - "github.com/neutron-org/neutron/v4/testutil/common/sample" - testkeeper "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - dexkeeper "github.com/neutron-org/neutron/v4/x/dex/keeper" - testutils "github.com/neutron-org/neutron/v4/x/dex/keeper/internal/testutils" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/apptesting" + "github.com/neutron-org/neutron/v5/testutil/common/sample" + testkeeper "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + dexkeeper "github.com/neutron-org/neutron/v5/x/dex/keeper" + testutils "github.com/neutron-org/neutron/v5/x/dex/keeper/internal/testutils" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // Test suite @@ -398,6 +398,39 @@ func (s *DexTestSuite) limitSellsWithMaxOut( return msg.TrancheKey } +func (s *DexTestSuite) aliceLimitSellsWithMinAvgPrice( + selling string, + limitPrice math_utils.PrecDec, + amountIn int, + minAvgPrice math_utils.PrecDec, + orderType types.LimitOrderType, +) (*types.MsgPlaceLimitOrderResponse, error) { + return s.limitSellsWithMinAvgPrice(s.alice, selling, limitPrice, amountIn, minAvgPrice, orderType) +} + +func (s *DexTestSuite) limitSellsWithMinAvgPrice( + account sdk.AccAddress, + tokenIn string, + limitPrice math_utils.PrecDec, + amountIn int, + minAvgPrice math_utils.PrecDec, + orderType types.LimitOrderType, +) (*types.MsgPlaceLimitOrderResponse, error) { + tokenIn, tokenOut := dexkeeper.GetInOutTokens(tokenIn, "TokenA", "TokenB") + + return s.msgServer.PlaceLimitOrder(s.Ctx, &types.MsgPlaceLimitOrder{ + Creator: account.String(), + Receiver: account.String(), + TokenIn: tokenIn, + TokenOut: tokenOut, + TickIndexInToOut: 0, + LimitSellPrice: &limitPrice, + AmountIn: sdkmath.NewInt(int64(amountIn)).Mul(denomMultiple), + OrderType: orderType, + MinAverageSellPrice: &minAvgPrice, + }) +} + func (s *DexTestSuite) limitSellsWithPrice( account sdk.AccAddress, tokenIn string, @@ -521,29 +554,30 @@ func NewDepositWithOptions( } } -func (s *DexTestSuite) aliceDeposits(deposits ...*Deposit) { - s.depositsSuccess(s.alice, deposits) +func (s *DexTestSuite) aliceDeposits(deposits ...*Deposit) *types.MsgDepositResponse { + return s.depositsSuccess(s.alice, deposits) } -func (s *DexTestSuite) bobDeposits(deposits ...*Deposit) { - s.depositsSuccess(s.bob, deposits) +func (s *DexTestSuite) bobDeposits(deposits ...*Deposit) *types.MsgDepositResponse { + return s.depositsSuccess(s.bob, deposits) } -func (s *DexTestSuite) carolDeposits(deposits ...*Deposit) { - s.depositsSuccess(s.carol, deposits) +func (s *DexTestSuite) carolDeposits(deposits ...*Deposit) *types.MsgDepositResponse { + return s.depositsSuccess(s.carol, deposits) } -func (s *DexTestSuite) danDeposits(deposits ...*Deposit) { - s.depositsSuccess(s.dan, deposits) +func (s *DexTestSuite) danDeposits(deposits ...*Deposit) *types.MsgDepositResponse { + return s.depositsSuccess(s.dan, deposits) } func (s *DexTestSuite) depositsSuccess( account sdk.AccAddress, deposits []*Deposit, pairID ...types.PairID, -) { - _, err := s.deposits(account, deposits, pairID...) +) *types.MsgDepositResponse { + resp, err := s.deposits(account, deposits, pairID...) s.Assert().Nil(err) + return resp } func (s *DexTestSuite) deposits( @@ -1472,77 +1506,6 @@ func (s *DexTestSuite) assertNLimitOrderExpiration(expected int) { s.Assert().Equal(expected, len(exps)) } -func (s *DexTestSuite) calcAutoswapSharesMinted( - centerTick int64, - fee uint64, - residual0, residual1, balanced0, balanced1, totalShares, valuePool int64, -) sdkmath.Int { - residual0Int, residual1Int, balanced0Int, balanced1Int, totalSharesInt, valuePoolInt := sdkmath.NewInt(residual0), - sdkmath.NewInt(residual1), - sdkmath.NewInt(balanced0), - sdkmath.NewInt(balanced1), - sdkmath.NewInt(totalShares), - sdkmath.NewInt(valuePool) - - // residualValue = 1.0001^-f * residualAmount0 + 1.0001^{i-f} * residualAmount1 - // balancedValue = balancedAmount0 + 1.0001^{i} * balancedAmount1 - // value = residualValue + balancedValue - // shares minted = value * totalShares / valuePool - - centerPrice := types.MustCalcPrice(-1 * centerTick) - leftPrice := types.MustCalcPrice(-1 * (centerTick - int64(fee))) - discountPrice := types.MustCalcPrice(-1 * int64(fee)) - - balancedValue := math_utils.NewPrecDecFromInt(balanced0Int). - Add(centerPrice.MulInt(balanced1Int)). - TruncateInt() - residualValue := discountPrice.MulInt(residual0Int). - Add(leftPrice.Mul(math_utils.NewPrecDecFromInt(residual1Int))). - TruncateInt() - valueMint := balancedValue.Add(residualValue) - - return valueMint.Mul(totalSharesInt).Quo(valuePoolInt) -} - -func (s *DexTestSuite) calcSharesMinted(centerTick, amount0Int, amount1Int int64) sdkmath.Int { - amount0, amount1 := sdkmath.NewInt(amount0Int), sdkmath.NewInt(amount1Int) - centerPrice := types.MustCalcPrice(-1 * centerTick) - - return math_utils.NewPrecDecFromInt(amount0).Add(centerPrice.Mul(math_utils.NewPrecDecFromInt(amount1))).TruncateInt() -} - -func (s *DexTestSuite) calcExpectedBalancesAfterWithdrawOnePool( - sharesMinted sdkmath.Int, - account sdk.AccAddress, - tickIndex int64, - fee uint64, -) (sdkmath.Int, sdkmath.Int, sdkmath.Int, sdkmath.Int) { - dexCurrentBalance0 := s.App.BankKeeper.GetBalance( - s.Ctx, - s.App.AccountKeeper.GetModuleAddress("dex"), - "TokenA", - ).Amount - dexCurrentBalance1 := s.App.BankKeeper.GetBalance( - s.Ctx, - s.App.AccountKeeper.GetModuleAddress("dex"), - "TokenB", - ).Amount - currentBalance0 := s.App.BankKeeper.GetBalance(s.Ctx, account, "TokenA").Amount - currentBalance1 := s.App.BankKeeper.GetBalance(s.Ctx, account, "TokenB").Amount - amountPool0, amountPool1 := s.getLiquidityAtTick(tickIndex, fee) - poolShares := s.getPoolShares("TokenA", "TokenB", tickIndex, fee) - - amountOut0 := amountPool0.Mul(sharesMinted).Quo(poolShares) - amountOut1 := amountPool1.Mul(sharesMinted).Quo(poolShares) - - expectedBalance0 := currentBalance0.Add(amountOut0) - expectedBalance1 := currentBalance1.Add(amountOut1) - dexExpectedBalance0 := dexCurrentBalance0.Sub(amountOut0) - dexExpectedBalance1 := dexCurrentBalance1.Sub(amountOut1) - - return expectedBalance0, expectedBalance1, dexExpectedBalance0, dexExpectedBalance1 -} - func (s *DexTestSuite) nextBlockWithTime(blockTime time.Time) { newCtx := s.Ctx.WithBlockTime(blockTime) s.Ctx = newCtx @@ -2005,6 +1968,7 @@ func TestMsgPlaceLimitOrderValidate(t *testing.T) { ZEROINT := sdkmath.ZeroInt() ONEINT := sdkmath.OneInt() + ZERODEC := math_utils.ZeroPrecDec() TINYDEC := math_utils.MustNewPrecDecFromStr("0.000000000000000000000000494") HUGEDEC := math_utils.MustNewPrecDecFromStr("2020125331305056766452345.127500016657360222036663652") FIVEDEC := math_utils.NewPrecDec(5) @@ -2176,6 +2140,19 @@ func TestMsgPlaceLimitOrderValidate(t *testing.T) { }, types.ErrInvalidPriceAndTick, }, + { + "invalid zero min average sell price", + types.MsgPlaceLimitOrder{ + Creator: sample.AccAddress(), + Receiver: sample.AccAddress(), + TokenIn: "TokenA", + TokenOut: "TokenB", + LimitSellPrice: &FIVEDEC, + AmountIn: sdkmath.OneInt(), + MinAverageSellPrice: &ZERODEC, + }, + types.ErrZeroMinAverageSellPrice, + }, } for _, tt := range tests { diff --git a/x/dex/keeper/multihop_swap.go b/x/dex/keeper/multihop_swap.go index 54bc23d34..c0f7a7485 100644 --- a/x/dex/keeper/multihop_swap.go +++ b/x/dex/keeper/multihop_swap.go @@ -1,6 +1,8 @@ package keeper import ( + "context" + "errors" "fmt" sdkerrors "cosmossdk.io/errors" @@ -8,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) type MultihopStep struct { @@ -17,6 +19,117 @@ type MultihopStep struct { tradePairID *types.TradePairID } +type MultiHopRouteOutput struct { + write func() + coinOut sdk.Coin + route []string + dust sdk.Coins +} + +// MultiHopSwapCore handles logic for MsgMultihopSwap including bank operations and event emissions. +func (k Keeper) MultiHopSwapCore( + goCtx context.Context, + amountIn math.Int, + routes []*types.MultiHopRoute, + exitLimitPrice math_utils.PrecDec, + pickBestRoute bool, + callerAddr sdk.AccAddress, + receiverAddr sdk.AccAddress, +) (coinOut sdk.Coin, route []string, dust sdk.Coins, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + bestRoute, initialInCoin, err := k.CalulateMultiHopSwap(ctx, amountIn, routes, exitLimitPrice, pickBestRoute) + if err != nil { + return sdk.Coin{}, []string{}, sdk.Coins{}, err + } + + bestRoute.write() + err = k.bankKeeper.SendCoinsFromAccountToModule( + ctx, + callerAddr, + types.ModuleName, + sdk.Coins{initialInCoin}, + ) + if err != nil { + return sdk.Coin{}, []string{}, sdk.Coins{}, err + } + + // send both dust and coinOut to receiver + // note that dust can be multiple coins collected from multiple hops. + err = k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + types.ModuleName, + receiverAddr, + bestRoute.dust.Add(bestRoute.coinOut), + ) + if err != nil { + return sdk.Coin{}, []string{}, sdk.Coins{}, fmt.Errorf("failed to send out coin and dust to the receiver: %w", err) + } + + ctx.EventManager().EmitEvent(types.CreateMultihopSwapEvent( + callerAddr, + receiverAddr, + initialInCoin.Denom, + bestRoute.coinOut.Denom, + initialInCoin.Amount, + bestRoute.coinOut.Amount, + bestRoute.route, + bestRoute.dust, + )) + + return bestRoute.coinOut, bestRoute.route, bestRoute.dust, nil +} + +// CalulateMultiHopSwap handles the core logic for MultiHopSwap -- simulating swap operations across all routes (when applicable) +// and picking the best route to execute. It uses a cache and does not modify state. +func (k Keeper) CalulateMultiHopSwap( + ctx sdk.Context, + amountIn math.Int, + routes []*types.MultiHopRoute, + exitLimitPrice math_utils.PrecDec, + pickBestRoute bool, +) (bestRoute MultiHopRouteOutput, initialInCoin sdk.Coin, err error) { + var routeErrors []error + initialInCoin = sdk.NewCoin(routes[0].Hops[0], amountIn) + stepCache := make(map[multihopCacheKey]StepResult) + + bestRoute.coinOut = sdk.Coin{Amount: math.ZeroInt()} + + for _, route := range routes { + routeDust, routeCoinOut, writeRoute, err := k.RunMultihopRoute( + ctx, + *route, + initialInCoin, + exitLimitPrice, + stepCache, + ) + if err != nil { + routeErrors = append(routeErrors, err) + continue + } + + if !pickBestRoute || bestRoute.coinOut.Amount.LT(routeCoinOut.Amount) { + bestRoute.coinOut = routeCoinOut + bestRoute.write = writeRoute + bestRoute.route = route.Hops + bestRoute.dust = routeDust + } + if !pickBestRoute { + break + } + } + + if len(routeErrors) == len(routes) { + // All routes have failed + + allErr := errors.Join(append([]error{types.ErrAllMultiHopRoutesFailed}, routeErrors...)...) + + return MultiHopRouteOutput{}, sdk.Coin{}, allErr + } + + return bestRoute, initialInCoin, nil +} + func (k Keeper) HopsToRouteData( ctx sdk.Context, hops []string, @@ -36,7 +149,7 @@ func (k Keeper) HopsToRouteData( if !found { return routeArr, types.ErrLimitPriceNotSatisfied } - priceAcc = priceAcc.Mul(price) + priceAcc = priceAcc.Quo(price) routeArr[index] = MultihopStep{ tradePairID: tradePairID, RemainingBestPrice: priceAcc, @@ -171,7 +284,7 @@ func (k Keeper) SwapFullAmountIn( return sdk.Coin{}, sdk.Coin{}, err } if !orderFilled { - return sdk.Coin{}, sdk.Coin{}, types.ErrLimitPriceNotSatisfied + return sdk.Coin{}, sdk.Coin{}, types.ErrNoLiquidity } dust = sdk.Coin.Sub(sdk.NewCoin(swapAmountTakerDenom.Denom, amountIn), swapAmountTakerDenom) diff --git a/x/dex/keeper/params.go b/x/dex/keeper/params.go index 6cd94982f..efa743898 100644 --- a/x/dex/keeper/params.go +++ b/x/dex/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // GetParams get all parameters as types.Params diff --git a/x/dex/keeper/params_test.go b/x/dex/keeper/params_test.go index 1e4b112f3..c84ae9294 100644 --- a/x/dex/keeper/params_test.go +++ b/x/dex/keeper/params_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestGetParams(t *testing.T) { diff --git a/x/dex/keeper/place_limit_order.go b/x/dex/keeper/place_limit_order.go new file mode 100644 index 000000000..79d8cdf75 --- /dev/null +++ b/x/dex/keeper/place_limit_order.go @@ -0,0 +1,217 @@ +package keeper + +import ( + "context" + "time" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +// PlaceLimitOrderCore handles the logic for MsgPlaceLimitOrder including bank operations and event emissions. +func (k Keeper) PlaceLimitOrderCore( + goCtx context.Context, + tokenIn string, + tokenOut string, + amountIn math.Int, + tickIndexInToOut int64, + orderType types.LimitOrderType, + goodTil *time.Time, + maxAmountOut *math.Int, + minAvgSellPriceP *math_utils.PrecDec, + callerAddr sdk.AccAddress, + receiverAddr sdk.AccAddress, +) (trancheKey string, totalInCoin, swapInCoin, swapOutCoin sdk.Coin, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + takerTradePairID, err := types.NewTradePairID(tokenIn, tokenOut) + if err != nil { + return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err + } + trancheKey, totalIn, swapInCoin, swapOutCoin, sharesIssued, minAvgSellPrice, err := k.ExecutePlaceLimitOrder( + ctx, + takerTradePairID, + amountIn, + tickIndexInToOut, + orderType, + goodTil, + maxAmountOut, + minAvgSellPriceP, + receiverAddr, + ) + if err != nil { + return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err + } + + if swapOutCoin.IsPositive() { + err = k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + types.ModuleName, + receiverAddr, + sdk.Coins{swapOutCoin}, + ) + if err != nil { + return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err + } + } + + if totalIn.IsPositive() { + totalInCoin = sdk.NewCoin(tokenIn, totalIn) + + err = k.bankKeeper.SendCoinsFromAccountToModule( + ctx, + callerAddr, + types.ModuleName, + sdk.Coins{totalInCoin}, + ) + if err != nil { + return trancheKey, totalInCoin, swapInCoin, swapOutCoin, err + } + } + + // This will never panic because we've already successfully constructed a TradePairID above + pairID := takerTradePairID.MustPairID() + ctx.EventManager().EmitEvent(types.CreatePlaceLimitOrderEvent( + callerAddr, + receiverAddr, + pairID.Token0, + pairID.Token1, + tokenIn, + tokenOut, + totalIn, + tickIndexInToOut, + orderType.String(), + minAvgSellPrice, + sharesIssued, + trancheKey, + swapInCoin.Amount, + swapOutCoin.Amount, + )) + + return trancheKey, totalInCoin, swapInCoin, swapOutCoin, nil +} + +// ExecutePlaceLimitOrder handles the core logic for PlaceLimitOrder -- performing taker a swap +// and (when applicable) adding a maker limit order to the orderbook. +// IT DOES NOT PERFORM ANY BANKING OPERATIONS +func (k Keeper) ExecutePlaceLimitOrder( + ctx sdk.Context, + takerTradePairID *types.TradePairID, + amountIn math.Int, + tickIndexInToOut int64, + orderType types.LimitOrderType, + goodTil *time.Time, + maxAmountOut *math.Int, + minAvgSellPriceP *math_utils.PrecDec, + receiverAddr sdk.AccAddress, +) ( + trancheKey string, + totalIn math.Int, + swapInCoin, swapOutCoin sdk.Coin, + sharesIssued math.Int, + minAvgSellPrice math_utils.PrecDec, + err error, +) { + amountLeft := amountIn + + limitBuyPrice, err := types.CalcPrice(tickIndexInToOut) + if err != nil { + return trancheKey, totalIn, swapInCoin, swapOutCoin, math.ZeroInt(), math_utils.ZeroPrecDec(), err + } + + // Use limitPrice for minAvgSellPrice if it has not been specified + minAvgSellPrice = math_utils.OnePrecDec().Quo(limitBuyPrice) + + if minAvgSellPriceP != nil { + minAvgSellPrice = *minAvgSellPriceP + } + + // Ensure that after rounding user will get at least 1 token out. + err = types.ValidateFairOutput(amountIn, limitBuyPrice) + if err != nil { + return trancheKey, totalIn, swapInCoin, swapOutCoin, math.ZeroInt(), minAvgSellPrice, err + } + + var orderFilled bool + if orderType.IsTakerOnly() { + swapInCoin, swapOutCoin, err = k.TakerLimitOrderSwap(ctx, *takerTradePairID, amountIn, maxAmountOut, limitBuyPrice, minAvgSellPrice, orderType) + } else { + swapInCoin, swapOutCoin, orderFilled, err = k.MakerLimitOrderSwap(ctx, *takerTradePairID, amountIn, limitBuyPrice, minAvgSellPrice) + } + if err != nil { + return trancheKey, totalIn, swapInCoin, swapOutCoin, math.ZeroInt(), minAvgSellPrice, err + } + + totalIn = swapInCoin.Amount + amountLeft = amountLeft.Sub(swapInCoin.Amount) + + makerTradePairID := takerTradePairID.Reversed() + tickIndexTakerToMaker := tickIndexInToOut * -1 + var placeTranche *types.LimitOrderTranche + placeTranche, err = k.GetOrInitPlaceTranche( + ctx, + makerTradePairID, + tickIndexTakerToMaker, + goodTil, + orderType, + ) + if err != nil { + return trancheKey, totalIn, swapInCoin, swapOutCoin, math.ZeroInt(), minAvgSellPrice, err + } + + trancheKey = placeTranche.Key.TrancheKey + trancheUser := k.GetOrInitLimitOrderTrancheUser( + ctx, + makerTradePairID, + tickIndexTakerToMaker, + trancheKey, + orderType, + receiverAddr.String(), + ) + + // FOR GTC, JIT & GoodTil try to place a maker limitOrder with remaining Amount + if amountLeft.IsPositive() && !orderFilled && + (orderType.IsGTC() || orderType.IsJIT() || orderType.IsGoodTil()) { + + // Ensure that the maker portion will generate at least 1 token of output + // NOTE: This does mean that a successful taker leg of the trade will be thrown away since the entire tx will fail. + // In most circumstances this seems preferable to executing the taker leg and exiting early before placing a maker + // order with the remaining liquidity. + err = types.ValidateFairOutput(amountLeft, limitBuyPrice) + if err != nil { + return trancheKey, totalIn, swapInCoin, swapOutCoin, math.ZeroInt(), minAvgSellPrice, err + } + placeTranche.PlaceMakerLimitOrder(amountLeft) + trancheUser.SharesOwned = trancheUser.SharesOwned.Add(amountLeft) + + if orderType.HasExpiration() { + goodTilRecord := NewLimitOrderExpiration(placeTranche) + k.SetLimitOrderExpiration(ctx, goodTilRecord) + ctx.GasMeter().ConsumeGas(types.ExpiringLimitOrderGas, "Expiring LimitOrder Fee") + } + + // This update will ALWAYS save the tranche as active. + // But we use the general updateTranche function so the correct events are emitted + k.UpdateTranche(ctx, placeTranche) + + totalIn = totalIn.Add(amountLeft) + sharesIssued = amountLeft + } + + // This update will ALWAYS save the trancheUser as active. + // But we use the general updateTranche function so the correct events are emitted + k.UpdateTrancheUser(ctx, trancheUser) + + if orderType.IsJIT() { + err = k.AssertCanPlaceJIT(ctx) + if err != nil { + return trancheKey, totalIn, swapInCoin, swapOutCoin, math.ZeroInt(), minAvgSellPrice, err + } + k.IncrementJITsInBlock(ctx) + } + + return trancheKey, totalIn, swapInCoin, swapOutCoin, sharesIssued, minAvgSellPrice, nil +} diff --git a/x/dex/keeper/pool.go b/x/dex/keeper/pool.go index 611dbee68..8da8a1850 100644 --- a/x/dex/keeper/pool.go +++ b/x/dex/keeper/pool.go @@ -6,8 +6,8 @@ import ( "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" - "github.com/neutron-org/neutron/v4/x/dex/utils" + "github.com/neutron-org/neutron/v5/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) func (k Keeper) GetOrInitPool( @@ -135,23 +135,11 @@ func (k Keeper) GetPoolIDByParams( return poolID, true } -func (k Keeper) SetPool(ctx sdk.Context, pool *types.Pool) { - k.updatePoolReserves(ctx, pool.LowerTick0) - k.updatePoolReserves(ctx, pool.UpperTick1) - - // TODO: this will create a bit of extra noise since not every Save is updating both ticks - // This should be solved upstream by better tracking of dirty ticks - ctx.EventManager().EmitEvent(types.CreateTickUpdatePoolReserves(*pool.LowerTick0)) - ctx.EventManager().EmitEvent(types.CreateTickUpdatePoolReserves(*pool.UpperTick1)) -} - -func (k Keeper) updatePoolReserves(ctx sdk.Context, reserves *types.PoolReserves) { - if reserves.HasToken() { - k.SetPoolReserves(ctx, reserves) - } else { - ctx.EventManager().EmitEvents(types.GetEventsDecTotalPoolReserves(*reserves.Key.TradePairId.MustPairID())) - k.RemovePoolReserves(ctx, reserves.Key) - } +// UpdatePool handles the logic for all updates to Pools in the KV Store. +// It provides a convenient way to save both sides of the pool reserves. +func (k Keeper) UpdatePool(ctx sdk.Context, pool *types.Pool) { + k.UpdatePoolReserves(ctx, pool.LowerTick0) + k.UpdatePoolReserves(ctx, pool.UpperTick1) } // GetPoolCount get the total number of pools @@ -177,3 +165,22 @@ func (k Keeper) SetPoolCount(ctx sdk.Context, count uint64) { binary.BigEndian.PutUint64(bz, count) store.Set(byteKey, bz) } + +func (k Keeper) GetAllPoolShareholders(ctx sdk.Context) map[uint64][]types.PoolShareholder { + result := make(map[uint64][]types.PoolShareholder) + balances := k.bankKeeper.GetAccountsBalances(ctx) + for _, balance := range balances { + for _, coin := range balance.Coins { + // Check if the Denom is a PoolShare denom + poolID, err := types.ParsePoolIDFromDenom(coin.Denom) + if err != nil { + // This is not a PoolShare denom + continue + } + shareholderInfo := types.PoolShareholder{Address: balance.Address, Shares: coin.Amount} + result[poolID] = append(result[poolID], shareholderInfo) + + } + } + return result +} diff --git a/x/dex/keeper/pool_metadata.go b/x/dex/keeper/pool_metadata.go index 43dbc8f06..ed9a9f497 100644 --- a/x/dex/keeper/pool_metadata.go +++ b/x/dex/keeper/pool_metadata.go @@ -7,7 +7,7 @@ import ( storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // SetPoolMetadata set a specific poolMetadata in the store diff --git a/x/dex/keeper/pool_metadata_test.go b/x/dex/keeper/pool_metadata_test.go index 7b0c52931..1e9081ee8 100644 --- a/x/dex/keeper/pool_metadata_test.go +++ b/x/dex/keeper/pool_metadata_test.go @@ -6,10 +6,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func createNPoolMetadata(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.PoolMetadata { diff --git a/x/dex/keeper/pool_reserves.go b/x/dex/keeper/pool_reserves.go index 1c3a10f61..df870e21d 100644 --- a/x/dex/keeper/pool_reserves.go +++ b/x/dex/keeper/pool_reserves.go @@ -4,7 +4,7 @@ import ( "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func (k Keeper) SetPoolReserves(ctx sdk.Context, poolReserves *types.PoolReserves) { @@ -35,8 +35,27 @@ func (k Keeper) GetPoolReserves( return tick.GetPoolReserves(), true } -// RemoveTickLiquidity removes a tickLiquidity from the store +// RemovePoolReserves removes a tickLiquidity from the store func (k Keeper) RemovePoolReserves(ctx sdk.Context, poolReservesID *types.PoolReservesKey) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TickLiquidityKeyPrefix)) store.Delete(poolReservesID.KeyMarshal()) } + +// UpdatePoolReserves handles the logic for all updates to PoolReserves in the KV Store. +// NOTE: This method should always be called even if not all logic branches are applicable. +// It avoids unnecessary repetition of logic and provides a single place to attach update event handlers. +func (k Keeper) UpdatePoolReserves(ctx sdk.Context, reserves *types.PoolReserves) { + if reserves.HasToken() { + // The pool still has ReservesMakerDenom; save it as is + k.SetPoolReserves(ctx, reserves) + } else { + ctx.EventManager().EmitEvents(types.GetEventsDecTotalPoolReserves(*reserves.Key.TradePairId.MustPairID())) + // The pool is empty (ie. ReservesMakerDenom == 0); it can be safely deleted + k.RemovePoolReserves(ctx, reserves.Key) + } + + // TODO: This will create a bit of extra noise since UpdatePoolReserves is called for both sides of the pool, + // but not in some cases only one side has been updated + // This should be solved upstream by better tracking of dirty ticks + ctx.EventManager().EmitEvent(types.CreateTickUpdatePoolReserves(*reserves)) +} diff --git a/x/dex/keeper/pool_reserves_test.go b/x/dex/keeper/pool_reserves_test.go index 6ddb2cac8..0e0d4f18e 100644 --- a/x/dex/keeper/pool_reserves_test.go +++ b/x/dex/keeper/pool_reserves_test.go @@ -6,10 +6,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func createNPoolReserves(k *keeper.Keeper, ctx sdk.Context, n int) []*types.PoolReserves { diff --git a/x/dex/keeper/pool_test.go b/x/dex/keeper/pool_test.go index f2b2d55ea..73ca44619 100644 --- a/x/dex/keeper/pool_test.go +++ b/x/dex/keeper/pool_test.go @@ -7,9 +7,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func createNPools(k *keeper.Keeper, ctx sdk.Context, n int) []*types.Pool { @@ -20,7 +20,7 @@ func createNPools(k *keeper.Keeper, ctx sdk.Context, n int) []*types.Pool { panic("failed to create pool") } pool.Deposit(math.NewInt(10), math.NewInt(0), math.ZeroInt(), true) - k.SetPool(ctx, pool) + k.UpdatePool(ctx, pool) items[i] = pool } @@ -33,7 +33,7 @@ func TestPoolInit(t *testing.T) { pool, err := keeper.InitPool(ctx, defaultPairID, 0, 1) require.NoError(t, err) pool.Deposit(math.NewInt(1000), math.NewInt(1000), math.NewInt(0), true) - keeper.SetPool(ctx, pool) + keeper.UpdatePool(ctx, pool) dbPool, found := keeper.GetPool(ctx, defaultPairID, 0, 1) @@ -74,7 +74,7 @@ func TestGetPoolIDByParams(t *testing.T) { id0, found := keeper.GetPoolIDByParams( ctx, items[0].LowerTick0.Key.TradePairId.MustPairID(), - items[0].CenterTickIndex(), + items[0].CenterTickIndexToken1(), items[0].Fee(), ) require.True(t, found) @@ -83,7 +83,7 @@ func TestGetPoolIDByParams(t *testing.T) { id1, found := keeper.GetPoolIDByParams( ctx, items[1].LowerTick0.Key.TradePairId.MustPairID(), - items[1].CenterTickIndex(), + items[1].CenterTickIndexToken1(), items[1].Fee(), ) require.True(t, found) diff --git a/x/dex/keeper/tick_iterator.go b/x/dex/keeper/tick_iterator.go index 583f77a79..f5933a70d 100644 --- a/x/dex/keeper/tick_iterator.go +++ b/x/dex/keeper/tick_iterator.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) type TickIterator struct { diff --git a/x/dex/keeper/tick_liquidity.go b/x/dex/keeper/tick_liquidity.go index 9c0989702..94030ac6f 100644 --- a/x/dex/keeper/tick_liquidity.go +++ b/x/dex/keeper/tick_liquidity.go @@ -5,7 +5,7 @@ import ( storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // GetAllTickLiquidity returns all tickLiquidity diff --git a/x/dex/keeper/tick_liquidity_test.go b/x/dex/keeper/tick_liquidity_test.go index 34e89f800..5472246df 100644 --- a/x/dex/keeper/tick_liquidity_test.go +++ b/x/dex/keeper/tick_liquidity_test.go @@ -8,9 +8,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - keepertest "github.com/neutron-org/neutron/v4/testutil/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + keepertest "github.com/neutron-org/neutron/v5/testutil/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func CreateNTickLiquidity(keeper *keeper.Keeper, ctx sdk.Context, n int) []*types.TickLiquidity { diff --git a/x/dex/keeper/withdraw.go b/x/dex/keeper/withdraw.go new file mode 100644 index 000000000..75104a4eb --- /dev/null +++ b/x/dex/keeper/withdraw.go @@ -0,0 +1,143 @@ +package keeper + +import ( + "context" + + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +// WithdrawCore handles logic for MsgWithdrawal including bank operations and event emissions. +func (k Keeper) WithdrawCore( + goCtx context.Context, + pairID *types.PairID, + callerAddr sdk.AccAddress, + receiverAddr sdk.AccAddress, + sharesToRemoveList []math.Int, + tickIndicesNormalized []int64, + fees []uint64, +) (reserves0ToRemoved, reserves1ToRemoved math.Int, sharesBurned sdk.Coins, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + totalReserve0ToRemove, totalReserve1ToRemove, coinsToBurn, events, err := k.ExecuteWithdraw( + ctx, + pairID, + callerAddr, + receiverAddr, + sharesToRemoveList, + tickIndicesNormalized, + fees, + ) + if err != nil { + return math.ZeroInt(), math.ZeroInt(), nil, err + } + + ctx.EventManager().EmitEvents(events) + + if err := k.BurnShares(ctx, callerAddr, coinsToBurn); err != nil { + return math.ZeroInt(), math.ZeroInt(), nil, err + } + + if totalReserve0ToRemove.IsPositive() { + coin0 := sdk.NewCoin(pairID.Token0, totalReserve0ToRemove) + + err := k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + types.ModuleName, + receiverAddr, + sdk.Coins{coin0}, + ) + ctx.EventManager().EmitEvents(types.GetEventsWithdrawnAmount(sdk.Coins{coin0})) + if err != nil { + return math.ZeroInt(), math.ZeroInt(), nil, err + } + } + + if totalReserve1ToRemove.IsPositive() { + coin1 := sdk.NewCoin(pairID.Token1, totalReserve1ToRemove) + err := k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + types.ModuleName, + receiverAddr, + sdk.Coins{coin1}, + ) + ctx.EventManager().EmitEvents(types.GetEventsWithdrawnAmount(sdk.Coins{coin1})) + if err != nil { + return math.ZeroInt(), math.ZeroInt(), nil, err + } + } + + return totalReserve0ToRemove, totalReserve1ToRemove, coinsToBurn, nil +} + +// ExecuteWithdraw handles the core Withdraw logic including calculating and withdrawing reserve0,reserve1 from a specified tick +// given a specified number of shares to remove. +// Calculates the amount of reserve0, reserve1 to withdraw based on the percentage of the desired +// number of shares to remove compared to the total number of shares at the given tick. +// IT DOES NOT PERFORM ANY BANKING OPERATIONS. +func (k Keeper) ExecuteWithdraw( + ctx sdk.Context, + pairID *types.PairID, + callerAddr sdk.AccAddress, + receiverAddr sdk.AccAddress, + sharesToRemoveList []math.Int, + tickIndicesNormalized []int64, + fees []uint64, +) (totalReserves0ToRemove, totalReserves1ToRemove math.Int, coinsToBurn sdk.Coins, events sdk.Events, err error) { + totalReserve0ToRemove := math.ZeroInt() + totalReserve1ToRemove := math.ZeroInt() + + for i, fee := range fees { + sharesToRemove := sharesToRemoveList[i] + tickIndex := tickIndicesNormalized[i] + + pool, err := k.GetOrInitPool(ctx, pairID, tickIndex, fee) + if err != nil { + return math.ZeroInt(), math.ZeroInt(), nil, nil, err + } + + poolDenom := pool.GetPoolDenom() + + // TODO: this is a bit hacky. Since it is possible to have multiple withdrawals from the same pool we have to artificially update the bank balance + // In the future we should enforce only one withdraw operation per pool in the message validation + alreadyWithdrawnOfDenom := coinsToBurn.AmountOf(poolDenom) + sharesOwned := k.bankKeeper.GetBalance(ctx, callerAddr, poolDenom).Amount.Sub(alreadyWithdrawnOfDenom) + if sharesOwned.LT(sharesToRemove) { + return math.ZeroInt(), math.ZeroInt(), nil, nil, sdkerrors.Wrapf( + types.ErrInsufficientShares, + "%s does not have %s shares of type %s", + callerAddr, + sharesToRemove, + poolDenom, + ) + } + + totalShares := k.bankKeeper.GetSupply(ctx, poolDenom).Amount.Sub(alreadyWithdrawnOfDenom) + outAmount0, outAmount1 := pool.Withdraw(sharesToRemove, totalShares) + + // Save both sides of the pool. If one or both sides are empty they will be deleted. + k.UpdatePool(ctx, pool) + + totalReserve0ToRemove = totalReserve0ToRemove.Add(outAmount0) + totalReserve1ToRemove = totalReserve1ToRemove.Add(outAmount1) + + coinsToBurn = coinsToBurn.Add(sdk.NewCoin(poolDenom, sharesToRemove)) + + withdrawEvent := types.CreateWithdrawEvent( + callerAddr, + receiverAddr, + pairID.Token0, + pairID.Token1, + tickIndex, + fee, + outAmount0, + outAmount1, + sharesToRemove, + ) + events = append(events, withdrawEvent) + } + return totalReserve0ToRemove, totalReserve1ToRemove, coinsToBurn, events, nil +} diff --git a/x/dex/keeper/withdraw_filled_limit_order.go b/x/dex/keeper/withdraw_filled_limit_order.go new file mode 100644 index 000000000..17d720e69 --- /dev/null +++ b/x/dex/keeper/withdraw_filled_limit_order.go @@ -0,0 +1,113 @@ +package keeper + +import ( + "context" + + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +// WithdrawFilledLimitOrderCore handles MsgWithdrawFilledLimitOrder including bank operations and event emissions. +func (k Keeper) WithdrawFilledLimitOrderCore( + goCtx context.Context, + trancheKey string, + callerAddr sdk.AccAddress, +) (takerCoinOut, makerCoinOut sdk.Coin, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + takerCoinOut, makerCoinOut, err = k.ExecuteWithdrawFilledLimitOrder(ctx, trancheKey, callerAddr) + if err != nil { + return sdk.Coin{}, sdk.Coin{}, err + } + + // NOTE: it is possible for coinTakerDenomOut xor coinMakerDenomOut to be zero. These are removed by the sanitize call in sdk.NewCoins + // ExecuteWithdrawFilledLimitOrder ensures that at least one of these has am amount > 0. + coins := sdk.NewCoins(takerCoinOut, makerCoinOut) + ctx.EventManager().EmitEvents(types.GetEventsWithdrawnAmount(sdk.NewCoins(takerCoinOut))) + if err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, callerAddr, coins); err != nil { + return sdk.Coin{}, sdk.Coin{}, err + } + + makerDenom := makerCoinOut.Denom + takerDenom := takerCoinOut.Denom + // This will never panic since TradePairID has already been successfully constructed by ExecuteWithdrawFilledLimitOrder + pairID := types.MustNewPairID(makerDenom, takerDenom) + ctx.EventManager().EmitEvent(types.WithdrawFilledLimitOrderEvent( + callerAddr, + pairID.Token0, + pairID.Token1, + makerDenom, + takerDenom, + takerCoinOut.Amount, + makerCoinOut.Amount, + trancheKey, + )) + + return takerCoinOut, makerCoinOut, nil +} + +// ExecuteWithdrawFilledLimitOrder handles the for logic for WithdrawFilledLimitOrder -- calculates and sends filled liquidity from module to user, +// returns any remaining TokenIn from inactive limit orders, and updates the LimitOrderTranche and LimitOrderTrancheUser. +// IT DOES NOT PERFORM ANY BANKING OPERATIONS +func (k Keeper) ExecuteWithdrawFilledLimitOrder( + ctx sdk.Context, + trancheKey string, + callerAddr sdk.AccAddress, +) (takerCoinOut, makerCoinOut sdk.Coin, err error) { + trancheUser, found := k.GetLimitOrderTrancheUser( + ctx, + callerAddr.String(), + trancheKey, + ) + if !found { + return makerCoinOut, takerCoinOut, sdkerrors.Wrapf(types.ErrValidLimitOrderTrancheNotFound, "%s", trancheKey) + } + + tradePairID, tickIndex := trancheUser.TradePairId, trancheUser.TickIndexTakerToMaker + + tranche, wasFilled, found := k.FindLimitOrderTranche( + ctx, + &types.LimitOrderTrancheKey{ + TradePairId: tradePairID, + TickIndexTakerToMaker: tickIndex, + TrancheKey: trancheKey, + }, + ) + + amountOutTokenOut := math.ZeroInt() + remainingTokenIn := math.ZeroInt() + // It's possible that a TrancheUser exists but tranche does not if LO was filled entirely through a swap + if found { + var amountOutTokenIn math.Int + amountOutTokenIn, amountOutTokenOut = tranche.Withdraw(trancheUser) + + if wasFilled { + // This is only relevant for inactive JIT and GoodTil limit orders + remainingTokenIn = tranche.RemoveTokenIn(trancheUser) + k.UpdateInactiveTranche(ctx, tranche) + + // Since the order has already been filled we treat this as a complete withdrawal + trancheUser.SharesWithdrawn = trancheUser.SharesOwned + + } else { + // This was an active tranche (still has MakerReserves) and we have only removed TakerReserves; we will save it as an active tranche + k.UpdateTranche(ctx, tranche) + trancheUser.SharesWithdrawn = trancheUser.SharesWithdrawn.Add(amountOutTokenIn) + } + + } + // Save the tranche user + k.UpdateTrancheUser(ctx, trancheUser) + + if !amountOutTokenOut.IsPositive() && !remainingTokenIn.IsPositive() { + return takerCoinOut, makerCoinOut, types.ErrWithdrawEmptyLimitOrder + } + + takerCoinOut = sdk.NewCoin(tradePairID.TakerDenom, amountOutTokenOut) + makerCoinOut = sdk.NewCoin(tradePairID.MakerDenom, remainingTokenIn) + + return takerCoinOut, makerCoinOut, nil +} diff --git a/x/dex/migrations/v3/store.go b/x/dex/migrations/v3/store.go index bb26392f1..786c89753 100644 --- a/x/dex/migrations/v3/store.go +++ b/x/dex/migrations/v3/store.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" - v2types "github.com/neutron-org/neutron/v4/x/dex/types/v2" + "github.com/neutron-org/neutron/v5/x/dex/types" + v2types "github.com/neutron-org/neutron/v5/x/dex/types/v2" ) // MigrateStore performs in-place store migrations. diff --git a/x/dex/migrations/v3/store_test.go b/x/dex/migrations/v3/store_test.go index 7dc44dc37..f884a6b54 100644 --- a/x/dex/migrations/v3/store_test.go +++ b/x/dex/migrations/v3/store_test.go @@ -8,12 +8,12 @@ import ( "cosmossdk.io/store/prefix" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/utils/math" - v3 "github.com/neutron-org/neutron/v4/x/dex/migrations/v3" - "github.com/neutron-org/neutron/v4/x/dex/types" - v2types "github.com/neutron-org/neutron/v4/x/dex/types/v2" - "github.com/neutron-org/neutron/v4/x/dex/utils" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/utils/math" + v3 "github.com/neutron-org/neutron/v5/x/dex/migrations/v3" + "github.com/neutron-org/neutron/v5/x/dex/types" + v2types "github.com/neutron-org/neutron/v5/x/dex/types/v2" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) type V3DexMigrationTestSuite struct { diff --git a/x/dex/migrations/v4/store.go b/x/dex/migrations/v4/store.go index 61dd9a922..470439e7a 100644 --- a/x/dex/migrations/v4/store.go +++ b/x/dex/migrations/v4/store.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // MigrateStore performs in-place store migrations. @@ -45,12 +45,11 @@ func migrateTickLiquidityPrices(ctx sdk.Context, cdc codec.BinaryCodec, storeKey // Recalculate all prices switch liquidity := tickLiq.Liquidity.(type) { case *types.TickLiquidity_LimitOrderTranche: - liquidity.LimitOrderTranche.PriceTakerToMaker = types.MustCalcPrice(liquidity.LimitOrderTranche.Key.TickIndexTakerToMaker) + liquidity.LimitOrderTranche.PriceTakerToMaker = types.MustCalcPrice(-liquidity.LimitOrderTranche.Key.TickIndexTakerToMaker) updatedTickLiq = types.TickLiquidity{Liquidity: liquidity} case *types.TickLiquidity_PoolReserves: poolReservesKey := liquidity.PoolReserves.Key - liquidity.PoolReserves.PriceTakerToMaker = types.MustCalcPrice(poolReservesKey.TickIndexTakerToMaker) - liquidity.PoolReserves.PriceOppositeTakerToMaker = poolReservesKey.Counterpart().MustPriceTakerToMaker() + liquidity.PoolReserves.PriceTakerToMaker = types.MustCalcPrice(-poolReservesKey.TickIndexTakerToMaker) updatedTickLiq = types.TickLiquidity{Liquidity: liquidity} default: @@ -90,7 +89,7 @@ func migrateInactiveTranchePrices(ctx sdk.Context, cdc codec.BinaryCodec, storeK var tranche types.LimitOrderTranche cdc.MustUnmarshal(iterator.Value(), &tranche) // Recalculate price - tranche.PriceTakerToMaker = types.MustCalcPrice(tranche.Key.TickIndexTakerToMaker) + tranche.PriceTakerToMaker = types.MustCalcPrice(-tranche.Key.TickIndexTakerToMaker) bz := cdc.MustMarshal(&tranche) ticksToUpdate = append(ticksToUpdate, migrationUpdate{key: iterator.Key(), val: bz}) diff --git a/x/dex/migrations/v4/store_test.go b/x/dex/migrations/v4/store_test.go index 10aa1bded..80840c91b 100644 --- a/x/dex/migrations/v4/store_test.go +++ b/x/dex/migrations/v4/store_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/utils/math" - v4 "github.com/neutron-org/neutron/v4/x/dex/migrations/v4" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/utils/math" + v4 "github.com/neutron-org/neutron/v5/x/dex/migrations/v4" + "github.com/neutron-org/neutron/v5/x/dex/types" ) type V4DexMigrationTestSuite struct { @@ -49,9 +49,8 @@ func (suite *V4DexMigrationTestSuite) TestPriceUpdates() { Fee: 1, } poolReserves := &types.PoolReserves{ - Key: poolKey, - PriceTakerToMaker: math.ZeroPrecDec(), - PriceOppositeTakerToMaker: math.ZeroPrecDec(), + Key: poolKey, + PriceTakerToMaker: math.ZeroPrecDec(), } app.DexKeeper.SetPoolReserves(ctx, poolReserves) @@ -60,6 +59,7 @@ func (suite *V4DexMigrationTestSuite) TestPriceUpdates() { // Check LimitOrderTranche has correct price newTranche := app.DexKeeper.GetLimitOrderTranche(ctx, trancheKey) + suite.True(newTranche.PriceTakerToMaker.Equal(math.MustNewPrecDecFromStr("1.005012269623051203500693815"))) // check InactiveLimitOrderTranche has correct price @@ -68,6 +68,5 @@ func (suite *V4DexMigrationTestSuite) TestPriceUpdates() { // Check PoolReserves has the correct prices newPool, _ := app.DexKeeper.GetPoolReserves(ctx, poolKey) - suite.True(newPool.PriceTakerToMaker.Equal(math.MustNewPrecDecFromStr("0.002479495864288162666675923"))) - suite.True(newPool.PriceOppositeTakerToMaker.Equal(math.MustNewPrecDecFromStr("403.227141612124702272520931931"))) + suite.True(newPool.PriceTakerToMaker.Equal(math.MustNewPrecDecFromStr("0.002479495864288162666675934"))) } diff --git a/x/dex/migrations/v5/store.go b/x/dex/migrations/v5/store.go new file mode 100644 index 000000000..575f2b61e --- /dev/null +++ b/x/dex/migrations/v5/store.go @@ -0,0 +1,109 @@ +package v5 + +import ( + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +// MigrateStore performs in-place store migrations. +// v5 adds a new field `MakerPrice` to all tickLiquidity. It must be calculated and added +func MigrateStore(ctx sdk.Context, cdc codec.BinaryCodec, storeKey storetypes.StoreKey) error { + if err := migrateTickLiquidityPrices(ctx, cdc, storeKey); err != nil { + return err + } + + if err := migrateInactiveTranchePrices(ctx, cdc, storeKey); err != nil { + return err + } + + return nil +} + +type migrationUpdate struct { + key []byte + val []byte +} + +func migrateTickLiquidityPrices(ctx sdk.Context, cdc codec.BinaryCodec, storeKey storetypes.StoreKey) error { + ctx.Logger().Info("Migrating TickLiquidity Prices...") + + // Iterate through all tickLiquidity + store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.TickLiquidityKeyPrefix)) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + ticksToUpdate := make([]migrationUpdate, 0) + + for ; iterator.Valid(); iterator.Next() { + var tickLiq types.TickLiquidity + var updatedTickLiq types.TickLiquidity + cdc.MustUnmarshal(iterator.Value(), &tickLiq) + // Add MakerPrice + switch liquidity := tickLiq.Liquidity.(type) { + case *types.TickLiquidity_LimitOrderTranche: + liquidity.LimitOrderTranche.MakerPrice = types.MustCalcPrice(liquidity.LimitOrderTranche.Key.TickIndexTakerToMaker) + updatedTickLiq = types.TickLiquidity{Liquidity: liquidity} + case *types.TickLiquidity_PoolReserves: + poolReservesKey := liquidity.PoolReserves.Key + liquidity.PoolReserves.MakerPrice = types.MustCalcPrice(poolReservesKey.TickIndexTakerToMaker) + updatedTickLiq = types.TickLiquidity{Liquidity: liquidity} + + default: + panic("Tick does not contain valid liqudityType") + } + + bz := cdc.MustMarshal(&updatedTickLiq) + ticksToUpdate = append(ticksToUpdate, migrationUpdate{key: iterator.Key(), val: bz}) + + } + + err := iterator.Close() + if err != nil { + return errorsmod.Wrap(err, "iterator failed to close during migration") + } + + // Store the updated TickLiquidity + for _, v := range ticksToUpdate { + store.Set(v.key, v.val) + } + + ctx.Logger().Info("Finished migrating TickLiquidity Prices...") + + return nil +} + +func migrateInactiveTranchePrices(ctx sdk.Context, cdc codec.BinaryCodec, storeKey storetypes.StoreKey) error { + ctx.Logger().Info("Migrating InactiveLimitOrderTranche Prices...") + + // Iterate through all InactiveTranches + store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.InactiveLimitOrderTrancheKeyPrefix)) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + ticksToUpdate := make([]migrationUpdate, 0) + + for ; iterator.Valid(); iterator.Next() { + var tranche types.LimitOrderTranche + cdc.MustUnmarshal(iterator.Value(), &tranche) + // Add MakerPrice + tranche.MakerPrice = types.MustCalcPrice(tranche.Key.TickIndexTakerToMaker) + + bz := cdc.MustMarshal(&tranche) + ticksToUpdate = append(ticksToUpdate, migrationUpdate{key: iterator.Key(), val: bz}) + } + + err := iterator.Close() + if err != nil { + return errorsmod.Wrap(err, "iterator failed to close during migration") + } + + // Store the updated InactiveTranches + for _, v := range ticksToUpdate { + store.Set(v.key, v.val) + } + + ctx.Logger().Info("Finished migrating InactiveLimitOrderTranche Prices...") + + return nil +} diff --git a/x/dex/migrations/v5/store_test.go b/x/dex/migrations/v5/store_test.go new file mode 100644 index 000000000..6923ca7d9 --- /dev/null +++ b/x/dex/migrations/v5/store_test.go @@ -0,0 +1,70 @@ +package v5_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/utils/math" + v5 "github.com/neutron-org/neutron/v5/x/dex/migrations/v5" + "github.com/neutron-org/neutron/v5/x/dex/types" +) + +type V4DexMigrationTestSuite struct { + testutil.IBCConnectionTestSuite +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(V4DexMigrationTestSuite)) +} + +func (suite *V4DexMigrationTestSuite) TestPriceUpdates() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + storeKey = app.GetKey(types.StoreKey) + ctx = suite.ChainA.GetContext() + cdc = app.AppCodec() + ) + + // Write tranches + trancheKey := &types.LimitOrderTrancheKey{ + TradePairId: types.MustNewTradePairID("TokenA", "TokenB"), + TickIndexTakerToMaker: -1150, + TrancheKey: "123", + } + tranche := &types.LimitOrderTranche{ + Key: trancheKey, + PriceTakerToMaker: math.ZeroPrecDec(), + } + app.DexKeeper.SetLimitOrderTranche(ctx, tranche) + + // also create inactive tranche + app.DexKeeper.SetInactiveLimitOrderTranche(ctx, tranche) + + // Write poolReserves + poolKey := &types.PoolReservesKey{ + TradePairId: types.MustNewTradePairID("TokenA", "TokenB"), + TickIndexTakerToMaker: 256000, + Fee: 1, + } + poolReserves := &types.PoolReserves{ + Key: poolKey, + } + app.DexKeeper.SetPoolReserves(ctx, poolReserves) + + // Run migration + suite.NoError(v5.MigrateStore(ctx, cdc, storeKey)) + + // Check LimitOrderTranche has correct price + newTranche := app.DexKeeper.GetLimitOrderTranche(ctx, trancheKey) + suite.True(newTranche.MakerPrice.Equal(math.MustNewPrecDecFromStr("0.891371268935227562508365227"))) + + // check InactiveLimitOrderTranche has correct price + inactiveTranche, _ := app.DexKeeper.GetInactiveLimitOrderTranche(ctx, trancheKey) + suite.True(inactiveTranche.MakerPrice.Equal(math.MustNewPrecDecFromStr("0.891371268935227562508365227"))) + + // Check PoolReserves has the correct prices + newPool, _ := app.DexKeeper.GetPoolReserves(ctx, poolKey) + suite.True(newPool.MakerPrice.Equal(math.MustNewPrecDecFromStr("131033661522.558812694915985539856164620"))) +} diff --git a/x/dex/module.go b/x/dex/module.go index f2fa6cb52..6caf10a58 100644 --- a/x/dex/module.go +++ b/x/dex/module.go @@ -19,9 +19,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/neutron-org/neutron/v4/x/dex/client/cli" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/client/cli" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) var ( @@ -162,6 +162,9 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err := cfg.RegisterMigration(types.ModuleName, 3, m.Migrate3to4); err != nil { panic(fmt.Sprintf("failed to migrate x/dex from version 3 to 4: %v", err)) } + if err := cfg.RegisterMigration(types.ModuleName, 4, m.Migrate4to5); err != nil { + panic(fmt.Sprintf("failed to migrate x/dex from version 4 to 5: %v", err)) + } } // RegisterInvariants registers the capability module's invariants. diff --git a/x/dex/module_simulation.go b/x/dex/module_simulation.go index b6fc4c12f..f62d9a19b 100644 --- a/x/dex/module_simulation.go +++ b/x/dex/module_simulation.go @@ -8,9 +8,9 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/neutron-org/neutron/v4/testutil/common/sample" - dexsimulation "github.com/neutron-org/neutron/v4/x/dex/simulation" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/testutil/common/sample" + dexsimulation "github.com/neutron-org/neutron/v5/x/dex/simulation" + "github.com/neutron-org/neutron/v5/x/dex/types" ) // avoid unused import issue diff --git a/x/dex/simulation/cancel_limit_order.go b/x/dex/simulation/cancel_limit_order.go index 1326ddca8..b7c2422c1 100644 --- a/x/dex/simulation/cancel_limit_order.go +++ b/x/dex/simulation/cancel_limit_order.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func SimulateMsgCancelLimitOrder( diff --git a/x/dex/simulation/deposit.go b/x/dex/simulation/deposit.go index e122cb262..ffc55b9b7 100644 --- a/x/dex/simulation/deposit.go +++ b/x/dex/simulation/deposit.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func SimulateMsgDeposit( diff --git a/x/dex/simulation/multi_hop_swap.go b/x/dex/simulation/multi_hop_swap.go index eec7070cb..55cb251d0 100644 --- a/x/dex/simulation/multi_hop_swap.go +++ b/x/dex/simulation/multi_hop_swap.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func SimulateMsgMultiHopSwap( diff --git a/x/dex/simulation/place_limit_order.go b/x/dex/simulation/place_limit_order.go index 1b1c15ee3..de5b3cbf8 100644 --- a/x/dex/simulation/place_limit_order.go +++ b/x/dex/simulation/place_limit_order.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func SimulateMsgPlaceLimitOrder( diff --git a/x/dex/simulation/withdrawl.go b/x/dex/simulation/withdrawl.go index ba5cce907..f45ea2986 100644 --- a/x/dex/simulation/withdrawl.go +++ b/x/dex/simulation/withdrawl.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func SimulateMsgWithdrawal( diff --git a/x/dex/simulation/withdrawl_filled_limit_order.go b/x/dex/simulation/withdrawl_filled_limit_order.go index ede547d4e..72c6f6b58 100644 --- a/x/dex/simulation/withdrawl_filled_limit_order.go +++ b/x/dex/simulation/withdrawl_filled_limit_order.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/neutron-org/neutron/v4/x/dex/keeper" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/keeper" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func SimulateMsgWithdrawFilledLimitOrder( diff --git a/x/dex/types/constants.go b/x/dex/types/constants.go index 119d6c47e..a5bb2eb73 100644 --- a/x/dex/types/constants.go +++ b/x/dex/types/constants.go @@ -1,3 +1,3 @@ package types -const ConsensusVersion = 4 +const ConsensusVersion = 5 diff --git a/x/dex/types/deposit_record.pb.go b/x/dex/types/deposit_record.pb.go index 8d3ca7286..03345af53 100644 --- a/x/dex/types/deposit_record.pb.go +++ b/x/dex/types/deposit_record.pb.go @@ -120,30 +120,30 @@ var fileDescriptor_250413eadaebbf28 = []byte{ // 410 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x3f, 0x8f, 0x94, 0x40, 0x18, 0xc6, 0x19, 0xc1, 0x3d, 0x1d, 0xfc, 0x73, 0xc7, 0xa9, 0xc1, 0x2d, 0x80, 0x50, 0x11, 0xf5, - 0x20, 0x51, 0x2b, 0xcb, 0xcd, 0x26, 0x86, 0x4a, 0x83, 0x56, 0x36, 0x84, 0x63, 0x46, 0x76, 0xb2, - 0xc0, 0x4b, 0x86, 0x59, 0x8f, 0xfb, 0x16, 0x7e, 0xac, 0xab, 0xcc, 0x95, 0xc6, 0x82, 0x98, 0xdd, - 0xce, 0xd2, 0x4f, 0x60, 0x66, 0x40, 0x0f, 0x1a, 0xbb, 0xf7, 0x7d, 0xe6, 0xf7, 0xce, 0x33, 0x4f, - 0xde, 0xc1, 0x5e, 0x4d, 0x77, 0x82, 0x43, 0x1d, 0x11, 0xda, 0x45, 0x84, 0x36, 0xd0, 0x32, 0x91, - 0x72, 0x9a, 0x03, 0x27, 0x61, 0xc3, 0x41, 0x80, 0x65, 0x8e, 0x44, 0x48, 0x68, 0xb7, 0x7c, 0x54, - 0x40, 0x01, 0x4a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 0xfa, 0x67, 0x4a, + 0xed, 0x85, 0x87, 0x02, 0x23, 0x91, 0xa5, 0x8c, 0x2e, 0x40, 0x64, 0x65, 0x3a, 0x3c, 0xd3, 0x3e, + 0xfa, 0x17, 0x1d, 0xfd, 0x37, 0xfa, 0x74, 0xe8, 0x26, 0xfa, 0x54, 0xf5, 0x13, 0x53, 0xb5, 0x1f, + 0x54, 0x67, 0x3d, 0xc7, 0x86, 0xdc, 0x98, 0x7d, 0x47, 0xad, 0xe3, 0x64, 0xbe, 0x0e, 0x80, 0x72, + 0x65, 0x48, 0xcf, 0x44, 0x41, 0xab, 0xb7, 0x57, 0x7b, 0x07, 0x5d, 0xef, 0x1d, 0xf4, 0x73, 0xef, + 0xa0, 0xaf, 0x07, 0x47, 0xbb, 0x3e, 0x38, 0xda, 0xf7, 0x83, 0xa3, 0x7d, 0x3a, 0x2b, 0x98, 0xd8, + 0xec, 0xce, 0xc3, 0x1c, 0xaa, 0x68, 0xbc, 0xe2, 0x0c, 0x78, 0xf1, 0xb7, 0x8e, 0xbe, 0xbc, 0x8e, + 0x3a, 0xf5, 0x3d, 0xc4, 0x65, 0x43, 0xdb, 0xf3, 0x85, 0xfa, 0x20, 0xaf, 0xfe, 0x04, 0x00, 0x00, + 0xff, 0xff, 0xcd, 0x2b, 0x06, 0xdc, 0x9a, 0x02, 0x00, 0x00, } func (m *DepositRecord) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/types/errors.go b/x/dex/types/errors.go index 69211ca8f..ff0b765b2 100644 --- a/x/dex/types/errors.go +++ b/x/dex/types/errors.go @@ -27,7 +27,7 @@ var ( ErrValidLimitOrderTrancheNotFound = sdkerrors.Register( ModuleName, 1111, - "Limit order trache not found:", + "Limit order tranche not found:", ) // "%d", trancheKey ErrCancelEmptyLimitOrder = sdkerrors.Register( ModuleName, @@ -57,7 +57,7 @@ var ( ErrZeroTrueDeposit = sdkerrors.Register( ModuleName, 1121, - "Cannot deposit double-sided liquidity in tick with prexisting single-sided liquidity.", + "Cannot deposit single-sided liquidity in tick with opposite liquidity while autoswap is disabled", ) ErrWithdrawEmptyLimitOrder = sdkerrors.Register( ModuleName, @@ -69,11 +69,6 @@ var ( 1125, "MaxAmountIn in must be > 0 for swap.", ) - ErrActiveLimitOrderNotFound = sdkerrors.Register( - ModuleName, - 1128, - "No active limit found. It does not exist or has already been filled", - ) ErrZeroWithdraw = sdkerrors.Register( ModuleName, 1129, @@ -224,4 +219,14 @@ var ( 1163, "Cannot convert price to int64 tick value", ) + ErrNoLiquidity = sdkerrors.Register( + ModuleName, + 1164, + "No tradable liquidity below LimitSellPrice", + ) + ErrZeroMinAverageSellPrice = sdkerrors.Register( + ModuleName, + 1165, + "MinAverageSellPrice must be nil or > 0.", + ) ) diff --git a/x/dex/types/events.go b/x/dex/types/events.go index bf3670855..4f96e826b 100644 --- a/x/dex/types/events.go +++ b/x/dex/types/events.go @@ -7,6 +7,72 @@ import ( "cosmossdk.io/math" "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + + math_utils "github.com/neutron-org/neutron/v5/utils/math" +) + +// Shared Attributes +const ( + AttributeCreator = "Creator" + AttributeReceiver = "Receiver" + AttributeToken0 = "TokenZero" + AttributeToken1 = "TokenOne" + AttributeTokenIn = "TokenIn" + AttributeTokenOut = "TokenOut" + AttributeAmountIn = "AmountIn" + AttributeAmountOut = "AmountOut" + AttributeSwapAmountIn = "SwapAmountIn" + AttributeSwapAmountOut = "SwapAmountOut" + AttributeTokenInAmountOut = "TokenInAmountOut" + AttributeTokenOutAmountOut = "TokenOutAmountOut" + AttributeTickIndex = "TickIndex" + AttributeFee = "Fee" + AttributeTrancheKey = "TrancheKey" + AttributeSharesMinted = "SharesMinted" + AttributeReserves0Deposited = "ReservesZeroDeposited" + AttributeReserves1Deposited = "ReservesOneDeposited" + AttributeReserves0Withdrawn = "ReservesZeroWithdrawn" + AttributeReserves1Withdrawn = "ReservesOneWithdrawn" + AttributeSharesRemoved = "SharesRemoved" + AttributeRoute = "Route" + AttributeDust = "Dust" + AttributeLimitTick = "LimitTick" + AttributeOrderType = "OrderType" + AttributeShares = "Shares" + AttributeReserves = "Reserves" + AttributeGas = "Gas" + AttributeDenom = "denom" + AttributeWithdrawn = "total_withdrawn" + AttributeGasConsumed = "gas_consumed" + AttributeLiquidityTickType = "liquidity_tick_type" + AttributeLp = "lp" + AttributeLimitOrder = "limit_order" + AttributeIsExpiringLimitOrder = "is_expiring_limit_order" + AttributeInc = "inc" + AttributeDec = "dec" + AttributePairID = "pair_id" + AttributeMakerDenom = "MakerDenom" + AttributeTakerDenom = "TakerDenom" + AttributeSharesOwned = "SharesOwned" + AttributeSharesWithdrawn = "SharesWithdrawn" + AttributeMinAvgSellPrice = "MinAvgSellPrice" +) + +// Event Keys +const ( + DepositEventKey = "DepositLP" + WithdrawEventKey = "WithdrawLP" + MultihopSwapEventKey = "MultihopSwap" + PlaceLimitOrderEventKey = "PlaceLimitOrder" + WithdrawFilledLimitOrderEventKey = "WithdrawLimitOrder" + CancelLimitOrderEventKey = "CancelLimitOrder" + EventTypeTickUpdate = "TickUpdate" + TickUpdateEventKey = "TickUpdate" + EventTypeGoodTilPurgeHitGasLimit = "GoodTilPurgeHitGasLimit" + TrancheUserUpdateEventKey = "TrancheUserUpdate" + EventTypeTrancheUserUpdate = "TrancheUserUpdate" + // EventTypeNeutronMessage defines the event type used by the Interchain Queries module events. + EventTypeNeutronMessage = "neutron" ) func CreateDepositEvent( @@ -23,15 +89,15 @@ func CreateDepositEvent( attrs := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), sdk.NewAttribute(sdk.AttributeKeyAction, DepositEventKey), - sdk.NewAttribute(DepositEventCreator, creator.String()), - sdk.NewAttribute(DepositEventReceiver, receiver.String()), - sdk.NewAttribute(DepositEventToken0, token0), - sdk.NewAttribute(DepositEventToken1, token1), - sdk.NewAttribute(DepositEventPrice, strconv.FormatInt(tickIndex, 10)), - sdk.NewAttribute(DepositEventFee, strconv.FormatUint(fee, 10)), - sdk.NewAttribute(DepositEventReserves0Deposited, depositAmountReserve0.String()), - sdk.NewAttribute(DepositEventReserves1Deposited, depositAmountReserve1.String()), - sdk.NewAttribute(DepositEventSharesMinted, sharesMinted.String()), + sdk.NewAttribute(AttributeCreator, creator.String()), + sdk.NewAttribute(AttributeReceiver, receiver.String()), + sdk.NewAttribute(AttributeToken0, token0), + sdk.NewAttribute(AttributeToken1, token1), + sdk.NewAttribute(AttributeTickIndex, strconv.FormatInt(tickIndex, 10)), + sdk.NewAttribute(AttributeFee, strconv.FormatUint(fee, 10)), + sdk.NewAttribute(AttributeReserves0Deposited, depositAmountReserve0.String()), + sdk.NewAttribute(AttributeReserves1Deposited, depositAmountReserve1.String()), + sdk.NewAttribute(AttributeSharesMinted, sharesMinted.String()), } return sdk.NewEvent(sdk.EventTypeMessage, attrs...) @@ -51,15 +117,15 @@ func CreateWithdrawEvent( attrs := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), sdk.NewAttribute(sdk.AttributeKeyAction, WithdrawEventKey), - sdk.NewAttribute(WithdrawEventCreator, creator.String()), - sdk.NewAttribute(WithdrawEventReceiver, receiver.String()), - sdk.NewAttribute(WithdrawEventToken0, token0), - sdk.NewAttribute(WithdrawEventToken1, token1), - sdk.NewAttribute(WithdrawEventPrice, strconv.FormatInt(tickIndex, 10)), - sdk.NewAttribute(WithdrawEventFee, strconv.FormatUint(fee, 10)), - sdk.NewAttribute(WithdrawEventReserves0Withdrawn, withdrawAmountReserve0.String()), - sdk.NewAttribute(WithdrawEventReserves1Withdrawn, withdrawAmountReserve1.String()), - sdk.NewAttribute(WithdrawEventSharesRemoved, sharesRemoved.String()), + sdk.NewAttribute(AttributeCreator, creator.String()), + sdk.NewAttribute(AttributeReceiver, receiver.String()), + sdk.NewAttribute(AttributeToken0, token0), + sdk.NewAttribute(AttributeToken1, token1), + sdk.NewAttribute(AttributeTickIndex, strconv.FormatInt(tickIndex, 10)), + sdk.NewAttribute(AttributeFee, strconv.FormatUint(fee, 10)), + sdk.NewAttribute(AttributeReserves0Withdrawn, withdrawAmountReserve0.String()), + sdk.NewAttribute(AttributeReserves1Withdrawn, withdrawAmountReserve1.String()), + sdk.NewAttribute(AttributeSharesRemoved, sharesRemoved.String()), } return sdk.NewEvent(sdk.EventTypeMessage, attrs...) @@ -82,14 +148,14 @@ func CreateMultihopSwapEvent( attrs := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), sdk.NewAttribute(sdk.AttributeKeyAction, MultihopSwapEventKey), - sdk.NewAttribute(MultihopSwapEventCreator, creator.String()), - sdk.NewAttribute(MultihopSwapEventReceiver, receiver.String()), - sdk.NewAttribute(MultihopSwapEventTokenIn, makerDenom), - sdk.NewAttribute(MultihopSwapEventTokenOut, tokenOut), - sdk.NewAttribute(MultihopSwapEventAmountIn, amountIn.String()), - sdk.NewAttribute(MultihopSwapEventAmountOut, amountOut.String()), - sdk.NewAttribute(MultihopSwapEventRoute, strings.Join(route, ",")), - sdk.NewAttribute(MultihopSwapEventDust, strings.Join(dustStrings, ",")), + sdk.NewAttribute(AttributeCreator, creator.String()), + sdk.NewAttribute(AttributeReceiver, receiver.String()), + sdk.NewAttribute(AttributeTokenIn, makerDenom), + sdk.NewAttribute(AttributeTokenOut, tokenOut), + sdk.NewAttribute(AttributeAmountIn, amountIn.String()), + sdk.NewAttribute(AttributeAmountOut, amountOut.String()), + sdk.NewAttribute(AttributeRoute, strings.Join(route, ",")), + sdk.NewAttribute(AttributeDust, strings.Join(dustStrings, ",")), } return sdk.NewEvent(sdk.EventTypeMessage, attrs...) @@ -105,23 +171,29 @@ func CreatePlaceLimitOrderEvent( amountIn math.Int, limitTick int64, orderType string, + minAvgSellPrice math_utils.PrecDec, shares math.Int, trancheKey string, + swapAmountIn math.Int, + swapAmountOut math.Int, ) sdk.Event { attrs := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), sdk.NewAttribute(sdk.AttributeKeyAction, PlaceLimitOrderEventKey), - sdk.NewAttribute(PlaceLimitOrderEventCreator, creator.String()), - sdk.NewAttribute(PlaceLimitOrderEventReceiver, receiver.String()), - sdk.NewAttribute(PlaceLimitOrderEventToken0, token0), - sdk.NewAttribute(PlaceLimitOrderEventToken1, token1), - sdk.NewAttribute(PlaceLimitOrderEventTokenIn, makerDenom), - sdk.NewAttribute(PlaceLimitOrderEventTokenOut, tokenOut), - sdk.NewAttribute(PlaceLimitOrderEventAmountIn, amountIn.String()), - sdk.NewAttribute(PlaceLimitOrderEventLimitTick, strconv.FormatInt(limitTick, 10)), - sdk.NewAttribute(PlaceLimitOrderEventOrderType, orderType), - sdk.NewAttribute(PlaceLimitOrderEventShares, shares.String()), - sdk.NewAttribute(PlaceLimitOrderEventTrancheKey, trancheKey), + sdk.NewAttribute(AttributeCreator, creator.String()), + sdk.NewAttribute(AttributeReceiver, receiver.String()), + sdk.NewAttribute(AttributeToken0, token0), + sdk.NewAttribute(AttributeToken1, token1), + sdk.NewAttribute(AttributeTokenIn, makerDenom), + sdk.NewAttribute(AttributeTokenOut, tokenOut), + sdk.NewAttribute(AttributeAmountIn, amountIn.String()), + sdk.NewAttribute(AttributeLimitTick, strconv.FormatInt(limitTick, 10)), + sdk.NewAttribute(AttributeOrderType, orderType), + sdk.NewAttribute(AttributeShares, shares.String()), + sdk.NewAttribute(AttributeTrancheKey, trancheKey), + sdk.NewAttribute(AttributeSwapAmountIn, swapAmountIn.String()), + sdk.NewAttribute(AttributeSwapAmountOut, swapAmountOut.String()), + sdk.NewAttribute(AttributeMinAvgSellPrice, minAvgSellPrice.String()), } return sdk.NewEvent(sdk.EventTypeMessage, attrs...) @@ -133,19 +205,24 @@ func WithdrawFilledLimitOrderEvent( token1 string, makerDenom string, tokenOut string, - amountOut math.Int, + amountOutTaker math.Int, + amountOutMaker math.Int, trancheKey string, ) sdk.Event { attrs := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), sdk.NewAttribute(sdk.AttributeKeyAction, WithdrawFilledLimitOrderEventKey), - sdk.NewAttribute(WithdrawFilledLimitOrderEventCreator, creator.String()), - sdk.NewAttribute(WithdrawFilledLimitOrderEventToken0, token0), - sdk.NewAttribute(WithdrawFilledLimitOrderEventToken1, token1), - sdk.NewAttribute(WithdrawFilledLimitOrderEventTokenIn, makerDenom), - sdk.NewAttribute(WithdrawFilledLimitOrderEventTokenOut, tokenOut), - sdk.NewAttribute(WithdrawFilledLimitOrderEventTrancheKey, trancheKey), - sdk.NewAttribute(WithdrawFilledLimitOrderEventAmountOut, amountOut.String()), + sdk.NewAttribute(AttributeCreator, creator.String()), + sdk.NewAttribute(AttributeReceiver, creator.String()), + sdk.NewAttribute(AttributeToken0, token0), + sdk.NewAttribute(AttributeToken1, token1), + sdk.NewAttribute(AttributeTokenIn, makerDenom), + sdk.NewAttribute(AttributeTokenOut, tokenOut), + sdk.NewAttribute(AttributeTrancheKey, trancheKey), + // DEPRECATED: `AmountOut` will be removed in the next release + sdk.NewAttribute(AttributeAmountOut, amountOutTaker.String()), + sdk.NewAttribute(AttributeTokenOutAmountOut, amountOutTaker.String()), + sdk.NewAttribute(AttributeTokenInAmountOut, amountOutMaker.String()), } return sdk.NewEvent(sdk.EventTypeMessage, attrs...) @@ -157,19 +234,30 @@ func CancelLimitOrderEvent( token1 string, makerDenom string, tokenOut string, - amountOut math.Int, + amountOutTaker math.Int, + amountOutMaker math.Int, trancheKey string, ) sdk.Event { + pairID := PairID{Token0: token0, Token1: token1} + takerDenom := pairID.MustOppositeToken(makerDenom) + coinsOut := sdk.NewCoins( + sdk.NewCoin(makerDenom, amountOutMaker), + sdk.NewCoin(takerDenom, amountOutTaker), + ) attrs := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), sdk.NewAttribute(sdk.AttributeKeyAction, CancelLimitOrderEventKey), - sdk.NewAttribute(CancelLimitOrderEventCreator, creator.String()), - sdk.NewAttribute(CancelLimitOrderEventToken0, token0), - sdk.NewAttribute(CancelLimitOrderEventToken1, token1), - sdk.NewAttribute(CancelLimitOrderEventTokenIn, makerDenom), - sdk.NewAttribute(CancelLimitOrderEventTokenOut, tokenOut), - sdk.NewAttribute(CancelLimitOrderEventAmountOut, amountOut.String()), - sdk.NewAttribute(CancelLimitOrderEventTrancheKey, trancheKey), + sdk.NewAttribute(AttributeCreator, creator.String()), + sdk.NewAttribute(AttributeReceiver, creator.String()), + sdk.NewAttribute(AttributeToken0, token0), + sdk.NewAttribute(AttributeToken1, token1), + sdk.NewAttribute(AttributeTokenIn, makerDenom), + sdk.NewAttribute(AttributeTokenOut, tokenOut), + // DEPRECATED: `AmountOut` will be removed in the next release + sdk.NewAttribute(AttributeAmountOut, coinsOut.String()), + sdk.NewAttribute(AttributeTokenInAmountOut, amountOutMaker.String()), + sdk.NewAttribute(AttributeTokenOutAmountOut, amountOutTaker.String()), + sdk.NewAttribute(AttributeTrancheKey, trancheKey), } return sdk.NewEvent(sdk.EventTypeMessage, attrs...) @@ -186,11 +274,11 @@ func TickUpdateEvent( attrs := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), sdk.NewAttribute(sdk.AttributeKeyAction, TickUpdateEventKey), - sdk.NewAttribute(TickUpdateEventToken0, token0), - sdk.NewAttribute(TickUpdateEventToken1, token1), - sdk.NewAttribute(TickUpdateEventTokenIn, makerDenom), - sdk.NewAttribute(TickUpdateEventTickIndex, strconv.FormatInt(tickIndex, 10)), - sdk.NewAttribute(TickUpdateEventReserves, reserves.String()), + sdk.NewAttribute(AttributeToken0, token0), + sdk.NewAttribute(AttributeToken1, token1), + sdk.NewAttribute(AttributeTokenIn, makerDenom), + sdk.NewAttribute(AttributeTickIndex, strconv.FormatInt(tickIndex, 10)), + sdk.NewAttribute(AttributeReserves, reserves.String()), } attrs = append(attrs, otherAttrs...) @@ -206,7 +294,7 @@ func CreateTickUpdatePoolReserves(tick PoolReserves) sdk.Event { tradePairID.MakerDenom, tick.Key.TickIndexTakerToMaker, tick.ReservesMakerDenom, - sdk.NewAttribute(TickUpdateEventFee, strconv.FormatUint(tick.Key.Fee, 10)), + sdk.NewAttribute(AttributeFee, strconv.FormatUint(tick.Key.Fee, 10)), ) } @@ -219,7 +307,7 @@ func CreateTickUpdateLimitOrderTranche(tranche *LimitOrderTranche) sdk.Event { tradePairID.MakerDenom, tranche.Key.TickIndexTakerToMaker, tranche.ReservesMakerDenom, - sdk.NewAttribute(TickUpdateEventTrancheKey, tranche.Key.TrancheKey), + sdk.NewAttribute(AttributeTrancheKey, tranche.Key.TrancheKey), ) } @@ -232,14 +320,14 @@ func CreateTickUpdateLimitOrderTranchePurge(tranche *LimitOrderTranche) sdk.Even tradePairID.MakerDenom, tranche.Key.TickIndexTakerToMaker, math.ZeroInt(), - sdk.NewAttribute(TickUpdateEventTrancheKey, tranche.Key.TrancheKey), + sdk.NewAttribute(AttributeTrancheKey, tranche.Key.TrancheKey), ) } func GoodTilPurgeHitLimitEvent(gas types.Gas) sdk.Event { attrs := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), - sdk.NewAttribute(GoodTilPurgeHitGasLimitEventGas, strconv.FormatUint(gas, 10)), + sdk.NewAttribute(AttributeGas, strconv.FormatUint(gas, 10)), } return sdk.NewEvent(EventTypeGoodTilPurgeHitGasLimit, attrs...) @@ -346,3 +434,20 @@ func GetEventsDecTotalPoolReserves(pairID PairID) sdk.Events { ), } } + +func TrancheUserUpdateEvent(trancheUser LimitOrderTrancheUser) sdk.Event { + pairID := trancheUser.TradePairId.MustPairID() + attrs := []sdk.Attribute{ + sdk.NewAttribute(sdk.AttributeKeyModule, "dex"), + sdk.NewAttribute(sdk.AttributeKeyAction, TrancheUserUpdateEventKey), + sdk.NewAttribute(AttributeTrancheKey, trancheUser.TrancheKey), + sdk.NewAttribute(AttributeCreator, trancheUser.Address), + sdk.NewAttribute(AttributeTickIndex, strconv.Itoa(int(trancheUser.TickIndexTakerToMaker))), + sdk.NewAttribute(AttributeToken0, pairID.Token0), + sdk.NewAttribute(AttributeToken1, pairID.Token1), + sdk.NewAttribute(AttributeTokenIn, trancheUser.TradePairId.MakerDenom), + sdk.NewAttribute(AttributeSharesOwned, trancheUser.SharesOwned.String()), + sdk.NewAttribute(AttributeSharesWithdrawn, trancheUser.SharesWithdrawn.String()), + } + return sdk.NewEvent(EventTypeTrancheUserUpdate, attrs...) +} diff --git a/x/dex/types/expected_keepers.go b/x/dex/types/expected_keepers.go index 339e22037..a925e867f 100644 --- a/x/dex/types/expected_keepers.go +++ b/x/dex/types/expected_keepers.go @@ -4,6 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) // BankKeeper defines the expected interface needed to retrieve account balances. @@ -15,4 +16,6 @@ type BankKeeper interface { BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error IterateAccountBalances(ctx context.Context, addr sdk.AccAddress, cb func(sdk.Coin) bool) GetSupply(ctx context.Context, denom string) sdk.Coin + GetAccountsBalances(ctx context.Context) []banktypes.Balance + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } diff --git a/x/dex/types/genesis.pb.go b/x/dex/types/genesis.pb.go index 167877ac6..50a5e0b85 100644 --- a/x/dex/types/genesis.pb.go +++ b/x/dex/types/genesis.pb.go @@ -116,32 +116,32 @@ func init() { proto.RegisterFile("neutron/dex/genesis.proto", fileDescriptor_0c0 var fileDescriptor_0c051a8a0d58cd8b = []byte{ // 407 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xb1, 0xae, 0xda, 0x30, - 0x14, 0x86, 0x93, 0x42, 0x91, 0x6a, 0x3a, 0xb4, 0xa1, 0x43, 0x88, 0x44, 0x48, 0x91, 0x2a, 0xa1, - 0x4a, 0x24, 0x2a, 0xed, 0x13, 0xd0, 0x81, 0x05, 0x54, 0x44, 0xe9, 0xd2, 0x25, 0x32, 0x89, 0x15, - 0x5c, 0x92, 0x38, 0x75, 0x4e, 0x10, 0xbc, 0x45, 0x1f, 0x8b, 0x91, 0xb1, 0x4b, 0xab, 0x2b, 0x78, - 0x91, 0xab, 0xd8, 0x46, 0x4a, 0x74, 0xb9, 0xf7, 0x6e, 0xd6, 0x39, 0x9f, 0xff, 0xcf, 0x3e, 0x36, - 0xea, 0xa6, 0xa4, 0x00, 0xce, 0x52, 0x2f, 0x24, 0x7b, 0x2f, 0x22, 0x29, 0xc9, 0x69, 0xee, 0x66, - 0x9c, 0x01, 0x33, 0xda, 0xaa, 0xe5, 0x86, 0x64, 0x6f, 0xbd, 0x8b, 0x58, 0xc4, 0x44, 0xdd, 0x2b, - 0x57, 0x12, 0xb1, 0x3e, 0x54, 0x77, 0xc7, 0x34, 0xa1, 0xe0, 0x33, 0x1e, 0x12, 0xee, 0x03, 0xc7, - 0x69, 0xb0, 0x21, 0x0a, 0xfb, 0xf8, 0x0c, 0xe6, 0x17, 0x39, 0xe1, 0x8a, 0x35, 0xab, 0x6c, 0x86, - 0x39, 0x4e, 0xd4, 0x79, 0xac, 0x7e, 0xad, 0xc3, 0x58, 0xec, 0x27, 0x04, 0x70, 0x88, 0x01, 0x2b, - 0xc0, 0xa9, 0x02, 0x40, 0x83, 0xad, 0x1f, 0xd3, 0xdf, 0x05, 0x0d, 0x29, 0x1c, 0x24, 0x31, 0xf8, - 0xd7, 0x40, 0xaf, 0xa7, 0xf2, 0x92, 0xdf, 0x01, 0x03, 0x31, 0x3e, 0xa1, 0x96, 0x74, 0x98, 0xba, - 0xa3, 0x0f, 0xdb, 0xe3, 0x8e, 0x5b, 0xb9, 0xb4, 0xbb, 0x10, 0xad, 0x49, 0xf3, 0xf8, 0xbf, 0xaf, - 0x2d, 0x15, 0x68, 0x2c, 0x50, 0xa7, 0x9e, 0xed, 0xc7, 0x34, 0x07, 0xf3, 0x85, 0xd3, 0x18, 0xb6, - 0xc7, 0x56, 0x6d, 0xff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 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0xaa, 0xda, 0x40, + 0x14, 0x86, 0x93, 0x6a, 0x85, 0x8e, 0x5d, 0xb4, 0xb1, 0x8b, 0x18, 0x30, 0xa6, 0x42, 0x41, 0x0a, + 0x26, 0xd4, 0xd2, 0x17, 0xb0, 0x0b, 0x37, 0x4a, 0xc5, 0xda, 0x4d, 0x37, 0x61, 0x4c, 0x86, 0x38, + 0x35, 0xc9, 0xa4, 0x93, 0x13, 0xd1, 0xb7, 0xe8, 0x63, 0xb9, 0x74, 0xd9, 0x4d, 0xcb, 0x45, 0x5f, + 0xe4, 0x92, 0x99, 0x11, 0x12, 0xae, 0xf7, 0xde, 0xdd, 0x70, 0xce, 0x37, 0xff, 0x37, 0x73, 0x66, + 0x50, 0x37, 0x25, 0x05, 0x70, 0x96, 0x7a, 0x21, 0xd9, 0x7b, 0x11, 0x49, 0x49, 0x4e, 0x73, 0x37, + 0xe3, 0x0c, 0x98, 0xd1, 0x56, 0x2d, 0x37, 0x24, 0x7b, 0xeb, 0x5d, 0xc4, 0x22, 0x26, 0xea, 0x5e, + 0xb9, 0x92, 0x88, 0xf5, 0xa1, 0xba, 0x3b, 0xa6, 0x09, 0x05, 0x9f, 0xf1, 0x90, 0x70, 0x1f, 0x38, + 0x4e, 0x83, 0x0d, 0x51, 0xd8, 0xc7, 0x67, 0x30, 0xbf, 0xc8, 0x09, 0x57, 0xac, 0x59, 0x65, 0x33, + 0xcc, 0x71, 0xa2, 0xce, 0x63, 0xf5, 0x6b, 0x1d, 0xc6, 0x62, 0x3f, 0x21, 0x80, 0x43, 0x0c, 0x58, + 0x01, 0x4e, 0x15, 0x00, 0x1a, 0x6c, 0xfd, 0x98, 0xfe, 0x2e, 0x68, 0x48, 0xe1, 0x20, 0x89, 0xc1, + 0xbf, 0x06, 0x7a, 0x3d, 0x95, 0x97, 0xfc, 0x0e, 0x18, 0x88, 0xf1, 0x09, 0xb5, 0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0x58, 0xe2, 0x29, 0xeb, 0x88, 0xf1, 0xe8, 0xba, 0xf6, 0x76, 0x5f, 0xbc, 0xbd, 0xfc, + 0x37, 0x87, 0x8c, 0xe4, 0xeb, 0x96, 0xf8, 0x2f, 0x9f, 0xef, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6c, + 0x1a, 0x11, 0x18, 0x1f, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/types/genesis_test.go b/x/dex/types/genesis_test.go index 200ced0db..dcded4b7b 100644 --- a/x/dex/types/genesis_test.go +++ b/x/dex/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/dex/types/keys.go b/x/dex/types/keys.go index 29cb202f2..9f6622d90 100644 --- a/x/dex/types/keys.go +++ b/x/dex/types/keys.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dex/utils" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) const ( @@ -194,105 +194,6 @@ func PoolIDKey( return key } -// Deposit Event Attributes -const ( - DepositEventKey = "DepositLP" - DepositEventCreator = "Creator" - DepositEventToken0 = "TokenZero" - DepositEventToken1 = "TokenOne" - DepositEventPrice = "TickIndex" - DepositEventFee = "Fee" - DepositEventReceiver = "Receiver" - DepositEventReserves0Deposited = "ReservesZeroDeposited" - DepositEventReserves1Deposited = "ReservesOneDeposited" - DepositEventSharesMinted = "SharesMinted" -) - -// Withdraw Event Attributes -const ( - WithdrawEventKey = "WithdrawLP" - WithdrawEventCreator = "Creator" - WithdrawEventToken0 = "TokenZero" - WithdrawEventToken1 = "TokenOne" - WithdrawEventPrice = "TickIndex" - WithdrawEventFee = "Fee" - WithdrawEventReceiver = "Receiver" - WithdrawEventReserves0Withdrawn = "ReservesZeroWithdrawn" - WithdrawEventReserves1Withdrawn = "ReservesOneWithdrawn" - WithdrawEventSharesRemoved = "SharesRemoved" -) - -// Multihop-Swap Event Attributes -const ( - MultihopSwapEventKey = "MultihopSwap" - MultihopSwapEventCreator = "Creator" - MultihopSwapEventReceiver = "Receiver" - MultihopSwapEventTokenIn = "TokenIn" - MultihopSwapEventTokenOut = "TokenOut" - MultihopSwapEventAmountIn = "AmountIn" - MultihopSwapEventAmountOut = "AmountOut" - MultihopSwapEventRoute = "Route" - MultihopSwapEventDust = "Dust" -) - -// Place LimitOrder Event Attributes -const ( - PlaceLimitOrderEventKey = "PlaceLimitOrder" - PlaceLimitOrderEventCreator = "Creator" - PlaceLimitOrderEventReceiver = "Receiver" - PlaceLimitOrderEventToken0 = "TokenZero" - PlaceLimitOrderEventToken1 = "TokenOne" - PlaceLimitOrderEventTokenIn = "TokenIn" - PlaceLimitOrderEventTokenOut = "TokenOut" - PlaceLimitOrderEventAmountIn = "AmountIn" - PlaceLimitOrderEventLimitTick = "LimitTick" - PlaceLimitOrderEventOrderType = "OrderType" - PlaceLimitOrderEventShares = "Shares" - PlaceLimitOrderEventTrancheKey = "TrancheKey" -) - -// Withdraw LimitOrder Event Attributes -const ( - WithdrawFilledLimitOrderEventKey = "WithdrawLimitOrder" - WithdrawFilledLimitOrderEventCreator = "Creator" - WithdrawFilledLimitOrderEventToken0 = "TokenZero" - WithdrawFilledLimitOrderEventToken1 = "TokenOne" - WithdrawFilledLimitOrderEventTokenIn = "TokenIn" - WithdrawFilledLimitOrderEventTokenOut = "TokenOut" - WithdrawFilledLimitOrderEventTrancheKey = "TrancheKey" - WithdrawFilledLimitOrderEventAmountOut = "AmountOut" -) - -// Cancel LimitOrder Event Attributes -const ( - CancelLimitOrderEventKey = "CancelLimitOrder" - CancelLimitOrderEventCreator = "Creator" - CancelLimitOrderEventToken0 = "TokenZero" - CancelLimitOrderEventToken1 = "TokenOne" - CancelLimitOrderEventTokenIn = "TokenIn" - CancelLimitOrderEventTokenOut = "TokenOut" - CancelLimitOrderEventTrancheKey = "TrancheKey" - CancelLimitOrderEventAmountOut = "AmountOut" -) - -// Tick Update Event Attributes -const ( - EventTypeTickUpdate = "TickUpdate" - TickUpdateEventKey = "TickUpdate" - TickUpdateEventToken0 = "TokenZero" - TickUpdateEventToken1 = "TokenOne" - TickUpdateEventTokenIn = "TokenIn" - TickUpdateEventTickIndex = "TickIndex" - TickUpdateEventFee = "Fee" - TickUpdateEventTrancheKey = "TrancheKey" - TickUpdateEventReserves = "Reserves" -) - -const ( - EventTypeGoodTilPurgeHitGasLimit = "GoodTilPurgeHitGasLimit" - GoodTilPurgeHitGasLimitEventGas = "Gas" -) - const ( // NOTE: have to add letter so that LP deposits are indexed ahead of LimitOrders LiquidityTypePoolReserves = "A_PoolDeposit" @@ -306,3 +207,6 @@ func JITGoodTilTime() time.Time { const ( ExpiringLimitOrderGas = 10_000 ) + +// Dummy Address used for simulate queries +const DummyAddress = "neutron1pq7j6za5zjcl3um9t5gfyleues336tv04tyq0k" diff --git a/x/dex/types/limit_order_expiration.pb.go b/x/dex/types/limit_order_expiration.pb.go index c983de898..1a53614ac 100644 --- a/x/dex/types/limit_order_expiration.pb.go +++ b/x/dex/types/limit_order_expiration.pb.go @@ -104,9 +104,9 @@ var fileDescriptor_61264397cad6ae82 = []byte{ 0x1a, 0x3c, 0x41, 0x5c, 0x50, 0xa1, 0xa0, 0xd4, 0x34, 0x27, 0xf7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, - 0xd5, 0x87, 0xfa, 0x58, 0x37, 0xbf, 0x28, 0x1d, 0xc6, 0xd6, 0x2f, 0x33, 0xd1, 0xaf, 0x00, 0x07, + 0xd5, 0x87, 0xfa, 0x58, 0x37, 0xbf, 0x28, 0x1d, 0xc6, 0xd6, 0x2f, 0x33, 0xd5, 0xaf, 0x00, 0x07, 0x56, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x5d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x2e, 0x39, 0x12, 0x8d, 0x48, 0x01, 0x00, 0x00, + 0xff, 0xb0, 0xba, 0xc8, 0x12, 0x48, 0x01, 0x00, 0x00, } func (m *LimitOrderExpiration) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/types/limit_order_tranche.go b/x/dex/types/limit_order_tranche.go index 8f6a6cb20..c9560100f 100644 --- a/x/dex/types/limit_order_tranche.go +++ b/x/dex/types/limit_order_tranche.go @@ -6,8 +6,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/utils" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) func NewLimitOrderTranche( @@ -24,7 +24,7 @@ func NewLimitOrderTranche( if err != nil { return nil, err } - priceTakerToMaker, err := tradePairID.PriceTakerToMaker(tickIndex) + makerPrice, err := tradePairID.MakerPrice(tickIndex) if err != nil { return nil, err } @@ -38,7 +38,8 @@ func NewLimitOrderTranche( ReservesTakerDenom: reservesTakerDenom, TotalMakerDenom: totalMakerDenom, TotalTakerDenom: totalTakerDenom, - PriceTakerToMaker: priceTakerToMaker, + MakerPrice: makerPrice, + PriceTakerToMaker: math_utils.OnePrecDec().Quo(makerPrice), }, nil } @@ -107,11 +108,11 @@ func (t LimitOrderTranche) HasTokenOut() bool { } func (t LimitOrderTranche) Price() math_utils.PrecDec { - return t.PriceTakerToMaker + return t.MakerPrice } func (t LimitOrderTranche) RatioFilled() math_utils.PrecDec { - amountFilled := t.PriceTakerToMaker.MulInt(t.TotalTakerDenom) + amountFilled := math_utils.NewPrecDecFromInt(t.TotalTakerDenom).Quo(t.MakerPrice) ratioFilled := amountFilled.QuoInt(t.TotalMakerDenom) // Cap ratio filled at 100% so that makers cannot over withdraw @@ -119,7 +120,7 @@ func (t LimitOrderTranche) RatioFilled() math_utils.PrecDec { } func (t LimitOrderTranche) AmountUnfilled() math_utils.PrecDec { - amountFilled := t.PriceTakerToMaker.MulInt(t.TotalTakerDenom) + amountFilled := math_utils.NewPrecDecFromInt(t.TotalTakerDenom).Quo(t.MakerPrice) trueAmountUnfilled := math_utils.NewPrecDecFromInt(t.TotalMakerDenom).Sub(amountFilled) // It is possible for a tranche to be overfilled due to rounding. Thus we cap the unfilled amount at 0 @@ -135,10 +136,9 @@ func (t *LimitOrderTranche) RemoveTokenIn( trancheUser *LimitOrderTrancheUser, ) (amountToRemove math.Int) { amountUnfilled := t.AmountUnfilled() - maxAmountToRemove := amountUnfilled.MulInt(trancheUser.SharesOwned). + amountToRemove = amountUnfilled.MulInt(trancheUser.SharesOwned). QuoInt(t.TotalMakerDenom). TruncateInt() - amountToRemove = maxAmountToRemove.Sub(trancheUser.SharesCancelled) t.ReservesMakerDenom = t.ReservesMakerDenom.Sub(amountToRemove) return amountToRemove @@ -148,7 +148,12 @@ func (t *LimitOrderTranche) CalcWithdrawAmount(trancheUser *LimitOrderTrancheUse ratioFilled := t.RatioFilled() maxAllowedToWithdraw := ratioFilled.MulInt(trancheUser.SharesOwned) sharesToWithdrawDec := maxAllowedToWithdraw.Sub(math_utils.NewPrecDecFromInt(trancheUser.SharesWithdrawn)) - amountOutTokenOutDec := sharesToWithdrawDec.Quo(t.PriceTakerToMaker) + + // Given rounding it is possible for sharesToWithdrawn > maxAllowedToWithdraw. In this case we just exit. + if !sharesToWithdrawDec.IsPositive() { + return math.ZeroInt(), math.ZeroInt() + } + amountOutTokenOutDec := sharesToWithdrawDec.Mul(t.MakerPrice) // Round shares withdrawn up and amountOut down to ensure math favors dex return sharesToWithdrawDec.Ceil().TruncateInt(), amountOutTokenOutDec.TruncateInt() @@ -168,14 +173,14 @@ func (t *LimitOrderTranche) Swap(maxAmountTakerIn math.Int, maxAmountMakerOut *m reservesTokenOut := &t.ReservesMakerDenom fillTokenIn := &t.ReservesTakerDenom totalTokenIn := &t.TotalTakerDenom - maxOutGivenIn := t.PriceTakerToMaker.MulInt(maxAmountTakerIn).TruncateInt() + maxOutGivenIn := math_utils.NewPrecDecFromInt(maxAmountTakerIn).Quo(t.MakerPrice).TruncateInt() possibleOutAmounts := []math.Int{*reservesTokenOut, maxOutGivenIn} if maxAmountMakerOut != nil { possibleOutAmounts = append(possibleOutAmounts, *maxAmountMakerOut) } outAmount = utils.MinIntArr(possibleOutAmounts) - inAmount = math_utils.NewPrecDecFromInt(outAmount).Quo(t.PriceTakerToMaker).Ceil().TruncateInt() + inAmount = t.MakerPrice.MulInt(outAmount).Ceil().TruncateInt() *fillTokenIn = fillTokenIn.Add(inAmount) *totalTokenIn = totalTokenIn.Add(inAmount) diff --git a/x/dex/types/limit_order_tranche.pb.go b/x/dex/types/limit_order_tranche.pb.go index e35ecd9cc..4f9386367 100644 --- a/x/dex/types/limit_order_tranche.pb.go +++ b/x/dex/types/limit_order_tranche.pb.go @@ -9,7 +9,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + github_com_neutron_org_neutron_v5_utils_math "github.com/neutron-org/neutron/v5/utils/math" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -98,8 +98,11 @@ type LimitOrderTranche struct { // JIT orders also use expiration_time to handle deletion but represent a special case // All JIT orders have a expiration_time of 0 and an exception is made to still treat these orders as live // Order deletion still functions the same and the orders will be deleted at the end of the block - ExpirationTime *time.Time `protobuf:"bytes,6,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time,omitempty"` - PriceTakerToMaker github_com_neutron_org_neutron_v4_utils_math.PrecDec `protobuf:"bytes,7,opt,name=price_taker_to_maker,json=priceTakerToMaker,proto3,customtype=github.com/neutron-org/neutron/v4/utils/math.PrecDec" json:"price_taker_to_maker" yaml:"price_taker_to_maker"` + ExpirationTime *time.Time `protobuf:"bytes,6,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time,omitempty"` + // DEPRECATED: price_taker_to_maker will be removed in future release, `maker_price` should always be used. + PriceTakerToMaker github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,7,opt,name=price_taker_to_maker,json=priceTakerToMaker,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"price_taker_to_maker" yaml:"price_taker_to_maker"` // Deprecated: Do not use. + // This is the price of the LimitOrder denominated in the opposite token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + MakerPrice github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,8,opt,name=maker_price,json=makerPrice,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"maker_price" yaml:"maker_price"` } func (m *LimitOrderTranche) Reset() { *m = LimitOrderTranche{} } @@ -159,43 +162,45 @@ func init() { } var fileDescriptor_8c2ded67c80756d1 = []byte{ - // 566 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x41, 0x8f, 0xd2, 0x40, - 0x14, 0xc7, 0x19, 0x51, 0x74, 0x87, 0xe8, 0x86, 0x86, 0x4d, 0xba, 0x98, 0xb4, 0xd8, 0xc4, 0x84, - 0xcb, 0xb6, 0x89, 0xbb, 0x07, 0x63, 0x3c, 0x11, 0x12, 0x43, 0x14, 0xdd, 0x34, 0x3d, 0x79, 0x69, - 0x4a, 0x3b, 0x96, 0x09, 0xb4, 0xd3, 0x4c, 0x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, 0xcd, 0x00, + 0xe3, 0xfc, 0xaf, 0x6d, 0x92, 0x90, 0xb4, 0xb7, 0x25, 0x9b, 0x74, 0xf6, 0x2b, 0x00, 0x00, 0xff, + 0xff, 0xda, 0xfd, 0x1f, 0x44, 0x7c, 0x05, 0x00, 0x00, } func (m *LimitOrderTrancheKey) Marshal() (dAtA []byte, err error) { @@ -265,6 +270,16 @@ func (m *LimitOrderTranche) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.MakerPrice.Size() + i -= size + if _, err := m.MakerPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLimitOrderTranche(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 { size := m.PriceTakerToMaker.Size() i -= size @@ -395,6 +410,8 @@ func (m *LimitOrderTranche) Size() (n int) { } l = m.PriceTakerToMaker.Size() n += 1 + l + sovLimitOrderTranche(uint64(l)) + l = m.MakerPrice.Size() + n += 1 + l + sovLimitOrderTranche(uint64(l)) return n } @@ -812,6 +829,40 @@ func (m *LimitOrderTranche) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MakerPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLimitOrderTranche + } + 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 ErrInvalidLengthLimitOrderTranche + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLimitOrderTranche + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MakerPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLimitOrderTranche(dAtA[iNdEx:]) diff --git a/x/dex/types/limit_order_tranche_key.go b/x/dex/types/limit_order_tranche_key.go index a42e9af16..5dfc78395 100644 --- a/x/dex/types/limit_order_tranche_key.go +++ b/x/dex/types/limit_order_tranche_key.go @@ -1,7 +1,7 @@ package types import ( - math_utils "github.com/neutron-org/neutron/v4/utils/math" + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) var _ TickLiquidityKey = (*LimitOrderTrancheKey)(nil) @@ -31,12 +31,12 @@ func (p LimitOrderTrancheKey) KeyMarshal() []byte { return key } -func (p LimitOrderTrancheKey) PriceTakerToMaker() (priceTakerToMaker math_utils.PrecDec, err error) { +func (p LimitOrderTrancheKey) Price() (priceTakerToMaker math_utils.PrecDec, err error) { return CalcPrice(p.TickIndexTakerToMaker) } -func (p LimitOrderTrancheKey) MustPriceTakerToMaker() (priceTakerToMaker math_utils.PrecDec) { - price, err := p.PriceTakerToMaker() +func (p LimitOrderTrancheKey) MustPrice() (priceTakerToMaker math_utils.PrecDec) { + price, err := p.Price() if err != nil { panic(err) } diff --git a/x/dex/types/limit_order_tranche_user.go b/x/dex/types/limit_order_tranche_user.go index 90dcf34ac..51f923210 100644 --- a/x/dex/types/limit_order_tranche_user.go +++ b/x/dex/types/limit_order_tranche_user.go @@ -1,6 +1,5 @@ package types func (l LimitOrderTrancheUser) IsEmpty() bool { - sharesRemoved := l.SharesCancelled.Add(l.SharesWithdrawn) - return sharesRemoved.Equal(l.SharesOwned) + return l.SharesWithdrawn.Equal(l.SharesOwned) } diff --git a/x/dex/types/limit_order_tranche_user.pb.go b/x/dex/types/limit_order_tranche_user.pb.go index b0e65087b..d83021acf 100644 --- a/x/dex/types/limit_order_tranche_user.pb.go +++ b/x/dex/types/limit_order_tranche_user.pb.go @@ -31,8 +31,9 @@ type LimitOrderTrancheUser struct { Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` SharesOwned cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=shares_owned,json=sharesOwned,proto3,customtype=cosmossdk.io/math.Int" json:"shares_owned" yaml:"shares_owned"` SharesWithdrawn cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=shares_withdrawn,json=sharesWithdrawn,proto3,customtype=cosmossdk.io/math.Int" json:"shares_withdrawn" yaml:"shares_withdrawn"` - SharesCancelled cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=shares_cancelled,json=sharesCancelled,proto3,customtype=cosmossdk.io/math.Int" json:"shares_cancelled" yaml:"shares_cancelled"` - OrderType LimitOrderType `protobuf:"varint,8,opt,name=order_type,json=orderType,proto3,enum=neutron.dex.LimitOrderType" json:"order_type,omitempty"` + // TODO: remove this in next release. It is no longer used + SharesCancelled cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=shares_cancelled,json=sharesCancelled,proto3,customtype=cosmossdk.io/math.Int" json:"shares_cancelled" yaml:"shares_cancelled"` + OrderType LimitOrderType `protobuf:"varint,8,opt,name=order_type,json=orderType,proto3,enum=neutron.dex.LimitOrderType" json:"order_type,omitempty"` } func (m *LimitOrderTrancheUser) Reset() { *m = LimitOrderTrancheUser{} } @@ -115,34 +116,34 @@ var fileDescriptor_67e5ffbd487ea05f = []byte{ // 469 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x4d, 0x6b, 0xdb, 0x4e, 0x10, 0xc6, 0xad, 0x7f, 0xf2, 0x4f, 0x9a, 0x55, 0xdf, 0x50, 0x63, 0xba, 0x4d, 0x41, 0x32, 0x3e, - 0x99, 0x42, 0x24, 0x48, 0x7b, 0x28, 0xa1, 0xa7, 0x34, 0x50, 0x4c, 0x53, 0x52, 0x84, 0x4b, 0xa1, - 0x17, 0xb1, 0xd1, 0x0e, 0xd2, 0x62, 0x4b, 0x2b, 0x76, 0xd7, 0xb5, 0xf4, 0x2d, 0xfa, 0xb1, 0x72, - 0xcc, 0xb1, 0xf4, 0x20, 0x5a, 0xfb, 0xd6, 0x63, 0x3e, 0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98, 0x8b, 0xa8, 0xa9, 0xbd, 0xaf, 0xaf, 0xbc, 0xbc, 0xba, 0xd7, 0x22, - 0x03, 0x79, 0xb5, 0xb7, 0xbd, 0xd9, 0x97, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x41, 0xf7, - 0x93, 0x3b, 0x03, 0x00, 0x00, + 0x99, 0x42, 0x24, 0x48, 0x29, 0x94, 0xd0, 0x53, 0x1a, 0x28, 0xa6, 0x29, 0x29, 0xc2, 0xa5, 0xd0, + 0x8b, 0xd8, 0x68, 0x07, 0x69, 0xb1, 0xa5, 0x15, 0xbb, 0xeb, 0x5a, 0xfa, 0x16, 0xfd, 0x58, 0x39, + 0xe6, 0x58, 0x7a, 0x10, 0xad, 0x7d, 0xeb, 0x31, 0x9f, 0xa0, 0xac, 0xf5, 0x82, 0x44, 0x0e, 0xa5, + 0x27, 0xcd, 0x3c, 0xcf, 0x33, 0xf3, 0x93, 0xc4, 0xa0, 0x17, 0x29, 0x2c, 0x95, 0xe0, 0xa9, 0x47, + 0x21, 0xf7, 0x16, 0x2c, 0x61, 0x2a, 0xe0, 0x82, 0x82, 0x08, 0x94, 0x20, 0x69, 0x18, 0x43, 0xb0, + 0x94, 0x20, 0xdc, 0x4c, 0x70, 0xc5, 0x2d, 0xb3, 0xce, 0xba, 0x14, 0xf2, 0xa3, 0xc3, 0x88, 0x47, + 0x7c, 0xab, 0x7b, 0xba, 0xaa, 0x22, 0x47, 0x4e, 0x77, 0x9d, 0x12, 0x84, 0x42, 0x90, 0x11, 0x26, + 0x02, 0x46, 0xeb, 0xc0, 0x61, 0x2f, 0x90, 0x57, 0xea, 0xf8, 0xd7, 0x2e, 0x1a, 0x5e, 0x68, 0xf8, + 0xa5, 0x66, 0xcf, 0x2a, 0xf4, 0x27, 0x09, 0xc2, 0x7a, 0x83, 0x1e, 0xf4, 0xd6, 0x60, 0x63, 0x64, + 0x4c, 0xcc, 0x13, 0xec, 0x76, 0xde, 0xc5, 0x9d,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x83, 0x77, + 0xc0, 0xad, 0xd3, 0x82, 0xdf, 0x36, 0x8a, 0x75, 0x8a, 0x50, 0x7d, 0x9d, 0x45, 0x06, 0xf8, 0xde, + 0xc8, 0x98, 0x3c, 0x3c, 0x79, 0xde, 0x3b, 0x85, 0xce, 0x15, 0x15, 0x19, 0xf8, 0x07, 0xbc, 0x29, + 0xcf, 0xde, 0x5d, 0xaf, 0x6d, 0xe3, 0x66, 0x6d, 0x1b, 0x3f, 0xd7, 0xb6, 0xf1, 0x6d, 0x63, 0x0f, + 0x6e, 0x36, 0xf6, 0xe0, 0xfb, 0xc6, 0x1e, 0x7c, 0x39, 0x8e, 0x98, 0x8a, 0x97, 0x57, 0x6e, 0xc8, + 0x13, 0xaf, 0xde, 0x75, 0xcc, 0x45, 0xd4, 0xd4, 0xde, 0xd7, 0x57, 0x5e, 0x5e, 0xdd, 0x6b, 0x91, + 0x81, 0xbc, 0xda, 0xdb, 0xde, 0xec, 0xcb, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xc2, 0x2d, + 0x0c, 0x3b, 0x03, 0x00, 0x00, } func (m *LimitOrderTrancheUser) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/types/liquidity.go b/x/dex/types/liquidity.go index aced7919c..97f6f9bd1 100644 --- a/x/dex/types/liquidity.go +++ b/x/dex/types/liquidity.go @@ -3,7 +3,7 @@ package types import ( "cosmossdk.io/math" - math_utils "github.com/neutron-org/neutron/v4/utils/math" + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) type Liquidity interface { diff --git a/x/dex/types/message_multi_hop_swap.go b/x/dex/types/message_multi_hop_swap.go index 416260d5c..57ffb4f65 100644 --- a/x/dex/types/message_multi_hop_swap.go +++ b/x/dex/types/message_multi_hop_swap.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) const TypeMsgMultiHopSwap = "multi_hop_swap" diff --git a/x/dex/types/message_place_limit_order.go b/x/dex/types/message_place_limit_order.go index 47206d49c..f40494e71 100644 --- a/x/dex/types/message_place_limit_order.go +++ b/x/dex/types/message_place_limit_order.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) const TypeMsgPlaceLimitOrder = "place_limit_order" @@ -121,6 +121,10 @@ func (msg *MsgPlaceLimitOrder) Validate() error { return ErrInvalidPriceAndTick } + if msg.MinAverageSellPrice != nil && msg.MinAverageSellPrice.IsZero() { + return ErrZeroMinAverageSellPrice + } + return nil } diff --git a/x/dex/types/pair_id.go b/x/dex/types/pair_id.go index dd2b9b9e6..4809e7e38 100644 --- a/x/dex/types/pair_id.go +++ b/x/dex/types/pair_id.go @@ -7,7 +7,8 @@ import ( sdkerrors "cosmossdk.io/errors" ) -func NewPairID(token0, token1 string) (*PairID, error) { +func NewPairID(tokenA, tokenB string) (*PairID, error) { + token0, token1 := SortTokens(tokenA, tokenB) if token0 == token1 { return nil, sdkerrors.Wrapf(ErrInvalidTradingPair, "%s<>%s", token0, token1) } @@ -17,19 +18,14 @@ func NewPairID(token0, token1 string) (*PairID, error) { }, nil } -func MustNewPairID(token0, token1 string) *PairID { - pairID, err := NewPairID(token0, token1) +func MustNewPairID(tokenA, tokenB string) *PairID { + pairID, err := NewPairID(tokenA, tokenB) if err != nil { panic(err) } return pairID } -func NewPairIDFromUnsorted(tokenA, tokenB string) (*PairID, error) { - token0, token1 := SortTokens(tokenA, tokenB) - return NewPairID(token0, token1) -} - func (p *PairID) CanonicalString() string { return fmt.Sprintf("%s<>%s", p.Token0, p.Token1) } diff --git a/x/dex/types/pair_id.pb.go b/x/dex/types/pair_id.pb.go index 1b97bd856..d42c49e72 100644 --- a/x/dex/types/pair_id.pb.go +++ b/x/dex/types/pair_id.pb.go @@ -90,8 +90,8 @@ var fileDescriptor_7bd5bf8f218c5bfa = []byte{ 0x71, 0x43, 0x27, 0xf7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0xda, 0xa5, 0x9b, 0x5f, 0x94, - 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xe8, 0x57, 0x80, 0xdd, 0x55, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, - 0x06, 0x76, 0x96, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xb4, 0x18, 0xd2, 0xb3, 0x00, 0x00, + 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xea, 0x57, 0x80, 0xdd, 0x55, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, + 0x06, 0x76, 0x96, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x02, 0x37, 0xc2, 0x4d, 0xb3, 0x00, 0x00, 0x00, } diff --git a/x/dex/types/params.pb.go b/x/dex/types/params.pb.go index ca28efd3e..8821ec7dd 100644 --- a/x/dex/types/params.pb.go +++ b/x/dex/types/params.pb.go @@ -101,7 +101,7 @@ var fileDescriptor_84a6bffcfc21009c = []byte{ // 290 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x90, 0x31, 0x4b, 0x03, 0x31, 0x14, 0xc7, 0x2f, 0xf4, 0x2c, 0x35, 0x0e, 0x42, 0x50, 0x08, 0x0a, 0x69, 0xe9, 0x54, 0x90, 0x36, - 0x83, 0x82, 0xe0, 0x66, 0x17, 0xc1, 0xa9, 0x94, 0x4e, 0x2e, 0x21, 0xed, 0xbd, 0xc6, 0xe8, 0x5d, + 0x83, 0x88, 0xe0, 0x66, 0x17, 0xc1, 0xa9, 0x94, 0x4e, 0x2e, 0x21, 0xed, 0xbd, 0xc6, 0xe8, 0x5d, 0x13, 0x92, 0x9c, 0x9e, 0xdf, 0xc2, 0xd1, 0xd1, 0x2f, 0xe1, 0x77, 0x70, 0xec, 0xe8, 0x24, 0x72, 0xb7, 0xf9, 0x29, 0xe4, 0xce, 0xeb, 0xf4, 0xfe, 0xef, 0xff, 0x7b, 0xff, 0xe1, 0xfd, 0x31, 0xdd, 0x40, 0x1e, 0x9c, 0xd9, 0xf0, 0x04, 0x0a, 0x6e, 0xa5, 0x93, 0x99, 0x9f, 0x58, 0x67, 0x82, 0x21, @@ -116,7 +116,7 @@ var fileDescriptor_84a6bffcfc21009c = []byte{ 0x3f, 0x9a, 0xde, 0x7c, 0x96, 0x0c, 0x6d, 0x4b, 0x86, 0x7e, 0x4a, 0x86, 0x5e, 0x2b, 0x16, 0x6d, 0x2b, 0x16, 0x7d, 0x55, 0x2c, 0xba, 0x1b, 0x2b, 0x1d, 0xee, 0xf3, 0xe5, 0x64, 0x65, 0x32, 0xde, 0xfe, 0x3f, 0x36, 0x4e, 0xed, 0x34, 0x7f, 0xba, 0xe0, 0x45, 0x53, 0x55, 0x78, 0xb1, 0xe0, 0x97, - 0xdd, 0xa6, 0x87, 0xf3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x58, 0x59, 0xc8, 0x6a, 0x46, 0x01, + 0xdd, 0xa6, 0x87, 0xf3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc6, 0xda, 0x12, 0xf5, 0x46, 0x01, 0x00, 0x00, } diff --git a/x/dex/types/pool.go b/x/dex/types/pool.go index 3a167f5b4..9d3093ce5 100644 --- a/x/dex/types/pool.go +++ b/x/dex/types/pool.go @@ -4,10 +4,15 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/utils" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) +type PoolShareholder struct { + Address string + Shares math.Int +} + func NewPool( pairID *PairID, centerTickIndexNormalized int64, @@ -49,7 +54,7 @@ func MustNewPool( return pool } -func (p *Pool) CenterTickIndex() int64 { +func (p *Pool) CenterTickIndexToken1() int64 { feeInt64 := utils.MustSafeUint64ToInt64(p.Fee()) return p.UpperTick1.Key.TickIndexTakerToMaker - feeInt64 } @@ -85,7 +90,7 @@ func (p *Pool) Swap( return math.ZeroInt(), math.ZeroInt() } - maxOutGivenTakerIn := makerReserves.PriceTakerToMaker.MulInt(maxAmountTakerIn).TruncateInt() + maxOutGivenTakerIn := math_utils.NewPrecDecFromInt(maxAmountTakerIn).Quo(makerReserves.MakerPrice).TruncateInt() possibleAmountsMakerOut := []math.Int{makerReserves.ReservesMakerDenom, maxOutGivenTakerIn} if maxAmountMakerOut != nil { possibleAmountsMakerOut = append(possibleAmountsMakerOut, *maxAmountMakerOut) @@ -97,10 +102,7 @@ func (p *Pool) Swap( // c) The maximum amount the user wants out (maxAmountOut1) amountMakerOut = utils.MinIntArr(possibleAmountsMakerOut) - amountTakerIn = math_utils.NewPrecDecFromInt(amountMakerOut). - Quo(makerReserves.PriceTakerToMaker). - Ceil(). - TruncateInt() + amountTakerIn = makerReserves.MakerPrice.MulInt(amountMakerOut).Ceil().TruncateInt() takerReserves.ReservesMakerDenom = takerReserves.ReservesMakerDenom.Add(amountTakerIn) makerReserves.ReservesMakerDenom = makerReserves.ReservesMakerDenom.Sub(amountMakerOut) @@ -118,34 +120,37 @@ func (p *Pool) Deposit( lowerReserve0 := &p.LowerTick0.ReservesMakerDenom upperReserve1 := &p.UpperTick1.ReservesMakerDenom - inAmount0, inAmount1 = CalcGreatestMatchingRatio( - *lowerReserve0, - *upperReserve1, - maxAmount0, - maxAmount1, - ) + centerPrice1To0 := p.MustCalcPrice1To0Center() + var depositValueAsToken0 math_utils.PrecDec + autoswapFee := math_utils.ZeroPrecDec() - if inAmount0.Equal(math.ZeroInt()) && inAmount1.Equal(math.ZeroInt()) { - return math.ZeroInt(), math.ZeroInt(), sdk.Coin{Denom: p.GetPoolDenom()} - } + if !autoswap { + inAmount0, inAmount1 = CalcGreatestMatchingRatio( + *lowerReserve0, + *upperReserve1, + maxAmount0, + maxAmount1, + ) + depositValueAsToken0 = CalcAmountAsToken0(inAmount0, inAmount1, centerPrice1To0) - outShares = p.CalcSharesMinted(inAmount0, inAmount1, existingShares) - - if autoswap { - residualAmount0 := maxAmount0.Sub(inAmount0) - residualAmount1 := maxAmount1.Sub(inAmount1) + } else { + residualAmount0, residualAmount1 := CalcAutoswapAmount( + *lowerReserve0, *upperReserve1, + maxAmount0, maxAmount1, + centerPrice1To0, + ) - // NOTE: Currently not doing anything with the error, - // but added error handling to all of the new functions for autoswap. - // Open to changing it however. - residualShares, _ := p.CalcResidualSharesMinted(residualAmount0, residualAmount1) + residualDepositValueAsToken0 := CalcAmountAsToken0(residualAmount0, residualAmount1, centerPrice1To0) + autoswapFee = p.CalcAutoswapFee(residualDepositValueAsToken0) - outShares = outShares.Add(residualShares) + fullDepositValueAsToken0 := CalcAmountAsToken0(maxAmount0, maxAmount1, centerPrice1To0) + depositValueAsToken0 = fullDepositValueAsToken0.Sub(autoswapFee) inAmount0 = maxAmount0 inAmount1 = maxAmount1 } + outShares = p.CalcSharesMinted(depositValueAsToken0, existingShares, autoswapFee) *lowerReserve0 = lowerReserve0.Add(inAmount0) *upperReserve1 = upperReserve1.Add(inAmount1) @@ -158,61 +163,44 @@ func (p *Pool) GetPoolDenom() string { func (p *Pool) Price(tradePairID *TradePairID) math_utils.PrecDec { if tradePairID.IsTakerDenomToken0() { - return p.UpperTick1.PriceTakerToMaker + return p.UpperTick1.MakerPrice } - return p.LowerTick0.PriceTakerToMaker + return p.LowerTick0.MakerPrice } func (p *Pool) MustCalcPrice1To0Center() math_utils.PrecDec { // NOTE: We can safely call the error-less version of CalcPrice here because the pool object // has already been initialized with an upper and lower tick which satisfy a check for IsTickOutOfRange - return MustCalcPrice(-1 * p.CenterTickIndex()) + return MustCalcPrice(-1 * p.CenterTickIndexToken1()) } func (p *Pool) CalcSharesMinted( - amount0 math.Int, - amount1 math.Int, + depositValueAsToken0 math_utils.PrecDec, existingShares math.Int, + autoswapFee math_utils.PrecDec, ) (sharesMinted sdk.Coin) { price1To0Center := p.MustCalcPrice1To0Center() - valueMintedToken0 := CalcAmountAsToken0(amount0, amount1, price1To0Center) valueExistingToken0 := CalcAmountAsToken0( p.LowerTick0.ReservesMakerDenom, p.UpperTick1.ReservesMakerDenom, price1To0Center, ) + + totalValueWithAutoswapFeeToken0 := valueExistingToken0.Add(autoswapFee) var sharesMintedAmount math.Int if valueExistingToken0.GT(math_utils.ZeroPrecDec()) { - sharesMintedAmount = valueMintedToken0.MulInt(existingShares). - Quo(valueExistingToken0). + sharesMintedAmount = depositValueAsToken0.MulInt(existingShares). + Quo(totalValueWithAutoswapFeeToken0). TruncateInt() } else { - sharesMintedAmount = valueMintedToken0.TruncateInt() + sharesMintedAmount = depositValueAsToken0.TruncateInt() } return sdk.Coin{Denom: p.GetPoolDenom(), Amount: sharesMintedAmount} } -func (p *Pool) CalcResidualSharesMinted( - residualAmount0 math.Int, - residualAmount1 math.Int, -) (sharesMinted sdk.Coin, err error) { - fee := CalcFee(p.UpperTick1.Key.TickIndexTakerToMaker, p.LowerTick0.Key.TickIndexTakerToMaker) - valueMintedToken0, err := CalcResidualValue( - residualAmount0, - residualAmount1, - p.LowerTick0.PriceTakerToMaker, - fee, - ) - if err != nil { - return sdk.Coin{Denom: p.GetPoolDenom()}, err - } - - return sdk.Coin{Denom: p.GetPoolDenom(), Amount: valueMintedToken0.TruncateInt()}, nil -} - func (p *Pool) RedeemValue(sharesToRemove, totalShares math.Int) (outAmount0, outAmount1 math.Int) { reserves0 := &p.LowerTick0.ReservesMakerDenom reserves1 := &p.UpperTick1.ReservesMakerDenom @@ -238,7 +226,7 @@ func (p *Pool) Withdraw(sharesToRemove, totalShares math.Int) (outAmount0, outAm return outAmount0, outAmount1 } -// Balance trueAmount1 to the pool ratio +// Balance deposit amounts to match the existing ratio in the pool. If pool is empty allow any ratio. func CalcGreatestMatchingRatio( targetAmount0 math.Int, targetAmount1 math.Int, @@ -267,26 +255,53 @@ func CalcGreatestMatchingRatio( return resultAmount0, resultAmount1 } -func CalcResidualValue( - amount0, amount1 math.Int, - priceLowerTakerToMaker math_utils.PrecDec, - fee int64, -) (math_utils.PrecDec, error) { - // ResidualValue = Amount0 * (Price1to0Center / Price1to0Upper) + Amount1 * Price1to0Lower - amount0Discount, err := CalcPrice(-fee) - if err != nil { - return math_utils.ZeroPrecDec(), err +// CalcAutoswapAmount calculates the smallest swap to match the current pool ratio. +// see: https://www.notion.so/Autoswap-Spec-ca5f35a4cd5b4dbf9ae27e0454ddd445?pvs=4#12032ea59b0e802c925efae10c3ca85f +func CalcAutoswapAmount( + reserves0, + reserves1, + depositAmount0, + depositAmount1 math.Int, + price1To0 math_utils.PrecDec, +) (resultAmount0, resultAmount1 math.Int) { + if reserves0.IsZero() && reserves1.IsZero() { + // The pool is empty, any deposit amount is allowed. Nothing to be swapped + return math.ZeroInt(), math.ZeroInt() } - return amount0Discount.MulInt(amount0).Add(priceLowerTakerToMaker.MulInt(amount1)), nil + reserves0Dec := math_utils.NewPrecDecFromInt(reserves0) + reserves1Dec := math_utils.NewPrecDecFromInt(reserves1) + // swapAmount = (reserves0*depositAmount1 - reserves1*depositAmount0) / (price * reserves1 + reserves0) + swapAmount := reserves0Dec.MulInt(depositAmount1).Sub(reserves1Dec.MulInt(depositAmount0)). + Quo(reserves0Dec.Add(reserves1Dec.Quo(price1To0))) + + switch { + case swapAmount.IsZero(): // nothing to be swapped + return math.ZeroInt(), math.ZeroInt() + + case swapAmount.IsPositive(): // Token1 needs to be swapped + return math.ZeroInt(), swapAmount.Ceil().TruncateInt() + + default: // Token0 needs to be swapped + amountSwappedAs1 := swapAmount.Neg() + + amountSwapped0 := amountSwappedAs1.Quo(price1To0) + return amountSwapped0.Ceil().TruncateInt(), math.ZeroInt() + } } -func CalcFee(upperTickIndex, lowerTickIndex int64) int64 { - return (upperTickIndex - lowerTickIndex) / 2 +func (p *Pool) CalcAutoswapFee(depositValueAsToken0 math_utils.PrecDec) math_utils.PrecDec { + feeInt64 := utils.MustSafeUint64ToInt64(p.Fee()) + feeAsPrice := MustCalcPrice(-feeInt64) + autoSwapFee := math_utils.OnePrecDec().Sub(feeAsPrice) + + // fee = depositValueAsToken0 * (1 - p(fee) ) + return autoSwapFee.Mul(depositValueAsToken0) } func CalcAmountAsToken0(amount0, amount1 math.Int, price1To0 math_utils.PrecDec) math_utils.PrecDec { amount0Dec := math_utils.NewPrecDecFromInt(amount0) + amount1Dec := math_utils.NewPrecDecFromInt(amount1) - return amount0Dec.Add(price1To0.MulInt(amount1)) + return amount0Dec.Add(amount1Dec.Quo(price1To0)) } diff --git a/x/dex/types/pool.pb.go b/x/dex/types/pool.pb.go index 7468d843b..b80290012 100644 --- a/x/dex/types/pool.pb.go +++ b/x/dex/types/pool.pb.go @@ -103,9 +103,9 @@ var fileDescriptor_6ad7a9165eac1fde = []byte{ 0x26, 0xa8, 0x17, 0xac, 0x1a, 0xa4, 0xd7, 0xd0, 0xc9, 0xfd, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x74, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, - 0xa1, 0x46, 0xe9, 0xe6, 0x17, 0xa5, 0xc3, 0xd8, 0xfa, 0x65, 0x26, 0xfa, 0x15, 0x60, 0x7f, 0x96, - 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x3d, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xa3, - 0xc3, 0x63, 0x5c, 0x3e, 0x01, 0x00, 0x00, + 0xa1, 0x46, 0xe9, 0xe6, 0x17, 0xa5, 0xc3, 0xd8, 0xfa, 0x65, 0xa6, 0xfa, 0x15, 0x60, 0x7f, 0x96, + 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x3d, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x3d, + 0x40, 0xb9, 0xc3, 0x3e, 0x01, 0x00, 0x00, } func (m *Pool) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/types/pool_denom_test.go b/x/dex/types/pool_denom_test.go index 713e5f42e..fc511a8b8 100644 --- a/x/dex/types/pool_denom_test.go +++ b/x/dex/types/pool_denom_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestValidatePoolDenom(t *testing.T) { diff --git a/x/dex/types/pool_liquidity.go b/x/dex/types/pool_liquidity.go index 9310826f3..1e3ddc253 100644 --- a/x/dex/types/pool_liquidity.go +++ b/x/dex/types/pool_liquidity.go @@ -3,7 +3,7 @@ package types import ( "cosmossdk.io/math" - math_utils "github.com/neutron-org/neutron/v4/utils/math" + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) type PoolLiquidity struct { diff --git a/x/dex/types/pool_metadata.pb.go b/x/dex/types/pool_metadata.pb.go index 47c15c2ae..cc8b75705 100644 --- a/x/dex/types/pool_metadata.pb.go +++ b/x/dex/types/pool_metadata.pb.go @@ -110,9 +110,9 @@ var fileDescriptor_c2ee8eaeac9c06d8 = []byte{ 0x09, 0x62, 0x03, 0xa9, 0xf1, 0x4c, 0x71, 0x72, 0x3f, 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, 0xdd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, - 0x01, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0x89, 0x7e, 0x05, 0xd8, 0x13, 0x25, 0x95, - 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x3f, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x55, - 0x5b, 0x6e, 0x0e, 0x01, 0x00, 0x00, + 0x01, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0xa9, 0x7e, 0x05, 0xd8, 0x13, 0x25, 0x95, + 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x3f, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x4e, 0xd6, + 0x81, 0xf1, 0x0e, 0x01, 0x00, 0x00, } func (m *PoolMetadata) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/types/pool_reserves.go b/x/dex/types/pool_reserves.go index d4f29eff6..7e924ddfe 100644 --- a/x/dex/types/pool_reserves.go +++ b/x/dex/types/pool_reserves.go @@ -2,6 +2,8 @@ package types import ( "cosmossdk.io/math" + + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) func (p PoolReserves) HasToken() bool { @@ -12,10 +14,13 @@ func NewPoolReservesFromCounterpart( counterpart *PoolReserves, ) *PoolReserves { thisID := counterpart.Key.Counterpart() + // Pool tickIndex has already been validated so this will never throw + makerPrice := MustCalcPrice(thisID.TickIndexTakerToMaker) return &PoolReserves{ Key: thisID, ReservesMakerDenom: math.ZeroInt(), - PriceTakerToMaker: counterpart.PriceOppositeTakerToMaker, + MakerPrice: makerPrice, + PriceTakerToMaker: math_utils.OnePrecDec().Quo(makerPrice), PriceOppositeTakerToMaker: counterpart.PriceTakerToMaker, } } @@ -23,7 +28,7 @@ func NewPoolReservesFromCounterpart( func NewPoolReserves( poolReservesID *PoolReservesKey, ) (*PoolReserves, error) { - priceTakerToMaker, err := poolReservesID.PriceTakerToMaker() + makerPrice, err := poolReservesID.Price() if err != nil { return nil, err } @@ -36,7 +41,8 @@ func NewPoolReserves( return &PoolReserves{ Key: poolReservesID, ReservesMakerDenom: math.ZeroInt(), - PriceTakerToMaker: priceTakerToMaker, + MakerPrice: makerPrice, + PriceTakerToMaker: math_utils.OnePrecDec().Quo(makerPrice), PriceOppositeTakerToMaker: priceOppositeTakerToMaker, }, nil } diff --git a/x/dex/types/pool_reserves.pb.go b/x/dex/types/pool_reserves.pb.go index 10e0f6d50..12ae8621c 100644 --- a/x/dex/types/pool_reserves.pb.go +++ b/x/dex/types/pool_reserves.pb.go @@ -8,7 +8,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + github_com_neutron_org_neutron_v5_utils_math "github.com/neutron-org/neutron/v5/utils/math" io "io" math "math" math_bits "math/bits" @@ -86,10 +86,15 @@ func (m *PoolReservesKey) GetFee() uint64 { } type PoolReserves struct { - Key *PoolReservesKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - ReservesMakerDenom cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=reserves_maker_denom,json=reservesMakerDenom,proto3,customtype=cosmossdk.io/math.Int" json:"reserves_maker_denom" yaml:"reserves_maker_denom"` - PriceTakerToMaker github_com_neutron_org_neutron_v4_utils_math.PrecDec `protobuf:"bytes,3,opt,name=price_taker_to_maker,json=priceTakerToMaker,proto3,customtype=github.com/neutron-org/neutron/v4/utils/math.PrecDec" json:"price_taker_to_maker" yaml:"price_taker_to_maker"` - PriceOppositeTakerToMaker github_com_neutron_org_neutron_v4_utils_math.PrecDec `protobuf:"bytes,4,opt,name=price_opposite_taker_to_maker,json=priceOppositeTakerToMaker,proto3,customtype=github.com/neutron-org/neutron/v4/utils/math.PrecDec" json:"price_opposite_taker_to_maker" yaml:"price_opposite_taker_to_maker"` + Key *PoolReservesKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + ReservesMakerDenom cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=reserves_maker_denom,json=reservesMakerDenom,proto3,customtype=cosmossdk.io/math.Int" json:"reserves_maker_denom" yaml:"reserves_maker_denom"` + // DEPRECATED: price_taker_to_maker will be removed in future release, `maker_price` should always be used. + PriceTakerToMaker github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,3,opt,name=price_taker_to_maker,json=priceTakerToMaker,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"price_taker_to_maker" yaml:"price_taker_to_maker"` // Deprecated: Do not use. + // DEPRECATED: price_opposite_taker_maker was an internal implementation detail and will be removed in a future release. + // It is being kept strictly for backwards compatibility. The actual field value is unused. + PriceOppositeTakerToMaker github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,4,opt,name=price_opposite_taker_to_maker,json=priceOppositeTakerToMaker,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"price_opposite_taker_to_maker" yaml:"price_opposite_taker_to_maker"` // Deprecated: Do not use. + // This is the price of the PoolReserves denominated in the opposite token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + MakerPrice github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,5,opt,name=maker_price,json=makerPrice,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"maker_price" yaml:"maker_price"` } func (m *PoolReserves) Reset() { *m = PoolReserves{} } @@ -140,36 +145,38 @@ func init() { func init() { proto.RegisterFile("neutron/dex/pool_reserves.proto", fileDescriptor_f0fe9f734c7ad538) } var fileDescriptor_f0fe9f734c7ad538 = []byte{ - // 463 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x41, 0x8b, 0xd3, 0x40, - 0x14, 0xc7, 0x3b, 0xa6, 0x08, 0x4e, 0x15, 0x35, 0x74, 0xa1, 0xbb, 0x6a, 0x52, 0x82, 0x87, 0x5e, - 0x36, 0x01, 0xdd, 0x83, 0x88, 0xa7, 0xa5, 0x20, 0x45, 0xc4, 0x12, 0x7a, 0xf2, 0x12, 0xb2, 0x99, - 0x67, 0x77, 0x68, 0x93, 0x17, 0x66, 0xa6, 0x4b, 0xfb, 0x01, 0xf4, 0xec, 0xdd, 0xab, 0x5f, 0xc2, - 0x6f, 0xd0, 0xe3, 0x1e, 0xc5, 0x43, 0x90, 0xf6, 0xe6, 0x71, 0x3f, 0x81, 0xcc, 0x24, 0xd5, 0xb6, - 0x46, 0x3d, 0xec, 0x29, 0x2f, 0xff, 0xff, 0x3f, 0x6f, 0x7e, 0x6f, 0xc2, 0xa3, 0x6e, 0x06, 0x33, - 0x25, 0x30, 0x0b, 0x18, 0xcc, 0x83, 0x1c, 0x71, 0x1a, 0x09, 0x90, 0x20, 0x2e, 0x40, 0xfa, 0xb9, - 0x40, 0x85, 0x76, 0xab, 0x0a, 0xf8, 0x0c, 0xe6, 0x47, 0xed, 0x31, 0x8e, 0xd1, 0xe8, 0x81, 0xae, - 0xca, 0xc8, 0xd1, 0x4e, 0x0f, 0x25, 0x62, 0x06, 0x51, 0x1e, 0x73, 0x11, 0x71, 0x56, 0x06, 0xbc, - 0x4f, 0x84, 0xde, 0x1d, 0x22, 0x4e, 0xc3, 0xaa, 0xf5, 0x2b, 0x58, 0xd8, 0x2f, 0xe8, 0x9d, 0x9d, - 0x68, 0x87, 0x74, 0x49, 0xaf, 0xf5, 0xa4, 0xe3, 0x6f, 0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x4b, 0xc6, 0xa1, 0x80, 0xa4, 0x0f, 0x89, 0xe6, 0xac, 0xeb, 0xfd, 0x9b, 0xb3, 0xce, 0xf5, 0xc2, - 0xfb, 0x46, 0xde, 0xf9, 0x05, 0x4b, 0x42, 0x1f, 0x95, 0x61, 0xcc, 0x73, 0x94, 0x5c, 0xfd, 0xc1, - 0xdb, 0x34, 0xbc, 0xef, 0xc9, 0x35, 0x81, 0xff, 0x7d, 0xca, 0x55, 0xe1, 0x3e, 0xde, 0x26, 0xff, - 0x4b, 0xcc, 0x0b, 0x0f, 0x8d, 0xff, 0xa6, 0xb2, 0xb7, 0x47, 0x39, 0x7d, 0xb9, 0x5c, 0x39, 0xe4, - 0x72, 0xe5, 0x90, 0xef, 0x2b, 0x87, 0x7c, 0x5c, 0x3b, 0x8d, 0xcb, 0xb5, 0xd3, 0xf8, 0xba, 0x76, - 0x1a, 0x6f, 0x8f, 0xff, 0xcf, 0x3c, 0x2f, 0x17, 0x66, 0x91, 0x83, 0x3c, 0xbb, 0x69, 0x36, 0xe5, - 0xe9, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x64, 0x59, 0x2e, 0x90, 0x03, 0x00, 0x00, + // 494 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0x8b, 0xd3, 0x40, + 0x14, 0xc0, 0x3b, 0x66, 0x57, 0x70, 0xaa, 0xa8, 0x43, 0x17, 0xb2, 0xab, 0x26, 0x25, 0x78, 0xe8, + 0x65, 0x13, 0xf0, 0x0f, 0x88, 0x78, 0x5a, 0x0a, 0x52, 0x44, 0x2c, 0xa1, 0x27, 0x2f, 0x21, 0x9b, + 0x3c, 0xbb, 0x43, 0x9b, 0xbc, 0x30, 0x99, 0x2e, 0xed, 0xd5, 0x83, 0x5e, 0xbd, 0x7b, 0xf7, 0x83, + 0x78, 0x5a, 0x3c, 0xed, 0x51, 0x3c, 0x04, 0x69, 0x6f, 0x1e, 0xfb, 0x09, 0x64, 0x26, 0xa9, 0x26, + 0x6b, 0xd5, 0xc3, 0x9e, 0xf2, 0xe6, 0xbd, 0x5f, 0xde, 0xfc, 0xde, 0x0c, 0x43, 0xed, 0x14, 0x66, + 0x52, 0x60, 0xea, 0xc5, 0x30, 0xf7, 0x32, 0xc4, 0x69, 0x20, 0x20, 0x07, 0x71, 0x0a, 0xb9, 0x9b, + 0x09, 0x94, 0xc8, 0xda, 0x15, 0xe0, 0xc6, 0x30, 0x3f, 0xe8, 0x8c, 0x71, 0x8c, 0x3a, 0xef, 0xa9, + 0xa8, 0x44, 0x0e, 0x1a, 0x3d, 0xa4, 0x08, 0x63, 0x08, 0xb2, 0x90, 0x8b, 0x80, 0xc7, 0x25, 0xe0, + 0x7c, 0x24, 0xf4, 0xe6, 0x10, 0x71, 0xea, 0x57, 0xad, 0x5f, 0xc0, 0x82, 0x3d, 0xa3, 0x37, 0x1a, + 0xa8, 0x49, 0xba, 0xa4, 0xd7, 0x7e, 0x60, 0xba, 0xb5, 0xfd, 0xdc, 0x91, 0x22, 0x86, 0x21, 0x17, + 0x83, 0xbe, 0xdf, 0x96, 0xbf, 0x16, 0x31, 0x7b, 0x42, 0xf7, 0x25, 0x8f, 0x26, 0x01, 0x4f, 0x63, + 0x98, 0x07, 0x32, 0x9c, 0x80, 0x08, 0x24, 0x06, 0x89, 0x0a, 0xcc, 0x2b, 0x5d, 0xd2, 0x33, 0xfc, + 0x3d, 0x05, 0x0c, 0x54, 0x7d, 0xa4, 0xb2, 0x23, 0x7c, 0xa9, 0x3e, 0xec, 0x16, 0x35, 0xde, 0x00, + 0x98, 0x46, 0x97, 0xf4, 0x76, 0x7c, 0x15, 0x3a, 0x9f, 0x77, 0xe9, 0xf5, 0xba, 0x1d, 0x73, 0xa9, + 0x31, 0x81, 0x45, 0x25, 0x74, 0xb7, 0x21, 0x74, 0x61, 0x0a, 0x5f, 0x81, 0xec, 0x1d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0x49, 0xc7, 0xa7, 0x7a, 0x35, 0x54, 0x8b, 0xa3, 0xe7, 0x67, 0x4b, 0x8b, 0x9c, 0x2f, + 0x2d, 0xf2, 0x7d, 0x69, 0x91, 0x0f, 0x2b, 0xab, 0x75, 0xbe, 0xb2, 0x5a, 0x5f, 0x57, 0x56, 0xeb, + 0xf5, 0xe1, 0xff, 0x05, 0xe6, 0xe5, 0xcb, 0x5d, 0x64, 0x90, 0x1f, 0x5f, 0xd5, 0x4f, 0xf6, 0xe1, + 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x9f, 0x7e, 0x24, 0x19, 0x04, 0x00, 0x00, } func (m *PoolReservesKey) Marshal() (dAtA []byte, err error) { @@ -237,6 +244,16 @@ func (m *PoolReserves) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.MakerPrice.Size() + i -= size + if _, err := m.MakerPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintPoolReserves(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a { size := m.PriceOppositeTakerToMaker.Size() i -= size @@ -328,6 +345,8 @@ func (m *PoolReserves) Size() (n int) { n += 1 + l + sovPoolReserves(uint64(l)) l = m.PriceOppositeTakerToMaker.Size() n += 1 + l + sovPoolReserves(uint64(l)) + l = m.MakerPrice.Size() + n += 1 + l + sovPoolReserves(uint64(l)) return n } @@ -628,6 +647,40 @@ func (m *PoolReserves) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MakerPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPoolReserves + } + 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 ErrInvalidLengthPoolReserves + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPoolReserves + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MakerPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPoolReserves(dAtA[iNdEx:]) diff --git a/x/dex/types/pool_reserves_key.go b/x/dex/types/pool_reserves_key.go index b331b6dd4..aabbb2c97 100644 --- a/x/dex/types/pool_reserves_key.go +++ b/x/dex/types/pool_reserves_key.go @@ -3,8 +3,8 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/utils" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) var _ TickLiquidityKey = (*PoolReservesKey)(nil) @@ -44,14 +44,18 @@ func (p PoolReservesKey) Counterpart() *PoolReservesKey { } } -func (p PoolReservesKey) PriceTakerToMaker() (priceTakerToMaker math_utils.PrecDec, err error) { +func (p PoolReservesKey) Price() (priceTakerToMaker math_utils.PrecDec, err error) { return CalcPrice(p.TickIndexTakerToMaker) } -func (p PoolReservesKey) MustPriceTakerToMaker() (priceTakerToMaker math_utils.PrecDec) { - price, err := p.PriceTakerToMaker() +func (p PoolReservesKey) MustPrice() (priceTakerToMaker math_utils.PrecDec) { + price, err := p.Price() if err != nil { panic(err) } return price } + +func (p PoolReservesKey) PriceTakerToMaker() (priceTakerToMaker math_utils.PrecDec, err error) { + return CalcPrice(-p.TickIndexTakerToMaker) +} diff --git a/x/dex/types/pool_test.go b/x/dex/types/pool_test.go index 6e339d212..77ed9e083 100644 --- a/x/dex/types/pool_test.go +++ b/x/dex/types/pool_test.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" "github.com/stretchr/testify/assert" - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" + dextypes "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestCalcGreatestMatchingRatioBothReservesNonZero(t *testing.T) { diff --git a/x/dex/types/precomputed_prices.gob b/x/dex/types/precomputed_prices.gob index fa2bbfad0..706e8e790 100644 Binary files a/x/dex/types/precomputed_prices.gob and b/x/dex/types/precomputed_prices.gob differ diff --git a/x/dex/types/price.go b/x/dex/types/price.go index 72686a6a1..3d553f420 100644 --- a/x/dex/types/price.go +++ b/x/dex/types/price.go @@ -9,8 +9,8 @@ import ( "cosmossdk.io/errors" "cosmossdk.io/math" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/utils" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) const ( @@ -54,21 +54,21 @@ func loadPrecomputedPricesFromFile() error { } // Calculates the price for a swap from token 0 to token 1 given a relative tick -// tickIndex refers to the index of a specified tick such that x * 1.0001 ^(-1 * t) = y +// tickIndex refers to the index of a specified tick such that x * 1.0001 ^(1 * t) = y // Lower ticks offer better prices. func CalcPrice(relativeTickIndex int64) (math_utils.PrecDec, error) { if IsTickOutOfRange(relativeTickIndex) { return math_utils.ZeroPrecDec(), ErrTickOutsideRange } if relativeTickIndex < 0 { - return utils.BasePrice().Power(uint64(-1 * relativeTickIndex)), nil + return math_utils.OnePrecDec().Quo(PrecomputedPrices[-relativeTickIndex]), nil } // else - return math_utils.OnePrecDec().Quo(utils.BasePrice().Power(uint64(relativeTickIndex))), nil + return PrecomputedPrices[relativeTickIndex], nil } func BinarySearchPriceToTick(price math_utils.PrecDec) uint64 { - if price.GT(math_utils.OnePrecDec()) { + if price.LT(math_utils.OnePrecDec()) { panic("Can only lookup prices <= 1") } var left uint64 // = 0 @@ -80,9 +80,9 @@ func BinarySearchPriceToTick(price math_utils.PrecDec) uint64 { case PrecomputedPrices[mid].Equal(price): return mid case PrecomputedPrices[mid].LT(price): - right = mid - 1 - default: left = mid + 1 + default: + right = mid - 1 } } @@ -96,8 +96,8 @@ func CalcTickIndexFromPrice(price math_utils.PrecDec) (int64, error) { return 0, ErrPriceOutsideRange } - if price.GT(math_utils.OnePrecDec()) { - // We only have a lookup table for prices <= 1 + if price.LT(math_utils.OnePrecDec()) { + // We only have a lookup table for prices >= 1 // So we invert the price for the lookup invPrice := math_utils.OnePrecDec().Quo(price) tick := BinarySearchPriceToTick(invPrice) @@ -141,20 +141,21 @@ func ValidateTickFee(tick int64, fee uint64) error { } func ValidateFairOutput(amountIn math.Int, price math_utils.PrecDec) error { - amountOut := price.MulInt(amountIn) + amountOut := math_utils.NewPrecDecFromInt(amountIn).Quo(price) if amountOut.LT(math_utils.OnePrecDec()) { return errors.Wrapf(ErrTradeTooSmall, "True output for %v tokens at price %v is %v", amountIn, price, amountOut) } return nil } -// Used for generating the precomputedPrice.gob file +// // Used for generating the precomputedPrice.gob file +// const PrecomputedPricesFile = "../types/precomputed_prices.gob" // func generatePrecomputedPrices() []math_utils.PrecDec { // precomputedPowers := make([]math_utils.PrecDec, MaxTickExp+1) // precomputedPowers[0] = math_utils.OnePrecDec() // 1.0001^0 = 1 // for i := 1; i <= int(MaxTickExp); i++ { -// precomputedPowers[i] = precomputedPowers[i-1].Quo(utils.BasePrice()) +// precomputedPowers[i] = precomputedPowers[i-1].Mul(utils.BasePrice()) // } // return precomputedPowers // } diff --git a/x/dex/types/price_test.go b/x/dex/types/price_test.go index 63145bf72..86b1c9c32 100644 --- a/x/dex/types/price_test.go +++ b/x/dex/types/price_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestCalcTickIndexFromPrice(t *testing.T) { diff --git a/x/dex/types/query.pb.go b/x/dex/types/query.pb.go index 9450a4a07..9bb947c6f 100644 --- a/x/dex/types/query.pb.go +++ b/x/dex/types/query.pb.go @@ -14,7 +14,7 @@ import ( grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + github_com_neutron_org_neutron_v5_utils_math "github.com/neutron-org/neutron/v5/utils/math" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -1327,11 +1327,12 @@ func (m *QueryGetPoolReservesResponse) GetPoolReserves() *PoolReserves { } type QueryEstimateMultiHopSwapRequest struct { + // DEPRECATED: Use QuerySimulateMultiHopSwap Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` Routes []*MultiHopRoute `protobuf:"bytes,3,rep,name=routes,proto3" json:"routes,omitempty"` AmountIn cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=amount_in,json=amountIn,proto3,customtype=cosmossdk.io/math.Int" json:"amount_in" yaml:"amount_in"` - ExitLimitPrice github_com_neutron_org_neutron_v4_utils_math.PrecDec `protobuf:"bytes,5,opt,name=exit_limit_price,json=exitLimitPrice,proto3,customtype=github.com/neutron-org/neutron/v4/utils/math.PrecDec" json:"exit_limit_price" yaml:"exit_limit_price"` + ExitLimitPrice github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,5,opt,name=exit_limit_price,json=exitLimitPrice,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"exit_limit_price" yaml:"exit_limit_price"` // If pickBestRoute == true then all routes are run and the route with the // best price is chosen otherwise, the first succesful route is used. PickBestRoute bool `protobuf:"varint,6,opt,name=pick_best_route,json=pickBestRoute,proto3" json:"pick_best_route,omitempty"` @@ -1436,6 +1437,7 @@ func (m *QueryEstimateMultiHopSwapResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryEstimateMultiHopSwapResponse proto.InternalMessageInfo type QueryEstimatePlaceLimitOrderRequest struct { + // DEPRECATED: Use QuerySimulatePlaceLimitOrder Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` TokenIn string `protobuf:"bytes,3,opt,name=token_in,json=tokenIn,proto3" json:"token_in,omitempty"` @@ -1909,1395 +1911,1731 @@ func (m *QueryAllPoolMetadataResponse) GetPagination() *query.PageResponse { return nil } -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "neutron.dex.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "neutron.dex.QueryParamsResponse") - proto.RegisterType((*QueryGetLimitOrderTrancheUserRequest)(nil), "neutron.dex.QueryGetLimitOrderTrancheUserRequest") - proto.RegisterType((*QueryGetLimitOrderTrancheUserResponse)(nil), "neutron.dex.QueryGetLimitOrderTrancheUserResponse") - proto.RegisterType((*QueryAllLimitOrderTrancheUserRequest)(nil), "neutron.dex.QueryAllLimitOrderTrancheUserRequest") - proto.RegisterType((*QueryAllLimitOrderTrancheUserResponse)(nil), "neutron.dex.QueryAllLimitOrderTrancheUserResponse") - proto.RegisterType((*QueryGetLimitOrderTrancheRequest)(nil), "neutron.dex.QueryGetLimitOrderTrancheRequest") - proto.RegisterType((*QueryGetLimitOrderTrancheResponse)(nil), "neutron.dex.QueryGetLimitOrderTrancheResponse") - proto.RegisterType((*QueryAllLimitOrderTrancheRequest)(nil), "neutron.dex.QueryAllLimitOrderTrancheRequest") - proto.RegisterType((*QueryAllLimitOrderTrancheResponse)(nil), "neutron.dex.QueryAllLimitOrderTrancheResponse") - proto.RegisterType((*QueryAllUserDepositsRequest)(nil), "neutron.dex.QueryAllUserDepositsRequest") - proto.RegisterType((*QueryAllUserDepositsResponse)(nil), "neutron.dex.QueryAllUserDepositsResponse") - proto.RegisterType((*QueryAllLimitOrderTrancheUserByAddressRequest)(nil), "neutron.dex.QueryAllLimitOrderTrancheUserByAddressRequest") - proto.RegisterType((*QueryAllLimitOrderTrancheUserByAddressResponse)(nil), "neutron.dex.QueryAllLimitOrderTrancheUserByAddressResponse") - proto.RegisterType((*QueryAllTickLiquidityRequest)(nil), "neutron.dex.QueryAllTickLiquidityRequest") - proto.RegisterType((*QueryAllTickLiquidityResponse)(nil), "neutron.dex.QueryAllTickLiquidityResponse") - proto.RegisterType((*QueryGetInactiveLimitOrderTrancheRequest)(nil), "neutron.dex.QueryGetInactiveLimitOrderTrancheRequest") - proto.RegisterType((*QueryGetInactiveLimitOrderTrancheResponse)(nil), "neutron.dex.QueryGetInactiveLimitOrderTrancheResponse") - proto.RegisterType((*QueryAllInactiveLimitOrderTrancheRequest)(nil), "neutron.dex.QueryAllInactiveLimitOrderTrancheRequest") - proto.RegisterType((*QueryAllInactiveLimitOrderTrancheResponse)(nil), "neutron.dex.QueryAllInactiveLimitOrderTrancheResponse") - proto.RegisterType((*QueryAllPoolReservesRequest)(nil), "neutron.dex.QueryAllPoolReservesRequest") - proto.RegisterType((*QueryAllPoolReservesResponse)(nil), "neutron.dex.QueryAllPoolReservesResponse") - proto.RegisterType((*QueryGetPoolReservesRequest)(nil), "neutron.dex.QueryGetPoolReservesRequest") - proto.RegisterType((*QueryGetPoolReservesResponse)(nil), "neutron.dex.QueryGetPoolReservesResponse") - proto.RegisterType((*QueryEstimateMultiHopSwapRequest)(nil), "neutron.dex.QueryEstimateMultiHopSwapRequest") - proto.RegisterType((*QueryEstimateMultiHopSwapResponse)(nil), "neutron.dex.QueryEstimateMultiHopSwapResponse") - proto.RegisterType((*QueryEstimatePlaceLimitOrderRequest)(nil), "neutron.dex.QueryEstimatePlaceLimitOrderRequest") - proto.RegisterType((*QueryEstimatePlaceLimitOrderResponse)(nil), "neutron.dex.QueryEstimatePlaceLimitOrderResponse") - proto.RegisterType((*QueryPoolRequest)(nil), "neutron.dex.QueryPoolRequest") - proto.RegisterType((*QueryPoolByIDRequest)(nil), "neutron.dex.QueryPoolByIDRequest") - proto.RegisterType((*QueryPoolResponse)(nil), "neutron.dex.QueryPoolResponse") - proto.RegisterType((*QueryGetPoolMetadataRequest)(nil), "neutron.dex.QueryGetPoolMetadataRequest") - proto.RegisterType((*QueryGetPoolMetadataResponse)(nil), "neutron.dex.QueryGetPoolMetadataResponse") - proto.RegisterType((*QueryAllPoolMetadataRequest)(nil), "neutron.dex.QueryAllPoolMetadataRequest") - proto.RegisterType((*QueryAllPoolMetadataResponse)(nil), "neutron.dex.QueryAllPoolMetadataResponse") +type QuerySimulateDepositRequest struct { + Msg *MsgDeposit `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` } -func init() { proto.RegisterFile("neutron/dex/query.proto", fileDescriptor_b6613ea5fce61e9c) } - -var fileDescriptor_b6613ea5fce61e9c = []byte{ - // 2332 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4d, 0x6c, 0x1c, 0x49, - 0x15, 0x4e, 0x7b, 0x1c, 0xc7, 0x2e, 0x3b, 0xb1, 0x5d, 0xb6, 0x37, 0x93, 0xb1, 0xe3, 0xb1, 0x7b, - 0x37, 0xb1, 0x63, 0xf0, 0x74, 0x6c, 0x36, 0xbb, 0xab, 0x2c, 0x0b, 0x78, 0xf0, 0xae, 0x33, 0xec, - 0x46, 0x31, 0xbd, 0x66, 0x7f, 0xc2, 0x4a, 0xad, 0xf6, 0x74, 0xc5, 0x6e, 0xb9, 0xa7, 0xbb, 0xd3, - 0x5d, 0x63, 0x7b, 0x14, 0xe5, 0xb2, 0xdc, 0x10, 0x87, 0xc0, 0xf2, 0x23, 0x16, 0x69, 0x39, 0x20, - 0x0e, 0x08, 0x21, 0x40, 0x42, 0xdc, 0xb8, 0x20, 0x81, 0x56, 0x08, 0xa1, 0x95, 0xf6, 0x82, 0x40, - 0x1a, 0x50, 0xc2, 0x29, 0x5c, 0x90, 0x0f, 0x9c, 0x51, 0x55, 0xbf, 0x9e, 0xe9, 0x9e, 0xa9, 0x9e, - 0x1e, 0x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0x34, 0x7b, 0xea, 0xa3, 0x47, 0xb3, 0xa7, 0xfe, 0xfa, 0x68, 0xf6, 0xd4, 0xed, 0xe5, 0xf4, - 0xae, 0xe2, 0x61, 0x50, 0x5c, 0xd9, 0xcd, 0x7b, 0x7b, 0x80, 0xb7, 0x73, 0x3e, 0xf7, 0xbf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x80, 0xda, 0x02, 0xc7, 0x18, 0x26, 0x00, 0x00, +func (m *QuerySimulateDepositRequest) Reset() { *m = QuerySimulateDepositRequest{} } +func (m *QuerySimulateDepositRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySimulateDepositRequest) ProtoMessage() {} +func (*QuerySimulateDepositRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{35} +} +func (m *QuerySimulateDepositRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulateDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateDepositRequest.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 *QuerySimulateDepositRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateDepositRequest.Merge(m, src) +} +func (m *QuerySimulateDepositRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulateDepositRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateDepositRequest.DiscardUnknown(m) } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +var xxx_messageInfo_QuerySimulateDepositRequest proto.InternalMessageInfo -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a LimitOrderTrancheUser by index. - LimitOrderTrancheUser(ctx context.Context, in *QueryGetLimitOrderTrancheUserRequest, opts ...grpc.CallOption) (*QueryGetLimitOrderTrancheUserResponse, error) - // Queries a list of LimitOrderTranchUser items. - LimitOrderTrancheUserAll(ctx context.Context, in *QueryAllLimitOrderTrancheUserRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheUserResponse, error) - // Queries a list of LimitOrderTrancheUser items for a given address. - LimitOrderTrancheUserAllByAddress(ctx context.Context, in *QueryAllLimitOrderTrancheUserByAddressRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheUserByAddressResponse, error) - // Queries a LimitOrderTranche by index. - LimitOrderTranche(ctx context.Context, in *QueryGetLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryGetLimitOrderTrancheResponse, error) - // Queries a list of LimitOrderTranche items for a given pairID / TokenIn - // combination. - LimitOrderTrancheAll(ctx context.Context, in *QueryAllLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheResponse, error) - // Queries a list of UserDeposits items. - UserDepositsAll(ctx context.Context, in *QueryAllUserDepositsRequest, opts ...grpc.CallOption) (*QueryAllUserDepositsResponse, error) - // Queries a list of TickLiquidity items. - TickLiquidityAll(ctx context.Context, in *QueryAllTickLiquidityRequest, opts ...grpc.CallOption) (*QueryAllTickLiquidityResponse, error) - // Queries a InactiveLimitOrderTranche by index. - InactiveLimitOrderTranche(ctx context.Context, in *QueryGetInactiveLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryGetInactiveLimitOrderTrancheResponse, error) - // Queries a list of InactiveLimitOrderTranche items. - InactiveLimitOrderTrancheAll(ctx context.Context, in *QueryAllInactiveLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryAllInactiveLimitOrderTrancheResponse, error) - // Queries a list of PoolReserves items. - PoolReservesAll(ctx context.Context, in *QueryAllPoolReservesRequest, opts ...grpc.CallOption) (*QueryAllPoolReservesResponse, error) - // Queries a PoolReserve by index - PoolReserves(ctx context.Context, in *QueryGetPoolReservesRequest, opts ...grpc.CallOption) (*QueryGetPoolReservesResponse, error) - // Queries the simulated result of a multihop swap - EstimateMultiHopSwap(ctx context.Context, in *QueryEstimateMultiHopSwapRequest, opts ...grpc.CallOption) (*QueryEstimateMultiHopSwapResponse, error) - // Queries the simulated result of a PlaceLimit order - EstimatePlaceLimitOrder(ctx context.Context, in *QueryEstimatePlaceLimitOrderRequest, opts ...grpc.CallOption) (*QueryEstimatePlaceLimitOrderResponse, error) - // Queries a pool by pair, tick and fee - Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) - // Queries a pool by ID - PoolByID(ctx context.Context, in *QueryPoolByIDRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) - // Queries a PoolMetadata by ID - PoolMetadata(ctx context.Context, in *QueryGetPoolMetadataRequest, opts ...grpc.CallOption) (*QueryGetPoolMetadataResponse, error) - // Queries a list of PoolMetadata items. - PoolMetadataAll(ctx context.Context, in *QueryAllPoolMetadataRequest, opts ...grpc.CallOption) (*QueryAllPoolMetadataResponse, error) +func (m *QuerySimulateDepositRequest) GetMsg() *MsgDeposit { + if m != nil { + return m.Msg + } + return nil } -type queryClient struct { - cc grpc1.ClientConn +type QuerySimulateDepositResponse struct { + Resp *MsgDepositResponse `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` } -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} +func (m *QuerySimulateDepositResponse) Reset() { *m = QuerySimulateDepositResponse{} } +func (m *QuerySimulateDepositResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySimulateDepositResponse) ProtoMessage() {} +func (*QuerySimulateDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{36} } - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/Params", in, out, opts...) - if err != nil { - return nil, err +func (m *QuerySimulateDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulateDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateDepositResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QuerySimulateDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateDepositResponse.Merge(m, src) +} +func (m *QuerySimulateDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulateDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateDepositResponse.DiscardUnknown(m) } -func (c *queryClient) LimitOrderTrancheUser(ctx context.Context, in *QueryGetLimitOrderTrancheUserRequest, opts ...grpc.CallOption) (*QueryGetLimitOrderTrancheUserResponse, error) { - out := new(QueryGetLimitOrderTrancheUserResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTrancheUser", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QuerySimulateDepositResponse proto.InternalMessageInfo + +func (m *QuerySimulateDepositResponse) GetResp() *MsgDepositResponse { + if m != nil { + return m.Resp } - return out, nil + return nil } -func (c *queryClient) LimitOrderTrancheUserAll(ctx context.Context, in *QueryAllLimitOrderTrancheUserRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheUserResponse, error) { - out := new(QueryAllLimitOrderTrancheUserResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTrancheUserAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type QuerySimulateWithdrawalRequest struct { + Msg *MsgWithdrawal `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` } -func (c *queryClient) LimitOrderTrancheUserAllByAddress(ctx context.Context, in *QueryAllLimitOrderTrancheUserByAddressRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheUserByAddressResponse, error) { - out := new(QueryAllLimitOrderTrancheUserByAddressResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTrancheUserAllByAddress", in, out, opts...) - if err != nil { - return nil, err +func (m *QuerySimulateWithdrawalRequest) Reset() { *m = QuerySimulateWithdrawalRequest{} } +func (m *QuerySimulateWithdrawalRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySimulateWithdrawalRequest) ProtoMessage() {} +func (*QuerySimulateWithdrawalRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{37} +} +func (m *QuerySimulateWithdrawalRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulateWithdrawalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateWithdrawalRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QuerySimulateWithdrawalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateWithdrawalRequest.Merge(m, src) +} +func (m *QuerySimulateWithdrawalRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulateWithdrawalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateWithdrawalRequest.DiscardUnknown(m) } -func (c *queryClient) LimitOrderTranche(ctx context.Context, in *QueryGetLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryGetLimitOrderTrancheResponse, error) { - out := new(QueryGetLimitOrderTrancheResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTranche", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QuerySimulateWithdrawalRequest proto.InternalMessageInfo + +func (m *QuerySimulateWithdrawalRequest) GetMsg() *MsgWithdrawal { + if m != nil { + return m.Msg } - return out, nil + return nil } -func (c *queryClient) LimitOrderTrancheAll(ctx context.Context, in *QueryAllLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheResponse, error) { - out := new(QueryAllLimitOrderTrancheResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTrancheAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type QuerySimulateWithdrawalResponse struct { + Resp *MsgWithdrawalResponse `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` } -func (c *queryClient) UserDepositsAll(ctx context.Context, in *QueryAllUserDepositsRequest, opts ...grpc.CallOption) (*QueryAllUserDepositsResponse, error) { - out := new(QueryAllUserDepositsResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/UserDepositsAll", in, out, opts...) - if err != nil { - return nil, err +func (m *QuerySimulateWithdrawalResponse) Reset() { *m = QuerySimulateWithdrawalResponse{} } +func (m *QuerySimulateWithdrawalResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySimulateWithdrawalResponse) ProtoMessage() {} +func (*QuerySimulateWithdrawalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{38} +} +func (m *QuerySimulateWithdrawalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulateWithdrawalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateWithdrawalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QuerySimulateWithdrawalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateWithdrawalResponse.Merge(m, src) +} +func (m *QuerySimulateWithdrawalResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulateWithdrawalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateWithdrawalResponse.DiscardUnknown(m) } -func (c *queryClient) TickLiquidityAll(ctx context.Context, in *QueryAllTickLiquidityRequest, opts ...grpc.CallOption) (*QueryAllTickLiquidityResponse, error) { - out := new(QueryAllTickLiquidityResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/TickLiquidityAll", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QuerySimulateWithdrawalResponse proto.InternalMessageInfo + +func (m *QuerySimulateWithdrawalResponse) GetResp() *MsgWithdrawalResponse { + if m != nil { + return m.Resp } - return out, nil + return nil } -func (c *queryClient) InactiveLimitOrderTranche(ctx context.Context, in *QueryGetInactiveLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryGetInactiveLimitOrderTrancheResponse, error) { - out := new(QueryGetInactiveLimitOrderTrancheResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/InactiveLimitOrderTranche", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type QuerySimulatePlaceLimitOrderRequest struct { + Msg *MsgPlaceLimitOrder `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` } -func (c *queryClient) InactiveLimitOrderTrancheAll(ctx context.Context, in *QueryAllInactiveLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryAllInactiveLimitOrderTrancheResponse, error) { - out := new(QueryAllInactiveLimitOrderTrancheResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/InactiveLimitOrderTrancheAll", in, out, opts...) - if err != nil { - return nil, err +func (m *QuerySimulatePlaceLimitOrderRequest) Reset() { *m = QuerySimulatePlaceLimitOrderRequest{} } +func (m *QuerySimulatePlaceLimitOrderRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySimulatePlaceLimitOrderRequest) ProtoMessage() {} +func (*QuerySimulatePlaceLimitOrderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{39} +} +func (m *QuerySimulatePlaceLimitOrderRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulatePlaceLimitOrderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulatePlaceLimitOrderRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QuerySimulatePlaceLimitOrderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulatePlaceLimitOrderRequest.Merge(m, src) +} +func (m *QuerySimulatePlaceLimitOrderRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulatePlaceLimitOrderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulatePlaceLimitOrderRequest.DiscardUnknown(m) } -func (c *queryClient) PoolReservesAll(ctx context.Context, in *QueryAllPoolReservesRequest, opts ...grpc.CallOption) (*QueryAllPoolReservesResponse, error) { - out := new(QueryAllPoolReservesResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolReservesAll", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QuerySimulatePlaceLimitOrderRequest proto.InternalMessageInfo + +func (m *QuerySimulatePlaceLimitOrderRequest) GetMsg() *MsgPlaceLimitOrder { + if m != nil { + return m.Msg } - return out, nil + return nil } -func (c *queryClient) PoolReserves(ctx context.Context, in *QueryGetPoolReservesRequest, opts ...grpc.CallOption) (*QueryGetPoolReservesResponse, error) { - out := new(QueryGetPoolReservesResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolReserves", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type QuerySimulatePlaceLimitOrderResponse struct { + Resp *MsgPlaceLimitOrderResponse `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` } -func (c *queryClient) EstimateMultiHopSwap(ctx context.Context, in *QueryEstimateMultiHopSwapRequest, opts ...grpc.CallOption) (*QueryEstimateMultiHopSwapResponse, error) { - out := new(QueryEstimateMultiHopSwapResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/EstimateMultiHopSwap", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *QuerySimulatePlaceLimitOrderResponse) Reset() { *m = QuerySimulatePlaceLimitOrderResponse{} } +func (m *QuerySimulatePlaceLimitOrderResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySimulatePlaceLimitOrderResponse) ProtoMessage() {} +func (*QuerySimulatePlaceLimitOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{40} } - -func (c *queryClient) EstimatePlaceLimitOrder(ctx context.Context, in *QueryEstimatePlaceLimitOrderRequest, opts ...grpc.CallOption) (*QueryEstimatePlaceLimitOrderResponse, error) { - out := new(QueryEstimatePlaceLimitOrderResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/EstimatePlaceLimitOrder", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *QuerySimulatePlaceLimitOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -func (c *queryClient) Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) { - out := new(QueryPoolResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/Pool", in, out, opts...) - if err != nil { - return nil, err +func (m *QuerySimulatePlaceLimitOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulatePlaceLimitOrderResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QuerySimulatePlaceLimitOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulatePlaceLimitOrderResponse.Merge(m, src) +} +func (m *QuerySimulatePlaceLimitOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulatePlaceLimitOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulatePlaceLimitOrderResponse.DiscardUnknown(m) } -func (c *queryClient) PoolByID(ctx context.Context, in *QueryPoolByIDRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) { - out := new(QueryPoolResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolByID", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QuerySimulatePlaceLimitOrderResponse proto.InternalMessageInfo + +func (m *QuerySimulatePlaceLimitOrderResponse) GetResp() *MsgPlaceLimitOrderResponse { + if m != nil { + return m.Resp } - return out, nil + return nil } -func (c *queryClient) PoolMetadata(ctx context.Context, in *QueryGetPoolMetadataRequest, opts ...grpc.CallOption) (*QueryGetPoolMetadataResponse, error) { - out := new(QueryGetPoolMetadataResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolMetadata", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type QuerySimulateWithdrawFilledLimitOrderRequest struct { + Msg *MsgWithdrawFilledLimitOrder `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` } -func (c *queryClient) PoolMetadataAll(ctx context.Context, in *QueryAllPoolMetadataRequest, opts ...grpc.CallOption) (*QueryAllPoolMetadataResponse, error) { - out := new(QueryAllPoolMetadataResponse) - err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolMetadataAll", in, out, opts...) - if err != nil { - return nil, err +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) Reset() { + *m = QuerySimulateWithdrawFilledLimitOrderRequest{} +} +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) String() string { + return proto.CompactTextString(m) +} +func (*QuerySimulateWithdrawFilledLimitOrderRequest) ProtoMessage() {} +func (*QuerySimulateWithdrawFilledLimitOrderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{41} +} +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateWithdrawFilledLimitOrderRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil } - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a LimitOrderTrancheUser by index. - LimitOrderTrancheUser(context.Context, *QueryGetLimitOrderTrancheUserRequest) (*QueryGetLimitOrderTrancheUserResponse, error) - // Queries a list of LimitOrderTranchUser items. - LimitOrderTrancheUserAll(context.Context, *QueryAllLimitOrderTrancheUserRequest) (*QueryAllLimitOrderTrancheUserResponse, error) - // Queries a list of LimitOrderTrancheUser items for a given address. - LimitOrderTrancheUserAllByAddress(context.Context, *QueryAllLimitOrderTrancheUserByAddressRequest) (*QueryAllLimitOrderTrancheUserByAddressResponse, error) - // Queries a LimitOrderTranche by index. - LimitOrderTranche(context.Context, *QueryGetLimitOrderTrancheRequest) (*QueryGetLimitOrderTrancheResponse, error) - // Queries a list of LimitOrderTranche items for a given pairID / TokenIn - // combination. - LimitOrderTrancheAll(context.Context, *QueryAllLimitOrderTrancheRequest) (*QueryAllLimitOrderTrancheResponse, error) - // Queries a list of UserDeposits items. - UserDepositsAll(context.Context, *QueryAllUserDepositsRequest) (*QueryAllUserDepositsResponse, error) - // Queries a list of TickLiquidity items. - TickLiquidityAll(context.Context, *QueryAllTickLiquidityRequest) (*QueryAllTickLiquidityResponse, error) - // Queries a InactiveLimitOrderTranche by index. - InactiveLimitOrderTranche(context.Context, *QueryGetInactiveLimitOrderTrancheRequest) (*QueryGetInactiveLimitOrderTrancheResponse, error) - // Queries a list of InactiveLimitOrderTranche items. - InactiveLimitOrderTrancheAll(context.Context, *QueryAllInactiveLimitOrderTrancheRequest) (*QueryAllInactiveLimitOrderTrancheResponse, error) - // Queries a list of PoolReserves items. - PoolReservesAll(context.Context, *QueryAllPoolReservesRequest) (*QueryAllPoolReservesResponse, error) - // Queries a PoolReserve by index - PoolReserves(context.Context, *QueryGetPoolReservesRequest) (*QueryGetPoolReservesResponse, error) - // Queries the simulated result of a multihop swap - EstimateMultiHopSwap(context.Context, *QueryEstimateMultiHopSwapRequest) (*QueryEstimateMultiHopSwapResponse, error) - // Queries the simulated result of a PlaceLimit order - EstimatePlaceLimitOrder(context.Context, *QueryEstimatePlaceLimitOrderRequest) (*QueryEstimatePlaceLimitOrderResponse, error) - // Queries a pool by pair, tick and fee - Pool(context.Context, *QueryPoolRequest) (*QueryPoolResponse, error) - // Queries a pool by ID - PoolByID(context.Context, *QueryPoolByIDRequest) (*QueryPoolResponse, error) - // Queries a PoolMetadata by ID - PoolMetadata(context.Context, *QueryGetPoolMetadataRequest) (*QueryGetPoolMetadataResponse, error) - // Queries a list of PoolMetadata items. - PoolMetadataAll(context.Context, *QueryAllPoolMetadataRequest) (*QueryAllPoolMetadataResponse, error) +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateWithdrawFilledLimitOrderRequest.Merge(m, src) +} +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateWithdrawFilledLimitOrderRequest.DiscardUnknown(m) } -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { +var xxx_messageInfo_QuerySimulateWithdrawFilledLimitOrderRequest proto.InternalMessageInfo + +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) GetMsg() *MsgWithdrawFilledLimitOrder { + if m != nil { + return m.Msg + } + return nil } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +type QuerySimulateWithdrawFilledLimitOrderResponse struct { + Resp *MsgWithdrawFilledLimitOrderResponse `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` } -func (*UnimplementedQueryServer) LimitOrderTrancheUser(ctx context.Context, req *QueryGetLimitOrderTrancheUserRequest) (*QueryGetLimitOrderTrancheUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTrancheUser not implemented") + +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) Reset() { + *m = QuerySimulateWithdrawFilledLimitOrderResponse{} } -func (*UnimplementedQueryServer) LimitOrderTrancheUserAll(ctx context.Context, req *QueryAllLimitOrderTrancheUserRequest) (*QueryAllLimitOrderTrancheUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTrancheUserAll not implemented") +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) String() string { + return proto.CompactTextString(m) } -func (*UnimplementedQueryServer) LimitOrderTrancheUserAllByAddress(ctx context.Context, req *QueryAllLimitOrderTrancheUserByAddressRequest) (*QueryAllLimitOrderTrancheUserByAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTrancheUserAllByAddress not implemented") +func (*QuerySimulateWithdrawFilledLimitOrderResponse) ProtoMessage() {} +func (*QuerySimulateWithdrawFilledLimitOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{42} } -func (*UnimplementedQueryServer) LimitOrderTranche(ctx context.Context, req *QueryGetLimitOrderTrancheRequest) (*QueryGetLimitOrderTrancheResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTranche not implemented") +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedQueryServer) LimitOrderTrancheAll(ctx context.Context, req *QueryAllLimitOrderTrancheRequest) (*QueryAllLimitOrderTrancheResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTrancheAll not implemented") +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateWithdrawFilledLimitOrderResponse.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 (*UnimplementedQueryServer) UserDepositsAll(ctx context.Context, req *QueryAllUserDepositsRequest) (*QueryAllUserDepositsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserDepositsAll not implemented") +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateWithdrawFilledLimitOrderResponse.Merge(m, src) } -func (*UnimplementedQueryServer) TickLiquidityAll(ctx context.Context, req *QueryAllTickLiquidityRequest) (*QueryAllTickLiquidityResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TickLiquidityAll not implemented") +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) XXX_Size() int { + return m.Size() } -func (*UnimplementedQueryServer) InactiveLimitOrderTranche(ctx context.Context, req *QueryGetInactiveLimitOrderTrancheRequest) (*QueryGetInactiveLimitOrderTrancheResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InactiveLimitOrderTranche not implemented") +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateWithdrawFilledLimitOrderResponse.DiscardUnknown(m) } -func (*UnimplementedQueryServer) InactiveLimitOrderTrancheAll(ctx context.Context, req *QueryAllInactiveLimitOrderTrancheRequest) (*QueryAllInactiveLimitOrderTrancheResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InactiveLimitOrderTrancheAll not implemented") + +var xxx_messageInfo_QuerySimulateWithdrawFilledLimitOrderResponse proto.InternalMessageInfo + +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) GetResp() *MsgWithdrawFilledLimitOrderResponse { + if m != nil { + return m.Resp + } + return nil } -func (*UnimplementedQueryServer) PoolReservesAll(ctx context.Context, req *QueryAllPoolReservesRequest) (*QueryAllPoolReservesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolReservesAll not implemented") + +type QuerySimulateCancelLimitOrderRequest struct { + Msg *MsgCancelLimitOrder `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` } -func (*UnimplementedQueryServer) PoolReserves(ctx context.Context, req *QueryGetPoolReservesRequest) (*QueryGetPoolReservesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolReserves not implemented") + +func (m *QuerySimulateCancelLimitOrderRequest) Reset() { *m = QuerySimulateCancelLimitOrderRequest{} } +func (m *QuerySimulateCancelLimitOrderRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySimulateCancelLimitOrderRequest) ProtoMessage() {} +func (*QuerySimulateCancelLimitOrderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{43} } -func (*UnimplementedQueryServer) EstimateMultiHopSwap(ctx context.Context, req *QueryEstimateMultiHopSwapRequest) (*QueryEstimateMultiHopSwapResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EstimateMultiHopSwap not implemented") +func (m *QuerySimulateCancelLimitOrderRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedQueryServer) EstimatePlaceLimitOrder(ctx context.Context, req *QueryEstimatePlaceLimitOrderRequest) (*QueryEstimatePlaceLimitOrderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EstimatePlaceLimitOrder not implemented") +func (m *QuerySimulateCancelLimitOrderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateCancelLimitOrderRequest.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 (*UnimplementedQueryServer) Pool(ctx context.Context, req *QueryPoolRequest) (*QueryPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Pool not implemented") +func (m *QuerySimulateCancelLimitOrderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateCancelLimitOrderRequest.Merge(m, src) } -func (*UnimplementedQueryServer) PoolByID(ctx context.Context, req *QueryPoolByIDRequest) (*QueryPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolByID not implemented") +func (m *QuerySimulateCancelLimitOrderRequest) XXX_Size() int { + return m.Size() } -func (*UnimplementedQueryServer) PoolMetadata(ctx context.Context, req *QueryGetPoolMetadataRequest) (*QueryGetPoolMetadataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolMetadata not implemented") +func (m *QuerySimulateCancelLimitOrderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateCancelLimitOrderRequest.DiscardUnknown(m) } -func (*UnimplementedQueryServer) PoolMetadataAll(ctx context.Context, req *QueryAllPoolMetadataRequest) (*QueryAllPoolMetadataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolMetadataAll not implemented") + +var xxx_messageInfo_QuerySimulateCancelLimitOrderRequest proto.InternalMessageInfo + +func (m *QuerySimulateCancelLimitOrderRequest) GetMsg() *MsgCancelLimitOrder { + if m != nil { + return m.Msg + } + return nil } -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) +type QuerySimulateCancelLimitOrderResponse struct { + Resp *MsgCancelLimitOrderResponse `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) +func (m *QuerySimulateCancelLimitOrderResponse) Reset() { *m = QuerySimulateCancelLimitOrderResponse{} } +func (m *QuerySimulateCancelLimitOrderResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySimulateCancelLimitOrderResponse) ProtoMessage() {} +func (*QuerySimulateCancelLimitOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{44} +} +func (m *QuerySimulateCancelLimitOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulateCancelLimitOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateCancelLimitOrderResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QuerySimulateCancelLimitOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateCancelLimitOrderResponse.Merge(m, src) +} +func (m *QuerySimulateCancelLimitOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulateCancelLimitOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateCancelLimitOrderResponse.DiscardUnknown(m) } -func _Query_LimitOrderTrancheUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetLimitOrderTrancheUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LimitOrderTrancheUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/LimitOrderTrancheUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LimitOrderTrancheUser(ctx, req.(*QueryGetLimitOrderTrancheUserRequest)) +var xxx_messageInfo_QuerySimulateCancelLimitOrderResponse proto.InternalMessageInfo + +func (m *QuerySimulateCancelLimitOrderResponse) GetResp() *MsgCancelLimitOrderResponse { + if m != nil { + return m.Resp } - return interceptor(ctx, in, info, handler) + return nil } -func _Query_LimitOrderTrancheUserAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllLimitOrderTrancheUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LimitOrderTrancheUserAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/LimitOrderTrancheUserAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LimitOrderTrancheUserAll(ctx, req.(*QueryAllLimitOrderTrancheUserRequest)) - } - return interceptor(ctx, in, info, handler) +type QuerySimulateMultiHopSwapRequest struct { + Msg *MsgMultiHopSwap `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` } -func _Query_LimitOrderTrancheUserAllByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllLimitOrderTrancheUserByAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LimitOrderTrancheUserAllByAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/LimitOrderTrancheUserAllByAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LimitOrderTrancheUserAllByAddress(ctx, req.(*QueryAllLimitOrderTrancheUserByAddressRequest)) +func (m *QuerySimulateMultiHopSwapRequest) Reset() { *m = QuerySimulateMultiHopSwapRequest{} } +func (m *QuerySimulateMultiHopSwapRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySimulateMultiHopSwapRequest) ProtoMessage() {} +func (*QuerySimulateMultiHopSwapRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{45} +} +func (m *QuerySimulateMultiHopSwapRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulateMultiHopSwapRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateMultiHopSwapRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QuerySimulateMultiHopSwapRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateMultiHopSwapRequest.Merge(m, src) +} +func (m *QuerySimulateMultiHopSwapRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulateMultiHopSwapRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateMultiHopSwapRequest.DiscardUnknown(m) } -func _Query_LimitOrderTranche_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetLimitOrderTrancheRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LimitOrderTranche(ctx, in) +var xxx_messageInfo_QuerySimulateMultiHopSwapRequest proto.InternalMessageInfo + +func (m *QuerySimulateMultiHopSwapRequest) GetMsg() *MsgMultiHopSwap { + if m != nil { + return m.Msg } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/LimitOrderTranche", + return nil +} + +type QuerySimulateMultiHopSwapResponse struct { + Resp *MsgMultiHopSwapResponse `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` +} + +func (m *QuerySimulateMultiHopSwapResponse) Reset() { *m = QuerySimulateMultiHopSwapResponse{} } +func (m *QuerySimulateMultiHopSwapResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySimulateMultiHopSwapResponse) ProtoMessage() {} +func (*QuerySimulateMultiHopSwapResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6613ea5fce61e9c, []int{46} +} +func (m *QuerySimulateMultiHopSwapResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySimulateMultiHopSwapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySimulateMultiHopSwapResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LimitOrderTranche(ctx, req.(*QueryGetLimitOrderTrancheRequest)) +} +func (m *QuerySimulateMultiHopSwapResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySimulateMultiHopSwapResponse.Merge(m, src) +} +func (m *QuerySimulateMultiHopSwapResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySimulateMultiHopSwapResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySimulateMultiHopSwapResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySimulateMultiHopSwapResponse proto.InternalMessageInfo + +func (m *QuerySimulateMultiHopSwapResponse) GetResp() *MsgMultiHopSwapResponse { + if m != nil { + return m.Resp } - return interceptor(ctx, in, info, handler) + return nil } -func _Query_LimitOrderTrancheAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllLimitOrderTrancheRequest) - if err := dec(in); err != nil { +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "neutron.dex.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "neutron.dex.QueryParamsResponse") + proto.RegisterType((*QueryGetLimitOrderTrancheUserRequest)(nil), "neutron.dex.QueryGetLimitOrderTrancheUserRequest") + proto.RegisterType((*QueryGetLimitOrderTrancheUserResponse)(nil), "neutron.dex.QueryGetLimitOrderTrancheUserResponse") + proto.RegisterType((*QueryAllLimitOrderTrancheUserRequest)(nil), "neutron.dex.QueryAllLimitOrderTrancheUserRequest") + proto.RegisterType((*QueryAllLimitOrderTrancheUserResponse)(nil), "neutron.dex.QueryAllLimitOrderTrancheUserResponse") + proto.RegisterType((*QueryGetLimitOrderTrancheRequest)(nil), "neutron.dex.QueryGetLimitOrderTrancheRequest") + proto.RegisterType((*QueryGetLimitOrderTrancheResponse)(nil), "neutron.dex.QueryGetLimitOrderTrancheResponse") + proto.RegisterType((*QueryAllLimitOrderTrancheRequest)(nil), "neutron.dex.QueryAllLimitOrderTrancheRequest") + proto.RegisterType((*QueryAllLimitOrderTrancheResponse)(nil), "neutron.dex.QueryAllLimitOrderTrancheResponse") + proto.RegisterType((*QueryAllUserDepositsRequest)(nil), "neutron.dex.QueryAllUserDepositsRequest") + proto.RegisterType((*QueryAllUserDepositsResponse)(nil), "neutron.dex.QueryAllUserDepositsResponse") + proto.RegisterType((*QueryAllLimitOrderTrancheUserByAddressRequest)(nil), "neutron.dex.QueryAllLimitOrderTrancheUserByAddressRequest") + proto.RegisterType((*QueryAllLimitOrderTrancheUserByAddressResponse)(nil), "neutron.dex.QueryAllLimitOrderTrancheUserByAddressResponse") + proto.RegisterType((*QueryAllTickLiquidityRequest)(nil), "neutron.dex.QueryAllTickLiquidityRequest") + proto.RegisterType((*QueryAllTickLiquidityResponse)(nil), "neutron.dex.QueryAllTickLiquidityResponse") + proto.RegisterType((*QueryGetInactiveLimitOrderTrancheRequest)(nil), "neutron.dex.QueryGetInactiveLimitOrderTrancheRequest") + proto.RegisterType((*QueryGetInactiveLimitOrderTrancheResponse)(nil), "neutron.dex.QueryGetInactiveLimitOrderTrancheResponse") + proto.RegisterType((*QueryAllInactiveLimitOrderTrancheRequest)(nil), "neutron.dex.QueryAllInactiveLimitOrderTrancheRequest") + proto.RegisterType((*QueryAllInactiveLimitOrderTrancheResponse)(nil), "neutron.dex.QueryAllInactiveLimitOrderTrancheResponse") + proto.RegisterType((*QueryAllPoolReservesRequest)(nil), "neutron.dex.QueryAllPoolReservesRequest") + proto.RegisterType((*QueryAllPoolReservesResponse)(nil), "neutron.dex.QueryAllPoolReservesResponse") + proto.RegisterType((*QueryGetPoolReservesRequest)(nil), "neutron.dex.QueryGetPoolReservesRequest") + proto.RegisterType((*QueryGetPoolReservesResponse)(nil), "neutron.dex.QueryGetPoolReservesResponse") + proto.RegisterType((*QueryEstimateMultiHopSwapRequest)(nil), "neutron.dex.QueryEstimateMultiHopSwapRequest") + proto.RegisterType((*QueryEstimateMultiHopSwapResponse)(nil), "neutron.dex.QueryEstimateMultiHopSwapResponse") + proto.RegisterType((*QueryEstimatePlaceLimitOrderRequest)(nil), "neutron.dex.QueryEstimatePlaceLimitOrderRequest") + proto.RegisterType((*QueryEstimatePlaceLimitOrderResponse)(nil), "neutron.dex.QueryEstimatePlaceLimitOrderResponse") + proto.RegisterType((*QueryPoolRequest)(nil), "neutron.dex.QueryPoolRequest") + proto.RegisterType((*QueryPoolByIDRequest)(nil), "neutron.dex.QueryPoolByIDRequest") + proto.RegisterType((*QueryPoolResponse)(nil), "neutron.dex.QueryPoolResponse") + proto.RegisterType((*QueryGetPoolMetadataRequest)(nil), "neutron.dex.QueryGetPoolMetadataRequest") + proto.RegisterType((*QueryGetPoolMetadataResponse)(nil), "neutron.dex.QueryGetPoolMetadataResponse") + proto.RegisterType((*QueryAllPoolMetadataRequest)(nil), "neutron.dex.QueryAllPoolMetadataRequest") + proto.RegisterType((*QueryAllPoolMetadataResponse)(nil), "neutron.dex.QueryAllPoolMetadataResponse") + proto.RegisterType((*QuerySimulateDepositRequest)(nil), "neutron.dex.QuerySimulateDepositRequest") + proto.RegisterType((*QuerySimulateDepositResponse)(nil), "neutron.dex.QuerySimulateDepositResponse") + proto.RegisterType((*QuerySimulateWithdrawalRequest)(nil), "neutron.dex.QuerySimulateWithdrawalRequest") + proto.RegisterType((*QuerySimulateWithdrawalResponse)(nil), "neutron.dex.QuerySimulateWithdrawalResponse") + proto.RegisterType((*QuerySimulatePlaceLimitOrderRequest)(nil), "neutron.dex.QuerySimulatePlaceLimitOrderRequest") + proto.RegisterType((*QuerySimulatePlaceLimitOrderResponse)(nil), "neutron.dex.QuerySimulatePlaceLimitOrderResponse") + proto.RegisterType((*QuerySimulateWithdrawFilledLimitOrderRequest)(nil), "neutron.dex.QuerySimulateWithdrawFilledLimitOrderRequest") + proto.RegisterType((*QuerySimulateWithdrawFilledLimitOrderResponse)(nil), "neutron.dex.QuerySimulateWithdrawFilledLimitOrderResponse") + proto.RegisterType((*QuerySimulateCancelLimitOrderRequest)(nil), "neutron.dex.QuerySimulateCancelLimitOrderRequest") + proto.RegisterType((*QuerySimulateCancelLimitOrderResponse)(nil), "neutron.dex.QuerySimulateCancelLimitOrderResponse") + proto.RegisterType((*QuerySimulateMultiHopSwapRequest)(nil), "neutron.dex.QuerySimulateMultiHopSwapRequest") + proto.RegisterType((*QuerySimulateMultiHopSwapResponse)(nil), "neutron.dex.QuerySimulateMultiHopSwapResponse") +} + +func init() { proto.RegisterFile("neutron/dex/query.proto", fileDescriptor_b6613ea5fce61e9c) } + +var fileDescriptor_b6613ea5fce61e9c = []byte{ + // 2746 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xdf, 0x6f, 0x1c, 0x47, + 0x1d, 0xcf, 0xf8, 0x1c, 0xc7, 0x1e, 0x3b, 0xb1, 0x33, 0x76, 0xea, 0xcb, 0xc5, 0xf1, 0xd9, 0xdb, + 0x24, 0x76, 0xd2, 0xf8, 0x36, 0x76, 0x48, 0x9a, 0x26, 0x14, 0x88, 0xeb, 0x26, 0x31, 0x6d, 0x88, + 0xd9, 0x84, 0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0x87, 0x05, 0x47, 0xc8, 0x86, 0xc2, 0x52, 0x18, 0x4f, 0xab, 0x86, 0xa1, 0xcf, 0xf2, 0xa1, 0x4f, + 0x91, 0x52, 0x62, 0xc2, 0x63, 0xf3, 0x9c, 0x98, 0x5c, 0x07, 0xf7, 0x06, 0x52, 0x0b, 0x99, 0x14, + 0x8f, 0x11, 0x91, 0x61, 0x32, 0x61, 0x3c, 0xcb, 0x61, 0x1c, 0x26, 0x87, 0x44, 0x30, 0x7c, 0xfd, + 0xe6, 0x01, 0xf9, 0x26, 0x2c, 0x81, 0x50, 0x1e, 0x48, 0x5f, 0x02, 0x4d, 0xba, 0x47, 0x8b, 0x25, + 0xd0, 0xac, 0x5c, 0x48, 0x53, 0x1c, 0xca, 0x24, 0x29, 0xca, 0xa9, 0xff, 0x13, 0x28, 0xdf, 0x67, + 0x70, 0xbe, 0x01, 0x7b, 0x46, 0xd0, 0x43, 0xeb, 0x3d, 0xa3, 0x0d, 0x44, 0x29, 0x5a, 0x8a, 0x24, + 0x71, 0x44, 0x63, 0xa4, 0x90, 0x8e, 0x88, 0xbc, 0x85, 0xf0, 0x60, 0x93, 0x24, 0x21, 0x02, 0x23, + 0xd6, 0x3f, 0x44, 0x60, 0x52, 0xf4, 0x0d, 0xe9, 0x28, 0x07, 0x53, 0x24, 0x87, 0x63, 0x60, 0x5c, + 0xb0, 0x56, 0xe1, 0xf0, 0x40, 0xde, 0x41, 0x98, 0x24, 0xd5, 0x07, 0xf2, 0x5c, 0xfa, 0x40, 0x09, + 0xcd, 0xa3, 0x70, 0xb2, 0x3d, 0x63, 0x00, 0x36, 0xcd, 0x81, 0x49, 0x64, 0x42, 0x0c, 0x6c, 0xbd, + 0x01, 0xe2, 0x03, 0x84, 0x47, 0x53, 0x44, 0x06, 0xd1, 0x7a, 0x6f, 0xad, 0x74, 0x88, 0xd6, 0x7b, + 0x86, 0x82, 0x01, 0x3b, 0x54, 0xf3, 0x7a, 0x0f, 0xa1, 0x26, 0xd6, 0x3b, 0xf9, 0x0b, 0xc2, 0x13, + 0x59, 0x2a, 0x02, 0x79, 0x21, 0x9b, 0xae, 0x14, 0x95, 0xa3, 0x70, 0x7e, 0x27, 0x4d, 0xc1, 0x99, + 0x17, 0xb8, 0x33, 0xa7, 0xc9, 0x6c, 0x6b, 0xde, 0xd5, 0x64, 0xa2, 0x26, 0xbf, 0x42, 0x38, 0x9f, + 0xa6, 0x24, 0x90, 0x16, 0xbc, 0xa6, 0x28, 0x1a, 0xa2, 0x7b, 0x5f, 0x96, 0x50, 0x91, 0x72, 0x53, + 0x0a, 0xe1, 0x97, 0x79, 0xbb, 0x18, 0xea, 0xf7, 0x11, 0x1e, 0x11, 0x89, 0x08, 0xa2, 0xbc, 0xd6, + 0x42, 0xc0, 0x10, 0xe5, 0xb5, 0x56, 0xda, 0x44, 0xca, 0x91, 0x3d, 0x44, 0x1a, 0xcf, 0x6b, 0xf3, + 0x97, 0x3f, 0x7c, 0x34, 0x8e, 0x3e, 0x7a, 0x34, 0x8e, 0xfe, 0xf9, 0x68, 0x1c, 0x3d, 0x7c, 0x3c, + 0xbe, 0xeb, 0xa3, 0xc7, 0xe3, 0xbb, 0xfe, 0xfa, 0x78, 0x7c, 0xd7, 0xed, 0x99, 0xec, 0xe7, 0xcc, + 0x0d, 0xff, 0xcc, 0x5d, 0xb7, 0xa9, 0xbb, 0xdc, 0xc3, 0xdf, 0x91, 0x4e, 0xff, 0x37, 0x00, 0x00, + 0xff, 0xff, 0x02, 0x04, 0x07, 0xcf, 0x91, 0x2e, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a LimitOrderTrancheUser by index. + LimitOrderTrancheUser(ctx context.Context, in *QueryGetLimitOrderTrancheUserRequest, opts ...grpc.CallOption) (*QueryGetLimitOrderTrancheUserResponse, error) + // Queries a list of LimitOrderTranchUser items. + LimitOrderTrancheUserAll(ctx context.Context, in *QueryAllLimitOrderTrancheUserRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheUserResponse, error) + // Queries a list of LimitOrderTrancheUser items for a given address. + LimitOrderTrancheUserAllByAddress(ctx context.Context, in *QueryAllLimitOrderTrancheUserByAddressRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheUserByAddressResponse, error) + // Queries a LimitOrderTranche by index. + LimitOrderTranche(ctx context.Context, in *QueryGetLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryGetLimitOrderTrancheResponse, error) + // Queries a list of LimitOrderTranche items for a given pairID / TokenIn + // combination. + LimitOrderTrancheAll(ctx context.Context, in *QueryAllLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheResponse, error) + // Queries a list of UserDeposits items. + UserDepositsAll(ctx context.Context, in *QueryAllUserDepositsRequest, opts ...grpc.CallOption) (*QueryAllUserDepositsResponse, error) + // Queries a list of TickLiquidity items. + TickLiquidityAll(ctx context.Context, in *QueryAllTickLiquidityRequest, opts ...grpc.CallOption) (*QueryAllTickLiquidityResponse, error) + // Queries a InactiveLimitOrderTranche by index. + InactiveLimitOrderTranche(ctx context.Context, in *QueryGetInactiveLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryGetInactiveLimitOrderTrancheResponse, error) + // Queries a list of InactiveLimitOrderTranche items. + InactiveLimitOrderTrancheAll(ctx context.Context, in *QueryAllInactiveLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryAllInactiveLimitOrderTrancheResponse, error) + // Queries a list of PoolReserves items. + PoolReservesAll(ctx context.Context, in *QueryAllPoolReservesRequest, opts ...grpc.CallOption) (*QueryAllPoolReservesResponse, error) + // Queries a PoolReserve by index + PoolReserves(ctx context.Context, in *QueryGetPoolReservesRequest, opts ...grpc.CallOption) (*QueryGetPoolReservesResponse, error) + // DEPRECATED Queries the simulated result of a multihop swap + EstimateMultiHopSwap(ctx context.Context, in *QueryEstimateMultiHopSwapRequest, opts ...grpc.CallOption) (*QueryEstimateMultiHopSwapResponse, error) + // DEPRECATED Queries the simulated result of a PlaceLimit order + EstimatePlaceLimitOrder(ctx context.Context, in *QueryEstimatePlaceLimitOrderRequest, opts ...grpc.CallOption) (*QueryEstimatePlaceLimitOrderResponse, error) + // Queries a pool by pair, tick and fee + Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) + // Queries a pool by ID + PoolByID(ctx context.Context, in *QueryPoolByIDRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) + // Queries a PoolMetadata by ID + PoolMetadata(ctx context.Context, in *QueryGetPoolMetadataRequest, opts ...grpc.CallOption) (*QueryGetPoolMetadataResponse, error) + // Queries a list of PoolMetadata items. + PoolMetadataAll(ctx context.Context, in *QueryAllPoolMetadataRequest, opts ...grpc.CallOption) (*QueryAllPoolMetadataResponse, error) + // Simulates MsgDeposit + SimulateDeposit(ctx context.Context, in *QuerySimulateDepositRequest, opts ...grpc.CallOption) (*QuerySimulateDepositResponse, error) + // Simulates MsgWithdrawal + SimulateWithdrawal(ctx context.Context, in *QuerySimulateWithdrawalRequest, opts ...grpc.CallOption) (*QuerySimulateWithdrawalResponse, error) + // Simulates MsgPlaceLimitOrder + SimulatePlaceLimitOrder(ctx context.Context, in *QuerySimulatePlaceLimitOrderRequest, opts ...grpc.CallOption) (*QuerySimulatePlaceLimitOrderResponse, error) + // Simulates MsgWithdrawFilledLimitOrder + SimulateWithdrawFilledLimitOrder(ctx context.Context, in *QuerySimulateWithdrawFilledLimitOrderRequest, opts ...grpc.CallOption) (*QuerySimulateWithdrawFilledLimitOrderResponse, error) + // Simulates MsgCancelLimitOrder + SimulateCancelLimitOrder(ctx context.Context, in *QuerySimulateCancelLimitOrderRequest, opts ...grpc.CallOption) (*QuerySimulateCancelLimitOrderResponse, error) + // Simulates MsgMultiHopSwap + SimulateMultiHopSwap(ctx context.Context, in *QuerySimulateMultiHopSwapRequest, opts ...grpc.CallOption) (*QuerySimulateMultiHopSwapResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/Params", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).LimitOrderTrancheAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/LimitOrderTrancheAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LimitOrderTrancheAll(ctx, req.(*QueryAllLimitOrderTrancheRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_UserDepositsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllUserDepositsRequest) - if err := dec(in); err != nil { +func (c *queryClient) LimitOrderTrancheUser(ctx context.Context, in *QueryGetLimitOrderTrancheUserRequest, opts ...grpc.CallOption) (*QueryGetLimitOrderTrancheUserResponse, error) { + out := new(QueryGetLimitOrderTrancheUserResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTrancheUser", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).UserDepositsAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/UserDepositsAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).UserDepositsAll(ctx, req.(*QueryAllUserDepositsRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_TickLiquidityAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllTickLiquidityRequest) - if err := dec(in); err != nil { +func (c *queryClient) LimitOrderTrancheUserAll(ctx context.Context, in *QueryAllLimitOrderTrancheUserRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheUserResponse, error) { + out := new(QueryAllLimitOrderTrancheUserResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTrancheUserAll", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).TickLiquidityAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/TickLiquidityAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TickLiquidityAll(ctx, req.(*QueryAllTickLiquidityRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_InactiveLimitOrderTranche_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetInactiveLimitOrderTrancheRequest) - if err := dec(in); err != nil { +func (c *queryClient) LimitOrderTrancheUserAllByAddress(ctx context.Context, in *QueryAllLimitOrderTrancheUserByAddressRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheUserByAddressResponse, error) { + out := new(QueryAllLimitOrderTrancheUserByAddressResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTrancheUserAllByAddress", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).InactiveLimitOrderTranche(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/InactiveLimitOrderTranche", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).InactiveLimitOrderTranche(ctx, req.(*QueryGetInactiveLimitOrderTrancheRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_InactiveLimitOrderTrancheAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllInactiveLimitOrderTrancheRequest) - if err := dec(in); err != nil { +func (c *queryClient) LimitOrderTranche(ctx context.Context, in *QueryGetLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryGetLimitOrderTrancheResponse, error) { + out := new(QueryGetLimitOrderTrancheResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTranche", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).InactiveLimitOrderTrancheAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/InactiveLimitOrderTrancheAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).InactiveLimitOrderTrancheAll(ctx, req.(*QueryAllInactiveLimitOrderTrancheRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_PoolReservesAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllPoolReservesRequest) - if err := dec(in); err != nil { +func (c *queryClient) LimitOrderTrancheAll(ctx context.Context, in *QueryAllLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryAllLimitOrderTrancheResponse, error) { + out := new(QueryAllLimitOrderTrancheResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/LimitOrderTrancheAll", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).PoolReservesAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/PoolReservesAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PoolReservesAll(ctx, req.(*QueryAllPoolReservesRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_PoolReserves_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetPoolReservesRequest) - if err := dec(in); err != nil { +func (c *queryClient) UserDepositsAll(ctx context.Context, in *QueryAllUserDepositsRequest, opts ...grpc.CallOption) (*QueryAllUserDepositsResponse, error) { + out := new(QueryAllUserDepositsResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/UserDepositsAll", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).PoolReserves(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/PoolReserves", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PoolReserves(ctx, req.(*QueryGetPoolReservesRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_EstimateMultiHopSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryEstimateMultiHopSwapRequest) - if err := dec(in); err != nil { +func (c *queryClient) TickLiquidityAll(ctx context.Context, in *QueryAllTickLiquidityRequest, opts ...grpc.CallOption) (*QueryAllTickLiquidityResponse, error) { + out := new(QueryAllTickLiquidityResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/TickLiquidityAll", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).EstimateMultiHopSwap(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/EstimateMultiHopSwap", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EstimateMultiHopSwap(ctx, req.(*QueryEstimateMultiHopSwapRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_EstimatePlaceLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryEstimatePlaceLimitOrderRequest) - if err := dec(in); err != nil { +func (c *queryClient) InactiveLimitOrderTranche(ctx context.Context, in *QueryGetInactiveLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryGetInactiveLimitOrderTrancheResponse, error) { + out := new(QueryGetInactiveLimitOrderTrancheResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/InactiveLimitOrderTranche", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).EstimatePlaceLimitOrder(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/EstimatePlaceLimitOrder", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EstimatePlaceLimitOrder(ctx, req.(*QueryEstimatePlaceLimitOrderRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_Pool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPoolRequest) - if err := dec(in); err != nil { +func (c *queryClient) InactiveLimitOrderTrancheAll(ctx context.Context, in *QueryAllInactiveLimitOrderTrancheRequest, opts ...grpc.CallOption) (*QueryAllInactiveLimitOrderTrancheResponse, error) { + out := new(QueryAllInactiveLimitOrderTrancheResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/InactiveLimitOrderTrancheAll", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).Pool(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/Pool", + return out, nil +} + +func (c *queryClient) PoolReservesAll(ctx context.Context, in *QueryAllPoolReservesRequest, opts ...grpc.CallOption) (*QueryAllPoolReservesResponse, error) { + out := new(QueryAllPoolReservesResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolReservesAll", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Pool(ctx, req.(*QueryPoolRequest)) + return out, nil +} + +func (c *queryClient) PoolReserves(ctx context.Context, in *QueryGetPoolReservesRequest, opts ...grpc.CallOption) (*QueryGetPoolReservesResponse, error) { + out := new(QueryGetPoolReservesResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolReserves", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_PoolByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPoolByIDRequest) - if err := dec(in); err != nil { +// Deprecated: Do not use. +func (c *queryClient) EstimateMultiHopSwap(ctx context.Context, in *QueryEstimateMultiHopSwapRequest, opts ...grpc.CallOption) (*QueryEstimateMultiHopSwapResponse, error) { + out := new(QueryEstimateMultiHopSwapResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/EstimateMultiHopSwap", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).PoolByID(ctx, in) + return out, nil +} + +// Deprecated: Do not use. +func (c *queryClient) EstimatePlaceLimitOrder(ctx context.Context, in *QueryEstimatePlaceLimitOrderRequest, opts ...grpc.CallOption) (*QueryEstimatePlaceLimitOrderResponse, error) { + out := new(QueryEstimatePlaceLimitOrderResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/EstimatePlaceLimitOrder", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/PoolByID", + return out, nil +} + +func (c *queryClient) Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) { + out := new(QueryPoolResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/Pool", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PoolByID(ctx, req.(*QueryPoolByIDRequest)) + return out, nil +} + +func (c *queryClient) PoolByID(ctx context.Context, in *QueryPoolByIDRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) { + out := new(QueryPoolResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolByID", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_PoolMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetPoolMetadataRequest) - if err := dec(in); err != nil { +func (c *queryClient) PoolMetadata(ctx context.Context, in *QueryGetPoolMetadataRequest, opts ...grpc.CallOption) (*QueryGetPoolMetadataResponse, error) { + out := new(QueryGetPoolMetadataResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolMetadata", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).PoolMetadata(ctx, in) + return out, nil +} + +func (c *queryClient) PoolMetadataAll(ctx context.Context, in *QueryAllPoolMetadataRequest, opts ...grpc.CallOption) (*QueryAllPoolMetadataResponse, error) { + out := new(QueryAllPoolMetadataResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/PoolMetadataAll", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/PoolMetadata", + return out, nil +} + +func (c *queryClient) SimulateDeposit(ctx context.Context, in *QuerySimulateDepositRequest, opts ...grpc.CallOption) (*QuerySimulateDepositResponse, error) { + out := new(QuerySimulateDepositResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/SimulateDeposit", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PoolMetadata(ctx, req.(*QueryGetPoolMetadataRequest)) + return out, nil +} + +func (c *queryClient) SimulateWithdrawal(ctx context.Context, in *QuerySimulateWithdrawalRequest, opts ...grpc.CallOption) (*QuerySimulateWithdrawalResponse, error) { + out := new(QuerySimulateWithdrawalResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/SimulateWithdrawal", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_PoolMetadataAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllPoolMetadataRequest) - if err := dec(in); err != nil { +func (c *queryClient) SimulatePlaceLimitOrder(ctx context.Context, in *QuerySimulatePlaceLimitOrderRequest, opts ...grpc.CallOption) (*QuerySimulatePlaceLimitOrderResponse, error) { + out := new(QuerySimulatePlaceLimitOrderResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/SimulatePlaceLimitOrder", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).PoolMetadataAll(ctx, in) + return out, nil +} + +func (c *queryClient) SimulateWithdrawFilledLimitOrder(ctx context.Context, in *QuerySimulateWithdrawFilledLimitOrderRequest, opts ...grpc.CallOption) (*QuerySimulateWithdrawFilledLimitOrderResponse, error) { + out := new(QuerySimulateWithdrawFilledLimitOrderResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/SimulateWithdrawFilledLimitOrder", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neutron.dex.Query/PoolMetadataAll", + return out, nil +} + +func (c *queryClient) SimulateCancelLimitOrder(ctx context.Context, in *QuerySimulateCancelLimitOrderRequest, opts ...grpc.CallOption) (*QuerySimulateCancelLimitOrderResponse, error) { + out := new(QuerySimulateCancelLimitOrderResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/SimulateCancelLimitOrder", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PoolMetadataAll(ctx, req.(*QueryAllPoolMetadataRequest)) + return out, nil +} + +func (c *queryClient) SimulateMultiHopSwap(ctx context.Context, in *QuerySimulateMultiHopSwapRequest, opts ...grpc.CallOption) (*QuerySimulateMultiHopSwapResponse, error) { + out := new(QuerySimulateMultiHopSwapResponse) + err := c.cc.Invoke(ctx, "/neutron.dex.Query/SimulateMultiHopSwap", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "neutron.dex.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "LimitOrderTrancheUser", - Handler: _Query_LimitOrderTrancheUser_Handler, - }, - { - MethodName: "LimitOrderTrancheUserAll", - Handler: _Query_LimitOrderTrancheUserAll_Handler, - }, - { - MethodName: "LimitOrderTrancheUserAllByAddress", - Handler: _Query_LimitOrderTrancheUserAllByAddress_Handler, - }, - { - MethodName: "LimitOrderTranche", - Handler: _Query_LimitOrderTranche_Handler, - }, - { - MethodName: "LimitOrderTrancheAll", - Handler: _Query_LimitOrderTrancheAll_Handler, - }, - { - MethodName: "UserDepositsAll", - Handler: _Query_UserDepositsAll_Handler, - }, - { - MethodName: "TickLiquidityAll", - Handler: _Query_TickLiquidityAll_Handler, - }, - { - MethodName: "InactiveLimitOrderTranche", - Handler: _Query_InactiveLimitOrderTranche_Handler, - }, - { - MethodName: "InactiveLimitOrderTrancheAll", - Handler: _Query_InactiveLimitOrderTrancheAll_Handler, - }, - { - MethodName: "PoolReservesAll", - Handler: _Query_PoolReservesAll_Handler, - }, - { - MethodName: "PoolReserves", - Handler: _Query_PoolReserves_Handler, - }, - { - MethodName: "EstimateMultiHopSwap", - Handler: _Query_EstimateMultiHopSwap_Handler, - }, - { - MethodName: "EstimatePlaceLimitOrder", - Handler: _Query_EstimatePlaceLimitOrder_Handler, - }, - { - MethodName: "Pool", - Handler: _Query_Pool_Handler, - }, - { - MethodName: "PoolByID", - Handler: _Query_PoolByID_Handler, - }, - { - MethodName: "PoolMetadata", - Handler: _Query_PoolMetadata_Handler, - }, - { - MethodName: "PoolMetadataAll", - Handler: _Query_PoolMetadataAll_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "neutron/dex/query.proto", +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a LimitOrderTrancheUser by index. + LimitOrderTrancheUser(context.Context, *QueryGetLimitOrderTrancheUserRequest) (*QueryGetLimitOrderTrancheUserResponse, error) + // Queries a list of LimitOrderTranchUser items. + LimitOrderTrancheUserAll(context.Context, *QueryAllLimitOrderTrancheUserRequest) (*QueryAllLimitOrderTrancheUserResponse, error) + // Queries a list of LimitOrderTrancheUser items for a given address. + LimitOrderTrancheUserAllByAddress(context.Context, *QueryAllLimitOrderTrancheUserByAddressRequest) (*QueryAllLimitOrderTrancheUserByAddressResponse, error) + // Queries a LimitOrderTranche by index. + LimitOrderTranche(context.Context, *QueryGetLimitOrderTrancheRequest) (*QueryGetLimitOrderTrancheResponse, error) + // Queries a list of LimitOrderTranche items for a given pairID / TokenIn + // combination. + LimitOrderTrancheAll(context.Context, *QueryAllLimitOrderTrancheRequest) (*QueryAllLimitOrderTrancheResponse, error) + // Queries a list of UserDeposits items. + UserDepositsAll(context.Context, *QueryAllUserDepositsRequest) (*QueryAllUserDepositsResponse, error) + // Queries a list of TickLiquidity items. + TickLiquidityAll(context.Context, *QueryAllTickLiquidityRequest) (*QueryAllTickLiquidityResponse, error) + // Queries a InactiveLimitOrderTranche by index. + InactiveLimitOrderTranche(context.Context, *QueryGetInactiveLimitOrderTrancheRequest) (*QueryGetInactiveLimitOrderTrancheResponse, error) + // Queries a list of InactiveLimitOrderTranche items. + InactiveLimitOrderTrancheAll(context.Context, *QueryAllInactiveLimitOrderTrancheRequest) (*QueryAllInactiveLimitOrderTrancheResponse, error) + // Queries a list of PoolReserves items. + PoolReservesAll(context.Context, *QueryAllPoolReservesRequest) (*QueryAllPoolReservesResponse, error) + // Queries a PoolReserve by index + PoolReserves(context.Context, *QueryGetPoolReservesRequest) (*QueryGetPoolReservesResponse, error) + // DEPRECATED Queries the simulated result of a multihop swap + EstimateMultiHopSwap(context.Context, *QueryEstimateMultiHopSwapRequest) (*QueryEstimateMultiHopSwapResponse, error) + // DEPRECATED Queries the simulated result of a PlaceLimit order + EstimatePlaceLimitOrder(context.Context, *QueryEstimatePlaceLimitOrderRequest) (*QueryEstimatePlaceLimitOrderResponse, error) + // Queries a pool by pair, tick and fee + Pool(context.Context, *QueryPoolRequest) (*QueryPoolResponse, error) + // Queries a pool by ID + PoolByID(context.Context, *QueryPoolByIDRequest) (*QueryPoolResponse, error) + // Queries a PoolMetadata by ID + PoolMetadata(context.Context, *QueryGetPoolMetadataRequest) (*QueryGetPoolMetadataResponse, error) + // Queries a list of PoolMetadata items. + PoolMetadataAll(context.Context, *QueryAllPoolMetadataRequest) (*QueryAllPoolMetadataResponse, error) + // Simulates MsgDeposit + SimulateDeposit(context.Context, *QuerySimulateDepositRequest) (*QuerySimulateDepositResponse, error) + // Simulates MsgWithdrawal + SimulateWithdrawal(context.Context, *QuerySimulateWithdrawalRequest) (*QuerySimulateWithdrawalResponse, error) + // Simulates MsgPlaceLimitOrder + SimulatePlaceLimitOrder(context.Context, *QuerySimulatePlaceLimitOrderRequest) (*QuerySimulatePlaceLimitOrderResponse, error) + // Simulates MsgWithdrawFilledLimitOrder + SimulateWithdrawFilledLimitOrder(context.Context, *QuerySimulateWithdrawFilledLimitOrderRequest) (*QuerySimulateWithdrawFilledLimitOrderResponse, error) + // Simulates MsgCancelLimitOrder + SimulateCancelLimitOrder(context.Context, *QuerySimulateCancelLimitOrderRequest) (*QuerySimulateCancelLimitOrderResponse, error) + // Simulates MsgMultiHopSwap + SimulateMultiHopSwap(context.Context, *QuerySimulateMultiHopSwapRequest) (*QuerySimulateMultiHopSwapResponse, error) } -func (m *QueryParamsRequest) 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 +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { } -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) LimitOrderTrancheUser(ctx context.Context, req *QueryGetLimitOrderTrancheUserRequest) (*QueryGetLimitOrderTrancheUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTrancheUser not implemented") +} +func (*UnimplementedQueryServer) LimitOrderTrancheUserAll(ctx context.Context, req *QueryAllLimitOrderTrancheUserRequest) (*QueryAllLimitOrderTrancheUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTrancheUserAll not implemented") +} +func (*UnimplementedQueryServer) LimitOrderTrancheUserAllByAddress(ctx context.Context, req *QueryAllLimitOrderTrancheUserByAddressRequest) (*QueryAllLimitOrderTrancheUserByAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTrancheUserAllByAddress not implemented") +} +func (*UnimplementedQueryServer) LimitOrderTranche(ctx context.Context, req *QueryGetLimitOrderTrancheRequest) (*QueryGetLimitOrderTrancheResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTranche not implemented") +} +func (*UnimplementedQueryServer) LimitOrderTrancheAll(ctx context.Context, req *QueryAllLimitOrderTrancheRequest) (*QueryAllLimitOrderTrancheResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LimitOrderTrancheAll not implemented") +} +func (*UnimplementedQueryServer) UserDepositsAll(ctx context.Context, req *QueryAllUserDepositsRequest) (*QueryAllUserDepositsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserDepositsAll not implemented") +} +func (*UnimplementedQueryServer) TickLiquidityAll(ctx context.Context, req *QueryAllTickLiquidityRequest) (*QueryAllTickLiquidityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TickLiquidityAll not implemented") +} +func (*UnimplementedQueryServer) InactiveLimitOrderTranche(ctx context.Context, req *QueryGetInactiveLimitOrderTrancheRequest) (*QueryGetInactiveLimitOrderTrancheResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InactiveLimitOrderTranche not implemented") +} +func (*UnimplementedQueryServer) InactiveLimitOrderTrancheAll(ctx context.Context, req *QueryAllInactiveLimitOrderTrancheRequest) (*QueryAllInactiveLimitOrderTrancheResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InactiveLimitOrderTrancheAll not implemented") +} +func (*UnimplementedQueryServer) PoolReservesAll(ctx context.Context, req *QueryAllPoolReservesRequest) (*QueryAllPoolReservesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolReservesAll not implemented") +} +func (*UnimplementedQueryServer) PoolReserves(ctx context.Context, req *QueryGetPoolReservesRequest) (*QueryGetPoolReservesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolReserves not implemented") +} +func (*UnimplementedQueryServer) EstimateMultiHopSwap(ctx context.Context, req *QueryEstimateMultiHopSwapRequest) (*QueryEstimateMultiHopSwapResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimateMultiHopSwap not implemented") +} +func (*UnimplementedQueryServer) EstimatePlaceLimitOrder(ctx context.Context, req *QueryEstimatePlaceLimitOrderRequest) (*QueryEstimatePlaceLimitOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimatePlaceLimitOrder not implemented") +} +func (*UnimplementedQueryServer) Pool(ctx context.Context, req *QueryPoolRequest) (*QueryPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pool not implemented") +} +func (*UnimplementedQueryServer) PoolByID(ctx context.Context, req *QueryPoolByIDRequest) (*QueryPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolByID not implemented") +} +func (*UnimplementedQueryServer) PoolMetadata(ctx context.Context, req *QueryGetPoolMetadataRequest) (*QueryGetPoolMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolMetadata not implemented") +} +func (*UnimplementedQueryServer) PoolMetadataAll(ctx context.Context, req *QueryAllPoolMetadataRequest) (*QueryAllPoolMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolMetadataAll not implemented") +} +func (*UnimplementedQueryServer) SimulateDeposit(ctx context.Context, req *QuerySimulateDepositRequest) (*QuerySimulateDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SimulateDeposit not implemented") +} +func (*UnimplementedQueryServer) SimulateWithdrawal(ctx context.Context, req *QuerySimulateWithdrawalRequest) (*QuerySimulateWithdrawalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SimulateWithdrawal not implemented") +} +func (*UnimplementedQueryServer) SimulatePlaceLimitOrder(ctx context.Context, req *QuerySimulatePlaceLimitOrderRequest) (*QuerySimulatePlaceLimitOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SimulatePlaceLimitOrder not implemented") +} +func (*UnimplementedQueryServer) SimulateWithdrawFilledLimitOrder(ctx context.Context, req *QuerySimulateWithdrawFilledLimitOrderRequest) (*QuerySimulateWithdrawFilledLimitOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SimulateWithdrawFilledLimitOrder not implemented") +} +func (*UnimplementedQueryServer) SimulateCancelLimitOrder(ctx context.Context, req *QuerySimulateCancelLimitOrderRequest) (*QuerySimulateCancelLimitOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SimulateCancelLimitOrder not implemented") +} +func (*UnimplementedQueryServer) SimulateMultiHopSwap(ctx context.Context, req *QuerySimulateMultiHopSwapRequest) (*QuerySimulateMultiHopSwapResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SimulateMultiHopSwap not implemented") } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryParamsResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) +func _Query_LimitOrderTrancheUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetLimitOrderTrancheUserRequest) + if err := dec(in); err != nil { + return nil, err } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + if interceptor == nil { + return srv.(QueryServer).LimitOrderTrancheUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/LimitOrderTrancheUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LimitOrderTrancheUser(ctx, req.(*QueryGetLimitOrderTrancheUserRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryGetLimitOrderTrancheUserRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_LimitOrderTrancheUserAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllLimitOrderTrancheUserRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(QueryServer).LimitOrderTrancheUserAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/LimitOrderTrancheUserAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LimitOrderTrancheUserAll(ctx, req.(*QueryAllLimitOrderTrancheUserRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryGetLimitOrderTrancheUserRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Query_LimitOrderTrancheUserAllByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllLimitOrderTrancheUserByAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LimitOrderTrancheUserAllByAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/LimitOrderTrancheUserAllByAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LimitOrderTrancheUserAllByAddress(ctx, req.(*QueryAllLimitOrderTrancheUserByAddressRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryGetLimitOrderTrancheUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CalcWithdrawableShares { - i-- - if m.CalcWithdrawableShares { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 +func _Query_LimitOrderTranche_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetLimitOrderTrancheRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.TrancheKey) > 0 { - i -= len(m.TrancheKey) - copy(dAtA[i:], m.TrancheKey) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TrancheKey))) - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(QueryServer).LimitOrderTranche(ctx, in) } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/LimitOrderTranche", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LimitOrderTranche(ctx, req.(*QueryGetLimitOrderTrancheRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryGetLimitOrderTrancheUserResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_LimitOrderTrancheAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllLimitOrderTrancheRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryGetLimitOrderTrancheUserResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetLimitOrderTrancheUserResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.WithdrawableShares != nil { - { - size := m.WithdrawableShares.Size() - i -= size - if _, err := m.WithdrawableShares.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(QueryServer).LimitOrderTrancheAll(ctx, in) } - if m.LimitOrderTrancheUser != nil { - { - size, err := m.LimitOrderTrancheUser.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/LimitOrderTrancheAll", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LimitOrderTrancheAll(ctx, req.(*QueryAllLimitOrderTrancheRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllLimitOrderTrancheUserRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_UserDepositsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllUserDepositsRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryAllLimitOrderTrancheUserRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllLimitOrderTrancheUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + if interceptor == nil { + return srv.(QueryServer).UserDepositsAll(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/UserDepositsAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).UserDepositsAll(ctx, req.(*QueryAllUserDepositsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllLimitOrderTrancheUserResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_TickLiquidityAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllTickLiquidityRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryAllLimitOrderTrancheUserResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllLimitOrderTrancheUserResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(QueryServer).TickLiquidityAll(ctx, in) } - if len(m.LimitOrderTrancheUser) > 0 { - for iNdEx := len(m.LimitOrderTrancheUser) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LimitOrderTrancheUser[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/TickLiquidityAll", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TickLiquidityAll(ctx, req.(*QueryAllTickLiquidityRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryGetLimitOrderTrancheRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_InactiveLimitOrderTranche_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetInactiveLimitOrderTrancheRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryGetLimitOrderTrancheRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if interceptor == nil { + return srv.(QueryServer).InactiveLimitOrderTranche(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/InactiveLimitOrderTranche", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).InactiveLimitOrderTranche(ctx, req.(*QueryGetInactiveLimitOrderTrancheRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryGetLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TrancheKey) > 0 { - i -= len(m.TrancheKey) - copy(dAtA[i:], m.TrancheKey) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TrancheKey))) - i-- - dAtA[i] = 0x22 +func _Query_InactiveLimitOrderTrancheAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllInactiveLimitOrderTrancheRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.TokenIn) > 0 { - i -= len(m.TokenIn) - copy(dAtA[i:], m.TokenIn) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) - i-- - dAtA[i] = 0x1a + if interceptor == nil { + return srv.(QueryServer).InactiveLimitOrderTrancheAll(ctx, in) } - if m.TickIndex != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TickIndex)) - i-- - dAtA[i] = 0x10 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/InactiveLimitOrderTrancheAll", } - if len(m.PairId) > 0 { - i -= len(m.PairId) - copy(dAtA[i:], m.PairId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) - i-- - dAtA[i] = 0xa + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).InactiveLimitOrderTrancheAll(ctx, req.(*QueryAllInactiveLimitOrderTrancheRequest)) } - return len(dAtA) - i, nil + return interceptor(ctx, in, info, handler) } -func (m *QueryGetLimitOrderTrancheResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_PoolReservesAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllPoolReservesRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryGetLimitOrderTrancheResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if interceptor == nil { + return srv.(QueryServer).PoolReservesAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/PoolReservesAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolReservesAll(ctx, req.(*QueryAllPoolReservesRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryGetLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LimitOrderTranche != nil { - { - size, err := m.LimitOrderTranche.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func _Query_PoolReserves_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPoolReservesRequest) + if err := dec(in); err != nil { + return nil, err } - return len(dAtA) - i, nil + if interceptor == nil { + return srv.(QueryServer).PoolReserves(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/PoolReserves", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolReserves(ctx, req.(*QueryGetPoolReservesRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllLimitOrderTrancheRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_EstimateMultiHopSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEstimateMultiHopSwapRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(QueryServer).EstimateMultiHopSwap(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/EstimateMultiHopSwap", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EstimateMultiHopSwap(ctx, req.(*QueryEstimateMultiHopSwapRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllLimitOrderTrancheRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Query_EstimatePlaceLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEstimatePlaceLimitOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EstimatePlaceLimitOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/EstimatePlaceLimitOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EstimatePlaceLimitOrder(ctx, req.(*QueryEstimatePlaceLimitOrderRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a +func _Query_Pool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPoolRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.TokenIn) > 0 { - i -= len(m.TokenIn) - copy(dAtA[i:], m.TokenIn) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(QueryServer).Pool(ctx, in) } - if len(m.PairId) > 0 { - i -= len(m.PairId) - copy(dAtA[i:], m.PairId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) - i-- - dAtA[i] = 0xa + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/Pool", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Pool(ctx, req.(*QueryPoolRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllLimitOrderTrancheResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_PoolByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPoolByIDRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(QueryServer).PoolByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/PoolByID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolByID(ctx, req.(*QueryPoolByIDRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllLimitOrderTrancheResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Query_PoolMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPoolMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PoolMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/PoolMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolMetadata(ctx, req.(*QueryGetPoolMetadataRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func _Query_PoolMetadataAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllPoolMetadataRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.LimitOrderTranche) > 0 { - for iNdEx := len(m.LimitOrderTranche) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LimitOrderTranche[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if interceptor == nil { + return srv.(QueryServer).PoolMetadataAll(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/PoolMetadataAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolMetadataAll(ctx, req.(*QueryAllPoolMetadataRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllUserDepositsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_SimulateDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySimulateDepositRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(QueryServer).SimulateDeposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/SimulateDeposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SimulateDeposit(ctx, req.(*QuerySimulateDepositRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllUserDepositsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Query_SimulateWithdrawal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySimulateWithdrawalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SimulateWithdrawal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/SimulateWithdrawal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SimulateWithdrawal(ctx, req.(*QuerySimulateWithdrawalRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllUserDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IncludePoolData { - i-- - if m.IncludePoolData { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 +func _Query_SimulatePlaceLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySimulatePlaceLimitOrderRequest) + if err := dec(in); err != nil { + return nil, err } - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(QueryServer).SimulatePlaceLimitOrder(ctx, in) } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/SimulatePlaceLimitOrder", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SimulatePlaceLimitOrder(ctx, req.(*QuerySimulatePlaceLimitOrderRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllUserDepositsResponse) Marshal() (dAtA []byte, err error) { +func _Query_SimulateWithdrawFilledLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySimulateWithdrawFilledLimitOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SimulateWithdrawFilledLimitOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/SimulateWithdrawFilledLimitOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SimulateWithdrawFilledLimitOrder(ctx, req.(*QuerySimulateWithdrawFilledLimitOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SimulateCancelLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySimulateCancelLimitOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SimulateCancelLimitOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/SimulateCancelLimitOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SimulateCancelLimitOrder(ctx, req.(*QuerySimulateCancelLimitOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SimulateMultiHopSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySimulateMultiHopSwapRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SimulateMultiHopSwap(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.dex.Query/SimulateMultiHopSwap", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SimulateMultiHopSwap(ctx, req.(*QuerySimulateMultiHopSwapRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "neutron.dex.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "LimitOrderTrancheUser", + Handler: _Query_LimitOrderTrancheUser_Handler, + }, + { + MethodName: "LimitOrderTrancheUserAll", + Handler: _Query_LimitOrderTrancheUserAll_Handler, + }, + { + MethodName: "LimitOrderTrancheUserAllByAddress", + Handler: _Query_LimitOrderTrancheUserAllByAddress_Handler, + }, + { + MethodName: "LimitOrderTranche", + Handler: _Query_LimitOrderTranche_Handler, + }, + { + MethodName: "LimitOrderTrancheAll", + Handler: _Query_LimitOrderTrancheAll_Handler, + }, + { + MethodName: "UserDepositsAll", + Handler: _Query_UserDepositsAll_Handler, + }, + { + MethodName: "TickLiquidityAll", + Handler: _Query_TickLiquidityAll_Handler, + }, + { + MethodName: "InactiveLimitOrderTranche", + Handler: _Query_InactiveLimitOrderTranche_Handler, + }, + { + MethodName: "InactiveLimitOrderTrancheAll", + Handler: _Query_InactiveLimitOrderTrancheAll_Handler, + }, + { + MethodName: "PoolReservesAll", + Handler: _Query_PoolReservesAll_Handler, + }, + { + MethodName: "PoolReserves", + Handler: _Query_PoolReserves_Handler, + }, + { + MethodName: "EstimateMultiHopSwap", + Handler: _Query_EstimateMultiHopSwap_Handler, + }, + { + MethodName: "EstimatePlaceLimitOrder", + Handler: _Query_EstimatePlaceLimitOrder_Handler, + }, + { + MethodName: "Pool", + Handler: _Query_Pool_Handler, + }, + { + MethodName: "PoolByID", + Handler: _Query_PoolByID_Handler, + }, + { + MethodName: "PoolMetadata", + Handler: _Query_PoolMetadata_Handler, + }, + { + MethodName: "PoolMetadataAll", + Handler: _Query_PoolMetadataAll_Handler, + }, + { + MethodName: "SimulateDeposit", + Handler: _Query_SimulateDeposit_Handler, + }, + { + MethodName: "SimulateWithdrawal", + Handler: _Query_SimulateWithdrawal_Handler, + }, + { + MethodName: "SimulatePlaceLimitOrder", + Handler: _Query_SimulatePlaceLimitOrder_Handler, + }, + { + MethodName: "SimulateWithdrawFilledLimitOrder", + Handler: _Query_SimulateWithdrawFilledLimitOrder_Handler, + }, + { + MethodName: "SimulateCancelLimitOrder", + Handler: _Query_SimulateCancelLimitOrder_Handler, + }, + { + MethodName: "SimulateMultiHopSwap", + Handler: _Query_SimulateMultiHopSwap_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "neutron/dex/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3307,46 +3645,53 @@ func (m *QueryAllUserDepositsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllUserDepositsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllUserDepositsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - if len(m.Deposits) > 0 { - for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetLimitOrderTrancheUserRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3356,26 +3701,31 @@ func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Marshal() (dAtA []byte, return dAtA[:n], nil } -func (m *QueryAllLimitOrderTrancheUserByAddressRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetLimitOrderTrancheUserRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllLimitOrderTrancheUserByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetLimitOrderTrancheUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if m.CalcWithdrawableShares { + i-- + if m.CalcWithdrawableShares { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- + dAtA[i] = 0x18 + } + if len(m.TrancheKey) > 0 { + i -= len(m.TrancheKey) + copy(dAtA[i:], m.TrancheKey) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TrancheKey))) + i-- dAtA[i] = 0x12 } if len(m.Address) > 0 { @@ -3388,7 +3738,7 @@ func (m *QueryAllLimitOrderTrancheUserByAddressRequest) MarshalToSizedBuffer(dAt return len(dAtA) - i, nil } -func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetLimitOrderTrancheUserResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3398,46 +3748,44 @@ func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Marshal() (dAtA []byte, return dAtA[:n], nil } -func (m *QueryAllLimitOrderTrancheUserByAddressResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetLimitOrderTrancheUserResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllLimitOrderTrancheUserByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetLimitOrderTrancheUserResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { + if m.WithdrawableShares != nil { { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.WithdrawableShares.Size() + i -= size + if _, err := m.WithdrawableShares.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } - if len(m.LimitOrders) > 0 { - for iNdEx := len(m.LimitOrders) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LimitOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if m.LimitOrderTrancheUser != nil { + { + size, err := m.LimitOrderTrancheUser.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryAllTickLiquidityRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllLimitOrderTrancheUserRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3447,12 +3795,12 @@ func (m *QueryAllTickLiquidityRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTickLiquidityRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheUserRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTickLiquidityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3467,26 +3815,12 @@ func (m *QueryAllTickLiquidityRequest) MarshalToSizedBuffer(dAtA []byte) (int, e i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - } - if len(m.TokenIn) > 0 { - i -= len(m.TokenIn) - copy(dAtA[i:], m.TokenIn) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) - i-- - dAtA[i] = 0x12 - } - if len(m.PairId) > 0 { - i -= len(m.PairId) - copy(dAtA[i:], m.PairId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryAllTickLiquidityResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllLimitOrderTrancheUserResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3496,12 +3830,12 @@ func (m *QueryAllTickLiquidityResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllTickLiquidityResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheUserResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllTickLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheUserResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3518,10 +3852,10 @@ func (m *QueryAllTickLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, i-- dAtA[i] = 0x12 } - if len(m.TickLiquidity) > 0 { - for iNdEx := len(m.TickLiquidity) - 1; iNdEx >= 0; iNdEx-- { + if len(m.LimitOrderTrancheUser) > 0 { + for iNdEx := len(m.LimitOrderTrancheUser) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TickLiquidity[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.LimitOrderTrancheUser[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3535,7 +3869,7 @@ func (m *QueryAllTickLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryGetInactiveLimitOrderTrancheRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetLimitOrderTrancheRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3545,12 +3879,12 @@ func (m *QueryGetInactiveLimitOrderTrancheRequest) Marshal() (dAtA []byte, err e return dAtA[:n], nil } -func (m *QueryGetInactiveLimitOrderTrancheRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetLimitOrderTrancheRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetInactiveLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3562,17 +3896,17 @@ func (m *QueryGetInactiveLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []b i-- dAtA[i] = 0x22 } - if m.TickIndex != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TickIndex)) - i-- - dAtA[i] = 0x18 - } if len(m.TokenIn) > 0 { i -= len(m.TokenIn) copy(dAtA[i:], m.TokenIn) i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + } + if m.TickIndex != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TickIndex)) + i-- + dAtA[i] = 0x10 } if len(m.PairId) > 0 { i -= len(m.PairId) @@ -3584,7 +3918,7 @@ func (m *QueryGetInactiveLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []b return len(dAtA) - i, nil } -func (m *QueryGetInactiveLimitOrderTrancheResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetLimitOrderTrancheResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3594,19 +3928,19 @@ func (m *QueryGetInactiveLimitOrderTrancheResponse) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *QueryGetInactiveLimitOrderTrancheResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetLimitOrderTrancheResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetInactiveLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.InactiveLimitOrderTranche != nil { + if m.LimitOrderTranche != nil { { - size, err := m.InactiveLimitOrderTranche.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.LimitOrderTranche.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3619,7 +3953,7 @@ func (m *QueryGetInactiveLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA [] return len(dAtA) - i, nil } -func (m *QueryAllInactiveLimitOrderTrancheRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllLimitOrderTrancheRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3629,12 +3963,12 @@ func (m *QueryAllInactiveLimitOrderTrancheRequest) Marshal() (dAtA []byte, err e return dAtA[:n], nil } -func (m *QueryAllInactiveLimitOrderTrancheRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllInactiveLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3649,12 +3983,26 @@ func (m *QueryAllInactiveLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []b i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x1a + } + if len(m.TokenIn) > 0 { + i -= len(m.TokenIn) + copy(dAtA[i:], m.TokenIn) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) + i-- + dAtA[i] = 0x12 + } + if len(m.PairId) > 0 { + i -= len(m.PairId) + copy(dAtA[i:], m.PairId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryAllInactiveLimitOrderTrancheResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllLimitOrderTrancheResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3664,12 +4012,12 @@ func (m *QueryAllInactiveLimitOrderTrancheResponse) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *QueryAllInactiveLimitOrderTrancheResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllInactiveLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3686,10 +4034,10 @@ func (m *QueryAllInactiveLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA [] i-- dAtA[i] = 0x12 } - if len(m.InactiveLimitOrderTranche) > 0 { - for iNdEx := len(m.InactiveLimitOrderTranche) - 1; iNdEx >= 0; iNdEx-- { + if len(m.LimitOrderTranche) > 0 { + for iNdEx := len(m.LimitOrderTranche) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.InactiveLimitOrderTranche[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.LimitOrderTranche[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3703,7 +4051,7 @@ func (m *QueryAllInactiveLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA [] return len(dAtA) - i, nil } -func (m *QueryAllPoolReservesRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllUserDepositsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3713,16 +4061,26 @@ func (m *QueryAllPoolReservesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllPoolReservesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllUserDepositsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllPoolReservesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllUserDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.IncludePoolData { + i-- + if m.IncludePoolData { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } if m.Pagination != nil { { size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) @@ -3733,26 +4091,19 @@ func (m *QueryAllPoolReservesRequest) MarshalToSizedBuffer(dAtA []byte) (int, er i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - } - if len(m.TokenIn) > 0 { - i -= len(m.TokenIn) - copy(dAtA[i:], m.TokenIn) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) - i-- dAtA[i] = 0x12 } - if len(m.PairId) > 0 { - i -= len(m.PairId) - copy(dAtA[i:], m.PairId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryAllPoolReservesResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllUserDepositsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3762,12 +4113,12 @@ func (m *QueryAllPoolReservesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllPoolReservesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllUserDepositsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllPoolReservesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllUserDepositsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3784,10 +4135,10 @@ func (m *QueryAllPoolReservesResponse) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x12 } - if len(m.PoolReserves) > 0 { - for iNdEx := len(m.PoolReserves) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Deposits) > 0 { + for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.PoolReserves[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3801,7 +4152,7 @@ func (m *QueryAllPoolReservesResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *QueryGetPoolReservesRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3811,44 +4162,39 @@ func (m *QueryGetPoolReservesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetPoolReservesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheUserByAddressRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetPoolReservesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheUserByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Fee != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Fee)) - i-- - dAtA[i] = 0x20 - } - if m.TickIndex != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TickIndex)) - i-- - dAtA[i] = 0x18 - } - if len(m.TokenIn) > 0 { - i -= len(m.TokenIn) - copy(dAtA[i:], m.TokenIn) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } - if len(m.PairId) > 0 { - i -= len(m.PairId) - copy(dAtA[i:], m.PairId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetPoolReservesResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3858,19 +4204,19 @@ func (m *QueryGetPoolReservesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetPoolReservesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheUserByAddressResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetPoolReservesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllLimitOrderTrancheUserByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.PoolReserves != nil { + if m.Pagination != nil { { - size, err := m.PoolReserves.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3878,12 +4224,26 @@ func (m *QueryGetPoolReservesResponse) MarshalToSizedBuffer(dAtA []byte) (int, e i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if len(m.LimitOrders) > 0 { + for iNdEx := len(m.LimitOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LimitOrders[iNdEx].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 *QueryEstimateMultiHopSwapRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllTickLiquidityRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3893,78 +4253,46 @@ func (m *QueryEstimateMultiHopSwapRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryEstimateMultiHopSwapRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllTickLiquidityRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryEstimateMultiHopSwapRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllTickLiquidityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.PickBestRoute { - i-- - if m.PickBestRoute { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x30 - } - { - size := m.ExitLimitPrice.Size() - i -= size - if _, err := m.ExitLimitPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x2a - { - size := m.AmountIn.Size() - i -= size - if _, err := m.AmountIn.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.Routes) > 0 { - for iNdEx := len(m.Routes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Routes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Receiver) > 0 { - i -= len(m.Receiver) - copy(dAtA[i:], m.Receiver) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Receiver))) + if len(m.TokenIn) > 0 { + i -= len(m.TokenIn) + copy(dAtA[i:], m.TokenIn) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) i-- dAtA[i] = 0x12 } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) + if len(m.PairId) > 0 { + i -= len(m.PairId) + copy(dAtA[i:], m.PairId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryEstimateMultiHopSwapResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllTickLiquidityResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3974,30 +4302,46 @@ func (m *QueryEstimateMultiHopSwapResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryEstimateMultiHopSwapResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllTickLiquidityResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryEstimateMultiHopSwapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllTickLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size := m.CoinOut.Size() - i -= size - if _, err := m.CoinOut.MarshalTo(dAtA[i:]); err != nil { - return 0, err + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.TickLiquidity) > 0 { + for iNdEx := len(m.TickLiquidity) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TickLiquidity[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryEstimatePlaceLimitOrderRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetInactiveLimitOrderTrancheRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4007,90 +4351,46 @@ func (m *QueryEstimatePlaceLimitOrderRequest) Marshal() (dAtA []byte, err error) return dAtA[:n], nil } -func (m *QueryEstimatePlaceLimitOrderRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetInactiveLimitOrderTrancheRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryEstimatePlaceLimitOrderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetInactiveLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.MaxAmountOut != nil { - { - size := m.MaxAmountOut.Size() - i -= size - if _, err := m.MaxAmountOut.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.ExpirationTime != nil { - n21, err21 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ExpirationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime):]) - if err21 != nil { - return 0, err21 - } - i -= n21 - i = encodeVarintQuery(dAtA, i, uint64(n21)) - i-- - dAtA[i] = 0x42 - } - if m.OrderType != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.OrderType)) - i-- - dAtA[i] = 0x38 - } - { - size := m.AmountIn.Size() - i -= size - if _, err := m.AmountIn.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if m.TickIndexInToOut != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TickIndexInToOut)) + if len(m.TrancheKey) > 0 { + i -= len(m.TrancheKey) + copy(dAtA[i:], m.TrancheKey) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TrancheKey))) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x22 } - if len(m.TokenOut) > 0 { - i -= len(m.TokenOut) - copy(dAtA[i:], m.TokenOut) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenOut))) + if m.TickIndex != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TickIndex)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x18 } if len(m.TokenIn) > 0 { i -= len(m.TokenIn) copy(dAtA[i:], m.TokenIn) i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) i-- - dAtA[i] = 0x1a - } - if len(m.Receiver) > 0 { - i -= len(m.Receiver) - copy(dAtA[i:], m.Receiver) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Receiver))) - i-- dAtA[i] = 0x12 } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) + if len(m.PairId) > 0 { + i -= len(m.PairId) + copy(dAtA[i:], m.PairId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryEstimatePlaceLimitOrderResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetInactiveLimitOrderTrancheResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4100,50 +4400,32 @@ func (m *QueryEstimatePlaceLimitOrderResponse) Marshal() (dAtA []byte, err error return dAtA[:n], nil } -func (m *QueryEstimatePlaceLimitOrderResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetInactiveLimitOrderTrancheResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryEstimatePlaceLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetInactiveLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size := m.SwapOutCoin.Size() - i -= size - if _, err := m.SwapOutCoin.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.SwapInCoin.Size() - i -= size - if _, err := m.SwapInCoin.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.TotalInCoin.Size() - i -= size - if _, err := m.TotalInCoin.MarshalTo(dAtA[i:]); err != nil { - return 0, err + if m.InactiveLimitOrderTranche != nil { + { + size, err := m.InactiveLimitOrderTranche.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryPoolRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllInactiveLimitOrderTrancheRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4153,37 +4435,32 @@ func (m *QueryPoolRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryPoolRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllInactiveLimitOrderTrancheRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllInactiveLimitOrderTrancheRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Fee != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Fee)) - i-- - dAtA[i] = 0x18 - } - if m.TickIndex != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TickIndex)) - i-- - dAtA[i] = 0x10 - } - if len(m.PairId) > 0 { - i -= len(m.PairId) - copy(dAtA[i:], m.PairId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) + if m.Pagination != nil { + { + size, err := m.Pagination.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 *QueryPoolByIDRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllInactiveLimitOrderTrancheResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4193,47 +4470,68 @@ func (m *QueryPoolByIDRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryPoolByIDRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllInactiveLimitOrderTrancheResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryPoolByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllInactiveLimitOrderTrancheResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryPoolResponse) 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[i] = 0x12 + } + if len(m.InactiveLimitOrderTranche) > 0 { + for iNdEx := len(m.InactiveLimitOrderTranche) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InactiveLimitOrderTranche[iNdEx].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 *QueryAllPoolReservesRequest) 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 *QueryPoolResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllPoolReservesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllPoolReservesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pool != nil { + if m.Pagination != nil { { - size, err := m.Pool.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4241,12 +4539,26 @@ func (m *QueryPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x1a + } + if len(m.TokenIn) > 0 { + i -= len(m.TokenIn) + copy(dAtA[i:], m.TokenIn) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) + i-- + dAtA[i] = 0x12 + } + if len(m.PairId) > 0 { + i -= len(m.PairId) + copy(dAtA[i:], m.PairId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryGetPoolMetadataRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllPoolReservesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4256,25 +4568,46 @@ func (m *QueryGetPoolMetadataRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetPoolMetadataRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllPoolReservesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetPoolMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllPoolReservesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x8 + dAtA[i] = 0x12 + } + if len(m.PoolReserves) > 0 { + for iNdEx := len(m.PoolReserves) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolReserves[iNdEx].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 *QueryGetPoolMetadataResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetPoolReservesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4284,30 +4617,44 @@ func (m *QueryGetPoolMetadataResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetPoolMetadataResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetPoolReservesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetPoolMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetPoolReservesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.PoolMetadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if m.Fee != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Fee)) + i-- + dAtA[i] = 0x20 + } + if m.TickIndex != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TickIndex)) + i-- + dAtA[i] = 0x18 + } + if len(m.TokenIn) > 0 { + i -= len(m.TokenIn) + copy(dAtA[i:], m.TokenIn) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) + i-- + dAtA[i] = 0x12 + } + if len(m.PairId) > 0 { + i -= len(m.PairId) + copy(dAtA[i:], m.PairId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryAllPoolMetadataRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetPoolReservesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4317,19 +4664,19 @@ func (m *QueryAllPoolMetadataRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllPoolMetadataRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetPoolReservesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllPoolMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetPoolReservesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { + if m.PoolReserves != nil { { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.PoolReserves.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4342,7 +4689,7 @@ func (m *QueryAllPoolMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *QueryAllPoolMetadataResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryEstimateMultiHopSwapRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4352,32 +4699,50 @@ func (m *QueryAllPoolMetadataResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllPoolMetadataResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryEstimateMultiHopSwapRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllPoolMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryEstimateMultiHopSwapRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if m.PickBestRoute { + i-- + if m.PickBestRoute { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x30 } - if len(m.PoolMetadata) > 0 { - for iNdEx := len(m.PoolMetadata) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.ExitLimitPrice.Size() + i -= size + if _, err := m.ExitLimitPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.AmountIn.Size() + i -= size + if _, err := m.AmountIn.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Routes) > 0 { + for iNdEx := len(m.Routes) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.PoolMetadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Routes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4385,652 +4750,2785 @@ func (m *QueryAllPoolMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, e i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x1a } } + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryEstimateMultiHopSwapResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *QueryEstimateMultiHopSwapResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetLimitOrderTrancheUserRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryEstimateMultiHopSwapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TrancheKey) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.CalcWithdrawableShares { - n += 2 + { + size := m.CoinOut.Size() + i -= size + if _, err := m.CoinOut.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryGetLimitOrderTrancheUserResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.LimitOrderTrancheUser != nil { - l = m.LimitOrderTrancheUser.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.WithdrawableShares != nil { - l = m.WithdrawableShares.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryEstimatePlaceLimitOrderRequest) 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 n + return dAtA[:n], nil } -func (m *QueryAllLimitOrderTrancheUserRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QueryEstimatePlaceLimitOrderRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllLimitOrderTrancheUserResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryEstimatePlaceLimitOrderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.LimitOrderTrancheUser) > 0 { - for _, e := range m.LimitOrderTrancheUser { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.MaxAmountOut != nil { + { + size := m.MaxAmountOut.Size() + i -= size + if _, err := m.MaxAmountOut.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x4a } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.ExpirationTime != nil { + n21, err21 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ExpirationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime):]) + if err21 != nil { + return 0, err21 + } + i -= n21 + i = encodeVarintQuery(dAtA, i, uint64(n21)) + i-- + dAtA[i] = 0x42 } - return n -} - -func (m *QueryGetLimitOrderTrancheRequest) Size() (n int) { - if m == nil { - return 0 + if m.OrderType != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.OrderType)) + i-- + dAtA[i] = 0x38 } - var l int - _ = l - l = len(m.PairId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + { + size := m.AmountIn.Size() + i -= size + if _, err := m.AmountIn.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.TickIndex != 0 { - n += 1 + sovQuery(uint64(m.TickIndex)) + i-- + dAtA[i] = 0x32 + if m.TickIndexInToOut != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TickIndexInToOut)) + i-- + dAtA[i] = 0x28 } - l = len(m.TokenIn) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.TokenOut) > 0 { + i -= len(m.TokenOut) + copy(dAtA[i:], m.TokenOut) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenOut))) + i-- + dAtA[i] = 0x22 } - l = len(m.TrancheKey) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.TokenIn) > 0 { + i -= len(m.TokenIn) + copy(dAtA[i:], m.TokenIn) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) + i-- + dAtA[i] = 0x1a } - return n -} - -func (m *QueryGetLimitOrderTrancheResponse) Size() (n int) { - if m == nil { - return 0 + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x12 } - var l int - _ = l - if m.LimitOrderTranche != nil { - l = m.LimitOrderTranche.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryAllLimitOrderTrancheRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PairId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TokenIn) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryEstimatePlaceLimitOrderResponse) 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 n + return dAtA[:n], nil } -func (m *QueryAllLimitOrderTrancheResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryEstimatePlaceLimitOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEstimatePlaceLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.LimitOrderTranche) > 0 { - for _, e := range m.LimitOrderTranche { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size := m.SwapOutCoin.Size() + i -= size + if _, err := m.SwapOutCoin.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + i-- + dAtA[i] = 0x1a + { + size := m.SwapInCoin.Size() + i -= size + if _, err := m.SwapInCoin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0x12 + { + size := m.TotalInCoin.Size() + i -= size + if _, err := m.TotalInCoin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryAllUserDepositsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryPoolRequest) 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 *QueryPoolRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.Fee != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Fee)) + i-- + dAtA[i] = 0x18 } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.TickIndex != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TickIndex)) + i-- + dAtA[i] = 0x10 } - if m.IncludePoolData { - n += 2 + if len(m.PairId) > 0 { + i -= len(m.PairId) + copy(dAtA[i:], m.PairId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PairId))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryAllUserDepositsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryPoolByIDRequest) 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 n + return dAtA[:n], nil } -func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryPoolByIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.PoolId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryPoolResponse) 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 *QueryPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.LimitOrders) > 0 { - for _, e := range m.LimitOrders { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Pool != nil { + { + size, err := m.Pool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *QueryAllTickLiquidityRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGetPoolMetadataRequest) 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 *QueryGetPoolMetadataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPoolMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.PairId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TokenIn) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryAllTickLiquidityResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGetPoolMetadataResponse) 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 *QueryGetPoolMetadataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPoolMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.TickLiquidity) > 0 { - for _, e := range m.TickLiquidity { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.PoolMetadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryGetInactiveLimitOrderTrancheRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PairId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TokenIn) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.TickIndex != 0 { - n += 1 + sovQuery(uint64(m.TickIndex)) - } - l = len(m.TrancheKey) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryAllPoolMetadataRequest) 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 n + return dAtA[:n], nil } -func (m *QueryGetInactiveLimitOrderTrancheResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.InactiveLimitOrderTranche != nil { - l = m.InactiveLimitOrderTranche.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QueryAllPoolMetadataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllInactiveLimitOrderTrancheRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryAllPoolMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryAllInactiveLimitOrderTrancheResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryAllPoolMetadataResponse) 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 *QueryAllPoolMetadataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPoolMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.InactiveLimitOrderTranche) > 0 { - for _, e := range m.InactiveLimitOrderTranche { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.PoolMetadata) > 0 { + for iNdEx := len(m.PoolMetadata) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolMetadata[iNdEx].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 *QueryAllPoolReservesRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulateDepositRequest) 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 *QuerySimulateDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.PairId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TokenIn) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Msg != nil { + { + size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryAllPoolReservesResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulateDepositResponse) 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 *QuerySimulateDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.PoolReserves) > 0 { - for _, e := range m.PoolReserves { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Resp != nil { + { + size, err := m.Resp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *QueryGetPoolReservesRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulateWithdrawalRequest) 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 *QuerySimulateWithdrawalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateWithdrawalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.PairId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TokenIn) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.TickIndex != 0 { - n += 1 + sovQuery(uint64(m.TickIndex)) - } - if m.Fee != 0 { - n += 1 + sovQuery(uint64(m.Fee)) + if m.Msg != nil { + { + size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryGetPoolReservesResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulateWithdrawalResponse) 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 *QuerySimulateWithdrawalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateWithdrawalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.PoolReserves != nil { - l = m.PoolReserves.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Resp != nil { + { + size, err := m.Resp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryEstimateMultiHopSwapRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulatePlaceLimitOrderRequest) 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 *QuerySimulatePlaceLimitOrderRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulatePlaceLimitOrderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Receiver) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Routes) > 0 { - for _, e := range m.Routes { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Msg != nil { + { + size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - l = m.AmountIn.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.ExitLimitPrice.Size() - n += 1 + l + sovQuery(uint64(l)) - if m.PickBestRoute { - n += 2 - } - return n + return len(dAtA) - i, nil } -func (m *QueryEstimateMultiHopSwapResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulatePlaceLimitOrderResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - l = m.CoinOut.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return dAtA[:n], nil } -func (m *QueryEstimatePlaceLimitOrderRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QuerySimulatePlaceLimitOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulatePlaceLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.Resp != nil { + { + size, err := m.Resp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - l = len(m.Receiver) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TokenIn) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TokenOut) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.TickIndexInToOut != 0 { - n += 1 + sovQuery(uint64(m.TickIndexInToOut)) - } - l = m.AmountIn.Size() - n += 1 + l + sovQuery(uint64(l)) - if m.OrderType != 0 { - n += 1 + sovQuery(uint64(m.OrderType)) - } - if m.ExpirationTime != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime) - n += 1 + l + sovQuery(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - if m.MaxAmountOut != nil { - l = m.MaxAmountOut.Size() - n += 1 + l + sovQuery(uint64(l)) + return dAtA[:n], nil +} + +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Msg != nil { + { + size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryEstimatePlaceLimitOrderResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) 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 *QuerySimulateWithdrawFilledLimitOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.TotalInCoin.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.SwapInCoin.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.SwapOutCoin.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + if m.Resp != nil { + { + size, err := m.Resp.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 *QueryPoolRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulateCancelLimitOrderRequest) 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 *QuerySimulateCancelLimitOrderRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateCancelLimitOrderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.PairId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.Msg != nil { + { + size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - if m.TickIndex != 0 { - n += 1 + sovQuery(uint64(m.TickIndex)) + return len(dAtA) - i, nil +} + +func (m *QuerySimulateCancelLimitOrderResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - if m.Fee != 0 { - n += 1 + sovQuery(uint64(m.Fee)) + return dAtA[:n], nil +} + +func (m *QuerySimulateCancelLimitOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateCancelLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Resp != nil { + { + size, err := m.Resp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryPoolByIDRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulateMultiHopSwapRequest) 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 *QuerySimulateMultiHopSwapRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateMultiHopSwapRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.PoolId != 0 { - n += 1 + sovQuery(uint64(m.PoolId)) + if m.Msg != nil { + { + size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryPoolResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySimulateMultiHopSwapResponse) 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 *QuerySimulateMultiHopSwapResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySimulateMultiHopSwapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Pool != nil { - l = m.Pool.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Resp != nil { + { + size, err := m.Resp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryGetPoolMetadataRequest) Size() (n int) { +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } return n } -func (m *QueryGetPoolMetadataResponse) Size() (n int) { +func (m *QueryParamsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.PoolMetadata.Size() + l = m.Params.Size() n += 1 + l + sovQuery(uint64(l)) return n } -func (m *QueryAllPoolMetadataRequest) Size() (n int) { +func (m *QueryGetLimitOrderTrancheUserRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Pagination != nil { - l = m.Pagination.Size() + l = len(m.Address) + if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = len(m.TrancheKey) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.CalcWithdrawableShares { + n += 2 + } return n } -func (m *QueryAllPoolMetadataResponse) Size() (n int) { +func (m *QueryGetLimitOrderTrancheUserResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.PoolMetadata) > 0 { - for _, e := range m.PoolMetadata { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.LimitOrderTrancheUser != nil { + l = m.LimitOrderTrancheUser.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.WithdrawableShares != nil { + l = m.WithdrawableShares.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllLimitOrderTrancheUserRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllLimitOrderTrancheUserResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LimitOrderTrancheUser) > 0 { + for _, e := range m.LimitOrderTrancheUser { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetLimitOrderTrancheRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PairId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.TickIndex != 0 { + n += 1 + sovQuery(uint64(m.TickIndex)) + } + l = len(m.TokenIn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TrancheKey) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetLimitOrderTrancheResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LimitOrderTranche != nil { + l = m.LimitOrderTranche.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllLimitOrderTrancheRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PairId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TokenIn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllLimitOrderTrancheResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LimitOrderTranche) > 0 { + for _, e := range m.LimitOrderTranche { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllUserDepositsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.IncludePoolData { + n += 2 + } + return n +} + +func (m *QueryAllUserDepositsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Deposits) > 0 { + for _, e := range m.Deposits { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LimitOrders) > 0 { + for _, e := range m.LimitOrders { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllTickLiquidityRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PairId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TokenIn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllTickLiquidityResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.TickLiquidity) > 0 { + for _, e := range m.TickLiquidity { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetInactiveLimitOrderTrancheRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PairId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TokenIn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.TickIndex != 0 { + n += 1 + sovQuery(uint64(m.TickIndex)) + } + l = len(m.TrancheKey) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetInactiveLimitOrderTrancheResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.InactiveLimitOrderTranche != nil { + l = m.InactiveLimitOrderTranche.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllInactiveLimitOrderTrancheRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllInactiveLimitOrderTrancheResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.InactiveLimitOrderTranche) > 0 { + for _, e := range m.InactiveLimitOrderTranche { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPoolReservesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PairId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TokenIn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPoolReservesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PoolReserves) > 0 { + for _, e := range m.PoolReserves { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetPoolReservesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PairId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TokenIn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.TickIndex != 0 { + n += 1 + sovQuery(uint64(m.TickIndex)) + } + if m.Fee != 0 { + n += 1 + sovQuery(uint64(m.Fee)) + } + return n +} + +func (m *QueryGetPoolReservesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolReserves != nil { + l = m.PoolReserves.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryEstimateMultiHopSwapRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Routes) > 0 { + for _, e := range m.Routes { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + l = m.AmountIn.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.ExitLimitPrice.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.PickBestRoute { + n += 2 + } + return n +} + +func (m *QueryEstimateMultiHopSwapResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.CoinOut.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryEstimatePlaceLimitOrderRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TokenIn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TokenOut) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.TickIndexInToOut != 0 { + n += 1 + sovQuery(uint64(m.TickIndexInToOut)) + } + l = m.AmountIn.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.OrderType != 0 { + n += 1 + sovQuery(uint64(m.OrderType)) + } + if m.ExpirationTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime) + n += 1 + l + sovQuery(uint64(l)) + } + if m.MaxAmountOut != nil { + l = m.MaxAmountOut.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryEstimatePlaceLimitOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.TotalInCoin.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.SwapInCoin.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.SwapOutCoin.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryPoolRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PairId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.TickIndex != 0 { + n += 1 + sovQuery(uint64(m.TickIndex)) + } + if m.Fee != 0 { + n += 1 + sovQuery(uint64(m.Fee)) + } + return n +} + +func (m *QueryPoolByIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolId != 0 { + n += 1 + sovQuery(uint64(m.PoolId)) + } + return n +} + +func (m *QueryPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pool != nil { + l = m.Pool.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetPoolMetadataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryGetPoolMetadataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PoolMetadata.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPoolMetadataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPoolMetadataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PoolMetadata) > 0 { + for _, e := range m.PoolMetadata { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateDepositRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Msg != nil { + l = m.Msg.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resp != nil { + l = m.Resp.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateWithdrawalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Msg != nil { + l = m.Msg.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateWithdrawalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resp != nil { + l = m.Resp.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulatePlaceLimitOrderRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Msg != nil { + l = m.Msg.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulatePlaceLimitOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resp != nil { + l = m.Resp.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Msg != nil { + l = m.Msg.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resp != nil { + l = m.Resp.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateCancelLimitOrderRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Msg != nil { + l = m.Msg.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateCancelLimitOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resp != nil { + l = m.Resp.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateMultiHopSwapRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Msg != nil { + l = m.Msg.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySimulateMultiHopSwapResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resp != nil { + l = m.Resp.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Params.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 *QueryGetLimitOrderTrancheUserRequest) 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: QueryGetLimitOrderTrancheUserRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetLimitOrderTrancheUserRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrancheKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrancheKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CalcWithdrawableShares", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CalcWithdrawableShares = bool(v != 0) + 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 *QueryGetLimitOrderTrancheUserResponse) 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: QueryGetLimitOrderTrancheUserResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetLimitOrderTrancheUserResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderTrancheUser", 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 m.LimitOrderTrancheUser == nil { + m.LimitOrderTrancheUser = &LimitOrderTrancheUser{} + } + if err := m.LimitOrderTrancheUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawableShares", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.WithdrawableShares = &v + if err := m.WithdrawableShares.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 *QueryAllLimitOrderTrancheUserRequest) 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: QueryAllLimitOrderTrancheUserRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryAllLimitOrderTrancheUserResponse) 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: QueryAllLimitOrderTrancheUserResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderTrancheUser", 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 + } + m.LimitOrderTrancheUser = append(m.LimitOrderTrancheUser, &LimitOrderTrancheUser{}) + if err := m.LimitOrderTrancheUser[len(m.LimitOrderTrancheUser)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryGetLimitOrderTrancheRequest) 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: QueryGetLimitOrderTrancheRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetLimitOrderTrancheRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PairId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) + } + m.TickIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TickIndex |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenIn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrancheKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrancheKey = string(dAtA[iNdEx:postIndex]) + 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 *QueryGetLimitOrderTrancheResponse) 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: QueryGetLimitOrderTrancheResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetLimitOrderTrancheResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderTranche", 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 m.LimitOrderTranche == nil { + m.LimitOrderTranche = &LimitOrderTranche{} + } + if err := m.LimitOrderTranche.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 *QueryAllLimitOrderTrancheRequest) 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: QueryAllLimitOrderTrancheRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllLimitOrderTrancheRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PairId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenIn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryAllLimitOrderTrancheResponse) 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: QueryAllLimitOrderTrancheResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllLimitOrderTrancheResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderTranche", 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 + } + m.LimitOrderTranche = append(m.LimitOrderTranche, &LimitOrderTranche{}) + if err := m.LimitOrderTranche[len(m.LimitOrderTranche)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllUserDepositsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5053,12 +7551,100 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllUserDepositsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllUserDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludePoolData", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludePoolData = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5080,7 +7666,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllUserDepositsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5103,15 +7689,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllUserDepositsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllUserDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5138,7 +7724,44 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Deposits = append(m.Deposits, &DepositRecord{}) + if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5163,7 +7786,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetLimitOrderTrancheUserRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5186,10 +7809,10 @@ func (m *QueryGetLimitOrderTrancheUserRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetLimitOrderTrancheUserRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserByAddressRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetLimitOrderTrancheUserRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5226,41 +7849,9 @@ func (m *QueryGetLimitOrderTrancheUserRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TrancheKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TrancheKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CalcWithdrawableShares", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5270,12 +7861,28 @@ func (m *QueryGetLimitOrderTrancheUserRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.CalcWithdrawableShares = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5297,7 +7904,7 @@ func (m *QueryGetLimitOrderTrancheUserRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5320,15 +7927,15 @@ func (m *QueryGetLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetLimitOrderTrancheUserResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserByAddressResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetLimitOrderTrancheUserResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderTrancheUser", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrders", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5355,18 +7962,16 @@ func (m *QueryGetLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.LimitOrderTrancheUser == nil { - m.LimitOrderTrancheUser = &LimitOrderTrancheUser{} - } - if err := m.LimitOrderTrancheUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.LimitOrders = append(m.LimitOrders, &LimitOrderTrancheUser{}) + if err := m.LimitOrders[len(m.LimitOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithdrawableShares", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5376,25 +7981,25 @@ func (m *QueryGetLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - var v cosmossdk_io_math.Int - m.WithdrawableShares = &v - if err := m.WithdrawableShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5419,7 +8024,7 @@ func (m *QueryGetLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllLimitOrderTrancheUserRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllTickLiquidityRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5442,13 +8047,77 @@ func (m *QueryAllLimitOrderTrancheUserRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllTickLiquidityRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllTickLiquidityRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PairId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenIn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } @@ -5505,7 +8174,7 @@ func (m *QueryAllLimitOrderTrancheUserRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllTickLiquidityResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5528,15 +8197,15 @@ func (m *QueryAllLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllTickLiquidityResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllTickLiquidityResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderTrancheUser", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TickLiquidity", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5563,8 +8232,8 @@ func (m *QueryAllLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.LimitOrderTrancheUser = append(m.LimitOrderTrancheUser, &LimitOrderTrancheUser{}) - if err := m.LimitOrderTrancheUser[len(m.LimitOrderTrancheUser)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.TickLiquidity = append(m.TickLiquidity, &TickLiquidity{}) + if err := m.TickLiquidity[len(m.TickLiquidity)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5625,7 +8294,7 @@ func (m *QueryAllLimitOrderTrancheUserResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetInactiveLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5648,10 +8317,10 @@ func (m *QueryGetLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetLimitOrderTrancheRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetInactiveLimitOrderTrancheRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetLimitOrderTrancheRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetInactiveLimitOrderTrancheRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5687,6 +8356,38 @@ func (m *QueryGetLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { m.PairId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenIn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) } @@ -5705,11 +8406,93 @@ func (m *QueryGetLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { break } } - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TrancheKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrancheKey = string(dAtA[iNdEx:postIndex]) + 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 *QueryGetInactiveLimitOrderTrancheResponse) 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: QueryGetInactiveLimitOrderTrancheResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetInactiveLimitOrderTrancheResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InactiveLimitOrderTranche", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5719,29 +8502,83 @@ func (m *QueryGetLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.TokenIn = string(dAtA[iNdEx:postIndex]) + if m.InactiveLimitOrderTranche == nil { + m.InactiveLimitOrderTranche = &LimitOrderTranche{} + } + if err := m.InactiveLimitOrderTranche.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: + 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 *QueryAllInactiveLimitOrderTrancheRequest) 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: QueryAllInactiveLimitOrderTrancheRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllInactiveLimitOrderTrancheRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TrancheKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5751,23 +8588,27 @@ func (m *QueryGetLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.TrancheKey = string(dAtA[iNdEx:postIndex]) + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -5790,7 +8631,7 @@ func (m *QueryGetLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllInactiveLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5813,15 +8654,15 @@ func (m *QueryGetLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetLimitOrderTrancheResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllInactiveLimitOrderTrancheResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetLimitOrderTrancheResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllInactiveLimitOrderTrancheResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderTranche", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InactiveLimitOrderTranche", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5848,10 +8689,44 @@ func (m *QueryGetLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.LimitOrderTranche == nil { - m.LimitOrderTranche = &LimitOrderTranche{} + m.InactiveLimitOrderTranche = append(m.InactiveLimitOrderTranche, &LimitOrderTranche{}) + if err := m.InactiveLimitOrderTranche[len(m.InactiveLimitOrderTranche)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if err := m.LimitOrderTranche.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5876,7 +8751,7 @@ func (m *QueryGetLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllPoolReservesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5899,10 +8774,10 @@ func (m *QueryAllLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPoolReservesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPoolReservesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6026,7 +8901,7 @@ func (m *QueryAllLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllPoolReservesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6049,15 +8924,15 @@ func (m *QueryAllLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPoolReservesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPoolReservesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderTranche", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolReserves", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6084,8 +8959,8 @@ func (m *QueryAllLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.LimitOrderTranche = append(m.LimitOrderTranche, &LimitOrderTranche{}) - if err := m.LimitOrderTranche[len(m.LimitOrderTranche)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PoolReserves = append(m.PoolReserves, &PoolReserves{}) + if err := m.PoolReserves[len(m.PoolReserves)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6146,7 +9021,7 @@ func (m *QueryAllLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllUserDepositsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetPoolReservesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6169,15 +9044,15 @@ func (m *QueryAllUserDepositsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllUserDepositsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetPoolReservesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllUserDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetPoolReservesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6205,13 +9080,13 @@ func (m *QueryAllUserDepositsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.PairId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6221,33 +9096,29 @@ func (m *QueryAllUserDepositsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TokenIn = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IncludePoolData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) } - var v int + m.TickIndex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6257,12 +9128,30 @@ func (m *QueryAllUserDepositsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.TickIndex |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + m.Fee = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Fee |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.IncludePoolData = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -6284,72 +9173,38 @@ func (m *QueryAllUserDepositsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllUserDepositsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetPoolReservesResponse) 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: QueryAllUserDepositsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllUserDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposits", 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 shift >= 64 { + return ErrIntOverflowQuery } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Deposits = append(m.Deposits, &DepositRecord{}) - if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 2: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPoolReservesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPoolReservesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolReserves", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6376,10 +9231,10 @@ func (m *QueryAllUserDepositsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + if m.PoolReserves == nil { + m.PoolReserves = &PoolReserves{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.PoolReserves.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6404,7 +9259,7 @@ func (m *QueryAllUserDepositsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Unmarshal(dAtA []byte) error { +func (m *QueryEstimateMultiHopSwapRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6427,15 +9282,15 @@ func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Unmarshal(dAtA []byte) e fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserByAddressRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEstimateMultiHopSwapRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEstimateMultiHopSwapRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6463,13 +9318,13 @@ func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Unmarshal(dAtA []byte) e if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6479,83 +9334,63 @@ func (m *QueryAllLimitOrderTrancheUserByAddressRequest) Unmarshal(dAtA []byte) e } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Receiver = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Routes", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery + 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 (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + if msglen < 0 { + return ErrInvalidLengthQuery } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllLimitOrderTrancheUserByAddressResponse) 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 + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Routes = append(m.Routes, &MultiHopRoute{}) + if err := m.Routes[len(m.Routes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserByAddressResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLimitOrderTrancheUserByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitOrders", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AmountIn", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6565,31 +9400,31 @@ func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Unmarshal(dAtA []byte) } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.LimitOrders = append(m.LimitOrders, &LimitOrderTrancheUser{}) - if err := m.LimitOrders[len(m.LimitOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AmountIn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExitLimitPrice", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6599,28 +9434,46 @@ func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Unmarshal(dAtA []byte) } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ExitLimitPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PickBestRoute", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PickBestRoute = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -6642,7 +9495,7 @@ func (m *QueryAllLimitOrderTrancheUserByAddressResponse) Unmarshal(dAtA []byte) } return nil } -func (m *QueryAllTickLiquidityRequest) Unmarshal(dAtA []byte) error { +func (m *QueryEstimateMultiHopSwapResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6665,79 +9518,15 @@ func (m *QueryAllTickLiquidityRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllTickLiquidityRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEstimateMultiHopSwapResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTickLiquidityRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEstimateMultiHopSwapResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PairId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TokenIn = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CoinOut", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6764,10 +9553,7 @@ func (m *QueryAllTickLiquidityRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CoinOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6792,7 +9578,7 @@ func (m *QueryAllTickLiquidityRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllTickLiquidityResponse) Unmarshal(dAtA []byte) error { +func (m *QueryEstimatePlaceLimitOrderRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6815,17 +9601,17 @@ func (m *QueryAllTickLiquidityResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllTickLiquidityResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEstimatePlaceLimitOrderRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllTickLiquidityResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEstimatePlaceLimitOrderRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TickLiquidity", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6835,31 +9621,29 @@ func (m *QueryAllTickLiquidityResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.TickLiquidity = append(m.TickLiquidity, &TickLiquidity{}) - if err := m.TickLiquidity[len(m.TickLiquidity)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6869,81 +9653,27 @@ func (m *QueryAllTickLiquidityResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Receiver = string(dAtA[iNdEx:postIndex]) 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 *QueryGetInactiveLimitOrderTrancheRequest) 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: QueryGetInactiveLimitOrderTrancheRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetInactiveLimitOrderTrancheRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6971,11 +9701,11 @@ func (m *QueryGetInactiveLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - m.PairId = string(dAtA[iNdEx:postIndex]) + m.TokenIn = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenOut", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7003,13 +9733,13 @@ func (m *QueryGetInactiveLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - m.TokenIn = string(dAtA[iNdEx:postIndex]) + m.TokenOut = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TickIndexInToOut", wireType) } - m.TickIndex = 0 + m.TickIndexInToOut = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -7019,14 +9749,14 @@ func (m *QueryGetInactiveLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error } b := dAtA[iNdEx] iNdEx++ - m.TickIndex |= int64(b&0x7F) << shift + m.TickIndexInToOut |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 4: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TrancheKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AmountIn", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7054,61 +9784,32 @@ func (m *QueryGetInactiveLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - m.TrancheKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { + if err := m.AmountIn.Unmarshal(dAtA[iNdEx:postIndex]); 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 *QueryGetInactiveLimitOrderTrancheResponse) 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 + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.OrderType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OrderType |= LimitOrderType(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetInactiveLimitOrderTrancheResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetInactiveLimitOrderTrancheResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InactiveLimitOrderTranche", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7135,68 +9836,18 @@ func (m *QueryGetInactiveLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - if m.InactiveLimitOrderTranche == nil { - m.InactiveLimitOrderTranche = &LimitOrderTranche{} + if m.ExpirationTime == nil { + m.ExpirationTime = new(time.Time) } - if err := m.InactiveLimitOrderTranche.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.ExpirationTime, 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 *QueryAllInactiveLimitOrderTrancheRequest) 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: QueryAllInactiveLimitOrderTrancheRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllInactiveLimitOrderTrancheRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxAmountOut", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -7206,25 +9857,25 @@ func (m *QueryAllInactiveLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + var v cosmossdk_io_math.Int + m.MaxAmountOut = &v + if err := m.MaxAmountOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7249,7 +9900,7 @@ func (m *QueryAllInactiveLimitOrderTrancheRequest) Unmarshal(dAtA []byte) error } return nil } -func (m *QueryAllInactiveLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error { +func (m *QueryEstimatePlaceLimitOrderResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7272,15 +9923,15 @@ func (m *QueryAllInactiveLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllInactiveLimitOrderTrancheResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEstimatePlaceLimitOrderResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllInactiveLimitOrderTrancheResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEstimatePlaceLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InactiveLimitOrderTranche", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TotalInCoin", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7307,14 +9958,13 @@ func (m *QueryAllInactiveLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - m.InactiveLimitOrderTranche = append(m.InactiveLimitOrderTranche, &LimitOrderTranche{}) - if err := m.InactiveLimitOrderTranche[len(m.InactiveLimitOrderTranche)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TotalInCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SwapInCoin", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7341,10 +9991,40 @@ func (m *QueryAllInactiveLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + if err := m.SwapInCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapOutCoin", 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.SwapOutCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7369,7 +10049,7 @@ func (m *QueryAllInactiveLimitOrderTrancheResponse) Unmarshal(dAtA []byte) error } return nil } -func (m *QueryAllPoolReservesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7392,10 +10072,10 @@ func (m *QueryAllPoolReservesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPoolReservesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryPoolRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPoolReservesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryPoolRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7431,10 +10111,10 @@ func (m *QueryAllPoolReservesRequest) Unmarshal(dAtA []byte) error { m.PairId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) } - var stringLen uint64 + m.TickIndex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -7444,29 +10124,16 @@ func (m *QueryAllPoolReservesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.TickIndex |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TokenIn = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) } - var msglen int + m.Fee = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -7476,28 +10143,11 @@ func (m *QueryAllPoolReservesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Fee |= uint64(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 m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -7519,7 +10169,7 @@ func (m *QueryAllPoolReservesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPoolReservesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryPoolByIDRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7542,17 +10192,17 @@ func (m *QueryAllPoolReservesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPoolReservesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryPoolByIDRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPoolReservesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryPoolByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolReserves", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) } - var msglen int + m.PoolId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -7562,29 +10212,64 @@ func (m *QueryAllPoolReservesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.PoolId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.PoolReserves = append(m.PoolReserves, &PoolReserves{}) - if err := m.PoolReserves[len(m.PoolReserves)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPoolResponse) 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 } - iNdEx = postIndex - case 2: + 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: QueryPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7611,13 +10296,82 @@ func (m *QueryAllPoolReservesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + if m.Pool == nil { + m.Pool = &Pool{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Pool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex + 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 *QueryGetPoolMetadataRequest) 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: QueryGetPoolMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPoolMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -7639,7 +10393,7 @@ func (m *QueryAllPoolReservesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPoolReservesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetPoolMetadataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7662,17 +10416,17 @@ func (m *QueryGetPoolReservesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPoolReservesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetPoolMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPoolReservesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetPoolMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolMetadata", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -7682,94 +10436,25 @@ func (m *QueryGetPoolReservesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.PairId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.PoolMetadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.TokenIn = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) - } - m.TickIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TickIndex |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - m.Fee = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Fee |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -7791,7 +10476,7 @@ func (m *QueryGetPoolReservesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPoolReservesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllPoolMetadataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7814,15 +10499,15 @@ func (m *QueryGetPoolReservesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPoolReservesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPoolMetadataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPoolReservesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPoolMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolReserves", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7849,10 +10534,10 @@ func (m *QueryGetPoolReservesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PoolReserves == nil { - m.PoolReserves = &PoolReserves{} + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} } - if err := m.PoolReserves.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7877,7 +10562,7 @@ func (m *QueryGetPoolReservesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryEstimateMultiHopSwapRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllPoolMetadataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7900,79 +10585,15 @@ func (m *QueryEstimateMultiHopSwapRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryEstimateMultiHopSwapRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPoolMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEstimateMultiHopSwapRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPoolMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Receiver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Routes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolMetadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7999,50 +10620,16 @@ func (m *QueryEstimateMultiHopSwapRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Routes = append(m.Routes, &MultiHopRoute{}) - if err := m.Routes[len(m.Routes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountIn", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AmountIn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PoolMetadata = append(m.PoolMetadata, PoolMetadata{}) + if err := m.PoolMetadata[len(m.PoolMetadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitLimitPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -8052,46 +10639,28 @@ func (m *QueryEstimateMultiHopSwapRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ExitLimitPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PickBestRoute", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} } - m.PickBestRoute = bool(v != 0) + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -8113,7 +10682,7 @@ func (m *QueryEstimateMultiHopSwapRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryEstimateMultiHopSwapResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateDepositRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8136,15 +10705,15 @@ func (m *QueryEstimateMultiHopSwapResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryEstimateMultiHopSwapResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateDepositRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEstimateMultiHopSwapResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CoinOut", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8171,7 +10740,10 @@ func (m *QueryEstimateMultiHopSwapResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.CoinOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Msg == nil { + m.Msg = &MsgDeposit{} + } + if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8196,7 +10768,7 @@ func (m *QueryEstimateMultiHopSwapResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryEstimatePlaceLimitOrderRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateDepositResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8219,81 +10791,17 @@ func (m *QueryEstimatePlaceLimitOrderRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryEstimatePlaceLimitOrderRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateDepositResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEstimatePlaceLimitOrderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Receiver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resp", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -8303,169 +10811,83 @@ func (m *QueryEstimatePlaceLimitOrderRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.TokenIn = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOut", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery + if m.Resp == nil { + m.Resp = &MsgDepositResponse{} } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.Resp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.TokenOut = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TickIndexInToOut", wireType) - } - m.TickIndexInToOut = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TickIndexInToOut |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountIn", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if err := m.AmountIn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) - } - m.OrderType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OrderType |= LimitOrderType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", 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 + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySimulateWithdrawalRequest) 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 postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - if m.ExpirationTime == nil { - m.ExpirationTime = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 9: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySimulateWithdrawalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySimulateWithdrawalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAmountOut", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -8475,25 +10897,25 @@ func (m *QueryEstimatePlaceLimitOrderRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - var v cosmossdk_io_math.Int - m.MaxAmountOut = &v - if err := m.MaxAmountOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Msg == nil { + m.Msg = &MsgWithdrawal{} + } + if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8518,7 +10940,7 @@ func (m *QueryEstimatePlaceLimitOrderRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryEstimatePlaceLimitOrderResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateWithdrawalResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8541,15 +10963,15 @@ func (m *QueryEstimatePlaceLimitOrderResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryEstimatePlaceLimitOrderResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateWithdrawalResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEstimatePlaceLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateWithdrawalResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalInCoin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8576,46 +10998,66 @@ func (m *QueryEstimatePlaceLimitOrderResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalInCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Resp == nil { + m.Resp = &MsgWithdrawalResponse{} + } + if err := m.Resp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapInCoin", 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 - } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySimulatePlaceLimitOrderRequest) 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 } - if err := m.SwapInCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 3: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySimulatePlaceLimitOrderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySimulatePlaceLimitOrderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapOutCoin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8642,7 +11084,10 @@ func (m *QueryEstimatePlaceLimitOrderResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.SwapOutCoin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Msg == nil { + m.Msg = &MsgPlaceLimitOrder{} + } + if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8667,7 +11112,7 @@ func (m *QueryEstimatePlaceLimitOrderResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySimulatePlaceLimitOrderResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8690,17 +11135,17 @@ func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryPoolRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulatePlaceLimitOrderResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulatePlaceLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resp", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -8710,62 +11155,28 @@ func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.PairId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) - } - m.TickIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TickIndex |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + if m.Resp == nil { + m.Resp = &MsgPlaceLimitOrderResponse{} } - m.Fee = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Fee |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.Resp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -8787,7 +11198,7 @@ func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryPoolByIDRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateWithdrawFilledLimitOrderRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8810,17 +11221,17 @@ func (m *QueryPoolByIDRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryPoolByIDRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateWithdrawFilledLimitOrderRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateWithdrawFilledLimitOrderRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) } - m.PoolId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -8830,11 +11241,28 @@ func (m *QueryPoolByIDRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift + 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 m.Msg == nil { + m.Msg = &MsgWithdrawFilledLimitOrder{} + } + if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -8856,7 +11284,7 @@ func (m *QueryPoolByIDRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateWithdrawFilledLimitOrderResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8879,15 +11307,15 @@ func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryPoolResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateWithdrawFilledLimitOrderResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateWithdrawFilledLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8914,10 +11342,10 @@ func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pool == nil { - m.Pool = &Pool{} + if m.Resp == nil { + m.Resp = &MsgWithdrawFilledLimitOrderResponse{} } - if err := m.Pool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Resp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8942,7 +11370,7 @@ func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPoolMetadataRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateCancelLimitOrderRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8965,17 +11393,17 @@ func (m *QueryGetPoolMetadataRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPoolMetadataRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateCancelLimitOrderRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPoolMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateCancelLimitOrderRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) } - m.Id = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -8985,11 +11413,28 @@ func (m *QueryGetPoolMetadataRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Id |= uint64(b&0x7F) << shift + 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 m.Msg == nil { + m.Msg = &MsgCancelLimitOrder{} + } + if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -9011,7 +11456,7 @@ func (m *QueryGetPoolMetadataRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPoolMetadataResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateCancelLimitOrderResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9034,15 +11479,15 @@ func (m *QueryGetPoolMetadataResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPoolMetadataResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateCancelLimitOrderResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPoolMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateCancelLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolMetadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9069,7 +11514,10 @@ func (m *QueryGetPoolMetadataResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.PoolMetadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Resp == nil { + m.Resp = &MsgCancelLimitOrderResponse{} + } + if err := m.Resp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9094,7 +11542,7 @@ func (m *QueryGetPoolMetadataResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPoolMetadataRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateMultiHopSwapRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9117,15 +11565,15 @@ func (m *QueryAllPoolMetadataRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPoolMetadataRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateMultiHopSwapRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPoolMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateMultiHopSwapRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9152,10 +11600,10 @@ func (m *QueryAllPoolMetadataRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} + if m.Msg == nil { + m.Msg = &MsgMultiHopSwap{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9180,7 +11628,7 @@ func (m *QueryAllPoolMetadataRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPoolMetadataResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySimulateMultiHopSwapResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9203,49 +11651,15 @@ func (m *QueryAllPoolMetadataResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPoolMetadataResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySimulateMultiHopSwapResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPoolMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySimulateMultiHopSwapResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolMetadata", 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 - } - m.PoolMetadata = append(m.PoolMetadata, PoolMetadata{}) - if err := m.PoolMetadata[len(m.PoolMetadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9272,10 +11686,10 @@ func (m *QueryAllPoolMetadataResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + if m.Resp == nil { + m.Resp = &MsgMultiHopSwapResponse{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Resp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/dex/types/query.pb.gw.go b/x/dex/types/query.pb.gw.go index d460afbaa..d6f00e3b6 100644 --- a/x/dex/types/query.pb.gw.go +++ b/x/dex/types/query.pb.gw.go @@ -1473,6 +1473,222 @@ func local_request_Query_PoolMetadataAll_0(ctx context.Context, marshaler runtim } +var ( + filter_Query_SimulateDeposit_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SimulateDeposit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateDepositRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateDeposit_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SimulateDeposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SimulateDeposit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateDepositRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateDeposit_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SimulateDeposit(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SimulateWithdrawal_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SimulateWithdrawal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateWithdrawalRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateWithdrawal_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SimulateWithdrawal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SimulateWithdrawal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateWithdrawalRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateWithdrawal_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SimulateWithdrawal(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SimulatePlaceLimitOrder_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SimulatePlaceLimitOrder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulatePlaceLimitOrderRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulatePlaceLimitOrder_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SimulatePlaceLimitOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SimulatePlaceLimitOrder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulatePlaceLimitOrderRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulatePlaceLimitOrder_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SimulatePlaceLimitOrder(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SimulateWithdrawFilledLimitOrder_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SimulateWithdrawFilledLimitOrder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateWithdrawFilledLimitOrderRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateWithdrawFilledLimitOrder_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SimulateWithdrawFilledLimitOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SimulateWithdrawFilledLimitOrder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateWithdrawFilledLimitOrderRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateWithdrawFilledLimitOrder_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SimulateWithdrawFilledLimitOrder(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SimulateCancelLimitOrder_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SimulateCancelLimitOrder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateCancelLimitOrderRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateCancelLimitOrder_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SimulateCancelLimitOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SimulateCancelLimitOrder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateCancelLimitOrderRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateCancelLimitOrder_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SimulateCancelLimitOrder(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SimulateMultiHopSwap_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SimulateMultiHopSwap_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateMultiHopSwapRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateMultiHopSwap_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SimulateMultiHopSwap(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SimulateMultiHopSwap_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySimulateMultiHopSwapRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SimulateMultiHopSwap_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SimulateMultiHopSwap(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1939,6 +2155,144 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_SimulateDeposit_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_SimulateDeposit_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_SimulateDeposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulateWithdrawal_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_SimulateWithdrawal_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_SimulateWithdrawal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulatePlaceLimitOrder_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_SimulatePlaceLimitOrder_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_SimulatePlaceLimitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulateWithdrawFilledLimitOrder_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_SimulateWithdrawFilledLimitOrder_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_SimulateWithdrawFilledLimitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulateCancelLimitOrder_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_SimulateCancelLimitOrder_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_SimulateCancelLimitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulateMultiHopSwap_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_SimulateMultiHopSwap_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_SimulateMultiHopSwap_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -2380,6 +2734,126 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_SimulateDeposit_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_SimulateDeposit_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_SimulateDeposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulateWithdrawal_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_SimulateWithdrawal_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_SimulateWithdrawal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulatePlaceLimitOrder_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_SimulatePlaceLimitOrder_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_SimulatePlaceLimitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulateWithdrawFilledLimitOrder_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_SimulateWithdrawFilledLimitOrder_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_SimulateWithdrawFilledLimitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulateCancelLimitOrder_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_SimulateCancelLimitOrder_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_SimulateCancelLimitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SimulateMultiHopSwap_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_SimulateMultiHopSwap_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_SimulateMultiHopSwap_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -2423,6 +2897,18 @@ var ( pattern_Query_PoolMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"neutron", "dex", "pool_metadata", "id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PoolMetadataAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"neutron", "dex", "pool_metadata"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SimulateDeposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"neutron", "dex", "simulate_deposit"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SimulateWithdrawal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"neutron", "dex", "simulate_withdrawal"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SimulatePlaceLimitOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"neutron", "dex", "simulate_place_limit_order"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SimulateWithdrawFilledLimitOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"neutron", "dex", "simulate_withdraw_filled_limit_order"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SimulateCancelLimitOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"neutron", "dex", "simulate_cancel_limit_order"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SimulateMultiHopSwap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"neutron", "dex", "simulate_multi_hop_swap"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -2465,4 +2951,16 @@ var ( forward_Query_PoolMetadata_0 = runtime.ForwardResponseMessage forward_Query_PoolMetadataAll_0 = runtime.ForwardResponseMessage + + forward_Query_SimulateDeposit_0 = runtime.ForwardResponseMessage + + forward_Query_SimulateWithdrawal_0 = runtime.ForwardResponseMessage + + forward_Query_SimulatePlaceLimitOrder_0 = runtime.ForwardResponseMessage + + forward_Query_SimulateWithdrawFilledLimitOrder_0 = runtime.ForwardResponseMessage + + forward_Query_SimulateCancelLimitOrder_0 = runtime.ForwardResponseMessage + + forward_Query_SimulateMultiHopSwap_0 = runtime.ForwardResponseMessage ) diff --git a/x/dex/types/tick_liquidity.go b/x/dex/types/tick_liquidity.go index dcc1b5419..fa0f39f53 100644 --- a/x/dex/types/tick_liquidity.go +++ b/x/dex/types/tick_liquidity.go @@ -1,7 +1,7 @@ package types import ( - math_utils "github.com/neutron-org/neutron/v4/utils/math" + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) // NOTE: These methods should be avoided if possible. @@ -10,10 +10,10 @@ import ( func (t TickLiquidity) Price() math_utils.PrecDec { switch liquidity := t.Liquidity.(type) { case *TickLiquidity_LimitOrderTranche: - return liquidity.LimitOrderTranche.PriceTakerToMaker + return liquidity.LimitOrderTranche.MakerPrice case *TickLiquidity_PoolReserves: - return liquidity.PoolReserves.PriceTakerToMaker + return liquidity.PoolReserves.MakerPrice default: panic("Tick does not contain valid liqudityType") } diff --git a/x/dex/types/tick_liquidity.pb.go b/x/dex/types/tick_liquidity.pb.go index c35f64b63..4459f7771 100644 --- a/x/dex/types/tick_liquidity.pb.go +++ b/x/dex/types/tick_liquidity.pb.go @@ -131,8 +131,8 @@ var fileDescriptor_fda22cbad7301397 = []byte{ 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, 0xdd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, 0x2d, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, - 0x89, 0x7e, 0x05, 0x24, 0xd4, 0x2b, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x41, 0x60, 0x0c, 0x08, - 0x00, 0x00, 0xff, 0xff, 0x09, 0x66, 0xc9, 0x03, 0x91, 0x01, 0x00, 0x00, + 0xa9, 0x7e, 0x05, 0x24, 0xd4, 0x2b, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x41, 0x60, 0x0c, 0x08, + 0x00, 0x00, 0xff, 0xff, 0x97, 0xe5, 0x13, 0x9c, 0x91, 0x01, 0x00, 0x00, } func (m *TickLiquidity) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/types/tick_liquidity_key.go b/x/dex/types/tick_liquidity_key.go index 9ea116cfe..3949f52f2 100644 --- a/x/dex/types/tick_liquidity_key.go +++ b/x/dex/types/tick_liquidity_key.go @@ -1,8 +1,8 @@ package types -import math_utils "github.com/neutron-org/neutron/v4/utils/math" +import math_utils "github.com/neutron-org/neutron/v5/utils/math" type TickLiquidityKey interface { KeyMarshal() []byte - PriceTakerToMaker() (priceTakerToMaker math_utils.PrecDec, err error) + Price() (priceTakerToMaker math_utils.PrecDec, err error) } diff --git a/x/dex/types/tick_liquidity_test.go b/x/dex/types/tick_liquidity_test.go index 000251832..6591eea61 100644 --- a/x/dex/types/tick_liquidity_test.go +++ b/x/dex/types/tick_liquidity_test.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" "github.com/stretchr/testify/assert" - "github.com/neutron-org/neutron/v4/x/dex/types" + "github.com/neutron-org/neutron/v5/x/dex/types" ) func TestHasTokenEmptyReserves(t *testing.T) { diff --git a/x/dex/types/trade_pair_id.go b/x/dex/types/trade_pair_id.go index 54b8469b6..388ab7cdf 100644 --- a/x/dex/types/trade_pair_id.go +++ b/x/dex/types/trade_pair_id.go @@ -3,7 +3,7 @@ package types import ( sdkerrors "cosmossdk.io/errors" - math_utils "github.com/neutron-org/neutron/v4/utils/math" + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) func NewTradePairID(takerDenom, makerDenom string) (*TradePairID, error) { @@ -68,7 +68,7 @@ func (p TradePairID) MustPairID() *PairID { } func (p TradePairID) PairID() (*PairID, error) { - return NewPairIDFromUnsorted(p.MakerDenom, p.TakerDenom) + return NewPairID(p.MakerDenom, p.TakerDenom) } func (p TradePairID) Reversed() *TradePairID { @@ -91,12 +91,12 @@ func (p TradePairID) TickIndexNormalized(tickIndexTakerToMaker int64) int64 { return p.TickIndexTakerToMaker(tickIndexTakerToMaker) } -func (p TradePairID) PriceTakerToMaker(tickIndexNormalized int64) (priceTakerToMaker math_utils.PrecDec, err error) { +func (p TradePairID) MakerPrice(tickIndexNormalized int64) (priceTakerToMaker math_utils.PrecDec, err error) { return CalcPrice(p.TickIndexTakerToMaker(tickIndexNormalized)) } -func (p TradePairID) MustPriceTakerToMaker(tickIndexNormalized int64) (priceTakerToMaker math_utils.PrecDec) { - price, err := p.PriceTakerToMaker(tickIndexNormalized) +func (p TradePairID) MustMakerPrice(tickIndexNormalized int64) (priceTakerToMaker math_utils.PrecDec) { + price, err := p.MakerPrice(tickIndexNormalized) if err != nil { panic(err) } diff --git a/x/dex/types/trade_pair_id.pb.go b/x/dex/types/trade_pair_id.pb.go index d2d64ef4e..e881507f6 100644 --- a/x/dex/types/trade_pair_id.pb.go +++ b/x/dex/types/trade_pair_id.pb.go @@ -91,9 +91,9 @@ var fileDescriptor_e0082302b8bd9607 = []byte{ 0x14, 0x30, 0x43, 0x14, 0x94, 0xc0, 0x15, 0x38, 0xb9, 0x9f, 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, 0x6e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, - 0xd4, 0x09, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0x89, 0x7e, 0x05, 0xc4, 0xd1, 0x95, - 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xd7, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x31, 0x99, - 0x56, 0x83, 0xd0, 0x00, 0x00, 0x00, + 0xd4, 0x09, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0xa9, 0x7e, 0x05, 0xc4, 0xd1, 0x95, + 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xd7, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x1a, + 0x8c, 0x1c, 0xd0, 0x00, 0x00, 0x00, } func (m *TradePairID) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/types/tx.pb.go b/x/dex/types/tx.pb.go index 433e795c2..93681d614 100644 --- a/x/dex/types/tx.pb.go +++ b/x/dex/types/tx.pb.go @@ -16,7 +16,7 @@ import ( grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + github_com_neutron_org_neutron_v5_utils_math "github.com/neutron-org/neutron/v5/utils/math" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -272,9 +272,10 @@ func (m *FailedDeposit) GetError() string { } type MsgDepositResponse struct { - Reserve0Deposited []cosmossdk_io_math.Int `protobuf:"bytes,1,rep,name=reserve0_deposited,json=reserve0Deposited,proto3,customtype=cosmossdk.io/math.Int" json:"reserve0_deposited" yaml:"reserve0_deposited"` - Reserve1Deposited []cosmossdk_io_math.Int `protobuf:"bytes,2,rep,name=reserve1_deposited,json=reserve1Deposited,proto3,customtype=cosmossdk.io/math.Int" json:"reserve1_deposited" yaml:"reserve1_deposited"` - FailedDeposits []*FailedDeposit `protobuf:"bytes,3,rep,name=failed_deposits,json=failedDeposits,proto3" json:"failed_deposits,omitempty"` + Reserve0Deposited []cosmossdk_io_math.Int `protobuf:"bytes,1,rep,name=reserve0_deposited,json=reserve0Deposited,proto3,customtype=cosmossdk.io/math.Int" json:"reserve0_deposited" yaml:"reserve0_deposited"` + Reserve1Deposited []cosmossdk_io_math.Int `protobuf:"bytes,2,rep,name=reserve1_deposited,json=reserve1Deposited,proto3,customtype=cosmossdk.io/math.Int" json:"reserve1_deposited" yaml:"reserve1_deposited"` + FailedDeposits []*FailedDeposit `protobuf:"bytes,3,rep,name=failed_deposits,json=failedDeposits,proto3" json:"failed_deposits,omitempty"` + SharesIssued []github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,rep,name=shares_issued,json=sharesIssued,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"shares_issued" yaml:"shares_issued"` } func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } @@ -403,6 +404,9 @@ func (m *MsgWithdrawal) GetFees() []uint64 { } type MsgWithdrawalResponse struct { + Reserve0Withdrawn cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=reserve0_withdrawn,json=reserve0Withdrawn,proto3,customtype=cosmossdk.io/math.Int" json:"reserve0_withdrawn" yaml:"reserve0_withdrawn"` + Reserve1Withdrawn cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=reserve1_withdrawn,json=reserve1Withdrawn,proto3,customtype=cosmossdk.io/math.Int" json:"reserve1_withdrawn" yaml:"reserve1_withdrawn"` + SharesBurned []github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,rep,name=shares_burned,json=sharesBurned,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"shares_burned" yaml:"shares_burned"` } func (m *MsgWithdrawalResponse) Reset() { *m = MsgWithdrawalResponse{} } @@ -450,7 +454,11 @@ type MsgPlaceLimitOrder struct { // expirationTime is only valid iff orderType == GOOD_TIL_TIME. ExpirationTime *time.Time `protobuf:"bytes,9,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time,omitempty"` MaxAmountOut *cosmossdk_io_math.Int `protobuf:"bytes,10,opt,name=max_amount_out,json=maxAmountOut,proto3,customtype=cosmossdk.io/math.Int" json:"max_amount_out" yaml:"max_amount_out"` - LimitSellPrice *github_com_neutron_org_neutron_v4_utils_math.PrecDec `protobuf:"bytes,11,opt,name=limit_sell_price,json=limitSellPrice,proto3,customtype=github.com/neutron-org/neutron/v4/utils/math.PrecDec" json:"limit_sell_price" yaml:"limit_sell_price"` + LimitSellPrice *github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,11,opt,name=limit_sell_price,json=limitSellPrice,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"limit_sell_price" yaml:"limit_sell_price"` + // min_average_sell_price is an optional parameter that sets a required minimum average price for the entire trade. + // if the min_average_sell_price is not met the trade will fail. + // If min_average_sell_price is omitted limit_sell_price will be used instead + MinAverageSellPrice *github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,12,opt,name=min_average_sell_price,json=minAverageSellPrice,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"min_average_sell_price" yaml:"min_average_sell_price"` } func (m *MsgPlaceLimitOrder) Reset() { *m = MsgPlaceLimitOrder{} } @@ -545,6 +553,8 @@ type MsgPlaceLimitOrderResponse struct { // executing the limit order. It does not include any future proceeds from the // maker portion which will have withdrawn in the future TakerCoinOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=taker_coin_out,json=takerCoinOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"taker_coin_out" yaml:"taker_coin_out"` + // Total amount of the token in that was immediately swapped for takerOutCoin + TakerCoinIn github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=taker_coin_in,json=takerCoinIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"taker_coin_in" yaml:"taker_coin_in"` } func (m *MsgPlaceLimitOrderResponse) Reset() { *m = MsgPlaceLimitOrderResponse{} } @@ -640,6 +650,10 @@ func (m *MsgWithdrawFilledLimitOrder) GetTrancheKey() string { } type MsgWithdrawFilledLimitOrderResponse struct { + // Total amount of taker reserves that were withdrawn + TakerCoinOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,1,opt,name=taker_coin_out,json=takerCoinOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"taker_coin_out" yaml:"taker_coin_out"` + // Total amount of maker reserves that were withdrawn --only applies to inactive LimitOrders + MakerCoinOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=maker_coin_out,json=makerCoinOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"maker_coin_out" yaml:"maker_coin_out"` } func (m *MsgWithdrawFilledLimitOrderResponse) Reset() { *m = MsgWithdrawFilledLimitOrderResponse{} } @@ -728,6 +742,10 @@ func (m *MsgCancelLimitOrder) GetTrancheKey() string { } type MsgCancelLimitOrderResponse struct { + // Total amount of taker reserves that were withdrawn + TakerCoinOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,1,opt,name=taker_coin_out,json=takerCoinOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"taker_coin_out" yaml:"taker_coin_out"` + // Total amount of maker reserves that were canceled + MakerCoinOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=maker_coin_out,json=makerCoinOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"maker_coin_out" yaml:"maker_coin_out"` } func (m *MsgCancelLimitOrderResponse) Reset() { *m = MsgCancelLimitOrderResponse{} } @@ -812,7 +830,7 @@ type MsgMultiHopSwap struct { Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` Routes []*MultiHopRoute `protobuf:"bytes,3,rep,name=routes,proto3" json:"routes,omitempty"` AmountIn cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=amount_in,json=amountIn,proto3,customtype=cosmossdk.io/math.Int" json:"amount_in" yaml:"amount_in"` - ExitLimitPrice github_com_neutron_org_neutron_v4_utils_math.PrecDec `protobuf:"bytes,5,opt,name=exit_limit_price,json=exitLimitPrice,proto3,customtype=github.com/neutron-org/neutron/v4/utils/math.PrecDec" json:"exit_limit_price" yaml:"exit_limit_price"` + ExitLimitPrice github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,5,opt,name=exit_limit_price,json=exitLimitPrice,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"exit_limit_price" yaml:"exit_limit_price"` // If pickBestRoute == true then all routes are run and the route with the // best price is chosen otherwise, the first succesful route is used. PickBestRoute bool `protobuf:"varint,6,opt,name=pick_best_route,json=pickBestRoute,proto3" json:"pick_best_route,omitempty"` @@ -880,7 +898,9 @@ func (m *MsgMultiHopSwap) GetPickBestRoute() bool { } type MsgMultiHopSwapResponse struct { - CoinOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,1,opt,name=coin_out,json=coinOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin_out"` + CoinOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,1,opt,name=coin_out,json=coinOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin_out" yaml:"coin_out"` + Route *MultiHopRoute `protobuf:"bytes,2,opt,name=route,proto3" json:"route,omitempty"` + Dust []github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,rep,name=dust,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"dust" yaml:"dust"` } func (m *MsgMultiHopSwapResponse) Reset() { *m = MsgMultiHopSwapResponse{} } @@ -916,6 +936,13 @@ func (m *MsgMultiHopSwapResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMultiHopSwapResponse proto.InternalMessageInfo +func (m *MsgMultiHopSwapResponse) GetRoute() *MultiHopRoute { + if m != nil { + return m.Route + } + return nil +} + type MsgUpdateParams struct { // Authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` @@ -1034,113 +1061,129 @@ func init() { func init() { proto.RegisterFile("neutron/dex/tx.proto", fileDescriptor_a489f6e187d5e074) } var fileDescriptor_a489f6e187d5e074 = []byte{ - // 1687 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0x4f, 0xdb, 0x89, 0x3f, 0x2a, 0x89, 0xe3, 0x74, 0x32, 0xeb, 0x8e, 0x07, 0xdc, 0x56, 0xcf, - 0xb2, 0x63, 0x22, 0x62, 0x4f, 0xc2, 0xb2, 0x07, 0x23, 0x21, 0xd9, 0xf9, 0xd8, 0x35, 0x6b, 0xaf, - 0xa3, 0x8e, 0x57, 0x48, 0xbb, 0x12, 0x4d, 0xdb, 0x5d, 0x71, 0x5a, 0x69, 0x77, 0x99, 0xae, 0xb2, - 0xd7, 0xe1, 0xc2, 0x8a, 0xe3, 0x8a, 0xc3, 0x5c, 0x38, 0xf1, 0x0f, 0xc0, 0x6d, 0x0e, 0x9c, 0x39, - 0xe7, 0xc6, 0x08, 0x09, 0x09, 0x81, 0x30, 0x68, 0xe6, 0x30, 0xd2, 0x1c, 0x73, 0xe6, 0x80, 0xaa, - 0xba, 0xfa, 0xc3, 0xed, 0x7c, 0x4c, 0x86, 0xd1, 0x5e, 0xe2, 0xaa, 0xf7, 0x5e, 0xbd, 0x7a, 0xf5, - 0x7b, 0xef, 0xfd, 0xaa, 0x3a, 0x60, 0xd3, 0x86, 0x23, 0xe2, 0x20, 0xbb, 0x62, 0xc0, 0x49, 0x85, - 0x4c, 0xca, 0x43, 0x07, 0x11, 0x24, 0x2e, 0x73, 0x69, 0xd9, 0x80, 0x93, 0xfc, 0xba, 0x3e, 0x30, - 0x6d, 0x54, 0x61, 0x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x47, 0xba, 0x69, 0x41, 0xc3, 0x4b, 0xa6, 0x0c, 0x96, 0x0d, 0x77, 0xa8, 0x99, 0xc6, 0x84, 0x25, - 0x74, 0x51, 0x05, 0x5c, 0xd4, 0x30, 0x26, 0xe2, 0x26, 0x58, 0x82, 0x8e, 0x83, 0xbc, 0x84, 0xba, - 0x13, 0xe5, 0x9f, 0x31, 0x20, 0x06, 0x6e, 0x55, 0x88, 0x87, 0xc8, 0xc6, 0x50, 0xfc, 0x35, 0x10, - 0x1d, 0x88, 0xa1, 0x33, 0x86, 0x4f, 0x34, 0xee, 0x03, 0x1a, 0x92, 0xc0, 0xe0, 0x3d, 0xbe, 0x0b, - 0xde, 0x6b, 0x96, 0x5e, 0x4d, 0xe5, 0x2d, 0x17, 0xe7, 0x79, 0x9d, 0xa2, 0xae, 0x7b, 0xc2, 0x03, - 0x4f, 0x16, 0x0a, 0x60, 0x37, 0x14, 0x40, 0xec, 0x7e, 0x01, 0xec, 0xde, 0x12, 0xc0, 0xee, 0x75, - 0x01, 0xec, 0x06, 0x01, 0xec, 0x83, 0xb5, 0x53, 0x06, 0xb0, 0x67, 0x87, 0xa5, 0x38, 0x4b, 0x60, - 0x7e, 0x26, 0x81, 0x33, 0x49, 0x50, 0x33, 0xa7, 0xe1, 0x29, 0x56, 0xfe, 0x16, 0x03, 0xab, 0x2d, - 0xdc, 0xff, 0x99, 0x49, 0xce, 0x0c, 0x47, 0xff, 0x4a, 0xb7, 0xbe, 0xb5, 0x9e, 0x1b, 0x83, 0x2c, - 0x3e, 0xd3, 0x1d, 0x88, 0x69, 0xc5, 0x3a, 0x70, 0x80, 0xc6, 0x90, 0xb7, 0x5e, 0xf3, 0x2e, 0xf4, - 0xe6, 0x16, 0x5e, 0x4d, 0xe5, 0x9c, 0x8b, 0x5d, 0x54, 0xa3, 0xa8, 0x19, 0x57, 0xd4, 0x41, 0x2a, - 0x13, 0xdc, 0xd4, 0x31, 0x89, 0xdb, 0x3b, 0x26, 0x19, 0x74, 0x4c, 0x55, 0x89, 0x96, 0xfe, 0x3a, - 0x2f, 0xfd, 0x00, 0x45, 0x25, 0x07, 0x1e, 0xcc, 0x08, 0xbc, 0xba, 0x55, 0xfe, 0xb2, 0xc4, 0xca, - 0xf9, 0xd8, 0xd2, 0x7b, 0xb0, 0x69, 0x0e, 0x4c, 0xd2, 0x76, 0x0c, 0xe8, 0xbc, 0x25, 0xea, 0x5b, - 0x20, 0xe5, 0x82, 0x6b, 0xda, 0x1c, 0x76, 0x17, 0xec, 0x86, 0x2d, 0x3e, 0x04, 0x69, 0x57, 0x85, - 0x46, 0x84, 0x23, 0xef, 0xda, 0xb6, 0x47, 0x44, 0xdc, 0x03, 0x9b, 0x01, 0x06, 0x9a, 0x69, 0x53, - 0x08, 0xa8, 0xdd, 0x52, 0x51, 0x28, 0xc5, 0xeb, 0x31, 0x49, 0x50, 0xb3, 0x3e, 0x10, 0x0d, 0xbb, - 0x83, 0xe8, 0x1a, 0x9f, 0xc6, 0xe8, 0x66, 0x49, 0xea, 0xf0, 0x8d, 0x69, 0x4c, 0x33, 0xed, 0x28, - 0x8d, 0x69, 0xa6, 0xed, 0xd3, 0x58, 0xc3, 0x16, 0xab, 0x00, 0x20, 0x8a, 0x83, 0x46, 0x2e, 0x86, - 0x50, 0x4a, 0x15, 0x85, 0x52, 0x26, 0xc2, 0x43, 0x01, 0x56, 0x9d, 0x8b, 0x21, 0x54, 0xd3, 0xc8, - 0x1b, 0x8a, 0x2d, 0xb0, 0x06, 0x27, 0x43, 0xd3, 0xd1, 0x29, 0x31, 0x69, 0xf4, 0x36, 0x93, 0xd2, - 0x45, 0x81, 0xf5, 0x81, 0x7b, 0xd5, 0x95, 0xbd, 0xab, 0xae, 0xdc, 0xf1, 0xae, 0xba, 0x7a, 0xea, - 0x72, 0x2a, 0x0b, 0x4f, 0xff, 0x2d, 0x0b, 0x6a, 0x26, 0x58, 0x4c, 0xd5, 0xa2, 0x0d, 0x32, 0x03, - 0x7d, 0xa2, 0xf1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0xfd, 0xdb, 0xb4, 0x61, 0x9f, 0x33, 0x0d, 0x36, - 0xe7, 0x33, 0xac, 0x9d, 0xf7, 0x79, 0x5d, 0xc5, 0xe7, 0x97, 0xbe, 0xa6, 0x3d, 0x54, 0xff, 0xf8, - 0xf2, 0x45, 0x41, 0x78, 0xfe, 0xa2, 0x20, 0xfc, 0xe7, 0x45, 0x41, 0x78, 0xfa, 0xb2, 0xb0, 0xf0, - 0xfc, 0x65, 0x61, 0xe1, 0xef, 0x2f, 0x0b, 0x0b, 0x5f, 0xec, 0xdc, 0xcd, 0x95, 0x13, 0xf7, 0x5f, - 0x41, 0x94, 0x22, 0xba, 0x09, 0xf6, 0x16, 0xfd, 0xe1, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2a, - 0x07, 0x8e, 0x98, 0x26, 0x12, 0x00, 0x00, + // 1940 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcb, 0x6f, 0x23, 0x49, + 0x19, 0x4f, 0xdb, 0x79, 0xd8, 0x95, 0xc4, 0xf1, 0x74, 0x32, 0x93, 0x1e, 0x0f, 0xa4, 0xad, 0x9e, + 0xd5, 0x8e, 0x19, 0x31, 0xf6, 0x78, 0x60, 0xf7, 0x90, 0x03, 0x92, 0x9d, 0xc7, 0xae, 0x59, 0x7b, + 0x12, 0xf5, 0x78, 0x05, 0xda, 0x95, 0x68, 0xda, 0xee, 0x8a, 0xd3, 0x4a, 0x77, 0x97, 0xd5, 0x55, + 0x76, 0x1c, 0x2e, 0xac, 0x10, 0xa7, 0x3d, 0xed, 0x05, 0x81, 0xc4, 0x3f, 0x00, 0x12, 0x87, 0x39, + 0xec, 0x99, 0xf3, 0x70, 0x5b, 0x21, 0x21, 0x01, 0x07, 0x03, 0x33, 0x87, 0x91, 0xf6, 0x98, 0x03, + 0x5c, 0x10, 0x42, 0xf5, 0x70, 0xbf, 0xec, 0x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 0x2f, 0x29, 0x16, 0x6c, 0x49, 0xfc, 0x6b, 0xbf, 0xbe, 0x06, 0xbf, 0xde, 0x05, + 0xab, 0xad, 0x81, 0x43, 0xec, 0x77, 0x51, 0x5f, 0x47, 0x03, 0x02, 0x69, 0x0f, 0x7d, 0x8c, 0xfa, + 0x98, 0xbf, 0x37, 0xea, 0xec, 0x59, 0xfb, 0x7d, 0x1a, 0xac, 0xb5, 0x70, 0x6f, 0xa2, 0xf8, 0xe4, + 0xd4, 0xec, 0x7f, 0xc1, 0x2e, 0xeb, 0x11, 0x58, 0xf4, 0xe9, 0x32, 0xb3, 0x5f, 0xcc, 0x62, 0x4c, + 0x74, 0xa1, 0x19, 0xef, 0x96, 0xe6, 0x5f, 0x73, 0xb7, 0x44, 0x5b, 0x06, 0x38, 0xb2, 0x89, 0xc1, + 0x6f, 0x71, 0x7e, 0x29, 0x2f, 0x04, 0x2d, 0xc3, 0xdc, 0x97, 0x69, 0x19, 0x92, 0x76, 0xc3, 0x96, + 0x21, 0x29, 0xd1, 0x68, 0xeb, 0x64, 0x13, 0x16, 0xdb, 0xbc, 0x65, 0x78, 0x13, 0xac, 0xf5, 0x69, + 0x5b, 0xd9, 0x81, 0x98, 0x18, 0xec, 0x20, 0x94, 0x45, 0xf6, 0x71, 0x68, 0x95, 0xc2, 0x75, 0x88, + 0x09, 0x3b, 0xa4, 0xed, 0x37, 0x92, 0x59, 0xb4, 0x2e, 0xb2, 0x28, 0xea, 0x2c, 0xed, 0x0f, 0x29, + 0xb0, 0x99, 0xc0, 0x82, 0xec, 0xf9, 0xb9, 0x04, 0x32, 0xaf, 0x9e, 0x37, 0x8f, 0xaf, 0x1f, 0x99, + 0x99, 0x48, 0x4c, 0xae, 0x45, 0xee, 0x61, 0x16, 0x8d, 0xec, 0x8e, 0xa6, 0x69, 0xf2, 0x10, 0x2c, + 0xf0, 0x6d, 0xa6, 0x44, 0xc3, 0x79, 0x71, 0x60, 0x70, 0x45, 0x79, 0x00, 0xe6, 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0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x95, 0x04, 0x7c, 0xe0, + 0xdf, 0x18, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1667,6 +1710,20 @@ func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SharesIssued) > 0 { + for iNdEx := len(m.SharesIssued) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.SharesIssued[iNdEx].Size() + i -= size + if _, err := m.SharesIssued[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } if len(m.FailedDeposits) > 0 { for iNdEx := len(m.FailedDeposits) - 1; iNdEx >= 0; iNdEx-- { { @@ -1834,6 +1891,40 @@ func (m *MsgWithdrawalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SharesBurned) > 0 { + for iNdEx := len(m.SharesBurned) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.SharesBurned[iNdEx].Size() + i -= size + if _, err := m.SharesBurned[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size := m.Reserve1Withdrawn.Size() + i -= size + if _, err := m.Reserve1Withdrawn.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Reserve0Withdrawn.Size() + i -= size + if _, err := m.Reserve0Withdrawn.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1857,6 +1948,18 @@ func (m *MsgPlaceLimitOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MinAverageSellPrice != nil { + { + size := m.MinAverageSellPrice.Size() + i -= size + if _, err := m.MinAverageSellPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } if m.LimitSellPrice != nil { { size := m.LimitSellPrice.Size() @@ -1962,6 +2065,16 @@ func (m *MsgPlaceLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + { + size := m.TakerCoinIn.Size() + i -= size + if _, err := m.TakerCoinIn.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 { size := m.TakerCoinOut.Size() i -= size @@ -2049,6 +2162,26 @@ func (m *MsgWithdrawFilledLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) _ = i var l int _ = l + { + size := m.MakerCoinOut.Size() + i -= size + if _, err := m.MakerCoinOut.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.TakerCoinOut.Size() + i -= size + if _, err := m.TakerCoinOut.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2109,6 +2242,26 @@ func (m *MsgCancelLimitOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l + { + size := m.MakerCoinOut.Size() + i -= size + if _, err := m.MakerCoinOut.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.TakerCoinOut.Size() + i -= size + if _, err := m.TakerCoinOut.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2245,6 +2398,32 @@ func (m *MsgMultiHopSwapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if len(m.Dust) > 0 { + for iNdEx := len(m.Dust) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Dust[iNdEx].Size() + i -= size + if _, err := m.Dust[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Route != nil { + { + size, err := m.Route.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } { size := m.CoinOut.Size() i -= size @@ -2444,6 +2623,12 @@ func (m *MsgDepositResponse) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } + if len(m.SharesIssued) > 0 { + for _, e := range m.SharesIssued { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -2498,6 +2683,16 @@ func (m *MsgWithdrawalResponse) Size() (n int) { } var l int _ = l + l = m.Reserve0Withdrawn.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.Reserve1Withdrawn.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.SharesBurned) > 0 { + for _, e := range m.SharesBurned { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -2543,6 +2738,10 @@ func (m *MsgPlaceLimitOrder) Size() (n int) { l = m.LimitSellPrice.Size() n += 1 + l + sovTx(uint64(l)) } + if m.MinAverageSellPrice != nil { + l = m.MinAverageSellPrice.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2560,6 +2759,8 @@ func (m *MsgPlaceLimitOrderResponse) Size() (n int) { n += 1 + l + sovTx(uint64(l)) l = m.TakerCoinOut.Size() n += 1 + l + sovTx(uint64(l)) + l = m.TakerCoinIn.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -2586,6 +2787,10 @@ func (m *MsgWithdrawFilledLimitOrderResponse) Size() (n int) { } var l int _ = l + l = m.TakerCoinOut.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.MakerCoinOut.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -2612,6 +2817,10 @@ func (m *MsgCancelLimitOrderResponse) Size() (n int) { } var l int _ = l + l = m.TakerCoinOut.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.MakerCoinOut.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -2668,6 +2877,16 @@ func (m *MsgMultiHopSwapResponse) Size() (n int) { _ = l l = m.CoinOut.Size() n += 1 + l + sovTx(uint64(l)) + if m.Route != nil { + l = m.Route.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Dust) > 0 { + for _, e := range m.Dust { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -3463,6 +3682,40 @@ func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharesIssued", 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 + } + m.SharesIssued = append(m.SharesIssued, github_com_cosmos_cosmos_sdk_types.Coin{}) + if err := m.SharesIssued[len(m.SharesIssued)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3879,59 +4132,9 @@ func (m *MsgWithdrawalResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgWithdrawalResponse: 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 *MsgPlaceLimitOrder) 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: MsgPlaceLimitOrder: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceLimitOrder: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Reserve0Withdrawn", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3959,11 +4162,13 @@ func (m *MsgPlaceLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Creator = string(dAtA[iNdEx:postIndex]) + if err := m.Reserve0Withdrawn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Reserve1Withdrawn", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3991,13 +4196,15 @@ func (m *MsgPlaceLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Receiver = string(dAtA[iNdEx:postIndex]) + if err := m.Reserve1Withdrawn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SharesBurned", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4007,37 +4214,185 @@ func (m *MsgPlaceLimitOrder) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.TokenIn = string(dAtA[iNdEx:postIndex]) + m.SharesBurned = append(m.SharesBurned, github_com_cosmos_cosmos_sdk_types.Coin{}) + if err := m.SharesBurned[len(m.SharesBurned)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOut", wireType) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] + 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 *MsgPlaceLimitOrder) 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: MsgPlaceLimitOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceLimitOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", 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.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", 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.TokenIn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenOut", 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 { @@ -4231,12 +4586,48 @@ func (m *MsgPlaceLimitOrder) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_neutron_org_neutron_v4_utils_math.PrecDec + var v github_com_neutron_org_neutron_v5_utils_math.PrecDec m.LimitSellPrice = &v if err := m.LimitSellPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinAverageSellPrice", 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 + } + var v github_com_neutron_org_neutron_v5_utils_math.PrecDec + m.MinAverageSellPrice = &v + if err := m.MinAverageSellPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4385,6 +4776,39 @@ func (m *MsgPlaceLimitOrderResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerCoinIn", 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.TakerCoinIn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4549,6 +4973,72 @@ func (m *MsgWithdrawFilledLimitOrderResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgWithdrawFilledLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerCoinOut", 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.TakerCoinOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MakerCoinOut", 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.MakerCoinOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4713,6 +5203,72 @@ func (m *MsgCancelLimitOrderResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgCancelLimitOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerCoinOut", 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.TakerCoinOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MakerCoinOut", 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.MakerCoinOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -5114,6 +5670,76 @@ func (m *MsgMultiHopSwapResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Route", 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 m.Route == nil { + m.Route = &MultiHopRoute{} + } + if err := m.Route.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dust", 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 + } + m.Dust = append(m.Dust, github_com_cosmos_cosmos_sdk_types.Coin{}) + if err := m.Dust[len(m.Dust)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/dex/types/types.go b/x/dex/types/types.go deleted file mode 100644 index 18196ebae..000000000 --- a/x/dex/types/types.go +++ /dev/null @@ -1,17 +0,0 @@ -package types - -const ( - // EventTypeNeutronMessage defines the event type used by the Interchain Queries module events. - EventTypeNeutronMessage = "neutron" - - AttributeDenom = "denom" - AttributeWithdrawn = "total_withdrawn" - AttributeGasConsumed = "gas_consumed" - AttributeLiquidityTickType = "liquidity_tick_type" - AttributeLp = "lp" - AttributeLimitOrder = "limit_order" - AttributeIsExpiringLimitOrder = "is_expiring_limit_order" - AttributeInc = "inc" - AttributeDec = "dec" - AttributePairID = "pair_id" -) diff --git a/x/dex/types/v2/params.pb.go b/x/dex/types/v2/params.pb.go index b6e4ad499..c40889fe5 100644 --- a/x/dex/types/v2/params.pb.go +++ b/x/dex/types/v2/params.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + github_com_neutron_org_neutron_v5_utils_math "github.com/neutron-org/neutron/v5/utils/math" io "io" math "math" math_bits "math/bits" @@ -27,7 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { FeeTiers []uint64 `protobuf:"varint,1,rep,packed,name=fee_tiers,json=feeTiers,proto3" json:"fee_tiers,omitempty"` - MaxTrueTakerSpread github_com_neutron_org_neutron_v4_utils_math.PrecDec `protobuf:"bytes,2,opt,name=max_true_taker_spread,json=maxTrueTakerSpread,proto3,customtype=github.com/neutron-org/neutron/v4/utils/math.PrecDec" json:"max_true_taker_spread" yaml:"max_true_taker_spread"` + MaxTrueTakerSpread github_com_neutron_org_neutron_v5_utils_math.PrecDec `protobuf:"bytes,2,opt,name=max_true_taker_spread,json=maxTrueTakerSpread,proto3,customtype=github.com/neutron-org/neutron/v5/utils/math.PrecDec" json:"max_true_taker_spread" yaml:"max_true_taker_spread"` } func (m *Params) Reset() { *m = Params{} } @@ -87,14 +87,14 @@ var fileDescriptor_d05490f4c0ad856f = []byte{ 0x92, 0xc4, 0xec, 0xd4, 0xa2, 0xf8, 0xe2, 0x82, 0xa2, 0xd4, 0xc4, 0x14, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x4e, 0xa7, 0xd2, 0x13, 0xf7, 0xe4, 0x19, 0x6e, 0xdd, 0x93, 0x37, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0x3a, 0x40, 0x37, 0xbf, 0x28, 0x1d, 0xc6, 0xd6, - 0x2f, 0x33, 0xd1, 0x2f, 0x2d, 0xc9, 0xcc, 0x29, 0xd6, 0xcf, 0x4d, 0x2c, 0xc9, 0xd0, 0x0b, 0x28, + 0x2f, 0x33, 0xd5, 0x2f, 0x2d, 0xc9, 0xcc, 0x29, 0xd6, 0xcf, 0x4d, 0x2c, 0xc9, 0xd0, 0x0b, 0x28, 0x4a, 0x4d, 0x76, 0x49, 0x4d, 0x7e, 0x75, 0x4f, 0x1e, 0xbb, 0xe1, 0x9f, 0xee, 0xc9, 0xcb, 0x54, 0x26, 0xe6, 0xe6, 0x58, 0x29, 0x61, 0x95, 0x56, 0x0a, 0x12, 0xca, 0x4d, 0xac, 0x08, 0x29, 0x2a, 0x4d, 0x0d, 0x01, 0x89, 0x06, 0x83, 0x05, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x3a, 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, 0x03, 0xc2, 0x4e, 0xac, 0x00, 0x87, 0x68, 0x49, 0x65, 0x41, 0x6a, 0xb1, 0x7e, 0x99, 0x51, 0x12, 0x1b, 0x38, 0xac, 0x8c, 0x01, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x45, 0xe3, 0x59, 0xc8, 0x70, 0x01, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xda, 0xae, 0xd3, 0x9e, 0x70, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/dex/utils/math.go b/x/dex/utils/math.go index 1a369aab3..e87314e26 100644 --- a/x/dex/utils/math.go +++ b/x/dex/utils/math.go @@ -8,7 +8,7 @@ import ( sdkmath "cosmossdk.io/math" - math_utils "github.com/neutron-org/neutron/v4/utils/math" + math_utils "github.com/neutron-org/neutron/v5/utils/math" ) // Return the base value for price, 1.0001 diff --git a/x/dex/utils/math_test.go b/x/dex/utils/math_test.go index fa52da35c..1459c0a92 100644 --- a/x/dex/utils/math_test.go +++ b/x/dex/utils/math_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - math_utils "github.com/neutron-org/neutron/v4/utils/math" - "github.com/neutron-org/neutron/v4/x/dex/utils" + math_utils "github.com/neutron-org/neutron/v5/utils/math" + "github.com/neutron-org/neutron/v5/x/dex/utils" ) func TestParsePrecDecScientificNotation(t *testing.T) { diff --git a/x/dynamicfees/client/cli/query.go b/x/dynamicfees/client/cli/query.go index 26b8d120f..704b239a7 100644 --- a/x/dynamicfees/client/cli/query.go +++ b/x/dynamicfees/client/cli/query.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/dynamicfees/client/cli/query_params.go b/x/dynamicfees/client/cli/query_params.go index 486ad500e..6b62cd713 100644 --- a/x/dynamicfees/client/cli/query_params.go +++ b/x/dynamicfees/client/cli/query_params.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/dynamicfees/genesis.go b/x/dynamicfees/genesis.go index 12b1842b3..3fb802d35 100644 --- a/x/dynamicfees/genesis.go +++ b/x/dynamicfees/genesis.go @@ -3,8 +3,8 @@ package dynamicfees import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dynamicfees/keeper" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/keeper" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) // InitGenesis initializes the module's state from a provided genesis state. diff --git a/x/dynamicfees/genesis_test.go b/x/dynamicfees/genesis_test.go index ae96b291e..f9098d3bc 100644 --- a/x/dynamicfees/genesis_test.go +++ b/x/dynamicfees/genesis_test.go @@ -6,15 +6,15 @@ import ( "cosmossdk.io/math" cosmostypes "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dynamicfees" + "github.com/neutron-org/neutron/v5/x/dynamicfees" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - "github.com/neutron-org/neutron/v4/testutil/dynamicfees/keeper" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/dynamicfees/keeper" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) func TestGenesis(t *testing.T) { diff --git a/x/dynamicfees/keeper/grpc_query.go b/x/dynamicfees/keeper/grpc_query.go index bad090d22..d077d01a6 100644 --- a/x/dynamicfees/keeper/grpc_query.go +++ b/x/dynamicfees/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/dynamicfees/keeper/grpc_query_params.go b/x/dynamicfees/keeper/grpc_query_params.go index af83c649c..a7f7e3336 100644 --- a/x/dynamicfees/keeper/grpc_query_params.go +++ b/x/dynamicfees/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/dynamicfees/keeper/grpc_query_params_test.go b/x/dynamicfees/keeper/grpc_query_params_test.go index eea6385d6..a8b119f1c 100644 --- a/x/dynamicfees/keeper/grpc_query_params_test.go +++ b/x/dynamicfees/keeper/grpc_query_params_test.go @@ -7,8 +7,8 @@ import ( cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/dynamicfees/keeper" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/dynamicfees/keeper" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/dynamicfees/keeper/keeper.go b/x/dynamicfees/keeper/keeper.go index 2488e1bd3..d46efba6f 100644 --- a/x/dynamicfees/keeper/keeper.go +++ b/x/dynamicfees/keeper/keeper.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) type ( diff --git a/x/dynamicfees/keeper/msg_server.go b/x/dynamicfees/keeper/msg_server.go index c126c1e3b..111c9500c 100644 --- a/x/dynamicfees/keeper/msg_server.go +++ b/x/dynamicfees/keeper/msg_server.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) type msgServer struct { diff --git a/x/dynamicfees/keeper/msg_server_test.go b/x/dynamicfees/keeper/msg_server_test.go index b0cfa06da..303a149c9 100644 --- a/x/dynamicfees/keeper/msg_server_test.go +++ b/x/dynamicfees/keeper/msg_server_test.go @@ -9,8 +9,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) type KeeperTestSuite struct { diff --git a/x/dynamicfees/keeper/params.go b/x/dynamicfees/keeper/params.go index 0125c3d1a..c55d8bfad 100644 --- a/x/dynamicfees/keeper/params.go +++ b/x/dynamicfees/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) // GetParams get all parameters as types.Params diff --git a/x/dynamicfees/keeper/resolver.go b/x/dynamicfees/keeper/resolver.go index 44ecb326a..c4749c4df 100644 --- a/x/dynamicfees/keeper/resolver.go +++ b/x/dynamicfees/keeper/resolver.go @@ -4,9 +4,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" - appparams "github.com/neutron-org/neutron/v4/app/params" + appparams "github.com/neutron-org/neutron/v5/app/params" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) var _ feemarkettypes.DenomResolver = Keeper{} diff --git a/x/dynamicfees/keeper/resolver_test.go b/x/dynamicfees/keeper/resolver_test.go index 274186dc2..305cfc6c4 100644 --- a/x/dynamicfees/keeper/resolver_test.go +++ b/x/dynamicfees/keeper/resolver_test.go @@ -7,10 +7,10 @@ import ( cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - appparams "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - testkeeper "github.com/neutron-org/neutron/v4/testutil/dynamicfees/keeper" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + appparams "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + testkeeper "github.com/neutron-org/neutron/v5/testutil/dynamicfees/keeper" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) func TestConvertToDenom(t *testing.T) { diff --git a/x/dynamicfees/module.go b/x/dynamicfees/module.go index 3af50b80e..c45eaf262 100644 --- a/x/dynamicfees/module.go +++ b/x/dynamicfees/module.go @@ -20,9 +20,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/neutron-org/neutron/v4/x/dynamicfees/client/cli" - "github.com/neutron-org/neutron/v4/x/dynamicfees/keeper" - "github.com/neutron-org/neutron/v4/x/dynamicfees/types" + "github.com/neutron-org/neutron/v5/x/dynamicfees/client/cli" + "github.com/neutron-org/neutron/v5/x/dynamicfees/keeper" + "github.com/neutron-org/neutron/v5/x/dynamicfees/types" ) var ( diff --git a/x/dynamicfees/module_simulation.go b/x/dynamicfees/module_simulation.go index 46f121bca..9cf98aa1e 100644 --- a/x/dynamicfees/module_simulation.go +++ b/x/dynamicfees/module_simulation.go @@ -7,9 +7,9 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/neutron-org/neutron/v4/testutil/common/sample" - feeburnersimulation "github.com/neutron-org/neutron/v4/x/feeburner/simulation" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/testutil/common/sample" + feeburnersimulation "github.com/neutron-org/neutron/v5/x/feeburner/simulation" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) // avoid unused import issue diff --git a/x/dynamicfees/types/genesis.pb.go b/x/dynamicfees/types/genesis.pb.go index ff1c4b185..e1aec7191 100644 --- a/x/dynamicfees/types/genesis.pb.go +++ b/x/dynamicfees/types/genesis.pb.go @@ -89,8 +89,8 @@ var fileDescriptor_311447c521bf6ae9 = []byte{ 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, 0xd3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, 0x89, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, 0x7e, 0x99, - 0x89, 0x7e, 0x05, 0x8a, 0x43, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xae, 0x34, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0x44, 0xe2, 0x53, 0x49, 0x20, 0x01, 0x00, 0x00, + 0xa9, 0x7e, 0x05, 0x8a, 0x43, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xae, 0x34, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x60, 0x3b, 0x54, 0x2a, 0x20, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/dynamicfees/types/params.pb.go b/x/dynamicfees/types/params.pb.go index cd6c8940e..dab94c323 100644 --- a/x/dynamicfees/types/params.pb.go +++ b/x/dynamicfees/types/params.pb.go @@ -98,8 +98,8 @@ var fileDescriptor_f4ff446f82722ba2 = []byte{ 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x38, 0xf9, 0x9f, 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, 0x29, 0x92, 0xc1, 0x50, 0x7f, 0xeb, 0xe6, 0x17, 0xa5, 0xc3, 0xd8, 0xfa, 0x65, - 0x26, 0xfa, 0x15, 0x28, 0xa1, 0x05, 0xb6, 0x2b, 0x89, 0x0d, 0xec, 0x39, 0x63, 0x40, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x5d, 0x49, 0x6f, 0xb5, 0x51, 0x01, 0x00, 0x00, + 0xa6, 0xfa, 0x15, 0x28, 0xa1, 0x05, 0xb6, 0x2b, 0x89, 0x0d, 0xec, 0x39, 0x63, 0x40, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x79, 0x90, 0x68, 0xd6, 0x51, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/dynamicfees/types/query.pb.go b/x/dynamicfees/types/query.pb.go index 51fb31b92..d0de7e7a9 100644 --- a/x/dynamicfees/types/query.pb.go +++ b/x/dynamicfees/types/query.pb.go @@ -138,9 +138,9 @@ var fileDescriptor_372e8efc521c6d67 = []byte{ 0x25, 0xb5, 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0x29, 0x08, 0xc9, 0xe9, 0xe3, 0x0d, 0x06, 0x27, 0xff, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, - 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0x85, 0x99, 0xa1, 0x9b, 0x5f, 0x94, 0x0e, 0x37, 0xaf, 0xcc, 0x44, + 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0x85, 0x99, 0xa1, 0x9b, 0x5f, 0x94, 0x0e, 0x37, 0xaf, 0xcc, 0x54, 0xbf, 0x02, 0xc5, 0xd0, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xc0, 0x1a, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0xec, 0xfe, 0xa2, 0xfa, 0xef, 0x01, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xc8, 0x27, 0xa5, 0x99, 0xef, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dynamicfees/types/tx.pb.go b/x/dynamicfees/types/tx.pb.go index a2dc42872..8639598bd 100644 --- a/x/dynamicfees/types/tx.pb.go +++ b/x/dynamicfees/types/tx.pb.go @@ -155,8 +155,8 @@ var fileDescriptor_a6a5f55503750f7f = []byte{ 0x40, 0x5e, 0x71, 0xf2, 0x3f, 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, 0xd3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, 0xd9, 0xba, 0xf9, 0x45, - 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0x89, 0x7e, 0x05, 0x4a, 0x64, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, - 0xb1, 0x81, 0x63, 0xca, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x32, 0x9c, 0x49, 0x80, 0x66, 0x02, + 0xe9, 0x30, 0xb6, 0x7e, 0x99, 0xa9, 0x7e, 0x05, 0x4a, 0x64, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, + 0xb1, 0x81, 0x63, 0xca, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x16, 0x45, 0x4e, 0xe3, 0x66, 0x02, 0x00, 0x00, } diff --git a/x/feeburner/client/cli/query.go b/x/feeburner/client/cli/query.go index 9978f4e4c..6c5116049 100644 --- a/x/feeburner/client/cli/query.go +++ b/x/feeburner/client/cli/query.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/feeburner/client/cli/query_params.go b/x/feeburner/client/cli/query_params.go index c906483fc..90238e64e 100644 --- a/x/feeburner/client/cli/query_params.go +++ b/x/feeburner/client/cli/query_params.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/feeburner/client/cli/query_total_burned_neutrons_amount.go b/x/feeburner/client/cli/query_total_burned_neutrons_amount.go index 5529f38d3..3de28acf0 100644 --- a/x/feeburner/client/cli/query_total_burned_neutrons_amount.go +++ b/x/feeburner/client/cli/query_total_burned_neutrons_amount.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func CmdQueryTotalBurnedNeutronsAmount() *cobra.Command { diff --git a/x/feeburner/genesis.go b/x/feeburner/genesis.go index 63291864d..50d184b77 100644 --- a/x/feeburner/genesis.go +++ b/x/feeburner/genesis.go @@ -3,13 +3,15 @@ package feeburner import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { // this line is used by starport scaffolding # genesis/module/init + k.SetTotalBurnedNeutronsAmount(ctx, genState.TotalBurnedNeutronsAmount) + err := k.SetParams(ctx, genState.Params) if err != nil { panic(err) @@ -20,6 +22,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) + genesis.TotalBurnedNeutronsAmount = k.GetTotalBurnedNeutronsAmount(ctx) return genesis } diff --git a/x/feeburner/genesis_test.go b/x/feeburner/genesis_test.go index 6301c7b6d..78535b32a 100644 --- a/x/feeburner/genesis_test.go +++ b/x/feeburner/genesis_test.go @@ -3,27 +3,40 @@ package feeburner_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "cosmossdk.io/math" + "github.com/neutron-org/neutron/v5/app/config" + + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - "github.com/neutron-org/neutron/v4/testutil/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/testutil/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func TestGenesis(t *testing.T) { _ = config.GetDefaultConfig() + amount := math.NewInt(10) + genesisState := types.GenesisState{ Params: types.DefaultParams(), + TotalBurnedNeutronsAmount: types.TotalBurnedNeutronsAmount{ + Coin: sdk.NewCoin(types.DefaultNeutronDenom, amount), + }, } k, ctx := keeper.FeeburnerKeeper(t) feeburner.InitGenesis(ctx, *k, genesisState) + + burnedTokens := k.GetTotalBurnedNeutronsAmount(ctx) + require.Equal(t, amount, burnedTokens.Coin.Amount) + got := feeburner.ExportGenesis(ctx, *k) require.NotNil(t, got) + require.Equal(t, amount, got.TotalBurnedNeutronsAmount.Coin.Amount) nullify.Fill(&genesisState) nullify.Fill(got) diff --git a/x/feeburner/keeper/grpc_query.go b/x/feeburner/keeper/grpc_query.go index a2d53508e..7158d411c 100644 --- a/x/feeburner/keeper/grpc_query.go +++ b/x/feeburner/keeper/grpc_query.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/feeburner/keeper/grpc_query_params.go b/x/feeburner/keeper/grpc_query_params.go index 7455573b3..955c9f2be 100644 --- a/x/feeburner/keeper/grpc_query_params.go +++ b/x/feeburner/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/feeburner/keeper/grpc_query_params_test.go b/x/feeburner/keeper/grpc_query_params_test.go index 030a8f022..135091f53 100644 --- a/x/feeburner/keeper/grpc_query_params_test.go +++ b/x/feeburner/keeper/grpc_query_params_test.go @@ -3,12 +3,12 @@ package keeper_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/feeburner/keeper/grpc_query_test.go b/x/feeburner/keeper/grpc_query_test.go index 32a1dc814..fa58019f5 100644 --- a/x/feeburner/keeper/grpc_query_test.go +++ b/x/feeburner/keeper/grpc_query_test.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - feekeeperutil "github.com/neutron-org/neutron/v4/testutil/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + feekeeperutil "github.com/neutron-org/neutron/v5/testutil/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func TestGrpcQuery_TotalBurnedNeutronsAmount(t *testing.T) { diff --git a/x/feeburner/keeper/keeper.go b/x/feeburner/keeper/keeper.go index 8660a4710..f2ff162b6 100644 --- a/x/feeburner/keeper/keeper.go +++ b/x/feeburner/keeper/keeper.go @@ -15,7 +15,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" consumertypes "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) type ( @@ -81,6 +81,13 @@ func (k Keeper) GetTotalBurnedNeutronsAmount(ctx sdk.Context) types.TotalBurnedN return totalBurnedNeutronsAmount } +// SetTotalBurnedNeutronsAmount sets the total burned amount of NTRN tokens +func (k Keeper) SetTotalBurnedNeutronsAmount(ctx sdk.Context, totalBurnedNeutronsAmount types.TotalBurnedNeutronsAmount) { + store := ctx.KVStore(k.storeKey) + + store.Set(KeyBurnedFees, k.cdc.MustMarshal(&totalBurnedNeutronsAmount)) +} + // BurnAndDistribute is an important part of tokenomics. It does few things: // 1. Burns NTRN fee coins distributed to consumertypes.ConsumerRedistributeName in ICS (https://github.com/cosmos/interchain-security/blob/86046926502f7b0ba795bebcdd1fdc97ac776573/x/ccv/consumer/keeper/distribution.go#L67) // 2. Updates total amount of burned NTRN coins diff --git a/x/feeburner/keeper/keeper_test.go b/x/feeburner/keeper/keeper_test.go index 7898a8c5f..1a2422a49 100644 --- a/x/feeburner/keeper/keeper_test.go +++ b/x/feeburner/keeper/keeper_test.go @@ -12,11 +12,11 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/feeburner/types" - "github.com/neutron-org/neutron/v4/x/feeburner/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/keeper" - feekeeperutil "github.com/neutron-org/neutron/v4/testutil/feeburner/keeper" - feetypes "github.com/neutron-org/neutron/v4/x/feeburner/types" + feekeeperutil "github.com/neutron-org/neutron/v5/testutil/feeburner/keeper" + feetypes "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func TestKeeper_RecordBurnedFees(t *testing.T) { diff --git a/x/feeburner/keeper/msg_server.go b/x/feeburner/keeper/msg_server.go index ff783fb6c..c6aa92197 100644 --- a/x/feeburner/keeper/msg_server.go +++ b/x/feeburner/keeper/msg_server.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) type msgServer struct { diff --git a/x/feeburner/keeper/msg_server_test.go b/x/feeburner/keeper/msg_server_test.go index bdb41fbf0..cff502714 100644 --- a/x/feeburner/keeper/msg_server_test.go +++ b/x/feeburner/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/testutil/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/testutil/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func TestMsgUpdateParamsValidate(t *testing.T) { diff --git a/x/feeburner/keeper/params.go b/x/feeburner/keeper/params.go index 966afdf21..9229eb2ca 100644 --- a/x/feeburner/keeper/params.go +++ b/x/feeburner/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) // GetParams get all parameters as types.Params diff --git a/x/feeburner/keeper/params_test.go b/x/feeburner/keeper/params_test.go index 19326fca6..8c360512b 100644 --- a/x/feeburner/keeper/params_test.go +++ b/x/feeburner/keeper/params_test.go @@ -3,12 +3,12 @@ package keeper_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func TestGetParams(t *testing.T) { diff --git a/x/feeburner/module.go b/x/feeburner/module.go index 212da36ab..d2381047c 100644 --- a/x/feeburner/module.go +++ b/x/feeburner/module.go @@ -20,9 +20,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/neutron-org/neutron/v4/x/feeburner/client/cli" - "github.com/neutron-org/neutron/v4/x/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/x/feeburner/client/cli" + "github.com/neutron-org/neutron/v5/x/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) var ( diff --git a/x/feeburner/module_simulation.go b/x/feeburner/module_simulation.go index 73879f633..85d33e561 100644 --- a/x/feeburner/module_simulation.go +++ b/x/feeburner/module_simulation.go @@ -7,9 +7,9 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/neutron-org/neutron/v4/testutil/common/sample" - feeburnersimulation "github.com/neutron-org/neutron/v4/x/feeburner/simulation" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/testutil/common/sample" + feeburnersimulation "github.com/neutron-org/neutron/v5/x/feeburner/simulation" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) // avoid unused import issue diff --git a/x/feeburner/types/genesis.pb.go b/x/feeburner/types/genesis.pb.go index 817cad2ff..f9004204d 100644 --- a/x/feeburner/types/genesis.pb.go +++ b/x/feeburner/types/genesis.pb.go @@ -98,8 +98,8 @@ var fileDescriptor_bdeb93808577407e = []byte{ 0xf0, 0x3d, 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, 0xe3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, 0x95, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, - 0x7e, 0x99, 0x89, 0x7e, 0x05, 0x72, 0x50, 0x55, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x03, 0xc5, - 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x52, 0xf6, 0xa7, 0x83, 0xb6, 0x01, 0x00, 0x00, + 0x7e, 0x99, 0xa9, 0x7e, 0x05, 0x72, 0x50, 0x55, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x03, 0xc5, + 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x13, 0xed, 0x2b, 0xed, 0xb6, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/feeburner/types/genesis_test.go b/x/feeburner/types/genesis_test.go index 08bf48f70..e94b328ae 100644 --- a/x/feeburner/types/genesis_test.go +++ b/x/feeburner/types/genesis_test.go @@ -3,14 +3,14 @@ package types_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/feeburner/keeper" - "github.com/neutron-org/neutron/v4/x/feeburner" - "github.com/neutron-org/neutron/v4/x/feeburner/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/feeburner/keeper" + "github.com/neutron-org/neutron/v5/x/feeburner" + "github.com/neutron-org/neutron/v5/x/feeburner/types" ) func TestGenesis(t *testing.T) { diff --git a/x/feeburner/types/params.go b/x/feeburner/types/params.go index de99e75d2..42e43fd92 100644 --- a/x/feeburner/types/params.go +++ b/x/feeburner/types/params.go @@ -7,7 +7,7 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" ) var _ paramtypes.ParamSet = (*Params)(nil) diff --git a/x/feeburner/types/params.pb.go b/x/feeburner/types/params.pb.go index 2f539541e..941f74a91 100644 --- a/x/feeburner/types/params.pb.go +++ b/x/feeburner/types/params.pb.go @@ -107,9 +107,9 @@ var fileDescriptor_be38a6978544057e = []byte{ 0x4a, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x3d, 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, 0xe3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, - 0xa8, 0x63, 0x74, 0xf3, 0x8b, 0xd2, 0x61, 0x6c, 0xfd, 0x32, 0x13, 0xfd, 0x0a, 0xa4, 0x80, 0x28, - 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xfb, 0xcf, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x07, - 0x94, 0x37, 0x42, 0x2a, 0x01, 0x00, 0x00, + 0xa8, 0x63, 0x74, 0xf3, 0x8b, 0xd2, 0x61, 0x6c, 0xfd, 0x32, 0x53, 0xfd, 0x0a, 0xa4, 0x80, 0x28, + 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xfb, 0xcf, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x46, + 0x8f, 0xbb, 0x2c, 0x2a, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/feeburner/types/query.pb.go b/x/feeburner/types/query.pb.go index ea85ae590..102eac6a0 100644 --- a/x/feeburner/types/query.pb.go +++ b/x/feeburner/types/query.pb.go @@ -210,32 +210,32 @@ func init() { proto.RegisterFile("neutron/feeburner/query.proto", fileDescriptor var fileDescriptor_f540485c4b79b2ac = []byte{ // 408 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x6f, 0xda, 0x40, - 0x18, 0xc6, 0x6d, 0xd4, 0x32, 0x5c, 0xa7, 0x5e, 0x19, 0x6a, 0x97, 0xba, 0xad, 0x25, 0x68, 0x55, - 0xb5, 0x3e, 0xf1, 0x47, 0xa2, 0x1d, 0xcb, 0x5e, 0xd4, 0xa2, 0x4e, 0x5d, 0xd0, 0x99, 0x5c, 0x1c, - 0x4b, 0xf8, 0x5e, 0xe3, 0x3b, 0xa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0x31, 0x6f, 0xda, 0x40, + 0x14, 0xc7, 0x6d, 0xd4, 0x32, 0x5c, 0xa7, 0x5e, 0x19, 0x6a, 0x97, 0xba, 0xad, 0x25, 0x68, 0x55, + 0xb5, 0x3e, 0x01, 0xad, 0x68, 0xc7, 0xb2, 0x17, 0xb5, 0x28, 0x53, 0x16, 0x74, 0x26, 0x17, 0xc7, + 0x12, 0xbe, 0x67, 0x7c, 0x67, 0x14, 0x32, 0xe6, 0x13, 0x44, 0xca, 0x9c, 0xef, 0x43, 0xa6, 0x20, + 0x65, 0xc9, 0x14, 0x45, 0x90, 0x0f, 0x12, 0x71, 0x3e, 0x50, 0x22, 0xe3, 0xa0, 0x64, 0x3b, 0xdf, + 0xff, 0xfd, 0xdf, 0xff, 0xf7, 0x9e, 0x0f, 0xbd, 0xe7, 0x2c, 0x95, 0x09, 0x70, 0xb2, 0xcf, 0x98, + 0x9f, 0x26, 0x9c, 0x25, 0x64, 0x94, 0xb2, 0x64, 0xe2, 0xc5, 0x09, 0x48, 0xc0, 0xaf, 0xb5, 0xec, + 0xad, 0x65, 0xfb, 0xeb, 0x00, 0x44, 0x04, 0x82, 0xf8, 0x54, 0xb0, 0xac, 0x96, 0x8c, 0x1b, 0x3e, + 0x93, 0xb4, 0x41, 0x62, 0x1a, 0x84, 0x9c, 0xca, 0x10, 0x78, 0x66, 0xb7, 0x2b, 0x01, 0x04, 0xa0, + 0x8e, 0x64, 0x79, 0xd2, 0xb7, 0xd5, 0x00, 0x20, 0x18, 0x32, 0x42, 0xe3, 0x90, 0x50, 0xce, 0x41, + 0x2a, 0x8b, 0xd0, 0xaa, 0x93, 0x27, 0x8a, 0x69, 0x42, 0xa3, 0x95, 0xfe, 0x23, 0xaf, 0x4b, 0x90, + 0x74, 0xd8, 0x57, 0x1f, 0x7b, 0x7d, 0x2d, 0x8b, 0x3e, 0x8d, 0x20, 0xe5, 0x32, 0x73, 0xb9, 0x15, + 0x84, 0xff, 0x2f, 0x59, 0xff, 0xa9,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0x18, 0xff, 0x24, 0x87, + 0xf7, 0x53, 0x26, 0x31, 0x13, 0x7e, 0x59, 0x3d, 0xeb, 0xd6, 0x5d, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x6a, 0x40, 0x06, 0x54, 0xc0, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feeburner/types/total_burned_neutrons_amount.pb.go b/x/feeburner/types/total_burned_neutrons_amount.pb.go index 8e9acf9f1..c9edd009f 100644 --- a/x/feeburner/types/total_burned_neutrons_amount.pb.go +++ b/x/feeburner/types/total_burned_neutrons_amount.pb.go @@ -92,9 +92,9 @@ var fileDescriptor_dfe0eb8ae8e764c8 = []byte{ 0x62, 0x6e, 0x8e, 0x95, 0x12, 0x48, 0x93, 0x52, 0x10, 0x58, 0xaf, 0x93, 0xef, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, - 0xe7, 0xe7, 0xea, 0x43, 0xbd, 0xa3, 0x9b, 0x5f, 0x94, 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xe8, 0x57, + 0xe7, 0xe7, 0xea, 0x43, 0xbd, 0xa3, 0x9b, 0x5f, 0x94, 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xea, 0x57, 0x20, 0x87, 0x4a, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0xd9, 0xc6, 0x80, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x86, 0x30, 0x87, 0x0c, 0x37, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xc7, 0x2b, 0x0b, 0x62, 0x37, 0x01, 0x00, 0x00, } func (m *TotalBurnedNeutronsAmount) Marshal() (dAtA []byte, err error) { diff --git a/x/feeburner/types/tx.pb.go b/x/feeburner/types/tx.pb.go index d25168e3c..4fa73aa2f 100644 --- a/x/feeburner/types/tx.pb.go +++ b/x/feeburner/types/tx.pb.go @@ -158,9 +158,9 @@ var fileDescriptor_49e6591b4db80f7f = []byte{ 0xac, 0x06, 0x66, 0x8d, 0x14, 0x6b, 0x03, 0xc8, 0xf9, 0x4e, 0xbe, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x9c, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, - 0xab, 0x0f, 0x35, 0x56, 0x37, 0xbf, 0x28, 0x1d, 0xc6, 0xd6, 0x2f, 0x33, 0xd1, 0xaf, 0x40, 0x4e, + 0xab, 0x0f, 0x35, 0x56, 0x37, 0xbf, 0x28, 0x1d, 0xc6, 0xd6, 0x2f, 0x33, 0xd5, 0xaf, 0x40, 0x4e, 0x22, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x68, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x04, 0x06, 0x52, 0xb9, 0x44, 0x02, 0x00, 0x00, + 0x45, 0x1d, 0xde, 0xd7, 0x44, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feerefunder/client/cli/query.go b/x/feerefunder/client/cli/query.go index 1d25877a5..bd31d52b3 100644 --- a/x/feerefunder/client/cli/query.go +++ b/x/feerefunder/client/cli/query.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/feerefunder/client/cli/query_params.go b/x/feerefunder/client/cli/query_params.go index 49e5a9155..42d0eb378 100644 --- a/x/feerefunder/client/cli/query_params.go +++ b/x/feerefunder/client/cli/query_params.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/feerefunder/client/cli/query_test.go b/x/feerefunder/client/cli/query_test.go index 84d3bbca2..7afdeb82c 100644 --- a/x/feerefunder/client/cli/query_test.go +++ b/x/feerefunder/client/cli/query_test.go @@ -3,7 +3,7 @@ package cli_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "cosmossdk.io/math" @@ -11,9 +11,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/contractmanager/network" - "github.com/neutron-org/neutron/v4/x/feerefunder/client/cli" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/testutil/contractmanager/network" + "github.com/neutron-org/neutron/v5/x/feerefunder/client/cli" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) func feeRefunderNetwork(t *testing.T, feeInfo types.Fee) *network.Network { diff --git a/x/feerefunder/genesis.go b/x/feerefunder/genesis.go index 9c0f44c82..e2a85989e 100644 --- a/x/feerefunder/genesis.go +++ b/x/feerefunder/genesis.go @@ -3,8 +3,8 @@ package feerefunder import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/feerefunder/keeper" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/keeper" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) // InitGenesis initializes the module's state from a provided genesis state. diff --git a/x/feerefunder/genesis_test.go b/x/feerefunder/genesis_test.go index 6f914e278..d38f6f9fa 100644 --- a/x/feerefunder/genesis_test.go +++ b/x/feerefunder/genesis_test.go @@ -5,15 +5,15 @@ import ( "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil/feerefunder/keeper" + "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil/feerefunder/keeper" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - "github.com/neutron-org/neutron/v4/x/feerefunder" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + "github.com/neutron-org/neutron/v5/x/feerefunder" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) const TestContractAddressNeutron = "neutron14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s5c2epq" diff --git a/x/feerefunder/keeper/export_test.go b/x/feerefunder/keeper/export_test.go index b29fbc31a..e3cedffe6 100644 --- a/x/feerefunder/keeper/export_test.go +++ b/x/feerefunder/keeper/export_test.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) func (k Keeper) CheckFees(ctx sdk.Context, fees types.Fee) error { diff --git a/x/feerefunder/keeper/grpc_query.go b/x/feerefunder/keeper/grpc_query.go index 064a346ac..7ee4524f9 100644 --- a/x/feerefunder/keeper/grpc_query.go +++ b/x/feerefunder/keeper/grpc_query.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/feerefunder/keeper/grpc_query_params.go b/x/feerefunder/keeper/grpc_query_params.go index e22502beb..99cce3091 100644 --- a/x/feerefunder/keeper/grpc_query_params.go +++ b/x/feerefunder/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/feerefunder/keeper/grpc_query_params_test.go b/x/feerefunder/keeper/grpc_query_params_test.go index 70d1dc0cb..1076057c8 100644 --- a/x/feerefunder/keeper/grpc_query_params_test.go +++ b/x/feerefunder/keeper/grpc_query_params_test.go @@ -3,11 +3,11 @@ package keeper_test import ( "testing" - testkeeper "github.com/neutron-org/neutron/v4/testutil/feerefunder/keeper" + testkeeper "github.com/neutron-org/neutron/v5/testutil/feerefunder/keeper" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/feerefunder/keeper/keeper.go b/x/feerefunder/keeper/keeper.go index fecaf59b4..a38ce85e6 100644 --- a/x/feerefunder/keeper/keeper.go +++ b/x/feerefunder/keeper/keeper.go @@ -15,7 +15,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) type ( diff --git a/x/feerefunder/keeper/keeper_test.go b/x/feerefunder/keeper/keeper_test.go index 0182998ca..1524726d6 100644 --- a/x/feerefunder/keeper/keeper_test.go +++ b/x/feerefunder/keeper/keeper_test.go @@ -9,9 +9,9 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" - "github.com/neutron-org/neutron/v4/testutil" - testutil_keeper "github.com/neutron-org/neutron/v4/testutil/feerefunder/keeper" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/feerefunder/types" + "github.com/neutron-org/neutron/v5/testutil" + testutil_keeper "github.com/neutron-org/neutron/v5/testutil/feerefunder/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/feerefunder/types" cosmoserrors "cosmossdk.io/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -20,7 +20,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) diff --git a/x/feerefunder/keeper/msg_server.go b/x/feerefunder/keeper/msg_server.go index 891d1ecfc..85961c38d 100644 --- a/x/feerefunder/keeper/msg_server.go +++ b/x/feerefunder/keeper/msg_server.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) type msgServer struct { diff --git a/x/feerefunder/keeper/msg_server_test.go b/x/feerefunder/keeper/msg_server_test.go index 158ced45e..deb29b9df 100644 --- a/x/feerefunder/keeper/msg_server_test.go +++ b/x/feerefunder/keeper/msg_server_test.go @@ -8,10 +8,10 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/testutil/feerefunder/keeper" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/testutil/feerefunder/keeper" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) func TestMsgUpdateParamsValidate(t *testing.T) { diff --git a/x/feerefunder/keeper/params.go b/x/feerefunder/keeper/params.go index 3dda4b096..a765d54b4 100644 --- a/x/feerefunder/keeper/params.go +++ b/x/feerefunder/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) // GetParams get all parameters as types.Params diff --git a/x/feerefunder/keeper/params_test.go b/x/feerefunder/keeper/params_test.go index e904004a9..3d163d4fb 100644 --- a/x/feerefunder/keeper/params_test.go +++ b/x/feerefunder/keeper/params_test.go @@ -3,11 +3,11 @@ package keeper_test import ( "testing" - testkeeper "github.com/neutron-org/neutron/v4/testutil/feerefunder/keeper" + testkeeper "github.com/neutron-org/neutron/v5/testutil/feerefunder/keeper" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) func TestGetParams(t *testing.T) { diff --git a/x/feerefunder/module.go b/x/feerefunder/module.go index 74efab243..a019a5104 100644 --- a/x/feerefunder/module.go +++ b/x/feerefunder/module.go @@ -21,9 +21,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/neutron-org/neutron/v4/x/feerefunder/client/cli" - "github.com/neutron-org/neutron/v4/x/feerefunder/keeper" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/client/cli" + "github.com/neutron-org/neutron/v5/x/feerefunder/keeper" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) var ( diff --git a/x/feerefunder/types/fee.pb.go b/x/feerefunder/types/fee.pb.go index 540bc0581..65562320c 100644 --- a/x/feerefunder/types/fee.pb.go +++ b/x/feerefunder/types/fee.pb.go @@ -158,30 +158,30 @@ func init() { proto.RegisterFile("neutron/feerefunder/fee.proto", fileDescriptor var fileDescriptor_08c389f5f82f1076 = []byte{ // 384 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xbd, 0x6e, 0xe2, 0x40, - 0x14, 0x85, 0x3d, 0xb0, 0xe2, 0x67, 0x90, 0x76, 0x25, 0xef, 0x4a, 0xcb, 0x22, 0x61, 0x90, 0x2b, - 0x37, 0x78, 0xc4, 0xfe, 0x34, 0x5b, 0x42, 0x84, 0x44, 0x95, 0x88, 0x32, 0x45, 0x90, 0x3d, 0xbe, - 0x18, 0xcb, 0x78, 0x86, 0xd8, 0x63, 0x2b, 0xb4, 0x79, 0x82, 0x3c, 0x47, 0x9e, 0x84, 0x92, 0x32, - 0x15, 0x89, 0xe0, 0x0d, 0xd2, 0x47, 0x8a, 0xc6, 0x1e, 0x22, 0x52, 0x21, 0xaa, 0x39, 0x33, 0x47, - 0xe7, 0x7c, 0x77, 0xa4, 0x8b, 0xdb, 0x0c, 0x52, 0x11, 0x73, 0x46, 0x66, 0x00, 0x31, 0xcc, 0x52, - 0xe6, 0x41, 0x2c, 0xb5, 0xbd, 0x8c, 0xb9, 0xe0, 0xfa, 0x77, 0x65, 0xdb, 0x47, 0x76, 0xcb, 0xa0, - 0x3c, 0x89, 0x78, 0x42, 0x5c, 0x27, 0x01, 0x92, 0xf5, 0x5d, 0x10, 0x4e, 0x9f, 0x50, 0x1e, 0xb0, - 0x22, 0xd4, 0xfa, 0xe1, 0x73, 0x9f, 0xe7, 0x92, 0x48, 0x55, 0xbc, 0x9a, 0x6f, 0x25, 0x5c, 0x1e, - 0x01, 0xe8, 0x2b, 0x5c, 0x8b, 0x81, 0x66, 0xd3, 0x19, 0x40, 0x13, 0x75, 0xcb, 0x56, 0xe3, 0xf7, - 0x2f, 0xbb, 0x28, 0xb4, 0x65, 0xa1, 0xad, 0x0a, 0xed, 0x21, 0x0f, 0xd8, 0x60, 0xb8, 0xde, 0x76, - 0xb4, 0xd7, 0x6d, 0xe7, 0xdb, 0xca, 0x89, 0x16, 0xff, 0xcd, 0x43, 0xd0, 0x7c, 0x7c, 0xee, 0x58, - 0x7e, 0x20, 0xe6, 0xa9, 0x6b, 0x53, 0x1e, 0x11, 0x35, 0x50, 0x71, 0xf4, 0x12, 0x2f, 0x24, 0x62, - 0xb5, 0x84, 0x24, 0xef, 0x48, 0x26, 0x55, 0x19, 0x93, 0xe8, 0x0c, 0x57, 0x1d, 0x1a, 0xe6, 0xe4, - 0xd2, 0x29, 0xf2, 0x40, 0x91, 0xbf, 0x16, 0x64, 0x95, 0x3b, 0x0f, 0x5c, 0x71, 0x68, 0x28, 0xb9, - 0xf7, 0x08, 0x37, 0x44, 0x10, 0x01, 0x4f, 0x45, 0x0e, 0x2f, 0x9f, 0x82, 0x8f, 0x14, 0x5c, 0x2f, - 0xe0, 0x47, 0xd9, 0xf3, 0x06, 0xc0, 0x2a, 0x39, 0x02, 0x30, 0x6f, 0x70, 0xed, 0xca, 0xa1, 0x21, - 0x88, 0xf1, 0x85, 0xde, 0xc6, 0x98, 0xce, 0x1d, 0xc6, 0x60, 0x31, 0x0d, 0xbc, 0x26, 0xea, 0x22, - 0xab, 0x3e, 0xa9, 0xab, 0x97, 0xb1, 0xa7, 0xff, 0xc4, 0xd5, 0x25, 0x8f, 0x85, 0xf4, 0x4a, 0xb9, - 0x57, 0x91, 0xd7, 0xb1, 0xa7, 0xb7, 0x70, 0x2d, 0x81, 0xdb, 0x14, 0x18, 0x95, 0x9f, 0x40, 0xd6, - 0x97, 0xc9, 0xc7, 0x7d, 0x70, 0xb9, 0xde, 0x19, 0x68, 0xb3, 0x33, 0xd0, 0xcb, 0xce, 0x40, 0x0f, - 0x7b, 0x43, 0xdb, 0xec, 0x0d, 0xed, 0x69, 0x6f, 0x68, 0xd7, 0xff, 0x8e, 0xe6, 0x55, 0xfb, 0xd4, - 0xe3, 0xb1, 0x7f, 0xd0, 0x24, 0xfb, 0x4b, 0xee, 0x3e, 0xed, 0x5f, 0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, 0x86, 0x76, 0x3d, 0x38, 0x99, 0x57, 0xed, 0x53, + 0x8f, 0xc7, 0xfe, 0x51, 0x93, 0x6c, 0x40, 0xee, 0x3e, 0xed, 0x5f, 0xfe, 0x05, 0xb7, 0x92, 0xef, + 0xcd, 0x9f, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x45, 0xd4, 0x1e, 0xa3, 0x02, 0x00, 0x00, } func (m *Fee) Marshal() (dAtA []byte, err error) { diff --git a/x/feerefunder/types/genesis.pb.go b/x/feerefunder/types/genesis.pb.go index 682002bcf..e4660599d 100644 --- a/x/feerefunder/types/genesis.pb.go +++ b/x/feerefunder/types/genesis.pb.go @@ -146,25 +146,25 @@ func init() { proto.RegisterFile("neutron/feerefunder/genesis.proto", fileDescri var fileDescriptor_43aedfe31f06653d = []byte{ // 314 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4f, 0x02, 0x31, - 0x14, 0xc6, 0xaf, 0xa0, 0x28, 0xc5, 0xa9, 0x32, 0x5c, 0x50, 0x2a, 0x32, 0xb1, 0x78, 0x35, 0xa8, - 0x83, 0x93, 0x86, 0x18, 0x0d, 0x93, 0x06, 0x37, 0x17, 0x72, 0xc0, 0xeb, 0x79, 0x31, 0xb4, 0x97, - 0x5e, 0x31, 0xf2, 0x2f, 0x38, 0x99, 0xf8, 0x4f, 0x31, 0x32, 0x3a, 0x19, 0xc3, 0xfd, 0x23, 0xe6, - 0xda, 0x92, 0x68, 0x72, 0x6c, 0xef, 0xe5, 0xfb, 0x7d, 0xef, 0xfb, 0xf2, 0xf0, 0xb1, 0x80, 0x99, - 0x56, 0x52, 0x30, 0x0e, 0xa0, 0x80, 0xcf, 0xc4, 0x04, 0x14, 0x8b, 0x40, 0x40, 0x1a, 0xa7, 0x41, - 0xa2, 0xa4, 0x96, 0x64, 0xdf, 0x21, 0xc1, 0x1f, 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, 0x39, - 0x7b, 0xfb, 0xf7, 0x7a, 0x3d, 0x4f, 0x20, 0x1d, 0x55, 0xcc, 0xeb, 0xcf, 0x7e, 0x03, 0x00, 0x00, - 0xff, 0xff, 0xeb, 0xe0, 0x85, 0x41, 0x0b, 0x02, 0x00, 0x00, + 0x14, 0xc6, 0xaf, 0xa0, 0x28, 0xc5, 0xa9, 0x32, 0x5c, 0x50, 0x2a, 0x32, 0xb1, 0x78, 0x35, 0x18, + 0x06, 0x27, 0x0d, 0x31, 0x1a, 0x26, 0x0d, 0x6e, 0x2e, 0xe4, 0x80, 0xd7, 0xf3, 0x62, 0x68, 0x2f, + 0xbd, 0x62, 0xe4, 0x5f, 0x70, 0x32, 0xf1, 0x9f, 0x62, 0x64, 0x74, 0x32, 0x86, 0xfb, 0x47, 0xcc, + 0xb5, 0x25, 0xd1, 0xe4, 0xd8, 0xde, 0xcb, 0xf7, 0xfb, 0xde, 0xf7, 0xe5, 0xe1, 0x53, 0x01, 0x73, + 0xad, 0xa4, 0x60, 0x1c, 0x40, 0x01, 0x9f, 0x8b, 0x29, 0x28, 0x16, 0x81, 0x80, 0x34, 0x4e, 0x83, + 0x44, 0x49, 0x2d, 0xc9, 0xa1, 0x43, 0x82, 0x3f, 0x48, 0xa3, 0x1e, 0xc9, 0x48, 0x1a, 0x9d, 0xe5, + 0x93, 0x45, 0x1b, 0xcd, 0xa2, 0x6b, 0x1c, 0xc0, 0xc9, 0xad, 0x22, 0x39, 0x09, 0x55, 0x38, 0x73, + 0x59, 0xed, 0x77, 0x84, 0x0f, 0xee, 0x6c, 0xfa, 0xa3, 0x0e, 0x35, 0x90, 0x4b, 0x5c, 0xb1, 0x80, + 0x8f, 0x5a, 0xa8, 0x53, 0xeb, 0x1e, 0x05, 0x05, 0x6d, 0x82, 0x07, 0x83, 0xf4, 0x77, 0x96, 0xdf, + 0x27, 0xde, 0xd0, 0x19, 0xc8, 0x15, 0xae, 0x72, 0x80, 0x51, 0x2c, 0xb8, 0x4c, 0xfd, 0x52, 0xab, + 0xdc, 0xa9, 0x75, 0x8f, 0x0b, 0xdd, 0xb7, 0x00, 0x03, 0xc1, 0xa5, 0xb3, 0xef, 0x73, 0xbb, 0xa6, + 0xed, 0x4f, 0x84, 0xf7, 0x9c, 0x46, 0xea, 0x78, 0x37, 0x09, 0x17, 0xa0, 0x4c, 0x8d, 0xea, 0xd0, + 0x2e, 0xe4, 0x1a, 0x57, 0x93, 0x70, 0xf2, 0x02, 0x7a, 0x14, 0x4f, 0xfd, 0x92, 0x29, 0xd8, 0xdc, + 0x52, 0x30, 0xa7, 0x06, 0x37, 0x9b, 0x0c, 0xeb, 0x1a, 0x4c, 0xc9, 0x39, 0x2e, 0x73, 0x00, 0xbf, + 0x6c, 0xbc, 0xfe, 0xb6, 0x7a, 0xce, 0x96, 0xa3, 0xfd, 0xfb, 0xe5, 0x9a, 0xa2, 0xd5, 0x9a, 0xa2, + 0x9f, 0x35, 0x45, 0x1f, 0x19, 0xf5, 0x56, 0x19, 0xf5, 0xbe, 0x32, 0xea, 0x3d, 0xf5, 0xa2, 0x58, + 0x3f, 0xcf, 0xc7, 0xc1, 0x44, 0xce, 0x98, 0x3b, 0x74, 0x26, 0x55, 0xb4, 0x99, 0xd9, 0x6b, 0x8f, + 0xbd, 0xfd, 0x7b, 0xbd, 0x5e, 0x24, 0x90, 0x8e, 0x2b, 0xe6, 0xf5, 0x17, 0xbf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xcf, 0x39, 0x82, 0x22, 0x0b, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/feerefunder/types/genesis_test.go b/x/feerefunder/types/genesis_test.go index 58cbc4591..69da3884c 100644 --- a/x/feerefunder/types/genesis_test.go +++ b/x/feerefunder/types/genesis_test.go @@ -3,16 +3,16 @@ package types_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) const ( diff --git a/x/feerefunder/types/params.go b/x/feerefunder/types/params.go index d9d149bb7..4598ebe99 100644 --- a/x/feerefunder/types/params.go +++ b/x/feerefunder/types/params.go @@ -8,7 +8,7 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" ) var _ paramtypes.ParamSet = (*Params)(nil) diff --git a/x/feerefunder/types/params.pb.go b/x/feerefunder/types/params.pb.go index 1bdb0da76..cfff95815 100644 --- a/x/feerefunder/types/params.pb.go +++ b/x/feerefunder/types/params.pb.go @@ -86,8 +86,8 @@ var fileDescriptor_2dae67276ca81c89 = []byte{ 0xf2, 0x3f, 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, 0xd3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, 0x89, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, - 0x7e, 0x99, 0x89, 0x7e, 0x05, 0x8a, 0xeb, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x0e, - 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x22, 0x03, 0x03, 0x97, 0x0e, 0x01, 0x00, 0x00, + 0x7e, 0x99, 0xa9, 0x7e, 0x05, 0x8a, 0xeb, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x0e, + 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x06, 0xda, 0x04, 0xf4, 0x0e, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/feerefunder/types/query.pb.go b/x/feerefunder/types/query.pb.go index 7bd8573fa..a0824ef5c 100644 --- a/x/feerefunder/types/query.pb.go +++ b/x/feerefunder/types/query.pb.go @@ -230,32 +230,32 @@ var fileDescriptor_c20b5686ec46d4e6 = []byte{ // 441 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x6b, 0xd4, 0x40, 0x14, 0xc6, 0x77, 0xd6, 0xba, 0xdb, 0x8e, 0xa0, 0x30, 0x2d, 0x58, 0x62, 0x4d, 0xd7, 0xa8, 0xec, - 0x2a, 0x34, 0x43, 0xab, 0x22, 0x5e, 0x7b, 0x10, 0xd6, 0x8b, 0x35, 0x47, 0x2f, 0x65, 0x92, 0xbc, - 0x4c, 0x03, 0xdd, 0x79, 0xe9, 0xcc, 0xa4, 0xd8, 0xab, 0x5e, 0x3d, 0x08, 0x5e, 0xfd, 0x83, 0x7a, - 0x2c, 0x78, 0xf1, 0x24, 0xb2, 0xeb, 0x1f, 0x22, 0x99, 0x4c, 0x8b, 0xc5, 0xd8, 0xde, 0x66, 0xde, - 0xfb, 0xbe, 0x6f, 0x7e, 0xef, 0x25, 0x74, 0x53, 0x41, 0x6d, 0x35, 0x2a, 0x5e, 0x00, 0x68, 0x28, - 0x6a, 0x95, 0x83, 0xe6, 0x47, 0x35, 0xe8, 0x93, 0xb8, 0xd2, 0x68, 0x91, 0xad, 0x7a, 0x41, 0xfc, - 0x97, 0x20, 0x78, 0x9a, 0xa1, 0x99, 0xa1, 0xe1, 0xa9, 0x30, 0xd0, 0xaa, 0xf9, 0xf1, 0x76, 0x0a, - 0x56, 0x6c, 0xf3, 0x4a, 0xc8, 0x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6c, 0x9a, 0x08, 0x95, 0xc1, 0xfa, 0xad, 0x11, 0x99, 0x2c, 0x25, 0x97, 0xf7, 0xe8, 0x0d, 0xbd, + 0x77, 0xf9, 0x8a, 0x67, 0x7e, 0x49, 0x97, 0x0b, 0x80, 0x83, 0x52, 0x15, 0xe8, 0xa9, 0x37, 0x3a, + 0xa9, 0x2f, 0x7c, 0xc3, 0xa2, 0x3d, 0xec, 0x7c, 0xeb, 0xd3, 0xdb, 0x6e, 0x09, 0xec, 0x33, 0xa1, + 0x83, 0x76, 0x28, 0x36, 0xee, 0xf4, 0xfe, 0xbb, 0xc1, 0x60, 0x72, 0xb3, 0xb0, 0x05, 0x8c, 0xf8, + 0xc7, 0xef, 0xbf, 0xbf, 0xf6, 0x9f, 0xb1, 0x31, 0xf7, 0x8e, 0x2d, 0xd4, 0x92, 0xff, 0xff, 0xc3, + 0xb1, 0x4f, 0x84, 0x0e, 0x3d, 0x2d, 0x7b, 0x7c, 0xed, 0x2c, 0x9e, 0xe5, 0xc9, 0xf5, 0x22, 0xcf, + 0xb1, 0xe5, 0x38, 0xc6, 0xec, 0xe9, 0x8d, 0x1c, 0xcd, 0x2e, 0xf7, 0xde, 0x9e, 0xcd, 0x43, 0x72, + 0x3e, 0x0f, 0xc9, 0xaf, 0x79, 0x48, 0xbe, 0x2c, 0xc2, 0xde, 0xf9, 0x22, 0xec, 0xfd, 0x58, 0x84, + 0xbd, 0xf7, 0xbb, 0xb2, 0xb4, 0x87, 0x75, 0x1a, 0x67, 0x38, 0xeb, 0x8c, 0x3a, 0xd9, 0xe5, 0x1f, + 0xae, 0xe4, 0xd9, 0xd3, 0x0a, 0x4c, 0x3a, 0x70, 0x3f, 0xe4, 0x8b, 0x3f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x81, 0x2b, 0x87, 0x0f, 0x6d, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feerefunder/types/tx.pb.go b/x/feerefunder/types/tx.pb.go index 3688fce95..4ed9d628a 100644 --- a/x/feerefunder/types/tx.pb.go +++ b/x/feerefunder/types/tx.pb.go @@ -158,9 +158,9 @@ var fileDescriptor_2e613aff856d34ed = []byte{ 0x29, 0x1d, 0x62, 0x54, 0xc1, 0xac, 0x92, 0x62, 0x6d, 0x00, 0x79, 0xc2, 0xc9, 0xff, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, - 0x92, 0xf3, 0x73, 0xf5, 0xa1, 0x06, 0xeb, 0xe6, 0x17, 0xa5, 0xc3, 0xd8, 0xfa, 0x65, 0x26, 0xfa, + 0x92, 0xf3, 0x73, 0xf5, 0xa1, 0x06, 0xeb, 0xe6, 0x17, 0xa5, 0xc3, 0xd8, 0xfa, 0x65, 0xa6, 0xfa, 0x15, 0xa8, 0x09, 0xa6, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x41, 0xc6, 0x80, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xb2, 0x97, 0x0b, 0xe2, 0x54, 0x02, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x96, 0x4e, 0x0c, 0x81, 0x54, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/globalfee/alias.go b/x/globalfee/alias.go index 656eb013a..e2c9c07c8 100644 --- a/x/globalfee/alias.go +++ b/x/globalfee/alias.go @@ -1,7 +1,7 @@ package globalfee import ( - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) const ( diff --git a/x/globalfee/ante/antetest/fee_test.go b/x/globalfee/ante/antetest/fee_test.go index de325da9b..8dac71795 100644 --- a/x/globalfee/ante/antetest/fee_test.go +++ b/x/globalfee/ante/antetest/fee_test.go @@ -16,8 +16,8 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - gaiafeeante "github.com/neutron-org/neutron/v4/x/globalfee/ante" - globfeetypes "github.com/neutron-org/neutron/v4/x/globalfee/types" + gaiafeeante "github.com/neutron-org/neutron/v5/x/globalfee/ante" + globfeetypes "github.com/neutron-org/neutron/v5/x/globalfee/types" ) var testGasLimit uint64 = 200_000 diff --git a/x/globalfee/ante/antetest/fee_test_setup.go b/x/globalfee/ante/antetest/fee_test_setup.go index 45a49afdb..2adfa3256 100644 --- a/x/globalfee/ante/antetest/fee_test_setup.go +++ b/x/globalfee/ante/antetest/fee_test_setup.go @@ -3,9 +3,9 @@ package antetest import ( "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" - "github.com/neutron-org/neutron/v4/testutil" + "github.com/neutron-org/neutron/v5/testutil" "github.com/stretchr/testify/suite" @@ -17,10 +17,10 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - neutronapp "github.com/neutron-org/neutron/v4/app" - gaiaparams "github.com/neutron-org/neutron/v4/app/params" - gaiafeeante "github.com/neutron-org/neutron/v4/x/globalfee/ante" - globfeetypes "github.com/neutron-org/neutron/v4/x/globalfee/types" + neutronapp "github.com/neutron-org/neutron/v5/app" + gaiaparams "github.com/neutron-org/neutron/v5/app/params" + gaiafeeante "github.com/neutron-org/neutron/v5/x/globalfee/ante" + globfeetypes "github.com/neutron-org/neutron/v5/x/globalfee/types" ) type IntegrationTestSuite struct { diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index b80483e7e..01300368d 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -3,14 +3,14 @@ package ante import ( "fmt" - gaiaerrors "github.com/neutron-org/neutron/v4/x/globalfee/types" + gaiaerrors "github.com/neutron-org/neutron/v5/x/globalfee/types" "cosmossdk.io/math" tmstrings "github.com/cometbft/cometbft/libs/strings" - "github.com/neutron-org/neutron/v4/app/params" - globalfeekeeper "github.com/neutron-org/neutron/v4/x/globalfee/keeper" + "github.com/neutron-org/neutron/v5/app/params" + globalfeekeeper "github.com/neutron-org/neutron/v5/x/globalfee/keeper" errorsmod "cosmossdk.io/errors" diff --git a/x/globalfee/ante/fee_utils.go b/x/globalfee/ante/fee_utils.go index 1eeb11f49..2917d6d41 100644 --- a/x/globalfee/ante/fee_utils.go +++ b/x/globalfee/ante/fee_utils.go @@ -3,7 +3,7 @@ package ante import ( errorsmod "cosmossdk.io/errors" - gaiaerrors "github.com/neutron-org/neutron/v4/x/globalfee/types" + gaiaerrors "github.com/neutron-org/neutron/v5/x/globalfee/types" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/globalfee/client/cli/query.go b/x/globalfee/client/cli/query.go index be422f555..7ac7f7d3f 100644 --- a/x/globalfee/client/cli/query.go +++ b/x/globalfee/client/cli/query.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) func GetQueryCmd() *cobra.Command { diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index 6fb447d03..6d5a644d1 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/math" metrics2 "cosmossdk.io/store/metrics" - globalfeekeeper "github.com/neutron-org/neutron/v4/x/globalfee/keeper" + globalfeekeeper "github.com/neutron-org/neutron/v5/x/globalfee/keeper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -21,8 +21,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - gaiaparams "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + gaiaparams "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) func TestDefaultGenesis(t *testing.T) { diff --git a/x/globalfee/keeper/grpc_query.go b/x/globalfee/keeper/grpc_query.go index 957eb8a9c..9f8b06c16 100644 --- a/x/globalfee/keeper/grpc_query.go +++ b/x/globalfee/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/globalfee/keeper/grpc_query_params.go b/x/globalfee/keeper/grpc_query_params.go index 563b38b3d..bcaac8e2f 100644 --- a/x/globalfee/keeper/grpc_query_params.go +++ b/x/globalfee/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/globalfee/keeper/grpc_query_params_test.go b/x/globalfee/keeper/grpc_query_params_test.go index 3bd18c387..2b80d1e00 100644 --- a/x/globalfee/keeper/grpc_query_params_test.go +++ b/x/globalfee/keeper/grpc_query_params_test.go @@ -6,11 +6,11 @@ import ( "cosmossdk.io/math" sdktypes "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/neutron-org/neutron/v4/testutil/globalfee/keeper" + testkeeper "github.com/neutron-org/neutron/v5/testutil/globalfee/keeper" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/globalfee/keeper/keeper.go b/x/globalfee/keeper/keeper.go index 9e5baca35..eda7a3843 100644 --- a/x/globalfee/keeper/keeper.go +++ b/x/globalfee/keeper/keeper.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) // Keeper of the globalfee store diff --git a/x/globalfee/keeper/migrations.go b/x/globalfee/keeper/migrations.go index ac0f41750..7090b13b2 100644 --- a/x/globalfee/keeper/migrations.go +++ b/x/globalfee/keeper/migrations.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - v3 "github.com/neutron-org/neutron/v4/x/globalfee/migrations/v3" + v3 "github.com/neutron-org/neutron/v5/x/globalfee/migrations/v3" - v2 "github.com/neutron-org/neutron/v4/x/globalfee/migrations/v2" + v2 "github.com/neutron-org/neutron/v5/x/globalfee/migrations/v2" ) // Migrator is a struct for handling in-place store migrations. diff --git a/x/globalfee/keeper/msg_server.go b/x/globalfee/keeper/msg_server.go index caea17934..662745004 100644 --- a/x/globalfee/keeper/msg_server.go +++ b/x/globalfee/keeper/msg_server.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) var _ types.MsgServer = msgServer{} diff --git a/x/globalfee/migrations/v2/migration.go b/x/globalfee/migrations/v2/migration.go index 070161b01..ac5160eec 100644 --- a/x/globalfee/migrations/v2/migration.go +++ b/x/globalfee/migrations/v2/migration.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) // MigrateStore performs in-place params migrations of diff --git a/x/globalfee/migrations/v2/v2_test/migration_test.go b/x/globalfee/migrations/v2/v2_test/migration_test.go index f9ecb4dec..46b01d5f1 100644 --- a/x/globalfee/migrations/v2/v2_test/migration_test.go +++ b/x/globalfee/migrations/v2/v2_test/migration_test.go @@ -19,8 +19,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - v2 "github.com/neutron-org/neutron/v4/x/globalfee/migrations/v2" - globalfeetypes "github.com/neutron-org/neutron/v4/x/globalfee/types" + v2 "github.com/neutron-org/neutron/v5/x/globalfee/migrations/v2" + globalfeetypes "github.com/neutron-org/neutron/v5/x/globalfee/types" ) func TestMigrateStore(t *testing.T) { diff --git a/x/globalfee/migrations/v3/migration.go b/x/globalfee/migrations/v3/migration.go index 4855c9497..8cf308bf7 100644 --- a/x/globalfee/migrations/v3/migration.go +++ b/x/globalfee/migrations/v3/migration.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) // MigrateStore performs in-place params migrations diff --git a/x/globalfee/migrations/v3/v3_test/migration_test.go b/x/globalfee/migrations/v3/v3_test/migration_test.go index 3733258bc..40b7350ff 100644 --- a/x/globalfee/migrations/v3/v3_test/migration_test.go +++ b/x/globalfee/migrations/v3/v3_test/migration_test.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" metrics2 "cosmossdk.io/store/metrics" - v3 "github.com/neutron-org/neutron/v4/x/globalfee/migrations/v3" + v3 "github.com/neutron-org/neutron/v5/x/globalfee/migrations/v3" "github.com/stretchr/testify/require" @@ -21,7 +21,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - globalfeetypes "github.com/neutron-org/neutron/v4/x/globalfee/types" + globalfeetypes "github.com/neutron-org/neutron/v5/x/globalfee/types" ) func TestMigrateStore(t *testing.T) { diff --git a/x/globalfee/module.go b/x/globalfee/module.go index 2b85ce35f..5a5743b33 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -22,9 +22,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/neutron-org/neutron/v4/x/globalfee/client/cli" - "github.com/neutron-org/neutron/v4/x/globalfee/keeper" - "github.com/neutron-org/neutron/v4/x/globalfee/types" + "github.com/neutron-org/neutron/v5/x/globalfee/client/cli" + "github.com/neutron-org/neutron/v5/x/globalfee/keeper" + "github.com/neutron-org/neutron/v5/x/globalfee/types" ) var ( diff --git a/x/globalfee/types/genesis.pb.go b/x/globalfee/types/genesis.pb.go index 349c454df..092d8780b 100644 --- a/x/globalfee/types/genesis.pb.go +++ b/x/globalfee/types/genesis.pb.go @@ -91,8 +91,8 @@ var fileDescriptor_015b3e8b7a7c65c5 = []byte{ 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, 0xca, 0x38, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x2f, 0xb5, 0xb4, 0xa4, 0x28, 0x3f, 0x4f, 0x37, 0xbf, 0x28, - 0x1d, 0xc6, 0xd6, 0x2f, 0x33, 0xd1, 0xaf, 0x40, 0xf2, 0x55, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, - 0x1b, 0xd8, 0xdd, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xf5, 0x57, 0x87, 0x32, 0x01, + 0x1d, 0xc6, 0xd6, 0x2f, 0x33, 0xd5, 0xaf, 0x40, 0xf2, 0x55, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, + 0x1b, 0xd8, 0xdd, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6d, 0xee, 0xdb, 0xe9, 0x32, 0x01, 0x00, 0x00, } diff --git a/x/globalfee/types/params.pb.go b/x/globalfee/types/params.pb.go index f6bc1a627..fe726838f 100644 --- a/x/globalfee/types/params.pb.go +++ b/x/globalfee/types/params.pb.go @@ -108,29 +108,29 @@ var fileDescriptor_f135cd41f9af437e = []byte{ // 402 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0xaa, 0xd3, 0x40, 0x14, 0x86, 0x13, 0x23, 0x17, 0x8c, 0x1b, 0x09, 0x17, 0x89, 0x97, 0x4b, 0x52, 0x22, 0x48, 0x41, - 0x6f, 0x86, 0xeb, 0x75, 0xe5, 0x32, 0x8a, 0xc5, 0x45, 0xb1, 0x94, 0xba, 0x71, 0x33, 0x9c, 0xc4, - 0xe9, 0x38, 0x98, 0xc9, 0x84, 0x9c, 0x49, 0x69, 0x96, 0xbe, 0x81, 0x0f, 0xe0, 0x13, 0xf8, 0x0c, - 0x3e, 0x40, 0x97, 0x5d, 0xba, 0x8a, 0xd2, 0xee, 0xba, 0xf4, 0x09, 0x24, 0x49, 0xab, 0x2d, 0xbd, - 0x5d, 0xe5, 0x70, 0xf2, 0xfd, 0xff, 0xf9, 0xcf, 0xcc, 0xd8, 0x8f, 0x39, 0x08, 0x20, 0x3c, 0x55, - 0x31, 0xa4, 0x53, 0xc6, 0xc8, 0xec, 0x3a, 0x66, 0x1a, 0xae, 0x49, 0x0e, 0x05, 0x48, 0x0c, 0xf3, - 0x42, 0x69, 0xe5, 0x3c, 0x6c, 0xa0, 0xf0, 0x1f, 0x14, 0x6e, 0xa1, 0x0b, 0x2f, 0x51, 0x28, 0x15, - 0x92, 0x18, 0xf0, 0xbf, 0x32, 0x51, 0x22, 0xeb, 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, 0x66, 0xe1, 0x12, 0x81, 0x33, + 0xd7, 0xea, 0x99, 0xfd, 0xbb, 0x63, 0x5f, 0xc2, 0x7c, 0xd2, 0xc0, 0xd1, 0xa1, 0xdb, 0x00, 0xf0, + 0x7d, 0x83, 0x45, 0xc3, 0xc5, 0xca, 0x33, 0x97, 0x2b, 0xcf, 0xfc, 0xbd, 0xf2, 0xcc, 0xaf, 0x6b, + 0xcf, 0x58, 0xae, 0x3d, 0xe3, 0xe7, 0xda, 0x33, 0x3e, 0xdc, 0xec, 0x9d, 0x56, 0xc6, 0x4a, 0x5d, + 0xa8, 0xec, 0x4a, 0x15, 0x7c, 0x57, 0x93, 0xd9, 0x0b, 0x32, 0xdf, 0x7b, 0x4a, 0x6d, 0xec, 0xf8, + 0xac, 0xbd, 0xf4, 0x9b, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x68, 0x4b, 0x82, 0x69, 0x02, 0x00, 0x00, } diff --git a/x/globalfee/types/query.pb.go b/x/globalfee/types/query.pb.go index 1f802433c..b3c41c2c8 100644 --- a/x/globalfee/types/query.pb.go +++ b/x/globalfee/types/query.pb.go @@ -140,8 +140,8 @@ var fileDescriptor_12a736cede25d10a = []byte{ 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xe7, 0xa5, 0x96, 0x96, 0x14, 0xe5, 0xe7, 0xe9, 0xe6, 0x17, - 0xa5, 0xc3, 0xd8, 0xfa, 0x65, 0x26, 0xfa, 0x15, 0x48, 0xe6, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, - 0xb1, 0x81, 0x83, 0xd5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x30, 0xe5, 0x3b, 0xc3, 0xed, 0x01, + 0xa5, 0xc3, 0xd8, 0xfa, 0x65, 0xa6, 0xfa, 0x15, 0x48, 0xe6, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, + 0xb1, 0x81, 0x83, 0xd5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x71, 0xfe, 0xb7, 0xad, 0xed, 0x01, 0x00, 0x00, } diff --git a/x/globalfee/types/tx.pb.go b/x/globalfee/types/tx.pb.go index 31da98227..961f4d490 100644 --- a/x/globalfee/types/tx.pb.go +++ b/x/globalfee/types/tx.pb.go @@ -159,9 +159,9 @@ var fileDescriptor_1b7ff262ac5784d9 = []byte{ 0xf2, 0x88, 0x93, 0xef, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xe7, 0xa5, 0x96, 0x96, 0x14, 0xe5, - 0xe7, 0xe9, 0xe6, 0x17, 0xa5, 0xc3, 0xd8, 0xfa, 0x65, 0x26, 0xfa, 0x15, 0x48, 0x71, 0x58, 0x52, - 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x8e, 0x25, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, - 0xc9, 0x07, 0xad, 0x62, 0x02, 0x00, 0x00, + 0xe7, 0xe9, 0xe6, 0x17, 0xa5, 0xc3, 0xd8, 0xfa, 0x65, 0xa6, 0xfa, 0x15, 0x48, 0x71, 0x58, 0x52, + 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x8e, 0x25, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc9, + 0xd2, 0x8b, 0xc3, 0x62, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ibc-hooks/bytecode/rate_limiter.wasm b/x/ibc-hooks/bytecode/rate_limiter.wasm new file mode 100644 index 000000000..7627ff34c Binary files /dev/null and b/x/ibc-hooks/bytecode/rate_limiter.wasm differ diff --git a/x/ibc-hooks/client/cli/query.go b/x/ibc-hooks/client/cli/query.go index 90da41aa0..8fb1c718d 100644 --- a/x/ibc-hooks/client/cli/query.go +++ b/x/ibc-hooks/client/cli/query.go @@ -4,11 +4,11 @@ import ( "fmt" "strings" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/utils" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/utils" "github.com/cosmos/cosmos-sdk/client" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/types" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/types" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/ibc-hooks/ibc_middleware_test.go b/x/ibc-hooks/ibc_middleware_test.go index 0291417f9..7deb43ce7 100644 --- a/x/ibc-hooks/ibc_middleware_test.go +++ b/x/ibc-hooks/ibc_middleware_test.go @@ -15,10 +15,10 @@ import ( ibctesting "github.com/cosmos/ibc-go/v8/testing" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/testutils" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/utils" + "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/testutils" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/utils" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck @@ -47,11 +47,11 @@ func (suite *HooksTestSuite) TestOnRecvPacketHooks() { expPass bool }{ {"override", func(status *testutils.Status) { - suite.GetNeutronZoneApp(suite.ChainB).HooksTransferIBCModule. + suite.GetNeutronZoneApp(suite.ChainB).TransferStack. ICS4Middleware.Hooks = testutils.TestRecvOverrideHooks{Status: status} }, true}, {"before and after", func(status *testutils.Status) { - suite.GetNeutronZoneApp(suite.ChainB).HooksTransferIBCModule. + suite.GetNeutronZoneApp(suite.ChainB).TransferStack. ICS4Middleware.Hooks = testutils.TestRecvBeforeAfterHooks{Status: status} }, true}, } @@ -87,7 +87,7 @@ func (suite *HooksTestSuite) TestOnRecvPacketHooks() { data := transfertypes.NewFungibleTokenPacketData(trace.GetFullDenomPath(), amount.String(), suite.ChainA.SenderAccount.GetAddress().String(), receiver, "") packet := channeltypes.NewPacket(data.GetBytes(), seq, suite.TransferPath.EndpointA.ChannelConfig.PortID, suite.TransferPath.EndpointA.ChannelID, suite.TransferPath.EndpointB.ChannelConfig.PortID, suite.TransferPath.EndpointB.ChannelID, clienttypes.NewHeight(1, 100), 0) - ack := suite.GetNeutronZoneApp(suite.ChainB).HooksTransferIBCModule. + ack := suite.GetNeutronZoneApp(suite.ChainB).TransferStack. OnRecvPacket(suite.ChainB.GetContext(), packet, suite.ChainA.SenderAccount.GetAddress()) if tc.expPass { @@ -96,14 +96,14 @@ func (suite *HooksTestSuite) TestOnRecvPacketHooks() { suite.Require().False(ack.Success()) } - if _, ok := suite.GetNeutronZoneApp(suite.ChainB).HooksTransferIBCModule. + if _, ok := suite.GetNeutronZoneApp(suite.ChainB).TransferStack. ICS4Middleware.Hooks.(testutils.TestRecvOverrideHooks); ok { suite.Require().True(status.OverrideRan) suite.Require().False(status.BeforeRan) suite.Require().False(status.AfterRan) } - if _, ok := suite.GetNeutronZoneApp(suite.ChainB).HooksTransferIBCModule. + if _, ok := suite.GetNeutronZoneApp(suite.ChainB).TransferStack. ICS4Middleware.Hooks.(testutils.TestRecvBeforeAfterHooks); ok { suite.Require().False(status.OverrideRan) suite.Require().True(status.BeforeRan) diff --git a/x/ibc-hooks/ics4_middleware.go b/x/ibc-hooks/ics4_middleware.go index 29f8dd4c4..6e5d72d0b 100644 --- a/x/ibc-hooks/ics4_middleware.go +++ b/x/ibc-hooks/ics4_middleware.go @@ -7,7 +7,7 @@ import ( capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck - "github.com/neutron-org/neutron/v4/x/ibc-hooks/types" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/types" // ibc-go channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" diff --git a/x/ibc-hooks/sdkmodule.go b/x/ibc-hooks/sdkmodule.go index ee71c4c73..248b61057 100644 --- a/x/ibc-hooks/sdkmodule.go +++ b/x/ibc-hooks/sdkmodule.go @@ -12,8 +12,8 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/client/cli" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/types" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/client/cli" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/types" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/ibc-hooks/testutils/testing_hooks.go b/x/ibc-hooks/testutils/testing_hooks.go index ccfdd6bd5..3d7f29dd7 100644 --- a/x/ibc-hooks/testutils/testing_hooks.go +++ b/x/ibc-hooks/testutils/testing_hooks.go @@ -8,7 +8,7 @@ import ( channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" - ibchooks "github.com/neutron-org/neutron/v4/x/ibc-hooks" + ibchooks "github.com/neutron-org/neutron/v5/x/ibc-hooks" ) var ( diff --git a/x/ibc-hooks/utils/utils.go b/x/ibc-hooks/utils/utils.go index 11e307889..44e4ed427 100644 --- a/x/ibc-hooks/utils/utils.go +++ b/x/ibc-hooks/utils/utils.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/address" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/types" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/types" sdk "github.com/cosmos/cosmos-sdk/types" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" @@ -71,3 +71,13 @@ func DeriveIntermediateSender(channel, originalSender, bech32Prefix string) (str sender := sdk.AccAddress(senderHash32) return sdk.Bech32ifyAddressBytes(bech32Prefix, sender) } + +// IsAckError checks an IBC acknowledgement to see if it's an error. +// This is a replacement for ack.Success() which is currently not working on some circumstances +func IsAckError(acknowledgement []byte) bool { + var ackErr channeltypes.Acknowledgement_Error + if err := json.Unmarshal(acknowledgement, &ackErr); err == nil && len(ackErr.Error) > 0 { + return true + } + return false +} diff --git a/x/ibc-hooks/wasm_hook.go b/x/ibc-hooks/wasm_hook.go index c87d03faa..cbbd55054 100644 --- a/x/ibc-hooks/wasm_hook.go +++ b/x/ibc-hooks/wasm_hook.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/utils" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/utils" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -16,7 +16,7 @@ import ( channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" - "github.com/neutron-org/neutron/v4/x/ibc-hooks/types" + "github.com/neutron-org/neutron/v5/x/ibc-hooks/types" ) type ContractAck struct { diff --git a/x/ibc-rate-limit/README.md b/x/ibc-rate-limit/README.md new file mode 100644 index 000000000..34165427e --- /dev/null +++ b/x/ibc-rate-limit/README.md @@ -0,0 +1,305 @@ +# IBC Rate Limit + +The IBC Rate Limit module is responsible for adding a governance-configurable rate limit to IBC transfers. +This is a safety control, intended to protect assets on Neutron in event of: + +* a bug/hack on Neutron +* a bug/hack on the counter-party chain +* a bug/hack in IBC itself + +This is done in exchange for a potential (one-way) bridge liveness tradeoff, in periods of high deposits or withdrawals. + +The architecture of this package is a minimal go package which implements an [IBC Middleware](https://github.com/cosmos/ibc-go/blob/f57170b1d4dd202a3c6c1c61dcf302b6a9546405/docs/ibc/middleware/develop.md) that wraps the [ICS20 transfer](https://ibc.cosmos.network/main/apps/transfer/overview.html) app, and calls into a cosmwasm contract. +The cosmwasm contract then has all of the actual IBC rate limiting logic. +The Cosmwasm code can be found in the [`contracts`](./contracts/) package, with bytecode findable in the [`bytecode`](./bytecode/) folder. The cosmwasm VM usage allows Neutron chain governance (Security SubDAI) to choose to change this safety control with no hard forks, via a parameter change proposal, a great mitigation for faster threat adaptavity. + +The status of the module is being in a state suitable for some initial governance settable rate limits for high value bridged assets. +Its not in its long term / end state for all channels by any means, but does act as a strong protection we +can instantiate today for high value IBC connections. + +## Motivation + +The motivation of IBC-rate-limit comes from the empirical observations of blockchain bridge hacks that a rate limit would have massively reduced the stolen amount of assets in: + +- [Polynetwork Bridge Hack ($611 million)](https://rekt.news/polynetwork-rekt/) +- [BNB Bridge Hack ($586 million)](https://rekt.news/bnb-bridge-rekt/) +- [Wormhole Bridge Hack ($326 million)](https://rekt.news/wormhole-rekt/) +- [Nomad Bridge Hack ($190 million)](https://rekt.news/nomad-rekt/) +- [Harmony Bridge Hack ($100 million)](https://rekt.news/harmony-rekt/) - (Would require rate limit + monitoring) +- [Dragonberry IBC bug](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702) (can't yet disclose amount at risk, but was saved due to being found first by altruistic Neutron core developers) + +In the presence of a software bug on Neutron, IBC itself, or on a counterparty chain, we would like to prevent the bridge from being fully depegged. +This stems from the idea that a 30% asset depeg is ~infinitely better than a 100% depeg. +Its _crazy_ that today these complex bridged assets can instantly go to 0 in event of bug. +The goal of a rate limit is to raise an alert that something has potentially gone wrong, allowing validators and developers to have time to analyze, react, and protect larger portions of user funds. + +The thesis of this is that, it is worthwhile to sacrifice liveness in the case of legitimate demand to send extreme amounts of funds, to prevent the terrible long-tail full fund risks. +Rate limits aren't the end-all of safety controls, they're merely the simplest automated one. More should be explored and added onto IBC! + +## Rate limit types + +We express rate limits in time-based periods. +This means, we set rate limits for (say) 6-hour, daily, and weekly intervals. +The rate limit for a given time period stores the relevant amount of assets at the start of the rate limit. +Rate limits are then defined on percentage terms of the asset. +The time windows for rate limits are currently _not_ rolling, they have discrete start/end times. + +We allow setting separate rate limits for the inflow and outflow of assets. +We do all of our rate limits based on the _net flow_ of assets on a channel pair. This prevents DOS issues, of someone repeatedly sending assets back and forth, to trigger rate limits and break liveness. + +We currently envision creating two kinds of rate limits: + +* Per denomination rate limits + - allows safety statements like "Only 30% of Atom on Neutron can flow out in one day" or "The amount of Atom on Neutron can at most double per day". +* Per channel rate limits + - Limit the total inflow and outflow on a given IBC channel, based on "USDC" equivalent, using Neutron as the price oracle. + +We currently only implement per denomination rate limits for non-native assets. We do not yet implement channel based rate limits. + +Currently these rate limits automatically "expire" at the end of the quota duration. TODO: Think of better designs here. E.g. can we have a constant number of subsequent quotas start filled? Or perhaps harmonically decreasing amounts of next few quotas pre-filled? Halted until DAO override seems not-great. + +## Instantiating rate limits + +Today all rate limit quotas must be set manually by governance. +In the future, we should design towards some conservative rate limit to add as a safety-backstop automatically for channels. +Ideas for how this could look: + +* One month after a channel has been created, automatically add in some USDC-based rate limit +* One month after governance incentivizes an asset, add on a per-denomination rate limit. + +Definitely needs far more ideation and iteration! + +## Parameterizing the rate limit + +One element is we don't want any rate limit timespan that's too short, e.g. not enough time for humans to react to. So we wouldn't want a 1 hour rate limit, unless we think that if its hit, it could be assessed within an hour. + +### Handling rate limit boundaries + +We want to be safe against the case where say we have a daily rate limit ending at a given time, and an adversary attempts to attack near the boundary window. +We would not like them to be able to "double extract funds" by timing their extraction near a window boundary. + +Admittedly, not a lot of thought has been put into how to deal with this well. +Right now we envision simply handling this by saying if you want a quota of duration D, instead include two quotas of duration D, but offset by `D/2` from each other. + +Ideally we can change windows to be more 'rolling' in the future, to avoid this overhead and more cleanly handle the problem. (Perhaps rolling ~1 hour at a time) + +### Inflow parameterization + +The "Inflow" side of a rate limit is essentially protection against unforeseen bug on a counterparty chain. +This can be quite conservative (e.g. bridged amount doubling in one week). This covers a few cases: + +* Counter-party chain B having a token theft attack + - TODO: description of how this looks +* Counter-party chain B runaway mint + - TODO: description of how this looks +* IBC theft + - TODO: description of how this looks + +It does get more complex when the counterparty chain is itself a DEX, but this is still much more protection than nothing. + +### Outflow parameterization + +The "Outflow" side of a rate limit is protection against a bug on Neutron OR IBC. +This has potential for much more user-frustrating issues, if set too low. +E.g. if there's some event that causes many people to suddenly withdraw many STARS or many USDC. + +So this parameterization has to contend with being a tradeoff of withdrawal liveness in high volatility periods vs being a crucial safety rail, in event of on-Neutron bug. + +TODO: Better fill out + +### Example suggested parameterization + +## Code structure + +As mentioned at the beginning of the README, the go code is a relatively minimal ICS 20 wrapper, that dispatches relevant calls to a cosmwasm contract that implements the rate limiting functionality. + +### Go Middleware + +To achieve this, the middleware needs to implement the `porttypes.Middleware` interface and the +`porttypes.ICS4Wrapper` interface. This allows the middleware to send and receive IBC messages by wrapping +any IBC module, and be used as an ICS4 wrapper by a transfer module (for sending packets or writing acknowledgements). + +Of those interfaces, just the following methods have custom logic: + +* `ICS4Wrapper.SendPacket` forwards to contract, with intent of tracking of value sent via an ibc channel +* `Middleware.OnRecvPacket` forwards to contract, with intent of tracking of value received via an ibc channel +* `Middleware.OnAcknowledgementPacket` forwards to contract, with intent of undoing the tracking of a sent packet if the acknowledgment is not a success +* `OnTimeoutPacket` forwards to contract, with intent of undoing the tracking of a sent packet if the packet times out (is not relayed) + +All other methods from those interfaces are passthroughs to the underlying implementations. + +#### Parameters + +The middleware uses the following parameters: + +| Key | Type | +|-----------------|--------| +| ContractAddress | string | + +1. **ContractAddress** - + The contract address is the address of an instantiated version of the contract provided under `./contracts/` + +### Cosmwasm Contract Concepts + +Something to keep in mind with all of the code, is that we have to reason separately about every item in the following matrix: + +| Native Token | Non-Native Token | +|----------------------|--------------------------| +| Send Native Token | Send Non-Native Token | +| Receive Native Token | Receive Non-Native Token | +| Timeout Native Send | Timeout Non-native Send | + +(Error ACK can reuse the same code as timeout) + +TODO: Spend more time on sudo messages in the following description. We need to better describe how we map the quota concepts onto the code. +Need to describe how we get the quota beginning balance, and that its different for sends and receives. +Explain intracacies of tracking that a timeout and/or ErrorAck must appear from the same quota, else we ignore its update to the quotas. + + +The tracking contract uses the following concepts + +1. **RateLimit** - tracks the value flow transferred and the quota for a path. +2. **Path** - is a (denom, channel) pair. +3. **Flow** - tracks the value that has moved through a path during the current time window. +4. **Quota** - is the percentage of the denom's total value that can be transferred through the path in a given period of time (duration) + +#### Messages + +The contract specifies the following messages: + +##### Query + +* GetQuotas - Returns the quotas for a path + +##### Exec + +* AddPath - Adds a list of quotas for a path +* RemovePath - Removes a path +* ResetPathQuota - If a rate limit has been reached, the contract's governance address can reset the quota so that transfers are allowed again + +##### Sudo + +Sudo messages can only be executed by the chain. + +* SendPacket - Increments the amount used out of the send quota and checks that the send is allowed. If it isn't, it will return a RateLimitExceeded error +* RecvPacket - Increments the amount used out of the receive quota and checks that the receive is allowed. If it isn't, it will return a RateLimitExceeded error +* UndoSend - If a send has failed, the undo message is used to remove its cost from the send quota + +All of these messages receive the packet from the chain and extract the necessary information to process the packet and determine if it should be the rate limited. + +### Necessary information + +To determine if a packet should be rate limited, we need: + +* Channel: The channel on the Neutron side: `packet.SourceChannel` for sends, and `packet.DestinationChannel` for receives. +* Denom: The denom of the token being transferred as known on the Neutron side (more on that below) +* Channel Value: The total value of the channel denominated in `Denom` (i.e.: channel-17 is worth 10k osmo). +* Funds: the amount being transferred + +#### Notes on Channel +The contract also supports quotas on a custom channel called "any" that is checked on every transfer. If either the +transfer channel or the "any" channel have a quota that has been filled, the transaction will be rate limited. + +#### Notes on Denom +We always use the the denom as represented on Neutron. For native assets that is the local denom, and for non-native +assets it's the "ibc" prefix and the sha256 hash of the denom trace (`ibc/...`). + +##### Sends + +For native denoms, we can just use the denom in the packet. If the denom is invalid, it will fail somewhere else along the chain. Example result: `uosmo` + +For non-native denoms, the contract needs to hash the denom trace and append it to the `ibc/` prefix. The +contract always receives the parsed denom (i.e.: `transfer/channel-32/uatom` instead of +`ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2`). This is because of the order in which +the middleware is called. When sending a non-native denom, the packet contains `transfer/source-channel/denom` as it +is built on the `relay.SendTransfer()` in the transfer module and then passed to the middleware. Example result: `ibc/` + +##### Receives + +This behaves slightly different if the asset is an Neutron asset that was sent to the counterparty and is being +returned to the chain, or if the asset is being received by the chain and originates on the counterparty. In ibc this +is called being a "source" or a "sink" respectively. + +If the chain is a sink for the denom, we build the local denom by prefixing the port and the channel +(`transfer/local-channel`) and hashing that denom. Example result: `ibc/` + +If the chain is the source for the denom, there are two possibilities: + +* The token is a native token, in which case we just remove the prefix added by the counterparty. Example result: `uosmo` +* The token is a non-native token, in which case we remove the extra prefix and hash it. Example result `ibc/` + +#### Notes on Channel Value +We have iterated on different strategies for calculating the channel value. Our preferred strategy is the following: +* For non-native tokens (`ibc/...`), the channel value should be the supply of those tokens in Neutron +* For native tokens, the channel value should be the total amount of tokens in escrow across all ibc channels + +The later ensures the limits are lower and represent the amount of native tokens that exist outside Neutron. This is +beneficial as we assume the majority of native tokens exist on the native chain and the amount "normal" ibc transfers is +proportional to the tokens that have left the chain. + +This strategy cannot be implemented at the moment because IBC does not track the amount of tokens in escrow across +all channels ([github issue](https://github.com/cosmos/ibc-go/issues/2664)). Instead, we use the current supply on +Neutron for all denoms (i.e.: treat native and non-native tokens the same way). Once that ticket is fixed, we will +update this strategy. + +##### Caching + +The channel value varies constantly. To have better predictability, and avoid issues of the value growing if there is +a potential infinite mint bug, we cache the channel value at the beginning of the period for every quota. + +This means that if we have a daily quota of 1% of the osmo supply, and the channel value is 1M osmo at the beginning of +the quota, no more than 100k osmo can transferred during that day. If 10M osmo were to be minted or IBC'd in during that +period, the quota will not increase until the period expired. Then it will be 1% of the new channel value (~11M) + +### Integration + +The rate limit middleware wraps the `transferIBCModule` and is added as the entry route for IBC transfers. + +The module is also provided to the underlying `transferIBCModule` as its `ICS4Wrapper`; previously, this would have +pointed to a channel, which also implements the `ICS4Wrapper` interface. + +## Testing strategy + + +A general testing strategy is as follows: + +* Setup two chains. +* Send some tokens from A->B and some from B->A (so that there are IBC tokens to play with in both sides) +* Add the rate limiter on A with low limits (i.e. 1% of supply) +* Test Function for chains A' and B' and denom d + * Send some d tokens from A' to B' and get close to the limit. + * Do the same transfer making sure the amount is above the quota and verify it fails with the rate limit error + * Wait until the reset time has passed, and send again. The transfer should now succeed +* Repeat the above test for the following combination of chains and tokens: `(A,B,a)`, `(B,A,a)`, `(A,B,b)`, `(B,A,b)`, + where `a` and `b` are native tokens to chains A and B respectively. + +For more comprehensive tests we can also: +* Add a third chain C and make sure everything works properly for C tokens that have been transferred to A and to B +* Test that the contracts gov address can reset rate limits if the quota has been hit +* Test the queries for getting information about the state of the quotas +* Test that rate limit symmetries hold (i.e.: sending the a token through a rate-limited channel and then sending back + reduces the rate limits by the same amount that it was increased during the first send) +* Ensure that the channels between the test chains have different names (A->B="channel-0", B->A="channel-1", for example) + +## Known Future work + +Items that have been highlighted above: + +* Making automated rate limits get added for channels, instead of manual configuration only +* Improving parameterization strategies / data analysis +* Adding the USDC based rate limits +* We need better strategies for how rate limits "expire". + +Not yet highlighted + +* Making monitoring tooling to know when approaching rate limiting and when they're hit +* Making tooling to easily give us summaries we can use, to reason about "bug or not bug" in event of rate limit being hit +* Enabling ways to pre-declare large transfers so as to not hit rate limits. + * Perhaps you can on-chain declare intent to send these assets with a large delay, that raises monitoring but bypasses rate limits? + * Maybe contract-based tooling to split up the transfer suffices? +* Strategies to account for high volatility periods without hitting rate limits + * Can imagine "Hop network" style markets emerging + * Could imagine tieng it into looking at AMM volatility, or off-chain oracles + * but these are both things we should be wary of security bugs in. + * Maybe [constraint based programming with tracking of provenance](https://youtu.be/HB5TrK7A4pI?t=2852) as a solution +* Analyze changing denom-based rate limits, to just overall withdrawal amount for Neutron diff --git a/x/ibc-rate-limit/bytecode/rate_limiter.wasm b/x/ibc-rate-limit/bytecode/rate_limiter.wasm new file mode 100644 index 000000000..7627ff34c Binary files /dev/null and b/x/ibc-rate-limit/bytecode/rate_limiter.wasm differ diff --git a/x/ibc-rate-limit/client/cli/query.go b/x/ibc-rate-limit/client/cli/query.go new file mode 100644 index 000000000..324363b04 --- /dev/null +++ b/x/ibc-rate-limit/client/cli/query.go @@ -0,0 +1,56 @@ +package cli + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd() *cobra.Command { + // Group ibc-rate-limit queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + GetParams(), + ) + + return nil +} + +// GetParams returns the params for the module +func GetParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params [flags]", + Short: "Get the params for the x/ibc-rate-limit module", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, _ []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/ibc-rate-limit/genesis.go b/x/ibc-rate-limit/genesis.go new file mode 100644 index 000000000..938943b59 --- /dev/null +++ b/x/ibc-rate-limit/genesis.go @@ -0,0 +1,23 @@ +package ibcratelimit + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +// InitGenesis initializes the x/ibc-rate-limit module's state from a provided genesis +// state, which includes the parameter for the contract address. +func (i *ICS4Wrapper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { + err := i.IbcratelimitKeeper.SetParams(ctx, genState.Params) + if err != nil { + panic(err) + } +} + +// ExportGenesis returns the x/ibc-rate-limit module's exported genesis. +func (i *ICS4Wrapper) ExportGenesis(ctx sdk.Context) *types.GenesisState { + return &types.GenesisState{ + Params: i.GetParams(ctx), + } +} diff --git a/x/ibc-rate-limit/genesis_test.go b/x/ibc-rate-limit/genesis_test.go new file mode 100644 index 000000000..957ec60e8 --- /dev/null +++ b/x/ibc-rate-limit/genesis_test.go @@ -0,0 +1,44 @@ +package ibcratelimit_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" + + "github.com/neutron-org/neutron/v5/testutil/apptesting" +) + +type GenesisTestSuite struct { + apptesting.KeeperTestHelper +} + +func TestGenesisTestSuite(t *testing.T) { + suite.Run(t, new(GenesisTestSuite)) +} + +func (suite *GenesisTestSuite) SetupTest() { + suite.Setup() +} + +func (suite *GenesisTestSuite) TestInitExportGenesis() { + testAddress := sdk.AccAddress([]byte("addr1_______________")).String() + suite.SetupTest() + k := suite.App.RateLimitingICS4Wrapper + + initialGenesis := types.GenesisState{ + Params: types.Params{ + ContractAddress: testAddress, + }, + } + + k.InitGenesis(suite.Ctx, initialGenesis) + + suite.Require().Equal(testAddress, k.GetParams(suite.Ctx).ContractAddress) + + exportedGenesis := k.ExportGenesis(suite.Ctx) + + suite.Require().Equal(initialGenesis, *exportedGenesis) +} diff --git a/x/ibc-rate-limit/ibc_middleware_test.go b/x/ibc-rate-limit/ibc_middleware_test.go new file mode 100644 index 000000000..dfdcb6ee0 --- /dev/null +++ b/x/ibc-rate-limit/ibc_middleware_test.go @@ -0,0 +1,761 @@ +package ibcratelimit_test + +import ( + "fmt" + "strconv" + "strings" + "testing" + "time" + + sdkmath "cosmossdk.io/math" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + "github.com/stretchr/testify/require" + "golang.org/x/exp/slices" + + "github.com/neutron-org/neutron/v5/testutil" + + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + + abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + "github.com/stretchr/testify/suite" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +type MiddlewareTestSuite struct { + testutil.IBCConnectionTestSuite +} + +const channelTest = "channel-2" + +// Setup +func TestMiddlewareTestSuite(t *testing.T) { + suite.Run(t, new(MiddlewareTestSuite)) +} + +// Helpers +func (suite *MiddlewareTestSuite) MessageFromAToB(denom string, amount sdkmath.Int) sdk.Msg { + coin := sdk.NewCoin(denom, amount) + port := suite.TransferPath.EndpointA.ChannelConfig.PortID + channel := suite.TransferPath.EndpointA.ChannelID + accountFrom := suite.ChainA.SenderAccount.GetAddress().String() + accountTo := suite.ChainB.SenderAccount.GetAddress().String() + timeoutHeight := clienttypes.NewHeight(10, 100) + return transfertypes.NewMsgTransfer( + port, + channel, + coin, + accountFrom, + accountTo, + timeoutHeight, + uint64(time.Now().UnixNano()), + "", + ) +} + +func (suite *MiddlewareTestSuite) MessageFromBToA(denom string, amount sdkmath.Int) sdk.Msg { + coin := sdk.NewCoin(denom, amount) + port := suite.TransferPath.EndpointB.ChannelConfig.PortID + channel := suite.TransferPath.EndpointB.ChannelID + accountFrom := suite.ChainB.SenderAccount.GetAddress().String() + accountTo := suite.ChainA.SenderAccount.GetAddress().String() + timeoutHeight := clienttypes.NewHeight(10, 100) + return transfertypes.NewMsgTransfer( + port, + channel, + coin, + accountFrom, + accountTo, + timeoutHeight, + uint64(time.Now().UnixNano()), + "", + ) +} + +func (suite *MiddlewareTestSuite) MessageFromAToC(denom string, amount sdkmath.Int) sdk.Msg { + coin := sdk.NewCoin(denom, amount) + port := suite.TransferPathAC.EndpointA.ChannelConfig.PortID + channel := suite.TransferPathAC.EndpointA.ChannelID + accountFrom := suite.ChainA.SenderAccount.GetAddress().String() + accountTo := suite.ChainC.SenderAccount.GetAddress().String() + timeoutHeight := clienttypes.NewHeight(10, 100) + return transfertypes.NewMsgTransfer( + port, + channel, + coin, + accountFrom, + accountTo, + timeoutHeight, + uint64(time.Now().UnixNano()), + "", + ) +} + +func CalculateChannelValue(ctx sdk.Context, denom string, bankKeeper bankkeeper.Keeper) sdkmath.Int { + return bankKeeper.GetSupply(ctx, denom).Amount +} + +func (suite *MiddlewareTestSuite) FullSendBToA(msg sdk.Msg) (*abci.ExecTxResult, string, error) { + sendResult, err := suite.SendMsgsNoCheck(suite.ChainB, msg) + suite.Require().NoError(err) + + packet, err := ibctesting.ParsePacketFromEvents(sendResult.GetEvents()) + suite.Require().NoError(err) + + err = suite.TransferPath.EndpointA.UpdateClient() + suite.Require().NoError(err) + + res, err := suite.TransferPath.EndpointA.RecvPacketWithResult(packet) + suite.Require().NoError(err) + + ack, err := ibctesting.ParseAckFromEvents(res.GetEvents()) + suite.Require().NoError(err) + + err = suite.TransferPath.EndpointA.UpdateClient() + suite.Require().NoError(err) + err = suite.TransferPath.EndpointB.UpdateClient() + suite.Require().NoError(err) + + return sendResult, string(ack), err +} + +func (suite *MiddlewareTestSuite) FullSendAToB(msg sdk.Msg) (*abci.ExecTxResult, string, error) { + sendResult, err := suite.SendMsgsNoCheck(suite.ChainA, msg) + if err != nil { + return nil, "", err + } + + packet, err := ibctesting.ParsePacketFromEvents(sendResult.GetEvents()) + if err != nil { + return nil, "", err + } + + err = suite.TransferPath.EndpointB.UpdateClient() + if err != nil { + return nil, "", err + } + + res, err := suite.TransferPath.EndpointB.RecvPacketWithResult(packet) + if err != nil { + return nil, "", err + } + ack, err := ibctesting.ParseAckFromEvents(res.GetEvents()) + if err != nil { + return nil, "", err + } + err = suite.TransferPath.EndpointA.UpdateClient() + if err != nil { + return nil, "", err + } + err = suite.TransferPath.EndpointB.UpdateClient() + if err != nil { + return nil, "", err + } + + return sendResult, string(ack), nil +} + +func (suite *MiddlewareTestSuite) FullSendAToC(msg sdk.Msg) (*abci.ExecTxResult, string, error) { + sendResult, err := suite.SendMsgsNoCheck(suite.ChainA, msg) + if err != nil { + return nil, "", err + } + + packet, err := ibctesting.ParsePacketFromEvents(sendResult.GetEvents()) + if err != nil { + return nil, "", err + } + + err = suite.TransferPathAC.EndpointB.UpdateClient() + if err != nil { + return nil, "", err + } + + res, err := suite.TransferPathAC.EndpointB.RecvPacketWithResult(packet) + if err != nil { + return nil, "", err + } + + ack, err := ibctesting.ParseAckFromEvents(res.GetEvents()) + if err != nil { + return nil, "", err + } + + err = suite.TransferPathAC.EndpointA.UpdateClient() + if err != nil { + return nil, "", err + } + err = suite.TransferPathAC.EndpointB.UpdateClient() + if err != nil { + return nil, "", err + } + + return sendResult, string(ack), nil +} + +func (suite *MiddlewareTestSuite) AssertReceive(success bool, msg sdk.Msg) (string, error) { + _, ack, err := suite.FullSendBToA(msg) + if success { + suite.Require().NoError(err) + suite.Require().NotContains(ack, "error", + "acknowledgment is an error") + } else { + suite.Require().Contains(ack, "error", + "acknowledgment is not an error") + suite.Require().Contains(ack, fmt.Sprintf("ABCI code: %d", types.ErrRateLimitExceeded.ABCICode()), + "acknowledgment error is not of the right type") + } + return ack, err +} + +func (suite *MiddlewareTestSuite) AssertSend(success bool, msg sdk.Msg) (*abci.ExecTxResult, error) { + r, _, err := suite.FullSendAToB(msg) + if success { + suite.Require().NoError(err, "IBC send failed. Expected success. %s", err) + } else { + suite.Require().Error(err, "IBC send succeeded. Expected failure") + suite.ErrorContains(err, types.ErrRateLimitExceeded.Error(), "Bad error type") + } + return r, err +} + +func (suite *MiddlewareTestSuite) BuildChannelQuota(name, channel, denom string, duration, sendPercentage, recvPercentage uint32) string { + return fmt.Sprintf(` + {"channel_id": "%s", "denom": "%s", "quotas": [{"name":"%s", "duration": %d, "send_recv":[%d, %d]}] } + `, channel, denom, name, duration, sendPercentage, recvPercentage) +} + +func (suite *MiddlewareTestSuite) BuildChannelQuotaWith2Quotas(name, channel, denom string, duration1 uint32, name2 string, sendPercentage1, recvPercentage1, duration2, sendPercentage2, recvPercentage2 uint32) string { + return fmt.Sprintf(` + {"channel_id": "%s", "denom": "%s", "quotas": [{"name":"%s", "duration": %d, "send_recv":[%d, %d]},{"name":"%s", "duration": %d, "send_recv":[%d, %d]}] } + `, channel, denom, name, duration1, sendPercentage1, recvPercentage1, name2, duration2, sendPercentage2, recvPercentage2) +} + +// Tests + +// Test that Sending IBC messages works when the middleware isn't configured +func (suite *MiddlewareTestSuite) TestSendTransferNoContract() { + suite.ConfigureTransferChannel() + one := sdkmath.NewInt(2) + _, err := suite.AssertSend(true, suite.MessageFromAToB(sdk.DefaultBondDenom, one)) + suite.Require().NoError(err) +} + +// Test that Receiving IBC messages works when the middleware isn't configured +func (suite *MiddlewareTestSuite) TestReceiveTransferNoContract() { + suite.ConfigureTransferChannel() + one := sdkmath.NewInt(2) + _, err := suite.AssertReceive(true, suite.MessageFromBToA(sdk.DefaultBondDenom, one)) + suite.Require().NoError(err) +} + +func (suite *MiddlewareTestSuite) initializeEscrow() { + app := suite.GetNeutronZoneApp(suite.ChainA) + supply := app.BankKeeper.GetSupply(suite.ChainA.GetContext(), sdk.DefaultBondDenom) + + // Move some funds from chainA to chainB so that there is something in escrow + // Each user has 10% of the supply, so we send most of the funds from one user to chainA + transferAmount := supply.Amount.QuoRaw(20) + + // When sending, the amount we're sending goes into escrow before we enter the middleware and thus + // it's used as part of the channel value in the rate limiting contract + // To account for that, we subtract the amount we'll send first (2.5% of transferAmount) here + sendAmount := transferAmount.QuoRaw(40) + + // Send from A to B + _, _, err := suite.FullSendAToB(suite.MessageFromAToB(sdk.DefaultBondDenom, transferAmount.Sub(sendAmount))) + suite.Require().NoError(err) + // Send from B to A + _, _, err = suite.FullSendBToA(suite.MessageFromBToA(sdk.DefaultBondDenom, transferAmount.Sub(sendAmount))) + suite.Require().NoError(err) +} + +func (suite *MiddlewareTestSuite) fullSendTest(native bool) map[string]string { + quotaPercentage := 5 + suite.initializeEscrow() + // Get the denom and amount to send + denom := sdk.DefaultBondDenom + if !native { + denomTrace := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", channelTest, denom)) + denom = denomTrace.IBCDenom() + } + + app := suite.GetNeutronZoneApp(suite.ChainA) + + // This is the first one. Inside the tests. It works as expected. + channelValue := CalculateChannelValue(suite.ChainA.GetContext(), denom, app.BankKeeper) + + // The amount to be sent is send 2.5% (quota is 5%) + quota := channelValue.QuoRaw(int64(100 / quotaPercentage)) + sendAmount := quota.QuoRaw(2) + + // Setup contract + testOwner := sdk.MustAccAddressFromBech32(testutil.TestOwnerAddress) + suite.StoreTestCode(suite.ChainA.GetContext(), testOwner, "./bytecode/rate_limiter.wasm") + quotas := suite.BuildChannelQuota("weekly", channelTest, denom, 604800, 5, 5) + addr := suite.InstantiateRLContract(quotas) + suite.RegisterRateLimitingContract(addr) + + // send 2.5% (quota is 5%) + _, err := suite.AssertSend(true, suite.MessageFromAToB(denom, sendAmount)) + suite.Require().NoError(err) + + // send 2.5% (quota is 5%) + r, _ := suite.AssertSend(true, suite.MessageFromAToB(denom, sendAmount)) + + // Calculate remaining allowance in the quota + attrs := suite.ExtractAttributes(suite.FindEvent(r.GetEvents(), "wasm")) + + used, ok := sdkmath.NewIntFromString(attrs["weekly_used_out"]) + suite.Require().True(ok) + + suite.Require().Equal(used, sendAmount.MulRaw(2)) + + // Sending above the quota should fail. We use 2 instead of 1 here to avoid rounding issues + _, err = suite.AssertSend(false, suite.MessageFromAToB(denom, sdkmath.NewInt(2))) + suite.Require().Error(err) + return attrs +} + +// Test rate limiting on sends +func (suite *MiddlewareTestSuite) TestSendTransferWithRateLimitingNative() { + suite.ConfigureTransferChannel() + // Sends denom=stake from A->B. Rate limit receives "stake" in the packet. Nothing to do in the contract + suite.fullSendTest(true) +} + +// Test rate limiting on sends +func (suite *MiddlewareTestSuite) TestSendTransferWithRateLimitingNonNative() { + suite.ConfigureTransferChannel() + // Sends denom=ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878 from A->B. + // Rate limit receives "transfer/channel-0/stake" in the packet (because transfer.relay.SendTransfer is called before the middleware) + // and should hash it before calculating the value + suite.fullSendTest(false) +} + +// Test rate limits are reset when the specified time period has passed +func (suite *MiddlewareTestSuite) TestSendTransferReset() { + suite.ConfigureTransferChannel() + // Same test as above, but the quotas get reset after time passes + attrs := suite.fullSendTest(true) + parts := strings.Split(attrs["weekly_period_end"], ".") // Splitting timestamp into secs and nanos + secs, err := strconv.ParseInt(parts[0], 10, 64) + suite.Require().NoError(err) + nanos, err := strconv.ParseInt(parts[1], 10, 64) + suite.Require().NoError(err) + resetTime := time.Unix(secs, nanos) + + // Move chainA forward one block + suite.ChainA.NextBlock() + + // Reset time + one second + oneSecAfterReset := resetTime.Add(time.Second) + suite.Coordinator.IncrementTimeBy(oneSecAfterReset.Sub(suite.Coordinator.CurrentTime)) + + // Sending should succeed again + _, err = suite.AssertSend(true, suite.MessageFromAToB(sdk.DefaultBondDenom, sdkmath.NewInt(2))) + suite.Require().NoError(err) +} + +// Test rate while having 2 limits (daily & weekly). +// Daily is hit, wait until 'day' ends. Do this twice. Second iteration will hit the 'weekly' quota. +// Then we check that weekly rate limit still hits even after daily quota is refreshed. +func (suite *MiddlewareTestSuite) TestSendTransferDailyReset() { + suite.ConfigureTransferChannel() + quotaPercentage := 4 + suite.initializeEscrow() + // Get the denom and amount to send + denom := sdk.DefaultBondDenom + + app := suite.GetNeutronZoneApp(suite.ChainA) + + // This is the first one. Inside the tests. It works as expected. + channelValue := CalculateChannelValue(suite.ChainA.GetContext(), denom, app.BankKeeper) + + // The amount to be sent is 2% (weekly quota is 4%, daily is 2%) + quota := channelValue.QuoRaw(int64(100 / quotaPercentage)) + sendAmount := quota.QuoRaw(2) + + // Setup contract + testOwner := sdk.MustAccAddressFromBech32(testutil.TestOwnerAddress) + suite.StoreTestCode(suite.ChainA.GetContext(), testOwner, "./bytecode/rate_limiter.wasm") + quotas := suite.BuildChannelQuotaWith2Quotas("weekly", channelTest, denom, 604800, "daily", 4, 4, 86400, 2, 2) + addr := suite.InstantiateRLContract(quotas) + suite.RegisterRateLimitingContract(addr) + + // send 2% (daily quota is 2%) + r, err := suite.AssertSend(true, suite.MessageFromAToB(denom, sendAmount)) + suite.Require().NoError(err) + + // Calculate remaining allowance in the quota + attrs := suite.ExtractAttributes(suite.FindEvent(r.GetEvents(), "wasm")) + + used, ok := sdkmath.NewIntFromString(attrs["daily_used_out"]) + suite.Require().True(ok) + + suite.Require().Equal(used, sendAmount) + + weeklyUsed, ok := sdkmath.NewIntFromString(attrs["weekly_used_out"]) + suite.Require().True(ok) + suite.Require().Equal(weeklyUsed, sendAmount) + + // Sending above the daily quota should fail. + _, err = suite.AssertSend(false, suite.MessageFromAToB(denom, sendAmount)) + suite.Require().Error(err) + // Now we 'wait' until 'day' ends + parts := strings.Split(attrs["daily_period_end"], ".") // Splitting timestamp into secs and nanos + secs, err := strconv.ParseInt(parts[0], 10, 64) + suite.Require().NoError(err) + nanos, err := strconv.ParseInt(parts[1], 10, 64) + suite.Require().NoError(err) + resetTime := time.Unix(secs, nanos) + + // Move chainA forward one block + suite.ChainA.NextBlock() + + // Reset time + one second + oneSecAfterReset := resetTime.Add(time.Second) + suite.Coordinator.IncrementTimeBy(oneSecAfterReset.Sub(suite.Coordinator.CurrentTime)) + + // Sending should succeed again. It hits daily quota for the second time & weekly quota at the same time + r, err = suite.AssertSend(true, suite.MessageFromAToB(sdk.DefaultBondDenom, sendAmount)) + suite.Require().NoError(err) + + attrs = suite.ExtractAttributes(suite.FindEvent(r.GetEvents(), "wasm")) + + used, ok = sdkmath.NewIntFromString(attrs["daily_used_out"]) + suite.Require().True(ok) + + suite.Require().Equal(used, sendAmount) + + weeklyUsed, ok = sdkmath.NewIntFromString(attrs["weekly_used_out"]) + suite.Require().True(ok) + suite.Require().Equal(weeklyUsed, sendAmount.MulRaw(2)) + + parts = strings.Split(attrs["daily_period_end"], ".") // Splitting timestamp into secs and nanos + secs, err = strconv.ParseInt(parts[0], 10, 64) + suite.Require().NoError(err) + nanos, err = strconv.ParseInt(parts[1], 10, 64) + suite.Require().NoError(err) + resetTime = time.Unix(secs, nanos) + + // Move chainA forward one block + suite.ChainA.NextBlock() + + // Reset time + one second + oneSecAfterResetDayTwo := resetTime.Add(time.Second) + // Now we're waiting for the second 'day' to expire + suite.Coordinator.IncrementTimeBy(oneSecAfterResetDayTwo.Sub(suite.Coordinator.CurrentTime)) + + // Sending should fail. Daily quota is refreshed but weekly is over + _, err = suite.AssertSend(false, suite.MessageFromAToB(sdk.DefaultBondDenom, sdkmath.NewInt(2))) + suite.Require().Error(err) +} + +// Test rate limiting on receives +func (suite *MiddlewareTestSuite) fullRecvTest(native bool) { + quotaPercentage := 4 + suite.initializeEscrow() + // Get the denom and amount to send + sendDenom := sdk.DefaultBondDenom + localDenom := sdk.DefaultBondDenom + if native { + denomTrace := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", channelTest, localDenom)) + localDenom = denomTrace.IBCDenom() + } else { + denomTrace := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", channelTest, sendDenom)) + sendDenom = denomTrace.IBCDenom() + } + + app := suite.GetNeutronZoneApp(suite.ChainA) + + channelValue := CalculateChannelValue(suite.ChainA.GetContext(), localDenom, app.BankKeeper) + + // The amount to be sent is 2% (quota is 4%) + quota := channelValue.QuoRaw(int64(100 / quotaPercentage)) + sendAmount := quota.QuoRaw(2) + + // Setup contract + suite.GetNeutronZoneApp(suite.ChainA) + testOwner := sdk.MustAccAddressFromBech32(testutil.TestOwnerAddress) + suite.StoreTestCode(suite.ChainA.GetContext(), testOwner, "./bytecode/rate_limiter.wasm") + quotas := suite.BuildChannelQuota("weekly", channelTest, localDenom, 604800, 4, 4) + addr := suite.InstantiateRLContract(quotas) + suite.RegisterRateLimitingContract(addr) + + // receive 2.5% (quota is 5%) + _, err := suite.AssertReceive(true, suite.MessageFromBToA(sendDenom, sendAmount)) + suite.Require().NoError(err) + + // receive 2.5% (quota is 5%) + _, err = suite.AssertReceive(true, suite.MessageFromBToA(sendDenom, sendAmount)) + suite.Require().NoError(err) + + // Sending above the quota should fail. We send 2 instead of 1 to account for rounding errors + _, err = suite.AssertReceive(false, suite.MessageFromBToA(sendDenom, sdkmath.NewInt(20000))) + suite.Require().NoError(err) +} + +func (suite *MiddlewareTestSuite) TestRecvTransferWithRateLimitingNative() { + suite.ConfigureTransferChannel() + // Sends denom=stake from B->A. + // Rate limit receives "stake" in the packet and should wrap it before calculating the value + // types.ReceiverChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), data.Denom) should return false => Wrap the token + suite.fullRecvTest(true) +} + +func (suite *MiddlewareTestSuite) TestRecvTransferWithRateLimitingNonNative() { + suite.ConfigureTransferChannel() + // Sends denom=ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878 from B->A. + // Rate limit receives "transfer/channel-0/stake" in the packet and should turn it into "stake" + // types.ReceiverChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), data.Denom) should return true => unprefix. If unprefixed is not local, hash. + suite.fullRecvTest(false) +} + +// Test no rate limiting occurs when the contract is set, but no quotas are configured for the path +func (suite *MiddlewareTestSuite) TestSendTransferNoQuota() { + suite.ConfigureTransferChannel() + // Setup contract + testOwner := sdk.MustAccAddressFromBech32(testutil.TestOwnerAddress) + suite.StoreTestCode(suite.ChainA.GetContext(), testOwner, "./bytecode/rate_limiter.wasm") + addr := suite.InstantiateRLContract(``) + suite.RegisterRateLimitingContract(addr) + + // send 1 token. + // If the contract doesn't have a quota for the current channel, all transfers are allowed + _, err := suite.AssertSend(true, suite.MessageFromAToB(sdk.DefaultBondDenom, sdkmath.NewInt(1))) + suite.Require().NoError(err) +} + +// Test rate limits are reverted if a "send" fails +func (suite *MiddlewareTestSuite) TestFailedSendTransfer() { + suite.ConfigureTransferChannel() + suite.initializeEscrow() + // Setup contract + testOwner := sdk.MustAccAddressFromBech32(testutil.TestOwnerAddress) + suite.StoreTestCode(suite.ChainA.GetContext(), testOwner, "./bytecode/rate_limiter.wasm") + quotas := suite.BuildChannelQuota("weekly", channelTest, sdk.DefaultBondDenom, 604800, 1, 1) + addr := suite.InstantiateRLContract(quotas) + suite.RegisterRateLimitingContract(addr) + + // Get the escrowed amount + app := suite.GetNeutronZoneApp(suite.ChainA) + // ToDo: This is what we eventually want here, but using the full supply temporarily for performance reasons. See CalculateChannelValue + // escrowAddress := transfertypes.GetEscrowAddress("transfer", "channel-0") + // escrowed := app.BankKeeper.GetBalance(suite.chainA.GetContext(), escrowAddress, sdk.DefaultBondDenom) + escrowed := app.BankKeeper.GetSupply(suite.ChainA.GetContext(), sdk.DefaultBondDenom) + quota := escrowed.Amount.QuoRaw(100) // 1% of the escrowed amount + + // Use the whole quota + coins := sdk.NewCoin(sdk.DefaultBondDenom, quota) + port := suite.TransferPath.EndpointA.ChannelConfig.PortID + channel := suite.TransferPath.EndpointA.ChannelID + accountFrom := suite.ChainA.SenderAccount.GetAddress().String() + timeoutHeight := clienttypes.NewHeight(10, 100) + msg := transfertypes.NewMsgTransfer(port, channel, coins, accountFrom, "INVALID", timeoutHeight, 0, "") + + // Sending the message manually because AssertSend updates both clients. We need to update the clients manually + // for this test so that the failure to receive on chain B happens after the second packet is sent from chain A. + // That way we validate that chain A is blocking as expected, but the flow is reverted after the receive failure is + // acknowledged on chain A + res, err := suite.SendMsgsNoCheck(suite.ChainA, msg) + suite.Require().NoError(err) + + // Sending again fails as the quota is filled + _, err = suite.AssertSend(false, suite.MessageFromAToB(sdk.DefaultBondDenom, quota)) + suite.Require().Error(err) + + // Move forward one block + suite.ChainA.NextBlock() + suite.ChainA.Coordinator.IncrementTime() + + // Update both clients + err = suite.TransferPath.EndpointA.UpdateClient() + suite.Require().NoError(err) + err = suite.TransferPath.EndpointB.UpdateClient() + suite.Require().NoError(err) + + // Execute the acknowledgement from chain B in chain A + + // extract the sent packet + packet, err := ibctesting.ParsePacketFromEvents(res.GetEvents()) + suite.Require().NoError(err) + + // recv in chain b + newRes, err := suite.TransferPath.EndpointB.RecvPacketWithResult(packet) + suite.Require().NoError(err) + + // get the ack from the chain b's response + ack, err := ibctesting.ParseAckFromEvents(newRes.GetEvents()) + suite.Require().NoError(err) + + // manually relay it to chain a + err = suite.TransferPath.EndpointA.AcknowledgePacket(packet, ack) + suite.Require().NoError(err) + + // We should be able to send again because the packet that exceeded the quota failed and has been reverted + _, err = suite.AssertSend(true, suite.MessageFromAToB(sdk.DefaultBondDenom, sdkmath.NewInt(2))) + suite.Require().NoError(err) +} + +func (suite *MiddlewareTestSuite) TestUnsetRateLimitingContract() { + // Setup contract + suite.ConfigureTransferChannel() + testOwner := sdk.MustAccAddressFromBech32(testutil.TestOwnerAddress) + suite.StoreTestCode(suite.ChainA.GetContext(), testOwner, "./bytecode/rate_limiter.wasm") + addr := suite.InstantiateRLContract("") + suite.RegisterRateLimitingContract(addr) + + app := suite.GetNeutronZoneApp(suite.ChainA) + + // Unset the contract param + err := app.RateLimitingICS4Wrapper.IbcratelimitKeeper.SetParams(suite.ChainA.GetContext(), types.Params{ContractAddress: ""}) + suite.Require().NoError(err) + // N.B.: this panics if validation fails. +} + +// Test rate limits are reverted if a "send" fails +func (suite *MiddlewareTestSuite) TestNonICS20() { + suite.ConfigureTransferChannel() + suite.initializeEscrow() + // Setup contract + app := suite.GetNeutronZoneApp(suite.ChainA) + testOwner := sdk.MustAccAddressFromBech32(testutil.TestOwnerAddress) + suite.StoreTestCode(suite.ChainA.GetContext(), testOwner, "./bytecode/rate_limiter.wasm") + quotas := suite.BuildChannelQuota("weekly", "channel-0", sdk.DefaultBondDenom, 604800, 1, 1) + addr := suite.InstantiateRLContract(quotas) + suite.RegisterRateLimitingContract(addr) + + data := []byte("{}") + _, err := app.RateLimitingICS4Wrapper.SendPacket(suite.ChainA.GetContext(), capabilitytypes.NewCapability(1), "wasm.neutron1873ls0d60tg7hk00976teq9ywhzv45u3hk2urw8t3eau9eusa4eqtun9xn", "channel-0", clienttypes.NewHeight(0, 0), 1, data) + + suite.Require().Error(err) + // This will error out, but not because of rate limiting + suite.Require().NotContains(err.Error(), "rate limit") + suite.Require().Contains(err.Error(), "channel not found") +} + +func (suite *MiddlewareTestSuite) TestDenomRestrictionFlow() { + suite.ConfigureTransferChannel() + suite.ConfigureTransferChannelAC() + // Setup contract + testOwner := sdk.MustAccAddressFromBech32(testutil.TestOwnerAddress) + suite.StoreTestCode(suite.ChainA.GetContext(), testOwner, "./bytecode/rate_limiter.wasm") + quotas := suite.BuildChannelQuota("weekly", "channel-0", sdk.DefaultBondDenom, 604800, 1, 1) + contractAddr := suite.InstantiateRLContract(quotas) + suite.RegisterRateLimitingContract(contractAddr) + + denom := sdk.DefaultBondDenom + sendAmount := sdkmath.NewInt(2) + acceptedChannel := suite.TransferPath.EndpointA.ChannelID + + // Sending on a diff channel should work + _, _, err := suite.FullSendAToC(suite.MessageFromAToC(denom, sendAmount)) + suite.Require().NoError(err, "Send on alternative channel should work") + + // Successfully send a denom before any restrictions are added. + _, err = suite.AssertSend(true, suite.MessageFromAToB(denom, sendAmount)) + suite.Require().NoError(err, "Send should succeed without restrictions") + + // Add a restriction that only allows sending on the accepted channel + restrictionMsg := fmt.Sprintf(`{"set_denom_restrictions": {"denom":"%s","allowed_channels":["%s"]}}`, denom, acceptedChannel) + _, err = suite.ExecuteContract(contractAddr, testOwner, []byte(restrictionMsg), sdk.Coins{}) + suite.Require().NoError(err) + + // Sending on the accepted channel should succeed + _, err = suite.AssertSend(true, suite.MessageFromAToB(denom, sendAmount)) + suite.Require().NoError(err, "Send on accepted channel should succeed") + + // Sending on any other channel should fail + _, err = suite.AssertSend(false, suite.MessageFromAToC(denom, sendAmount)) + suite.Require().Error(err, "Send on blocked channel should fail") + + // Unset the restriction and verify that sending on other channels works again + unsetMsg := fmt.Sprintf(`{"unset_denom_restrictions": {"denom":"%s"}}`, denom) + _, err = suite.ExecuteContract(contractAddr, testOwner, []byte(unsetMsg), sdk.Coins{}) + suite.Require().NoError(err, "Unsetting denom restriction should succeed") + + // Sending again on the previously blocked channel should now succeed + _, _, err = suite.FullSendAToC(suite.MessageFromAToC(denom, sendAmount)) + suite.Require().NoError(err, "Send on previously blocked channel should succeed after unsetting restriction") +} + +func (suite *MiddlewareTestSuite) InstantiateRLContract(quotas string) sdk.AccAddress { + app := suite.GetNeutronZoneApp(suite.ChainA) + transferModule := app.AccountKeeper.GetModuleAddress(transfertypes.ModuleName) + initMsgBz := []byte(fmt.Sprintf(`{ + "gov_module": "%s", + "ibc_module":"%s", + "paths": [%s] + }`, + testutil.TestOwnerAddress, transferModule, quotas)) + + contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper) + codeID := uint64(1) + creator := suite.ChainA.SenderAccount.GetAddress() + addr, _, err := contractKeeper.Instantiate(suite.ChainA.GetContext(), codeID, creator, creator, initMsgBz, "rate limiting contract", nil) + suite.Require().NoError(err) + return addr +} + +func (suite *MiddlewareTestSuite) InstantiateRLContract2Quotas(quotas1 string) sdk.AccAddress { + app := suite.GetNeutronZoneApp(suite.ChainA) + transferModule := app.AccountKeeper.GetModuleAddress(transfertypes.ModuleName) + initMsgBz := []byte(fmt.Sprintf(`{ + "gov_module": "%s", + "ibc_module":"%s", + "paths": [%s] + }`, + testutil.TestOwnerAddress, transferModule, quotas1)) + contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper) + codeID := uint64(1) + creator := suite.ChainA.SenderAccount.GetAddress() + addr, _, err := contractKeeper.Instantiate(suite.ChainA.GetContext(), codeID, creator, creator, initMsgBz, "rate limiting contract", nil) + suite.Require().NoError(err) + return addr +} + +func (suite *MiddlewareTestSuite) RegisterRateLimitingContract(addr []byte) { + addrStr, _ := sdk.Bech32ifyAddressBytes("neutron", addr) + app := suite.GetNeutronZoneApp(suite.ChainA) + _ = app.RateLimitingICS4Wrapper.SetParams(suite.ChainA.GetContext(), types.Params{ContractAddress: addrStr}) + require.True(suite.ChainA.TB, true) +} + +// AssertEventEmitted asserts that ctx's event manager has emitted the given number of events +// of the given type. +func (suite *MiddlewareTestSuite) 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) + } + } + suite.Require().Equal(numEventsExpected, len(actualEvents)) +} + +func (suite *MiddlewareTestSuite) FindEvent(events []abci.Event, name string) abci.Event { + index := slices.IndexFunc(events, func(e abci.Event) bool { return e.Type == name }) + if index == -1 { + return abci.Event{} + } + return events[index] +} + +func (suite *MiddlewareTestSuite) ExtractAttributes(event abci.Event) map[string]string { + attrs := make(map[string]string) + if event.Attributes == nil { + return attrs + } + for _, a := range event.Attributes { + attrs[a.Key] = a.Value + } + return attrs +} diff --git a/x/ibc-rate-limit/ibc_module.go b/x/ibc-rate-limit/ibc_module.go new file mode 100644 index 000000000..38b4349ca --- /dev/null +++ b/x/ibc-rate-limit/ibc_module.go @@ -0,0 +1,252 @@ +package ibcratelimit + +import ( + "encoding/json" + "strings" + + "github.com/neutron-org/neutron/v5/x/ibc-hooks/utils" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +type IBCModule struct { + app porttypes.IBCModule + ics4Middleware *ICS4Wrapper +} + +func NewIBCModule(app porttypes.IBCModule, ics4 *ICS4Wrapper) IBCModule { + return IBCModule{ + app: app, + ics4Middleware: ics4, + } +} + +// OnChanOpenInit implements the IBCModule interface +func (im *IBCModule) OnChanOpenInit(ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID string, + channelID string, + channelCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + version string, +) (string, error) { + return im.app.OnChanOpenInit( + ctx, + order, + connectionHops, + portID, + channelID, + channelCap, + counterparty, + version, + ) +} + +// OnChanOpenTry implements the IBCModule interface +func (im *IBCModule) OnChanOpenTry( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID, + channelID string, + channelCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + counterpartyVersion string, +) (string, error) { + return im.app.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) +} + +// OnChanOpenAck implements the IBCModule interface +func (im *IBCModule) OnChanOpenAck( + ctx sdk.Context, + portID, + channelID string, + counterpartyChannelID string, + counterpartyVersion string, +) error { + // Here we can add initial limits when a new channel is open. For now, they can be added manually on the contract + return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) +} + +// OnChanOpenConfirm implements the IBCModule interface +func (im *IBCModule) OnChanOpenConfirm( + ctx sdk.Context, + portID, + channelID string, +) error { + // Here we can add initial limits when a new channel is open. For now, they can be added manually on the contract + return im.app.OnChanOpenConfirm(ctx, portID, channelID) +} + +// OnChanCloseInit implements the IBCModule interface +func (im *IBCModule) OnChanCloseInit( + ctx sdk.Context, + portID, + channelID string, +) error { + // Here we can remove the limits when a new channel is closed. For now, they can remove them manually on the contract + return im.app.OnChanCloseInit(ctx, portID, channelID) +} + +// OnChanCloseConfirm implements the IBCModule interface +func (im *IBCModule) OnChanCloseConfirm( + ctx sdk.Context, + portID, + channelID string, +) error { + // Here we can remove the limits when a new channel is closed. For now, they can remove them manually on the contract + return im.app.OnChanCloseConfirm(ctx, portID, channelID) +} + +type receiverParser struct { + Receiver string `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"` +} + +func ValidateReceiverAddress(packet exported.PacketI) error { + var receiverObj receiverParser + + if err := json.Unmarshal(packet.GetData(), &receiverObj); err != nil { + return err + } + if len(receiverObj.Receiver) >= types.MaxSupportedIBCReceiverAddressLength { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "IBC Receiver address too long. Max supported length is %d", types.MaxSupportedIBCReceiverAddressLength) + } + return nil +} + +// OnRecvPacket implements the IBCModule interface +func (im *IBCModule) OnRecvPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) exported.Acknowledgement { + if err := ValidateReceiverAddress(packet); err != nil { + return utils.NewEmitErrorAcknowledgement(ctx, types.ErrBadMessage, err.Error()) + } + + contract := im.ics4Middleware.GetContractAddress(ctx) + if contract == "" { + // The contract has not been configured. Continue as usual + return im.app.OnRecvPacket(ctx, packet, relayer) + } + + err := CheckAndUpdateRateLimits(ctx, im.ics4Middleware.ContractKeeper, msgRecv, contract, packet) + if err != nil { + if strings.Contains(err.Error(), types.RateLimitExceededSubStr) { + return utils.NewEmitErrorAcknowledgement(ctx, types.ErrRateLimitExceeded) + } + fullError := errorsmod.Wrap(types.ErrContractError, err.Error()) + return utils.NewEmitErrorAcknowledgement(ctx, fullError) + } + + // if this returns an Acknowledgement that isn't successful, all state changes are discarded + return im.app.OnRecvPacket(ctx, packet, relayer) +} + +// OnAcknowledgementPacket implements the IBCModule interface +func (im *IBCModule) OnAcknowledgementPacket( + ctx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, +) error { + // Osmosis have some osmo-specific code here, but it disrupts proper work of neutron chain. + // See: https://github.com/osmosis-labs/osmosis/pull/8308 & https://github.com/osmosis-labs/osmosis/pull/8420 + var ack channeltypes.Acknowledgement + if err := json.Unmarshal(acknowledgement, &ack); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-20 transfer packet acknowledgement: %v", err) + } + + if utils.IsAckError(acknowledgement) { + err := im.RevertSentPacket(ctx, packet) // If there is an error here we should still handle the ack + if err != nil { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventBadRevert, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(types.AttributeKeyFailureType, "acknowledgment"), + sdk.NewAttribute(types.AttributeKeyPacket, string(packet.GetData())), + sdk.NewAttribute(types.AttributeKeyAck, string(acknowledgement)), + ), + ) + } + } + + return im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) +} + +// OnTimeoutPacket implements the IBCModule interface +func (im *IBCModule) OnTimeoutPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) error { + err := im.RevertSentPacket(ctx, packet) // If there is an error here we should still handle the timeout + if err != nil { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventBadRevert, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(types.AttributeKeyFailureType, "timeout"), + sdk.NewAttribute(types.AttributeKeyPacket, string(packet.GetData())), + ), + ) + } + return im.app.OnTimeoutPacket(ctx, packet, relayer) +} + +// RevertSentPacket Notifies the contract that a sent packet wasn't properly received +func (im *IBCModule) RevertSentPacket( + ctx sdk.Context, + packet exported.PacketI, +) error { + contract := im.ics4Middleware.GetContractAddress(ctx) + if contract == "" { + // The contract has not been configured. Continue as usual + return nil + } + + return UndoSendRateLimit( + ctx, + im.ics4Middleware.ContractKeeper, + contract, + packet, + ) +} + +// SendPacket implements the ICS4 Wrapper interface +func (im *IBCModule) SendPacket( + ctx sdk.Context, + chanCap *capabilitytypes.Capability, + sourcePort, sourceChannel string, + timeoutHeight clienttypes.Height, + timeoutTimestamp uint64, + data []byte, +) (uint64, error) { + return im.ics4Middleware.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) +} + +// WriteAcknowledgement implements the ICS4 Wrapper interface +func (im *IBCModule) WriteAcknowledgement( + ctx sdk.Context, + chanCap *capabilitytypes.Capability, + packet exported.PacketI, + ack exported.Acknowledgement, +) error { + return im.ics4Middleware.WriteAcknowledgement(ctx, chanCap, packet, ack) +} + +func (im *IBCModule) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + return im.ics4Middleware.GetAppVersion(ctx, portID, channelID) +} diff --git a/x/ibc-rate-limit/ics4_wrapper.go b/x/ibc-rate-limit/ics4_wrapper.go new file mode 100644 index 000000000..41301ab86 --- /dev/null +++ b/x/ibc-rate-limit/ics4_wrapper.go @@ -0,0 +1,108 @@ +package ibcratelimit + +import ( + "encoding/json" + + errorsmod "cosmossdk.io/errors" + + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/keeper" + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +var ( + _ porttypes.Middleware = &IBCModule{} + _ porttypes.ICS4Wrapper = &ICS4Wrapper{} +) + +type ICS4Wrapper struct { + channel porttypes.ICS4Wrapper + accountKeeper *authkeeper.AccountKeeper + bankKeeper *bankkeeper.BaseKeeper + ContractKeeper *wasmkeeper.PermissionedKeeper + IbcratelimitKeeper *keeper.Keeper +} + +func (i *ICS4Wrapper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + return i.channel.GetAppVersion(ctx, portID, channelID) +} + +func NewICS4Middleware( + channel porttypes.ICS4Wrapper, + accountKeeper *authkeeper.AccountKeeper, contractKeeper *wasmkeeper.PermissionedKeeper, + bankKeeper *bankkeeper.BaseKeeper, ibcratelimitkeeper *keeper.Keeper, +) ICS4Wrapper { + return ICS4Wrapper{ + channel: channel, + accountKeeper: accountKeeper, + ContractKeeper: contractKeeper, + bankKeeper: bankKeeper, + IbcratelimitKeeper: ibcratelimitkeeper, + } +} + +// SendPacket implements the ICS4 interface and is called when sending packets. +// This method retrieves the contract from the middleware's parameters and checks if the limits have been exceeded for +// the current transfer, in which case it returns an error preventing the IBC send from taking place. +// If the contract param is not configured, or the contract doesn't have a configuration for the (channel+denom) being +// used, transfers are not prevented and handled by the wrapped IBC app +func (i *ICS4Wrapper) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte) (uint64, error) { + var packetdata transfertypes.FungibleTokenPacketData + if err := json.Unmarshal(data, &packetdata); err != nil { + return i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) + } + if packetdata.Denom == "" || packetdata.Amount == "" { + return i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) + } + contract := i.GetContractAddress(ctx) + if contract == "" { + // The contract has not been configured. Continue as usual + return i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) + } + + // setting 0 as a default so it can be properly parsed by cosmwasm + fullPacket := channeltypes.Packet{ + Sequence: 0, + SourcePort: sourcePort, + SourceChannel: sourceChannel, + DestinationPort: "omitted", + DestinationChannel: "omitted", + Data: data, + TimeoutTimestamp: timeoutTimestamp, + TimeoutHeight: timeoutHeight, + } + + err := CheckAndUpdateRateLimits(ctx, i.ContractKeeper, msgSend, contract, fullPacket) + if err != nil { + return 0, errorsmod.Wrap(err, "rate limit SendPacket failed to authorize transfer") + } + + return i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) +} + +func (i *ICS4Wrapper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement) error { + return i.channel.WriteAcknowledgement(ctx, chanCap, packet, ack) +} + +func (i *ICS4Wrapper) GetContractAddress(ctx sdk.Context) (contract string) { + return i.GetParams(ctx).ContractAddress +} + +func (i *ICS4Wrapper) GetParams(ctx sdk.Context) (params types.Params) { + params = i.IbcratelimitKeeper.GetParams(ctx) + return params +} + +func (i *ICS4Wrapper) SetParams(ctx sdk.Context, params types.Params) error { + return i.IbcratelimitKeeper.SetParams(ctx, params) +} diff --git a/x/ibc-rate-limit/keeper/grpc_query_params.go b/x/ibc-rate-limit/keeper/grpc_query_params.go new file mode 100644 index 000000000..99a9571cb --- /dev/null +++ b/x/ibc-rate-limit/keeper/grpc_query_params.go @@ -0,0 +1,20 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/ibc-rate-limit/keeper/keeper.go b/x/ibc-rate-limit/keeper/keeper.go new file mode 100644 index 000000000..a726c3ef1 --- /dev/null +++ b/x/ibc-rate-limit/keeper/keeper.go @@ -0,0 +1,60 @@ +package keeper + +import ( + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +// Keeper of the globalfee store +type Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + + // the address capable of executing a MsgUpdateParams message. Typically, this + // should be the x/adminmodule module account. + authority string +} + +func NewKeeper( + cdc codec.BinaryCodec, + key storetypes.StoreKey, + authority string, +) Keeper { + return Keeper{ + cdc: cdc, + storeKey: key, + authority: authority, + } +} + +// GetAuthority returns the x/ibcratelimit module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +// GetParams returns the total set params. +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } + + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams sets the total set of params. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { + store := ctx.KVStore(k.storeKey) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + + store.Set(types.ParamsKey, bz) + return nil +} diff --git a/x/ibc-rate-limit/keeper/msg_server.go b/x/ibc-rate-limit/keeper/msg_server.go new file mode 100644 index 000000000..1f7e864bc --- /dev/null +++ b/x/ibc-rate-limit/keeper/msg_server.go @@ -0,0 +1,41 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +// UpdateParams updates the module parameters +func (k Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if err := req.Validate(); err != nil { + return nil, errors.Wrap(err, "failed to validate MsgUpdateParams") + } + authority := k.GetAuthority() + if authority != req.Authority { + return nil, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid authority; expected %s, got %s", authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := k.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/ibc-rate-limit/module.go b/x/ibc-rate-limit/module.go new file mode 100644 index 000000000..c5af0cff3 --- /dev/null +++ b/x/ibc-rate-limit/module.go @@ -0,0 +1,146 @@ +package ibcratelimit + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/keeper" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + + "cosmossdk.io/core/appmodule" + + ibcratelimitcli "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/client/cli" + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +var ( + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasGenesisBasics = AppModuleBasic{} + + _ appmodule.AppModule = AppModule{} + _ module.HasConsensusVersion = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} +) + +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +func (AppModuleBasic) Name() string { return types.ModuleName } + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the ibcratelimit module. +func (b 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) + } + return genState.Validate() +} + +// --------------------------------------- +// Interfaces. +func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) //nolint:errcheck +} + +func (b AppModuleBasic) GetTxCmd() *cobra.Command { + return nil +} + +func (b AppModuleBasic) GetQueryCmd() *cobra.Command { + return ibcratelimitcli.GetQueryCmd() +} + +// RegisterInterfaces registers interfaces and implementations of the ibc-rate-limit module. +func (AppModuleBasic) RegisterInterfaces(reg codectypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + ics4wrapper *ICS4Wrapper + keeper *keeper.Keeper +} + +func NewAppModule( + cdc codec.Codec, + keeper *keeper.Keeper, + ics4wrapper *ICS4Wrapper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + ics4wrapper: ics4wrapper, + } +} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType is a marker function just indicates that this is a one-per-module type. +func (am AppModule) IsOnePerModuleType() {} + +// Name returns the txfees module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// QuerierRoute returns the ibc-rate-limit module's query routing key. +func (AppModule) QuerierRoute() string { return types.RouterKey } + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(*am.keeper)) +} + +// RegisterInvariants registers the txfees module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the txfees module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + am.ics4wrapper.InitGenesis(ctx, genState) +} + +// ExportGenesis returns the txfees module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := am.ics4wrapper.ExportGenesis(ctx) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 1 } diff --git a/x/ibc-rate-limit/module_simulation.go b/x/ibc-rate-limit/module_simulation.go new file mode 100644 index 000000000..081c8b40a --- /dev/null +++ b/x/ibc-rate-limit/module_simulation.go @@ -0,0 +1,49 @@ +package ibcratelimit + +import ( + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/neutron-org/neutron/v5/testutil/common/sample" + ibcratelimitsimulation "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/simulation" + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +// avoid unused import issue +var ( + _ = sample.AccAddress + _ = ibcratelimitsimulation.FindAccount + _ = sims.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +// GenerateGenesisState creates a randomized GenState of the module +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + interchainqueriesGenesis := types.GenesisState{ + Params: types.DefaultParams(), + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&interchainqueriesGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { + return nil +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + return operations +} diff --git a/x/ibc-rate-limit/rate_limit.go b/x/ibc-rate-limit/rate_limit.go new file mode 100644 index 000000000..eb8d01f49 --- /dev/null +++ b/x/ibc-rate-limit/rate_limit.go @@ -0,0 +1,153 @@ +package ibcratelimit + +import ( + "encoding/json" + + errorsmod "cosmossdk.io/errors" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" + + "github.com/neutron-org/neutron/v5/x/ibc-rate-limit/types" +) + +var ( + msgSend = "send_packet" + msgRecv = "recv_packet" +) + +func CheckAndUpdateRateLimits(ctx sdk.Context, contractKeeper *wasmkeeper.PermissionedKeeper, + msgType, contract string, packet exported.PacketI, +) error { + contractAddr, err := sdk.AccAddressFromBech32(contract) + if err != nil { + return err + } + + sendPacketMsg, err := BuildWasmExecMsg( + msgType, + packet, + ) + if err != nil { + return errorsmod.Wrap(err, "failed to CheckAndUpdateRateLimits") + } + + _, err = contractKeeper.Sudo(ctx, contractAddr, sendPacketMsg) + if err != nil { + return errorsmod.Wrap(types.ErrRateLimitExceeded, err.Error()) + } + + return nil +} + +type UndoSendMsg struct { + UndoSend UndoPacketMsg `json:"undo_send"` +} + +type UndoPacketMsg struct { + Packet UnwrappedPacket `json:"packet"` +} + +func UndoSendRateLimit(ctx sdk.Context, contractKeeper *wasmkeeper.PermissionedKeeper, + contract string, + packet exported.PacketI, +) error { + contractAddr, err := sdk.AccAddressFromBech32(contract) + if err != nil { + return errorsmod.Wrap(err, "failed to UndoSendRateLimit") + } + + unwrapped, err := unwrapPacket(packet) + if err != nil { + return errorsmod.Wrap(err, "failed to UndoSendRateLimit") + } + + msg := UndoSendMsg{UndoSend: UndoPacketMsg{Packet: unwrapped}} + asJSON, err := json.Marshal(msg) + if err != nil { + return errorsmod.Wrap(err, "failed to UndoSendRateLimit") + } + + _, err = contractKeeper.Sudo(ctx, contractAddr, asJSON) + if err != nil { + return errorsmod.Wrap(types.ErrContractError, err.Error()) + } + + return nil +} + +type SendPacketMsg struct { + SendPacket PacketMsg `json:"send_packet"` +} + +type RecvPacketMsg struct { + RecvPacket PacketMsg `json:"recv_packet"` +} + +type PacketMsg struct { + Packet UnwrappedPacket `json:"packet"` +} + +type UnwrappedPacket struct { + Sequence uint64 `json:"sequence"` + SourcePort string `json:"source_port"` + SourceChannel string `json:"source_channel"` + DestinationPort string `json:"destination_port"` + DestinationChannel string `json:"destination_channel"` + Data transfertypes.FungibleTokenPacketData `json:"data"` + TimeoutHeight clienttypes.Height `json:"timeout_height"` + TimeoutTimestamp uint64 `json:"timeout_timestamp,omitempty"` +} + +func unwrapPacket(packet exported.PacketI) (UnwrappedPacket, error) { + var packetData transfertypes.FungibleTokenPacketData + err := json.Unmarshal(packet.GetData(), &packetData) + if err != nil { + return UnwrappedPacket{}, err + } + height, ok := packet.GetTimeoutHeight().(clienttypes.Height) + if !ok { + return UnwrappedPacket{}, types.ErrBadMessage + } + return UnwrappedPacket{ + Sequence: packet.GetSequence(), + SourcePort: packet.GetSourcePort(), + SourceChannel: packet.GetSourceChannel(), + DestinationPort: packet.GetDestPort(), + DestinationChannel: packet.GetDestChannel(), + Data: packetData, + TimeoutHeight: height, + TimeoutTimestamp: packet.GetTimeoutTimestamp(), + }, nil +} + +func BuildWasmExecMsg(msgType string, packet exported.PacketI) ([]byte, error) { + unwrapped, err := unwrapPacket(packet) + if err != nil { + return []byte{}, err + } + + var asJSON []byte + switch { + case msgType == msgSend: + msg := SendPacketMsg{SendPacket: PacketMsg{ + Packet: unwrapped, + }} + asJSON, err = json.Marshal(msg) + case msgType == msgRecv: + msg := RecvPacketMsg{RecvPacket: PacketMsg{ + Packet: unwrapped, + }} + asJSON, err = json.Marshal(msg) + default: + return []byte{}, types.ErrBadMessage + } + + if err != nil { + return []byte{}, errorsmod.Wrap(err, "failed to BuildWasmExecMsg") + } + + return asJSON, nil +} diff --git a/x/ibc-rate-limit/simulation/simap.go b/x/ibc-rate-limit/simulation/simap.go new file mode 100644 index 000000000..92c437c0d --- /dev/null +++ b/x/ibc-rate-limit/simulation/simap.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/ibc-rate-limit/types/codec.go b/x/ibc-rate-limit/types/codec.go new file mode 100644 index 000000000..e1725d89d --- /dev/null +++ b/x/ibc-rate-limit/types/codec.go @@ -0,0 +1,25 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateParams{}, "neutron/ibc-rate-limit/update-params", nil) +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + Amino = codec.NewLegacyAmino() + ModuleCdc *codec.ProtoCodec +) diff --git a/x/ibc-rate-limit/types/constants.go b/x/ibc-rate-limit/types/constants.go new file mode 100644 index 000000000..4d4fce0bd --- /dev/null +++ b/x/ibc-rate-limit/types/constants.go @@ -0,0 +1,6 @@ +package types + +const ( + MaxSupportedIBCReceiverAddressLength = 4096 + RateLimitExceededSubStr = "rate limit exceeded" +) diff --git a/x/ibc-rate-limit/types/errors.go b/x/ibc-rate-limit/types/errors.go new file mode 100644 index 000000000..42116a7e1 --- /dev/null +++ b/x/ibc-rate-limit/types/errors.go @@ -0,0 +1,11 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" +) + +var ( + ErrRateLimitExceeded = errorsmod.Register(ModuleName, 2, "rate limit exceeded") + ErrBadMessage = errorsmod.Register(ModuleName, 3, "bad message") + ErrContractError = errorsmod.Register(ModuleName, 4, "contract error") +) diff --git a/x/ibc-rate-limit/types/events.go b/x/ibc-rate-limit/types/events.go new file mode 100644 index 000000000..36d31181e --- /dev/null +++ b/x/ibc-rate-limit/types/events.go @@ -0,0 +1,8 @@ +package types + +const ( + EventBadRevert = "bad_revert" + AttributeKeyPacket = "packet" + AttributeKeyAck = "acknowledgement" + AttributeKeyFailureType = "failure_type" +) diff --git a/x/ibc-rate-limit/types/genesis.go b/x/ibc-rate-limit/types/genesis.go new file mode 100644 index 000000000..9167936c6 --- /dev/null +++ b/x/ibc-rate-limit/types/genesis.go @@ -0,0 +1,17 @@ +package types + +// DefaultGenesis creates a default GenesisState object. +func DefaultGenesis() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + if err := gs.Params.Validate(); err != nil { + return err + } + return nil +} diff --git a/x/ibc-rate-limit/types/genesis.pb.go b/x/ibc-rate-limit/types/genesis.pb.go new file mode 100644 index 000000000..735122fb7 --- /dev/null +++ b/x/ibc-rate-limit/types/genesis.pb.go @@ -0,0 +1,329 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: neutron/ibcratelimit/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the ibc-rate-limit module's genesis state. +type GenesisState struct { + // params are all the parameters of the module + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_4a6a285b43c9c3fe, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "neutron.ibcratelimit.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("neutron/ibcratelimit/v1beta1/genesis.proto", fileDescriptor_4a6a285b43c9c3fe) +} + +var fileDescriptor_4a6a285b43c9c3fe = []byte{ + // 250 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xca, 0x4b, 0x2d, 0x2d, + 0x29, 0xca, 0xcf, 0xd3, 0xcf, 0x4c, 0x4a, 0x2e, 0x4a, 0x2c, 0x49, 0xcd, 0xc9, 0xcc, 0xcd, 0x2c, + 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x81, 0xaa, 0xd5, 0x43, 0x56, 0xab, 0x07, 0x55, + 0x2b, 0x25, 0x99, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0x1c, 0x0f, 0x56, 0xab, 0x0f, 0xe1, 0x40, 0x34, + 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x43, 0xc4, 0x41, 0x2c, 0xa8, 0xa8, 0x64, 0x7a, 0x7e, 0x7e, + 0x7a, 0x4e, 0xaa, 0x3e, 0x98, 0x97, 0x54, 0x9a, 0xa6, 0x9f, 0x98, 0x57, 0x09, 0x95, 0xd2, 0xc4, + 0xeb, 0xaa, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0xd9, 0x4a, 0x41, 0x5c, 0x3c, 0xee, 0x10, 0x57, + 0x06, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x39, 0x71, 0xb1, 0x41, 0xe4, 0x25, 0x18, 0x15, 0x18, 0x35, + 0xb8, 0x8d, 0x54, 0xf4, 0xf0, 0xb9, 0x5a, 0x2f, 0x00, 0xac, 0xd6, 0x89, 0xe5, 0xc4, 0x3d, 0x79, + 0x86, 0x20, 0xa8, 0x4e, 0xa7, 0xa0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, + 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, + 0xb2, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0x9a, 0xab, 0x9b, + 0x5f, 0x94, 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xea, 0x57, 0x80, 0x1c, 0xad, 0x0b, 0xb2, 0x49, 0x17, + 0xe2, 0xec, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x73, 0x8d, 0x01, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xc8, 0xd2, 0x7b, 0x68, 0x71, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) 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 = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + 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 := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc-rate-limit/types/keys.go b/x/ibc-rate-limit/types/keys.go new file mode 100644 index 000000000..1ce3db024 --- /dev/null +++ b/x/ibc-rate-limit/types/keys.go @@ -0,0 +1,18 @@ +package types + +import "strings" + +const ( + prefixParamsKey = iota + 1 +) + +const ( + ModuleName = "rate-limited-ibc" // IBC at the end to avoid conflicts with the ibc prefix + +) + +var ParamsKey = []byte{prefixParamsKey} + +// RouterKey is the message route. Can only contain +// alphanumeric characters. +var RouterKey = strings.ReplaceAll(ModuleName, "-", "") diff --git a/x/ibc-rate-limit/types/params.go b/x/ibc-rate-limit/types/params.go new file mode 100644 index 000000000..35b172863 --- /dev/null +++ b/x/ibc-rate-limit/types/params.go @@ -0,0 +1,73 @@ +package types + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +// Parameter store keys. +var ( + KeyContractAddress = []byte("contract") + + _ paramtypes.ParamSet = &Params{} +) + +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +func NewParams(contractAddress string) (Params, error) { + return Params{ + ContractAddress: contractAddress, + }, nil +} + +// default gamm module parameters. +func DefaultParams() Params { + return Params{ + ContractAddress: "", + } +} + +// validate params. +func (p Params) Validate() error { + if err := validateContractAddress(p.ContractAddress); err != nil { + return err + } + + return nil +} + +// Implements params.ParamSet. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyContractAddress, &p.ContractAddress, validateContractAddress), + } +} + +func validateContractAddress(i interface{}) error { + v, ok := i.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + // Empty strings are valid for unsetting the param + if v == "" { + return nil + } + + // Checks that the contract address is valid + bech32, err := sdk.AccAddressFromBech32(v) + if err != nil { + return err + } + + err = sdk.VerifyAddressFormat(bech32) + if err != nil { + return err + } + + return nil +} diff --git a/x/ibc-rate-limit/types/params.pb.go b/x/ibc-rate-limit/types/params.pb.go new file mode 100644 index 000000000..81ce2f24f --- /dev/null +++ b/x/ibc-rate-limit/types/params.pb.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: neutron/ibcratelimit/v1beta1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the ibc-rate-limit module. +type Params struct { + ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty" yaml:"contract_address"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_96b2a3ecd8a27c06, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetContractAddress() string { + if m != nil { + return m.ContractAddress + } + return "" +} + +func init() { + proto.RegisterType((*Params)(nil), "neutron.ibcratelimit.v1beta1.Params") +} + +func init() { + proto.RegisterFile("neutron/ibcratelimit/v1beta1/params.proto", fileDescriptor_96b2a3ecd8a27c06) +} + +var fileDescriptor_96b2a3ecd8a27c06 = []byte{ + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcc, 0x4b, 0x2d, 0x2d, + 0x29, 0xca, 0xcf, 0xd3, 0xcf, 0x4c, 0x4a, 0x2e, 0x4a, 0x2c, 0x49, 0xcd, 0xc9, 0xcc, 0xcd, 0x2c, + 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x81, 0x2a, 0xd5, 0x43, 0x56, 0xaa, 0x07, 0x55, 0x2a, + 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa8, 0x0f, 0x62, 0x41, 0xf4, 0x28, 0x85, 0x70, 0xb1, + 0x05, 0x80, 0xcd, 0x10, 0xf2, 0xe2, 0x12, 0x48, 0xce, 0xcf, 0x2b, 0x29, 0x4a, 0x4c, 0x2e, 0x89, + 0x4f, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x92, 0x3f, + 0x71, 0x4f, 0x9e, 0xf1, 0xd3, 0x3d, 0x79, 0xf1, 0xca, 0xc4, 0xdc, 0x1c, 0x2b, 0x25, 0x74, 0x55, + 0x4a, 0x41, 0xfc, 0x30, 0x21, 0x47, 0x88, 0x88, 0x53, 0xd0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, + 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, + 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, + 0x43, 0x9d, 0xab, 0x9b, 0x5f, 0x94, 0x0e, 0x63, 0xeb, 0x97, 0x99, 0xea, 0x57, 0x80, 0xbc, 0xaa, + 0x0b, 0xf2, 0x80, 0x2e, 0xc4, 0xb3, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x07, 0x1b, + 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x65, 0xd8, 0x69, 0x11, 0x01, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ContractAddress) > 0 { + i -= len(m.ContractAddress) + copy(dAtA[i:], m.ContractAddress) + i = encodeVarintParams(dAtA, i, uint64(len(m.ContractAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContractAddress) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc-rate-limit/types/params_test.go b/x/ibc-rate-limit/types/params_test.go new file mode 100644 index 000000000..f37e4d886 --- /dev/null +++ b/x/ibc-rate-limit/types/params_test.go @@ -0,0 +1,79 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestValidateContractAddress(t *testing.T) { + testCases := map[string]struct { + addr interface{} + expected bool + }{ + // ToDo: Why do tests expect the bech32 prefix to be cosmos? + "valid_addr": { + addr: "cosmos1qm0hhug8kszhcp9f3ryuecz5yw8s3e5v0n2ckd", + expected: true, + }, + "invalid_addr": { + addr: "cosmos1234", + expected: false, + }, + "invalid parameter type": { + addr: 123456, + expected: false, + }, + } + + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + err := validateContractAddress(tc.addr) + + // Assertions. + if !tc.expected { + require.Error(t, err) + return + } + + require.NoError(t, err) + }) + } +} + +func TestValidateParams(t *testing.T) { + testCases := map[string]struct { + addr interface{} + expected bool + }{ + // ToDo: Why do tests expect the bech32 prefix to be cosmos? + "valid_addr": { + addr: "cosmos1qm0hhug8kszhcp9f3ryuecz5yw8s3e5v0n2ckd", + expected: true, + }, + "invalid_addr": { + addr: "cosmos1234", + expected: false, + }, + } + + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + addr, ok := tc.addr.(string) + require.True(t, ok, "unexpected type of address") + + params := Params{ + ContractAddress: addr, + } + + err := params.Validate() + + // Assertions. + if !tc.expected { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/ibc-rate-limit/types/query.pb.go b/x/ibc-rate-limit/types/query.pb.go new file mode 100644 index 000000000..f794ecbd4 --- /dev/null +++ b/x/ibc-rate-limit/types/query.pb.go @@ -0,0 +1,542 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: neutron/ibcratelimit/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a6095f726b1d3aec, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// aramsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params defines the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a6095f726b1d3aec, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "neutron.ibcratelimit.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "neutron.ibcratelimit.v1beta1.QueryParamsResponse") +} + +func init() { + proto.RegisterFile("neutron/ibcratelimit/v1beta1/query.proto", fileDescriptor_a6095f726b1d3aec) +} + +var fileDescriptor_a6095f726b1d3aec = []byte{ + // 318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0xcd, 0x4a, 0x33, 0x31, + 0x14, 0x86, 0x27, 0x1f, 0x9f, 0x5d, 0x8c, 0xbb, 0xd8, 0x85, 0x94, 0x12, 0xa5, 0x88, 0x54, 0xa1, + 0x89, 0xad, 0x08, 0xae, 0x7b, 0x05, 0xda, 0x9d, 0xee, 0x32, 0x25, 0xc4, 0x40, 0x27, 0x27, 0x4d, + 0x32, 0xc5, 0x6e, 0xbd, 0x02, 0xc1, 0xb5, 0x6b, 0x6f, 0xa5, 0xcb, 0x82, 0x1b, 0x57, 0x22, 0xad, + 0x17, 0x22, 0x9d, 0xc4, 0x52, 0x7f, 0x18, 0x70, 0x77, 0x38, 0x79, 0x9f, 0x87, 0x37, 0x27, 0x6d, + 0x6b, 0x51, 0x78, 0x0b, 0x9a, 0xa9, 0x6c, 0x68, 0xb9, 0x17, 0x23, 0x95, 0x2b, 0xcf, 0x26, 0xdd, + 0x4c, 0x78, 0xde, 0x65, 0xe3, 0x42, 0xd8, 0x29, 0x35, 0x16, 0x3c, 0xe0, 0x66, 0x4c, 0xd2, 0xcd, + 0x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 0xb9, 0x9f, 0x1a, 0xe1, 0xb2, 0x5a, 0x79, 0xf5, 0xd3, + 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xee, 0xd8, 0x97, 0x25, 0x4a, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Params defines a gRPC query method that returns the ibc-rate-limit module's + // parameters. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/neutron.ibcratelimit.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params defines a gRPC query method that returns the ibc-rate-limit module's + // parameters. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/neutron.ibcratelimit.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "neutron.ibcratelimit.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "neutron/ibcratelimit/v1beta1/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Params.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 skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc-rate-limit/types/query.pb.gw.go b/x/ibc-rate-limit/types/query.pb.gw.go new file mode 100644 index 000000000..1e18d9032 --- /dev/null +++ b/x/ibc-rate-limit/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: neutron/ibcratelimit/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"neutron", "ibc-rate-limit", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/ibc-rate-limit/types/tx.go b/x/ibc-rate-limit/types/tx.go new file mode 100644 index 000000000..ec4026dc7 --- /dev/null +++ b/x/ibc-rate-limit/types/tx.go @@ -0,0 +1,44 @@ +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 ModuleCdc.MustMarshalJSON(msg) +} + +func (msg *MsgUpdateParams) Validate() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority is invalid") + } + + // we allow unsetting the contract + if msg.Params.ContractAddress == "" { + return nil + } + if _, err := sdk.AccAddressFromBech32(msg.Params.ContractAddress); err != nil { + return errorsmod.Wrap(err, "contract_address is invalid") + } + + return nil +} diff --git a/x/ibc-rate-limit/types/tx.pb.go b/x/ibc-rate-limit/types/tx.pb.go new file mode 100644 index 000000000..ddf4576ad --- /dev/null +++ b/x/ibc-rate-limit/types/tx.pb.go @@ -0,0 +1,605 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: neutron/ibcratelimit/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.47 +type MsgUpdateParams struct { + // Authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/tokenfactory 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_88b553b0b85135fe, []int{0} +} +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_88b553b0b85135fe, []int{1} +} +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((*MsgUpdateParams)(nil), "neutron.ibcratelimit.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "neutron.ibcratelimit.v1beta1.MsgUpdateParamsResponse") +} + +func init() { + proto.RegisterFile("neutron/ibcratelimit/v1beta1/tx.proto", fileDescriptor_88b553b0b85135fe) +} + +var fileDescriptor_88b553b0b85135fe = []byte{ + // 390 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcd, 0x4b, 0x2d, 0x2d, + 0x29, 0xca, 0xcf, 0xd3, 0xcf, 0x4c, 0x4a, 0x2e, 0x4a, 0x2c, 0x49, 0xcd, 0xc9, 0xcc, 0xcd, 0x2c, + 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x92, 0x81, 0x2a, 0xd3, 0x43, 0x56, 0xa6, 0x07, 0x55, 0x26, 0x25, 0x98, 0x98, 0x9b, + 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x1a, 0xa4, 0xe4, 0x92, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, + 0x93, 0x12, 0xf3, 0xb2, 0xe1, 0xc6, 0x81, 0x38, 0x18, 0xf2, 0xc5, 0xa9, 0x70, 0xf9, 0xe4, 0xfc, + 0xcc, 0x3c, 0xa8, 0xbc, 0x38, 0x54, 0x3e, 0xb7, 0x38, 0x5d, 0xbf, 0xcc, 0x10, 0x44, 0x41, 0x25, + 0x24, 0x21, 0x12, 0xf1, 0x60, 0x9e, 0x3e, 0x84, 0x03, 0x95, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x87, + 0x88, 0x83, 0x58, 0x50, 0x51, 0x4d, 0xbc, 0x3e, 0x2c, 0x48, 0x2c, 0x4a, 0xcc, 0x85, 0x1a, 0xa0, + 0x74, 0x96, 0x91, 0x8b, 0xdf, 0xb7, 0x38, 0x3d, 0xb4, 0x20, 0x25, 0xb1, 0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, 0x65, 0x91, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xb5, + 0x41, 0x37, 0xbf, 0x28, 0x1d, 0xc6, 0xd6, 0x2f, 0x33, 0xd5, 0xaf, 0x40, 0xf7, 0x7d, 0x49, 0x65, + 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x2a, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xe4, + 0xe9, 0x9d, 0xd9, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// 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 { + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/neutron.ibcratelimit.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 { + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +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) +} + +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: "/neutron.ibcratelimit.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: "neutron.ibcratelimit.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "neutron/ibcratelimit/v1beta1/tx.proto", +} + +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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +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 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibcswap/ibc_middleware.go b/x/ibcswap/ibc_middleware.go deleted file mode 100644 index 9f5b5edab..000000000 --- a/x/ibcswap/ibc_middleware.go +++ /dev/null @@ -1,428 +0,0 @@ -package ibcswap - -import ( - "encoding/json" - "errors" - "strings" - - sdkerrors "cosmossdk.io/errors" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" - - "github.com/neutron-org/neutron/v4/x/ibcswap/keeper" - "github.com/neutron-org/neutron/v4/x/ibcswap/types" -) - -var _ porttypes.Middleware = &IBCMiddleware{} - -// IBCMiddleware implements the ICS26 callbacks for the swap middleware given the -// swap keeper and the underlying application. -type IBCMiddleware struct { - app porttypes.IBCModule - keeper keeper.Keeper -} - -// NewIBCMiddleware creates a new IBCMiddleware given the keeper and underlying application. -func NewIBCMiddleware(app porttypes.IBCModule, k keeper.Keeper) IBCMiddleware { - return IBCMiddleware{ - app: app, - keeper: k, - } -} - -// OnChanOpenInit implements the IBCModule interface. -func (im IBCMiddleware) OnChanOpenInit( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID string, - channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - version string, -) (string, error) { - return im.app.OnChanOpenInit( - ctx, - order, - connectionHops, - portID, - channelID, - chanCap, - counterparty, - version, - ) -} - -// OnChanOpenTry implements the IBCModule interface. -func (im IBCMiddleware) OnChanOpenTry( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID, channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - counterpartyVersion string, -) (version string, err error) { - return im.app.OnChanOpenTry( - ctx, - order, - connectionHops, - portID, - channelID, - chanCap, - counterparty, - counterpartyVersion, - ) -} - -// OnChanOpenAck implements the IBCModule interface. -func (im IBCMiddleware) OnChanOpenAck( - ctx sdk.Context, - portID, channelID string, - counterpartyChannelID string, - counterpartyVersion string, -) error { - return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) -} - -// OnChanOpenConfirm implements the IBCModule interface. -func (im IBCMiddleware) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanOpenConfirm(ctx, portID, channelID) -} - -// OnChanCloseInit implements the IBCModule interface. -func (im IBCMiddleware) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanCloseInit(ctx, portID, channelID) -} - -// OnChanCloseConfirm implements the IBCModule interface. -func (im IBCMiddleware) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanCloseConfirm(ctx, portID, channelID) -} - -// OnRecvPacket checks the memo field on this packet and if the metadata inside's root key indicates this packet -// should be handled by the swap middleware it attempts to perform a swap. If the swap is successful -// the underlying application's OnRecvPacket callback is invoked. - -// For clarity, here is a breakdown of the steps -// 1. Check if this is a swap packet; if not pass it to next middleware -// 2. validate swapMetadata; ErrAck if invalid -// 3. Pass through the middleware stack to ibc-go/transfer#OnRecvPacket; transfer coins are sent to receiver -// 4. Do swap; handle failures - -func (im IBCMiddleware) OnRecvPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) ibcexported.Acknowledgement { - var data transfertypes.FungibleTokenPacketData - if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { - return channeltypes.NewErrorAcknowledgement(err) - } - - m := &types.PacketMetadata{} - err := json.Unmarshal([]byte(data.Memo), m) - if err != nil || m.Swap == nil { - // Not a packet that should be handled by the swap middleware - return im.app.OnRecvPacket(ctx, packet, relayer) - } - - metadata := m.Swap - - if err := metadata.Validate(); err != nil { - return channeltypes.NewErrorAcknowledgement(err) - } - - if err := validateSwapPacket(packet, data, *metadata); err != nil { - return channeltypes.NewErrorAcknowledgement(err) - } - - // Use overrideReceiver so that users cannot ibcswap through arbitrary addresses. - // Instead generate a unique address for each user based on their channel and origin-address - originalCreator := m.Swap.Creator - overrideReceiver, err := packetforward.GetReceiver(packet.DestinationChannel, data.Sender) - if err != nil { - return channeltypes.NewErrorAcknowledgement(err) - } - metadata.Creator = overrideReceiver - // Update packet data to match the new receiver so that transfer middleware adds tokens to the expected address - packet = newPacketWithOverrideReceiver(packet, data, overrideReceiver) - - ack := im.app.OnRecvPacket(ctx, packet, relayer) - if ack == nil || !ack.Success() { - return ack - } - - // Attempt to perform a swap using a cacheCtx - cacheCtx, writeCache := ctx.CacheContext() - res, err := im.keeper.Swap(cacheCtx, originalCreator, metadata.MsgPlaceLimitOrder) - if err != nil { - return im.handleFailedSwap(ctx, packet, data, metadata, err) - } - - // If there is no next field set in the metadata return ack - if metadata.Next == nil { - writeCache() - return ack - } - - // We need to reset the packets memo field so that the root key in the metadata is the - // next field from the current metadata. - memoBz, err := json.Marshal(metadata.Next) - if err != nil { - return ack - } - - postSwapData := data - postSwapData.Memo = string(memoBz) - - // Override the packet data to include the token denom and amount that was received from the swap. - postSwapData.Denom = res.TakerCoinOut.Denom - postSwapData.Amount = res.TakerCoinOut.Amount.String() - - // After a successful swap funds are now in the receiver account from the MsgPlaceLimitOrder so, - // we need to override the packets receiver field before invoking the forward middlewares OnRecvPacket. - postSwapData.Receiver = m.Swap.Receiver - - dataBz, err := transfertypes.ModuleCdc.MarshalJSON(&postSwapData) - if err != nil { - return ack - } - - packet.Data = dataBz - - // The forward middleware should return a nil ack if the forward is initiated properly. - // If not an error occurred, and we return the original ack. - newAck := im.app.OnRecvPacket(cacheCtx, packet, relayer) - if newAck != nil { - return im.handleFailedSwap(ctx, packet, data, metadata, errors.New(string(newAck.Acknowledgement()))) - } - - writeCache() - return nil -} - -// OnAcknowledgementPacket implements the IBCModule interface. -func (im IBCMiddleware) OnAcknowledgementPacket( - ctx sdk.Context, - packet channeltypes.Packet, - acknowledgement []byte, - relayer sdk.AccAddress, -) error { - return im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) -} - -// OnTimeoutPacket implements the IBCModule interface. -func (im IBCMiddleware) OnTimeoutPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) error { - return im.app.OnTimeoutPacket(ctx, packet, relayer) -} - -func (im IBCMiddleware) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - sourcePort string, - sourceChannel string, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, - data []byte, -) (sequence uint64, err error) { - return im.keeper.SendPacket( - ctx, - chanCap, - sourcePort, - sourceChannel, - timeoutHeight, - timeoutTimestamp, - data, - ) -} - -// WriteAcknowledgement implements the ICS4 Wrapper interface. -func (im IBCMiddleware) WriteAcknowledgement( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - packet ibcexported.PacketI, - ack ibcexported.Acknowledgement, -) error { - return im.keeper.WriteAcknowledgement(ctx, chanCap, packet, ack) -} - -func (im IBCMiddleware) GetAppVersion( - ctx sdk.Context, - portID string, - channelID string, -) (string, bool) { - return im.keeper.GetAppVersion(ctx, portID, channelID) -} - -// handleFailedSwap will invoke the appropriate failover logic depending on if this swap was marked refundable -// or non-refundable in the SwapMetadata. -func (im IBCMiddleware) handleFailedSwap( - ctx sdk.Context, - packet channeltypes.Packet, - data transfertypes.FungibleTokenPacketData, - metadata *types.SwapMetadata, - err error, -) ibcexported.Acknowledgement { - swapErr := sdkerrors.Wrap(types.ErrSwapFailed, err.Error()) - im.keeper.Logger(ctx).Error( - "ibc swap failed", - "err", swapErr, - "creator", metadata.Creator, - "receiver", metadata.Receiver, - "tokenIn", metadata.TokenIn, - "tokenOut", metadata.TokenOut, - "AmountIn", metadata.AmountIn, - "TickIndexInToOut", metadata.TickIndexInToOut, - "OrderType", metadata.OrderType, - "refund address", metadata.NeutronRefundAddress, - ) - - // The current denom is from the sender chains perspective, we need to compose the appropriate denom for this side - denomOnThisChain := getDenomForThisChain(packet, data.Denom) - - if len(metadata.NeutronRefundAddress) != 0 { - return im.handleOnChainRefund(ctx, data, metadata, denomOnThisChain, err) - } - - return im.handleIBCRefund(ctx, packet, data, metadata, denomOnThisChain, err) -} - -// handleOnChainRefund will compose a successful ack to send back to the counterparty chain containing any error messages. -// Returning a successful ack ensures that a refund is not issued on the counterparty chain. -// See: https://github.com/cosmos/ibc-go/blob/3ecc7dd3aef5790ec5d906936a297b34adf1ee41/modules/apps/transfer/keeper/relay.go#L320 -func (im IBCMiddleware) handleOnChainRefund( - ctx sdk.Context, - data transfertypes.FungibleTokenPacketData, - metadata *types.SwapMetadata, - newDenom string, - swapErr error, -) ibcexported.Acknowledgement { - amount, ok := math.NewIntFromString(data.Amount) - if !ok { - wrappedErr := sdkerrors.Wrapf( - transfertypes.ErrInvalidAmount, - "unable to parse transfer amount (%s) into math.Int", - data.Amount, - ) - wrappedErr = sdkerrors.Wrap(swapErr, wrappedErr.Error()) - return channeltypes.NewResultAcknowledgement([]byte(wrappedErr.Error())) - } - - token := sdk.NewCoin(newDenom, amount) - err := im.keeper.SendCoins(ctx, metadata.Creator, metadata.NeutronRefundAddress, sdk.NewCoins(token)) - if err != nil { - wrappedErr := sdkerrors.Wrap(err, "failed to move funds to refund address") - wrappedErr = sdkerrors.Wrap(swapErr, wrappedErr.Error()) - return channeltypes.NewResultAcknowledgement([]byte(wrappedErr.Error())) - } - - return channeltypes.NewResultAcknowledgement([]byte(swapErr.Error())) -} - -// handleIBCRefund will either burn or transfer the funds back to the appropriate escrow account. -// When a packet comes in the transfer module's OnRecvPacket callback is invoked which either -// mints or unescrows funds on this side so if the swap fails an explicit refund is required. -func (im IBCMiddleware) handleIBCRefund( - ctx sdk.Context, - packet channeltypes.Packet, - data transfertypes.FungibleTokenPacketData, - metadata *types.SwapMetadata, - newDenom string, - swapErr error, -) ibcexported.Acknowledgement { - data.Denom = newDenom - - err := im.keeper.RefundPacketToken(ctx, packet, data, metadata) - if err != nil { - wrappedErr := sdkerrors.Wrap(swapErr, err.Error()) - - // If the refund fails on this side we want to make sure that the refund does not happen on the counterparty, - // so we return a successful ack containing the error - return channeltypes.NewResultAcknowledgement([]byte(wrappedErr.Error())) - } - - return channeltypes.NewErrorAcknowledgement(swapErr) -} - -// getDenomForThisChain composes a new token denom by either unwinding or prefixing the specified token denom appropriately. -// This is necessary because the token denom in the packet data is from the perspective of the counterparty chain. -func getDenomForThisChain(packet channeltypes.Packet, denom string) string { - counterpartyPrefix := transfertypes.GetDenomPrefix(packet.SourcePort, packet.SourceChannel) - if strings.HasPrefix(denom, counterpartyPrefix) { - // unwind denom - unwoundDenom := denom[len(counterpartyPrefix):] - denomTrace := transfertypes.ParseDenomTrace(unwoundDenom) - if denomTrace.Path == "" { - // denom is now unwound back to native denom - return unwoundDenom - } - // denom is still IBC denom - return denomTrace.IBCDenom() - } - - // append port and channel from this chain to denom - prefixedDenom := transfertypes.GetDenomPrefix(packet.DestinationPort, packet.DestinationChannel) + denom - return transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() -} - -// Update the packet data to reflect the new receiver address that is used by the PFM -func newPacketWithOverrideReceiver(oldPacket channeltypes.Packet, data transfertypes.FungibleTokenPacketData, overrideReceiver string) channeltypes.Packet { - overrideData := transfertypes.FungibleTokenPacketData{ - Denom: data.Denom, - Amount: data.Amount, - Sender: data.Sender, - Receiver: overrideReceiver, // override receiver - } - overrideDataBz := transfertypes.ModuleCdc.MustMarshalJSON(&overrideData) - - return channeltypes.Packet{ - Sequence: oldPacket.Sequence, - SourcePort: oldPacket.SourcePort, - SourceChannel: oldPacket.SourceChannel, - DestinationPort: oldPacket.DestinationPort, - DestinationChannel: oldPacket.DestinationChannel, - Data: overrideDataBz, // override data - TimeoutHeight: oldPacket.TimeoutHeight, - TimeoutTimestamp: oldPacket.TimeoutTimestamp, - } -} - -func validateSwapPacket(packet channeltypes.Packet, transferData transfertypes.FungibleTokenPacketData, sm types.SwapMetadata) error { - denomOnNeutron := getDenomForThisChain(packet, transferData.Denom) - if denomOnNeutron != sm.TokenIn { - return sdkerrors.Wrap(types.ErrInvalidSwapMetadata, "Transfer Denom must match TokenIn") - } - - transferAmount, ok := math.NewIntFromString(transferData.Amount) - if !ok { - return sdkerrors.Wrapf( - transfertypes.ErrInvalidAmount, - "unable to parse transfer amount (%s) into math.Int", - transferData.Amount, - ) - } - - if transferAmount.LT(sm.AmountIn) { - return sdkerrors.Wrap(types.ErrInvalidSwapMetadata, "Transfer amount must be >= AmountIn") - } - - if sm.ContainsPFM() { - return sdkerrors.Wrap( - types.ErrInvalidSwapMetadata, - "ibcswap middleware cannot be used in conjunction with packet-forward-middleware", - ) - } - return nil -} diff --git a/x/ibcswap/keeper/keeper.go b/x/ibcswap/keeper/keeper.go deleted file mode 100644 index 33d5f1493..000000000 --- a/x/ibcswap/keeper/keeper.go +++ /dev/null @@ -1,207 +0,0 @@ -package keeper - -import ( - "fmt" - - sdkerrors "cosmossdk.io/errors" - "cosmossdk.io/log" - "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/gogoproto/proto" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" - - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" - "github.com/neutron-org/neutron/v4/x/ibcswap/types" -) - -// Keeper defines the swap middleware keeper. -type Keeper struct { - cdc codec.BinaryCodec - msgServiceRouter *baseapp.MsgServiceRouter - - ics4Wrapper porttypes.ICS4Wrapper - bankKeeper types.BankKeeper -} - -// NewKeeper creates a new swap Keeper instance. -func NewKeeper( - cdc codec.BinaryCodec, - msgServiceRouter *baseapp.MsgServiceRouter, - ics4Wrapper porttypes.ICS4Wrapper, - bankKeeper types.BankKeeper, -) Keeper { - return Keeper{ - cdc: cdc, - msgServiceRouter: msgServiceRouter, - - ics4Wrapper: ics4Wrapper, - bankKeeper: bankKeeper, - } -} - -// Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+ibcexported.ModuleName+"-"+types.ModuleName) -} - -// Swap calls into the base app's msg service router so that the appropriate handler is called when sending the swap msg. -func (k Keeper) Swap( - ctx sdk.Context, - originalCreator string, - msg *dextypes.MsgPlaceLimitOrder, -) (*dextypes.MsgPlaceLimitOrderResponse, error) { - swapHandler := k.msgServiceRouter.Handler(msg) - if swapHandler == nil { - return nil, sdkerrors.Wrap( - types.ErrMsgHandlerInvalid, - fmt.Sprintf("could not find the handler for %T", msg), - ) - } - - res, err := swapHandler(ctx, msg) - if err != nil { - return nil, err - } - - msgSwapRes := &dextypes.MsgPlaceLimitOrderResponse{} - // TODO: replace the Data field with MsgResponses? - if err := proto.Unmarshal(res.Data, msgSwapRes); err != nil { - return nil, err - } - - amountUnused := msg.AmountIn.Sub(msgSwapRes.CoinIn.Amount) - // If not all tokenIn is swapped and a temporary creator address has been used - // return the unused portion to the original creator address - if amountUnused.IsPositive() && originalCreator != msg.Creator { - overrrideCreatorAddr := sdk.MustAccAddressFromBech32(msg.Creator) - originalCreatorAddr := sdk.MustAccAddressFromBech32(originalCreator) - unusedCoin := sdk.NewCoin(msg.TokenIn, amountUnused) - - err := k.bankKeeper.SendCoins(ctx, overrrideCreatorAddr, originalCreatorAddr, sdk.Coins{unusedCoin}) - if err != nil { - return nil, err - } - } - - return msgSwapRes, nil -} - -// SendPacket wraps IBC ChannelKeeper's SendPacket function. -func (k Keeper) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - sourcePort string, - sourceChannel string, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, - data []byte, -) (sequence uint64, err error) { - return k.ics4Wrapper.SendPacket( - ctx, - chanCap, - sourcePort, - sourceChannel, - timeoutHeight, - timeoutTimestamp, - data, - ) -} - -// WriteAcknowledgement wraps IBC ChannelKeeper's WriteAcknowledgement function. -func (k Keeper) WriteAcknowledgement( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - packet ibcexported.PacketI, - acknowledgement ibcexported.Acknowledgement, -) error { - return k.ics4Wrapper.WriteAcknowledgement(ctx, chanCap, packet, acknowledgement) -} - -// RefundPacketToken handles the burning or escrow lock up of vouchers when an asset should be refunded. -// This is only used in the case where we call into the transfer modules OnRecvPacket callback but then the swap fails. -func (k Keeper) RefundPacketToken( - ctx sdk.Context, - packet channeltypes.Packet, - data transfertypes.FungibleTokenPacketData, - metadata *types.SwapMetadata, -) error { - // parse the denomination from the full denom path - trace := transfertypes.ParseDenomTrace(data.Denom) - - // parse the transfer amount - transferAmount, ok := math.NewIntFromString(data.Amount) - if !ok { - return sdkerrors.Wrapf( - transfertypes.ErrInvalidAmount, - "unable to parse transfer amount (%s) into math.Int", - data.Amount, - ) - } - token := sdk.NewCoin(trace.IBCDenom(), transferAmount) - - // decode the creator address - receiver, err := sdk.AccAddressFromBech32(metadata.Creator) - if err != nil { - return err - } - - // if the sender chain is source that means a voucher was minted on Neutron when the ics20 transfer took place - if transfertypes.SenderChainIsSource(packet.SourcePort, packet.SourceChannel, data.Denom) { - // transfer coins from user account to transfer module - err = k.bankKeeper.SendCoinsFromAccountToModule( - ctx, - receiver, - types.ModuleName, - sdk.NewCoins(token), - ) - if err != nil { - return err - } - - // burn the coins - err = k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(token)) - if err != nil { - return err - } - - return nil - } - - // transfer coins from user account to escrow address - escrowAddress := transfertypes.GetEscrowAddress( - packet.GetSourcePort(), - packet.GetSourceChannel(), - ) - err = k.bankKeeper.SendCoins(ctx, receiver, escrowAddress, sdk.NewCoins(token)) - if err != nil { - return err - } - - return nil -} - -// SendCoins wraps the BankKeepers SendCoins function so it can be invoked from the middleware. -func (k Keeper) SendCoins(ctx sdk.Context, fromAddr, toAddr string, amt sdk.Coins) error { - from, err := sdk.AccAddressFromBech32(fromAddr) - if err != nil { - return err - } - - to, err := sdk.AccAddressFromBech32(toAddr) - if err != nil { - return err - } - - return k.bankKeeper.SendCoins(ctx, from, to, amt) -} - -func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { - return k.ics4Wrapper.GetAppVersion(ctx, portID, channelID) -} diff --git a/x/ibcswap/module.go b/x/ibcswap/module.go deleted file mode 100644 index 428ac1274..000000000 --- a/x/ibcswap/module.go +++ /dev/null @@ -1,144 +0,0 @@ -package ibcswap - -import ( - "encoding/json" - - "cosmossdk.io/core/appmodule" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "github.com/neutron-org/neutron/v4/x/ibcswap/keeper" - "github.com/neutron-org/neutron/v4/x/ibcswap/types" -) - -var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ appmodule.AppModule = AppModule{} - _ module.AppModuleSimulation = AppModule{} -) - -// AppModuleBasic is the swap middleware AppModuleBasic. -type AppModuleBasic struct{} - -// Name implements AppModuleBasic interface. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -// RegisterLegacyAminoCodec implements AppModuleBasic interface. -func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} - -// RegisterInterfaces registers module concrete types into protobuf Any. -func (AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) {} - -// DefaultGenesis returns default genesis state as raw bytes for the swap module. -func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage { - return nil -} - -// ValidateGenesis performs genesis state validation for the swap module. -func (AppModuleBasic) ValidateGenesis( - _ codec.JSONCodec, - _ client.TxEncodingConfig, - _ json.RawMessage, -) error { - return nil -} - -// RegisterRESTRoutes implements AppModuleBasic interface. -func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the swap module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {} - -// GetTxCmd implements AppModuleBasic interface. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return nil -} - -// GetQueryCmd implements AppModuleBasic interface. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - -// AppModule implements the module.AppModule -type AppModule struct { - AppModuleBasic - keeper keeper.Keeper -} - -func NewAppModule(keeper keeper.Keeper) *AppModule { - return &AppModule{ - keeper: keeper, - } -} - -// RegisterInvariants implements the AppModule interface. -func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// QuerierRoute implements the AppModule interface. -func (AppModule) QuerierRoute() string { - return "" -} - -// RegisterServices registers module services. -func (am AppModule) RegisterServices(_ module.Configurator) {} - -// InitGenesis performs genesis initialization for the ibc-router module. It returns -// no validator updates. -func (am AppModule) InitGenesis( - _ sdk.Context, - _ codec.JSONCodec, - _ json.RawMessage, -) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the exported genesis state as raw bytes for the swap module. -func (am AppModule) ExportGenesis(_ sdk.Context, _ codec.JSONCodec) json.RawMessage { - return nil -} - -// ConsensusVersion returns the consensus state breaking version for the swap module. -func (AppModule) ConsensusVersion() uint64 { return 1 } - -// BeginBlock implements the AppModule interface. -func (am AppModule) BeginBlock(_ sdk.Context) {} - -// EndBlock implements the AppModule interface. -func (am AppModule) EndBlock(_ sdk.Context) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} - -// GenerateGenesisState implements the AppModuleSimulation interface. -func (AppModule) GenerateGenesisState(_ *module.SimulationState) {} - -// ProposalContents implements the AppModuleSimulation interface. -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// RegisterStoreDecoder implements the AppModuleSimulation interface. -func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} - -// WeightedOperations implements the AppModuleSimulation interface. -func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { - return nil -} - -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() { // marker -} - -// IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() { // marker -} diff --git a/x/ibcswap/types/errors.go b/x/ibcswap/types/errors.go deleted file mode 100644 index 819589ae8..000000000 --- a/x/ibcswap/types/errors.go +++ /dev/null @@ -1,9 +0,0 @@ -package types - -import sdkerrors "cosmossdk.io/errors" - -var ( - ErrInvalidSwapMetadata = sdkerrors.Register(ModuleName, 2, "invalid swap metadata") - ErrSwapFailed = sdkerrors.Register(ModuleName, 3, "ibc swap failed") - ErrMsgHandlerInvalid = sdkerrors.Register(ModuleName, 4, "msg service handler not found") -) diff --git a/x/ibcswap/types/expected_keepers.go b/x/ibcswap/types/expected_keepers.go deleted file mode 100644 index 705463d97..000000000 --- a/x/ibcswap/types/expected_keepers.go +++ /dev/null @@ -1,14 +0,0 @@ -package types - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// BankKeeper defines the expected interface that the swap middleware needs in order to facilitate refunds. -type BankKeeper interface { - SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error - BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error -} diff --git a/x/ibcswap/types/keys.go b/x/ibcswap/types/keys.go deleted file mode 100644 index 9a88fc669..000000000 --- a/x/ibcswap/types/keys.go +++ /dev/null @@ -1,8 +0,0 @@ -package types - -// ModuleName defines the name for the swap middleware. -const ModuleName = "swap-middleware" - -// ProcessedKey is used to signal to the swap middleware that a packet has already been processed by some other -// middleware and so invoking the transfer modules OnRecvPacket callback should be avoided. -type ProcessedKey struct{} diff --git a/x/ibcswap/types/swap.go b/x/ibcswap/types/swap.go deleted file mode 100644 index 9f5013a49..000000000 --- a/x/ibcswap/types/swap.go +++ /dev/null @@ -1,114 +0,0 @@ -package types - -import ( - "encoding/json" - - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/iancoleman/orderedmap" - - dextypes "github.com/neutron-org/neutron/v4/x/dex/types" -) - -// PacketMetadata wraps the SwapMetadata. The root key in the incoming ICS20 transfer packet's memo needs to be set to the same -// value as the json tag in order for the swap middleware to process the swap. -type PacketMetadata struct { - Swap *SwapMetadata `json:"swap"` -} - -// SwapMetadata defines the parameters necessary to perform a swap utilizing the memo field from an incoming ICS20 -// transfer packet. The next field is a string so that you can nest any arbitrary metadata to be handled -// further in the middleware stack or on the counterparty. -type SwapMetadata struct { - *dextypes.MsgPlaceLimitOrder - // If a value is provided for NeutronRefundAddress and the swap fails the Transfer.Amount will be moved to this address for later recovery. - // If no NeutronRefundAddress is provided and a swap fails we will fail the ibc transfer and tokens will be refunded on the source chain. - NeutronRefundAddress string `json:"refund-address,omitempty"` - - // Using JSONObject so that objects for next property will not be mutated by golang's lexicographic key sort on map keys during Marshal. - // Supports primitives for Unmarshal/Marshal so that an escaped JSON-marshaled string is also valid. - Next *JSONObject `json:"next,omitempty"` -} - -// Validate ensures that all the required fields are present in the SwapMetadata and contain valid values. -func (sm SwapMetadata) Validate() error { - if err := sm.MsgPlaceLimitOrder.Validate(); err != nil { - return sdkerrors.Wrap(ErrInvalidSwapMetadata, err.Error()) - } - if sm.TokenIn == "" { - return sdkerrors.Wrap(ErrInvalidSwapMetadata, "limit order tokenIn cannot be an empty string") - } - if sm.TokenOut == "" { - return sdkerrors.Wrap(ErrInvalidSwapMetadata, "limit order tokenOut cannot be an empty string") - } - if sm.NeutronRefundAddress != "" { - _, err := sdk.AccAddressFromBech32(sm.NeutronRefundAddress) - if err != nil { - return sdkerrors.Wrapf(dextypes.ErrInvalidAddress, "%s is not a valid Neutron address", sm.NeutronRefundAddress) - } - } - - if !sm.OrderType.IsFoK() { - return sdkerrors.Wrap(ErrInvalidSwapMetadata, "Limit Order type must be FILL_OR_KILL") - } - - return nil -} - -// ContainsPFM checks if the Swapetadata is wrapping packet-forward-middleware -func (sm SwapMetadata) ContainsPFM() bool { - if sm.Next == nil { - return false - } - forward, _ := sm.Next.orderedMap.Get("forward") - - return forward != nil -} - -// JSONObject is a wrapper type to allow either a primitive type or a JSON object. -// In the case the value is a JSON object, OrderedMap type is used so that key order -// is retained across Unmarshal/Marshal. -type JSONObject struct { - obj bool - primitive []byte - orderedMap orderedmap.OrderedMap -} - -// NewJSONObject is a constructor used for tests. -// The usage of JSONObject in the middleware is only json Marshal/Unmarshal -func NewJSONObject(object bool, primitive []byte, orderedMap orderedmap.OrderedMap) *JSONObject { - return &JSONObject{ - obj: object, - primitive: primitive, - orderedMap: orderedMap, - } -} - -// UnmarshalJSON overrides the default json.Unmarshal behavior -func (o *JSONObject) UnmarshalJSON(b []byte) error { - if err := o.orderedMap.UnmarshalJSON(b); err != nil { - // If ordered map unmarshal fails, this is a primitive value - o.obj = false - // Attempt to unmarshal as string, this removes extra JSON escaping - var primitiveStr string - if err := json.Unmarshal(b, &primitiveStr); err != nil { - o.primitive = b - return nil - } - o.primitive = []byte(primitiveStr) - return nil - } - // This is a JSON object, now stored as an ordered map to retain key order. - o.obj = true - return nil -} - -// MarshalJSON overrides the default json.Marshal behavior -func (o *JSONObject) MarshalJSON() ([]byte, error) { - if o.obj { - // non-primitive, return marshaled ordered map. - return o.orderedMap.MarshalJSON() - } - // primitive, return raw bytes. - return o.primitive, nil -} diff --git a/x/ibcswap/types/swap_test.go b/x/ibcswap/types/swap_test.go deleted file mode 100644 index 50bc06772..000000000 --- a/x/ibcswap/types/swap_test.go +++ /dev/null @@ -1,248 +0,0 @@ -package types_test - -import ( - "encoding/json" - "testing" - - "github.com/neutron-org/neutron/v4/app/config" - - "cosmossdk.io/math" - pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" - "github.com/iancoleman/orderedmap" - "github.com/stretchr/testify/require" - - "github.com/neutron-org/neutron/v4/testutil/common/sample" - "github.com/neutron-org/neutron/v4/x/dex/types" - dextypes "github.com/neutron-org/neutron/v4/x/ibcswap/types" -) - -func init() { - _ = config.GetDefaultConfig() -} - -// TestPacketMetadata_Marshal asserts that the marshaling of the swap metadata works as intended. -func TestPacketMetadata_Marshal(t *testing.T) { - pm := dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "test-1", - Receiver: "test-1", - TokenIn: "token-a", - TokenOut: "token-b", - AmountIn: math.NewInt(123), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - _, err := json.Marshal(pm) - require.NoError(t, err) -} - -// TestPacketMetadata_MarshalWithNext asserts that the marshaling of the swap metadata works as intended with next field initialized. -func TestPacketMetadata_MarshalWithNext(t *testing.T) { - forwardMedata := &pfmtypes.PacketMetadata{ - Forward: &pfmtypes.ForwardMetadata{ - Receiver: "cosmos14zde8usc4ur04y3aqnufzzmv2uqdpwwttr5uwv", - Port: "transfer", - Channel: "channel-0", - Timeout: 0, - Retries: nil, - Next: nil, - }, - } - nextBz, err := json.Marshal(forwardMedata) - require.NoError(t, err) - - pm := dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "test-1", - Receiver: "test-1", - TokenIn: "token-a", - TokenOut: "token-b", - TickIndexInToOut: 0, - AmountIn: math.NewInt(123), - OrderType: types.LimitOrderType_FILL_OR_KILL, - // MaxAmountOut: math.NewInt(456), - }, - Next: dextypes.NewJSONObject(false, nextBz, orderedmap.OrderedMap{}), - }, - } - _, err = json.Marshal(pm) - require.NoError(t, err) -} - -// TestPacketMetadata_Unmarshal asserts that unmarshaling works as intended. -func TestPacketMetadata_Unmarshal(t *testing.T) { - metadata := "{\n \"swap\": {\n \"creator\": \"test-1\",\n \"TickIndexInToOut\": 0,\n \"orderType\": 1,\n \"receiver\": \"test-1\",\n \"tokenIn\": \"token-a\",\n \"tokenOut\": \"token-b\",\n \"AmountIn\": \"123\",\n \"next\": \"\"\n }\n}" - pm := &dextypes.PacketMetadata{} - err := json.Unmarshal([]byte(metadata), pm) - require.NoError(t, err) -} - -// TestPacketMetadata_UnmarshalStringNext asserts that unmarshaling works as intended when next is escaped json string. -func TestPacketMetadata_UnmarshalStringNext(t *testing.T) { - metadata := "{\n \"swap\": {\n \"creator\": \"test-1\",\n \"receiver\": \"test-1\",\n \"tokenIn\": \"token-a\",\n \"tokenOut\": \"token-b\",\n \"AmountIn\": \"123\",\n \"TickIndexInToOut\": 0,\n \"orderType\": 1,\n \"next\": \" {\\\"forward\\\":{\\\"receiver\\\":\\\"cosmos1f4cur2krsua2th9kkp7n0zje4stea4p9tu70u8\\\",\\\"port\\\":\\\"transfer\\\",\\\"channel\\\":\\\"channel-0\\\",\\\"timeout\\\":0,\\\"next\\\":{\\\"forward\\\":{\\\"receiver\\\":\\\"cosmos1l505zhahp24v5jsmps9vs5asah759fdce06sfp\\\",\\\"port\\\":\\\"transfer\\\",\\\"channel\\\":\\\"channel-0\\\",\\\"timeout\\\":0}}}}\"\n }\n}" - pm := &dextypes.PacketMetadata{} - err := json.Unmarshal([]byte(metadata), pm) - require.NoError(t, err) -} - -// TestPacketMetadata_UnmarshalJSONNext asserts that unmarshaling works as intended when next is a raw json object. -func TestPacketMetadata_UnmarshalJSONNext(t *testing.T) { - metadata := "{\"swap\":{\"creator\":\"test-1\",\"receiver\":\"test-1\",\"tokenIn\":\"token-a\",\"tokenOut\":\"token-b\",\"AmountIn\":\"123\",\"TickIndexInToOut\":0, \"orderType\": 1, \"tokenIn\":\"token-in\",\"next\":{\"forward\":{\"receiver\":\"cosmos14zde8usc4ur04y3aqnufzzmv2uqdpwwttr5uwv\",\"port\":\"transfer\",\"channel\":\"channel-0\"}}}}" - pm := &dextypes.PacketMetadata{} - err := json.Unmarshal([]byte(metadata), pm) - require.NoError(t, err) -} - -func TestSwapMetadata_ValidatePass(t *testing.T) { - pm := dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: sample.AccAddress(), - Receiver: sample.AccAddress(), - TokenIn: "token-a", - TokenOut: "token-b", - AmountIn: math.NewInt(123), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - _, err := json.Marshal(pm) - require.NoError(t, err) - - require.NoError(t, pm.Swap.Validate()) -} - -func TestSwapMetadata_ValidateFail(t *testing.T) { - pm := dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "", - Receiver: "test-1", - TokenIn: "token-a", - TokenOut: "token-b", - AmountIn: math.NewInt(123), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - _, err := json.Marshal(pm) - require.NoError(t, err) - require.Error(t, pm.Swap.Validate()) - - pm = dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "creator", - Receiver: "", - TokenIn: "token-a", - TokenOut: "token-b", - AmountIn: math.NewInt(123), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - _, err = json.Marshal(pm) - require.NoError(t, err) - require.Error(t, pm.Swap.Validate()) - - pm = dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "creator", - Receiver: "test-1", - TokenIn: "", - TokenOut: "token-b", - AmountIn: math.NewInt(123), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - _, err = json.Marshal(pm) - require.NoError(t, err) - require.Error(t, pm.Swap.Validate()) - - pm = dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "creator", - Receiver: "receiver", - TokenIn: "token-a", - TokenOut: "", - AmountIn: math.NewInt(123), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - _, err = json.Marshal(pm) - require.NoError(t, err) - require.Error(t, pm.Swap.Validate()) - - pm = dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "creator", - Receiver: "receiver", - TokenIn: "token-a", - TokenOut: "token-b", - AmountIn: math.NewInt(0), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - _, err = json.Marshal(pm) - require.NoError(t, err) - require.Error(t, pm.Swap.Validate()) - - pm = dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "creator", - Receiver: "receiver", - TokenIn: "token-a", - TokenOut: "token-b", - AmountIn: math.NewInt(-1), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_FILL_OR_KILL, - }, - Next: nil, - }, - } - _, err = json.Marshal(pm) - require.NoError(t, err) - require.Error(t, pm.Swap.Validate()) - - pm = dextypes.PacketMetadata{ - &dextypes.SwapMetadata{ - MsgPlaceLimitOrder: &types.MsgPlaceLimitOrder{ - Creator: "creator", - Receiver: "receiver", - TokenIn: "token-a", - TokenOut: "token-b", - AmountIn: math.NewInt(123), - TickIndexInToOut: 0, - OrderType: types.LimitOrderType_GOOD_TIL_CANCELLED, - }, - Next: nil, - }, - } - _, err = json.Marshal(pm) - require.NoError(t, err) - require.Error(t, pm.Swap.Validate()) -} diff --git a/x/interchainqueries/client/cli/query.go b/x/interchainqueries/client/cli/query.go index 29f519ab3..d63790abd 100644 --- a/x/interchainqueries/client/cli/query.go +++ b/x/interchainqueries/client/cli/query.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) const ( diff --git a/x/interchainqueries/client/cli/query_params.go b/x/interchainqueries/client/cli/query_params.go index b7c679073..4fb95a5d9 100644 --- a/x/interchainqueries/client/cli/query_params.go +++ b/x/interchainqueries/client/cli/query_params.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/interchainqueries/client/cli/tx.go b/x/interchainqueries/client/cli/tx.go index efe430ad8..f9448534f 100644 --- a/x/interchainqueries/client/cli/tx.go +++ b/x/interchainqueries/client/cli/tx.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // GetTxCmd returns the transaction commands for this module diff --git a/x/interchainqueries/genesis.go b/x/interchainqueries/genesis.go index 4f7d837ba..5cdad98c1 100644 --- a/x/interchainqueries/genesis.go +++ b/x/interchainqueries/genesis.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/interchainqueries/genesis_test.go b/x/interchainqueries/genesis_test.go index 2313d60e4..e93f123ca 100644 --- a/x/interchainqueries/genesis_test.go +++ b/x/interchainqueries/genesis_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/interchainqueries/keeper" - "github.com/neutron-org/neutron/v4/x/interchainqueries" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/interchainqueries/keeper" + "github.com/neutron-org/neutron/v5/x/interchainqueries" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func TestGenesis(t *testing.T) { diff --git a/x/interchainqueries/keeper/grpc_query.go b/x/interchainqueries/keeper/grpc_query.go index 0386207e7..367309be2 100644 --- a/x/interchainqueries/keeper/grpc_query.go +++ b/x/interchainqueries/keeper/grpc_query.go @@ -14,7 +14,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/interchainqueries/keeper/grpc_query_params.go b/x/interchainqueries/keeper/grpc_query_params.go index d0316c257..3c3cc971c 100644 --- a/x/interchainqueries/keeper/grpc_query_params.go +++ b/x/interchainqueries/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/interchainqueries/keeper/grpc_query_params_test.go b/x/interchainqueries/keeper/grpc_query_params_test.go index f1de7e024..015d701fe 100644 --- a/x/interchainqueries/keeper/grpc_query_params_test.go +++ b/x/interchainqueries/keeper/grpc_query_params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/interchainqueries/keeper" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/interchainqueries/keeper" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/interchainqueries/keeper/grpc_query_test.go b/x/interchainqueries/keeper/grpc_query_test.go index 98d368451..8c337f3d8 100644 --- a/x/interchainqueries/keeper/grpc_query_test.go +++ b/x/interchainqueries/keeper/grpc_query_test.go @@ -12,8 +12,8 @@ import ( ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" - "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - iqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + iqtypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func (suite *KeeperTestSuite) TestRemoteLastHeight() { @@ -509,9 +509,8 @@ func (suite *KeeperTestSuite) TestQueryResult() { suite.Require().NoError(err) msg := iqtypes.MsgSubmitQueryResultRequest{ - QueryId: regQuery1.Id, - Sender: contractAddress.String(), - ClientId: suite.Path.EndpointA.ClientID, + QueryId: regQuery1.Id, + Sender: contractAddress.String(), Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, diff --git a/x/interchainqueries/keeper/keeper.go b/x/interchainqueries/keeper/keeper.go index e22fd27e1..4a39fbadb 100644 --- a/x/interchainqueries/keeper/keeper.go +++ b/x/interchainqueries/keeper/keeper.go @@ -15,7 +15,7 @@ import ( ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" tendermintLightClientTypes "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) const ( diff --git a/x/interchainqueries/keeper/keeper_test.go b/x/interchainqueries/keeper/keeper_test.go index 6c73b50c8..af7ca453a 100644 --- a/x/interchainqueries/keeper/keeper_test.go +++ b/x/interchainqueries/keeper/keeper_test.go @@ -12,7 +12,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" wasmKeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" abci "github.com/cometbft/cometbft/abci/types" @@ -21,9 +21,9 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - iqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + iqtypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) var reflectContractPath = "../../../wasmbinding/testdata/reflect.wasm" @@ -769,9 +769,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: 1, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: 1, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -819,9 +818,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -870,9 +868,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -925,9 +922,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -976,9 +972,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -1027,9 +1022,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -1078,9 +1072,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -1131,9 +1124,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, // A bit weird that query owner submits the results, but it doesn't really matter - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, // A bit weird that query owner submits the results, but it doesn't really matter Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -1182,9 +1174,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -1232,9 +1223,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -1286,9 +1276,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -1343,9 +1332,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, @@ -1398,9 +1386,8 @@ func (suite *KeeperTestSuite) TestSubmitInterchainQueryResult() { suite.Require().NoError(err) msg = iqtypes.MsgSubmitQueryResultRequest{ - QueryId: res.Id, - Sender: sender, // A bit weird that query owner submits the results, but it doesn't really matter - ClientId: suite.Path.EndpointA.ClientID, + QueryId: res.Id, + Sender: sender, // A bit weird that query owner submits the results, but it doesn't really matter Result: &iqtypes.QueryResult{ KvResults: []*iqtypes.StorageValue{{ Key: resp.Key, diff --git a/x/interchainqueries/keeper/migrations.go b/x/interchainqueries/keeper/migrations.go new file mode 100644 index 000000000..01beba7f0 --- /dev/null +++ b/x/interchainqueries/keeper/migrations.go @@ -0,0 +1,25 @@ +package keeper + +import ( + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + v3 "github.com/neutron-org/neutron/v5/x/interchainqueries/migrations/v3" +) + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey +} + +// NewMigrator returns a new Migrator. +func NewMigrator(cdc codec.BinaryCodec, storeKey storetypes.StoreKey) Migrator { + return Migrator{storeKey: storeKey, cdc: cdc} +} + +// Migrate2to3 migrates from version 2 to 3. +func (m Migrator) Migrate2to3(ctx sdk.Context) error { + return v3.MigrateParams(ctx, m.cdc, m.storeKey) +} diff --git a/x/interchainqueries/keeper/msg_server.go b/x/interchainqueries/keeper/msg_server.go index 7a978fb3a..283b9d84e 100644 --- a/x/interchainqueries/keeper/msg_server.go +++ b/x/interchainqueries/keeper/msg_server.go @@ -18,7 +18,7 @@ import ( ibccommitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" ics23 "github.com/cosmos/ics23/go" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) var _ types.MsgServer = msgServer{} @@ -35,14 +35,14 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { func (m msgServer) RegisterInterchainQuery(goCtx context.Context, msg *types.MsgRegisterInterchainQueryRequest) (*types.MsgRegisterInterchainQueryResponse, error) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), LabelRegisterInterchainQuery) + ctx := sdk.UnwrapSDKContext(goCtx) + ctx.Logger().Debug("RegisterInterchainQuery", "msg", msg) + params := m.GetParams(ctx) - if err := msg.Validate(); err != nil { + if err := msg.Validate(params); err != nil { return nil, errors.Wrap(err, "failed to validate MsgRegisterInterchainQuery") } - ctx := sdk.UnwrapSDKContext(goCtx) - ctx.Logger().Debug("RegisterInterchainQuery", "msg", msg) - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { m.Logger(ctx).Debug("RegisterInterchainQuery: failed to parse sender address", "sender_address", msg.Sender) @@ -62,8 +62,6 @@ func (m msgServer) RegisterInterchainQuery(goCtx context.Context, msg *types.Msg lastID := m.GetLastRegisteredQueryKey(ctx) lastID++ - params := m.GetParams(ctx) - registeredQuery := &types.RegisteredQuery{ Id: lastID, Owner: msg.Sender, @@ -122,12 +120,13 @@ func (m msgServer) RemoveInterchainQuery(goCtx context.Context, msg *types.MsgRe } func (m msgServer) UpdateInterchainQuery(goCtx context.Context, msg *types.MsgUpdateInterchainQueryRequest) (*types.MsgUpdateInterchainQueryResponse, error) { - if err := msg.Validate(); err != nil { - return nil, errors.Wrap(err, "failed to validate MsgUpdateInterchainQueryRequest") - } - ctx := sdk.UnwrapSDKContext(goCtx) ctx.Logger().Debug("UpdateInterchainQuery", "msg", msg) + params := m.GetParams(ctx) + + if err := msg.Validate(params); err != nil { + return nil, errors.Wrap(err, "failed to validate MsgUpdateInterchainQueryRequest") + } query, err := m.GetQueryByID(ctx, msg.GetQueryId()) if err != nil { @@ -184,6 +183,11 @@ func (m msgServer) SubmitQueryResult(goCtx context.Context, msg *types.MsgSubmit return nil, errors.Wrapf(err, "failed to get query by id: %v", err) } + connection, ok := m.ibcKeeper.ConnectionKeeper.GetConnection(ctx, query.ConnectionId) + if !ok { + return nil, errors.Wrapf(types.ErrInvalidConnectionID, "registered query %d has invalid connection id: %s", query.Id, query.ConnectionId) + } + queryOwner, err := sdk.AccAddressFromBech32(query.Owner) if err != nil { ctx.Logger().Error("SubmitQueryResult: failed to decode AccAddressFromBech32", @@ -226,7 +230,7 @@ func (m msgServer) SubmitQueryResult(goCtx context.Context, msg *types.MsgSubmit return nil, errors.Wrapf(sdkerrors.ErrUnpackAny, "failed to cast interface exported.ConsensusState to type *tendermint.ConsensusState") } - clientState, err := m.GetClientState(ctx, msg.ClientId) + clientState, err := m.GetClientState(ctx, connection.ClientId) if err != nil { return nil, err } @@ -293,7 +297,7 @@ func (m msgServer) SubmitQueryResult(goCtx context.Context, msg *types.MsgSubmit return nil, errors.Wrapf(types.ErrInvalidType, "invalid query result for query type: %s", query.QueryType) } - if err := m.ProcessBlock(ctx, queryOwner, msg.QueryId, msg.ClientId, msg.Result.Block); err != nil { + if err := m.ProcessBlock(ctx, queryOwner, msg.QueryId, connection.ClientId, msg.Result.Block); err != nil { ctx.Logger().Debug("SubmitQueryResult: failed to ProcessBlock", "error", err, "query", query, "message", msg) return nil, errors.Wrapf(err, "failed to ProcessBlock: %v", err) diff --git a/x/interchainqueries/keeper/msg_server_test.go b/x/interchainqueries/keeper/msg_server_test.go index 6c9fa9159..dc464337c 100644 --- a/x/interchainqueries/keeper/msg_server_test.go +++ b/x/interchainqueries/keeper/msg_server_test.go @@ -8,10 +8,10 @@ import ( ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - testkeeper "github.com/neutron-org/neutron/v4/testutil/interchainqueries/keeper" - "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/testutil" + testkeeper "github.com/neutron-org/neutron/v5/testutil/interchainqueries/keeper" + "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func TestMsgRegisterInterchainQueryValidate(t *testing.T) { @@ -99,7 +99,7 @@ func TestMsgRegisterInterchainQueryValidate(t *testing.T) { "too many keys", types.MsgRegisterInterchainQueryRequest{ QueryType: string(types.InterchainQueryTypeKV), - Keys: make([]*types.KVKey, types.MaxKVQueryKeysCount+1), + Keys: make([]*types.KVKey, types.DefaultMaxKvQueryKeysCount+1), TransactionsFilter: "[]", ConnectionId: "connection-0", UpdatePeriod: 1, @@ -191,19 +191,17 @@ func TestMsgSubmitQueryResultValidate(t *testing.T) { { "empty result", types.MsgSubmitQueryResultRequest{ - QueryId: 1, - Sender: testutil.TestOwnerAddress, - ClientId: "client-id", - Result: nil, + QueryId: 1, + Sender: testutil.TestOwnerAddress, + Result: nil, }, types.ErrEmptyResult, }, { "empty kv results and block result", types.MsgSubmitQueryResultRequest{ - QueryId: 1, - Sender: testutil.TestOwnerAddress, - ClientId: "client-id", + QueryId: 1, + Sender: testutil.TestOwnerAddress, Result: &types.QueryResult{ KvResults: nil, Block: nil, @@ -216,9 +214,8 @@ func TestMsgSubmitQueryResultValidate(t *testing.T) { { "zero query id", types.MsgSubmitQueryResultRequest{ - QueryId: 0, - Sender: testutil.TestOwnerAddress, - ClientId: "client-id", + QueryId: 0, + Sender: testutil.TestOwnerAddress, Result: &types.QueryResult{ KvResults: []*types.StorageValue{{ Key: []byte{10}, @@ -242,9 +239,8 @@ func TestMsgSubmitQueryResultValidate(t *testing.T) { { "empty sender", types.MsgSubmitQueryResultRequest{ - QueryId: 1, - Sender: "", - ClientId: "client-id", + QueryId: 1, + Sender: "", Result: &types.QueryResult{ KvResults: []*types.StorageValue{{ Key: []byte{10}, @@ -268,9 +264,8 @@ func TestMsgSubmitQueryResultValidate(t *testing.T) { { "invalid sender", types.MsgSubmitQueryResultRequest{ - QueryId: 1, - Sender: "invalid_sender", - ClientId: "client-id", + QueryId: 1, + Sender: "invalid_sender", Result: &types.QueryResult{ KvResults: []*types.StorageValue{{ Key: []byte{10}, @@ -291,25 +286,6 @@ func TestMsgSubmitQueryResultValidate(t *testing.T) { }, sdkerrors.ErrInvalidAddress, }, - { - "empty client id", - types.MsgSubmitQueryResultRequest{ - QueryId: 1, - Sender: testutil.TestOwnerAddress, - ClientId: "", - Result: &types.QueryResult{ - KvResults: nil, - Block: &types.Block{ - NextBlockHeader: nil, - Header: nil, - Tx: nil, - }, - Height: 100, - Revision: 1, - }, - }, - types.ErrInvalidClientID, - }, } for _, tt := range tests { @@ -418,7 +394,7 @@ func TestMsgUpdateInterchainQueryRequestValidate(t *testing.T) { "too many keys", types.MsgUpdateInterchainQueryRequest{ QueryId: 1, - NewKeys: make([]*types.KVKey, types.MaxKVQueryKeysCount+1), + NewKeys: make([]*types.KVKey, types.DefaultMaxKvQueryKeysCount+1), NewUpdatePeriod: 0, Sender: testutil.TestOwnerAddress, }, diff --git a/x/interchainqueries/keeper/params.go b/x/interchainqueries/keeper/params.go index a9622d2ad..c955a9f4c 100644 --- a/x/interchainqueries/keeper/params.go +++ b/x/interchainqueries/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // GetParams get all parameters as types.Params diff --git a/x/interchainqueries/keeper/params_test.go b/x/interchainqueries/keeper/params_test.go index 37320eed8..e99112909 100644 --- a/x/interchainqueries/keeper/params_test.go +++ b/x/interchainqueries/keeper/params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/interchainqueries/keeper" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/interchainqueries/keeper" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func TestGetParams(t *testing.T) { diff --git a/x/interchainqueries/keeper/process_block_results.go b/x/interchainqueries/keeper/process_block_results.go index 566bf48df..a45bf6d7e 100644 --- a/x/interchainqueries/keeper/process_block_results.go +++ b/x/interchainqueries/keeper/process_block_results.go @@ -17,7 +17,7 @@ import ( "github.com/cosmos/ibc-go/v8/modules/core/exported" tendermintLightClientTypes "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // deterministicExecTxResult strips non-deterministic fields from diff --git a/x/interchainqueries/keeper/process_block_results_test.go b/x/interchainqueries/keeper/process_block_results_test.go index 1c218675f..fd9205b8a 100644 --- a/x/interchainqueries/keeper/process_block_results_test.go +++ b/x/interchainqueries/keeper/process_block_results_test.go @@ -10,8 +10,8 @@ import ( ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" "github.com/golang/mock/gomock" - icqtestkeeper "github.com/neutron-org/neutron/v4/testutil/interchainqueries/keeper" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/interchainqueries/types" + icqtestkeeper "github.com/neutron-org/neutron/v5/testutil/interchainqueries/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/interchainqueries/types" "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/cometbft/cometbft/crypto/tmhash" @@ -29,9 +29,9 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" clientkeeper "github.com/cosmos/ibc-go/v8/modules/core/02-client/keeper" - "github.com/neutron-org/neutron/v4/testutil" - iqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - iqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/testutil" + iqkeeper "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + iqtypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // CreateTMClientHeader creates a TM header to update the TM client. Args are passed in to allow diff --git a/x/interchainqueries/migrations/v3/migration.go b/x/interchainqueries/migrations/v3/migration.go new file mode 100644 index 000000000..4f04d83f9 --- /dev/null +++ b/x/interchainqueries/migrations/v3/migration.go @@ -0,0 +1,28 @@ +package v3 + +import ( + "fmt" + + store "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" +) + +func MigrateParams(ctx sdk.Context, cdc codec.BinaryCodec, storeKey store.StoreKey) error { + var params types.Params + st := ctx.KVStore(storeKey) + bz := st.Get(types.ParamsKey) + if bz == nil { + return fmt.Errorf("no params stored in %s", types.ParamsKey) + } + + cdc.MustUnmarshal(bz, ¶ms) + params.MaxTransactionsFilters = types.DefaultMaxTransactionsFilters + params.MaxKvQueryKeysCount = types.DefaultMaxKvQueryKeysCount + bz = cdc.MustMarshal(¶ms) + st.Set(types.ParamsKey, bz) + return nil +} diff --git a/x/interchainqueries/migrations/v3/migration_test.go b/x/interchainqueries/migrations/v3/migration_test.go new file mode 100644 index 000000000..48dbd558a --- /dev/null +++ b/x/interchainqueries/migrations/v3/migration_test.go @@ -0,0 +1,83 @@ +package v3_test + +import ( + "testing" + + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + "gopkg.in/yaml.v2" + + "github.com/neutron-org/neutron/v5/testutil" + v3 "github.com/neutron-org/neutron/v5/x/interchainqueries/migrations/v3" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" +) + +type V3ICQMigrationTestSuite struct { + testutil.IBCConnectionTestSuite +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(V3ICQMigrationTestSuite)) +} + +// ParamsV2 defines the parameters for the module v2. +type ParamsV2 struct { + // Defines amount of blocks required before query becomes available for + // removal by anybody + QuerySubmitTimeout uint64 `protobuf:"varint,1,opt,name=query_submit_timeout,json=querySubmitTimeout,proto3" json:"query_submit_timeout,omitempty"` + // Amount of coins deposited for the query. + QueryDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=query_deposit,json=queryDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"query_deposit"` + // Amount of tx hashes to be removed during a single EndBlock. Can vary to + // balance between network cleaning speed and EndBlock duration. A zero value + // means no limit. + TxQueryRemovalLimit uint64 `protobuf:"varint,3,opt,name=tx_query_removal_limit,json=txQueryRemovalLimit,proto3" json:"tx_query_removal_limit,omitempty"` +} + +func (p *ParamsV2) Reset() { *p = ParamsV2{} } +func (p *ParamsV2) ProtoMessage() {} + +// String implements the Stringer interface. +func (p ParamsV2) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} + +func (suite *V3ICQMigrationTestSuite) TestParamsMigration() { + var ( + app = suite.GetNeutronZoneApp(suite.ChainA) + storeKey = app.GetKey(types.StoreKey) + ctx = suite.ChainA.GetContext() + cdc = app.AppCodec() + ) + + // preinitialize v2 params + p := ParamsV2{ + QuerySubmitTimeout: types.DefaultQuerySubmitTimeout, + QueryDeposit: types.DefaultQueryDeposit, + TxQueryRemovalLimit: types.DefaultTxQueryRemovalLimit, + } + store := ctx.KVStore(storeKey) + bz, err := cdc.Marshal(&p) + suite.Require().NoError(err) + store.Set(types.ParamsKey, bz) + + paramsOld := app.InterchainQueriesKeeper.GetParams(ctx) + suite.Require().Equal(paramsOld.TxQueryRemovalLimit, p.TxQueryRemovalLimit) + suite.Require().Equal(paramsOld.QuerySubmitTimeout, p.QuerySubmitTimeout) + suite.Require().Equal(paramsOld.QueryDeposit, p.QueryDeposit) + suite.Require().Equal(paramsOld.MaxTransactionsFilters, uint64(0)) + suite.Require().Equal(paramsOld.MaxKvQueryKeysCount, uint64(0)) + + err = v3.MigrateParams(ctx, cdc, storeKey) + suite.Require().NoError(err) + + paramsNew := app.InterchainQueriesKeeper.GetParams(ctx) + params := types.Params{ + QuerySubmitTimeout: types.DefaultQuerySubmitTimeout, + QueryDeposit: types.DefaultQueryDeposit, + TxQueryRemovalLimit: types.DefaultTxQueryRemovalLimit, + MaxKvQueryKeysCount: types.DefaultMaxKvQueryKeysCount, + MaxTransactionsFilters: types.DefaultMaxTransactionsFilters, + } + suite.Require().Equal(params, paramsNew) +} diff --git a/x/interchainqueries/module.go b/x/interchainqueries/module.go index 4f9910975..b97573a14 100644 --- a/x/interchainqueries/module.go +++ b/x/interchainqueries/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" @@ -17,9 +19,9 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchainqueries/client/cli" - "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/client/cli" + "github.com/neutron-org/neutron/v5/x/interchainqueries/keeper" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) var ( @@ -103,6 +105,7 @@ var _ appmodule.AppModule = AppModule{} type AppModule struct { AppModuleBasic + storeKey storetypes.StoreKey keeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper @@ -110,12 +113,14 @@ type AppModule struct { func NewAppModule( cdc codec.Codec, + storeKey storetypes.StoreKey, keeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, ) AppModule { return AppModule{ AppModuleBasic: NewAppModuleBasic(cdc), + storeKey: storeKey, keeper: keeper, accountKeeper: accountKeeper, bankKeeper: bankKeeper, @@ -141,6 +146,12 @@ func (AppModule) QuerierRoute() string { return types.QuerierRoute } // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { + m := keeper.NewMigrator(am.cdc, am.storeKey) + + if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3); err != nil { + panic(fmt.Sprintf("failed to migrate x/interchainqueries from version 2 to 3: %v", err)) + } + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) } diff --git a/x/interchainqueries/module_simulation.go b/x/interchainqueries/module_simulation.go index 64d6877f6..a077a9073 100644 --- a/x/interchainqueries/module_simulation.go +++ b/x/interchainqueries/module_simulation.go @@ -7,9 +7,9 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/neutron-org/neutron/v4/testutil/common/sample" - interchainqueriessimulation "github.com/neutron-org/neutron/v4/x/interchainqueries/simulation" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/testutil/common/sample" + interchainqueriessimulation "github.com/neutron-org/neutron/v5/x/interchainqueries/simulation" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) // avoid unused import issue diff --git a/x/interchainqueries/types/constants.go b/x/interchainqueries/types/constants.go index 4c93fbeff..fef80f236 100644 --- a/x/interchainqueries/types/constants.go +++ b/x/interchainqueries/types/constants.go @@ -1,3 +1,3 @@ package types -const ConsensusVersion = 2 +const ConsensusVersion = 3 diff --git a/x/interchainqueries/types/genesis.go b/x/interchainqueries/types/genesis.go index c00668e58..29cc30ae1 100644 --- a/x/interchainqueries/types/genesis.go +++ b/x/interchainqueries/types/genesis.go @@ -34,14 +34,14 @@ func (gs GenesisState) Validate() error { switch val.QueryType { case string(InterchainQueryTypeTX): - if err := ValidateTransactionsFilter(val.TransactionsFilter); err != nil { + if err := ValidateTransactionsFilter(val.TransactionsFilter, gs.Params.MaxTransactionsFilters); err != nil { return errors.Wrap(ErrInvalidTransactionsFilter, err.Error()) } case string(InterchainQueryTypeKV): if len(val.Keys) == 0 { return errors.Wrap(ErrEmptyKeys, "keys cannot be empty") } - if err := validateKeys(val.GetKeys()); err != nil { + if err := validateKeys(val.GetKeys(), gs.Params.MaxKvQueryKeysCount); err != nil { return err } default: diff --git a/x/interchainqueries/types/genesis.pb.go b/x/interchainqueries/types/genesis.pb.go index b7c42cd50..de58e1e32 100644 --- a/x/interchainqueries/types/genesis.pb.go +++ b/x/interchainqueries/types/genesis.pb.go @@ -302,44 +302,44 @@ var fileDescriptor_ed312d37df0260a6 = []byte{ // 638 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xcd, 0x6e, 0xd3, 0x40, 0x10, 0x8e, 0xd3, 0xb4, 0x25, 0x9b, 0xb4, 0xc0, 0xd2, 0x83, 0x5b, 0x09, 0x27, 0xa4, 0x02, 0x22, - 0xa4, 0x7a, 0x9b, 0xd2, 0x1b, 0x07, 0x44, 0x91, 0xf8, 0x2b, 0x87, 0xe2, 0x16, 0x24, 0xb8, 0x58, - 0xfe, 0x19, 0x9c, 0x55, 0x93, 0x5d, 0xb3, 0xbb, 0x0e, 0xf8, 0x2d, 0x78, 0x8e, 0x3e, 0x49, 0x8f, - 0x3d, 0x72, 0x02, 0xd4, 0x3e, 0x07, 0x12, 0xf2, 0xd8, 0xa1, 0x05, 0xd2, 0x9e, 0x3c, 0xfe, 0xf6, - 0x9b, 0x6f, 0x67, 0x67, 0xbe, 0x21, 0xf7, 0x05, 0x64, 0x46, 0x49, 0xc1, 0xb8, 0x30, 0xa0, 0xa2, - 0x61, 0xc0, 0xc5, 0xa7, 0x0c, 0x14, 0x07, 0xcd, 0x12, 0x10, 0xa0, 0xb9, 0x76, 0x53, 0x25, 0x8d, - 0xa4, 0xab, 0x15, 0xd1, 0xfd, 0x8f, 0xb8, 0xe6, 0x44, 0x52, 0x8f, 0xa5, 0x66, 0x61, 0xa0, 0x81, - 0x4d, 0x06, 0x21, 0x98, 0x60, 0xc0, 0x22, 0xc9, 0x45, 0x99, 0xba, 0xb6, 0x92, 0xc8, 0x44, 0x62, - 0xc8, 0x8a, 0xa8, 0x42, 0x3b, 0x3c, 0x8c, 0x58, 0x24, 0x15, 0xb0, 0x68, 0xc4, 0x41, 0x18, 0x36, - 0x19, 0x54, 0x51, 0x45, 0xb8, 0x77, 0x79, 0x69, 0x69, 0xa0, 0x82, 0x71, 0x55, 0x59, 0xef, 0x57, - 0x83, 0x5c, 0xf7, 0x20, 0xe1, 0xda, 0x80, 0x82, 0xf8, 0x4d, 0x06, 0x2a, 0xa7, 0xcb, 0xa4, 0xce, - 0x63, 0xdb, 0xea, 0x5a, 0xfd, 0x86, 0x57, 0xe7, 0x31, 0x5d, 0x21, 0xf3, 0xf2, 0xb3, 0x00, 0x65, - 0xd7, 0xbb, 0x56, 0xbf, 0xe9, 0x95, 0x3f, 0xf4, 0x36, 0x21, 0x85, 0x62, 0xee, 0x9b, 0x3c, 0x05, - 0x7b, 0x0e, 0x8f, 0x9a, 0x88, 0x1c, 0xe4, 0x29, 0xd0, 0x6d, 0xd2, 0x38, 0x84, 0x5c, 0xdb, 0x8d, - 0xee, 0x5c, 0xbf, 0xb5, 0xd5, 0x75, 0x2f, 0xed, 0x80, 0xbb, 0xfb, 0x6e, 0x17, 0x72, 0x0f, 0xd9, - 0x94, 0x91, 0x5b, 0x46, 0x05, 0x42, 0x07, 0x91, 0xe1, 0x52, 0x68, 0xff, 0x23, 0x1f, 0x19, 0x50, - 0xf6, 0x3c, 0xaa, 0xd3, 0x8b, 0x47, 0xcf, 0xf0, 0x84, 0xae, 0x93, 0xa5, 0x48, 0x0a, 0x01, 0x08, - 0xfa, 0x3c, 0x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0x53, 0xa7, 0xf6, 0xed, 0xd4, 0xa9, 0x7d, 0x78, 0x74, 0x6e, 0x02, 0xd5, 0x15, 0x1b, 0x52, + 0x25, 0xd3, 0x98, 0x4d, 0x1e, 0xb2, 0x2f, 0x33, 0x36, 0x17, 0x47, 0x13, 0x2e, 0xe0, 0xe6, 0xde, + 0xff, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x23, 0xcf, 0xdc, 0x7e, 0x04, 0x00, 0x00, } func (m *RegisteredQuery) Marshal() (dAtA []byte, err error) { diff --git a/x/interchainqueries/types/genesis_test.go b/x/interchainqueries/types/genesis_test.go index a4e0956a4..0fdb5b122 100644 --- a/x/interchainqueries/types/genesis_test.go +++ b/x/interchainqueries/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/interchainqueries/types/params.go b/x/interchainqueries/types/params.go index ce52e3689..fa598c216 100644 --- a/x/interchainqueries/types/params.go +++ b/x/interchainqueries/types/params.go @@ -8,18 +8,20 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" ) var _ paramtypes.ParamSet = (*Params)(nil) var ( - KeyQuerySubmitTimeout = []byte("QuerySubmitTimeout") - DefaultQuerySubmitTimeout = uint64(1036800) // One month, with block_time = 2.5s - KeyQueryDeposit = []byte("QueryDeposit") - DefaultQueryDeposit = sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(int64(1_000_000)))) - KeyTxQueryRemovalLimit = []byte("TxQueryRemovalLimit") - DefaultTxQueryRemovalLimit = uint64(10_000) + KeyQuerySubmitTimeout = []byte("QuerySubmitTimeout") + DefaultQuerySubmitTimeout = uint64(1036800) // One month, with block_time = 2.5s + KeyQueryDeposit = []byte("QueryDeposit") + DefaultQueryDeposit = sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(int64(1_000_000)))) + KeyTxQueryRemovalLimit = []byte("TxQueryRemovalLimit") + DefaultTxQueryRemovalLimit = uint64(10_000) + DefaultMaxKvQueryKeysCount = uint64(32) + DefaultMaxTransactionsFilters = uint64(32) ) // ParamKeyTable the param key table for launch module @@ -32,17 +34,19 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(querySubmitTimeout uint64, queryDeposit sdk.Coins, txQueryRemovalLimit uint64) Params { +func NewParams(querySubmitTimeout uint64, queryDeposit sdk.Coins, txQueryRemovalLimit, maxKvQueryKeysCount, maxTransactionsFilters uint64) Params { return Params{ - QuerySubmitTimeout: querySubmitTimeout, - QueryDeposit: queryDeposit, - TxQueryRemovalLimit: txQueryRemovalLimit, + QuerySubmitTimeout: querySubmitTimeout, + QueryDeposit: queryDeposit, + TxQueryRemovalLimit: txQueryRemovalLimit, + MaxKvQueryKeysCount: maxKvQueryKeysCount, + MaxTransactionsFilters: maxTransactionsFilters, } } // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams(DefaultQuerySubmitTimeout, DefaultQueryDeposit, DefaultTxQueryRemovalLimit) + return NewParams(DefaultQuerySubmitTimeout, DefaultQueryDeposit, DefaultTxQueryRemovalLimit, DefaultMaxKvQueryKeysCount, DefaultMaxTransactionsFilters) } // ParamSetPairs get the params.ParamSet diff --git a/x/interchainqueries/types/params.pb.go b/x/interchainqueries/types/params.pb.go index 23d2d97a6..4c8a9a5cd 100644 --- a/x/interchainqueries/types/params.pb.go +++ b/x/interchainqueries/types/params.pb.go @@ -35,6 +35,10 @@ type Params struct { // Amount of tx hashes to be removed during a single EndBlock. Can vary to balance between // network cleaning speed and EndBlock duration. A zero value means no limit. TxQueryRemovalLimit uint64 `protobuf:"varint,3,opt,name=tx_query_removal_limit,json=txQueryRemovalLimit,proto3" json:"tx_query_removal_limit,omitempty"` + // Maximum amount of keys in a registered key value query + MaxKvQueryKeysCount uint64 `protobuf:"varint,4,opt,name=max_kv_query_keys_count,json=maxKvQueryKeysCount,proto3" json:"max_kv_query_keys_count,omitempty"` + // max_transactions_filters defines maximum allowed amount of tx filters in msgRegisterInterchainQuery + MaxTransactionsFilters uint64 `protobuf:"varint,5,opt,name=max_transactions_filters,json=maxTransactionsFilters,proto3" json:"max_transactions_filters,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -90,6 +94,20 @@ func (m *Params) GetTxQueryRemovalLimit() uint64 { return 0 } +func (m *Params) GetMaxKvQueryKeysCount() uint64 { + if m != nil { + return m.MaxKvQueryKeysCount + } + return 0 +} + +func (m *Params) GetMaxTransactionsFilters() uint64 { + if m != nil { + return m.MaxTransactionsFilters + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "neutron.interchainqueries.Params") } @@ -99,28 +117,32 @@ func init() { } var fileDescriptor_752a5f3346da64b1 = []byte{ - // 331 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xb1, 0x4e, 0xf3, 0x30, - 0x10, 0xc7, 0x93, 0xaf, 0x55, 0x87, 0x7c, 0xb0, 0x84, 0x0a, 0xb5, 0x1d, 0xdc, 0x8a, 0x01, 0x75, - 0xa9, 0xdd, 0x52, 0x26, 0xd8, 0x0a, 0x23, 0x03, 0x14, 0x58, 0x58, 0xa2, 0x24, 0xb5, 0x52, 0x8b, - 0x3a, 0x17, 0xec, 0x4b, 0xd5, 0xbe, 0x05, 0x23, 0x23, 0x33, 0x4f, 0xd2, 0xb1, 0x23, 0x13, 0xa0, - 0x76, 0xe0, 0x35, 0x50, 0xec, 0x20, 0x21, 0xc1, 0xe4, 0x93, 0x7f, 0x77, 0xfe, 0xff, 0x74, 0xf6, - 0x0e, 0x53, 0x9e, 0xa3, 0x82, 0x94, 0x89, 0x14, 0xb9, 0x8a, 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 0xd1, 0xed, 0x6a, 0x43, 0xdc, 0xf5, 0x86, 0xb8, 0x1f, 0x1b, 0xe2, 0x3e, 0x6e, 0x89, 0xb3, - 0xde, 0x12, 0xe7, 0x75, 0x4b, 0x9c, 0xbb, 0xd3, 0x1f, 0x32, 0xe5, 0x7e, 0x7b, 0xa0, 0x92, 0xef, - 0x9a, 0xcd, 0x8f, 0xd9, 0xe2, 0x8f, 0x8f, 0x31, 0x96, 0x51, 0xcd, 0xec, 0x71, 0xf8, 0x15, 0x00, - 0x00, 0xff, 0xff, 0xc7, 0x61, 0x00, 0x43, 0xc2, 0x01, 0x00, 0x00, + // 397 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xb1, 0xae, 0xd3, 0x30, + 0x14, 0x86, 0x93, 0x7b, 0xcb, 0x1d, 0x02, 0x2c, 0xe1, 0xea, 0x92, 0x76, 0x48, 0x2b, 0x06, 0xd4, + 0xa5, 0x71, 0x4b, 0x41, 0x42, 0xb0, 0xb5, 0x88, 0xa5, 0x0c, 0x50, 0xca, 0xc2, 0x12, 0x39, 0xa9, + 0x49, 0xad, 0xd6, 0x3e, 0xc1, 0x3e, 0x89, 0x92, 0xb7, 0x60, 0x64, 0x64, 0xe6, 0x49, 0x3a, 0x76, + 0x83, 0x09, 0x50, 0xfb, 0x22, 0x28, 0x76, 0x90, 0x2a, 0x71, 0xa7, 0x1c, 0xe5, 0xf3, 0x97, 0xff, + 0x4f, 0x4e, 0xbc, 0xc7, 0x92, 0x15, 0xa8, 0x40, 0x12, 0x2e, 0x91, 0xa9, 0x74, 0x43, 0xb9, 0xfc, + 0x5c, 0x30, 0xc5, 0x99, 0x26, 0x39, 0x55, 0x54, 0xe8, 0x28, 0x57, 0x80, 0xe0, 0x77, 0xdb, 0x73, + 0xd1, 0x7f, 0xe7, 0x7a, 0x61, 0x0a, 0x5a, 0x80, 0x26, 0x09, 0xd5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x68, 0x2c, 0x54, 0x54, 0x6a, 0x9a, 0x22, 0x07, 0xa9, 0xe3, 0x4f, 0x7c, 0x87, 0x4c, 0xe9, 0xe0, + 0x8e, 0xd1, 0x6e, 0x04, 0xad, 0x56, 0x67, 0xf8, 0xb5, 0xa5, 0x2f, 0x3a, 0x5f, 0xbf, 0xf5, 0x9d, + 0xd9, 0x87, 0xfd, 0x31, 0x74, 0x0f, 0xc7, 0xd0, 0xfd, 0x73, 0x0c, 0xdd, 0x2f, 0xa7, 0xd0, 0x39, + 0x9c, 0x42, 0xe7, 0xe7, 0x29, 0x74, 0x3e, 0xbe, 0x3c, 0x7b, 0xf9, 0x76, 0x9f, 0x23, 0x50, 0xd9, + 0xbf, 0x99, 0x94, 0xcf, 0x48, 0x75, 0xcb, 0x8f, 0x60, 0xbe, 0x4a, 0x72, 0x65, 0xf6, 0x36, 0xfd, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0x47, 0x2f, 0xed, 0x13, 0x32, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -143,6 +165,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MaxTransactionsFilters != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxTransactionsFilters)) + i-- + dAtA[i] = 0x28 + } + if m.MaxKvQueryKeysCount != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxKvQueryKeysCount)) + i-- + dAtA[i] = 0x20 + } if m.TxQueryRemovalLimit != 0 { i = encodeVarintParams(dAtA, i, uint64(m.TxQueryRemovalLimit)) i-- @@ -199,6 +231,12 @@ func (m *Params) Size() (n int) { if m.TxQueryRemovalLimit != 0 { n += 1 + sovParams(uint64(m.TxQueryRemovalLimit)) } + if m.MaxKvQueryKeysCount != 0 { + n += 1 + sovParams(uint64(m.MaxKvQueryKeysCount)) + } + if m.MaxTransactionsFilters != 0 { + n += 1 + sovParams(uint64(m.MaxTransactionsFilters)) + } return n } @@ -309,6 +347,44 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxKvQueryKeysCount", wireType) + } + m.MaxKvQueryKeysCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxKvQueryKeysCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTransactionsFilters", wireType) + } + m.MaxTransactionsFilters = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTransactionsFilters |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/interchainqueries/types/query.pb.go b/x/interchainqueries/types/query.pb.go index 0b40d656b..cb08fa6c6 100644 --- a/x/interchainqueries/types/query.pb.go +++ b/x/interchainqueries/types/query.pb.go @@ -545,7 +545,7 @@ var fileDescriptor_2254be23ba3ff3b4 = []byte{ // 732 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x41, 0x4f, 0x13, 0x41, 0x14, 0xee, 0x02, 0xae, 0x30, 0x68, 0x80, 0x91, 0x60, 0x59, 0x71, 0x85, 0x25, 0x42, 0xc1, 0x74, - 0x47, 0x0a, 0x2a, 0xc6, 0x44, 0x13, 0x4c, 0x54, 0x12, 0x0f, 0xb0, 0x06, 0x0f, 0x5c, 0x9a, 0x6d, + 0x47, 0x8a, 0x28, 0xc6, 0x44, 0x13, 0x4c, 0x54, 0x12, 0x0f, 0xb0, 0x06, 0x0f, 0x5c, 0x9a, 0x6d, 0x3b, 0xd9, 0x6e, 0x42, 0x67, 0xca, 0xce, 0x14, 0xd9, 0xab, 0xbf, 0xc0, 0xe8, 0x5f, 0x30, 0xf1, 0x27, 0x78, 0xf4, 0x4a, 0x3c, 0x91, 0x78, 0xf1, 0x64, 0x0c, 0xf8, 0x33, 0x3c, 0x98, 0x9d, 0x99, 0x2d, 0xb4, 0xdb, 0x76, 0x5b, 0x4f, 0x9d, 0x79, 0x7d, 0xdf, 0x7b, 0xdf, 0xfb, 0xde, 0x7b, 0x3b, @@ -569,16 +569,16 @@ var fileDescriptor_2254be23ba3ff3b4 = []byte{ 0x4f, 0x04, 0x5f, 0xb6, 0xd4, 0x32, 0x24, 0x6a, 0x59, 0x4e, 0xad, 0x45, 0xb2, 0x6b, 0x29, 0x66, 0x13, 0xdc, 0xea, 0x50, 0x4b, 0x18, 0x0b, 0x3e, 0x0b, 0x46, 0x45, 0xa0, 0x48, 0xd3, 0xa8, 0xab, 0x23, 0xce, 0x55, 0x71, 0xdf, 0xae, 0x58, 0x0d, 0x30, 0xd7, 0x19, 0xa9, 0x34, 0xd8, 0x03, 0x93, - 0x6d, 0x1a, 0x84, 0x6a, 0x30, 0x06, 0x50, 0xc0, 0x99, 0x68, 0xad, 0x3d, 0xb4, 0x36, 0xc0, 0x4d, - 0x71, 0x88, 0x93, 0x35, 0x0e, 0x78, 0x1f, 0x64, 0xf7, 0x41, 0x36, 0x89, 0x52, 0x44, 0x9f, 0x02, - 0x3d, 0x10, 0x16, 0x45, 0x6f, 0xa9, 0x07, 0xbd, 0xcb, 0x78, 0x85, 0xb2, 0x9e, 0x2b, 0x21, 0x5e, - 0xbb, 0x8c, 0x3b, 0xb8, 0x46, 0x39, 0x7e, 0x85, 0x7d, 0xaf, 0xda, 0xa4, 0x95, 0x18, 0x4e, 0x2d, - 0x39, 0x9c, 0xd6, 0x1b, 0x35, 0xfa, 0xc9, 0x20, 0x8a, 0xe5, 0x0c, 0xd0, 0xab, 0xc2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0x2a, 0xfc, 0xa8, 0x01, 0x5d, 0xee, 0x1c, 0xcc, 0xa7, 0x95, 0xd7, 0xb2, + 0xec, 0x86, 0xdd, 0xaf, 0xbb, 0xe4, 0x69, 0xad, 0xbc, 0xff, 0xf1, 0xe7, 0xd3, 0xd0, 0x22, 0x5c, + 0x40, 0x69, 0xdf, 0x21, 0xf8, 0x4d, 0x03, 0x53, 0x89, 0x1d, 0x82, 0x9b, 0xe9, 0xf2, 0x77, 0xfe, + 0x3a, 0x18, 0x8f, 0xff, 0x03, 0xa9, 0x58, 0x6f, 0x08, 0xd6, 0x08, 0xe6, 0x7b, 0xb0, 0x4e, 0x6e, 0x34, 0xfc, 0xaa, 0x81, 0x89, 0xb6, 0x89, 0x85, 0x0f, 0x07, 0x63, 0x11, 0xaf, 0x9a, 0xf1, 0x68, 0x60, 0x9c, 0xe2, 0xbe, 0x2e, 0xb8, 0xe7, 0xe1, 0xbd, 0xfe, 0xb9, 0x87, 0xf0, 0x8b, 0x06, 0xc6, 0x2f, 0x0d, 0x33, 0x2c, 0xa4, 0x65, 0x4f, 0xee, 0x9b, 0xb1, 0x3e, 0x10, 0x46, 0xb1, 0x45, 0x82, @@ -588,7 +588,7 @@ var fileDescriptor_2254be23ba3ff3b4 = []byte{ 0xef, 0x33, 0x53, 0xfb, 0x70, 0x6e, 0x66, 0x4e, 0xcf, 0xcd, 0xcc, 0xcf, 0x73, 0x33, 0xb3, 0xff, 0xc4, 0xf3, 0x79, 0xb5, 0x51, 0xb2, 0xcb, 0xb4, 0x16, 0x47, 0xcb, 0xd3, 0xc0, 0x6b, 0x46, 0x3e, 0xda, 0x40, 0xc7, 0x9d, 0xde, 0xe5, 0xb0, 0x8e, 0x59, 0x49, 0x17, 0x6f, 0xf3, 0xfa, 0xbf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x40, 0x9d, 0x80, 0xce, 0xb4, 0x08, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x88, 0x8a, 0x1e, 0x01, 0xb4, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchainqueries/types/tx.go b/x/interchainqueries/types/tx.go index 2eaa771fc..c9429ab2d 100644 --- a/x/interchainqueries/types/tx.go +++ b/x/interchainqueries/types/tx.go @@ -11,10 +11,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -const ( - MaxKVQueryKeysCount = 32 -) - var ( _ sdk.Msg = &MsgSubmitQueryResultRequest{} _ codectypes.UnpackInterfacesMessage = MsgSubmitQueryResultRequest{} @@ -49,10 +45,6 @@ func (msg MsgSubmitQueryResultRequest) Validate() error { return errors.Wrapf(sdkerrors.ErrInvalidAddress, "failed to parse address: %s", msg.Sender) } - if strings.TrimSpace(msg.ClientId) == "" { - return errors.Wrap(ErrInvalidClientID, "client id cannot be empty") - } - return nil } @@ -90,7 +82,7 @@ func (msg MsgRegisterInterchainQueryRequest) Type() string { return "register-interchain-query" } -func (msg MsgRegisterInterchainQueryRequest) Validate() error { +func (msg MsgRegisterInterchainQueryRequest) Validate(params Params) error { if msg.UpdatePeriod == 0 { return errors.Wrap(ErrInvalidUpdatePeriod, "update period can not be equal to zero") } @@ -115,13 +107,13 @@ func (msg MsgRegisterInterchainQueryRequest) Validate() error { if len(msg.Keys) == 0 { return errors.Wrap(ErrEmptyKeys, "keys cannot be empty") } - if err := validateKeys(msg.GetKeys()); err != nil { + if err := validateKeys(msg.GetKeys(), params.MaxKvQueryKeysCount); err != nil { return err } } if InterchainQueryType(msg.QueryType).IsTX() { - if err := ValidateTransactionsFilter(msg.TransactionsFilter); err != nil { + if err := ValidateTransactionsFilter(msg.TransactionsFilter, params.MaxTransactionsFilters); err != nil { return errors.Wrap(ErrInvalidTransactionsFilter, err.Error()) } } @@ -144,7 +136,7 @@ func (msg MsgRegisterInterchainQueryRequest) GetSigners() []sdk.AccAddress { var _ sdk.Msg = &MsgUpdateInterchainQueryRequest{} -func (msg MsgUpdateInterchainQueryRequest) Validate() error { +func (msg MsgUpdateInterchainQueryRequest) Validate(params Params) error { if msg.GetQueryId() == 0 { return errors.Wrap(ErrInvalidQueryID, "query_id cannot be empty or equal to 0") } @@ -167,13 +159,13 @@ func (msg MsgUpdateInterchainQueryRequest) Validate() error { } if len(newKeys) != 0 { - if err := validateKeys(newKeys); err != nil { + if err := validateKeys(newKeys, params.MaxKvQueryKeysCount); err != nil { return err } } if newTxFilter != "" { - if err := ValidateTransactionsFilter(newTxFilter); err != nil { + if err := ValidateTransactionsFilter(newTxFilter, params.MaxTransactionsFilters); err != nil { return errors.Wrap(ErrInvalidTransactionsFilter, err.Error()) } } @@ -230,9 +222,9 @@ func (msg *MsgUpdateParamsRequest) Validate() error { return nil } -func validateKeys(keys []*KVKey) error { - if uint64(len(keys)) > MaxKVQueryKeysCount { - return errors.Wrapf(ErrTooManyKVQueryKeys, "keys count cannot be more than %d", MaxKVQueryKeysCount) +func validateKeys(keys []*KVKey, maxKVQueryKeysCount uint64) error { + if uint64(len(keys)) > maxKVQueryKeysCount { + return errors.Wrapf(ErrTooManyKVQueryKeys, "keys count cannot be more than %d", maxKVQueryKeysCount) } duplicates := make(map[string]struct{}) diff --git a/x/interchainqueries/types/tx.pb.go b/x/interchainqueries/types/tx.pb.go index 255a24f47..4390f6227 100644 --- a/x/interchainqueries/types/tx.pb.go +++ b/x/interchainqueries/types/tx.pb.go @@ -183,7 +183,8 @@ type MsgSubmitQueryResultRequest struct { Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` // The IBC client ID that corresponds to the IBC connection to the remote chain (where the // query result is coming from). - ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // Deprecated: populating this field does not make any affect + ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // Deprecated: Do not use. // The result of the Interchain Query execution. Result *QueryResult `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"` } @@ -235,6 +236,7 @@ func (m *MsgSubmitQueryResultRequest) GetSender() string { return "" } +// Deprecated: Do not use. func (m *MsgSubmitQueryResultRequest) GetClientId() string { if m != nil { return m.ClientId @@ -921,81 +923,81 @@ func init() { } var fileDescriptor_d4793837a316491e = []byte{ - // 1175 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x4f, 0x1b, 0xc7, - 0x17, 0x67, 0x8d, 0x4d, 0xf0, 0xe0, 0x90, 0x64, 0xbe, 0x24, 0x18, 0xf3, 0x8d, 0x43, 0xb6, 0x6a, - 0x82, 0x50, 0xb2, 0x2b, 0x5c, 0x44, 0x55, 0xe8, 0x2f, 0x68, 0x1b, 0x15, 0x21, 0x54, 0xba, 0x40, - 0x0e, 0xbd, 0xac, 0xd6, 0xbb, 0xc3, 0x7a, 0xe4, 0xf5, 0x8c, 0xb3, 0x33, 0xeb, 0x1f, 0xb7, 0x2a, - 0xea, 0xa9, 0x27, 0x4e, 0x55, 0xff, 0x84, 0x4a, 0xbd, 0x70, 0xe8, 0xa9, 0x7f, 0x41, 0x2a, 0xf5, - 0x10, 0xf5, 0xd4, 0x43, 0x55, 0x55, 0x70, 0xe0, 0xd8, 0x7f, 0xa1, 0x9a, 0x1f, 0x6b, 0x4c, 0xc1, - 0x76, 0xc9, 0x25, 0xd9, 0x37, 0xef, 0xf3, 0xde, 0x7c, 0xe6, 0x33, 0xef, 0xbd, 0x31, 0xc0, 0x24, - 0x28, 0xe1, 0x31, 0x25, 0x36, 0x26, 0x1c, 0xc5, 0x7e, 0xcd, 0xc3, 0xe4, 0x45, 0x82, 0x62, 0x8c, - 0x98, 0xcd, 0x3b, 0x56, 0x33, 0xa6, 0x9c, 0xc2, 0x39, 0x8d, 0xb1, 0x2e, 0x61, 0x4a, 0x77, 0xbc, - 0x06, 0x26, 0xd4, 0x96, 0xff, 0x2a, 0x74, 0x69, 0xd6, 0xa7, 0xac, 0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, 0x3d, 0xf0, 0x2d, 0x70, 0xd3, 0xa7, 0x84, 0x20, 0xb9, 0xe8, 0xe2, 0xa0, 0x98, 0x95, 0xd0, - 0xc2, 0xf9, 0xe2, 0x56, 0x20, 0x40, 0x49, 0x33, 0xf0, 0x38, 0x72, 0x9b, 0x28, 0xc6, 0x34, 0x28, - 0xe6, 0x16, 0x8c, 0xc5, 0xac, 0x53, 0x50, 0x8b, 0xbb, 0x72, 0x0d, 0xde, 0x03, 0x13, 0x4c, 0xca, - 0x52, 0x9c, 0x90, 0x29, 0xb4, 0xb5, 0x36, 0xf5, 0xf2, 0xec, 0x78, 0x49, 0x1b, 0xe6, 0x0a, 0x30, - 0x87, 0x29, 0xc3, 0x9a, 0x94, 0x30, 0x04, 0xa7, 0x41, 0x06, 0x07, 0x52, 0x92, 0xac, 0x93, 0xc1, - 0x81, 0xf9, 0xb3, 0x01, 0xe6, 0x77, 0x58, 0xb8, 0x97, 0x54, 0x1b, 0x98, 0xa7, 0xd0, 0x24, 0xe2, - 0xa9, 0x94, 0x73, 0x60, 0x52, 0x49, 0xd9, 0x8b, 0xba, 0x21, 0xed, 0xad, 0x7e, 0x56, 0x99, 0x7e, - 0x56, 0x70, 0x1e, 0xe4, 0xfd, 0x08, 0x23, 0xc2, 0x45, 0x8c, 0x92, 0x67, 0x52, 0x2d, 0x6c, 0x05, - 0xf0, 0x43, 0x30, 0x11, 0xcb, 0x0d, 0xa4, 0x1a, 0x53, 0x95, 0x47, 0x43, 0xd4, 0xef, 0xa7, 0xa3, - 0xa3, 0x2e, 0x1e, 0xf9, 0x6f, 0x03, 0x4c, 0xf5, 0x81, 0xe0, 0x33, 0x00, 0xea, 0x2d, 0x57, 0x21, - 0x59, 0xd1, 0x90, 0xd7, 0xfb, 0x78, 0xc8, 0x06, 0x7b, 0x9c, 0xc6, 0x5e, 0x88, 0x9e, 0x7b, 0x51, - 0x82, 0x9c, 0x7c, 0xbd, 0xa5, 0xd2, 0x30, 0xb8, 0x0a, 0x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0x32, 0x1e, 0x45, 0x69, - 0x58, 0xff, 0x8f, 0xa2, 0x34, 0xb4, 0x6f, 0x60, 0x02, 0x0a, 0xfd, 0x55, 0x06, 0x97, 0xff, 0x4b, - 0xb2, 0x0b, 0xfd, 0x55, 0xaa, 0x5c, 0x27, 0x44, 0x6d, 0x5b, 0xca, 0x7d, 0x2d, 0x9a, 0x64, 0xf3, - 0xe0, 0xd5, 0x49, 0xd9, 0x78, 0x7d, 0x52, 0x36, 0xfe, 0x3a, 0x29, 0x1b, 0x47, 0xa7, 0xe5, 0xb1, - 0xd7, 0xa7, 0xe5, 0xb1, 0xdf, 0x4f, 0xcb, 0x63, 0x5f, 0xad, 0x87, 0x98, 0xd7, 0x92, 0xaa, 0xe5, - 0xd3, 0x86, 0xad, 0xd3, 0x3f, 0xa5, 0x71, 0x98, 0x7e, 0xdb, 0xad, 0x15, 0xbb, 0x73, 0xd5, 0xdf, - 0x07, 0xe2, 0x17, 0x72, 0x75, 0x42, 0xbe, 0x82, 0xef, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0xea, - 0x29, 0x2e, 0x6b, 0x49, 0x0c, 0x00, 0x00, + // 1178 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcd, 0x4f, 0x1b, 0x47, + 0x14, 0x67, 0x8d, 0x4d, 0xf0, 0xe0, 0x90, 0x64, 0x4a, 0x82, 0x71, 0x1a, 0x87, 0x6c, 0xd5, 0x04, + 0xa1, 0x64, 0x57, 0xb8, 0x94, 0xaa, 0xd0, 0x2f, 0x68, 0x1b, 0x15, 0x21, 0x54, 0xba, 0x40, 0x0e, + 0xbd, 0xac, 0xd6, 0xbb, 0xc3, 0x7a, 0xe4, 0xf5, 0x8c, 0xb3, 0x33, 0xeb, 0x8f, 0x5b, 0x15, 0xf5, + 0xd4, 0x13, 0xa7, 0xaa, 0x7f, 0x42, 0xa5, 0x5e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9, 0x3b, + 0xe9, 0xab, 0x04, 0xc5, 0x5d, 0x07, 0x3d, 0x4f, 0x10, 0xe3, 0xf0, 0x1e, 0x00, 0xe2, 0xe4, 0xae, + 0x2b, 0x22, 0x17, 0x8d, 0x79, 0x63, 0x21, 0xef, 0xe4, 0xa5, 0x66, 0xaf, 0xdb, 0x44, 0x70, 0x19, + 0x64, 0xeb, 0xa8, 0xcb, 0x8a, 0x99, 0xf9, 0xf1, 0x85, 0xa9, 0xca, 0xbc, 0x35, 0xb0, 0xe6, 0xd6, + 0xd6, 0xb3, 0x2d, 0xd4, 0x75, 0x24, 0x1a, 0xda, 0xe0, 0x0d, 0x1e, 0x7b, 0x84, 0x79, 0x3e, 0xc7, + 0x94, 0x30, 0xf7, 0x00, 0x47, 0x1c, 0xc5, 0xc5, 0x71, 0x19, 0x1d, 0xf6, 0x9b, 0x9e, 0x4a, 0x0b, + 0x7c, 0x0b, 0x5c, 0xf7, 0x29, 0x21, 0x48, 0x2a, 0x5d, 0x1c, 0x14, 0xb3, 0x12, 0x5a, 0x38, 0x53, + 0x6e, 0x06, 0x02, 0x94, 0x34, 0x03, 0x8f, 0x23, 0xb7, 0x89, 0x62, 0x4c, 0x83, 0x62, 0x6e, 0xde, + 0x58, 0xc8, 0x3a, 0x05, 0xa5, 0xdc, 0x91, 0x3a, 0x78, 0x07, 0x4c, 0x30, 0x59, 0x96, 0xe2, 0x84, + 0x0c, 0xa1, 0xa5, 0xd5, 0xa9, 0x17, 0xa7, 0x47, 0x8b, 0x5a, 0x30, 0x97, 0x81, 0x39, 0xac, 0x32, + 0xac, 0x49, 0x09, 0x43, 0x70, 0x1a, 0x64, 0x70, 0x20, 0x4b, 0x92, 0x75, 0x32, 0x38, 0x30, 0x7f, + 0x31, 0xc0, 0xdd, 0x6d, 0x16, 0xee, 0x26, 0xd5, 0x06, 0xe6, 0x29, 0x34, 0x89, 0x78, 0x5a, 0xca, + 0x39, 0x30, 0xa9, 0x4a, 0xd9, 0xf3, 0xba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x06, 0x00, 0x00, + 0xff, 0xff, 0xe3, 0x2e, 0x2e, 0xb3, 0x4d, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchainqueries/types/tx_test.go b/x/interchainqueries/types/tx_test.go index 2ee4a063c..393abd6a0 100644 --- a/x/interchainqueries/types/tx_test.go +++ b/x/interchainqueries/types/tx_test.go @@ -8,7 +8,7 @@ import ( ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" "github.com/stretchr/testify/require" - iqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" + iqtypes "github.com/neutron-org/neutron/v5/x/interchainqueries/types" ) const TestAddress = "cosmos10h9stc5v6ntgeygf5xf945njqq5h32r53uquvw" diff --git a/x/interchainqueries/types/types.go b/x/interchainqueries/types/types.go index dafa661f3..be94cc357 100644 --- a/x/interchainqueries/types/types.go +++ b/x/interchainqueries/types/types.go @@ -43,9 +43,6 @@ const ( // AttributeValueQueryRemoved represents the value for the 'action' event attribute. AttributeValueQueryRemoved = "query_removed" - - // maxTransactionsFilters defines maximum allowed amount of tx filters in msgRegisterInterchainQuery - maxTransactionsFilters = 32 ) const ( @@ -107,13 +104,13 @@ type TransactionsFilterItem struct { } // ValidateTransactionsFilter checks if the passed string is a valid TransactionsFilter value. -func ValidateTransactionsFilter(s string) error { +func ValidateTransactionsFilter(s string, maxTransactionsFilters uint64) error { const forbiddenCharacters = "\t\n\r\\()\"'=><" filters := TransactionsFilter{} if err := json.Unmarshal([]byte(s), &filters); err != nil { return fmt.Errorf("failed to unmarshal transactions filter: %w", err) } - if len(filters) > maxTransactionsFilters { + if uint64(len(filters)) > maxTransactionsFilters { return fmt.Errorf("too many transactions filters, provided=%d, max=%d", len(filters), maxTransactionsFilters) } diff --git a/x/interchainqueries/types/types_test.go b/x/interchainqueries/types/types_test.go index 202c8c531..f062a310e 100644 --- a/x/interchainqueries/types/types_test.go +++ b/x/interchainqueries/types/types_test.go @@ -10,37 +10,37 @@ import ( func TestTransactionFilterValidation(t *testing.T) { t.Run("Valid", func(t *testing.T) { // several conditions - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"},{"field":"tx.height","op":"Gte","value":100}]`)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"},{"field":"tx.height","op":"Gte","value":100}]`, DefaultMaxTransactionsFilters)) // all supported operations with a whole operand - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Eq","value":1000}]`)) - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gt","value":1000}]`)) - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gte","value":1000}]`)) - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Lt","value":1000}]`)) - assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Lte","value":1000}]`)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Eq","value":1000}]`, DefaultMaxTransactionsFilters)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gt","value":1000}]`, DefaultMaxTransactionsFilters)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gte","value":1000}]`, DefaultMaxTransactionsFilters)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Lt","value":1000}]`, DefaultMaxTransactionsFilters)) + assert.NoError(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Lte","value":1000}]`, DefaultMaxTransactionsFilters)) }) t.Run("Invalid", func(t *testing.T) { // invalid json - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"Eq","value":`), "unexpected end of JSON input") + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"Eq","value":`, DefaultMaxTransactionsFilters), "unexpected end of JSON input") // empty operation - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), "op '' is expected to be one of: eq, gt, gte, lt, lte") + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.recipient","op":"","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), "op '' is expected to be one of: eq, gt, gte, lt, lte") // empty field - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), "field couldn't be empty") + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), "field couldn't be empty") // field with forbidden symbols const specialSymbolsAreNotAllowed = "special symbols \t\n\r\\()\"'=>< are not allowed" - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\t","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\n","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\r","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\\","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.(","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.)","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\"","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.'","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.=","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.>","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.<","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\t","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\n","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\r","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\\","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.(","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.)","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.\"","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.'","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.=","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.>","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"transfer.<","op":"Eq","value":"neutron1mjk79fjjgpplak5wq838w0yd982gzkyf8fxu8u"}]`, DefaultMaxTransactionsFilters), specialSymbolsAreNotAllowed) // decimal number - assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gte","value":15.5}]`), "can't be a decimal number") - assert.ErrorContains(t, ValidateTransactionsFilter(lotsOfTxFilters(t, 40)), "too many transactions filters") + assert.ErrorContains(t, ValidateTransactionsFilter(`[{"field":"tx.height","op":"Gte","value":15.5}]`, DefaultMaxTransactionsFilters), "can't be a decimal number") + assert.ErrorContains(t, ValidateTransactionsFilter(lotsOfTxFilters(t, 40), DefaultMaxTransactionsFilters), "too many transactions filters") }) } diff --git a/x/interchaintxs/client/cli/query.go b/x/interchaintxs/client/cli/query.go index 7ebb89948..7cd1100d4 100644 --- a/x/interchaintxs/client/cli/query.go +++ b/x/interchaintxs/client/cli/query.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/interchaintxs/client/cli/query_interchainaccounts.go b/x/interchaintxs/client/cli/query_interchainaccounts.go index 784a4ada2..a32a7d445 100644 --- a/x/interchaintxs/client/cli/query_interchainaccounts.go +++ b/x/interchaintxs/client/cli/query_interchainaccounts.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func CmdInterchainAccountCmd() *cobra.Command { diff --git a/x/interchaintxs/client/cli/query_params.go b/x/interchaintxs/client/cli/query_params.go index 206605fca..c6123d9aa 100644 --- a/x/interchaintxs/client/cli/query_params.go +++ b/x/interchaintxs/client/cli/query_params.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/interchaintxs/client/cli/tx.go b/x/interchaintxs/client/cli/tx.go index 26a914656..512f9d617 100644 --- a/x/interchaintxs/client/cli/tx.go +++ b/x/interchaintxs/client/cli/tx.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) // GetTxCmd returns the transaction commands for this module diff --git a/x/interchaintxs/genesis.go b/x/interchaintxs/genesis.go index 63cf86198..33483f6c9 100644 --- a/x/interchaintxs/genesis.go +++ b/x/interchaintxs/genesis.go @@ -3,8 +3,8 @@ package interchaintxs import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/interchaintxs/genesis_test.go b/x/interchaintxs/genesis_test.go index d50e01491..6759b0931 100644 --- a/x/interchaintxs/genesis_test.go +++ b/x/interchaintxs/genesis_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil/common/nullify" - keepertest "github.com/neutron-org/neutron/v4/testutil/interchaintxs/keeper" - "github.com/neutron-org/neutron/v4/x/interchaintxs" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/testutil/common/nullify" + keepertest "github.com/neutron-org/neutron/v5/testutil/interchaintxs/keeper" + "github.com/neutron-org/neutron/v5/x/interchaintxs" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func TestGenesis(t *testing.T) { diff --git a/x/interchaintxs/ibc_module.go b/x/interchaintxs/ibc_module.go index 85183f032..77043a795 100644 --- a/x/interchaintxs/ibc_module.go +++ b/x/interchaintxs/ibc_module.go @@ -9,7 +9,7 @@ import ( porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" - "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" + "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" ) var _ porttypes.IBCModule = IBCModule{} diff --git a/x/interchaintxs/keeper/grpc_query.go b/x/interchaintxs/keeper/grpc_query.go index 1e0373538..925847d29 100644 --- a/x/interchaintxs/keeper/grpc_query.go +++ b/x/interchaintxs/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/interchaintxs/keeper/grpc_query_interchainaccount.go b/x/interchaintxs/keeper/grpc_query_interchainaccount.go index d564636cc..94489e7c7 100644 --- a/x/interchaintxs/keeper/grpc_query_interchainaccount.go +++ b/x/interchaintxs/keeper/grpc_query_interchainaccount.go @@ -9,7 +9,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func (k Keeper) InterchainAccountAddress(c context.Context, req *types.QueryInterchainAccountAddressRequest) (*types.QueryInterchainAccountAddressResponse, error) { diff --git a/x/interchaintxs/keeper/grpc_query_interchainaccount_test.go b/x/interchaintxs/keeper/grpc_query_interchainaccount_test.go index 327e20573..4550a9afc 100644 --- a/x/interchaintxs/keeper/grpc_query_interchainaccount_test.go +++ b/x/interchaintxs/keeper/grpc_query_interchainaccount_test.go @@ -9,10 +9,10 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - testkeeper "github.com/neutron-org/neutron/v4/testutil/interchaintxs/keeper" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/interchaintxs/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/testutil" + testkeeper "github.com/neutron-org/neutron/v5/testutil/interchaintxs/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func TestKeeper_InterchainAccountAddress(t *testing.T) { diff --git a/x/interchaintxs/keeper/grpc_query_params.go b/x/interchaintxs/keeper/grpc_query_params.go index fb917e8f9..4119d0b92 100644 --- a/x/interchaintxs/keeper/grpc_query_params.go +++ b/x/interchaintxs/keeper/grpc_query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/interchaintxs/keeper/grpc_query_params_test.go b/x/interchaintxs/keeper/grpc_query_params_test.go index 89770d771..0d75ff1db 100644 --- a/x/interchaintxs/keeper/grpc_query_params_test.go +++ b/x/interchaintxs/keeper/grpc_query_params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/interchaintxs/keeper" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/interchaintxs/keeper" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/interchaintxs/keeper/ibc_handlers.go b/x/interchaintxs/keeper/ibc_handlers.go index 93097350c..bdceebf64 100644 --- a/x/interchaintxs/keeper/ibc_handlers.go +++ b/x/interchaintxs/keeper/ibc_handlers.go @@ -3,7 +3,7 @@ package keeper import ( "time" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" "cosmossdk.io/errors" @@ -12,9 +12,9 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - contractmanagertypes "github.com/neutron-org/neutron/v4/x/contractmanager/types" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + contractmanagertypes "github.com/neutron-org/neutron/v5/x/contractmanager/types" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) // HandleAcknowledgement passes the acknowledgement data to the appropriate contract via a sudo call. diff --git a/x/interchaintxs/keeper/ibc_handlers_test.go b/x/interchaintxs/keeper/ibc_handlers_test.go index 313e25391..df8faca3d 100644 --- a/x/interchaintxs/keeper/ibc_handlers_test.go +++ b/x/interchaintxs/keeper/ibc_handlers_test.go @@ -6,7 +6,7 @@ import ( types2 "cosmossdk.io/store/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" sdk "github.com/cosmos/cosmos-sdk/types" icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" @@ -14,11 +14,11 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - testkeeper "github.com/neutron-org/neutron/v4/testutil/interchaintxs/keeper" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/interchaintxs/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/types" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/testutil" + testkeeper "github.com/neutron-org/neutron/v5/testutil/interchaintxs/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/types" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) const ICAId = ".ica0" diff --git a/x/interchaintxs/keeper/keeper.go b/x/interchaintxs/keeper/keeper.go index 4f609c96a..5a29a82b1 100644 --- a/x/interchaintxs/keeper/keeper.go +++ b/x/interchaintxs/keeper/keeper.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) const ( diff --git a/x/interchaintxs/keeper/msg_server.go b/x/interchaintxs/keeper/msg_server.go index ed1dcc9ed..9cf0af3f3 100644 --- a/x/interchaintxs/keeper/msg_server.go +++ b/x/interchaintxs/keeper/msg_server.go @@ -16,8 +16,8 @@ import ( icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + ictxtypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) type msgServer struct { @@ -66,7 +66,8 @@ func (k Keeper) RegisterInterchainAccount(goCtx context.Context, msg *ictxtypes. Owner: icaOwner, ConnectionId: msg.ConnectionId, Version: "", // FIXME: empty version string doesn't look good - Ordering: channeltypes.ORDERED, + // underlying controller uses ORDER_ORDERED as default in case msg's ordering is NONE // TODO: check now + Ordering: msg.Ordering, }) if err != nil { k.Logger(ctx).Debug("RegisterInterchainAccount: failed to RegisterInterchainAccount:", "error", err, "owner", icaOwner, "msg", &msg) diff --git a/x/interchaintxs/keeper/msg_server_test.go b/x/interchaintxs/keeper/msg_server_test.go index afd182224..61feca1a0 100644 --- a/x/interchaintxs/keeper/msg_server_test.go +++ b/x/interchaintxs/keeper/msg_server_test.go @@ -5,17 +5,18 @@ import ( "testing" "time" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + "cosmossdk.io/math" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - feerefundertypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" + feerefundertypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -24,14 +25,18 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/neutron-org/neutron/v4/testutil" - testkeeper "github.com/neutron-org/neutron/v4/testutil/interchaintxs/keeper" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/interchaintxs/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/testutil" + testkeeper "github.com/neutron-org/neutron/v5/testutil/interchaintxs/keeper" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) const TestFeeCollectorAddr = "neutron1dua3d89szsmd3vwg0y5a2689ah0g4x68ps8vew" +const channelID = "channel-0" + +var portID = "icacontroller-" + testutil.TestOwnerAddress + ICAId + func TestMsgRegisterInterchainAccountValidate(t *testing.T) { icak, ctx := testkeeper.InterchainTxsKeeper(t, nil, nil, nil, nil, nil, nil, func(_ sdk.Context) string { return TestFeeCollectorAddr @@ -114,6 +119,7 @@ func TestRegisterInterchainAccount(t *testing.T) { FromAddress: testutil.TestOwnerAddress, ConnectionId: "connection-0", InterchainAccountId: "ica0", + Ordering: channeltypes.ORDERED, } contractAddress := sdk.MustAccAddressFromBech32(msgRegAcc.FromAddress) icaOwner := types.NewICAOwnerFromAddress(contractAddress, msgRegAcc.InterchainAccountId) @@ -155,8 +161,61 @@ func TestRegisterInterchainAccount(t *testing.T) { require.ErrorContains(t, err, "failed to charge fees to pay for RegisterInterchainAccount msg") require.Nil(t, resp) - channelID := "channel-0" - portID := "icacontroller-" + testutil.TestOwnerAddress + ICAId + wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(true) + wmKeeper.EXPECT().GetContractInfo(ctx, contractAddress).Return(&wasmtypes.ContractInfo{CodeID: 1}) + bankKeeper.EXPECT().SendCoins(ctx, sdk.MustAccAddressFromBech32(msgRegAcc.FromAddress), sdk.MustAccAddressFromBech32(TestFeeCollectorAddr), msgRegAcc.RegisterFee) + icaMsgServer.EXPECT().RegisterInterchainAccount(ctx, msgRegICA).Return(&icacontrollertypes.MsgRegisterInterchainAccountResponse{ + ChannelId: channelID, + PortId: portID, + }, nil) + icaKeeper.EXPECT().SetMiddlewareEnabled(ctx, portID, msgRegAcc.ConnectionId) + resp, err = icak.RegisterInterchainAccount(ctx, &msgRegAcc) + require.NoError(t, err) + require.Equal(t, types.MsgRegisterInterchainAccountResponse{ + ChannelId: channelID, + PortId: portID, + }, *resp) +} + +func TestRegisterInterchainAccountUnordered(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + icaKeeper := mock_types.NewMockICAControllerKeeper(ctrl) + icaMsgServer := mock_types.NewMockICAControllerMsgServer(ctrl) + wmKeeper := mock_types.NewMockWasmKeeper(ctrl) + bankKeeper := mock_types.NewMockBankKeeper(ctrl) + icak, ctx := testkeeper.InterchainTxsKeeper(t, wmKeeper, nil, icaKeeper, icaMsgServer, nil, bankKeeper, func(_ sdk.Context) string { + return TestFeeCollectorAddr + }) + + msgRegAcc := types.MsgRegisterInterchainAccount{ + FromAddress: testutil.TestOwnerAddress, + ConnectionId: "connection-0", + InterchainAccountId: "ica0", + Ordering: channeltypes.UNORDERED, // return unordered + } + contractAddress := sdk.MustAccAddressFromBech32(msgRegAcc.FromAddress) + icaOwner := types.NewICAOwnerFromAddress(contractAddress, msgRegAcc.InterchainAccountId) + + wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(false) + resp, err := icak.RegisterInterchainAccount(ctx, &msgRegAcc) + require.ErrorContains(t, err, "is not a contract address") + require.Nil(t, resp) + + wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(true) + wmKeeper.EXPECT().GetContractInfo(ctx, contractAddress).Return(&wasmtypes.ContractInfo{CodeID: 1}) + resp, err = icak.RegisterInterchainAccount(ctx, &msgRegAcc) + require.ErrorContains(t, err, "failed to charge fees to pay for RegisterInterchainAccount msg") + require.Nil(t, resp) + + msgRegAcc.RegisterFee = sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000))) + + msgRegICA := &icacontrollertypes.MsgRegisterInterchainAccount{ + Owner: icaOwner.String(), + ConnectionId: msgRegAcc.ConnectionId, + Version: "", + Ordering: channeltypes.UNORDERED, + } wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(true) wmKeeper.EXPECT().GetContractInfo(ctx, contractAddress).Return(&wasmtypes.ContractInfo{CodeID: 1}) @@ -439,7 +498,6 @@ func TestSubmitTx(t *testing.T) { require.ErrorContains(t, err, "MsgSubmitTx contains more messages than allowed") submitMsg.Msgs = []*codectypes.Any{&cosmosMsg} - portID := "icacontroller-" + testutil.TestOwnerAddress + ICAId wmKeeper.EXPECT().HasContractInfo(ctx, contractAddress).Return(true) icaKeeper.EXPECT().GetActiveChannelID(ctx, "connection-0", portID).Return("", false) resp, err = icak.SubmitTx(ctx, &submitMsg) diff --git a/x/interchaintxs/keeper/params.go b/x/interchaintxs/keeper/params.go index dbbb8f6d6..abef57d10 100644 --- a/x/interchaintxs/keeper/params.go +++ b/x/interchaintxs/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) // GetParams get all parameters as types.Params diff --git a/x/interchaintxs/keeper/params_test.go b/x/interchaintxs/keeper/params_test.go index 06ac97d6c..7ddf78c0d 100644 --- a/x/interchaintxs/keeper/params_test.go +++ b/x/interchaintxs/keeper/params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - testkeeper "github.com/neutron-org/neutron/v4/testutil/interchaintxs/keeper" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/interchaintxs/keeper" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func TestGetParams(t *testing.T) { diff --git a/x/interchaintxs/module.go b/x/interchaintxs/module.go index 847b16cf1..07529147c 100644 --- a/x/interchaintxs/module.go +++ b/x/interchaintxs/module.go @@ -17,9 +17,9 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "github.com/neutron-org/neutron/v4/x/interchaintxs/client/cli" - "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/client/cli" + "github.com/neutron-org/neutron/v5/x/interchaintxs/keeper" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) var ( diff --git a/x/interchaintxs/module_simulation.go b/x/interchaintxs/module_simulation.go index 945b32c88..92cc103c8 100644 --- a/x/interchaintxs/module_simulation.go +++ b/x/interchaintxs/module_simulation.go @@ -7,8 +7,8 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - interchaintxssimulation "github.com/neutron-org/neutron/v4/x/interchaintxs/simulation" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + interchaintxssimulation "github.com/neutron-org/neutron/v5/x/interchaintxs/simulation" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) // avoid unused import issue diff --git a/x/interchaintxs/types/expected_keepers.go b/x/interchaintxs/types/expected_keepers.go index 6df8596aa..718b5c992 100644 --- a/x/interchaintxs/types/expected_keepers.go +++ b/x/interchaintxs/types/expected_keepers.go @@ -9,7 +9,7 @@ import ( channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" - feerefundertypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" + feerefundertypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) diff --git a/x/interchaintxs/types/genesis.pb.go b/x/interchaintxs/types/genesis.pb.go index 25770ae3c..56141516e 100644 --- a/x/interchaintxs/types/genesis.pb.go +++ b/x/interchaintxs/types/genesis.pb.go @@ -89,8 +89,8 @@ var fileDescriptor_d16558b72a810826 = []byte{ 0x0a, 0x3c, 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, 0xf3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, 0x99, 0xba, 0xf9, 0x45, 0xe9, 0x30, 0xb6, - 0x7e, 0x99, 0x89, 0x7e, 0x05, 0x9a, 0x63, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x2e, - 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x02, 0x5d, 0x4b, 0x80, 0x2a, 0x01, 0x00, 0x00, + 0x7e, 0x99, 0xa9, 0x7e, 0x05, 0x9a, 0x63, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x2e, + 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xb5, 0xac, 0x8e, 0x2a, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/interchaintxs/types/genesis_test.go b/x/interchaintxs/types/genesis_test.go index 7bab45336..ae0e0bd7b 100644 --- a/x/interchaintxs/types/genesis_test.go +++ b/x/interchaintxs/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/interchaintxs/types/params.go b/x/interchaintxs/types/params.go index 35fea139d..445a0b0d0 100644 --- a/x/interchaintxs/types/params.go +++ b/x/interchaintxs/types/params.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/neutron-org/neutron/v4/app/params" + "github.com/neutron-org/neutron/v5/app/params" "gopkg.in/yaml.v2" ) diff --git a/x/interchaintxs/types/params.pb.go b/x/interchaintxs/types/params.pb.go index e2f86cfc9..e3d2cd984 100644 --- a/x/interchaintxs/types/params.pb.go +++ b/x/interchaintxs/types/params.pb.go @@ -90,7 +90,7 @@ var fileDescriptor_52b0ced89d3fa9c6 = []byte{ // 291 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x31, 0x4b, 0x03, 0x41, 0x10, 0x85, 0x6f, 0x35, 0xa4, 0xb8, 0x58, 0x05, 0x91, 0x98, 0x62, 0x13, 0x04, 0x21, 0x8d, 0xbb, - 0x9c, 0x0a, 0x42, 0xca, 0x08, 0x76, 0x01, 0x8d, 0x56, 0x36, 0xc7, 0xde, 0x31, 0x6e, 0xb6, 0xd8, + 0x9c, 0x22, 0x42, 0xca, 0x08, 0x76, 0x01, 0x8d, 0x56, 0x36, 0xc7, 0xde, 0x31, 0x6e, 0xb6, 0xd8, 0xdd, 0xb0, 0xb3, 0x39, 0xd6, 0x3f, 0x21, 0x96, 0x96, 0xfe, 0x9c, 0x94, 0x29, 0xad, 0x44, 0xee, 0xfe, 0x88, 0xe4, 0xee, 0x52, 0x68, 0xf7, 0x98, 0x79, 0x8f, 0xf9, 0xe6, 0xc5, 0xe7, 0x06, 0xd6, 0xde, 0x59, 0xc3, 0x95, 0xf1, 0xe0, 0xf2, 0xa5, 0x50, 0xc6, 0x07, 0xe4, 0x45, 0xc2, 0x57, 0xc2, @@ -105,7 +105,7 @@ var fileDescriptor_52b0ced89d3fa9c6 = []byte{ 0xe3, 0x73, 0x14, 0xcd, 0x1e, 0x36, 0x25, 0x25, 0xdb, 0x92, 0x92, 0x9f, 0x92, 0x92, 0xf7, 0x8a, 0x46, 0xdb, 0x8a, 0x46, 0x5f, 0x15, 0x8d, 0x9e, 0x6f, 0xa4, 0xf2, 0xcb, 0x75, 0xc6, 0x72, 0xab, 0x79, 0xdb, 0xc2, 0x85, 0x75, 0x72, 0xaf, 0x79, 0x71, 0xcd, 0xc3, 0xbf, 0xf6, 0xfc, 0xeb, 0x0a, - 0x30, 0xeb, 0xd6, 0xaf, 0x5e, 0xfd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x40, 0x55, 0x79, 0xd9, 0x63, + 0x30, 0xeb, 0xd6, 0xaf, 0x5e, 0xfd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x91, 0xbd, 0x9e, 0xd7, 0x63, 0x01, 0x00, 0x00, } diff --git a/x/interchaintxs/types/query.pb.go b/x/interchaintxs/types/query.pb.go index 5f71e842b..5e35adaa5 100644 --- a/x/interchaintxs/types/query.pb.go +++ b/x/interchaintxs/types/query.pb.go @@ -219,7 +219,7 @@ var fileDescriptor_6130c5f6c54e2428 = []byte{ // 483 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xcf, 0x6a, 0x13, 0x41, 0x18, 0xdf, 0x4d, 0x35, 0xe8, 0xa8, 0x97, 0x69, 0x85, 0x65, 0xd1, 0x4d, 0x59, 0x1b, 0x10, 0xb1, - 0x3b, 0x24, 0x0a, 0x82, 0x48, 0xa5, 0xbd, 0xe5, 0x66, 0x03, 0x5e, 0xbc, 0x84, 0xc9, 0xee, 0xb0, + 0x3b, 0x24, 0x22, 0x82, 0x48, 0xa5, 0xbd, 0xe5, 0x66, 0x03, 0x5e, 0xbc, 0x84, 0xc9, 0xee, 0xb0, 0x1d, 0x34, 0xf3, 0x6d, 0x76, 0x66, 0x63, 0x4b, 0xc8, 0xc5, 0x93, 0x07, 0x11, 0xc1, 0x17, 0xe8, 0xcd, 0x9b, 0xcf, 0xd1, 0x63, 0xc1, 0x8b, 0x27, 0x91, 0xc4, 0x83, 0x8f, 0x21, 0x3b, 0x33, 0x6d, 0xd9, 0x9a, 0x25, 0xe2, 0x6d, 0xf8, 0xf6, 0xf7, 0xef, 0xfb, 0xb3, 0x68, 0x4b, 0xb0, 0x42, 0xe5, @@ -246,7 +246,7 @@ var fileDescriptor_6130c5f6c54e2428 = []byte{ 0x9f, 0xcc, 0x03, 0xf7, 0x74, 0x1e, 0xb8, 0x3f, 0xe7, 0x81, 0xfb, 0x69, 0x11, 0x38, 0xa7, 0x8b, 0xc0, 0xf9, 0xbe, 0x08, 0x9c, 0x57, 0x4f, 0x52, 0xae, 0x0e, 0x8a, 0x61, 0x14, 0xc3, 0xe8, 0x2c, 0xce, 0x36, 0xe4, 0xe9, 0x79, 0xb4, 0xc9, 0x63, 0x72, 0x78, 0x29, 0x9f, 0x3a, 0xca, 0x98, 0x1c, - 0x36, 0xf5, 0x8f, 0xf8, 0xe8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, 0x40, 0xec, 0x47, 0x51, + 0x36, 0xf5, 0x8f, 0xf8, 0xe8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xa8, 0x0b, 0x49, 0x51, 0x04, 0x00, 0x00, } diff --git a/x/interchaintxs/types/tx.go b/x/interchaintxs/types/tx.go index 26f31e4b3..f416cc46f 100644 --- a/x/interchaintxs/types/tx.go +++ b/x/interchaintxs/types/tx.go @@ -18,8 +18,6 @@ const interchainAccountIDLimit = 128 - len("neutron1unyuj8qnmygvzuex3dwmg9yzt9alhvyeat0uu0jedg2wj33efl5qmysp02") - // just a random contract address len(".") -var _ codectypes.UnpackInterfacesMessage = &MsgSubmitTx{} - func (msg *MsgRegisterInterchainAccount) Validate() error { if len(msg.ConnectionId) == 0 { return ErrEmptyConnectionID @@ -119,17 +117,6 @@ func PackTxMsgAny(sdkMsg sdk.Msg) (*codectypes.Any, error) { return value, nil } -// implements UnpackInterfacesMessage.UnpackInterfaces (https://github.com/cosmos/cosmos-sdk/blob/d07d35f29e0a0824b489c552753e8798710ff5a8/codec/types/interface_registry.go#L60) -func (msg *MsgSubmitTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { - var sdkMsg sdk.Msg - for _, m := range msg.Msgs { - if err := unpacker.UnpackAny(m, &sdkMsg); err != nil { - return err - } - } - return nil -} - //---------------------------------------------------------------- var _ sdk.Msg = &MsgUpdateParams{} diff --git a/x/interchaintxs/types/tx.pb.go b/x/interchaintxs/types/tx.pb.go index 8b7fb7755..65c1ee010 100644 --- a/x/interchaintxs/types/tx.pb.go +++ b/x/interchaintxs/types/tx.pb.go @@ -7,7 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" + types2 "github.com/cosmos/cosmos-sdk/codec/types" 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" @@ -15,7 +15,8 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - types2 "github.com/neutron-org/neutron/v4/x/feerefunder/types" + types1 "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + types3 "github.com/neutron-org/neutron/v5/x/feerefunder/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -42,6 +43,7 @@ type MsgRegisterInterchainAccount struct { ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` InterchainAccountId string `protobuf:"bytes,3,opt,name=interchain_account_id,json=interchainAccountId,proto3" json:"interchain_account_id,omitempty" yaml:"interchain_account_id"` RegisterFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=register_fee,json=registerFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"register_fee"` + Ordering types1.Order `protobuf:"varint,5,opt,name=ordering,proto3,enum=ibc.core.channel.v1.Order" json:"ordering,omitempty"` } func (m *MsgRegisterInterchainAccount) Reset() { *m = MsgRegisterInterchainAccount{} } @@ -126,11 +128,11 @@ type MsgSubmitTx struct { // claim our capability for. InterchainAccountId string `protobuf:"bytes,2,opt,name=interchain_account_id,json=interchainAccountId,proto3" json:"interchain_account_id,omitempty"` ConnectionId string `protobuf:"bytes,3,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - Msgs []*types1.Any `protobuf:"bytes,4,rep,name=msgs,proto3" json:"msgs,omitempty"` + Msgs []*types2.Any `protobuf:"bytes,4,rep,name=msgs,proto3" json:"msgs,omitempty"` Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` // timeout in seconds after which the packet times out Timeout uint64 `protobuf:"varint,6,opt,name=timeout,proto3" json:"timeout,omitempty"` - Fee types2.Fee `protobuf:"bytes,7,opt,name=fee,proto3" json:"fee"` + Fee types3.Fee `protobuf:"bytes,7,opt,name=fee,proto3" json:"fee"` } func (m *MsgSubmitTx) Reset() { *m = MsgSubmitTx{} } @@ -332,60 +334,63 @@ func init() { func init() { proto.RegisterFile("neutron/interchaintxs/v1/tx.proto", fileDescriptor_50f087790e59c806) } var fileDescriptor_50f087790e59c806 = []byte{ - // 839 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xbf, 0x6f, 0xfb, 0x44, - 0x14, 0x8f, 0x93, 0x7c, 0x53, 0x72, 0x09, 0x42, 0xb8, 0xa9, 0xea, 0x44, 0x6d, 0x92, 0x1a, 0x2a, - 0x85, 0x4a, 0xb1, 0x9b, 0x80, 0x8a, 0x14, 0x09, 0xa4, 0xa6, 0x52, 0xa5, 0x0c, 0x91, 0x8a, 0x5b, - 0x16, 0x96, 0xe8, 0x62, 0x5f, 0x1c, 0x8b, 0xf8, 0xce, 0xf8, 0xce, 0x51, 0xb2, 0x21, 0x26, 0xc4, - 0xc4, 0xc2, 0xde, 0x11, 0x31, 0xa0, 0x0e, 0xfc, 0x01, 0x8c, 0x1d, 0x2b, 0x26, 0xa6, 0x02, 0xed, - 0x50, 0xe6, 0x0e, 0xcc, 0xe8, 0xec, 0x73, 0x7e, 0xa9, 0x89, 0xaa, 0xef, 0x92, 0xdc, 0x7b, 0xef, - 0x73, 0xef, 0xbd, 0xfb, 0x7c, 0xee, 0x9d, 0xc1, 0x01, 0x46, 0x01, 0xf3, 0x09, 0xd6, 0x1d, 0xcc, - 0x90, 0x6f, 0x0e, 0xa1, 0x83, 0xd9, 0x84, 0xea, 0xe3, 0x86, 0xce, 0x26, 0x9a, 0xe7, 0x13, 0x46, - 0x64, 0x45, 0x40, 0xb4, 0x25, 0x88, 0x36, 0x6e, 0x94, 0xde, 0x87, 0xae, 0x83, 0x89, 0x1e, 0xfe, - 0x46, 0xe0, 0x52, 0xd9, 0x24, 0xd4, 0x25, 0x54, 0xef, 0x43, 0x8a, 0xf4, 0x71, 0xa3, 0x8f, 0x18, - 0x6c, 0xe8, 0x26, 0x71, 0xb0, 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x6d, 0xf9, 0x27, 0x09, 0x14, 0xd7, 0xbf, - 0x17, 0x27, 0xeb, 0xfb, 0xdc, 0x34, 0x04, 0xa5, 0xcf, 0xdf, 0x6e, 0x5f, 0xdc, 0x9d, 0x9a, 0x90, - 0xfb, 0xe0, 0x9d, 0xd9, 0xe5, 0x3f, 0xdc, 0x98, 0x2d, 0x86, 0x95, 0xea, 0xaf, 0x82, 0x2d, 0xd4, - 0x18, 0x81, 0xfc, 0x92, 0xba, 0x1f, 0x6d, 0x4c, 0xb0, 0x08, 0x2d, 0x35, 0x5e, 0x0d, 0x8d, 0xeb, - 0x95, 0xde, 0x7c, 0xcb, 0xd5, 0x6c, 0x7f, 0x71, 0xfb, 0x50, 0x96, 0xee, 0x1e, 0xca, 0xd2, 0xdf, - 0x0f, 0x65, 0xe9, 0xc7, 0xc7, 0x72, 0xe2, 0xee, 0xb1, 0x9c, 0xf8, 0xf3, 0xb1, 0x9c, 0xf8, 0xea, - 0xd3, 0x85, 0xb7, 0x4a, 0x64, 0xaf, 0x13, 0xdf, 0x8e, 0xd7, 0xfa, 0xf8, 0x13, 0x7d, 0xb2, 0xf2, - 0x01, 0x08, 0x1f, 0xb0, 0x7e, 0x26, 0x1c, 0xc5, 0x8f, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xd9, - 0x95, 0xf0, 0x9e, 0x4f, 0x07, 0x00, 0x00, + // 891 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x31, 0x6f, 0x23, 0x45, + 0x14, 0xf6, 0xc6, 0xbe, 0xe4, 0x3c, 0x0e, 0x20, 0xf6, 0x72, 0xca, 0xda, 0x4a, 0x6c, 0x67, 0xe1, + 0x24, 0x13, 0x29, 0xb3, 0xb1, 0x11, 0x41, 0x8a, 0x04, 0x52, 0x7c, 0xd2, 0x49, 0x2e, 0x22, 0x8e, + 0xbd, 0xa3, 0xa1, 0xb1, 0x66, 0x77, 0xc7, 0xeb, 0x11, 0xd9, 0x19, 0x33, 0x33, 0x6b, 0xc5, 0x1d, + 0xa2, 0x42, 0x54, 0x34, 0x14, 0x74, 0x57, 0x22, 0x0a, 0x94, 0x82, 0x1f, 0x40, 0x79, 0xe5, 0x89, + 0x8a, 0x2a, 0xa0, 0xa4, 0x08, 0xf5, 0x15, 0xd4, 0x68, 0x76, 0x67, 0x1c, 0xdb, 0x3a, 0x5b, 0x11, + 0x8d, 0x3d, 0xef, 0xbd, 0x6f, 0xde, 0x7b, 0xf3, 0xbe, 0xf7, 0xde, 0x82, 0x3d, 0x8a, 0x53, 0xc9, + 0x19, 0xf5, 0x08, 0x95, 0x98, 0x87, 0x43, 0x44, 0xa8, 0x3c, 0x17, 0xde, 0xb8, 0xed, 0xc9, 0x73, + 0x38, 0xe2, 0x4c, 0x32, 0xdb, 0xd1, 0x10, 0x38, 0x07, 0x81, 0xe3, 0x76, 0xed, 0x5d, 0x94, 0x10, + 0xca, 0xbc, 0xec, 0x37, 0x07, 0xd7, 0xea, 0x21, 0x13, 0x09, 0x13, 0x5e, 0x80, 0x04, 0xf6, 0xc6, + 0xed, 0x00, 0x4b, 0xd4, 0xf6, 0x42, 0x46, 0xa8, 0xb6, 0x6f, 0x6b, 0x7b, 0x22, 0x62, 0x15, 0x24, + 0x11, 0xb1, 0x36, 0x54, 0x73, 0x43, 0x3f, 0x93, 0xbc, 0x5c, 0xd0, 0xa6, 0xad, 0x98, 0xc5, 0x2c, + 0xd7, 0xab, 0x93, 0xd6, 0xee, 0xc4, 0x8c, 0xc5, 0x67, 0xd8, 0x43, 0x23, 0xe2, 0x21, 0x4a, 0x99, + 0x44, 0x92, 0x30, 0x6a, 0xee, 0x3c, 0x9c, 0xb1, 0x0e, 0xa5, 0x1c, 0x99, 0x28, 0x5a, 0x9d, 0x49, + 0x41, 0x3a, 0xf0, 0x10, 0x9d, 0x68, 0xd3, 0x1e, 0x09, 0x42, 0x2f, 0x64, 0x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xff, 0xee, 0x99, + 0xec, 0xdc, 0x82, 0x1d, 0x80, 0xfb, 0xd3, 0xe6, 0x7f, 0xb4, 0xd2, 0x9b, 0x81, 0xd5, 0x0e, 0xee, + 0x04, 0x9b, 0x89, 0x71, 0x06, 0x36, 0xe7, 0xd8, 0xfd, 0x60, 0xa5, 0x83, 0x59, 0x68, 0xad, 0x7d, + 0x67, 0xa8, 0x89, 0x57, 0xbb, 0xf7, 0x8d, 0x62, 0xb3, 0xfb, 0xf9, 0xcb, 0xab, 0xba, 0xf5, 0xea, + 0xaa, 0x6e, 0xfd, 0x7d, 0x55, 0xb7, 0x7e, 0xb8, 0xae, 0x17, 0x5e, 0x5d, 0xd7, 0x0b, 0x7f, 0x5e, + 0xd7, 0x0b, 0x5f, 0x7e, 0x3c, 0xb3, 0xe3, 0xb4, 0xf7, 0x03, 0xc6, 0x63, 0x73, 0xf6, 0xc6, 0x1f, + 0x79, 0xe7, 0x0b, 0x1f, 0x8e, 0x6c, 0xf1, 0x05, 0xeb, 0xd9, 0x28, 0x7e, 0xf8, 0x5f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x0b, 0xc4, 0x84, 0xb7, 0xaa, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -560,6 +565,11 @@ func (m *MsgRegisterInterchainAccount) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if m.Ordering != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Ordering)) + i-- + dAtA[i] = 0x28 + } if len(m.RegisterFee) > 0 { for iNdEx := len(m.RegisterFee) - 1; iNdEx >= 0; iNdEx-- { { @@ -848,6 +858,9 @@ func (m *MsgRegisterInterchainAccount) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } + if m.Ordering != 0 { + n += 1 + sovTx(uint64(m.Ordering)) + } return n } @@ -1109,6 +1122,25 @@ func (m *MsgRegisterInterchainAccount) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ordering", wireType) + } + m.Ordering = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ordering |= types1.Order(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1398,7 +1430,7 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Msgs = append(m.Msgs, &types1.Any{}) + m.Msgs = append(m.Msgs, &types2.Any{}) if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/interchaintxs/types/tx_test.go b/x/interchaintxs/types/tx_test.go index 79bbc2905..f0fe46dd0 100644 --- a/x/interchaintxs/types/tx_test.go +++ b/x/interchaintxs/types/tx_test.go @@ -7,7 +7,7 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) const TestAddress = "neutron1m9l358xunhhwds0568za49mzhvuxx9ux8xafx2" diff --git a/x/interchaintxs/types/types_test.go b/x/interchaintxs/types/types_test.go index db7876c3b..d49fb1f5f 100644 --- a/x/interchaintxs/types/types_test.go +++ b/x/interchaintxs/types/types_test.go @@ -3,11 +3,11 @@ package types_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) const ( diff --git a/x/tokenfactory/client/cli/query.go b/x/tokenfactory/client/cli/query.go index 5b62e060a..d423ba3ea 100644 --- a/x/tokenfactory/client/cli/query.go +++ b/x/tokenfactory/client/cli/query.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/tokenfactory/client/cli/tx.go b/x/tokenfactory/client/cli/tx.go index 90117ccc5..96a3c2747 100644 --- a/x/tokenfactory/client/cli/tx.go +++ b/x/tokenfactory/client/cli/tx.go @@ -14,7 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) // GetTxCmd returns the transaction commands for this module diff --git a/x/tokenfactory/keeper/admins.go b/x/tokenfactory/keeper/admins.go index b57cc3b6d..237c5032a 100644 --- a/x/tokenfactory/keeper/admins.go +++ b/x/tokenfactory/keeper/admins.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) // GetAuthorityMetadata returns the authority metadata for a specific denom diff --git a/x/tokenfactory/keeper/admins_test.go b/x/tokenfactory/keeper/admins_test.go index a44606575..708ec1156 100644 --- a/x/tokenfactory/keeper/admins_test.go +++ b/x/tokenfactory/keeper/admins_test.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func (suite *KeeperTestSuite) TestAdminMsgs() { diff --git a/x/tokenfactory/keeper/bankactions.go b/x/tokenfactory/keeper/bankactions.go index 5e7b650f9..ed2f7d565 100644 --- a/x/tokenfactory/keeper/bankactions.go +++ b/x/tokenfactory/keeper/bankactions.go @@ -5,7 +5,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func (k Keeper) mintTo(ctx sdk.Context, amount sdk.Coin, mintTo string) error { diff --git a/x/tokenfactory/keeper/before_send.go b/x/tokenfactory/keeper/before_send.go index 40e81ba8b..ff8c5b41e 100644 --- a/x/tokenfactory/keeper/before_send.go +++ b/x/tokenfactory/keeper/before_send.go @@ -7,7 +7,7 @@ import ( types2 "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" errorsmod "cosmossdk.io/errors" wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" diff --git a/x/tokenfactory/keeper/before_send_test.go b/x/tokenfactory/keeper/before_send_test.go index cd1def71d..3ffd7a0f4 100644 --- a/x/tokenfactory/keeper/before_send_test.go +++ b/x/tokenfactory/keeper/before_send_test.go @@ -8,7 +8,7 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func (suite *KeeperTestSuite) initBalanceTrackContract(denom string) (sdk.AccAddress, uint64, string) { diff --git a/x/tokenfactory/keeper/createdenom.go b/x/tokenfactory/keeper/createdenom.go index 35979f9f4..18bb3c617 100644 --- a/x/tokenfactory/keeper/createdenom.go +++ b/x/tokenfactory/keeper/createdenom.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) // ConvertToBaseToken converts a fee amount in a whitelisted fee token to the base fee token amount diff --git a/x/tokenfactory/keeper/createdenom_test.go b/x/tokenfactory/keeper/createdenom_test.go index 38fcd1360..91e786bb9 100644 --- a/x/tokenfactory/keeper/createdenom_test.go +++ b/x/tokenfactory/keeper/createdenom_test.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func (suite *KeeperTestSuite) TestMsgCreateDenom() { diff --git a/x/tokenfactory/keeper/genesis.go b/x/tokenfactory/keeper/genesis.go index f013f6ac0..e203f9c5f 100644 --- a/x/tokenfactory/keeper/genesis.go +++ b/x/tokenfactory/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) // InitGenesis initializes the tokenfactory module's state from a provided genesis diff --git a/x/tokenfactory/keeper/genesis_test.go b/x/tokenfactory/keeper/genesis_test.go index e059b848f..d96e70b09 100644 --- a/x/tokenfactory/keeper/genesis_test.go +++ b/x/tokenfactory/keeper/genesis_test.go @@ -3,7 +3,7 @@ package keeper_test import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func (suite *KeeperTestSuite) TestGenesis() { diff --git a/x/tokenfactory/keeper/grpc_query.go b/x/tokenfactory/keeper/grpc_query.go index b3999f363..0c6827d8e 100644 --- a/x/tokenfactory/keeper/grpc_query.go +++ b/x/tokenfactory/keeper/grpc_query.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) var _ types.QueryServer = Keeper{} @@ -44,3 +44,16 @@ func (k Keeper) BeforeSendHookAddress(ctx context.Context, req *types.QueryBefor return &types.QueryBeforeSendHookAddressResponse{ContractAddr: contractAddr}, nil } + +func (k Keeper) FullDenom(_ context.Context, req *types.QueryFullDenomRequest) (*types.QueryFullDenomResponse, error) { + if _, err := sdk.AccAddressFromBech32(req.Creator); err != nil { + return nil, err + } + + fullDenom, err := types.GetTokenDenom(req.Creator, req.Subdenom) + if err != nil { + return nil, err + } + + return &types.QueryFullDenomResponse{FullDenom: fullDenom}, nil +} diff --git a/x/tokenfactory/keeper/keeper.go b/x/tokenfactory/keeper/keeper.go index 593e977a7..241183ca1 100644 --- a/x/tokenfactory/keeper/keeper.go +++ b/x/tokenfactory/keeper/keeper.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) type ( diff --git a/x/tokenfactory/keeper/keeper_test.go b/x/tokenfactory/keeper/keeper_test.go index ac371decf..bbf4b0488 100644 --- a/x/tokenfactory/keeper/keeper_test.go +++ b/x/tokenfactory/keeper/keeper_test.go @@ -12,10 +12,10 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil" - "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil" + "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) const ( diff --git a/x/tokenfactory/keeper/migrations.go b/x/tokenfactory/keeper/migrations.go index fa10d45ae..40a46cece 100644 --- a/x/tokenfactory/keeper/migrations.go +++ b/x/tokenfactory/keeper/migrations.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v2 "github.com/neutron-org/neutron/v4/x/tokenfactory/migrations/v2" + v2 "github.com/neutron-org/neutron/v5/x/tokenfactory/migrations/v2" ) // Migrator is a struct for handling in-place store migrations. diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index d708a8488..b7ea7c436 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) type msgServer struct { diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go index 30edda04c..70bd4158d 100644 --- a/x/tokenfactory/keeper/msg_server_test.go +++ b/x/tokenfactory/keeper/msg_server_test.go @@ -10,11 +10,11 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil" - testkeeper "github.com/neutron-org/neutron/v4/testutil/tokenfactory/keeper" - "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil" + testkeeper "github.com/neutron-org/neutron/v5/testutil/tokenfactory/keeper" + "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) const ( diff --git a/x/tokenfactory/keeper/params.go b/x/tokenfactory/keeper/params.go index 4faa1764d..3e033cf48 100644 --- a/x/tokenfactory/keeper/params.go +++ b/x/tokenfactory/keeper/params.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/tokenfactory/migrations/v2/store.go b/x/tokenfactory/migrations/v2/store.go index e36561925..5f7d2fc82 100644 --- a/x/tokenfactory/migrations/v2/store.go +++ b/x/tokenfactory/migrations/v2/store.go @@ -12,8 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" - v1beta1types "github.com/neutron-org/neutron/v4/x/tokenfactory/types/v1beta1" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" + v1beta1types "github.com/neutron-org/neutron/v5/x/tokenfactory/types/v1beta1" ) type TokenFactoryKeeper interface { diff --git a/x/tokenfactory/migrations/v2/store_test.go b/x/tokenfactory/migrations/v2/store_test.go index b65b99cba..9fc3c2ae4 100644 --- a/x/tokenfactory/migrations/v2/store_test.go +++ b/x/tokenfactory/migrations/v2/store_test.go @@ -10,10 +10,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/testutil" - v2 "github.com/neutron-org/neutron/v4/x/tokenfactory/migrations/v2" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types/v1beta1" + "github.com/neutron-org/neutron/v5/testutil" + v2 "github.com/neutron-org/neutron/v5/x/tokenfactory/migrations/v2" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types/v1beta1" ) type V3DexMigrationTestSuite struct { diff --git a/x/tokenfactory/module.go b/x/tokenfactory/module.go index c0a2322a3..ca560c18f 100644 --- a/x/tokenfactory/module.go +++ b/x/tokenfactory/module.go @@ -19,9 +19,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/neutron-org/neutron/v4/x/tokenfactory/client/cli" - "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/client/cli" + "github.com/neutron-org/neutron/v5/x/tokenfactory/keeper" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) var ( diff --git a/x/tokenfactory/types/authorityMetadata.pb.go b/x/tokenfactory/types/authorityMetadata.pb.go index ad2ace108..bdc322d35 100644 --- a/x/tokenfactory/types/authorityMetadata.pb.go +++ b/x/tokenfactory/types/authorityMetadata.pb.go @@ -95,8 +95,8 @@ var fileDescriptor_99435de88ae175f7 = []byte{ 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, 0xb3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xbc, 0xd4, 0xd2, 0x92, 0xa2, 0xfc, 0x3c, 0xdd, 0xfc, 0xa2, - 0x74, 0x18, 0x5b, 0xbf, 0xcc, 0x44, 0xbf, 0x02, 0x35, 0x1c, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, - 0xd8, 0xc0, 0x0e, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xab, 0xda, 0x91, 0xd6, 0x2c, 0x01, + 0x74, 0x18, 0x5b, 0xbf, 0xcc, 0x54, 0xbf, 0x02, 0x35, 0x1c, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, + 0xd8, 0xc0, 0x0e, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x39, 0xf1, 0xea, 0x2c, 0x01, 0x00, 0x00, } diff --git a/x/tokenfactory/types/denoms_test.go b/x/tokenfactory/types/denoms_test.go index 14c54eb55..102b751f4 100644 --- a/x/tokenfactory/types/denoms_test.go +++ b/x/tokenfactory/types/denoms_test.go @@ -3,11 +3,11 @@ package types_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func TestDecomposeDenoms(t *testing.T) { diff --git a/x/tokenfactory/types/genesis.pb.go b/x/tokenfactory/types/genesis.pb.go index 3415f1e6c..dd6d89194 100644 --- a/x/tokenfactory/types/genesis.pb.go +++ b/x/tokenfactory/types/genesis.pb.go @@ -153,30 +153,30 @@ var fileDescriptor_5749c3f71850298b = []byte{ // 411 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0xae, 0xd2, 0x40, 0x14, 0xc6, 0x3b, 0xf7, 0x5e, 0x6f, 0x62, 0x2f, 0x1a, 0xad, 0x92, 0x54, 0x82, 0x2d, 0x74, 0x61, - 0x08, 0x89, 0x6d, 0x40, 0x62, 0x0c, 0x3b, 0x2a, 0x89, 0x2b, 0x13, 0x52, 0x77, 0x6e, 0x9a, 0xa1, - 0x1d, 0x4b, 0x83, 0xed, 0x69, 0x66, 0x06, 0x62, 0x5f, 0xc0, 0xb5, 0x8f, 0xe0, 0x83, 0xf8, 0x00, - 0x2c, 0x59, 0xba, 0x22, 0x06, 0x36, 0xae, 0x79, 0x01, 0x4d, 0x67, 0xc6, 0x3f, 0x5c, 0x08, 0xbb, - 0xe9, 0x99, 0xdf, 0xf9, 0xce, 0x77, 0xbe, 0x8e, 0xde, 0x05, 0x96, 0x01, 0x4b, 0x99, 0xc7, 0x61, - 0x4e, 0xf2, 0x0f, 0x38, 0xe2, 0x40, 0x4b, 0x6f, 0xd9, 0x9b, 0x12, 0x8e, 0x7b, 0x5e, 0x42, 0x72, - 0xc2, 0x52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, 0x9d, 0x07, 0xe7, 0xfd, 0x8a, 0x49, 0xa3, 0xff, 0x03, + 0xf5, 0xdb, 0xca, 0xf9, 0x23, 0x39, 0xef, 0x58, 0xdd, 0x09, 0xee, 0x1f, 0xfd, 0x06, 0xe3, 0xa5, + 0x5e, 0x9f, 0x01, 0xcc, 0xc3, 0x08, 0x72, 0x4e, 0x71, 0xc4, 0x43, 0x1c, 0xc7, 0x94, 0x30, 0x66, + 0x5e, 0x8a, 0x05, 0xaa, 0x80, 0x51, 0xf0, 0xa0, 0x42, 0x5e, 0x29, 0x62, 0x24, 0x81, 0xe1, 0xd5, + 0x8f, 0x2f, 0x36, 0xf2, 0x27, 0xab, 0xad, 0x85, 0xd6, 0x5b, 0x0b, 0x7d, 0xdf, 0x5a, 0xe8, 0xf3, + 0xce, 0xd2, 0xd6, 0x3b, 0x4b, 0xfb, 0xb6, 0xb3, 0xb4, 0x77, 0x2f, 0x92, 0x94, 0xcf, 0x16, 0x53, + 0x37, 0x82, 0xcc, 0xcb, 0xc9, 0x82, 0x53, 0xc8, 0x9f, 0x02, 0x4d, 0x7e, 0x9f, 0xbd, 0xe5, 0x73, + 0xef, 0xe3, 0xe1, 0x63, 0xe1, 0x65, 0x41, 0xd8, 0xf4, 0x5a, 0xbc, 0x8c, 0x67, 0xbf, 0x02, 0x00, + 0x00, 0xff, 0xff, 0xe6, 0x0c, 0x91, 0x02, 0xd4, 0x02, 0x00, 0x00, } func (this *GenesisDenom) Equal(that interface{}) bool { diff --git a/x/tokenfactory/types/genesis_test.go b/x/tokenfactory/types/genesis_test.go index e3039050b..80836d095 100644 --- a/x/tokenfactory/types/genesis_test.go +++ b/x/tokenfactory/types/genesis_test.go @@ -3,11 +3,11 @@ package types_test import ( "testing" - "github.com/neutron-org/neutron/v4/app/config" + "github.com/neutron-org/neutron/v5/app/config" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/x/tokenfactory/types" + "github.com/neutron-org/neutron/v5/x/tokenfactory/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/tokenfactory/types/params.pb.go b/x/tokenfactory/types/params.pb.go index a5b112b5a..bc357640f 100644 --- a/x/tokenfactory/types/params.pb.go +++ b/x/tokenfactory/types/params.pb.go @@ -171,7 +171,7 @@ var fileDescriptor_09c297db7c49d1cf = []byte{ // 457 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xc1, 0x6e, 0xd3, 0x40, 0x10, 0x8d, 0x49, 0x14, 0xc4, 0x02, 0xa2, 0x98, 0x22, 0x9c, 0x1c, 0xec, 0xd4, 0x15, 0x52, 0x38, - 0xd4, 0xab, 0x16, 0xc4, 0x81, 0x1b, 0x31, 0x02, 0x7a, 0x40, 0xaa, 0x7c, 0x41, 0x82, 0x83, 0xb5, + 0xd4, 0xab, 0x16, 0xc1, 0x81, 0x1b, 0x31, 0x02, 0x7a, 0x40, 0xaa, 0x7c, 0x41, 0x82, 0x83, 0xb5, 0xf1, 0x8e, 0x9d, 0x55, 0xe2, 0x9d, 0xc8, 0xbb, 0x69, 0xc9, 0x5f, 0xc0, 0x85, 0x8f, 0xe0, 0x4b, 0x72, 0xec, 0x91, 0x93, 0x41, 0xc9, 0x1f, 0xf4, 0x0b, 0x50, 0xd6, 0xae, 0x9a, 0x94, 0x9c, 0xbc, 0xf3, 0xde, 0xcc, 0x78, 0xde, 0x9b, 0x21, 0x07, 0xa8, 0x72, 0x54, 0x42, 0x51, 0x8d, 0x63, 0x90, @@ -197,7 +197,7 @@ var fileDescriptor_09c297db7c49d1cf = []byte{ 0xb5, 0xfe, 0x2e, 0x5d, 0xeb, 0xfb, 0xca, 0x6d, 0x5c, 0xae, 0xdc, 0xc6, 0xef, 0x95, 0xdb, 0xf8, 0xf2, 0x7a, 0xc3, 0x45, 0x09, 0x33, 0x5d, 0xa0, 0x3c, 0xc2, 0x22, 0xbb, 0x7e, 0xd3, 0xf3, 0x57, 0xf4, 0xdb, 0xf6, 0xc1, 0x1a, 0x67, 0x87, 0x6d, 0x73, 0x49, 0x2f, 0xff, 0x05, 0x00, 0x00, 0xff, - 0xff, 0x0e, 0x4e, 0x8c, 0xba, 0xd5, 0x02, 0x00, 0x00, + 0xff, 0x06, 0xad, 0xec, 0x86, 0xd5, 0x02, 0x00, 0x00, } func (m *WhitelistedHook) Marshal() (dAtA []byte, err error) { diff --git a/x/tokenfactory/types/query.pb.go b/x/tokenfactory/types/query.pb.go index 5e6fb2b06..9bdee336b 100644 --- a/x/tokenfactory/types/query.pb.go +++ b/x/tokenfactory/types/query.pb.go @@ -304,6 +304,8 @@ func (m *QueryDenomsFromCreatorResponse) GetDenoms() []string { return nil } +// QueryBeforeSendHookAddressRequest defines the request structure for the +// BeforeSendHookAddress gRPC query. type QueryBeforeSendHookAddressRequest struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"` Subdenom string `protobuf:"bytes,2,opt,name=subdenom,proto3" json:"subdenom,omitempty" yaml:"subdenom"` @@ -357,7 +359,7 @@ func (m *QueryBeforeSendHookAddressRequest) GetSubdenom() string { } // QueryBeforeSendHookAddressResponse defines the response structure for the -// DenomBeforeSendHook gRPC query. +// BeforeSendHookAddress gRPC query. type QueryBeforeSendHookAddressResponse struct { ContractAddr string `protobuf:"bytes,1,opt,name=contract_addr,json=contractAddr,proto3" json:"contract_addr,omitempty" yaml:"contract_addr"` } @@ -402,6 +404,106 @@ func (m *QueryBeforeSendHookAddressResponse) GetContractAddr() string { return "" } +// QueryFullDenomRequest defines the request structure for the +// FullDenom gRPC query. +type QueryFullDenomRequest struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"` + Subdenom string `protobuf:"bytes,2,opt,name=subdenom,proto3" json:"subdenom,omitempty" yaml:"subdenom"` +} + +func (m *QueryFullDenomRequest) Reset() { *m = QueryFullDenomRequest{} } +func (m *QueryFullDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFullDenomRequest) ProtoMessage() {} +func (*QueryFullDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6f22013ad0f72e3f, []int{8} +} +func (m *QueryFullDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFullDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFullDenomRequest.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 *QueryFullDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFullDenomRequest.Merge(m, src) +} +func (m *QueryFullDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFullDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFullDenomRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFullDenomRequest proto.InternalMessageInfo + +func (m *QueryFullDenomRequest) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *QueryFullDenomRequest) GetSubdenom() string { + if m != nil { + return m.Subdenom + } + return "" +} + +// QueryFullDenomResponse defines the response structure for the +// FullDenom gRPC query. +type QueryFullDenomResponse struct { + FullDenom string `protobuf:"bytes,1,opt,name=full_denom,json=fullDenom,proto3" json:"full_denom,omitempty" yaml:"full_denom"` +} + +func (m *QueryFullDenomResponse) Reset() { *m = QueryFullDenomResponse{} } +func (m *QueryFullDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFullDenomResponse) ProtoMessage() {} +func (*QueryFullDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6f22013ad0f72e3f, []int{9} +} +func (m *QueryFullDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFullDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFullDenomResponse.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 *QueryFullDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFullDenomResponse.Merge(m, src) +} +func (m *QueryFullDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFullDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFullDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFullDenomResponse proto.InternalMessageInfo + +func (m *QueryFullDenomResponse) GetFullDenom() string { + if m != nil { + return m.FullDenom + } + return "" +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "osmosis.tokenfactory.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "osmosis.tokenfactory.v1beta1.QueryParamsResponse") @@ -411,6 +513,8 @@ func init() { proto.RegisterType((*QueryDenomsFromCreatorResponse)(nil), "osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse") proto.RegisterType((*QueryBeforeSendHookAddressRequest)(nil), "osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest") proto.RegisterType((*QueryBeforeSendHookAddressResponse)(nil), "osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse") + proto.RegisterType((*QueryFullDenomRequest)(nil), "osmosis.tokenfactory.v1beta1.QueryFullDenomRequest") + proto.RegisterType((*QueryFullDenomResponse)(nil), "osmosis.tokenfactory.v1beta1.QueryFullDenomResponse") } func init() { @@ -418,50 +522,55 @@ func init() { } var fileDescriptor_6f22013ad0f72e3f = []byte{ - // 677 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x4f, 0x13, 0x4f, - 0x18, 0xee, 0xf2, 0xfb, 0x59, 0x65, 0x14, 0x0d, 0x03, 0x1a, 0x6c, 0x70, 0x2b, 0xa3, 0x31, 0x98, - 0xe0, 0x8e, 0x20, 0xf1, 0x00, 0x12, 0xa1, 0x18, 0x63, 0x62, 0x48, 0x60, 0x25, 0x1e, 0x88, 0x49, - 0x33, 0xed, 0x0e, 0xa5, 0x81, 0xdd, 0xb7, 0xcc, 0x4c, 0x89, 0x0d, 0xe1, 0x82, 0x89, 0x67, 0x13, - 0x8f, 0x7e, 0x07, 0x3f, 0x07, 0x47, 0x12, 0x2e, 0x9e, 0x1a, 0x03, 0x7e, 0x82, 0x1e, 0xbc, 0x78, - 0x31, 0x9d, 0x99, 0xe5, 0x8f, 0x2d, 0x9b, 0x5a, 0x12, 0x6f, 0xdb, 0x79, 0x9f, 0xf7, 0x79, 0x9f, - 0xe7, 0xfd, 0x93, 0xa2, 0x51, 0x90, 0x21, 0xc8, 0xb2, 0xa4, 0x0a, 0xd6, 0x79, 0xb4, 0xca, 0x8a, - 0x0a, 0x44, 0x8d, 0x6e, 0x8d, 0x17, 0xb8, 0x62, 0xe3, 0x74, 0xb3, 0xca, 0x45, 0xcd, 0xab, 0x08, - 0x50, 0x80, 0x87, 0x2d, 0xd2, 0x3b, 0x8d, 0xf4, 0x2c, 0x32, 0x33, 0x58, 0x82, 0x12, 0x68, 0x20, - 0x6d, 0x7e, 0x99, 0x9c, 0xcc, 0x70, 0x09, 0xa0, 0xb4, 0xc1, 0x29, 0xab, 0x94, 0x29, 0x8b, 0x22, - 0x50, 0x4c, 0x95, 0x21, 0x92, 0x36, 0x3a, 0xd2, 0xb6, 0x76, 0x85, 0x09, 0x16, 0xc6, 0x90, 0xc9, - 0x44, 0x79, 0xac, 0xaa, 0xd6, 0x40, 0x94, 0x55, 0x6d, 0x81, 0x2b, 0x16, 0x30, 0xc5, 0x4c, 0x16, - 0x19, 0x44, 0x78, 0xa9, 0xa9, 0x7c, 0x51, 0x53, 0xf9, 0x7c, 0xb3, 0xca, 0xa5, 0x22, 0x4b, 0x68, - 0xe0, 0xcc, 0xab, 0xac, 0x40, 0x24, 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0x69, 0x66, 0x66, 0xbb, 0x27, 0xb0, 0x0e, 0x57, 0xb4, 0xc3, 0x65, 0xec, 0x5f, 0x7c, - 0xa0, 0x05, 0x5d, 0x28, 0x2f, 0x79, 0x14, 0xe4, 0xd7, 0x00, 0xd6, 0x73, 0x8b, 0x7b, 0x87, 0xae, - 0xb3, 0x7f, 0xe8, 0x3a, 0xdf, 0x0f, 0x5d, 0xe7, 0xd3, 0x91, 0x9b, 0xda, 0x3f, 0x72, 0x53, 0xdf, - 0x8e, 0xdc, 0xd4, 0xca, 0xd3, 0x52, 0x59, 0xad, 0x55, 0x0b, 0x5e, 0x11, 0x42, 0x1a, 0xf1, 0xaa, - 0x12, 0x10, 0x3d, 0x02, 0x51, 0x8a, 0xbf, 0xe9, 0xd6, 0x24, 0x7d, 0x7f, 0x56, 0x88, 0xaa, 0x55, - 0xb8, 0x2c, 0xa4, 0xf5, 0x7f, 0xde, 0x93, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xf0, 0xc4, - 0xcf, 0xca, 0x07, 0x00, 0x00, + // 757 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x4f, 0x13, 0x4f, + 0x18, 0xee, 0xf2, 0xfb, 0x59, 0xe9, 0x28, 0x9a, 0x0e, 0x7f, 0x82, 0x0d, 0xb6, 0x32, 0x1a, 0x83, + 0x09, 0x76, 0x04, 0xaa, 0x07, 0x90, 0x08, 0xc5, 0x10, 0x13, 0x85, 0xc0, 0x4a, 0x3c, 0x10, 0x93, + 0x66, 0xda, 0x9d, 0x96, 0x86, 0xee, 0x4e, 0x99, 0x9d, 0x25, 0x36, 0x84, 0x0b, 0x26, 0x9e, 0x4d, + 0x3c, 0xfa, 0x1d, 0xfc, 0x0e, 0xde, 0x38, 0x78, 0x20, 0xe1, 0xe2, 0x69, 0x63, 0xc0, 0x4f, 0xd0, + 0x83,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e6, + 0xcd, 0xe0, 0x77, 0x83, 0x09, 0x6d, 0x82, 0x7e, 0x59, 0x64, 0xde, 0xab, 0x54, 0xe4, 0xd5, 0x5d, + 0x91, 0xb9, 0x45, 0x30, 0x70, 0xba, 0xae, 0x36, 0x94, 0x01, 0xa0, 0xe8, 0x55, 0x2a, 0x39, 0x45, + 0xa6, 0x6a, 0xf7, 0xd7, 0xfd, 0x54, 0x5c, 0x91, 0x35, 0x63, 0xc8, 0x8c, 0x15, 0x83, 0xec, 0xf1, + 0xef, 0xdd, 0xe0, 0x9a, 0x24, 0x84, 0x5f, 0x0d, 0x10, 0x55, 0x73, 0x0a, 0x9f, 0x84, 0x3f, 0xe7, + 0xd6, 0xf5, 0x90, 0x18, 0x3b, 0x47, 0x86, 0xd2, 0x8b, 0x46, 0x77, 0xf6, 0x7f, 0x7f, 0xe9, 0x7a, + 0x08, 0x1f, 0xe0, 0xd0, 0x35, 0xa5, 0x96, 0x05, 0xfc, 0x6b, 0x80, 0x81, 0xf6, 0x63, 0x04, 0x67, + 0x3a, 0xa8, 0x1d, 0xba, 0x62, 0x12, 0xb3, 0x97, 0x60, 0xd0, 0x6e, 0xde, 0x4b, 0x37, 0xef, 0xe0, + 0x4a, 0xb8, 0x1b, 0x35, 0x27, 0x38, 0x38, 0xde, 0xd2, 0xef, 0x60, 0x1b, 0x6f, 0x05, 0x1d, 0xde, + 0xc6, 0xad, 0x7b, 0x00, 0xee, 0x1b, 0x20, 0xde, 0x32, 0xa0, 0x70, 0xaa, 0x53, 0xd9, 0x6d, 0xb6, + 0x44, 0xe2, 0xf9, 0xc5, 0x92, 0xb5, 0xdd, 0x39, 0x69, 0x77, 0x1a, 0x4e, 0x75, 0x62, 0x37, 0x57, + 0xe4, 0xcc, 0xce, 0x69, 0xab, 0x4d, 0xcf, 0xf0, 0x8f, 0x01, 0xfa, 0xdb, 0x0e, 0x29, 0x7c, 0xd1, + 0x81, 0xb8, 0xb0, 0x15, 0x93, 0x98, 0xb9, 0x38, 0x81, 0x76, 0xb8, 0x2a, 0x1d, 0xae, 0x40, 0xf3, + 0xf2, 0x0d, 0xcd, 0xcb, 0x42, 0x39, 0x97, 0x3a, 0x56, 0x6e, 0x8d, 0xb1, 0x75, 0xf8, 0xc3, 0x00, + 0xb1, 0xa3, 0x01, 0x86, 0x13, 0x1d, 0x68, 0x3d, 0xbd, 0x66, 0x12, 0x99, 0xf3, 0x25, 0x69, 0x53, + 0x2b, 0xd2, 0xd4, 0x22, 0x7c, 0x73, 0x79, 0x53, 0xcd, 0x7d, 0x92, 0x5d, 0xda, 0x3d, 0x48, 0x1a, + 0x7b, 0x07, 0x49, 0xe3, 0xd7, 0x41, 0xd2, 0xf8, 0x7c, 0x98, 0x8c, 0xec, 0x1d, 0x26, 0x23, 0x3f, + 0x0f, 0x93, 0x91, 0xd5, 0x67, 0xa5, 0xb2, 0x58, 0xf3, 0xf2, 0xe9, 0x02, 0xb3, 0xb1, 0x43, 0x3d, + 0xc1, 0x99, 0xf3, 0x98, 0xf1, 0x52, 0xf0, 0x8d, 0x37, 0x9f, 0xe2, 0x0f, 0x27, 0x25, 0x88, 0x5a, + 0x95, 0xba, 0xf9, 0xa8, 0xfc, 0x2b, 0x32, 0xf1, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x68, 0xcf, 0x46, + 0xd0, 0x61, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -488,6 +597,9 @@ type QueryClient interface { // BeforeSendHookAddress defines a gRPC query method for // getting the address registered for the before send hook. BeforeSendHookAddress(ctx context.Context, in *QueryBeforeSendHookAddressRequest, opts ...grpc.CallOption) (*QueryBeforeSendHookAddressResponse, error) + // FullDenom defines a gRPC query method for getting full denom name + // from the creator and subdenom strings. + FullDenom(ctx context.Context, in *QueryFullDenomRequest, opts ...grpc.CallOption) (*QueryFullDenomResponse, error) } type queryClient struct { @@ -534,6 +646,15 @@ func (c *queryClient) BeforeSendHookAddress(ctx context.Context, in *QueryBefore return out, nil } +func (c *queryClient) FullDenom(ctx context.Context, in *QueryFullDenomRequest, opts ...grpc.CallOption) (*QueryFullDenomResponse, error) { + out := new(QueryFullDenomResponse) + err := c.cc.Invoke(ctx, "/osmosis.tokenfactory.v1beta1.Query/FullDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Params defines a gRPC query method that returns the tokenfactory module's @@ -548,6 +669,9 @@ type QueryServer interface { // BeforeSendHookAddress defines a gRPC query method for // getting the address registered for the before send hook. BeforeSendHookAddress(context.Context, *QueryBeforeSendHookAddressRequest) (*QueryBeforeSendHookAddressResponse, error) + // FullDenom defines a gRPC query method for getting full denom name + // from the creator and subdenom strings. + FullDenom(context.Context, *QueryFullDenomRequest) (*QueryFullDenomResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -566,6 +690,9 @@ func (*UnimplementedQueryServer) DenomsFromCreator(ctx context.Context, req *Que func (*UnimplementedQueryServer) BeforeSendHookAddress(ctx context.Context, req *QueryBeforeSendHookAddressRequest) (*QueryBeforeSendHookAddressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BeforeSendHookAddress not implemented") } +func (*UnimplementedQueryServer) FullDenom(ctx context.Context, req *QueryFullDenomRequest) (*QueryFullDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FullDenom not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -643,6 +770,24 @@ func _Query_BeforeSendHookAddress_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Query_FullDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFullDenomRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FullDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.tokenfactory.v1beta1.Query/FullDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FullDenom(ctx, req.(*QueryFullDenomRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.tokenfactory.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -663,6 +808,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "BeforeSendHookAddress", Handler: _Query_BeforeSendHookAddress_Handler, }, + { + MethodName: "FullDenom", + Handler: _Query_FullDenom_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/tokenfactory/v1beta1/query.proto", @@ -923,6 +1072,73 @@ func (m *QueryBeforeSendHookAddressResponse) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } +func (m *QueryFullDenomRequest) 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 *QueryFullDenomRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFullDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Subdenom) > 0 { + i -= len(m.Subdenom) + copy(dAtA[i:], m.Subdenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Subdenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFullDenomResponse) 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 *QueryFullDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFullDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FullDenom) > 0 { + i -= len(m.FullDenom) + copy(dAtA[i:], m.FullDenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.FullDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1040,6 +1256,36 @@ func (m *QueryBeforeSendHookAddressResponse) Size() (n int) { return n } +func (m *QueryFullDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Subdenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFullDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FullDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1736,6 +1982,202 @@ func (m *QueryBeforeSendHookAddressResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryFullDenomRequest) 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: QueryFullDenomRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFullDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subdenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subdenom = string(dAtA[iNdEx:postIndex]) + 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 *QueryFullDenomResponse) 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: QueryFullDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFullDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FullDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FullDenom = string(dAtA[iNdEx:postIndex]) + 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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/tokenfactory/types/query.pb.gw.go b/x/tokenfactory/types/query.pb.gw.go index 3da3e9e6d..ba0c18113 100644 --- a/x/tokenfactory/types/query.pb.gw.go +++ b/x/tokenfactory/types/query.pb.gw.go @@ -257,6 +257,82 @@ func local_request_Query_BeforeSendHookAddress_0(ctx context.Context, marshaler } +func request_Query_FullDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFullDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["creator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "creator") + } + + protoReq.Creator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "creator", err) + } + + val, ok = pathParams["subdenom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subdenom") + } + + protoReq.Subdenom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subdenom", err) + } + + msg, err := client.FullDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FullDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFullDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["creator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "creator") + } + + protoReq.Creator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "creator", err) + } + + val, ok = pathParams["subdenom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subdenom") + } + + protoReq.Subdenom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subdenom", err) + } + + msg, err := server.FullDenom(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -355,6 +431,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_FullDenom_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_FullDenom_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_FullDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -476,6 +575,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_FullDenom_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_FullDenom_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_FullDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -487,6 +606,8 @@ var ( pattern_Query_DenomsFromCreator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms_from_creator", "creator"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_BeforeSendHookAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms", "factory", "creator", "subdenom", "before_send_hook"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_FullDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms", "factory", "creator", "subdenom", "full_denom"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -497,4 +618,6 @@ var ( forward_Query_DenomsFromCreator_0 = runtime.ForwardResponseMessage forward_Query_BeforeSendHookAddress_0 = runtime.ForwardResponseMessage + + forward_Query_FullDenom_0 = runtime.ForwardResponseMessage ) diff --git a/x/tokenfactory/types/tx.pb.go b/x/tokenfactory/types/tx.pb.go index e20ba1f2c..8611c6a88 100644 --- a/x/tokenfactory/types/tx.pb.go +++ b/x/tokenfactory/types/tx.pb.go @@ -858,72 +858,72 @@ func init() { var fileDescriptor_283b6c9a90a846b4 = []byte{ // 1064 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0xf6, 0x47, 0x9a, 0x4c, 0x12, 0x92, 0x6c, 0x42, 0xe3, 0x2c, 0xa9, 0xb7, 0x2c, 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aa, 0xcf, 0x5e, 0x9f, 0x17, + 0x8d, 0x37, 0xe7, 0x45, 0xe3, 0xaf, 0xf3, 0xa2, 0xf1, 0xc3, 0x45, 0x71, 0xee, 0xcd, 0x45, 0x71, + 0xee, 0xcf, 0x8b, 0xe2, 0xdc, 0xd7, 0x7b, 0x41, 0xc8, 0xdb, 0xbd, 0x86, 0xdb, 0x24, 0x91, 0x87, + 0x51, 0x8f, 0x53, 0x82, 0x4b, 0x84, 0x06, 0xc9, 0x6f, 0xef, 0xf8, 0x91, 0xf7, 0x32, 0x3b, 0xfd, + 0xf8, 0x69, 0x17, 0xb1, 0xc6, 0xbc, 0xfc, 0x93, 0xe0, 0xc1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xa3, 0xcd, 0xc9, 0x53, 0x19, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tokenfactory/types/v1beta1/params.pb.go b/x/tokenfactory/types/v1beta1/params.pb.go index cf863a97c..7219dbd6d 100644 --- a/x/tokenfactory/types/v1beta1/params.pb.go +++ b/x/tokenfactory/types/v1beta1/params.pb.go @@ -105,31 +105,31 @@ func init() { } var fileDescriptor_cc8299d306f3ff47 = []byte{ - // 376 bytes of a gzipped FileDescriptorProto + // 377 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xbd, 0x6e, 0xe2, 0x40, 0x10, 0xf6, 0xc2, 0x09, 0xe9, 0x7c, 0xcd, 0xc9, 0x77, 0xa7, 0x03, 0x74, 0xb2, 0x39, 0x57, 0xa6, - 0xc0, 0x2b, 0x48, 0xaa, 0x14, 0x91, 0x82, 0xa5, 0xa4, 0x8a, 0x14, 0x51, 0x45, 0x69, 0xac, 0xb5, - 0x3d, 0x76, 0x2c, 0xf0, 0x0e, 0xf2, 0x2e, 0x28, 0xbc, 0x45, 0xaa, 0x3c, 0x44, 0xde, 0x21, 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0x07, 0xd1, 0x88, 0x09, 0xd7, 0x47, 0x2e, 0x66, 0x09, 0x34, 0x6b, - 0x1d, 0x62, 0x7d, 0x1b, 0x76, 0x97, 0x99, 0x41, 0xb6, 0x99, 0xf1, 0xff, 0x4b, 0x13, 0x7b, 0x7c, - 0x73, 0xf4, 0xf7, 0x60, 0xc0, 0x05, 0x13, 0x4e, 0x81, 0x68, 0x03, 0xf5, 0x4f, 0x08, 0xe0, 0xfa, - 0x38, 0x99, 0xc0, 0x6e, 0xed, 0x2e, 0x0b, 0x82, 0x14, 0x84, 0x68, 0xd6, 0x3b, 0xc4, 0xfa, 0x3e, - 0xfa, 0x15, 0x02, 0x38, 0x15, 0x76, 0x56, 0x40, 0xc3, 0xeb, 0xe5, 0x5a, 0x27, 0xab, 0xb5, 0x4e, - 0x5e, 0xd7, 0x3a, 0xb9, 0xdf, 0xe8, 0xca, 0x6a, 0xa3, 0x2b, 0xcf, 0x1b, 0x5d, 0xb9, 0x39, 0xdd, - 0xfb, 0x63, 0x0e, 0x33, 0x99, 0x22, 0xef, 0x61, 0x1a, 0x55, 0x31, 0x9d, 0x1f, 0xd3, 0xbb, 0xc3, - 0xf7, 0x90, 0x6f, 0xa1, 0xba, 0xaa, 0xd7, 0xc8, 0x0f, 0x74, 0xf4, 0x16, 0x00, 0x00, 0xff, 0xff, - 0xc4, 0x5e, 0x24, 0x25, 0x3c, 0x02, 0x00, 0x00, + 0xc0, 0x2b, 0x88, 0xd2, 0xa4, 0x88, 0x14, 0x2c, 0x25, 0x55, 0xa4, 0x88, 0x2a, 0x4a, 0x63, 0xad, + 0xed, 0xb1, 0x63, 0x81, 0x77, 0x90, 0x77, 0x41, 0xe1, 0x2d, 0x52, 0xe5, 0x21, 0xf2, 0x0e, 0xe9, + 0x29, 0x29, 0x53, 0x39, 0x11, 0xbc, 0x01, 0x4f, 0x10, 0xe1, 0x9f, 0x08, 0x92, 0x54, 0x9e, 0x99, + 0xef, 0x9b, 0x6f, 0x3e, 0xcf,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0xff, 0x5f, 0x9a, 0xd8, 0xe3, + 0x9b, 0xa3, 0xbf, 0x07, 0x03, 0x2e, 0x98, 0x70, 0x0a, 0x44, 0x1b, 0xa8, 0x7f, 0x42, 0x00, 0xd7, + 0xc7, 0xc9, 0x04, 0x76, 0x6b, 0x77, 0x59, 0x10, 0xa4, 0x20, 0x44, 0xb3, 0xde, 0x21, 0xd6, 0xf7, + 0xd1, 0xaf, 0x10, 0xc0, 0xa9, 0xb0, 0xb3, 0x02, 0x1a, 0x5e, 0x2f, 0xd7, 0x3a, 0x59, 0xad, 0x75, + 0xf2, 0xba, 0xd6, 0xc9, 0xfd, 0x46, 0x57, 0x56, 0x1b, 0x5d, 0x79, 0xde, 0xe8, 0xca, 0xcd, 0xe9, + 0xde, 0x1f, 0x73, 0x98, 0xc9, 0x14, 0x79, 0x0f, 0xd3, 0xa8, 0x8a, 0xe9, 0xfc, 0x98, 0xde, 0x1d, + 0xbe, 0x87, 0x7c, 0x0b, 0xd5, 0x55, 0xbd, 0x46, 0x7e, 0xa0, 0xa3, 0xb7, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x26, 0xa3, 0xac, 0xa8, 0x3c, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/transfer/ibc_handlers.go b/x/transfer/ibc_handlers.go index 9ccd06b86..3c911599c 100644 --- a/x/transfer/ibc_handlers.go +++ b/x/transfer/ibc_handlers.go @@ -7,9 +7,9 @@ import ( transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/interchaintxs/types" ) // HandleAcknowledgement passes the acknowledgement data to the appropriate contract via a sudo call. @@ -32,7 +32,6 @@ func (im IBCModule) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.P } im.wrappedKeeper.FeeKeeper.DistributeAcknowledgementFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence)) - msg, err := keeper.PrepareSudoCallbackMessage(packet, &ack) if err != nil { return errors.Wrapf(sdkerrors.ErrJSONMarshal, "failed to marshal Packet/Acknowledgment: %v", err) diff --git a/x/transfer/ibc_handlers_test.go b/x/transfer/ibc_handlers_test.go index 61f0b6540..e6ccadc1a 100644 --- a/x/transfer/ibc_handlers_test.go +++ b/x/transfer/ibc_handlers_test.go @@ -6,7 +6,7 @@ import ( types2 "cosmossdk.io/store/types" - "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" + "github.com/neutron-org/neutron/v5/x/contractmanager/keeper" sdk "github.com/cosmos/cosmos-sdk/types" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" @@ -14,12 +14,12 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/neutron-org/neutron/v4/testutil" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/transfer/types" - testkeeper "github.com/neutron-org/neutron/v4/testutil/transfer/keeper" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" - "github.com/neutron-org/neutron/v4/x/transfer" + "github.com/neutron-org/neutron/v5/testutil" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/transfer/types" + testkeeper "github.com/neutron-org/neutron/v5/testutil/transfer/keeper" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + ictxtypes "github.com/neutron-org/neutron/v5/x/interchaintxs/types" + "github.com/neutron-org/neutron/v5/x/transfer" ) const TestCosmosAddress = "cosmos10h9stc5v6ntgeygf5xf945njqq5h32r53uquvw" diff --git a/x/transfer/keeper/keeper.go b/x/transfer/keeper/keeper.go index 56e630cd0..191a1ae4f 100644 --- a/x/transfer/keeper/keeper.go +++ b/x/transfer/keeper/keeper.go @@ -16,8 +16,8 @@ import ( channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - wrappedtypes "github.com/neutron-org/neutron/v4/x/transfer/types" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + wrappedtypes "github.com/neutron-org/neutron/v5/x/transfer/types" ) // KeeperTransferWrapper is a wrapper for original ibc keeper to override response for "Transfer" method diff --git a/x/transfer/keeper/keeper_test.go b/x/transfer/keeper/keeper_test.go index 7ba8be0a3..d085325b3 100644 --- a/x/transfer/keeper/keeper_test.go +++ b/x/transfer/keeper/keeper_test.go @@ -15,12 +15,12 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil" - mock_types "github.com/neutron-org/neutron/v4/testutil/mocks/transfer/types" - "github.com/neutron-org/neutron/v4/testutil/transfer/keeper" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - "github.com/neutron-org/neutron/v4/x/transfer/types" + "github.com/neutron-org/neutron/v5/app/params" + "github.com/neutron-org/neutron/v5/testutil" + mock_types "github.com/neutron-org/neutron/v5/testutil/mocks/transfer/types" + "github.com/neutron-org/neutron/v5/testutil/transfer/keeper" + feetypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" + "github.com/neutron-org/neutron/v5/x/transfer/types" ) const ( diff --git a/x/transfer/module.go b/x/transfer/module.go index 509470d61..0479b53b5 100644 --- a/x/transfer/module.go +++ b/x/transfer/module.go @@ -15,8 +15,8 @@ import ( "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - wrapkeeper "github.com/neutron-org/neutron/v4/x/transfer/keeper" - neutrontypes "github.com/neutron-org/neutron/v4/x/transfer/types" + wrapkeeper "github.com/neutron-org/neutron/v5/x/transfer/keeper" + neutrontypes "github.com/neutron-org/neutron/v5/x/transfer/types" ) /* diff --git a/x/transfer/types/expected_keepers.go b/x/transfer/types/expected_keepers.go index f13d094a0..5eb6f8edc 100644 --- a/x/transfer/types/expected_keepers.go +++ b/x/transfer/types/expected_keepers.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - feerefundertypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" + feerefundertypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" ) type WasmKeeper interface { diff --git a/x/transfer/types/query.pb.go b/x/transfer/types/query.pb.go index 4d562d622..649f418da 100644 --- a/x/transfer/types/query.pb.go +++ b/x/transfer/types/query.pb.go @@ -30,30 +30,31 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("neutron/transfer/v1/query.proto", fileDescriptor_560cfedb574fdf6b) } var fileDescriptor_560cfedb574fdf6b = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x3f, 0x4b, 0x03, 0x31, - 0x18, 0xc6, 0x7b, 0x42, 0x0b, 0xc6, 0x45, 0x32, 0x96, 0x12, 0xa1, 0x74, 0xd0, 0xaa, 0x89, 0xd7, - 0x56, 0x3f, 0x80, 0x38, 0x38, 0x38, 0xa8, 0x38, 0xb9, 0x48, 0xee, 0x8c, 0x77, 0x07, 0x6d, 0x92, - 0x26, 0xb9, 0x62, 0x91, 0x2e, 0x7e, 0x02, 0xa1, 0x5f, 0xc1, 0x41, 0xc4, 0x0f, 0xe2, 0x58, 0x70, - 0x71, 0x94, 0xd6, 0x0f, 0x22, 0x97, 0xbb, 0xb3, 0x0a, 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1c, - 0x19, 0x5b, 0xc3, 0xb2, 0x21, 0x58, 0xfb, 0x99, 0x4d, 0xa6, 0x28, 0x8f, 0x0e, 0x58, 0xb6, 0x37, - 0x3b, 0xa4, 0x3a, 0x84, 0xed, 0x45, 0xfb, 0x90, 0xa8, 0x73, 0xb6, 0x4e, 0x31, 0x53, 0x86, 0xd7, - 0xb2, 0x78, 0x5b, 0xb0, 0xf9, 0x57, 0xeb, 0x92, 0x21, 0x27, 0xc3, 0xb6, 0x2d, 0x1c, 0xed, 0x1f, - 0x3d, 0x4f, 0x91, 0x33, 0x99, 0x22, 0xe7, 0x6d, 0x8a, 0x9c, 0xbb, 0x19, 0x2a, 0x4d, 0x66, 0xa8, - 0xf4, 0x3a, 0x43, 0xa5, 0xf3, 0x56, 0x10, 0x99, 0x30, 0xf6, 0xb0, 0x2f, 0x7a, 0x24, 0xfb, 0x25, - 0xdb, 0x42, 0x05, 0xf9, 0x9a, 0x0c, 0x3a, 0xe4, 0x7a, 0x9e, 0x6f, 0x86, 0x92, 0x69, 0xaf, 0x62, - 0xdf, 0x7e, 0xfb, 0x23, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x46, 0x5b, 0xdc, 0x78, 0x03, 0x00, 0x00, + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xcd, 0x4a, 0x3b, 0x31, + 0x14, 0xc5, 0x3b, 0x7f, 0x68, 0xe1, 0x1f, 0x37, 0x92, 0x65, 0x29, 0x11, 0x4a, 0x17, 0x5a, 0x35, + 0x71, 0xfa, 0xe1, 0x03, 0x88, 0x0b, 0x17, 0x2e, 0x54, 0x5c, 0xb9, 0x91, 0xcc, 0x18, 0x67, 0x06, + 0xda, 0x24, 0x4d, 0x32, 0xc5, 0x22, 0xdd, 0xf8, 0x04, 0x42, 0x5f, 0xc1, 0x85, 0x88, 0x0f, 0xe2, + 0xb2, 0xe0, 0xc6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3b, 0x4b, 0x94, 0x4b, 0xa5, 0x39, 0xa0, 0x5b, + 0xc0, 0x91, 0xb1, 0x35, 0x2c, 0x1b, 0x82, 0xb5, 0xef, 0xd9, 0x64, 0x8a, 0xf2, 0xe0, 0x80, 0xff, + 0xf6, 0x66, 0x07, 0x54, 0x87, 0xb0, 0xbd, 0x6c, 0x1f, 0x12, 0x75, 0xce, 0xd6, 0x29, 0x66, 0xca, + 0xf0, 0x5a, 0x16, 0x6f, 0x0b, 0x36, 0x7f, 0x6b, 0x5d, 0x32, 0xe4, 0x64, 0xd8, 0xb6, 0x85, 0xe3, + 0xbd, 0xc3, 0xa7, 0x19, 0x72, 0xa6, 0x33, 0xe4, 0xbc, 0xce, 0x90, 0x73, 0x3b, 0x47, 0xa5, 0xe9, + 0x1c, 0x95, 0x5e, 0xe6, 0xa8, 0x74, 0xd6, 0x0a, 0x22, 0x13, 0xc6, 0x1e, 0xf6, 0x45, 0x9f, 0x64, + 0xbf, 0x64, 0x5b, 0xa8, 0x20, 0x5f, 0x93, 0x61, 0x97, 0x5c, 0x2d, 0xf2, 0xcd, 0x48, 0x32, 0xed, + 0x55, 0xec, 0xdb, 0x6f, 0xbf, 0x07, 0x00, 0x00, 0xff, 0xff, 0x63, 0xe0, 0x46, 0x3b, 0x78, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/transfer/types/tx.go b/x/transfer/types/tx.go index ada5bc1ae..e87ce7e09 100644 --- a/x/transfer/types/tx.go +++ b/x/transfer/types/tx.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" "google.golang.org/grpc" - feerefundertypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" + feerefundertypes "github.com/neutron-org/neutron/v5/x/feerefunder/types" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/transfer/types/tx.pb.go b/x/transfer/types/tx.pb.go index 94361dafa..b2e46f9df 100644 --- a/x/transfer/types/tx.pb.go +++ b/x/transfer/types/tx.pb.go @@ -13,7 +13,7 @@ import ( proto "github.com/cosmos/gogoproto/proto" types3 "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" types1 "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - types2 "github.com/neutron-org/neutron/v4/x/feerefunder/types" + types2 "github.com/neutron-org/neutron/v5/x/feerefunder/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -234,50 +234,50 @@ func init() { func init() { proto.RegisterFile("neutron/transfer/v1/tx.proto", fileDescriptor_c44193c4a9c18e30) } var fileDescriptor_c44193c4a9c18e30 = []byte{ - // 686 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4f, 0x6f, 0xd3, 0x4a, - 0x10, 0x8f, 0x5f, 0xd2, 0xb4, 0xdd, 0xbc, 0xfe, 0x79, 0xdb, 0xf7, 0x5a, 0x37, 0x6a, 0xed, 0x3e, - 0x0b, 0xa4, 0x52, 0xc4, 0x9a, 0x04, 0x10, 0x52, 0x4f, 0x28, 0x95, 0x10, 0x95, 0xa8, 0x14, 0x59, - 0xe5, 0x82, 0x90, 0x8a, 0xe3, 0x4c, 0x1c, 0x8b, 0x78, 0xd7, 0xec, 0x6e, 0xa2, 0xf6, 0x82, 0x10, - 0xa7, 0x1e, 0xf9, 0x08, 0xfd, 0x08, 0xfd, 0x00, 0x7c, 0x80, 0x1e, 0x7b, 0xe4, 0x14, 0xa1, 0xf6, - 0x50, 0xce, 0xbd, 0x72, 0x41, 0x5e, 0xaf, 0xd3, 0xa4, 0x42, 0x70, 0xca, 0xcc, 0xfc, 0x7e, 0x33, - 0xe3, 0xf9, 0xcd, 0x6c, 0xd0, 0x1a, 0x85, 0xbe, 0xe4, 0x8c, 0xba, 0x92, 0xfb, 0x54, 0x74, 0x80, - 0xbb, 0x83, 0x9a, 0x2b, 0x0f, 0x49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 0xd1, 0x2a, 0xab, 0xe7, 0xff, 0xe8, - 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x33, 0x1a, 0x12, 0x42, 0xec, 0x04, 0x00, 0x00, + // 685 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4f, 0x4f, 0xdb, 0x4a, + 0x10, 0x8f, 0x5f, 0x42, 0x80, 0xcd, 0xe3, 0xcf, 0x5b, 0xde, 0x03, 0x13, 0x81, 0xcd, 0xb3, 0x5a, + 0x89, 0x52, 0x75, 0xdd, 0xa4, 0x42, 0x95, 0x38, 0x55, 0x41, 0xaa, 0x8a, 0x54, 0xa4, 0xc8, 0xa2, + 0x97, 0xaa, 0x12, 0x75, 0x9c, 0x89, 0x63, 0x35, 0xde, 0x75, 0x77, 0x37, 0x11, 0x5c, 0xaa, 0xaa, + 0x27, 0x8e, 0xfd, 0x08, 0x7c, 0x04, 0x3e, 0x40, 0x3f, 0x00, 0x47, 0x8e, 0x3d, 0x45, 0x15, 0x1c, + 0xe8, 0x99, 0x6b, 0x2f, 0x95, 0xd7, 0xeb, 0x90, 0xa0, 0xaa, 0x3d, 0x65, 0x66, 0x7e, 0xbf, 0x99, + 0xf1, 0xfc, 0x66, 0x36, 0x68, 0x8d, 0x42, 0x5f, 0x72, 0x46, 0x5d, 0xc9, 0x7d, 0x2a, 0x3a, 0xc0, + 0xdd, 0x41, 0xcd, 0x95, 0x47, 0x24, 0xe1, 0x4c, 0x32, 0xbc, 0xa8, 0x51, 0x92, 0xa3, 0x55, 0x2b, + 0x60, 0x22, 0x66, 0xc2, 0x6d, 0xf9, 0x02, 0xdc, 0x41, 0xad, 0x05, 0xd2, 0xaf, 0xb9, 0x01, 0x8b, + 0x68, 0x96, 0x51, 0x5d, 0xd1, 0x78, 0x2c, 0xc2, 0xb4, 0x52, 0x2c, 0x42, 0x0d, 0xfc, 0x1b, 0xb2, + 0x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7, 0x3d, 0xdc, + 0x40, 0xe5, 0x44, 0x31, 0x54, 0x8d, 0x4a, 0xfd, 0x9e, 0x12, 0x7f, 0xfc, 0xf0, 0x47, 0x4f, 0x2c, + 0x5d, 0x43, 0x56, 0x4d, 0x8f, 0xa4, 0x33, 0x77, 0x16, 0x4e, 0x46, 0x13, 0xa9, 0xa2, 0xce, 0x2a, + 0x5a, 0xb9, 0xd3, 0x3f, 0x9f, 0xaa, 0xfe, 0xc5, 0x40, 0xc5, 0x7d, 0x11, 0xe2, 0x26, 0x9a, 0x19, + 0x9d, 0xfb, 0x3a, 0xb9, 0xfb, 0x9a, 0xc9, 0x98, 0x20, 0xd5, 0xfb, 0xbf, 0x85, 0x47, 0x7a, 0xbd, + 0x41, 0x7f, 0x4f, 0x4c, 0xfc, 0xff, 0x2f, 0xd3, 0xc6, 0x29, 0xd5, 0x07, 0x7f, 0xa4, 0xe4, 0xd5, + 0xab, 0x53, 0x1f, 0xaf, 0xcf, 0xb6, 0x8c, 0xc6, 0xcb, 0xf3, 0x4b, 0xcb, 0xb8, 0xb8, 0xb4, 0x8c, + 0x6f, 0x97, 0x96, 0xf1, 0xf9, 0xca, 0x2a, 0x5c, 0x5c, 0x59, 0x85, 0xaf, 0x57, 0x56, 0xe1, 0x75, + 0x3d, 0x8c, 0x64, 0xb7, 0xdf, 0x22, 0x01, 0x8b, 0x5d, 0x5d, 0xf5, 0x11, 0xe3, 0x61, 0x6e, 0xbb, + 0x83, 0x6d, 0xf7, 0xe8, 0xf6, 0x3f, 0x44, 0x1e, 0x27, 0x20, 0x5a, 0x65, 0xf5, 0xfc, 0x9f, 0xfc, + 0x0c, 0x00, 0x00, 0xff, 0xff, 0xa4, 0xbc, 0x0f, 0xa5, 0xec, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used.