diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 00c4e3d23..283c785ff 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -16,7 +16,7 @@ v Please also ensure that this is not a duplicate issue :) ## Version - + ## Steps to Reproduce diff --git a/.github/workflows/build_go.yml b/.github/workflows/build_go.yml index 8aaf912b3..cf6479a71 100644 --- a/.github/workflows/build_go.yml +++ b/.github/workflows/build_go.yml @@ -51,11 +51,11 @@ jobs: - name: Display go version if: env.GIT_DIFF run: go version - - name: Build quasarnoded + - name: Build quasard if: env.GIT_DIFF run: make build-reproducible-${{ matrix.arch }} - uses: actions/upload-artifact@v3 if: env.GIT_DIFF with: - name: quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }} - path: build/quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }} \ No newline at end of file + name: quasard-${{ matrix.targetos }}-${{ matrix.arch }} + path: build/quasard-${{ matrix.targetos }}-${{ matrix.arch }} \ No newline at end of file diff --git a/.github/workflows/lint_go.yml b/.github/workflows/lint_go.yml index c72232476..af658f8d1 100644 --- a/.github/workflows/lint_go.yml +++ b/.github/workflows/lint_go.yml @@ -1,9 +1,11 @@ name: Lint (Go) +# todo remove v3.x beafore merge to main on: pull_request: branches: - main + - v3.x paths-ignore: - 'smart-contracts/**' - '**.md' @@ -39,10 +41,10 @@ jobs: if: env.GIT_DIFF uses: actions/setup-go@v4 with: - go-version: 1.21 + go-version: 1.22 - name: Display go version if: env.GIT_DIFF run: go version - name: Go lint if: env.GIT_DIFF - run: make lint \ No newline at end of file + run: make lint diff --git a/.github/workflows/test_go.yml b/.github/workflows/test_go.yml index 53c7277d2..dea30bbbe 100644 --- a/.github/workflows/test_go.yml +++ b/.github/workflows/test_go.yml @@ -38,7 +38,7 @@ jobs: if: env.GIT_DIFF uses: actions/setup-go@v3 with: - go-version: 1.21 + go-version: 1.22 - name: Display go version if: env.GIT_DIFF run: go version diff --git a/.gitignore b/.gitignore index 51b1b4015..6d54347cd 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ vue/ **/**/target **/**/test-tube-build local_testnet_run-*nodes/ +*.out +coverage.txt **/Cargo.lock containers_homes/ diff --git a/Dockerfile b/Dockerfile index 10dd1e1b8..5aea82ce8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,24 @@ # syntax=docker/dockerfile:1 -ARG GO_VERSION="1.20" +ARG GO_VERSION="1.22" ARG RUNNER_IMAGE="gcr.io/distroless/static-debian11" +ARG BUILD_TAGS="netgo,ledger,muslc" # -------------------------------------------------------- # 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 RUN apk add --no-cache \ ca-certificates \ build-base \ - linux-headers + linux-headers \ + binutils-gold # Download go dependencies WORKDIR /quasar @@ -25,44 +28,40 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ go mod download # Cosmwasm - Download correct libwasmvm version -RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \ - wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \ - -O /lib/libwasmvm_muslc.a && \ +RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | cut -d ' ' -f 2) && \ + wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \ + -O /lib/libwasmvm_muslc.$(uname -m).a && \ # verify checksum wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \ - sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1) + sha256sum /lib/libwasmvm_muslc.$(uname -m).a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1) # Copy the remaining files COPY . . -# Build quasarnoded binary -# force it to use static lib (from above) not standard libgo_cosmwasm.so file -# then log output of file /quasar/build/quasarnoded -# then ensure static linking +# Build quasard binary RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/root/go/pkg/mod \ GOWORK=off go build \ - -mod=readonly \ - -tags "netgo,ledger,muslc" \ - -ldflags \ - "-X github.com/cosmos/cosmos-sdk/version.Name="quasar" \ - -X github.com/cosmos/cosmos-sdk/version.AppName="quasarnoded" \ - -X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \ - -X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \ - -X github.com/cosmos/cosmos-sdk/version.BuildTags='netgo,ledger,muslc' \ - -w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \ - -trimpath \ - -o build/quasarnoded \ - /quasar/cmd/quasarnoded/main.go - + -mod=readonly \ + -tags "netgo,ledger,muslc" \ + -ldflags \ + "-X github.com/cosmos/cosmos-sdk/version.Name="quasar" \ + -X github.com/cosmos/cosmos-sdk/version.AppName="quasard" \ + -X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \ + -X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \ + -X github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS} \ + -w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \ + -trimpath \ + -o /quasar/build/quasard \ + /quasar/cmd/quasard/main.go # -------------------------------------------------------- # Runner # -------------------------------------------------------- -FROM ${RUNNER_IMAGE} as runner +FROM ${RUNNER_IMAGE} -COPY --from=builder /quasar/build/quasarnoded /bin/quasarnoded +COPY --from=builder /quasar/build/quasard /bin/quasard ENV HOME /quasar WORKDIR $HOME @@ -71,34 +70,4 @@ EXPOSE 26656 EXPOSE 26657 EXPOSE 1317 -CMD ["quasarnoded"] - -# -------------------------------------------------------- -# Development -# -------------------------------------------------------- - -FROM ubuntu:22.04 as dev - -ENV PACKAGES jq - -RUN rm -f /etc/apt/apt.conf.d/docker-clean -RUN --mount=type=cache,target=/var/cache/apt \ - apt-get update && apt-get install -y $PACKAGES - - -COPY --from=builder /quasar/build/quasarnoded /bin/quasarnoded - - -ENV HOME /quasar -WORKDIR $HOME - -COPY tests/docker/bootstrap-scripts/entrypoint.sh /quasar/entrypoint.sh -COPY tests/docker/bootstrap-scripts/quasar_localnet.sh /quasar/app_init.sh -RUN chmod +x entrypoint.sh && chmod +x app_init.sh && mkdir logs - -EXPOSE 26656 -EXPOSE 26657 -EXPOSE 1317 - -CMD ["quasarnoded"] -ENTRYPOINT ["./entrypoint.sh"] +ENTRYPOINT ["quasard"] diff --git a/LOCALNET.md b/LOCALNET.md index ff6358b89..01711e4a9 100644 --- a/LOCALNET.md +++ b/LOCALNET.md @@ -90,7 +90,7 @@ Then make sure the upgrade is registered in the `app.go`: ```golang // imports // ... -dummy "github.com/quasarlabs/quasarnode/app/upgrades/dummy" +dummy "github.com/quasar-finance/quasar/app/upgrades/dummy" // var block declaration // ... diff --git a/Makefile b/Makefile index 744505942..04f8d9227 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,29 @@ #!/usr/bin/make -f +include scripts/makefiles/build.mk +include scripts/makefiles/docker.mk +include scripts/makefiles/lint.mk +include scripts/makefiles/proto.mk +include scripts/makefiles/test.mk +include tests/e2e/Makefile + +.DEFAULT_GOAL := help +help: + @echo "Available top-level commands:" + @echo "" + @echo "Usage:" + @echo " make [command]" + @echo "" + @echo " make build Build quasard binary" + @echo " make build-help Show available build commands" + @echo " make docker Show available docker commands" + @echo " make e2e Show available e2e commands" + @echo " make install Install quasard binary" + @echo " make lint Show available lint commands" + @echo " make test Show available test commands" + @echo "" + @echo "Run 'make [subcommand]' to see the available commands for each subcommand." + VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') COMMIT := $(shell git log -1 --format='%H') LEDGER_ENABLED ?= true @@ -7,27 +31,18 @@ SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) DOCKER := $(shell which docker) GOMOD := $(shell go list -m) +GO_MODULE := $(shell cat go.mod | grep "module " | cut -d ' ' -f 2) +GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1) +GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) +# minimum supported Go version +GO_MINIMUM_MAJOR_VERSION = $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f2 | cut -d'.' -f1) +GO_MINIMUM_MINOR_VERSION = $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f2 | cut -d'.' -f2) + BUILDDIR ?= $(CURDIR)/build MOCKSDIR = $(CURDIR)/testutil/mock export GO111MODULE = on -## Helper function to show help with `make` or `make help` - -.DEFAULT_GOAL := help - -HELP_FUN = \ - %help; while(<>){push@{$$help{$$2//'targets'}},[$$1,$$3] \ - if/^([\w-_]+)\s*:.*\#\#(?:@(\w+))?\s(.*)$$/}; \ - print"$$_:\n", map" $$_->[0]".(" "x(40-length($$_->[0])))."$$_->[1]\n",\ - @{$$help{$$_}},"\n" for keys %help; \ - -help: ##@misc Show this help - @echo "Usage: make [target] ...\n" - @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST) - - - # process build tags build_tags = netgo @@ -71,7 +86,7 @@ build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) # process linker flags ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=quasar \ - -X github.com/cosmos/cosmos-sdk/version.AppName=quasarnoded \ + -X github.com/cosmos/cosmos-sdk/version.AppName=quasard \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" @@ -106,97 +121,48 @@ ifeq (,$(findstring nostrip,$(QUASAR_BUILD_OPTIONS))) endif ############################################################################### -### Build ### +### Build & Install ### ############################################################################### -all: install lint test - -BUILD_TARGETS := build install -#BUILD_TARGETS_DEBUG := build install -build: BUILD_ARGS=-o $(BUILDDIR)/ +update-deps: + @go mod tidy; -$(BUILD_TARGETS): go.sum $(BUILDDIR)/ - go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./cmd/quasarnoded +build: build-check-version go.sum + # back up before build + @cp go.mod go.mod.backup + @cp go.sum go.sum.backup + @go mod tidy -$(BUILD_TARGETS_DEBUG): go.sum $(BUILDDIR)/ - go $@ -mod=readonly $(BUILD_FLAGS_DEBUG) -gcflags='all=-N -l' $(BUILD_ARGS) ./cmd/quasarnoded - -$(BUILDDIR)/: mkdir -p $(BUILDDIR)/ + GOWORK=off go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ $(GO_MODULE)/cmd/quasard -# Cross-building for arm64 from amd64 (or viceversa) takes -# a lot of time due to QEMU virtualization but it's the only way (afaik) -# to get a statically linked binary with CosmWasm - -build-reproducible: build-reproducible-amd64 build-reproducible-arm64 + # clean up before install + @mv go.mod.backup go.mod + @mv go.sum.backup go.sum + @rm -f go.mod.bak + @go mod tidy -build-reproducible-amd64: $(BUILDDIR)/ - $(DOCKER) buildx create --name quasarbuilder || true - $(DOCKER) buildx use quasarbuilder - $(DOCKER) buildx build \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - --platform linux/amd64 \ - -t quasar-amd64 \ - --load \ - -f Dockerfile . - $(DOCKER) rm -f quasarbinary || true - $(DOCKER) create -ti --name quasarbinary quasar-amd64 - $(DOCKER) cp quasarbinary:/bin/quasarnoded $(BUILDDIR)/quasarnoded-linux-amd64 - $(DOCKER) rm -f quasarbinary +install: build-check-version go.sum + # back up before build + @cp go.mod go.mod.backup + @cp go.sum go.sum.backup + @go mod tidy -build-reproducible-arm64: $(BUILDDIR)/ - $(DOCKER) buildx create --name quasarbuilder || true - $(DOCKER) buildx use quasarbuilder - $(DOCKER) buildx build \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - --platform linux/arm64 \ - -t quasar-arm64 \ - --load \ - -f Dockerfile . - $(DOCKER) rm -f quasarbinary || true - $(DOCKER) create -ti --name quasarbinary quasar-arm64 - $(DOCKER) cp quasarbinary:/bin/quasarnoded $(BUILDDIR)/quasarnoded-linux-arm64 - $(DOCKER) rm -f quasarbinary + GOWORK=off go install -mod=readonly $(BUILD_FLAGS) $(GO_MODULE)/cmd/quasard -build-linux: go.sum - LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build - -go.sum: go.mod - @echo "--> Ensure dependencies have not been modified" - @go mod verify + # clean up before install + @mv go.mod.backup go.mod + @mv go.sum.backup go.sum + @rm -f go.mod.bak + @go mod tidy ############################################################################### -### Proto & Mock Generation ### +### Go Mock ### ############################################################################### -proto-all: proto-format proto-gen -BUF_VERSION=1.26.1 -BUILDER_VERSION=0.13.5 -proto-gen: - @echo "Generating Protobuf files" - @sh ./scripts/protocgen.sh - -proto-gen-1: - @echo "🤖 Generating code from protobuf..." - @echo "PWD is $(PWD)" - - @docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \ - ghcr.io/cosmos/proto-builder:$(BUILDER_VERSION) sh ./scripts/protocgen.sh - @echo "✅ Completed code generation!" - -proto-doc: - @echo "Generating Protoc docs" - @sh ./scripts/generate-docs.sh - -.PHONY: proto-gen proto-doc - -mocks: $(MOCKSDIR)/ +# todo : need ideas on external libraries +# example : mockgen -source=/path/to/go/pkg/mod/github.com/cosmos/ibc-go/v7@v7.4.0/modules/core/05-port/types/module.go -destination=/path/to/quasar/mock/ics4_wrapper_mocks.go -package=mock -mock_names=MockICS4Wrapper +mocks: $(MOCKSDIR)/ mockgen -package=mock -destination=$(MOCKSDIR)/ibc_channel_mocks.go $(GOMOD)/x/qoracle/types ChannelKeeper # mockgen -package=mock -destination=$(MOCKSDIR)/ica_mocks.go $(GOMOD)/x/intergamm/types ICAControllerKeeper # mockgen -package=mock -destination=$(MOCKSDIR)/ibc_mocks.go $(GOMOD)/x/intergamm/types IBCTransferKeeper @@ -208,157 +174,6 @@ mocks: $(MOCKSDIR)/ $(MOCKSDIR)/: mkdir -p $(MOCKSDIR)/ -############################################################################### -### Tests & Simulation ### -############################################################################### - -PACKAGES_UNIT=$(shell go list ./x/epochs/... ./x/qoracle/... ./x/tokenfactory/... | grep -E -v "simapp|e2e" | grep -E -v "x/qoracle/client/cli") -PACKAGES_E2E=$(shell go list ./... | grep '/tests/e2e') -PACKAGES_SIM=$(shell go list ./... | grep '/tests/simulator') -TEST_PACKAGES=./... - -include tests/e2e/Makefile - -test: test-unit test-build - -test-all: check test-race test-cover - -test-unit: - @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock norace' $(PACKAGES_UNIT) - -test-race: - @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' $(PACKAGES_UNIT) - -test-cover: - @VERSION=$(VERSION) go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic $(PACKAGES_UNIT) - -test-sim-suite: - @VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_SIM) - -test-sim-app: - @VERSION=$(VERSION) go test -mod=readonly -run ^TestFullAppSimulation -v $(PACKAGES_SIM) - -test-sim-determinism: - @VERSION=$(VERSION) go test -mod=readonly -run ^TestAppStateDeterminism -v $(PACKAGES_SIM) - -test-sim-bench: - @VERSION=$(VERSION) go test -benchmem -run ^BenchmarkFullAppSimulation -bench ^BenchmarkFullAppSimulation -cpuprofile cpu.out $(PACKAGES_SIM) - -benchmark: - @go test -mod=readonly -bench=. $(PACKAGES_UNIT) - -############################################################################### -### Docker ### -############################################################################### - -RUNNER_BASE_IMAGE_DISTROLESS := gcr.io/distroless/static-debian11 -RUNNER_BASE_IMAGE_ALPINE := alpine:3.17 -RUNNER_BASE_IMAGE_NONROOT := gcr.io/distroless/static-debian11:nonroot - -docker-build: - @DOCKER_BUILDKIT=1 docker build \ - -t quasar:local \ - -t quasar:local-distroless \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - -f Dockerfile . - -docker-build-distroless: docker-build - -docker-build-alpine: - @DOCKER_BUILDKIT=1 docker build \ - -t quasar:local-alpine \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_ALPINE) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - -f Dockerfile . - -docker-build-nonroot: - @DOCKER_BUILDKIT=1 docker build \ - -t quasar:local-nonroot \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_NONROOT) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - -f Dockerfile . - - -# This is not available to avoid missbehavior since it seems to be a bug in docker compose -p localenv: -# https://github.com/docker/compose/issues/10068 -# docker-compose-up-attached: ##@docker Run (and build if needed) env in docker compose. Attach if running in background. -# @echo "Launching local env with docker-compose" -# DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml up - -docker-compose-up: ##@docker Run local env, build only if no images available - @echo "Launching local env, building images if not available" - DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml up -d - -docker-compose-up-recreate: ##@docker DESTROY env containers and respawn them - @echo "Recreate local env (will destroy application state)" - DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml up -d --force-recreate - -docker-compose-build: ##@docker Build new image if there are code changes, won't recreate containers. - @echo "Rebuilding image for local env" - DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml build - -docker-compose-rebuild: docker-compose-build docker-compose-up-recreate ##@docker Recreate containers building new code if needed - @echo "Rebuilding images and restarting containers" - -docker-compose-stop: ##@docker Stop containers without deleting them - @echo "Stop docker containers without removing them" - DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml stop - -docker-compose-down: ##@docker Stop AND DELETE delete the containers - @echo "Stopping docker containers and REMOVING THEM" - DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml down - -docker-attach-quasar: ##@docker Connect to a terminal prompt in QUASAR node container - @echo "Connecting to quasar docker container" - docker exec -it localenv-quasar-1 /bin/bash - -docker-attach-osmosis: ##@docker Connect to a terminal prompt in OSMOSIS node container - @echo "Connecting to osmosis docker container" - docker exec -it localenv-osmosis-1 /bin/ash - -docker-attach-relayer: ##@docker Connect to a terminal prompt in RLY node container - @echo "Connecting to relayer docker container" - docker exec -it localenv-relayer-1 /bin/bash - -docker-test-e2e: docker-compose-up - @echo "Running e2e tests" - cd ./tests/shell/ && ./create_and_execute_contract.sh - -############################################################################### -### Docker E2E InterchainTest ### -############################################################################### - -docker-e2e-build: - $(eval CHAINS=$(filter-out $@,$(MAKECMDGOALS))) - @for chain in $(CHAINS); do \ - echo "Building $$chain"; \ - DOCKER_BUILDKIT=1 docker build \ - -t $$chain:local \ - -t $$chain:local-distroless \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - -f ./tests/e2e/dockerfiles/$$chain.Dockerfile . ;\ - done - -%: - @: - -############################################################################### -### Linting ### -############################################################################### - -lint: - @echo "--> Running linter" - @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m .PHONY: all build-linux install format lint build \ test test-all test-build test-cover test-unit test-race benchmark diff --git a/README.md b/README.md index 66583fff3..41854079b 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ x/qtransfer, x/epochs and x/tokenfactory module are utilised from the osmosis x/ ### Rust In order to run test-tube the following dependencies are required: * `sudo apt update && sudo apt install -y build-essential pkg-config libssl-dev curl clang libclang-dev` -* go1.21 ([see here](https://go.dev/doc/install)) +* go1.22 ([see here](https://go.dev/doc/install)) * libwasmvm ([see here](https://github.com/CosmWasm/wasmvm) -- !Instructions don't cover installation, copy the files to your desired install location or add the subfolder `wasmvm/internal/api` to your library paths) ## Git hooks diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 000000000..21dfd3d42 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,37 @@ +# Upgrading Quasar to v3 + +This guide provides instructions for upgrading to specific versions of Quasar. + +## [v3.x](https://github.com/quasar-finance/quasar/releases/tag/v3.0.0) + +### `Binary Name Change` +- This version contains binary name change from `quasarnoded` to `quasard` which requires changes in Cosmovisor settings. + +### `Feemarket Module Addition and Relayer Config Changes` + +- It contains Feemarket module addition with min gas fee. +This needs changes on relayer `gas-prices` to be set equal to params set in feemarket module. + +- Feemarket brings in variable gas depending on past few block usage which in turn will affect the `gas-adjustment` parameter as well. +It should ideally be set to 2 or above. + +### Packages + +New modules added : +- PFM v8 +- Ibc-hooks v8 +- Rate-limiting v8 +- Feemarket v1 + +Updates : +- Wasmd v0.45 to v0.51 +- Wasmvm from v1 to v2 +- Cosmos-SDK from v47.12 to v50.9 +- Ibc-go v7 to ibc-go v8 +- Contains updates of Async ICQ, wasm light clients and capability module. + +Upgrade removes old unused modules : +- `qVesting` +- `qOracle` +- `qTransfer` + diff --git a/ante/ante.go b/ante/ante.go index 258e1a973..822f7725d 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -1,35 +1,61 @@ package ante import ( + feemarketante "github.com/skip-mev/feemarket/x/feemarket/ante" + feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" + + ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + + corestoretypes "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + + quasarerrors "github.com/quasar-finance/quasar/types/errors" ) +// UseFeeMarketDecorator to make the integration testing easier: we can switch off its ante and post decorators with this flag +var UseFeeMarketDecorator = true + // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC // channel keeper. type HandlerOptions struct { ante.HandlerOptions - Codec codec.BinaryCodec - IBCkeeper *ibckeeper.Keeper + Codec codec.BinaryCodec + IBCkeeper *ibckeeper.Keeper + StakingKeeper *stakingkeeper.Keeper + FeeMarketKeeper *feemarketkeeper.Keeper + TxFeeChecker ante.TxFeeChecker + TXCounterStoreService corestoretypes.KVStoreService + WasmConfig *wasmtypes.WasmConfig } func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { if opts.AccountKeeper == nil { - return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") + return nil, errorsmod.Wrap(quasarerrors.ErrLogic, "account keeper is required for AnteHandler") } if opts.BankKeeper == nil { - return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") + return nil, errorsmod.Wrap(quasarerrors.ErrLogic, "bank keeper is required for AnteHandler") } if opts.SignModeHandler == nil { - return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for AnteHandler") + return nil, errorsmod.Wrap(quasarerrors.ErrLogic, "sign mode handler is required for AnteHandler") } if opts.IBCkeeper == nil { - return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "IBC keeper is required for AnteHandler") + return nil, errorsmod.Wrap(quasarerrors.ErrLogic, "IBC keeper is required for AnteHandler") + } + if opts.FeeMarketKeeper == nil { + return nil, errorsmod.Wrap(quasarerrors.ErrLogic, "FeeMarket keeper is required for AnteHandler") + } + + if opts.StakingKeeper == nil { + return nil, errorsmod.Wrap(quasarerrors.ErrNotFound, "staking param store is required for AnteHandler") } sigGasConsumer := opts.SigGasConsumer @@ -38,13 +64,16 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { } anteDecorators := []sdk.AnteDecorator{ - ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first + ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first + wasmkeeper.NewLimitSimulationGasDecorator(opts.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early + wasmkeeper.NewCountTXDecorator(opts.TXCounterStoreService), ante.NewExtensionOptionsDecorator(opts.ExtensionOptionChecker), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), ante.NewValidateMemoDecorator(opts.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper), - ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.TxFeeChecker), + NewGovVoteDecorator(opts.Codec, opts.StakingKeeper), + NewGovExpeditedProposalsDecorator(opts.Codec), ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators ante.NewValidateSigCountDecorator(opts.AccountKeeper), ante.NewSigGasConsumeDecorator(opts.AccountKeeper, sigGasConsumer), @@ -53,5 +82,16 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { ibcante.NewRedundantRelayDecorator(opts.IBCkeeper), } + if UseFeeMarketDecorator { + anteDecorators = append(anteDecorators, + feemarketante.NewFeeMarketCheckDecorator( + opts.FeeMarketKeeper, + ante.NewDeductFeeDecorator( + opts.AccountKeeper, + opts.BankKeeper, + opts.FeegrantKeeper, + opts.TxFeeChecker))) + } + return sdk.ChainAnteDecorators(anteDecorators...), nil } diff --git a/ante/gov_expedited_ante.go b/ante/gov_expedited_ante.go new file mode 100644 index 000000000..5bcfd49ec --- /dev/null +++ b/ante/gov_expedited_ante.go @@ -0,0 +1,79 @@ +package ante + +import ( + errorsmod "cosmossdk.io/errors" + quasarerrors "github.com/quasar-finance/quasar/types/errors" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" +) + +var expeditedPropDecoratorEnabled = true + +// SetExpeditedProposalsEnabled toggles the expedited proposals decorator on/off. +// Should only be used in testing - this is to allow simtests to pass. +func SetExpeditedProposalsEnabled(val bool) { + expeditedPropDecoratorEnabled = val +} + +var expeditedPropsWhitelist = map[string]struct{}{ + "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": {}, + "/cosmos.upgrade.v1beta1.MsgCancelUpgrade": {}, +} + +// Check if the proposal is whitelisted for expedited voting. +type GovExpeditedProposalsDecorator struct { + cdc codec.BinaryCodec +} + +func NewGovExpeditedProposalsDecorator(cdc codec.BinaryCodec) GovExpeditedProposalsDecorator { + return GovExpeditedProposalsDecorator{ + cdc: cdc, + } +} + +// AnteHandle checks if the proposal is whitelisted for expedited voting. +// Only proposals submitted using "quasard tx gov submit-proposal" can be expedited. +// Legacy proposals submitted using "quasard tx gov submit-legacy-proposal" cannot be marked as expedited. +func (g GovExpeditedProposalsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { + if expeditedPropDecoratorEnabled { + for _, msg := range tx.GetMsgs() { + prop, ok := msg.(*govv1.MsgSubmitProposal) + if !ok { + continue + } + if prop.Expedited { + if err := g.validateExpeditedGovProp(prop); err != nil { + return ctx, err + } + } + } + } + return next(ctx, tx, simulate) +} + +func (g GovExpeditedProposalsDecorator) isWhitelisted(msgType string) bool { + _, ok := expeditedPropsWhitelist[msgType] + return ok +} + +func (g GovExpeditedProposalsDecorator) validateExpeditedGovProp(prop *govv1.MsgSubmitProposal) error { + msgs := prop.GetMessages() + if len(msgs) == 0 { + return quasarerrors.ErrInvalidExpeditedProposal + } + for _, message := range msgs { + // in case of legacy content submitted using govv1.MsgSubmitProposal + if sdkMsg, isLegacy := message.GetCachedValue().(*govv1.MsgExecLegacyContent); isLegacy { + if !g.isWhitelisted(sdkMsg.Content.TypeUrl) { + return errorsmod.Wrapf(quasarerrors.ErrInvalidExpeditedProposal, "invalid Msg type: %s", sdkMsg.Content.TypeUrl) + } + continue + } + if !g.isWhitelisted(message.TypeUrl) { + return errorsmod.Wrapf(quasarerrors.ErrInvalidExpeditedProposal, "invalid Msg type: %s", message.TypeUrl) + } + } + return nil +} diff --git a/ante/gov_expedited_ante_test.go b/ante/gov_expedited_ante_test.go new file mode 100644 index 000000000..e3f72d739 --- /dev/null +++ b/ante/gov_expedited_ante_test.go @@ -0,0 +1,215 @@ +package ante_test + +import ( + "testing" + + "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/quasar-finance/quasar/ante" + "github.com/quasar-finance/quasar/testutil" + "github.com/stretchr/testify/require" +) + +func TestGovExpeditedProposalsDecorator(t *testing.T) { + quasarApp := testutil.Setup(t) + + testCases := []struct { + name string + ctx sdk.Context + msgs []sdk.Msg + expectErr bool + }{ + // these cases should pass + { + name: "expedited - govv1.MsgSubmitProposal - MsgSoftwareUpgrade", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{&upgradetypes.MsgSoftwareUpgrade{ + Authority: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + Plan: upgradetypes.Plan{ + Name: "upgrade plan-plan", + Info: "some text here", + Height: 123456789, + }, + }}, true), + }, + expectErr: false, + }, + { + name: "expedited - govv1.MsgSubmitProposal - MsgCancelUpgrade", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{&upgradetypes.MsgCancelUpgrade{ + Authority: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + }}, true), + }, + expectErr: false, + }, + { + name: "normal - govv1.MsgSubmitProposal - TextProposal", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newLegacyTextProp(false), // normal + }, + expectErr: false, + }, + { + name: "normal - govv1.MsgSubmitProposal - MsgCommunityPoolSpend", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{&distrtypes.MsgCommunityPoolSpend{ + Authority: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + Recipient: sdk.AccAddress{}.String(), + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), + }}, false), // normal + }, + expectErr: false, + }, + { + name: "normal - govv1.MsgSubmitProposal - MsgTransfer", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{&banktypes.MsgSend{ + FromAddress: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + ToAddress: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), + }}, false), // normal + }, + expectErr: false, + }, + { + name: "normal - govv1.MsgSubmitProposal - MsgUpdateParams", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{&banktypes.MsgUpdateParams{ + Authority: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + }}, false), + }, + expectErr: false, + }, + // legacy proposals - antehandler should not affect them + // submitted using "quasard tx gov submit-legacy-proposal" + { + name: "normal - govv1beta.MsgSubmitProposal - LegacySoftwareUpgrade", + ctx: sdk.Context{}, + msgs: []sdk.Msg{newGovV1BETA1LegacyUpgradeProp()}, + expectErr: false, + }, + { + name: "normal - govv1beta.MsgSubmitProposal - LegacyCancelSoftwareUpgrade", + ctx: sdk.Context{}, + msgs: []sdk.Msg{newGovV1BETA1LegacyCancelUpgradeProp()}, + expectErr: false, + }, + // these cases should fail + // these are normal proposals, not whitelisted for expedited voting + { + name: "fail - expedited - govv1.MsgSubmitProposal - Empty", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{}, true), + }, + expectErr: true, + }, + { + name: "fail - expedited - govv1.MsgSubmitProposal - TextProposal", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newLegacyTextProp(true), // expedite + }, + expectErr: true, + }, + { + name: "fail - expedited - govv1.MsgSubmitProposal - MsgCommunityPoolSpend", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{&distrtypes.MsgCommunityPoolSpend{ + Authority: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + Recipient: sdk.AccAddress{}.String(), + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), + }}, true), + }, + expectErr: true, + }, + { + name: "fail - expedited - govv1.MsgSubmitProposal - MsgTransfer", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{&banktypes.MsgSend{ + FromAddress: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + ToAddress: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), + }}, true), + }, + expectErr: true, + }, + { + name: "fail - expedited - govv1.MsgSubmitProposal - MsgUpdateParams", + ctx: sdk.Context{}, + msgs: []sdk.Msg{ + newGovProp([]sdk.Msg{&banktypes.MsgUpdateParams{ + Authority: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + }}, true), + }, + expectErr: true, + }, + } + + for _, tc := range testCases { + tc := tc + + t.Run(tc.name, func(t *testing.T) { + txCfg := quasarApp.GetTxConfig() + decorator := ante.NewGovExpeditedProposalsDecorator(quasarApp.AppCodec()) + + txBuilder := txCfg.NewTxBuilder() + require.NoError(t, txBuilder.SetMsgs(tc.msgs...)) + + _, err := decorator.AnteHandle(tc.ctx, txBuilder.GetTx(), false, + func(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) { return ctx, nil }) + if tc.expectErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func newLegacyTextProp(expedite bool) *govv1.MsgSubmitProposal { + testProposal := govv1beta1.NewTextProposal("Proposal", "Test as normal proposal") + msgContent, err := govv1.NewLegacyContent(testProposal, "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn") + if err != nil { + return nil + } + return newGovProp([]sdk.Msg{msgContent}, expedite) +} + +func newGovV1BETA1LegacyUpgradeProp() *govv1beta1.MsgSubmitProposal { + legacyContent := upgradetypes.NewSoftwareUpgradeProposal("test legacy upgrade", "test legacy upgrade", upgradetypes.Plan{ + Name: "upgrade plan-plan", + Info: "some text here", + Height: 123456789, + }) + + msg, _ := govv1beta1.NewMsgSubmitProposal(legacyContent, sdk.NewCoins(), sdk.AccAddress{}) + return msg +} + +func newGovV1BETA1LegacyCancelUpgradeProp() *govv1beta1.MsgSubmitProposal { + legacyContent := upgradetypes.NewCancelSoftwareUpgradeProposal("test legacy upgrade", "test legacy upgrade") + + msg, _ := govv1beta1.NewMsgSubmitProposal(legacyContent, sdk.NewCoins(), sdk.AccAddress{}) + return msg +} + +func newGovProp(msgs []sdk.Msg, expedite bool) *govv1.MsgSubmitProposal { + msg, _ := govv1.NewMsgSubmitProposal(msgs, sdk.NewCoins(), sdk.AccAddress{}.String(), "", "expedite", "expedite", expedite) + // fmt.Println("### msg ###", msg, "err", err) + return msg +} diff --git a/ante/gov_vote_ante.go b/ante/gov_vote_ante.go new file mode 100644 index 000000000..80b739b69 --- /dev/null +++ b/ante/gov_vote_ante.go @@ -0,0 +1,144 @@ +package ante + +import ( + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" + quasarerrors "github.com/quasar-finance/quasar/types/errors" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/authz" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +var ( + minStakedTokens = math.LegacyNewDec(1000000) // 1_000_000 uatom (or 1 atom) + maxDelegationsChecked = 100 // number of delegation to check for the minStakedTokens +) + +// SetMinStakedTokens sets the minimum amount of staked tokens required to vote +// Should only be used in testing +func SetMinStakedTokens(tokens math.LegacyDec) { + minStakedTokens = tokens +} + +type GovVoteDecorator struct { + stakingKeeper *stakingkeeper.Keeper + cdc codec.BinaryCodec +} + +func NewGovVoteDecorator(cdc codec.BinaryCodec, stakingKeeper *stakingkeeper.Keeper) GovVoteDecorator { + return GovVoteDecorator{ + stakingKeeper: stakingKeeper, + cdc: cdc, + } +} + +func (g GovVoteDecorator) AnteHandle( + ctx sdk.Context, tx sdk.Tx, + simulate bool, next sdk.AnteHandler, +) (newCtx sdk.Context, err error) { + // do not run check during simulations + if simulate { + return next(ctx, tx, simulate) + } + + msgs := tx.GetMsgs() + if err = g.ValidateVoteMsgs(ctx, msgs); err != nil { + return ctx, err + } + + return next(ctx, tx, simulate) +} + +// ValidateVoteMsgs checks if a voter has enough stake to vote +func (g GovVoteDecorator) ValidateVoteMsgs(ctx sdk.Context, msgs []sdk.Msg) error { + validMsg := func(m sdk.Msg) error { + var accAddr sdk.AccAddress + var err error + + switch msg := m.(type) { + case *govv1beta1.MsgVote: + accAddr, err = sdk.AccAddressFromBech32(msg.Voter) + if err != nil { + return err + } + case *govv1.MsgVote: + accAddr, err = sdk.AccAddressFromBech32(msg.Voter) + if err != nil { + return err + } + default: + // not a vote message - nothing to validate + return nil + } + + if minStakedTokens.IsZero() { + return nil + } + + enoughStake := false + delegationCount := 0 + stakedTokens := math.LegacyNewDec(0) + err = g.stakingKeeper.IterateDelegatorDelegations(ctx, accAddr, func(delegation stakingtypes.Delegation) bool { + validatorAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) + if err != nil { + panic(err) // shouldn't happen + } + validator, err := g.stakingKeeper.GetValidator(ctx, validatorAddr) + if err == nil { + shares := delegation.Shares + tokens := validator.TokensFromSharesTruncated(shares) + stakedTokens = stakedTokens.Add(tokens) + if stakedTokens.GTE(minStakedTokens) { + enoughStake = true + return true // break the iteration + } + } + delegationCount++ + // break the iteration if maxDelegationsChecked were already checked + return delegationCount >= maxDelegationsChecked + }) + if err != nil { + return err + } + + if !enoughStake { + return errorsmod.Wrapf(quasarerrors.ErrInsufficientStake, "insufficient stake for voting - min required %v", minStakedTokens) + } + + return nil + } + + validAuthz := func(execMsg *authz.MsgExec) error { + for _, v := range execMsg.Msgs { + var innerMsg sdk.Msg + if err := g.cdc.UnpackAny(v, &innerMsg); err != nil { + return errorsmod.Wrap(quasarerrors.ErrUnauthorized, "cannot unmarshal authz exec msgs") + } + if err := validMsg(innerMsg); err != nil { + return err + } + } + + return nil + } + + for _, m := range msgs { + if msg, ok := m.(*authz.MsgExec); ok { + if err := validAuthz(msg); err != nil { + return err + } + continue + } + + // validate normal msgs + if err := validMsg(m); err != nil { + return err + } + } + return nil +} diff --git a/ante/gov_vote_ante_test.go b/ante/gov_vote_ante_test.go new file mode 100644 index 000000000..28f4a9ad7 --- /dev/null +++ b/ante/gov_vote_ante_test.go @@ -0,0 +1,269 @@ +package ante_test + +import ( + "testing" + + "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/quasar-finance/quasar/ante" + "github.com/quasar-finance/quasar/testutil" + "github.com/stretchr/testify/require" +) + +// Test that the GovVoteDecorator rejects v1beta1 vote messages from accounts with less than 1 atom staked +// Submitting v1beta1.VoteMsg should not be possible through the CLI, but it's still possible to craft a transaction +func TestVoteSpamDecoratorGovV1Beta1(t *testing.T) { + quasarApp := testutil.Setup(t) + ctx := quasarApp.NewUncachedContext(true, tmproto.Header{}) + decorator := ante.NewGovVoteDecorator(quasarApp.AppCodec(), quasarApp.StakingKeeper) + stakingKeeper := quasarApp.StakingKeeper + + // Get validator + validators, err := stakingKeeper.GetAllValidators(ctx) + require.NoError(t, err) + valAddr1, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[0].GetOperator()) + require.NoError(t, err) + valAddr1 = sdk.ValAddress(valAddr1) + + // Create one more validator + pk := ed25519.GenPrivKeyFromSecret([]byte{uint8(13)}).PubKey() + validator2, err := stakingtypes.NewValidator( + sdk.ValAddress(pk.Address()).String(), + pk, + stakingtypes.Description{}, + ) + require.NoError(t, err) + valAddr2, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(validator2.GetOperator()) + valAddr2 = sdk.ValAddress(valAddr2) + require.NoError(t, err) + // Make sure the validator is bonded so it's not removed on Undelegate + validator2.Status = stakingtypes.Bonded + err = stakingKeeper.SetValidator(ctx, validator2) + require.NoError(t, err) + err = stakingKeeper.SetValidatorByConsAddr(ctx, validator2) + require.NoError(t, err) + err = stakingKeeper.SetNewValidatorByPowerIndex(ctx, validator2) + require.NoError(t, err) + err = stakingKeeper.Hooks().AfterValidatorCreated(ctx, valAddr2) + require.NoError(t, err) + + // Get delegator (this account was created during setup) + addr, err := quasarApp.AccountKeeper.Accounts.Indexes.Number.MatchExact(ctx, 0) + require.NoError(t, err) + delegator, err := sdk.AccAddressFromBech32(addr.String()) + require.NoError(t, err) + + tests := []struct { + name string + bondAmt math.Int + validators []sdk.ValAddress + expectPass bool + }{ + { + name: "delegate 0 atom", + bondAmt: math.ZeroInt(), + validators: []sdk.ValAddress{valAddr1}, + expectPass: false, + }, + { + name: "delegate 0.1 atom", + bondAmt: math.NewInt(100000), + validators: []sdk.ValAddress{valAddr1}, + expectPass: false, + }, + { + name: "delegate 1 atom", + bondAmt: math.NewInt(1000000), + validators: []sdk.ValAddress{valAddr1}, + expectPass: true, + }, + { + name: "delegate 1 atom to two validators", + bondAmt: math.NewInt(1000000), + validators: []sdk.ValAddress{valAddr1, valAddr2}, + expectPass: true, + }, + { + name: "delegate 0.9 atom to two validators", + bondAmt: math.NewInt(900000), + validators: []sdk.ValAddress{valAddr1, valAddr2}, + expectPass: false, + }, + { + name: "delegate 10 atom", + bondAmt: math.NewInt(10000000), + validators: []sdk.ValAddress{valAddr1}, + expectPass: true, + }, + } + + for _, tc := range tests { + // Unbond all tokens for this delegator + delegations, err := stakingKeeper.GetAllDelegatorDelegations(ctx, delegator) + require.NoError(t, err) + for _, del := range delegations { + valAddr, err := sdk.ValAddressFromBech32(del.GetValidatorAddr()) + require.NoError(t, err) + _, _, err = stakingKeeper.Undelegate(ctx, delegator, valAddr, del.GetShares()) + require.NoError(t, err) + } + + // Delegate tokens + if !tc.bondAmt.IsZero() { + amt := tc.bondAmt.Quo(math.NewInt(int64(len(tc.validators)))) + for _, valAddr := range tc.validators { + val, err := stakingKeeper.GetValidator(ctx, valAddr) + require.NoError(t, err) + _, err = stakingKeeper.Delegate(ctx, delegator, amt, stakingtypes.Unbonded, val, true) + require.NoError(t, err) + } + } + + // Create vote message + msg := govv1beta1.NewMsgVote( + delegator, + 0, + govv1beta1.OptionYes, + ) + + // Validate vote message + err = decorator.ValidateVoteMsgs(ctx, []sdk.Msg{msg}) + if tc.expectPass { + require.NoError(t, err, "expected %v to pass", tc.name) + } else { + require.Error(t, err, "expected %v to fail", tc.name) + } + } +} + +// Test that the GovVoteDecorator rejects v1 vote messages from accounts with less than 1 atom staked +// Usually, only v1.VoteMsg can be submitted using the CLI. +func TestVoteSpamDecoratorGovV1(t *testing.T) { + quasarApp := testutil.Setup(t) + ctx := quasarApp.NewUncachedContext(true, tmproto.Header{}) + decorator := ante.NewGovVoteDecorator(quasarApp.AppCodec(), quasarApp.StakingKeeper) + stakingKeeper := quasarApp.StakingKeeper + + // Get validator + validators, err := stakingKeeper.GetAllValidators(ctx) + require.NoError(t, err) + valAddr1, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[0].GetOperator()) + require.NoError(t, err) + valAddr1 = sdk.ValAddress(valAddr1) + + // Create one more validator + pk := ed25519.GenPrivKeyFromSecret([]byte{uint8(13)}).PubKey() + validator2, err := stakingtypes.NewValidator( + sdk.ValAddress(pk.Address()).String(), + pk, + stakingtypes.Description{}, + ) + require.NoError(t, err) + valAddr2, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(validator2.GetOperator()) + require.NoError(t, err) + valAddr2 = sdk.ValAddress(valAddr2) + // Make sure the validator is bonded so it's not removed on Undelegate + validator2.Status = stakingtypes.Bonded + err = stakingKeeper.SetValidator(ctx, validator2) + require.NoError(t, err) + err = stakingKeeper.SetValidatorByConsAddr(ctx, validator2) + require.NoError(t, err) + err = stakingKeeper.SetNewValidatorByPowerIndex(ctx, validator2) + require.NoError(t, err) + err = stakingKeeper.Hooks().AfterValidatorCreated(ctx, valAddr2) + require.NoError(t, err) + + // Get delegator (this account was created during setup) + addr, err := quasarApp.AccountKeeper.Accounts.Indexes.Number.MatchExact(ctx, 0) + require.NoError(t, err) + delegator, err := sdk.AccAddressFromBech32(addr.String()) + require.NoError(t, err) + + tests := []struct { + name string + bondAmt math.Int + validators []sdk.ValAddress + expectPass bool + }{ + { + name: "delegate 0 atom", + bondAmt: math.ZeroInt(), + validators: []sdk.ValAddress{valAddr1}, + expectPass: false, + }, + { + name: "delegate 0.1 atom", + bondAmt: math.NewInt(100000), + validators: []sdk.ValAddress{valAddr1}, + expectPass: false, + }, + { + name: "delegate 1 atom", + bondAmt: math.NewInt(1000000), + validators: []sdk.ValAddress{valAddr1}, + expectPass: true, + }, + { + name: "delegate 1 atom to two validators", + bondAmt: math.NewInt(1000000), + validators: []sdk.ValAddress{valAddr1, valAddr2}, + expectPass: true, + }, + { + name: "delegate 0.9 atom to two validators", + bondAmt: math.NewInt(900000), + validators: []sdk.ValAddress{valAddr1, valAddr2}, + expectPass: false, + }, + { + name: "delegate 10 atom", + bondAmt: math.NewInt(10000000), + validators: []sdk.ValAddress{valAddr1}, + expectPass: true, + }, + } + + for _, tc := range tests { + // Unbond all tokens for this delegator + delegations, err := stakingKeeper.GetAllDelegatorDelegations(ctx, delegator) + require.NoError(t, err) + for _, del := range delegations { + valAddr, err := sdk.ValAddressFromBech32(del.GetValidatorAddr()) + require.NoError(t, err) + _, _, err = stakingKeeper.Undelegate(ctx, delegator, valAddr, del.GetShares()) + require.NoError(t, err) + } + + // Delegate tokens + if !tc.bondAmt.IsZero() { + amt := tc.bondAmt.Quo(math.NewInt(int64(len(tc.validators)))) + for _, valAddr := range tc.validators { + val, err := stakingKeeper.GetValidator(ctx, valAddr) + require.NoError(t, err) + _, err = stakingKeeper.Delegate(ctx, delegator, amt, stakingtypes.Unbonded, val, true) + require.NoError(t, err) + } + } + + // Create vote message + msg := govv1.NewMsgVote( + delegator, + 0, + govv1.VoteOption_VOTE_OPTION_YES, + "new-v1-vote-message-test", + ) + + // Validate vote message + err = decorator.ValidateVoteMsgs(ctx, []sdk.Msg{msg}) + if tc.expectPass { + require.NoError(t, err, "expected %v to pass", tc.name) + } else { + require.Error(t, err, "expected %v to fail", tc.name) + } + } +} diff --git a/app/app.go b/app/app.go index 30f82f9ca..361d135fe 100644 --- a/app/app.go +++ b/app/app.go @@ -6,59 +6,68 @@ import ( "net/http" "os" "path/filepath" + "strings" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/core/appmodule" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" + "cosmossdk.io/math" + "cosmossdk.io/x/tx/signing" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/std" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" + sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth/ante" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" "github.com/cosmos/cosmos-sdk/x/crisis" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/cosmos/gogoproto/proto" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" ibcwasmkeeper "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper" ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types" + quasarante "github.com/quasar-finance/quasar/ante" + "github.com/quasar-finance/quasar/app/keepers" + "github.com/quasar-finance/quasar/app/openapiconsole" + appParams "github.com/quasar-finance/quasar/app/params" + "github.com/quasar-finance/quasar/app/upgrades" + v2 "github.com/quasar-finance/quasar/app/upgrades/v2" + v3 "github.com/quasar-finance/quasar/app/upgrades/v3" + "github.com/quasar-finance/quasar/docs" + feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" "github.com/spf13/cast" - - // Quasar imports - quasarante "github.com/quasarlabs/quasarnode/ante" - "github.com/quasarlabs/quasarnode/app/keepers" - "github.com/quasarlabs/quasarnode/app/openapiconsole" - appParams "github.com/quasarlabs/quasarnode/app/params" - "github.com/quasarlabs/quasarnode/app/upgrades" - v0 "github.com/quasarlabs/quasarnode/app/upgrades/v0" - v2 "github.com/quasarlabs/quasarnode/app/upgrades/v2" - "github.com/quasarlabs/quasarnode/docs" -) - -const ( - AccountAddressPrefix = "quasar" - Name = "quasarnode" ) var ( @@ -71,12 +80,13 @@ var ( // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. + // todo remove this before v50, keeping it here till we find a better way to handle it for test-setup ModuleBasics = module.NewBasicManager(AppModuleBasics...) // module account permissions maccPerms = ModuleAccountPermissions - Upgrades = []upgrades.Upgrade{v0.Upgrade, v2.Upgrade} + Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade} ) // overrideWasmVariables overrides the wasm variables to: @@ -88,7 +98,9 @@ func overrideWasmVariables() { } var ( + _ runtime.AppI = (*QuasarApp)(nil) _ servertypes.Application = (*QuasarApp)(nil) + _ ibctesting.TestingApp = (*QuasarApp)(nil) ) func init() { @@ -97,7 +109,7 @@ func init() { panic(err) } - DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) + DefaultNodeHome = filepath.Join(userHomeDir, "."+appParams.DirName) } // QuasarApp extends an ABCI application, but with most of its parameters exported. @@ -107,13 +119,15 @@ type QuasarApp struct { *baseapp.BaseApp *keepers.AppKeepers - cdc *codec.LegacyAmino + legacyAmino *codec.LegacyAmino appCodec codec.Codec + txConfig client.TxConfig interfaceRegistry types.InterfaceRegistry invCheckPeriod uint // mm is the module manager - mm *module.Manager + mm *module.Manager + ModuleBasics module.BasicManager // sm is the simulation manager sm *module.SimulationManager @@ -130,31 +144,52 @@ func New( skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, - encodingConfig appParams.EncodingConfig, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *QuasarApp { overrideWasmVariables() - appCodec := encodingConfig.Marshaler - cdc := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry + + // encoding config starts here + legacyAmino := codec.NewLegacyAmino() + interfaceRegistry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signing.Options{ + AddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + }, + ValidatorAddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), + }, + }, + }) + if err != nil { + panic(err) + } + appCodec := codec.NewProtoCodec(interfaceRegistry) + txConfig := authtx.NewTxConfig(appCodec, authtx.DefaultSignModes) + + std.RegisterLegacyAminoCodec(legacyAmino) + std.RegisterInterfaces(interfaceRegistry) + // encoding config ends here bApp := baseapp.NewBaseApp( - Name, + appParams.Name, logger, db, - encodingConfig.TxConfig.TxDecoder(), + txConfig.TxDecoder(), baseAppOptions..., ) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) + bApp.SetTxEncoder(txConfig.TxEncoder()) app := &QuasarApp{ AppKeepers: &keepers.AppKeepers{}, BaseApp: bApp, - cdc: cdc, + legacyAmino: legacyAmino, + txConfig: txConfig, appCodec: appCodec, interfaceRegistry: interfaceRegistry, invCheckPeriod: invCheckPeriod, @@ -170,7 +205,7 @@ func New( ibcWasmConfig := ibcwasmtypes.WasmConfig{ DataDir: filepath.Join(homePath, "ibc_08-wasm"), - SupportedCapabilities: "iterator,stargate,abort", + SupportedCapabilities: strings.Split("iterator,stargate,abort", ","), // put it as true whenever doing a local debug ContractDebugMode: false, } @@ -178,13 +213,20 @@ func New( // init special keepers app.InitSpecialKeepers( appCodec, - bApp, cdc, invCheckPeriod, skipUpgradeHeights, homePath) + bApp, + legacyAmino, + invCheckPeriod, + skipUpgradeHeights, + homePath, + logger, + appOpts, + ) // init normal keepers app.InitNormalKeepers( appCodec, - encodingConfig, bApp, + legacyAmino, maccPerms, dataDir, wasmDir, @@ -199,8 +241,29 @@ func New( // NOTE: Any module instantiated in the module manager that is later modified // must be passed by reference here. skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - app.mm = module.NewManager(appModules(app, encodingConfig, skipGenesisInvariants)...) + app.mm = module.NewManager(appModules(app, appCodec, txConfig, skipGenesisInvariants)...) + app.ModuleBasics = newBasicManagerFromManager(app) + + enabledSignModes := append([]sigtypes.SignMode(nil), authtx.DefaultSignModes...) + enabledSignModes = append(enabledSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL) + + txConfigOpts := authtx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), + } + txConfig, err = authtx.NewTxConfigWithOptions( + appCodec, + txConfigOpts, + ) + if err != nil { + panic(err) + } + app.txConfig = txConfig + // NOTE: upgrade module is required to be prioritized + app.mm.SetOrderPreBlockers( + upgradetypes.ModuleName, + ) // During begin block slashing happens after distr.BeginBlocker so that // there is nothing left over in the validator fee pool, so as to keep the // CanWithdrawInvariant invariant. @@ -220,11 +283,11 @@ func New( app.mm.SetOrderInitGenesis(orderInitBlockers()...) app.mm.RegisterInvariants(app.CrisisKeeper) - app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) - - // REFLECTION - SDK47 + err = app.mm.RegisterServices(app.configurator) + if err != nil { + panic(err) + } autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules)) @@ -234,33 +297,16 @@ func New( } reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) - /* TODO - SDK50 keeping in pending for now. - // app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + // add test gRPC service for testing gRPC queries in isolation + testdata.RegisterQueryServer(app.GRPCQueryRouter(), testdata.QueryImpl{}) + // create the simulation manager and define the order of the modules for deterministic simulations - app.sm = module.NewSimulationManager( - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - params.NewAppModule(app.ParamsKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - ibc.NewAppModule(app.IBCKeeper), - app.RawIcs20TransferAppModule, - epochsModule, - //qvestingModule, TODO fix or remove - // TODO fix qoracle testing for sim - // qoracleModule, - // TODO fix intergam genesis + testing first (right now, test code does not even compile...) - // intergammModule, - ) + // + // NOTE: this is not required apps that don't use the simulator for fuzz testing + // transactions + app.sm = module.NewSimulationManager(simulationModules(app, appCodec, skipGenesisInvariants)...) + app.sm.RegisterStoreDecoders() - */ // initialize stores app.MountKVStores(app.GetKVStoreKey()) @@ -272,20 +318,41 @@ func New( HandlerOptions: ante.HandlerOptions{ AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), FeegrantKeeper: app.FeeGrantKeeper, + SignModeHandler: txConfig.SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, - Codec: appCodec, - IBCkeeper: app.IBCKeeper, + Codec: appCodec, + IBCkeeper: app.IBCKeeper, + StakingKeeper: app.StakingKeeper, + FeeMarketKeeper: app.FeeMarketKeeper, + WasmConfig: &wasmConfig, + TXCounterStoreService: runtime.NewKVStoreService(app.AppKeepers.GetKey(wasmtypes.StoreKey)), + TxFeeChecker: func(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error) { + return minTxFeesChecker(ctx, tx, *app.FeeMarketKeeper) + }, }, ) if err != nil { panic(fmt.Errorf("failed to create AnteHandler: %s", err)) } + postHandlerOptions := PostHandlerOptions{ + AccountKeeper: app.AccountKeeper, + BankKeeper: app.BankKeeper, + FeeGrantKeeper: app.FeeGrantKeeper, + FeeMarketKeeper: app.FeeMarketKeeper, + } + postHandler, err := NewPostHandler(postHandlerOptions) + if err != nil { + panic(err) + } + app.SetAnteHandler(anteHandler) + app.SetPostHandler(postHandler) + app.SetInitChainer(app.InitChainer) + app.SetPreBlocker(app.PreBlocker) app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) @@ -321,7 +388,7 @@ func New( tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err)) } - if err := ibcwasmkeeper.InitializePinnedCodes(ctx, appCodec); err != nil { + if err := ibcwasmkeeper.InitializePinnedCodes(ctx); err != nil { tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err)) } } @@ -355,7 +422,6 @@ func (app *QuasarApp) setupUpgradeHandlers() { upgrade.CreateUpgradeHandler( app.mm, app.configurator, - app.BaseApp, app.AppKeepers, ), ) @@ -368,24 +434,47 @@ func (app *QuasarApp) Name() string { return app.BaseApp.Name() } // GetBaseApp returns the base app of the application func (app *QuasarApp) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } +// EmptyAppOptions is a stub implementing AppOptions +type EmptyAppOptions struct{} + +// EmptyWasmOptions is a stub implementing Wasmkeeper Option +var EmptyWasmOptions []wasmkeeper.Option + +// Get implements AppOptions +func (ao EmptyAppOptions) Get(_ string) interface{} { + return nil +} + +func (app *QuasarApp) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return app.mm.PreBlock(ctx) +} + // BeginBlocker application updates every begin block -func (app *QuasarApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) +func (app *QuasarApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { + return app.mm.BeginBlock(ctx) } // EndBlocker application updates every end block -func (app *QuasarApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) +func (app *QuasarApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + return app.mm.EndBlock(ctx) } // InitChainer application update at chain initialization -func (app *QuasarApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { +func (app *QuasarApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { var genesisState GenesisState if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) + if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()); err != nil { + panic(err) + } + + response, err := app.mm.InitGenesis(ctx, app.appCodec, genesisState) + if err != nil { + panic(err) + } + + return response, nil } // LoadHeight loads a particular height @@ -407,24 +496,23 @@ func (app *QuasarApp) ModuleAccountAddrs() map[string]bool { // addresses. func (app *QuasarApp) BlockedModuleAccountAddrs() map[string]bool { modAccAddrs := app.ModuleAccountAddrs() - // TODO: Investigate why gov module in removed from blocked list - // https://github.com/cosmos/gaia/blob/main/app/app.go#L280 + delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) return modAccAddrs } // RegisterNodeService registers the node gRPC Query service. -func (app *QuasarApp) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +func (app *QuasarApp) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) } -// LegacyAmino returns SimApp's amino codec. +// LegacyAmino returns SimApp's legacyAmino codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable // for modules to register their own custom testing types. func (app *QuasarApp) LegacyAmino() *codec.LegacyAmino { - return app.cdc + return app.legacyAmino } // AppCodec returns an app codec. @@ -455,10 +543,10 @@ func (app *QuasarApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.API // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register legacy and grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + app.ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register node gRPC service for grpc-gateway. nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) @@ -474,7 +562,7 @@ func (app *QuasarApp) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *QuasarApp) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( + cmtservice.RegisterTendermintService( clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, @@ -505,9 +593,68 @@ func (app *QuasarApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { } func (app *QuasarApp) GetTxConfig() client.TxConfig { - return MakeEncodingConfig().TxConfig + return app.txConfig } func (app *QuasarApp) GetStakingKeeper() ibctestingtypes.StakingKeeper { return app.StakingKeeper } + +// minTxFeesChecker will be executed only if the feemarket module is disabled. +// In this case, the auth module's DeductFeeDecorator is executed, and +// we use the minTxFeesChecker to enforce the minimum transaction fees. +// Min tx fees are calculated as gas_limit * feemarket_min_base_gas_price +func minTxFeesChecker(ctx sdk.Context, tx sdk.Tx, feemarketKp feemarketkeeper.Keeper) (sdk.Coins, int64, error) { + feeTx, ok := tx.(sdk.FeeTx) + if !ok { + return nil, 0, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") + } + + // To keep the gentxs with zero fees, we need to skip the validation in the first block + if ctx.BlockHeight() == 0 { + return feeTx.GetFee(), 0, nil + } + + feeMarketParams, err := feemarketKp.GetParams(ctx) + if err != nil { + return nil, 0, err + } + + feeRequired := sdk.NewCoins( + sdk.NewCoin( + feeMarketParams.FeeDenom, + feeMarketParams.MinBaseGasPrice.MulInt(math.NewIntFromUint64(feeTx.GetGas())).Ceil().RoundInt())) + + feeCoins := feeTx.GetFee() + if len(feeCoins) != 1 { + return nil, 0, fmt.Errorf( + "expected exactly one fee coin; got %s, required: %s", feeCoins.String(), feeRequired.String()) + } + + if !feeCoins.IsAnyGTE(feeRequired) { + return nil, 0, fmt.Errorf( + "not enough fees provided; got %s, required: %s", feeCoins.String(), feeRequired.String()) + } + + return feeTx.GetFee(), 0, nil +} + +// AutoCliOpts returns the autocli options for the app. +func (app *QuasarApp) AutoCliOpts() autocli.AppOptions { + modules := make(map[string]appmodule.AppModule, 0) + for _, m := range app.mm.Modules { + if moduleWithName, ok := m.(module.HasName); ok { + moduleName := moduleWithName.Name() + if appModule, ok := moduleWithName.(appmodule.AppModule); ok { + modules[moduleName] = appModule + } + } + } + + return autocli.AppOptions{ + Modules: modules, + AddressCodec: address.NewBech32Codec(appParams.Bech32PrefixAccAddr), + ValidatorAddressCodec: address.NewBech32Codec(appParams.Bech32PrefixValAddr), + ConsensusAddressCodec: address.NewBech32Codec(appParams.Bech32PrefixConsAddr), + } +} diff --git a/app/app_test.go b/app/app_test.go new file mode 100644 index 000000000..b47c3916a --- /dev/null +++ b/app/app_test.go @@ -0,0 +1,57 @@ +package app_test + +import ( + "os" + "testing" + + "cosmossdk.io/log" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + db "github.com/cosmos/cosmos-db" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/quasar-finance/quasar/app" + "github.com/quasar-finance/quasar/testutil" + "github.com/stretchr/testify/require" +) + +type EmptyAppOptions struct{} + +var emptyWasmOption []wasmkeeper.Option + +var tempDir = func() string { + dir, err := os.MkdirTemp("", ".quasarnode") + if err != nil { + dir = app.DefaultNodeHome + } + defer os.RemoveAll(dir) + + return dir +} + +func (ao EmptyAppOptions) Get(_ string) interface{} { + return nil +} + +func TestQuasarApp_BlockedModuleAccountAddrs(t *testing.T) { + app := app.New( + log.NewNopLogger(), + db.NewMemDB(), + nil, + true, + map[int64]bool{}, + tempDir(), + 0, + EmptyAppOptions{}, + emptyWasmOption, + ) + + blockedAddrs := app.BlockedModuleAccountAddrs() + + require.NotContains(t, blockedAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) +} + +func TestQuasarApp_Export(t *testing.T) { + app := testutil.Setup(t) + _, err := app.ExportAppStateAndValidators(true, []string{}, []string{}) + require.NoError(t, err, "ExportAppStateAndValidators should not have an error") +} diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go new file mode 100644 index 000000000..d2179101a --- /dev/null +++ b/app/apptesting/test_suite.go @@ -0,0 +1,529 @@ +package apptesting + +import ( + "encoding/json" + "fmt" + "os" + "testing" + "time" + + coreheader "cosmossdk.io/core/header" + "cosmossdk.io/log" + "cosmossdk.io/math" + storemetrics "cosmossdk.io/store/metrics" + "cosmossdk.io/store/rootmulti" + storetypes "cosmossdk.io/store/types" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/crypto/ed25519" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + "github.com/cosmos/cosmos-sdk/x/authz" + authzmod "github.com/cosmos/cosmos-sdk/x/authz/module" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/gogo/protobuf/proto" + "github.com/quasar-finance/quasar/app" + "github.com/quasar-finance/quasar/app/helpers" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" +) + +type KeeperTestHelper struct { + suite.Suite + + // defaults to false, + // set to true if any method that potentially alters baseapp/abci is used. + // this controls whether or not we can reuse the app instance, or have to set a new one. + hasUsedAbci bool + // defaults to false, set to true if we want to use a new app instance with caching enabled. + // then on new setup test call, we just drop the current cache. + // this is not always enabled, because some tests may take a painful performance hit due to CacheKv. + withCaching bool + + App *app.QuasarApp + Ctx sdk.Context + QueryHelper *baseapp.QueryServiceTestHelper + TestAccs []sdk.AccAddress +} + +var ( + TestDenom = "ustake" + TestFundAmount = math.NewInt(10000000000000000) + SecondaryAmount = math.NewInt(10000000000000000) + baseTestAccts = []sdk.AccAddress{} + defaultTestStartTime = time.Now().UTC() + testDescription = stakingtypes.NewDescription("test_moniker", "test_identity", "test_website", "test_security_contact", "test_details") +) + +func init() { + baseTestAccts = CreateRandomAccounts(3) +} + +// Setup sets up basic environment for suite (App, Ctx, and test accounts) +// preserves the caching enabled/disabled state. +func (s *KeeperTestHelper) Setup() { + dir, err := os.MkdirTemp("", "osmosisd-test-home") + if err != nil { + panic(fmt.Sprintf("failed creating temporary directory: %v", err)) + } + s.T().Cleanup(func() { os.RemoveAll(dir); s.withCaching = false }) + s.App = helpers.SetupWithCustomHome(false, dir) + s.setupGeneral() + + // Manually set validator signing info, otherwise we panic + vals, err := s.App.StakingKeeper.GetAllValidators(s.Ctx) + if err != nil { + panic(err) + } + for _, val := range vals { + consAddr, _ := val.GetConsAddr() + signingInfo := slashingtypes.NewValidatorSigningInfo( + consAddr, + s.Ctx.BlockHeight(), + 0, + time.Unix(0, 0), + false, + 0, + ) + err := s.App.SlashingKeeper.SetValidatorSigningInfo(s.Ctx, consAddr, signingInfo) + if err != nil { + panic(err) + } + } +} + +func (s *KeeperTestHelper) SetupWithCustomChainId(chainId string) { + dir, err := os.MkdirTemp("", "quasard-test-home") + if err != nil { + panic(fmt.Sprintf("failed creating temporary directory: %v", err)) + } + s.T().Cleanup(func() { os.RemoveAll(dir); s.withCaching = false }) + s.App = helpers.SetupWithCustomHomeAndChainId(false, dir, chainId) + s.setupGeneralCustomChainId(chainId) + + // Manually set validator signing info, otherwise we panic + vals, err := s.App.StakingKeeper.GetAllValidators(s.Ctx) + if err != nil { + panic(err) + } + for _, val := range vals { + consAddr, _ := val.GetConsAddr() + signingInfo := slashingtypes.NewValidatorSigningInfo( + consAddr, + s.Ctx.BlockHeight(), + 0, + time.Unix(0, 0), + false, + 0, + ) + err := s.App.SlashingKeeper.SetValidatorSigningInfo(s.Ctx, consAddr, signingInfo) + if err != nil { + panic(err) + } + } +} + +// resets the test environment +// requires that all commits go through helpers in s. +// On first reset, will instantiate a new app, with caching enabled. +// NOTE: If you are using ABCI methods, usage of Reset vs Setup has not been well tested. +// It is believed to work, but if you get an odd error, try changing the call to this for setup to sanity check. +// what's supposed to happen is a new setup call, and reset just does that in such a case. +func (s *KeeperTestHelper) Reset() { + if s.hasUsedAbci || !s.withCaching { + s.withCaching = true + s.Setup() + } else { + s.setupGeneral() + } +} + +func (s *KeeperTestHelper) SetupWithLevelDb() func() { + app, cleanup := helpers.SetupTestingAppWithLevelDb(false) + s.App = app + s.setupGeneral() + return cleanup +} + +func (s *KeeperTestHelper) setupGeneral() { + s.setupGeneralCustomChainId("quasar-1") +} + +func (s *KeeperTestHelper) setupGeneralCustomChainId(chainId string) { + s.Ctx = s.App.BaseApp.NewContextLegacy(false, cmtproto.Header{Height: 1, ChainID: chainId, Time: defaultTestStartTime}) + if s.withCaching { + s.Ctx, _ = s.Ctx.CacheContext() + } + s.QueryHelper = &baseapp.QueryServiceTestHelper{ + GRPCQueryRouter: s.App.GRPCQueryRouter(), + Ctx: s.Ctx, + } + + s.SetEpochStartTime() + s.TestAccs = []sdk.AccAddress{} + s.TestAccs = append(s.TestAccs, baseTestAccts...) + s.hasUsedAbci = false +} + +func (s *KeeperTestHelper) SetupTestForInitGenesis() { + // Setting to True, leads to init genesis not running + s.App = helpers.Setup(true) + s.Ctx = s.App.BaseApp.NewContextLegacy(true, cmtproto.Header{}) + s.hasUsedAbci = true +} + +// RunTestCaseWithoutStateUpdates runs the testcase as a callback with the given name. +// Does not persist any state changes. This is useful when test suite uses common state setup +// but desures each test case to be run in isolation. +func (s *KeeperTestHelper) RunTestCaseWithoutStateUpdates(name string, cb func(t *testing.T)) { + originalCtx := s.Ctx + s.Ctx, _ = s.Ctx.CacheContext() + + s.T().Run(name, cb) + + s.Ctx = originalCtx +} + +func (s *KeeperTestHelper) SetEpochStartTime() { + epochsKeeper := s.App.EpochsKeeper + + for _, epoch := range epochsKeeper.AllEpochInfos(s.Ctx) { + epoch.StartTime = s.Ctx.BlockTime() + epochsKeeper.DeleteEpochInfo(s.Ctx, epoch.Identifier) + err := epochsKeeper.AddEpochInfo(s.Ctx, epoch) + if err != nil { + panic(err) + } + } +} + +// CreateTestContext creates a test context. +func (s *KeeperTestHelper) CreateTestContext() sdk.Context { + ctx, _ := s.CreateTestContextWithMultiStore() + return ctx +} + +// CreateTestContextWithMultiStore creates a test context and returns it together with multi store. +func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, storetypes.CommitMultiStore) { + db := dbm.NewMemDB() + logger := log.NewNopLogger() + + ms := rootmulti.NewStore(db, logger, storemetrics.NewNoOpMetrics()) + + return sdk.NewContext(ms, cmtproto.Header{}, false, logger), ms +} + +// CreateTestContext creates a test context. +func (s *KeeperTestHelper) Commit() { + _, err := s.App.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.Ctx.BlockHeight(), Time: s.Ctx.BlockTime()}) + if err != nil { + panic(err) + } + _, err = s.App.Commit() + if err != nil { + panic(err) + } + + newBlockTime := s.Ctx.BlockTime().Add(time.Second) + + header := s.Ctx.BlockHeader() + header.Time = newBlockTime + header.Height++ + + s.Ctx = s.App.BaseApp.NewUncachedContext(false, header).WithHeaderInfo(coreheader.Info{ + Height: header.Height, + Time: header.Time, + }) + + s.hasUsedAbci = true +} + +// FundAcc funds target address with specified amount. +func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins) { + err := testutil.FundAccount(s.Ctx, s.App.BankKeeper, acc, amounts) + s.Require().NoError(err) +} + +// FundModuleAcc funds target modules with specified amount. +func (s *KeeperTestHelper) FundModuleAcc(moduleName string, amounts sdk.Coins) { + err := testutil.FundModuleAccount(s.Ctx, s.App.BankKeeper, moduleName, amounts) + s.Require().NoError(err) +} + +func (s *KeeperTestHelper) MintCoins(coins sdk.Coins) { + err := s.App.BankKeeper.MintCoins(s.Ctx, minttypes.ModuleName, coins) + s.Require().NoError(err) +} + +// SetupValidator sets up a validator and returns the ValAddress. +func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress { + valPub := secp256k1.GenPrivKey().PubKey() + valAddr := sdk.ValAddress(valPub.Address()) + stakingParams, err := s.App.StakingKeeper.GetParams(s.Ctx) + s.Require().NoError(err) + bondDenom := stakingParams.BondDenom + bondAmt := sdk.DefaultPowerReduction + selfBond := sdk.NewCoins(sdk.Coin{Amount: bondAmt, Denom: bondDenom}) + + s.FundAcc(sdk.AccAddress(valAddr), selfBond) + + stakingCoin := sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: selfBond[0].Amount} + ZeroCommission := stakingtypes.NewCommissionRates(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()) + valCreateMsg, err := stakingtypes.NewMsgCreateValidator(valAddr.String(), valPub, stakingCoin, testDescription, ZeroCommission, math.OneInt()) + s.Require().NoError(err) + stakingMsgSvr := stakingkeeper.NewMsgServerImpl(s.App.StakingKeeper) + res, err := stakingMsgSvr.CreateValidator(s.Ctx, valCreateMsg) + s.Require().NoError(err) + s.Require().NotNil(res) + + val, err := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr) + s.Require().NoError(err) + + val = val.UpdateStatus(bondStatus) + err = s.App.StakingKeeper.SetValidator(s.Ctx, val) + s.Require().NoError(err) + + consAddr, err := val.GetConsAddr() + s.Suite.Require().NoError(err) + + signingInfo := slashingtypes.NewValidatorSigningInfo( + consAddr, + s.Ctx.BlockHeight(), + 0, + time.Unix(0, 0), + false, + 0, + ) + err = s.App.SlashingKeeper.SetValidatorSigningInfo(s.Ctx, consAddr, signingInfo) + s.Require().NoError(err) + + return valAddr +} + +// SetupMultipleValidators setups "numValidator" validators and returns their address in string +func (s *KeeperTestHelper) SetupMultipleValidators(numValidator int) []string { + valAddrs := []string{} + for i := 0; i < numValidator; i++ { + valAddr := s.SetupValidator(stakingtypes.Bonded) + valAddrs = append(valAddrs, valAddr.String()) + } + return valAddrs +} + +// BeginNewBlock starts a new block. +func (s *KeeperTestHelper) BeginNewBlock() { + var valAddr []byte + + validators, err := s.App.StakingKeeper.GetAllValidators(s.Ctx) + s.Require().NoError(err) + if len(validators) >= 1 { + valAddrFancy, err := validators[0].GetConsAddr() + s.Require().NoError(err) + valAddr = valAddrFancy + } else { + valAddrFancy := s.SetupValidator(stakingtypes.Bonded) + validator, _ := s.App.StakingKeeper.GetValidator(s.Ctx, valAddrFancy) + valAddr2, _ := validator.GetConsAddr() + valAddr = valAddr2 + } + + s.BeginNewBlockWithProposer(valAddr) +} + +// BeginNewBlockWithProposer begins a new block with a proposer. +func (s *KeeperTestHelper) BeginNewBlockWithProposer(proposer sdk.ValAddress) { + validator, err := s.App.StakingKeeper.GetValidator(s.Ctx, proposer) + s.Assert().NoError(err) + + valConsAddr, err := validator.GetConsAddr() + s.Require().NoError(err) + + valAddr := valConsAddr + + //Note : when we add any logic executed over some epochs use below logic + //epochIdentifier := s.App.EpochsKeeper.GetEpochInfo(s.Ctx,) + //epoch := s.App.EpochsKeeper.GetEpochInfo(s.Ctx, epochIdentifier) + newBlockTime := s.Ctx.BlockTime().Add(5 * time.Second) + //if executeNextEpoch { + // newBlockTime = s.Ctx.BlockTime().Add(epoch.Duration).Add(time.Second) + //} + + header := cmtproto.Header{Height: s.Ctx.BlockHeight() + 1, Time: newBlockTime} + s.Ctx = s.Ctx.WithBlockTime(newBlockTime).WithBlockHeight(s.Ctx.BlockHeight() + 1) + voteInfos := []abci.VoteInfo{{ + Validator: abci.Validator{Address: valAddr, Power: 1000}, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }} + s.Ctx = s.Ctx.WithVoteInfos(voteInfos) + + fmt.Println("beginning block ", s.Ctx.BlockHeight()) + + _, err = s.App.BeginBlocker(s.Ctx) + s.Require().NoError(err) + + s.Ctx = s.App.NewContextLegacy(false, header) + s.hasUsedAbci = true +} + +// EndBlock ends the block, and runs commit +func (s *KeeperTestHelper) EndBlock() { + _, err := s.App.EndBlocker(s.Ctx) + s.Require().NoError(err) + s.hasUsedAbci = true +} + +func (s *KeeperTestHelper) RunMsg(msg sdk.Msg) (*sdk.Result, error) { + router := s.App.GetBaseApp().MsgServiceRouter() + if handler := router.Handler(msg); handler != nil { + // ADR 031 request type routing + return handler(s.Ctx, msg) + } + s.FailNow("msg %v could not be ran", msg) + s.hasUsedAbci = true + return nil, fmt.Errorf("msg %v could not be ran", msg) +} + +// AllocateRewardsToValidator allocates reward tokens to a distribution module then allocates rewards to the validator address. +func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt math.Int) { + validator, err := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr) + s.Require().NoError(err) + + // allocate reward tokens to distribution module + coins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, rewardAmt)} + err = testutil.FundModuleAccount(s.Ctx, s.App.BankKeeper, distrtypes.ModuleName, coins) + s.Require().NoError(err) + + // allocate rewards to validator + s.Ctx = s.Ctx.WithBlockHeight(s.Ctx.BlockHeight() + 1) + decTokens := sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyMustNewDecFromStr("20000")}} + err = s.App.DistrKeeper.AllocateTokensToValidator(s.Ctx, validator, decTokens) + s.Require().NoError(err) +} + +// BuildTx builds a transaction. +func (s *KeeperTestHelper) BuildTx( + txBuilder client.TxBuilder, + msgs []sdk.Msg, + sigV2 signing.SignatureV2, + memo string, txFee sdk.Coins, + gasLimit uint64, +) authsigning.Tx { + err := txBuilder.SetMsgs(msgs[0]) + s.Require().NoError(err) + + err = txBuilder.SetSignatures(sigV2) + s.Require().NoError(err) + + txBuilder.SetMemo(memo) + txBuilder.SetFeeAmount(txFee) + txBuilder.SetGasLimit(gasLimit) + + return txBuilder.GetTx() +} + +// StateNotAltered validates that app state is not altered. Fails if it is. +func (s *KeeperTestHelper) StateNotAltered() { + oldState := s.App.ExportState(s.Ctx) + s.App.CommitMultiStore().Commit() + newState := s.App.ExportState(s.Ctx) + s.Require().Equal(oldState, newState) + s.hasUsedAbci = true +} + +func (s *KeeperTestHelper) SkipIfWSL() { + SkipIfWSL(s.T()) +} + +// SkipIfWSL skips tests if running on WSL +// This is a workaround to enable quickly running full unit test suite locally +// on WSL without failures. The failures are stemming from trying to upload +// wasm code. An OS permissioning issue. +func SkipIfWSL(t *testing.T) { + t.Helper() + skip := os.Getenv("SKIP_WASM_WSL_TESTS") + fmt.Println("SKIP_WASM_WSL_TESTS", skip) + if skip == "true" { + t.Skip("Skipping Wasm tests") + } +} + +// CreateRandomAccounts is a function return a list of randomly generated AccAddresses +func CreateRandomAccounts(numAccts int) []sdk.AccAddress { + testAddrs := make([]sdk.AccAddress, numAccts) + for i := 0; i < numAccts; i++ { + pk := ed25519.GenPrivKey().PubKey() + testAddrs[i] = sdk.AccAddress(pk.Address()) + } + + return testAddrs +} + +func TestMessageAuthzSerialization(t *testing.T, msg sdk.Msg, module module.AppModuleBasic) { + someDate := time.Date(1, 1, 1, 1, 1, 1, 1, time.UTC) + const ( + mockGranter string = "cosmos1abc" + mockGrantee string = "cosmos1xyz" + ) + + var ( + mockMsgGrant authz.MsgGrant + mockMsgRevoke authz.MsgRevoke + mockMsgExec authz.MsgExec + ) + + // mutates mockMsg + testSerDeser := func(msg proto.Message, mockMsg proto.Message) { + encCfg := moduletestutil.MakeTestEncodingConfig(authzmod.AppModuleBasic{}, module) + msgGrantBytes := json.RawMessage(sdk.MustSortJSON(encCfg.Codec.MustMarshalJSON(msg))) + err := encCfg.Codec.UnmarshalJSON(msgGrantBytes, mockMsg) + require.NoError(t, err) + } + + // Authz: Grant Msg + typeURL := sdk.MsgTypeURL(msg) + expiryTime := someDate.Add(time.Hour) + grant, err := authz.NewGrant(someDate, authz.NewGenericAuthorization(typeURL), &expiryTime) + require.NoError(t, err) + + msgGrant := authz.MsgGrant{Granter: mockGranter, Grantee: mockGrantee, Grant: grant} + testSerDeser(&msgGrant, &mockMsgGrant) + + // Authz: Revoke Msg + msgRevoke := authz.MsgRevoke{Granter: mockGranter, Grantee: mockGrantee, MsgTypeUrl: typeURL} + testSerDeser(&msgRevoke, &mockMsgRevoke) + + // Authz: Exec Msg + msgAny, err := cdctypes.NewAnyWithValue(msg) + require.NoError(t, err) + msgExec := authz.MsgExec{Grantee: mockGrantee, Msgs: []*cdctypes.Any{msgAny}} + testSerDeser(&msgExec, &mockMsgExec) + require.Equal(t, msgExec.Msgs[0].Value, mockMsgExec.Msgs[0].Value) +} + +func GenerateTestAddrs() (string, string) { + pk1 := ed25519.GenPrivKey().PubKey() + validAddr := sdk.AccAddress(pk1.Address()).String() + invalidAddr := sdk.AccAddress("invalid").String() + return validAddr, invalidAddr +} + +// RequireDecCoinsSlice compares two slices of DecCoins +func (s *KeeperTestHelper) RequireDecCoinsSlice(expected, actual []sdk.DecCoins) { + s.Require().Equal(len(expected), len(actual)) + for i := range actual { + s.Require().Equal(expected[i].String(), actual[i].String()) + } +} diff --git a/app/encoding.go b/app/encoding.go index 7ed8d71e9..a96573418 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -5,11 +5,10 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/x/auth/tx" - - "github.com/quasarlabs/quasarnode/app/params" + "github.com/quasar-finance/quasar/app/params" ) -// makeEncodingConfig creates an EncodingConfig for an amino based test configuration. +// makeEncodingConfig creates an EncodingConfig for an legacyAmino based test configuration. func makeEncodingConfig() params.EncodingConfig { amino := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() diff --git a/app/export.go b/app/export.go index 94985b385..687675ff6 100644 --- a/app/export.go +++ b/app/export.go @@ -2,8 +2,8 @@ package app import ( "encoding/json" - "log" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,11 +15,12 @@ import ( // ExportAppStateAndValidators exports the state of the application for a genesis // file. func (app *QuasarApp) ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, + forZeroHeight bool, + jailAllowedAddrs []string, + modulesToExport []string, ) (servertypes.ExportedApp, error) { - // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContextLegacy(true, tmproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. @@ -29,22 +30,23 @@ func (app *QuasarApp) ExportAppStateAndValidators( app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := app.mm.ExportGenesis(ctx, app.appCodec) - appState, err := json.MarshalIndent(genState, "", " ") + genState, err := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) if err != nil { return servertypes.ExportedApp{}, err } - validators, err := staking.WriteValidators(ctx, app.StakingKeeper) + appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err } + + validators, err := staking.WriteValidators(ctx, app.StakingKeeper) return servertypes.ExportedApp{ AppState: appState, Validators: validators, Height: height, ConsensusParams: app.BaseApp.GetConsensusParams(ctx), - }, nil + }, err } // prepare for fresh start at zero height @@ -64,7 +66,7 @@ func (app *QuasarApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs for _, addr := range jailAllowedAddrs { _, err := sdk.ValAddressFromBech32(addr) if err != nil { - log.Fatal(err) + panic(err) } allowedAddrsMap[addr] = true } @@ -75,18 +77,38 @@ func (app *QuasarApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs /* Handle fee distribution state. */ // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, err := app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + err := app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valAddr, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) if err != nil { - panic(err) + app.Logger().Error(err.Error(), "ValOperatorAddress", val.GetOperator()) + } + _, err = app.DistrKeeper.WithdrawValidatorCommission(ctx, valAddr) + if err != nil { + app.Logger().Error(err.Error(), "ValOperatorAddress", val.GetOperator()) } return false }) + if err != nil { + panic(err) + } // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) + dels, err := app.StakingKeeper.GetAllDelegations(ctx) + if err != nil { + panic(err) + } for _, delegation := range dels { - _, err := app.DistrKeeper.WithdrawDelegationRewards(ctx, delegation.GetDelegatorAddr(), delegation.GetValidatorAddr()) + valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) + if err != nil { + panic(err) + } + + delAddr, err := sdk.AccAddressFromBech32(delegation.DelegatorAddress) + if err != nil { + panic(err) + } + + _, err = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr) if err != nil { panic(err) } @@ -102,30 +124,65 @@ func (app *QuasarApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs height := ctx.BlockHeight() ctx = ctx.WithBlockHeight(0) + // reinitialize all validators (v0.46 version) + // app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + // // donate any unwithdrawn outstanding reward fraction tokens to the community pool + // scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) + // feePool := app.DistrKeeper.GetFeePool(ctx) + // feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) + // app.DistrKeeper.SetFeePool(ctx, feePool) + + // err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + // if err != nil { + // panic(err) + // } + // return false + // }) + // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + err = app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) + valAddr, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } + scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valAddr) + if err != nil { + panic(err) + } + feePool, err := app.DistrKeeper.FeePool.Get(ctx) + if err != nil { + panic(err) + } feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) - - err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + err = app.DistrKeeper.FeePool.Set(ctx, feePool) if err != nil { - log.Fatal(err) + panic(err) + } + if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, valAddr); err != nil { + panic(err) } return false }) + if err != nil { + panic(err) + } // reinitialize all delegations for _, del := range dels { - err := app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) + valAddr, err := sdk.ValAddressFromBech32(del.ValidatorAddress) if err != nil { - log.Fatal(err) + panic(err) } - err = app.DistrKeeper.Hooks().AfterDelegationModified(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) + delAddr, err := sdk.AccAddressFromBech32(del.DelegatorAddress) if err != nil { - log.Fatal(err) + panic(err) + } + if err := app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil { + panic(err) + } + if err := app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr); err != nil { + panic(err) } } @@ -135,61 +192,90 @@ func (app *QuasarApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs /* Handle staking state. */ // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + err = app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { for i := range red.Entries { red.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetRedelegation(ctx, red) + if err := app.StakingKeeper.SetRedelegation(ctx, red); err != nil { + panic(err) + } return false }) + if err != nil { + panic(err) + } // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { + err = app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { for i := range ubd.Entries { ubd.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + if err := app.StakingKeeper.SetUnbondingDelegation(ctx, ubd); err != nil { + panic(err) + } return false }) + if err != nil { + panic(err) + } // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. - keys := app.GetKVStoreKey() - store := ctx.KVStore(keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) - counter := int16(0) + store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey)) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) - for ; iter.Valid(); iter.Next() { - addr := sdk.ValAddress(iter.Key()[1:]) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { - panic("expected validator, not found") - } + counter := int16(0) - validator.UnbondingHeight = 0 - if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { - validator.Jailed = true + // Closure to ensure iterator doesn't leak. + func() { + defer iter.Close() + for ; iter.Valid(); iter.Next() { + addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) + validator, err := app.StakingKeeper.GetValidator(ctx, addr) + if err != nil { + panic("expected validator, not found") + } + + validator.UnbondingHeight = 0 + if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { + validator.Jailed = true + } + + if err = app.StakingKeeper.SetValidator(ctx, validator); err != nil { + panic(err) + } + + counter++ } + }() - app.StakingKeeper.SetValidator(ctx, validator) - counter++ - } - - iter.Close() - - if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil { + _, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + if err != nil { panic(err) } /* Handle slashing state. */ // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( + err = app.SlashingKeeper.IterateValidatorSigningInfos( ctx, func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + if err = app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info); err != nil { + panic(err) + } return false }, ) + if err != nil { + panic(err) + } +} + +func (app *QuasarApp) ExportState(ctx sdk.Context) map[string]json.RawMessage { + export, err := app.mm.ExportGenesis(ctx, app.AppCodec()) + if err != nil { + panic(err) + } + return export } diff --git a/app/genesis_account.go b/app/genesis_account.go new file mode 100644 index 000000000..3a3d86e2a --- /dev/null +++ b/app/genesis_account.go @@ -0,0 +1,56 @@ +package app + +import ( + "errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +var _ authtypes.GenesisAccount = (*SimGenesisAccount)(nil) + +// SimGenesisAccount defines a type that implements the GenesisAccount interface +// to be used for simulation accounts in the genesis state. +type SimGenesisAccount struct { + *authtypes.BaseAccount + + // vesting account fields + OriginalVesting sdk.Coins `json:"original_vesting" yaml:"original_vesting"` // total vesting coins upon initialization + DelegatedFree sdk.Coins `json:"delegated_free" yaml:"delegated_free"` // delegated vested coins at time of delegation + DelegatedVesting sdk.Coins `json:"delegated_vesting" yaml:"delegated_vesting"` // delegated vesting coins at time of delegation + StartTime int64 `json:"start_time" yaml:"start_time"` // vesting start time (UNIX Epoch time) + EndTime int64 `json:"end_time" yaml:"end_time"` // vesting end time (UNIX Epoch time) + + // module account fields + ModuleName string `json:"module_name" yaml:"module_name"` // name of the module account + ModulePermissions []string `json:"module_permissions" yaml:"module_permissions"` // permissions of module account +} + +// Validate checks for errors on the vesting and module account parameters +func (sga SimGenesisAccount) Validate() error { + if sga.OriginalVesting.IsAnyNil() { + return errors.New("OriginalVesting amount must not be nil") + } + + if !sga.OriginalVesting.IsZero() { + if sga.StartTime >= sga.EndTime { + return errors.New("vesting start-time cannot be before end-time") + } + } + + if sga.BaseAccount == nil { + return errors.New("BaseAccount must not be nil") + } + + if sga.ModuleName != "" { + ma := authtypes.ModuleAccount{ + BaseAccount: sga.BaseAccount, Name: sga.ModuleName, Permissions: sga.ModulePermissions, + } + + if err := ma.Validate(); err != nil { + return err + } + } + + return sga.BaseAccount.Validate() +} diff --git a/app/genesis_account_fuzz_test.go b/app/genesis_account_fuzz_test.go new file mode 100644 index 000000000..97edae4d5 --- /dev/null +++ b/app/genesis_account_fuzz_test.go @@ -0,0 +1,35 @@ +package app + +import ( + "runtime/debug" + "testing" + + fuzz "github.com/google/gofuzz" +) + +func TestFuzzGenesisAccountValidate(t *testing.T) { + if testing.Short() { + t.Skip("running in -short mode") + } + + t.Parallel() + + acct := new(SimGenesisAccount) + i := 0 + defer func() { + r := recover() + if r == nil { + return + } + + // Otherwise report on the configuration and iteration. + t.Fatalf("Failed SimGenesisAccount on iteration #%d: %#v\n\n%s\n\n%s", i, acct, r, debug.Stack()) + }() + + f := fuzz.New() + for i = 0; i < 1e5; i++ { + acct = new(SimGenesisAccount) + f.Fuzz(acct) + acct.Validate() //nolint:errcheck + } +} diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go new file mode 100644 index 000000000..ea9ecce81 --- /dev/null +++ b/app/helpers/test_helpers.go @@ -0,0 +1,197 @@ +package helpers + +import ( + "encoding/json" + "os" + "time" + + "cosmossdk.io/log" + "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/crypto/secp256k1" + tmtypes "github.com/cometbft/cometbft/types" + cosmosdb "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/baseapp" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/testutil/mock" + sims "github.com/cosmos/cosmos-sdk/testutil/sims" + 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" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/quasar-finance/quasar/app" +) + +func GenesisStateWithValSet(quasarApp *app.QuasarApp) app.GenesisState { + privVal := mock.NewPV() + pubKey, _ := privVal.GetPubKey() + validator := tmtypes.NewValidator(pubKey, 1) + valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + + // generate genesis account + senderPrivKey := secp256k1.GenPrivKey() + senderPrivKey.PubKey().Address() + acc := authtypes.NewBaseAccountWithAddress(senderPrivKey.PubKey().Address().Bytes()) + balances := []banktypes.Balance{} + + encCfg := app.MakeEncodingConfig() + genesisState := app.NewDefaultGenesisState(encCfg.Marshaler) + genAccs := []authtypes.GenesisAccount{acc} + authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) + genesisState[authtypes.ModuleName] = quasarApp.AppCodec().MustMarshalJSON(authGenesis) + + validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) + delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) + + bondAmt := sdk.DefaultPowerReduction + initValPowers := []abci.ValidatorUpdate{} + + for _, val := range valSet.Validators { + pk, _ := cryptocodec.FromCmtPubKeyInterface(val.PubKey) + pkAny, _ := codectypes.NewAnyWithValue(pk) + validator := stakingtypes.Validator{ + OperatorAddress: sdk.ValAddress(val.Address).String(), + ConsensusPubkey: pkAny, + Jailed: false, + Status: stakingtypes.Bonded, + Tokens: bondAmt, + DelegatorShares: math.LegacyOneDec(), + Description: stakingtypes.Description{}, + UnbondingHeight: int64(0), + UnbondingTime: time.Unix(0, 0).UTC(), + Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), + MinSelfDelegation: math.ZeroInt(), + } + validators = append(validators, validator) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), math.LegacyOneDec())) + + // add initial validator powers so consumer InitGenesis runs correctly + pub, _ := val.ToProto() + initValPowers = append(initValPowers, abci.ValidatorUpdate{ + Power: val.VotingPower, + PubKey: pub.PubKey, + }) + } + // set validators and delegations + stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations) + genesisState[stakingtypes.ModuleName] = quasarApp.AppCodec().MustMarshalJSON(stakingGenesis) + + totalSupply := sdk.NewCoins() + for _, b := range balances { + // add genesis acc tokens to total supply + totalSupply = totalSupply.Add(b.Coins...) + } + + for range delegations { + // add delegated tokens to total supply + totalSupply = totalSupply.Add(sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)) + } + + // add bonded amount to bonded pool module account + balances = append(balances, banktypes.Balance{ + Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), + Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)}, + }) + + // update total supply + bankGenesis := banktypes.NewGenesisState( + banktypes.DefaultGenesisState().Params, + balances, + totalSupply, + []banktypes.Metadata{}, + []banktypes.SendEnabled{}, + ) + genesisState[banktypes.ModuleName] = quasarApp.AppCodec().MustMarshalJSON(bankGenesis) + + _, err := tmtypes.PB2TM.ValidatorUpdates(initValPowers) + if err != nil { + panic("failed to get vals") + } + + return genesisState +} + +var defaultGenesisStatebytes = []byte{} + +// SetupWithCustomHome initializes a new OsmosisApp with a custom home directory +func SetupWithCustomHome(isCheckTx bool, dir string) *app.QuasarApp { + return SetupWithCustomHomeAndChainId(isCheckTx, dir, "quasar-1") +} + +func SetupWithCustomHomeAndChainId(isCheckTx bool, dir, chainId string) *app.QuasarApp { + db := cosmosdb.NewMemDB() + quasarApp := app.New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, dir, 0, sims.EmptyAppOptions{}, app.EmptyWasmOpts, baseapp.SetChainID(chainId)) + if !isCheckTx { + if len(defaultGenesisStatebytes) == 0 { + var err error + genesisState := GenesisStateWithValSet(quasarApp) + defaultGenesisStatebytes, err = json.Marshal(genesisState) + if err != nil { + panic(err) + } + } + + _, err := quasarApp.InitChain( + &abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{}, + ConsensusParams: sims.DefaultConsensusParams, + AppStateBytes: defaultGenesisStatebytes, + ChainId: chainId, + }, + ) + if err != nil { + panic(err) + } + } + + return quasarApp +} + +// Setup initializes a new QuasarApp. +func Setup(isCheckTx bool) *app.QuasarApp { + return SetupWithCustomHome(isCheckTx, app.DefaultNodeHome) +} + +// SetupTestingAppWithLevelDb initializes a new OsmosisApp intended for testing, +// with LevelDB as a db. +func SetupTestingAppWithLevelDb(isCheckTx bool) (quasarApp *app.QuasarApp, cleanupFn func()) { + dir, err := os.MkdirTemp(os.TempDir(), "osmosis_leveldb_testing") + if err != nil { + panic(err) + } + db, err := cosmosdb.NewGoLevelDB("osmosis_leveldb_testing", dir, nil) + if err != nil { + panic(err) + } + quasarApp = app.New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, app.DefaultNodeHome, 5, sims.EmptyAppOptions{}, app.EmptyWasmOpts, baseapp.SetChainID("quasar-1")) + if !isCheckTx { + genesisState := GenesisStateWithValSet(quasarApp) + stateBytes, err := json.MarshalIndent(genesisState, "", " ") + if err != nil { + panic(err) + } + + _, err = quasarApp.InitChain( + &abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{}, + ConsensusParams: sims.DefaultConsensusParams, + AppStateBytes: stateBytes, + ChainId: "osmosis-1", + }, + ) + if err != nil { + panic(err) + } + } + + cleanupFn = func() { + db.Close() + err = os.RemoveAll(dir) + if err != nil { + panic(err) + } + } + + return quasarApp, cleanupFn +} diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 31eff0e71..b3e1f9e30 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -1,30 +1,38 @@ package keepers import ( + "fmt" + "os" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + evidencekeeper "cosmossdk.io/x/evidence/keeper" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/runtime" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authztypes "github.com/cosmos/cosmos-sdk/x/authz" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -38,48 +46,52 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" + pfmrouter "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" + packetforwardkeeper "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" + icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" + ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8" + ibchookskeeper "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/keeper" + ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/types" + ratelimit "github.com/cosmos/ibc-apps/modules/rate-limiting/v8" + ratelimitkeeper "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/keeper" + ratelimittypes "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/types" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" ibcwasmkeeper "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper" ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" - icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcporttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - - appparams "github.com/quasarlabs/quasarnode/app/params" - owasm "github.com/quasarlabs/quasarnode/wasmbinding" - epochsmodulekeeper "github.com/quasarlabs/quasarnode/x/epochs/keeper" - epochsmoduletypes "github.com/quasarlabs/quasarnode/x/epochs/types" - qoraclemodulekeeper "github.com/quasarlabs/quasarnode/x/qoracle/keeper" - qosmo "github.com/quasarlabs/quasarnode/x/qoracle/osmosis" - qosmokeeper "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/keeper" - qosmotypes "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - qoraclemoduletypes "github.com/quasarlabs/quasarnode/x/qoracle/types" - "github.com/quasarlabs/quasarnode/x/qtransfer" - qtransferkeeper "github.com/quasarlabs/quasarnode/x/qtransfer/keeper" - qtransfertypes "github.com/quasarlabs/quasarnode/x/qtransfer/types" - qvestingmodulekeeper "github.com/quasarlabs/quasarnode/x/qvesting/keeper" - qvestingmoduletypes "github.com/quasarlabs/quasarnode/x/qvesting/types" - tfbindings "github.com/quasarlabs/quasarnode/x/tokenfactory/bindings" - tfkeeper "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" - tfmodulekeeper "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" - tftypes "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller" + 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" + icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcclient "github.com/cosmos/ibc-go/v8/modules/core/02-client" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + appparams "github.com/quasar-finance/quasar/app/params" + "github.com/quasar-finance/quasar/wasmbindings" + epochsmodulekeeper "github.com/quasar-finance/quasar/x/epochs/keeper" + epochsmoduletypes "github.com/quasar-finance/quasar/x/epochs/types" + tfbindings "github.com/quasar-finance/quasar/x/tokenfactory/bindings" + tfkeeper "github.com/quasar-finance/quasar/x/tokenfactory/keeper" + tfmodulekeeper "github.com/quasar-finance/quasar/x/tokenfactory/keeper" + tftypes "github.com/quasar-finance/quasar/x/tokenfactory/types" + feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" + feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" ) +// Deprecated modules const ( - AccountAddressPrefix = "quasar" + QTransferModuleKey = "qtransfer" + QOracleModuleKey = "qoracle" + QVestingModuleKey = "qvesting" ) type AppKeepers struct { @@ -109,27 +121,31 @@ type AppKeepers struct { DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + IBCHooksKeeper *ibchookskeeper.Keeper EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper IBCWasmClientKeeper *ibcwasmkeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper WasmKeeper *wasmkeeper.Keeper - QTransferKeeper qtransferkeeper.Keeper + ContractKeeper *wasmkeeper.PermissionedKeeper EpochsKeeper *epochsmodulekeeper.Keeper - QOsmosisKeeper qosmokeeper.Keeper - QOracleKeeper qoraclemodulekeeper.Keeper - QVestingKeeper qvestingmodulekeeper.Keeper TfKeeper tfmodulekeeper.Keeper AuthzKeeper authzkeeper.Keeper ICAControllerKeeper icacontrollerkeeper.Keeper ICAHostKeeper *icahostkeeper.Keeper + FeeMarketKeeper *feemarketkeeper.Keeper + + PFMRouterKeeper *packetforwardkeeper.Keeper + RatelimitKeeper ratelimitkeeper.Keeper // IBC modules // transfer module - RawIcs20TransferAppModule transfer.AppModule - TransferStack *qtransfer.IBCMiddleware - Ics20WasmHooks *qtransfer.WasmHooks - HooksICS4Wrapper qtransfer.ICS4Middleware + RateLimitModule ratelimit.AppModule + TransferStack *ibchooks.IBCMiddleware + TransferModule transfer.AppModule + Ics20WasmHooks *ibchooks.WasmHooks + HooksICS4Wrapper ibchooks.ICS4Middleware + PFMRouterModule pfmrouter.AppModule // keys to access the substores keys map[string]*storetypes.KVStoreKey @@ -145,17 +161,31 @@ func (appKeepers *AppKeepers) InitSpecialKeepers( invCheckPeriod uint, skipUpgradeHeights map[int64]bool, homePath string, + logger log.Logger, + appOpts servertypes.AppOptions, ) { appKeepers.GenerateKeys() + + /* + configure state listening capabilities using AppOptions + we are doing nothing with the returned streamingServices and waitGroup in this case + */ + // load state streaming if enabled + + if err := bApp.RegisterStreamingServices(appOpts, appKeepers.keys); err != nil { + logger.Error("failed to load state streaming", "err", err) + os.Exit(1) + } + appKeepers.ParamsKeeper = appKeepers.initParamsKeeper(appCodec, cdc, appKeepers.keys[paramstypes.StoreKey], appKeepers.tkeys[paramstypes.TStoreKey]) - consensusParamsKeeper := consensusparamkeeper.NewKeeper( - appCodec, - appKeepers.keys[consensusparamtypes.StoreKey], + consensusParamsKeeper := consensusparamkeeper.NewKeeper(appCodec, + runtime.NewKVStoreService(appKeepers.keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) + runtime.EventService{}) + appKeepers.ConsensusParamsKeeper = &consensusParamsKeeper - bApp.SetParamStore(appKeepers.ConsensusParamsKeeper) + bApp.SetParamStore(appKeepers.ConsensusParamsKeeper.ParamsStore) // add capability keeper and ScopeToModule for ibc module appKeepers.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, appKeepers.keys[capabilitytypes.StoreKey], appKeepers.memKeys[capabilitytypes.MemStoreKey]) @@ -164,7 +194,7 @@ func (appKeepers *AppKeepers) InitSpecialKeepers( appKeepers.ScopedIBCKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) appKeepers.ScopedTransferKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) appKeepers.ScopedWasmKeeper = appKeepers.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName) - appKeepers.ScopedQOsmosisKeeper = appKeepers.CapabilityKeeper.ScopeToModule(qosmotypes.SubModuleName) + // appKeepers.ScopedQOsmosisKeeper = appKeepers.CapabilityKeeper.ScopeToModule(qosmotypes.SubModuleName) appKeepers.ScopedICAControllerKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) appKeepers.ScopedICAHostKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) appKeepers.ScopedICQKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icqtypes.ModuleName) @@ -172,17 +202,17 @@ func (appKeepers *AppKeepers) InitSpecialKeepers( appKeepers.CrisisKeeper = crisiskeeper.NewKeeper( appCodec, - appKeepers.keys[crisistypes.StoreKey], - //app.GetSubspace(crisistypes.ModuleName), + runtime.NewKVStoreService(appKeepers.keys[crisistypes.StoreKey]), invCheckPeriod, appKeepers.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), ) appKeepers.UpgradeKeeper = upgradekeeper.NewKeeper( skipUpgradeHeights, - appKeepers.keys[upgradetypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[upgradetypes.StoreKey]), appCodec, homePath, bApp, @@ -192,8 +222,8 @@ func (appKeepers *AppKeepers) InitSpecialKeepers( // InitNormalKeepers initializes all 'normal' keepers (account, app, bank, auth, staking, distribution, slashing, transfer, IBC router, governance, mint keepers). func (appKeepers *AppKeepers) InitNormalKeepers( appCodec codec.Codec, - encodingConfig appparams.EncodingConfig, bApp *baseapp.BaseApp, + legacyAmino *codec.LegacyAmino, maccPerms map[string][]string, dataDir string, wasmDir string, @@ -202,39 +232,50 @@ func (appKeepers *AppKeepers) InitNormalKeepers( blockedAddress map[string]bool, ibcWasmConfig ibcwasmtypes.WasmConfig, ) { - legacyAmino := encodingConfig.Amino - accountKeeper := authkeeper.NewAccountKeeper( appCodec, - appKeepers.keys[authtypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, - AccountAddressPrefix, + address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + sdk.GetConfig().GetBech32AccountAddrPrefix(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + appKeepers.AccountKeeper = accountKeeper bankKeeper := bankkeeper.NewBaseKeeper( appCodec, - appKeepers.keys[banktypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[banktypes.StoreKey]), appKeepers.AccountKeeper, blockedAddress, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + bApp.Logger(), ) appKeepers.BankKeeper = bankKeeper stakingKeeper := stakingkeeper.NewKeeper( appCodec, - appKeepers.keys[stakingtypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[stakingtypes.StoreKey]), appKeepers.AccountKeeper, appKeepers.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + address.NewBech32Codec(appparams.Bech32PrefixValAddr), + address.NewBech32Codec(appparams.Bech32PrefixConsAddr), ) appKeepers.StakingKeeper = stakingKeeper + appKeepers.FeeMarketKeeper = feemarketkeeper.NewKeeper( + appCodec, + appKeepers.keys[feemarkettypes.StoreKey], + appKeepers.AccountKeeper, + &DefaultFeemarketDenomResolver{}, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + mintKeeper := mintkeeper.NewKeeper( appCodec, - appKeepers.keys[minttypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[minttypes.StoreKey]), appKeepers.StakingKeeper, appKeepers.AccountKeeper, appKeepers.BankKeeper, @@ -245,7 +286,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers( distrKeeper := distrkeeper.NewKeeper( appCodec, - appKeepers.keys[distrtypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[distrtypes.StoreKey]), appKeepers.AccountKeeper, appKeepers.BankKeeper, appKeepers.StakingKeeper, @@ -257,7 +298,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers( slashingKeeper := slashingkeeper.NewKeeper( appCodec, legacyAmino, - appKeepers.keys[slashingtypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[slashingtypes.StoreKey]), appKeepers.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -265,7 +306,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers( feeGrantKeeper := feegrantkeeper.NewKeeper( appCodec, - appKeepers.keys[feegrant.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[feegrant.StoreKey]), appKeepers.AccountKeeper) appKeepers.FeeGrantKeeper = feeGrantKeeper @@ -286,11 +327,34 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.StakingKeeper, appKeepers.UpgradeKeeper, appKeepers.ScopedIBCKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // Configure the hooks keeper + hooksKeeper := ibchookskeeper.NewKeeper( + appKeepers.keys[ibchookstypes.StoreKey], + ) + appKeepers.IBCHooksKeeper = &hooksKeeper + + wasmHooks := ibchooks.NewWasmHooks(appKeepers.IBCHooksKeeper, nil, appparams.Bech32PrefixAccAddr) + appKeepers.Ics20WasmHooks = &wasmHooks + + // Configure the rate limit keeper + rateLimitKeeper := *ratelimitkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[ratelimittypes.StoreKey]), + appKeepers.GetSubspace(ratelimittypes.ModuleName), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appKeepers.BankKeeper, + appKeepers.IBCKeeper.ChannelKeeper, + appKeepers.IBCKeeper.ChannelKeeper, // ICS4Wrapper ) + appKeepers.RatelimitKeeper = rateLimitKeeper + ibcWasmClientKeeper := ibcwasmkeeper.NewKeeperWithConfig( appCodec, - appKeepers.keys[ibcwasmtypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[ibcwasmtypes.StoreKey]), appKeepers.IBCKeeper.ClientKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ibcWasmConfig, @@ -299,58 +363,75 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.IBCWasmClientKeeper = &ibcWasmClientKeeper + // PFMRouterKeeper must be created before TransferKeeper + appKeepers.PFMRouterKeeper = packetforwardkeeper.NewKeeper( + appCodec, + appKeepers.keys[pfmtypes.StoreKey], + nil, // Will be zero-value here. Reference is set later on with SetTransferKeeper. + appKeepers.IBCKeeper.ChannelKeeper, + appKeepers.DistrKeeper, + appKeepers.BankKeeper, + appKeepers.RatelimitKeeper, // ICS4Wrapper + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + transferKeeper := ibctransferkeeper.NewKeeper( appCodec, appKeepers.keys[ibctransfertypes.StoreKey], appKeepers.GetSubspace(ibctransfertypes.ModuleName), + appKeepers.PFMRouterKeeper, // ICS4 Wrapper: PFM Router middleware appKeepers.IBCKeeper.ChannelKeeper, - appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, + appKeepers.IBCKeeper.PortKeeper, appKeepers.AccountKeeper, appKeepers.BankKeeper, appKeepers.ScopedTransferKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - appKeepers.TransferKeeper = transferKeeper - - appKeepers.RawIcs20TransferAppModule = transfer.NewAppModule(appKeepers.TransferKeeper) - // Hooks Middleware - hooksTransferModule := qtransfer.NewIBCMiddleware(transfer.NewIBCModule(appKeepers.TransferKeeper), &appKeepers.HooksICS4Wrapper) - appKeepers.TransferStack = &hooksTransferModule + appKeepers.TransferKeeper = transferKeeper + // Must be called on PFMRouter AFTER TransferKeeper initialized + appKeepers.PFMRouterKeeper.SetTransferKeeper(appKeepers.TransferKeeper) appKeepers.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( appCodec, appKeepers.keys[icacontrollertypes.StoreKey], appKeepers.GetSubspace(icacontrollertypes.SubModuleName), appKeepers.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, + appKeepers.IBCKeeper.PortKeeper, appKeepers.ScopedICAControllerKeeper, bApp.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + icaHostKeeper := icahostkeeper.NewKeeper( appCodec, appKeepers.keys[icahosttypes.StoreKey], appKeepers.GetSubspace(icahosttypes.SubModuleName), appKeepers.IBCKeeper.ChannelKeeper, // can be replaced with rate limiter ICS 4 Wrapper appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, + appKeepers.IBCKeeper.PortKeeper, appKeepers.AccountKeeper, appKeepers.ScopedICAHostKeeper, bApp.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + icaHostKeeper.WithQueryRouter(bApp.GRPCQueryRouter()) appKeepers.ICAHostKeeper = &icaHostKeeper evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, appKeepers.keys[evidencetypes.StoreKey], appKeepers.StakingKeeper, appKeepers.SlashingKeeper, + appCodec, + runtime.NewKVStoreService(appKeepers.keys[evidencetypes.StoreKey]), + appKeepers.StakingKeeper, appKeepers.SlashingKeeper, + address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + runtime.ProvideCometInfoService(), ) + appKeepers.EvidenceKeeper = *evidenceKeeper govRouter := govv1beta1.NewRouter() govRouter. AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(appKeepers.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(appKeepers.UpgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)). AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)) govConfig := govtypes.DefaultConfig() @@ -358,10 +439,12 @@ func (appKeepers *AppKeepers) InitNormalKeepers( govConfig.MaxMetadataLen = 10200 govKeeper := govkeeper.NewKeeper( appCodec, - appKeepers.keys[govtypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[govtypes.StoreKey]), + // appKeepers.keys[govtypes.StoreKey], appKeepers.AccountKeeper, appKeepers.BankKeeper, appKeepers.StakingKeeper, + appKeepers.DistrKeeper, bApp.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), @@ -376,58 +459,11 @@ func (appKeepers *AppKeepers) InitNormalKeepers( ) appKeepers.EpochsKeeper = epochsmodulekeeper.NewKeeper(appCodec, appKeepers.keys[epochsmoduletypes.StoreKey]) - - appKeepers.QTransferKeeper = qtransferkeeper.NewKeeper( - appCodec, - appKeepers.keys[qtransfertypes.ModuleName], - appKeepers.GetSubspace(qtransfertypes.ModuleName), - appKeepers.AccountKeeper, - ) - - appKeepers.QOracleKeeper = qoraclemodulekeeper.NewKeeper( - appCodec, - appKeepers.keys[qoraclemoduletypes.StoreKey], - appKeepers.memKeys[qoraclemoduletypes.MemStoreKey], - appKeepers.tkeys[qoraclemoduletypes.TStoreKey], - appKeepers.GetSubspace(qoraclemoduletypes.ModuleName), - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - appKeepers.QOsmosisKeeper = qosmokeeper.NewKeeper( - appCodec, - appKeepers.keys[qosmotypes.StoreKey], - appKeepers.GetSubspace(qosmotypes.SubModuleName), - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - appKeepers.IBCKeeper.ClientKeeper, - appKeepers.IBCKeeper.ChannelKeeper, - appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, - appKeepers.ScopedQOsmosisKeeper, - appKeepers.QOracleKeeper, - ) - - appKeepers.QOracleKeeper.RegisterPoolOracle(appKeepers.QOsmosisKeeper) - appKeepers.QOracleKeeper.Seal() - - appKeepers.QTransferKeeper = qtransferkeeper.NewKeeper( - appCodec, - appKeepers.keys[qtransfertypes.ModuleName], - appKeepers.GetSubspace(qtransfertypes.ModuleName), - appKeepers.AccountKeeper, - ) - - appKeepers.QVestingKeeper = *qvestingmodulekeeper.NewKeeper( - appCodec, - appKeepers.keys[qvestingmoduletypes.StoreKey], - appKeepers.keys[qvestingmoduletypes.MemStoreKey], - appKeepers.GetSubspace(qvestingmoduletypes.ModuleName), - appKeepers.AccountKeeper, - appKeepers.BankKeeper, - ) + appKeepers.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(appKeepers.WasmKeeper) // Authz appKeepers.AuthzKeeper = authzkeeper.NewKeeper( - appKeepers.keys[authzkeeper.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[authzkeeper.StoreKey]), appCodec, bApp.MsgServiceRouter(), appKeepers.AccountKeeper, @@ -436,69 +472,106 @@ func (appKeepers *AppKeepers) InitNormalKeepers( // Set epoch hooks appKeepers.EpochsKeeper.SetHooks( epochsmoduletypes.NewMultiEpochHooks( - appKeepers.QOsmosisKeeper.EpochHooks(), + // appKeepers.QOsmosisKeeper.EpochHooks(), ), ) /// Token factory Module - appKeepers.TfKeeper = tfkeeper.NewKeeper(appKeepers.keys[tftypes.StoreKey], + appKeepers.TfKeeper = tfkeeper.NewKeeper( + appKeepers.keys[tftypes.StoreKey], appKeepers.GetSubspace(tftypes.ModuleName), + maccPerms, appKeepers.AccountKeeper, appKeepers.BankKeeper, appKeepers.DistrKeeper, ) - callback := owasm.NewCallbackPlugin(appKeepers.WasmKeeper, appKeepers.QTransferKeeper.GetQTransferAcc()) + // set token factory contract keeper + appKeepers.TfKeeper.SetContractKeeper(appKeepers.ContractKeeper) - // AUDIT CHECK IS THIS TYPE ASSERTION FOR TYPE CASTING INTERFACE TO STRUCT SAFE? tmpBankBaseKeeper := appKeepers.BankKeeper.(bankkeeper.BaseKeeper) - wasmOpts = append(owasm.RegisterCustomPlugins(appKeepers.QOracleKeeper, &tmpBankBaseKeeper, callback), wasmOpts...) wasmOpts = append(tfbindings.RegisterCustomPlugins(&tmpBankBaseKeeper, &appKeepers.TfKeeper), wasmOpts...) - // The last arguments can contain custom message handlers, and custom query handlers, - // if we want to allow any custom callbacks - supportedFeatures := "cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_4,iterator,staking,stargate" + queryPlugins := wasmkeeper.WithQueryPlugins( + &wasmkeeper.QueryPlugins{ + Stargate: wasmkeeper.AcceptListStargateQuerier(wasmbindings.AcceptedStargateQueries(), bApp.GRPCQueryRouter(), appCodec), + Grpc: wasmkeeper.AcceptListGrpcQuerier(wasmbindings.AcceptedStargateQueries(), bApp.GRPCQueryRouter(), appCodec), + }) + + wasmOpts = append(wasmOpts, queryPlugins) wasmKeeper := wasmkeeper.NewKeeper( appCodec, - appKeepers.keys[wasmtypes.StoreKey], + runtime.NewKVStoreService(appKeepers.keys[wasmtypes.StoreKey]), appKeepers.AccountKeeper, appKeepers.BankKeeper, appKeepers.StakingKeeper, distrkeeper.NewQuerier(appKeepers.DistrKeeper), appKeepers.IBCKeeper.ChannelKeeper, appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, + appKeepers.IBCKeeper.PortKeeper, appKeepers.ScopedWasmKeeper, appKeepers.TransferKeeper, bApp.MsgServiceRouter(), bApp.GRPCQueryRouter(), wasmDir, wasmConfig, - supportedFeatures, + wasmkeeper.BuiltInCapabilities(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), wasmOpts..., ) - appKeepers.WasmKeeper = &wasmKeeper - ibcRouter := ibcporttypes.NewRouter() + appKeepers.WasmKeeper = &wasmKeeper - wasmHooks := qtransfer.NewWasmHooks(appKeepers.QTransferKeeper, *appKeepers.WasmKeeper) - appKeepers.Ics20WasmHooks = &wasmHooks - appKeepers.HooksICS4Wrapper = qtransfer.NewICS4Middleware( + //IBC hooks + appKeepers.Ics20WasmHooks.ContractKeeper = appKeepers.WasmKeeper + appKeepers.HooksICS4Wrapper = ibchooks.NewICS4Middleware( appKeepers.IBCKeeper.ChannelKeeper, appKeepers.Ics20WasmHooks, ) + //Middleware Stacks + appKeepers.TransferModule = transfer.NewAppModule(appKeepers.TransferKeeper) + appKeepers.PFMRouterModule = pfmrouter.NewAppModule(appKeepers.PFMRouterKeeper, appKeepers.GetSubspace(pfmtypes.ModuleName)) + appKeepers.RateLimitModule = ratelimit.NewAppModule(appCodec, appKeepers.RatelimitKeeper) + + // Create Transfer Stack (from bottom to top of stack) + // - core IBC + // - ibcfee + // - ratelimit + // - pfm + // - provider (not required for us) + // - transfer + // + // This is how transfer stack will work in the end: + // * RecvPacket -> IBC core -> Fee -> RateLimit -> PFM -> Provider -> Transfer (AddRoute) + // * SendPacket -> Transfer -> Provider -> PFM -> RateLimit -> Fee -> IBC core (ICS4Wrapper) + + var transferStack ibcporttypes.IBCModule + transferStack = transfer.NewIBCModule(appKeepers.TransferKeeper) + transferStack = pfmrouter.NewIBCMiddleware( + transferStack, + appKeepers.PFMRouterKeeper, + 0, // retries on timeout + packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, + packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, + ) + transferStack = ratelimit.NewIBCMiddleware(appKeepers.RatelimitKeeper, transferStack) + + // hooks middleware + hooksTransferModule := ibchooks.NewIBCMiddleware(transferStack, &appKeepers.HooksICS4Wrapper) + appKeepers.TransferStack = &hooksTransferModule + + ibcRouter := ibcporttypes.NewRouter() + // Register host and authentication routes - // TODO_IMPORTANT - addition of qtransfer module ibcRouter. - AddRoute(wasmtypes.ModuleName, wasm.NewIBCHandler(appKeepers.WasmKeeper, appKeepers.IBCKeeper.ChannelKeeper, appKeepers.IBCKeeper.ChannelKeeper)). AddRoute(icahosttypes.SubModuleName, icahost.NewIBCModule(*appKeepers.ICAHostKeeper)). AddRoute(ibctransfertypes.ModuleName, appKeepers.TransferStack). - AddRoute(qosmotypes.SubModuleName, qosmo.NewIBCModule(appKeepers.QOsmosisKeeper)) - // AddRoute(qoraclemoduletypes.ModuleName, qoracleIBCModule) + AddRoute(wasmtypes.ModuleName, wasm.NewIBCHandler(appKeepers.WasmKeeper, + appKeepers.IBCKeeper.ChannelKeeper, appKeepers.IBCKeeper.ChannelKeeper)). + AddRoute(icacontrollertypes.SubModuleName, controller.NewIBCMiddleware(nil, appKeepers.ICAControllerKeeper)) appKeepers.IBCKeeper.SetRouter(ibcRouter) } @@ -506,7 +579,8 @@ func (appKeepers *AppKeepers) InitNormalKeepers( // initParamsKeeper init params keeper and its subspaces func (appKeepers *AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - + keyTable := ibcclienttypes.ParamKeyTable() + keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) paramsKeeper.Subspace(authtypes.ModuleName) paramsKeeper.Subspace(banktypes.ModuleName) paramsKeeper.Subspace(stakingtypes.ModuleName) @@ -515,19 +589,18 @@ func (appKeepers *AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legac paramsKeeper.Subspace(slashingtypes.ModuleName) paramsKeeper.Subspace(govtypes.ModuleName) paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibchost.ModuleName) + paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable()) + paramsKeeper.Subspace(ibchost.ModuleName).WithKeyTable(keyTable) paramsKeeper.Subspace(epochsmoduletypes.ModuleName) - paramsKeeper.Subspace(qoraclemoduletypes.ModuleName) - paramsKeeper.Subspace(qosmotypes.SubModuleName) paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable()) paramsKeeper.Subspace(icqtypes.ModuleName) - paramsKeeper.Subspace(icahosttypes.SubModuleName) + paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable()) paramsKeeper.Subspace(wasmtypes.ModuleName) - paramsKeeper.Subspace(qtransfertypes.ModuleName) paramsKeeper.Subspace(tftypes.ModuleName) - paramsKeeper.Subspace(qvestingmoduletypes.ModuleName) paramsKeeper.Subspace(authztypes.ModuleName) + paramsKeeper.Subspace(ratelimittypes.ModuleName).WithKeyTable(ratelimittypes.ParamKeyTable()) + paramsKeeper.Subspace(pfmtypes.ModuleName).WithKeyTable(pfmtypes.ParamKeyTable()) + paramsKeeper.Subspace(ibchookstypes.ModuleName) return paramsKeeper } @@ -549,18 +622,36 @@ func KVStoreKeys() []string { ibctransfertypes.StoreKey, capabilitytypes.StoreKey, epochsmoduletypes.StoreKey, - qoraclemoduletypes.StoreKey, - qosmotypes.StoreKey, icacontrollertypes.StoreKey, icahosttypes.StoreKey, icqtypes.StoreKey, ibcwasmtypes.StoreKey, wasmtypes.StoreKey, - qtransfertypes.StoreKey, tftypes.StoreKey, - qvestingmoduletypes.StoreKey, authzkeeper.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, + feemarkettypes.StoreKey, + ibchookstypes.StoreKey, + ratelimittypes.StoreKey, + pfmtypes.StoreKey, + //deprecated modules + QTransferModuleKey, + QOracleModuleKey, + QVestingModuleKey, } } + +type DefaultFeemarketDenomResolver struct{} + +func (r *DefaultFeemarketDenomResolver) ConvertToDenom(_ sdk.Context, coin sdk.DecCoin, denom string) (sdk.DecCoin, error) { + if coin.Denom == denom { + return coin, nil + } + + return sdk.DecCoin{}, fmt.Errorf("error resolving denom") +} + +func (r *DefaultFeemarketDenomResolver) ExtraDenoms(_ sdk.Context) ([]string, error) { + return []string{}, nil +} diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 9372b1273..df5f631ba 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -1,30 +1,25 @@ package keepers import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + storetypes "cosmossdk.io/store/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - - qoraclemoduletypes "github.com/quasarlabs/quasarnode/x/qoracle/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" ) // GenerateKeys generates new keys (KV Store, Transient store, and memory store). func (appKeepers *AppKeepers) GenerateKeys() { // Define what keys will be used in the cosmos-sdk key/value store. // Cosmos-SDK modules each have a "key" that allows the application to reference what they've stored on the chain. - appKeepers.keys = sdk.NewKVStoreKeys(KVStoreKeys()...) + appKeepers.keys = storetypes.NewKVStoreKeys(KVStoreKeys()...) // Define transient store keys - appKeepers.tkeys = sdk.NewTransientStoreKeys( + appKeepers.tkeys = storetypes.NewTransientStoreKeys( paramstypes.TStoreKey, - qoraclemoduletypes.TStoreKey, ) // MemKeys are for information that is stored only in RAM. - appKeepers.memKeys = sdk.NewMemoryStoreKeys( + appKeepers.memKeys = storetypes.NewMemoryStoreKeys( capabilitytypes.MemStoreKey, - qoraclemoduletypes.MemStoreKey, ) } diff --git a/app/modules.go b/app/modules.go index b3f52611d..c468cc87b 100644 --- a/app/modules.go +++ b/app/modules.go @@ -1,10 +1,20 @@ package app import ( + "cosmossdk.io/x/evidence" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantmodule "cosmossdk.io/x/feegrant/module" + "cosmossdk.io/x/upgrade" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" + authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -12,18 +22,12 @@ import ( authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/bank" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -38,46 +42,46 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" + ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8" + ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/types" + ratelimit "github.com/cosmos/ibc-apps/modules/rate-limiting/v8" + ratelimittypes "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/types" + "github.com/cosmos/ibc-go/modules/capability" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" ibcwasm "github.com/cosmos/ibc-go/modules/light-clients/08-wasm" ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - - appparams "github.com/quasarlabs/quasarnode/app/params" - epochsmodule "github.com/quasarlabs/quasarnode/x/epochs" - epochsmoduletypes "github.com/quasarlabs/quasarnode/x/epochs/types" - qoraclemodule "github.com/quasarlabs/quasarnode/x/qoracle" - qoraclemoduletypes "github.com/quasarlabs/quasarnode/x/qoracle/types" - "github.com/quasarlabs/quasarnode/x/qtransfer" - qtransfertypes "github.com/quasarlabs/quasarnode/x/qtransfer/types" - qvestingmodule "github.com/quasarlabs/quasarnode/x/qvesting" - qvestingmoduletypes "github.com/quasarlabs/quasarnode/x/qvesting/types" - tfmodule "github.com/quasarlabs/quasarnode/x/tokenfactory" - tftypes "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + appparams "github.com/quasar-finance/quasar/app/params" + epochsmodule "github.com/quasar-finance/quasar/x/epochs" + epochsmoduletypes "github.com/quasar-finance/quasar/x/epochs/types" + tfmodule "github.com/quasar-finance/quasar/x/tokenfactory" + tftypes "github.com/quasar-finance/quasar/x/tokenfactory/types" + "github.com/skip-mev/feemarket/x/feemarket" + feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" ) // moduleAccountPermissions defines module account permissions var ModuleAccountPermissions = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - icatypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - wasmtypes.ModuleName: {authtypes.Burner}, - tftypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + icatypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + wasmtypes.ModuleName: {authtypes.Burner}, + tftypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + feemarkettypes.ModuleName: nil, + feemarkettypes.FeeCollectorName: nil, } // AppModuleBasics returns ModuleBasics for the module BasicManager. @@ -92,10 +96,9 @@ var AppModuleBasics = []module.AppModuleBasic{ gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, + // upgradeclient.LegacyProposalHandler, + // ibcclientclient.UpdateClientProposalHandler, + // ibcclientclient.UpgradeProposalHandler, }, ), params.AppModuleBasic{}, @@ -108,29 +111,75 @@ var AppModuleBasics = []module.AppModuleBasic{ transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, epochsmodule.AppModuleBasic{}, - qoraclemodule.AppModuleBasic{}, ica.AppModuleBasic{}, ibcwasm.AppModuleBasic{}, wasm.AppModuleBasic{}, - qtransfer.AppModuleBasic{}, tfmodule.AppModuleBasic{}, - qvestingmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, consensus.AppModuleBasic{}, ibctm.AppModuleBasic{}, + ibchooks.AppModuleBasic{}, + ratelimit.AppModuleBasic{}, +} + +// ModuleBasics defines the module BasicManager that is in charge of setting up basic, +// non-dependant module elements, such as codec registration +// and genesis verification. +func newBasicManagerFromManager(app *QuasarApp) module.BasicManager { + basicManager := module.NewBasicManagerFromManager( + app.mm, + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + govtypes.ModuleName: gov.NewAppModuleBasic( + []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + }, + ), + }) + basicManager.RegisterLegacyAminoCodec(app.legacyAmino) + basicManager.RegisterInterfaces(app.interfaceRegistry) + return basicManager +} + +// simulationModules returns modules for simulation manager +// define the order of the modules for deterministic simulations +func simulationModules( + app *QuasarApp, + appCodec codec.Codec, + _ bool, +) []module.AppModuleSimulation { + return []module.AppModuleSimulation{ + auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), + capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), + feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), + gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), + staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), + distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), + params.NewAppModule(app.ParamsKeeper), + evidence.NewAppModule(app.EvidenceKeeper), + authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + ibc.NewAppModule(app.IBCKeeper), + wasm.NewAppModule(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + ica.NewAppModule(&app.ICAControllerKeeper, app.ICAHostKeeper), + + // quasar modules + // empty because no module implements simulation + } } func appModules( app *QuasarApp, - encodingConfig appparams.EncodingConfig, + appCodec codec.Codec, + txConfig client.TxEncodingConfig, skipGenesisInvariants bool, ) []module.AppModule { - appCodec := encodingConfig.Marshaler - return []module.AppModule{ genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, - encodingConfig.TxConfig, + app.AccountKeeper, app.StakingKeeper, app.BaseApp, + txConfig, ), auth.NewAppModule(appCodec, app.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), @@ -139,33 +188,35 @@ func appModules( crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, + app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - upgrade.NewAppModule(app.UpgradeKeeper), + upgrade.NewAppModule(app.UpgradeKeeper, addresscodec.NewBech32Codec(appparams.Bech32PrefixAccAddr)), ibcwasm.NewAppModule(*app.IBCWasmClientKeeper), evidence.NewAppModule(app.EvidenceKeeper), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), ibc.NewAppModule(app.IBCKeeper), + ibctm.NewAppModule(), params.NewAppModule(app.ParamsKeeper), wasm.NewAppModule(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), - app.RawIcs20TransferAppModule, ica.NewAppModule(&app.ICAControllerKeeper, app.ICAHostKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), consensus.NewAppModule(appCodec, *app.ConsensusParamsKeeper), + feemarket.NewAppModule(appCodec, *app.FeeMarketKeeper), + ibchooks.NewAppModule(app.AccountKeeper), + app.TransferModule, + app.PFMRouterModule, + app.RateLimitModule, // quasar modules - epochsmodule.NewAppModule(appCodec, app.EpochsKeeper), - qoraclemodule.NewAppModule(appCodec, app.QOracleKeeper, app.QOsmosisKeeper), - qtransfer.NewAppModule(app.QTransferKeeper), + epochsmodule.NewAppModule(*app.EpochsKeeper), tfmodule.NewAppModule(app.TfKeeper, app.AccountKeeper, app.BankKeeper), - qvestingmodule.NewAppModule(appCodec, app.QVestingKeeper, app.AccountKeeper, app.BankKeeper), } } func orderBeginBlockers() []string { return []string{ - upgradetypes.ModuleName, capabilitytypes.ModuleName, epochsmoduletypes.ModuleName, minttypes.ModuleName, @@ -180,19 +231,20 @@ func orderBeginBlockers() []string { ibcexported.ModuleName, ibctransfertypes.ModuleName, icatypes.ModuleName, + ratelimittypes.ModuleName, genutiltypes.ModuleName, authztypes.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, ibchost.ModuleName, vestingtypes.ModuleName, + feemarkettypes.ModuleName, consensusparamtypes.ModuleName, - qoraclemoduletypes.ModuleName, - qtransfertypes.ModuleName, + pfmtypes.ModuleName, + ibchookstypes.ModuleName, wasmtypes.ModuleName, ibcwasmtypes.ModuleName, tftypes.ModuleName, - qvestingmoduletypes.ModuleName, } } @@ -202,8 +254,6 @@ func orderEndBlockers() []string { govtypes.ModuleName, stakingtypes.ModuleName, ibcexported.ModuleName, - qoraclemoduletypes.ModuleName, - qtransfertypes.ModuleName, evidencetypes.ModuleName, ibchost.ModuleName, feegrant.ModuleName, @@ -211,6 +261,7 @@ func orderEndBlockers() []string { slashingtypes.ModuleName, ibctransfertypes.ModuleName, vestingtypes.ModuleName, + feemarkettypes.ModuleName, capabilitytypes.ModuleName, upgradetypes.ModuleName, paramstypes.ModuleName, @@ -218,12 +269,14 @@ func orderEndBlockers() []string { banktypes.ModuleName, distrtypes.ModuleName, icatypes.ModuleName, + ratelimittypes.ModuleName, genutiltypes.ModuleName, epochsmoduletypes.ModuleName, + pfmtypes.ModuleName, + ibchookstypes.ModuleName, wasmtypes.ModuleName, ibcwasmtypes.ModuleName, tftypes.ModuleName, - qvestingmoduletypes.ModuleName, authztypes.ModuleName, consensusparamtypes.ModuleName, } @@ -253,19 +306,27 @@ func orderInitBlockers() []string { evidencetypes.ModuleName, ibctransfertypes.ModuleName, ibcexported.ModuleName, - qoraclemoduletypes.ModuleName, icatypes.ModuleName, + ratelimittypes.ModuleName, vestingtypes.ModuleName, + // The feemarket module should ideally be initialized before the genutil module in theory: + // The feemarket antehandler performs checks in DeliverTx, which is called by gentx. + // When the fee > 0, gentx needs to pay the fee. However, this is not expected. + // To resolve this issue, we should initialize the feemarket module after genutil, ensuring that the + // min fee is empty when gentx is called. + // A similar issue existed for the 'globalfee' module, which was previously used instead of 'feemarket'. + // For more details, please refer to the following link: https://github.com/cosmos/gaia/issues/2489 + feemarkettypes.ModuleName, feegrant.ModuleName, upgradetypes.ModuleName, paramstypes.ModuleName, epochsmoduletypes.ModuleName, + pfmtypes.ModuleName, + ibchookstypes.ModuleName, // wasm after ibc transfer wasmtypes.ModuleName, ibcwasmtypes.ModuleName, - qtransfertypes.ModuleName, tftypes.ModuleName, - qvestingmoduletypes.ModuleName, authztypes.ModuleName, consensusparamtypes.ModuleName, } diff --git a/app/params/params.go b/app/params/params.go index 853be880e..012570ffe 100644 --- a/app/params/params.go +++ b/app/params/params.go @@ -1,5 +1,12 @@ package params +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + const ( HumanCoinUnit = "qsr" BaseCoinUnit = "uqsr" @@ -7,6 +14,52 @@ const ( DefaultBondDenom = BaseCoinUnit - AccountAddressPrefix = "quasar" - Name = "quasarnode" + Name = "quasar" + DirName = "quasarnode" + + // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address. + Bech32PrefixAccAddr = "quasar" ) + +var ( + // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key. + Bech32PrefixAccPub = Bech32PrefixAccAddr + "pub" + // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address. + Bech32PrefixValAddr = Bech32PrefixAccAddr + "valoper" + // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key. + Bech32PrefixValPub = Bech32PrefixAccAddr + "valoperpub" + // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address. + Bech32PrefixConsAddr = Bech32PrefixAccAddr + "valcons" + // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key. + Bech32PrefixConsPub = Bech32PrefixAccAddr + "valconspub" +) + +func init() { + SetAddressPrefixes() +} + +// SetAddressPrefixes builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts, validators, and consensus nodes and verifies that addreeses have correct format. +func SetAddressPrefixes() { + config := sdk.GetConfig() + config.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub) + config.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub) + config.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub) + + // This is copied from the cosmos sdk v0.43.0-beta1 + // source: https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/types/address.go#L141 + config.SetAddressVerifier(func(bytes []byte) error { + if len(bytes) == 0 { + return errorsmod.Wrap(sdkerrors.ErrUnknownAddress, "addresses cannot be empty") + } + + if len(bytes) > address.MaxAddrLen { + return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "address max length is %d, got %d, %x", address.MaxAddrLen, len(bytes), bytes) + } + + if len(bytes) != 20 && len(bytes) != 32 { + return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "address length must be 20 or 32 bytes, got %d, %x", len(bytes), bytes) + } + + return nil + }) +} diff --git a/app/post.go b/app/post.go new file mode 100644 index 000000000..ab2733a6c --- /dev/null +++ b/app/post.go @@ -0,0 +1,50 @@ +package app + +import ( + feemarketpost "github.com/skip-mev/feemarket/x/feemarket/post" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/quasar-finance/quasar/ante" +) + +// PostHandlerOptions are the options required for constructing a FeeMarket PostHandler. +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. +func NewPostHandler(options PostHandlerOptions) (sdk.PostHandler, error) { + if !ante.UseFeeMarketDecorator { + return nil, nil + } + + if options.AccountKeeper == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for post builder") + } + + if options.BankKeeper == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for post builder") + } + + if options.FeeMarketKeeper == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "feemarket keeper is required for post builder") + } + + postDecorators := []sdk.PostDecorator{ + feemarketpost.NewFeeMarketDeductDecorator( + options.AccountKeeper, + options.BankKeeper, + options.FeeGrantKeeper, + options.FeeMarketKeeper, + ), + } + + return sdk.ChainPostDecorators(postDecorators...), nil +} diff --git a/app/sim/sim_config.go b/app/sim/sim_config.go new file mode 100644 index 000000000..43c150303 --- /dev/null +++ b/app/sim/sim_config.go @@ -0,0 +1,75 @@ +package sim + +import ( + "flag" + + "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// List of available flags for the simulator +var ( + FlagGenesisFileValue string + FlagParamsFileValue string + FlagExportParamsPathValue string + FlagExportParamsHeightValue int + FlagExportStatePathValue string + FlagExportStatsPathValue string + FlagSeedValue int64 + FlagInitialBlockHeightValue int + FlagNumBlocksValue int + FlagBlockSizeValue int + FlagLeanValue bool + FlagCommitValue bool + FlagOnOperationValue bool // TODO: Remove in favor of binary search for invariant violation + FlagAllInvariantsValue bool + + FlagEnabledValue bool + FlagVerboseValue bool + FlagPeriodValue uint + FlagGenesisTimeValue int64 +) + +// GetSimulatorFlags gets the values of all the available simulation flags +func GetSimulatorFlags() { + // config fields + flag.StringVar(&FlagGenesisFileValue, "Genesis", "", "custom simulation genesis file; cannot be used with params file") + flag.StringVar(&FlagParamsFileValue, "Params", "", "custom simulation params file which overrides any random params; cannot be used with genesis") + flag.StringVar(&FlagExportParamsPathValue, "ExportParamsPath", "", "custom file path to save the exported params JSON") + flag.IntVar(&FlagExportParamsHeightValue, "ExportParamsHeight", 0, "height to which export the randomly generated params") + flag.StringVar(&FlagExportStatePathValue, "ExportStatePath", "", "custom file path to save the exported app state JSON") + flag.StringVar(&FlagExportStatsPathValue, "ExportStatsPath", "", "custom file path to save the exported simulation statistics JSON") + flag.Int64Var(&FlagSeedValue, "Seed", 42, "simulation random seed") + flag.IntVar(&FlagInitialBlockHeightValue, "InitialBlockHeight", 1, "initial block to start the simulation") + flag.IntVar(&FlagNumBlocksValue, "NumBlocks", 500, "number of new blocks to simulate from the initial block height") + flag.IntVar(&FlagBlockSizeValue, "BlockSize", 200, "operations per block") + flag.BoolVar(&FlagLeanValue, "Lean", false, "lean simulation log output") + flag.BoolVar(&FlagCommitValue, "Commit", false, "have the simulation commit") + flag.BoolVar(&FlagOnOperationValue, "SimulateEveryOperation", false, "run slow invariants every operation") + flag.BoolVar(&FlagAllInvariantsValue, "PrintAllInvariants", false, "print all invariants if a broken invariant is found") + + // simulation flags + flag.BoolVar(&FlagEnabledValue, "Enabled", false, "enable the simulation") + flag.BoolVar(&FlagVerboseValue, "Verbose", false, "verbose log output") + flag.UintVar(&FlagPeriodValue, "Period", 0, "run slow invariants only once every period assertions") + flag.Int64Var(&FlagGenesisTimeValue, "GenesisTime", 0, "override genesis UNIX time instead of using a random UNIX time") +} + +// NewConfigFromFlags creates a simulation from the retrieved values of the flags. +func NewConfigFromFlags() simulation.Config { + return simulation.Config{ + GenesisFile: FlagGenesisFileValue, + ParamsFile: FlagParamsFileValue, + ExportParamsPath: FlagExportParamsPathValue, + ExportParamsHeight: FlagExportParamsHeightValue, + ExportStatePath: FlagExportStatePathValue, + ExportStatsPath: FlagExportStatsPathValue, + Seed: FlagSeedValue, + InitialBlockHeight: FlagInitialBlockHeightValue, + NumBlocks: FlagNumBlocksValue, + BlockSize: FlagBlockSizeValue, + Lean: FlagLeanValue, + Commit: FlagCommitValue, + OnOperation: FlagOnOperationValue, + AllInvariants: FlagAllInvariantsValue, + } +} diff --git a/app/sim/sim_state.go b/app/sim/sim_state.go new file mode 100644 index 000000000..3eac64e59 --- /dev/null +++ b/app/sim/sim_state.go @@ -0,0 +1,254 @@ +package sim + +import ( + "encoding/json" + "fmt" + "io" + "math/rand" + "os" + "time" + + "cosmossdk.io/math" + cmtjson "github.com/cometbft/cometbft/libs/json" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/quasar-finance/quasar/app" +) + +// Simulation parameter constants +const ( + StakePerAccount = "stake_per_account" + InitiallyBondedValidators = "initially_bonded_validators" +) + +// AppStateFn returns the initial application state using a genesis or the simulation parameters. +// It panics if the user provides files for both of them. +// If a file is not given for the genesis or the sim params, it creates a randomized one. +func AppStateFn(cdc codec.Codec, simManager *module.SimulationManager, genesisState map[string]json.RawMessage) simtypes.AppStateFn { + return func(r *rand.Rand, accs []simtypes.Account, config simtypes.Config, + ) (appState json.RawMessage, simAccs []simtypes.Account, chainID string, genesisTimestamp time.Time) { + if FlagGenesisTimeValue == 0 { + genesisTimestamp = simtypes.RandTimestamp(r) + } else { + genesisTimestamp = time.Unix(FlagGenesisTimeValue, 0) + } + + chainID = config.ChainID + switch { + case config.ParamsFile != "" && config.GenesisFile != "": + panic("cannot provide both a genesis file and a params file") + + case config.GenesisFile != "": + // override the default chain-id from simapp to set it later to the config + genesisDoc, accounts, err := AppStateFromGenesisFileFn(r, cdc, config.GenesisFile) + if err != nil { + panic(err) + } + + if FlagGenesisTimeValue == 0 { + // use genesis timestamp if no custom timestamp is provided (i.e no random timestamp) + genesisTimestamp = genesisDoc.GenesisTime + } + + appState = genesisDoc.AppState + chainID = genesisDoc.ChainID + simAccs = accounts + + case config.ParamsFile != "": + appParams := make(simtypes.AppParams) + bz, err := os.ReadFile(config.ParamsFile) + if err != nil { + panic(err) + } + + err = json.Unmarshal(bz, &appParams) + if err != nil { + panic(err) + } + appState, simAccs = AppStateRandomizedFn(simManager, r, cdc, accs, genesisTimestamp, appParams, genesisState) + + default: + appParams := make(simtypes.AppParams) + appState, simAccs = AppStateRandomizedFn(simManager, r, cdc, accs, genesisTimestamp, appParams, genesisState) + } + + rawState := make(map[string]json.RawMessage) + err := json.Unmarshal(appState, &rawState) + if err != nil { + panic(err) + } + + stakingStateBz, ok := rawState[stakingtypes.ModuleName] + if !ok { + panic("staking genesis state is missing") + } + + stakingState := new(stakingtypes.GenesisState) + err = cdc.UnmarshalJSON(stakingStateBz, stakingState) + if err != nil { + panic(err) + } + // compute not bonded balance + notBondedTokens := math.ZeroInt() + for _, val := range stakingState.Validators { + if val.Status != stakingtypes.Unbonded { + continue + } + notBondedTokens = notBondedTokens.Add(val.GetTokens()) + } + notBondedCoins := sdk.NewCoin(stakingState.Params.BondDenom, notBondedTokens) + // edit bank state to make it have the not bonded pool tokens + bankStateBz, ok := rawState[banktypes.ModuleName] + // TODO(fdymylja/jonathan): should we panic in this case + if !ok { + panic("bank genesis state is missing") + } + bankState := new(banktypes.GenesisState) + err = cdc.UnmarshalJSON(bankStateBz, bankState) + if err != nil { + panic(err) + } + + stakingAddr := authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName).String() + var found bool + for _, balance := range bankState.Balances { + if balance.Address == stakingAddr { + found = true + break + } + } + if !found { + bankState.Balances = append(bankState.Balances, banktypes.Balance{ + Address: stakingAddr, + Coins: sdk.NewCoins(notBondedCoins), + }) + } + + // change appState back + rawState[stakingtypes.ModuleName] = cdc.MustMarshalJSON(stakingState) + rawState[banktypes.ModuleName] = cdc.MustMarshalJSON(bankState) + + // replace appstate + appState, err = json.Marshal(rawState) + if err != nil { + panic(err) + } + return appState, simAccs, chainID, genesisTimestamp + } +} + +// AppStateRandomizedFn creates calls each module's GenesisState generator function +// and creates the simulation params +func AppStateRandomizedFn( + simManager *module.SimulationManager, r *rand.Rand, cdc codec.Codec, + accs []simtypes.Account, genesisTimestamp time.Time, appParams simtypes.AppParams, + genesisState map[string]json.RawMessage, +) (json.RawMessage, []simtypes.Account) { + numAccs := int64(len(accs)) + // generate a random amount of initial stake coins and a random initial + // number of bonded accounts + var ( + numInitiallyBonded int64 + initialStake math.Int + ) + + appParams.GetOrGenerate( + StakePerAccount, &initialStake, r, + func(r *rand.Rand) { initialStake = math.NewInt(r.Int63n(1e12)) }, + ) + appParams.GetOrGenerate( + InitiallyBondedValidators, &numInitiallyBonded, r, + func(r *rand.Rand) { numInitiallyBonded = int64(r.Intn(300)) }, + ) + + if numInitiallyBonded > numAccs { + numInitiallyBonded = numAccs + } + + fmt.Printf( + `Selected randomly generated parameters for simulated genesis: +{ + stake_per_account: "%d", + initially_bonded_validators: "%d" +} +`, initialStake, numInitiallyBonded, + ) + + simState := &module.SimulationState{ + AppParams: appParams, + Cdc: cdc, + Rand: r, + GenState: genesisState, + Accounts: accs, + InitialStake: initialStake, + NumBonded: numInitiallyBonded, + GenTimestamp: genesisTimestamp, + } + + simManager.GenerateGenesisStates(simState) + + appState, err := json.Marshal(genesisState) + if err != nil { + panic(err) + } + + return appState, accs +} + +// AppStateFromGenesisFileFn util function to generate the genesis AppState +// from a genesis.json file. +func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account, error) { + bytes, err := os.ReadFile(genesisFile) + if err != nil { + panic(err) + } + + var genesis tmtypes.GenesisDoc + // NOTE: Comet uses a custom JSON decoder for GenesisDoc + err = cmtjson.Unmarshal(bytes, &genesis) + if err != nil { + panic(err) + } + + var appState app.GenesisState + err = json.Unmarshal(genesis.AppState, &appState) + if err != nil { + panic(err) + } + + var authGenesis authtypes.GenesisState + if appState[authtypes.ModuleName] != nil { + cdc.MustUnmarshalJSON(appState[authtypes.ModuleName], &authGenesis) + } + + newAccs := make([]simtypes.Account, len(authGenesis.Accounts)) + for i, acc := range authGenesis.Accounts { + // Pick a random private key, since we don't know the actual key + // This should be fine as it's only used for mock Tendermint validators + // and these keys are never actually used to sign by mock Tendermint. + privkeySeed := make([]byte, 15) + if _, err := r.Read(privkeySeed); err != nil { + panic(err) + } + + privKey := secp256k1.GenPrivKeyFromSecret(privkeySeed) + + a, ok := acc.GetCachedValue().(sdk.AccountI) + if !ok { + return genesis, nil, fmt.Errorf("expected account") + } + + // create simulator accounts + simAcc := simtypes.Account{PrivKey: privKey, PubKey: privKey.PubKey(), Address: a.GetAddress()} + newAccs[i] = simAcc + } + + return genesis, newAccs, nil +} diff --git a/app/sim/sim_utils.go b/app/sim/sim_utils.go new file mode 100644 index 000000000..78ef0fc98 --- /dev/null +++ b/app/sim/sim_utils.go @@ -0,0 +1,75 @@ +package sim + +import ( + "encoding/json" + "fmt" + "os" + + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/quasar-finance/quasar/app" +) + +// SimulationOperations retrieves the simulation params from the provided file path +// and returns all the modules weighted operations +func SimulationOperations(app *app.QuasarApp, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation { + simState := module.SimulationState{ + AppParams: make(simtypes.AppParams), + Cdc: cdc, + } + + if config.ParamsFile != "" { + bz, err := os.ReadFile(config.ParamsFile) + if err != nil { + panic(err) + } + + err = json.Unmarshal(bz, &simState.AppParams) + if err != nil { + panic(err) + } + } + + simState.LegacyProposalContents = app.SimulationManager().GetProposalContents(simState) //nolint:staticcheck + simState.ProposalMsgs = app.SimulationManager().GetProposalMsgs(simState) + return app.SimulationManager().WeightedOperations(simState) +} + +// CheckExportSimulation exports the app state and simulation parameters to JSON +// if the export paths are defined. +func CheckExportSimulation(app runtime.AppI, config simtypes.Config, params simtypes.Params) error { + if config.ExportStatePath != "" { + fmt.Println("exporting app state...") + exported, err := app.ExportAppStateAndValidators(false, nil, nil) + if err != nil { + return err + } + + if err := os.WriteFile(config.ExportStatePath, []byte(exported.AppState), 0o600); err != nil { + return err + } + } + + if config.ExportParamsPath != "" { + fmt.Println("exporting simulation params...") + paramsBz, err := json.MarshalIndent(params, "", " ") + if err != nil { + return err + } + + if err := os.WriteFile(config.ExportParamsPath, paramsBz, 0o600); err != nil { + return err + } + } + return nil +} + +// PrintStats prints the corresponding statistics from the app DB. +func PrintStats(db dbm.DB) { + fmt.Println("\nLevelDB Stats") + fmt.Println(db.Stats()["leveldb.stats"]) + fmt.Println("LevelDB cached block size", db.Stats()["leveldb.cachedblock"]) +} diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go new file mode 100644 index 000000000..58a2b09fd --- /dev/null +++ b/app/sim_bench_test.go @@ -0,0 +1,84 @@ +package app_test + +import ( + "os" + "testing" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + simulation2 "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" + app2 "github.com/quasar-finance/quasar/app" + "github.com/quasar-finance/quasar/app/sim" + "github.com/stretchr/testify/require" +) + +// Profile with: +// /usr/local/go/bin/go test -benchmem -run=^$ github.com/cosmos/cosmos-sdk/GaiaApp -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out +func BenchmarkFullAppSimulation(b *testing.B) { + b.ReportAllocs() + + config := simcli.NewConfigFromFlags() + config.ChainID = AppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "goleveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if err != nil { + b.Fatalf("simulation setup failed: %s", err.Error()) + } + + if skip { + b.Skip("skipping benchmark application simulation") + } + + defer func() { + require.NoError(b, db.Close()) + require.NoError(b, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + app := app2.New( + logger, + db, + nil, + true, + map[int64]bool{}, + app2.DefaultNodeHome, + 0, + appOptions, + emptyWasmOption, + interBlockCacheOpt(), + baseapp.SetChainID(AppChainID), + ) + + defaultGenesisState := app.ModuleBasics.DefaultGenesis(app.AppCodec()) + + // Run randomized simulation:w + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + app.BaseApp, + sim.AppStateFn(app.AppCodec(), app.SimulationManager(), defaultGenesisState), + simulation2.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + sim.SimulationOperations(app, app.AppCodec(), config), + app.ModuleAccountAddrs(), + config, + app.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + if err = sim.CheckExportSimulation(app, config, simParams); err != nil { + b.Fatal(err) + } + + if simErr != nil { + b.Fatal(simErr) + } + + if config.Commit { + sim.PrintStats(db) + } +} diff --git a/app/sim_test.go b/app/sim_test.go new file mode 100644 index 000000000..2db67fcd3 --- /dev/null +++ b/app/sim_test.go @@ -0,0 +1,143 @@ +package app_test + +import ( + "encoding/json" + "fmt" + "math/rand" + "os" + "testing" + + "cosmossdk.io/log" + "cosmossdk.io/math" + "cosmossdk.io/store" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + simulation2 "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" + "github.com/quasar-finance/quasar/ante" + "github.com/quasar-finance/quasar/app" + "github.com/quasar-finance/quasar/app/sim" + "github.com/stretchr/testify/require" +) + +// AppChainID hardcoded chainID for simulation +const AppChainID = "quasar-app" + +func init() { + sim.GetSimulatorFlags() +} + +// interBlockCacheOpt returns a BaseApp option function that sets the persistent +// inter-block write-through cache. +func interBlockCacheOpt() func(*baseapp.BaseApp) { + return baseapp.SetInterBlockCache(store.NewCommitKVStoreCacheManager()) +} + +func TestAppStateDeterminism(t *testing.T) { + if !sim.FlagEnabledValue { + t.Skip("skipping application simulation") + } + + // since we can't provide tx fees to SimulateFromSeed(), we must switch off the feemarket + ante.UseFeeMarketDecorator = false + + config := sim.NewConfigFromFlags() + config.InitialBlockHeight = 1 + config.ExportParamsPath = "" + config.OnOperation = false + config.AllInvariants = false + config.ChainID = AppChainID + + numSeeds := 3 + numTimesToRunPerSeed := 5 + + // We will be overriding the random seed and just run a single simulation on the provided seed value + if config.Seed != simcli.DefaultSeedValue { + numSeeds = 1 + } + + appHashList := make([]json.RawMessage, numTimesToRunPerSeed) + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[server.FlagInvCheckPeriod] = sim.FlagPeriodValue + + for i := 0; i < numSeeds; i++ { + if config.Seed == simcli.DefaultSeedValue { + config.Seed = rand.Int63() + } + + fmt.Println("config.Seed: ", config.Seed) + + for j := 0; j < numTimesToRunPerSeed; j++ { + var logger log.Logger + if sim.FlagVerboseValue { + logger = log.NewTestLogger(t) + } else { + logger = log.NewNopLogger() + } + + db := dbm.NewMemDB() + dir, err := os.MkdirTemp("", "quasar-simulation") + require.NoError(t, err) + appOptions[flags.FlagHome] = dir + app := app.New( + logger, + db, + nil, + true, + map[int64]bool{}, + dir, + 0, + appOptions, + emptyWasmOption, + interBlockCacheOpt(), + baseapp.SetChainID(AppChainID), + ) + + // NOTE: setting to zero to avoid failing the simulation + // due to the minimum staked tokens required to submit a vote + ante.SetMinStakedTokens(math.LegacyZeroDec()) + + // NOTE: setting to zero to avoid failing the simulation + // gaia ante allows only certain proposals to be expedited - the simulation doesn't know about this + ante.SetExpeditedProposalsEnabled(false) + + fmt.Printf( + "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", + config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, + ) + + blockedAddresses := app.BlockedModuleAccountAddrs() + + _, _, err = simulation.SimulateFromSeed( + t, + os.Stdout, + app.BaseApp, + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.ModuleBasics.DefaultGenesis(app.AppCodec())), + simulation2.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(app, app.AppCodec(), config), + blockedAddresses, + config, + app.AppCodec(), + ) + require.NoError(t, err) + + if config.Commit { + sim.PrintStats(db) + } + + appHash := app.LastCommitID().Hash + appHashList[j] = appHash + + if j != 0 { + require.Equal( + t, string(appHashList[0]), string(appHashList[j]), + "non-determinism in seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, + ) + } + } + } +} diff --git a/app/simulation_test.go b/app/simulation_test.go deleted file mode 100644 index 8bacb4e79..000000000 --- a/app/simulation_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package app_test - -import ( - "os" - "testing" - - "github.com/cosmos/cosmos-sdk/testutil/sims" - simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/cosmos/ibc-go/v7/testing/simapp" - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/app" -) - -func init() { - simapp.GetSimulatorFlags() -} - -// BenchmarkSimulation run the chain simulation -// Running using starport command: -// `starport chain simulate -v --numBlocks 200 --blockSize 50` -// Running as go benchmark test: -// `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true` -func BenchmarkSimulation(b *testing.B) { - simapp.FlagEnabledValue = true - simapp.FlagCommitValue = true - config, db, dir, logger, _, err := simapp.SetupSimulation("goleveldb-app-sim", "Simulation") - require.NoError(b, err, "simulation setup failed") - - b.Cleanup(func() { - db.Close() - err = os.RemoveAll(dir) - require.NoError(b, err) - }) - - encoding := app.MakeEncodingConfig() - - app := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - encoding, - sims.EmptyAppOptions{}, - app.EmptyWasmOpts, - ) - - // Run randomized simulations - _, simParams, simErr := simulation.SimulateFromSeed( - b, - os.Stdout, - app.BaseApp, - simapp.AppStateFn(app.AppCodec(), app.SimulationManager()), - simulationtypes.RandomAccounts, - simapp.SimulationOperations(app, app.AppCodec(), config), - app.ModuleAccountAddrs(), - config, - app.AppCodec(), - ) - - // export state and simParams before the simulation error is checked - err = simapp.CheckExportSimulation(app, config, simParams) - require.NoError(b, err) - require.NoError(b, simErr) - - if config.Commit { - simapp.PrintStats(db) - } -} diff --git a/app/upgrades/types.go b/app/upgrades/types.go index d37696946..71e1d2d25 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -1,19 +1,19 @@ package upgrades import ( + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - store "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/quasarlabs/quasarnode/app/keepers" + "github.com/quasar-finance/quasar/app/keepers" ) // BaseAppParamManager defines an interrace that BaseApp is expected to fullfil // that allows upgrade handlers to modify BaseApp parameters. type BaseAppParamManager interface { - GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams - StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusParams) + GetConsensusParams(ctx sdk.Context) tmproto.ConsensusParams + StoreConsensusParams(ctx sdk.Context, cp tmproto.ConsensusParams) error } // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal @@ -28,10 +28,9 @@ type Upgrade struct { CreateUpgradeHandler func( mm *module.Manager, configurator module.Configurator, - bam BaseAppParamManager, keepers *keepers.AppKeepers, ) upgradetypes.UpgradeHandler // Store upgrades, should be used for any new modules introduced, new modules deleted, or store names renamed. - StoreUpgrades store.StoreUpgrades + StoreUpgrades storetypes.StoreUpgrades } diff --git a/app/upgrades/v0/constants.go b/app/upgrades/v0/constants.go deleted file mode 100644 index 610386725..000000000 --- a/app/upgrades/v0/constants.go +++ /dev/null @@ -1,21 +0,0 @@ -package v0 - -import ( - store "github.com/cosmos/cosmos-sdk/store/types" - authztypes "github.com/cosmos/cosmos-sdk/x/authz/keeper" - "github.com/quasarlabs/quasarnode/app/upgrades" - qvestingtypes "github.com/quasarlabs/quasarnode/x/qvesting/types" - tftypes "github.com/quasarlabs/quasarnode/x/tokenfactory/types" -) - -// UpgradeName defines the on-chain upgrade name for the Quasar chain v1.0.0 upgrade. -const UpgradeName = "v1" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{qvestingtypes.StoreKey, tftypes.StoreKey, authztypes.StoreKey}, - Deleted: []string{}, - }, -} diff --git a/app/upgrades/v0/export_test.go b/app/upgrades/v0/export_test.go deleted file mode 100644 index 636c40a94..000000000 --- a/app/upgrades/v0/export_test.go +++ /dev/null @@ -1,10 +0,0 @@ -package v0 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - qvestingkeeper "github.com/quasarlabs/quasarnode/x/qvesting/keeper" -) - -func SetQVestingParams(ctx sdk.Context, icqKeeper *qvestingkeeper.Keeper) { - setQVestingParams(ctx, icqKeeper) -} diff --git a/app/upgrades/v0/upgrades.go b/app/upgrades/v0/upgrades.go deleted file mode 100644 index a788c898a..000000000 --- a/app/upgrades/v0/upgrades.go +++ /dev/null @@ -1,37 +0,0 @@ -package v0 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/quasarlabs/quasarnode/app/keepers" - "github.com/quasarlabs/quasarnode/app/upgrades" - qvestingkeeper "github.com/quasarlabs/quasarnode/x/qvesting/keeper" - qvestingtypes "github.com/quasarlabs/quasarnode/x/qvesting/types" - tfkeeper "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" - tftypes "github.com/quasarlabs/quasarnode/x/tokenfactory/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - bpm upgrades.BaseAppParamManager, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - setQVestingParams(ctx, &keepers.QVestingKeeper) - setTfParams(ctx, &keepers.TfKeeper) - - return mm.RunMigrations(ctx, configurator, fromVM) - } -} - -func setQVestingParams(ctx sdk.Context, qvestingKeeper *qvestingkeeper.Keeper) { - qvestingParams := qvestingtypes.DefaultParams() - qvestingKeeper.SetParams(ctx, qvestingParams) -} - -func setTfParams(ctx sdk.Context, tfKeeper *tfkeeper.Keeper) { - tfParams := tftypes.DefaultParams() - tfKeeper.SetParams(ctx, tfParams) -} diff --git a/app/upgrades/v2/constants.go b/app/upgrades/v2/constants.go index 0c40532e6..b7ac857d3 100644 --- a/app/upgrades/v2/constants.go +++ b/app/upgrades/v2/constants.go @@ -1,13 +1,12 @@ package v2 import ( - store "github.com/cosmos/cosmos-sdk/store/types" + store "cosmossdk.io/store/types" consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" + icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" - - "github.com/quasarlabs/quasarnode/app/upgrades" + "github.com/quasar-finance/quasar/app/upgrades" ) // UpgradeName defines the on-chain upgrade name for the Quasar chain v2.0.0 upgrade. diff --git a/app/upgrades/v2/upgrades.go b/app/upgrades/v2/upgrades.go index d4600225f..4293c060d 100644 --- a/app/upgrades/v2/upgrades.go +++ b/app/upgrades/v2/upgrades.go @@ -1,112 +1,20 @@ package v2 import ( - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - qosmotypes "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - qoraclemoduletypes "github.com/quasarlabs/quasarnode/x/qoracle/types" - qtransfertypes "github.com/quasarlabs/quasarnode/x/qtransfer/types" - tftypes "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "context" - "github.com/quasarlabs/quasarnode/app/keepers" - "github.com/quasarlabs/quasarnode/app/upgrades" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/quasar-finance/quasar/app/keepers" ) func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, - bpm upgrades.BaseAppParamManager, keepers *keepers.AppKeepers, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - fromVM[govtypes.ModuleName] = 1 - baseAppLegacySS := keepers.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) - - // https://github.com/cosmos/cosmos-sdk/pull/12363/files - // Set param key table for params module migration - for _, subspace := range keepers.ParamsKeeper.GetSubspaces() { - subspace := subspace - - var keyTable paramstypes.KeyTable - switch subspace.Name() { - // sdk - case authtypes.ModuleName: - keyTable = authtypes.ParamKeyTable() //nolint:staticcheck - case banktypes.ModuleName: - keyTable = banktypes.ParamKeyTable() //nolint:staticcheck - case stakingtypes.ModuleName: - keyTable = stakingtypes.ParamKeyTable() //nolint:staticcheck - case minttypes.ModuleName: - keyTable = minttypes.ParamKeyTable() //nolint:staticcheck - case distrtypes.ModuleName: - keyTable = distrtypes.ParamKeyTable() //nolint:staticcheck - case slashingtypes.ModuleName: - keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck - case govtypes.ModuleName: - keyTable = govv1.ParamKeyTable() //nolint:staticcheck - case crisistypes.ModuleName: - keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck - - // ibc types - case ibctransfertypes.ModuleName: - keyTable = ibctransfertypes.ParamKeyTable() //nolint:staticcheck - case icahosttypes.SubModuleName: - keyTable = icahosttypes.ParamKeyTable() //nolint:staticcheck - case icacontrollertypes.SubModuleName: - keyTable = icacontrollertypes.ParamKeyTable() //nolint:staticcheck - case icqtypes.ModuleName: - keyTable = icqtypes.ParamKeyTable() //nolint:staticcheck - - // wasm - case wasmtypes.ModuleName: - keyTable = wasmtypes.ParamKeyTable() //nolint:staticcheck - - // quasar - case qoraclemoduletypes.ModuleName: - keyTable = qoraclemoduletypes.ParamKeyTable() - case qosmotypes.SubModuleName: - keyTable = qosmotypes.ParamKeyTable() - case qtransfertypes.ModuleName: - keyTable = qtransfertypes.ParamKeyTable() - case tftypes.ModuleName: - keyTable = tftypes.ParamKeyTable() - // qvesting does not have params - - default: - continue - } - - if !subspace.HasKeyTable() { - subspace.WithKeyTable(keyTable) - } - } - - // Migrate Tendermint consensus parameters from x/params module to a deprecated x/consensus module. - // The old params module is required to still be imported in your app.go in order to handle this migration. - baseapp.MigrateParams(ctx, baseAppLegacySS, keepers.ConsensusParamsKeeper) - - migrations, err := mm.RunMigrations(ctx, configurator, fromVM) - if err != nil { - return nil, err - } + return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return migrations, nil + return mm.RunMigrations(ctx, configurator, fromVM) } -} +} \ No newline at end of file diff --git a/app/upgrades/v3/constants.go b/app/upgrades/v3/constants.go new file mode 100644 index 000000000..6f92b123c --- /dev/null +++ b/app/upgrades/v3/constants.go @@ -0,0 +1,26 @@ +package v3 + +import ( + store "cosmossdk.io/store/types" + pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" + ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/types" + ratelimittypes "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/types" + "github.com/quasar-finance/quasar/app/upgrades" + feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" +) + +// UpgradeName defines the on-chain upgrade name for the Quasar chain v2.0.0 upgrade. +const ( + UpgradeName = "v3" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + feemarkettypes.StoreKey, ibchookstypes.StoreKey, pfmtypes.StoreKey, ratelimittypes.StoreKey, + }, + Deleted: []string{}, + }, +} diff --git a/app/upgrades/v3/upgrades.go b/app/upgrades/v3/upgrades.go new file mode 100644 index 000000000..ec34c024f --- /dev/null +++ b/app/upgrades/v3/upgrades.go @@ -0,0 +1,97 @@ +package v3 + +import ( + "context" + "fmt" + + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" + ratelimittypes "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/types" + "github.com/quasar-finance/quasar/app/keepers" + appparams "github.com/quasar-finance/quasar/app/params" + feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" + feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" +) + +// CreateUpgradeHandler runs migrations and param changes needed for upgrade. +// Note : Always use RunMigrations before setting new params +// as RunMigrations calls InitGenesis with default params +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(c context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + modulesToRemove := []string{"qtransfer", "qoracle", "qvesting"} + ctx := sdk.UnwrapSDKContext(c) + // Iterate over each module + for _, moduleName := range modulesToRemove { + storeKey := keepers.GetKey(moduleName) + + // Access the store directly using the store key + store := ctx.KVStore(storeKey) + + // Iterate over all key-value pairs in the store and delete them + iterator := store.Iterator(nil, nil) + defer func(iterator storetypes.Iterator) { + err := iterator.Close() + if err != nil { + panic(err) + } + }(iterator) + + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } + } + + vm, err := mm.RunMigrations(ctx, configurator, fromVM) + if err != nil { + return vm, err + } + + // Set rate-limit params + keepers.RatelimitKeeper.SetParams(ctx, ratelimittypes.DefaultParams()) + // Set pfm params + err = keepers.PFMRouterKeeper.SetParams(ctx, pfmtypes.DefaultParams()) + if err != nil { + return nil, err + } + // fee market params + // TODO: change values from default after discussion + ctx.Logger().Info("Setting dynamicfees/feemarket params...") + err = setFeeMarketParams(ctx, keepers.FeeMarketKeeper) + if err != nil { + return nil, err + } + + ctx.Logger().Info(fmt.Sprintf("Migration {%s} applied", UpgradeName)) + return vm, nil + } +} + +func setFeeMarketParams(ctx sdk.Context, feemarketKeeper *feemarketkeeper.Keeper) error { + feemarketParams := feemarkettypes.DefaultParams() + feemarketParams.MinBaseGasPrice = math.LegacyMustNewDecFromStr("0.10000000000000000") + feemarketParams.MaxBlockUtilization = uint64(120_000_000) + feemarketParams.FeeDenom = appparams.DefaultBondDenom + feemarketParams.Enabled = true + feemarketParams.DistributeFees = true + + feemarketState := feemarkettypes.NewState(feemarketParams.Window, feemarketParams.MinBaseGasPrice, feemarketParams.MinLearningRate) + err := feemarketKeeper.SetParams(ctx, feemarketParams) + if err != nil { + return errorsmod.Wrap(err, "failed to set feemarket params") + } + err = feemarketKeeper.SetState(ctx, feemarketState) + if err != nil { + return errorsmod.Wrap(err, "failed to set feemarket state") + } + + return nil +} diff --git a/app/upgrades/v3/upgrades_test.go b/app/upgrades/v3/upgrades_test.go new file mode 100644 index 000000000..dd4c540a0 --- /dev/null +++ b/app/upgrades/v3/upgrades_test.go @@ -0,0 +1,111 @@ +package v3_test + +import ( + "fmt" + "testing" + "time" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/header" + "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/upgrade" + upgradetypes "cosmossdk.io/x/upgrade/types" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" + ratelimittypes "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/types" + "github.com/quasar-finance/quasar/app/apptesting" + v3 "github.com/quasar-finance/quasar/app/upgrades/v3" + feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" + "github.com/stretchr/testify/suite" +) + +const ( + v3UpgradeHeight = int64(5) +) + +type UpgradeTestSuite struct { + preModule appmodule.HasPreBlocker + apptesting.KeeperTestHelper +} + +func TestUpgradeTestSuite(t *testing.T) { + suite.Run(t, new(UpgradeTestSuite)) +} + +func (s *UpgradeTestSuite) PreBlockerSetup() { + s.preModule = upgrade.NewAppModule(s.App.UpgradeKeeper, addresscodec.NewBech32Codec("osmo")) +} +func (s *UpgradeTestSuite) TestUpgrade() { + s.Setup() + s.PreBlockerSetup() + + // Pre-upgrade setup: Insert dummy data into the stores to be deleted + ctx := s.Ctx + keepers := s.App.AppKeepers + + modulesToRemove := []string{"qtransfer", "qoracle", "qvesting"} + for _, moduleName := range modulesToRemove { + storeKey := keepers.GetKey(moduleName) + store := ctx.KVStore(storeKey) + prefixStore := prefix.NewStore(store, []byte{}) + + // Insert a dummy key-value pair + prefixStore.Set([]byte("dummyKey"), []byte("dummyValue")) + } + + // Simulate the upgrade + dummyUpgrade(s) + s.Require().NotPanics(func() { + _, err := s.preModule.PreBlock(s.Ctx) + s.Require().NoError(err) + }) + + // Post-upgrade assertions + for _, moduleName := range modulesToRemove { + storeKey := keepers.GetKey(moduleName) + store := ctx.KVStore(storeKey) + + // Iterate over all key-value pairs in the store to verify it's empty + iterator := store.Iterator(nil, nil) + defer func(iterator storetypes.Iterator) { + err := iterator.Close() + if err != nil { + panic(err) + } + }(iterator) + + // Check if the iterator is valid, which would mean the store is not empty + s.Require().False(iterator.Valid(), fmt.Sprintf("Store for module %s is not empty", moduleName)) + } + + // Assert that the rate-limit params were set correctly + rateLimitParams := keepers.RatelimitKeeper.GetParams(ctx) + s.Require().Equal(ratelimittypes.DefaultParams(), rateLimitParams, "Rate limit params do not match default params after upgrade") + + // Assert that the PFM params were set correctly + pfmParams := keepers.PFMRouterKeeper.GetParams(ctx) + s.Require().Equal(pfmtypes.DefaultParams(), pfmParams, "PFM params do not match default params after upgrade") + + // Assert that the fee market params were set correctly + feemarketParams, err := keepers.FeeMarketKeeper.GetParams(ctx) + s.Require().NoError(err, "Error getting feemarket params after upgrade") + expectedFeeMarketParams := feemarkettypes.DefaultParams() + expectedFeeMarketParams.MinBaseGasPrice = math.LegacyMustNewDecFromStr("0.10000000000000000") + expectedFeeMarketParams.MaxBlockUtilization = uint64(120000000) + expectedFeeMarketParams.FeeDenom = "uqsr" + expectedFeeMarketParams.DistributeFees = true + s.Require().Equal(expectedFeeMarketParams, feemarketParams, "Fee market params do not match expected values after upgrade") +} + +func dummyUpgrade(s *UpgradeTestSuite) { + s.Ctx = s.Ctx.WithBlockHeight(v3UpgradeHeight - 1) + plan := upgradetypes.Plan{Name: v3.Upgrade.UpgradeName, Height: v3UpgradeHeight} + err := s.App.UpgradeKeeper.ScheduleUpgrade(s.Ctx, plan) + s.Require().NoError(err) + _, err = s.App.UpgradeKeeper.GetUpgradePlan(s.Ctx) + s.Require().NoError(err) + + s.Ctx = s.Ctx.WithHeaderInfo(header.Info{Height: v3UpgradeHeight, Time: s.Ctx.BlockTime().Add(time.Second)}).WithBlockHeight(v3UpgradeHeight) +} diff --git a/buf.work.yaml b/buf.work.yaml index d3ed9b563..7a18eb025 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -1,4 +1,3 @@ version: v1 directories: - - proto - - third_party/proto \ No newline at end of file + - proto \ No newline at end of file diff --git a/cmd/quasard/cmd/bech32.go b/cmd/quasard/cmd/bech32.go new file mode 100644 index 000000000..c9674179b --- /dev/null +++ b/cmd/quasard/cmd/bech32.go @@ -0,0 +1,50 @@ +package cmd + +// DONTCOVER + +import ( + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/types/bech32" +) + +var flagBech32Prefix = "prefix" + +// get cmd to convert any bech32 address to an osmo prefix. +func ConvertBech32Cmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "bech32-convert [bech32 string]", + Short: "Convert any bech32 string to the quasar prefix", + Long: `Convert any bech32 string to the quasar prefix +Especially useful for converting cosmos addresses to quasar addresses + +Example: + quasard bech32-convert cosmos1ey69r37gfxvxg62sh4r0ktpuc46pzjrmz29g45 + `, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + bech32prefix, err := cmd.Flags().GetString(flagBech32Prefix) + if err != nil { + return err + } + + _, bz, err := bech32.DecodeAndConvert(args[0]) + if err != nil { + return err + } + + bech32Addr, err := bech32.ConvertAndEncode(bech32prefix, bz) + if err != nil { + panic(err) + } + + cmd.Println(bech32Addr) + + return nil + }, + } + + cmd.Flags().StringP(flagBech32Prefix, "p", "quasar", "Bech32 Prefix to encode to") + + return cmd +} diff --git a/cmd/quasard/cmd/config.go b/cmd/quasard/cmd/config.go new file mode 100644 index 000000000..c1272eace --- /dev/null +++ b/cmd/quasard/cmd/config.go @@ -0,0 +1,21 @@ +package cmd + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + appparams "github.com/quasar-finance/quasar/app/params" +) + +func InitTestConfig() { + // Set prefixes + accountPubKeyPrefix := appparams.Bech32PrefixAccAddr + "pub" + validatorAddressPrefix := appparams.Bech32PrefixAccAddr + "valoper" + validatorPubKeyPrefix := appparams.Bech32PrefixAccAddr + "valoperpub" + consNodeAddressPrefix := appparams.Bech32PrefixAccAddr + "valcons" + consNodePubKeyPrefix := appparams.Bech32PrefixAccAddr + "valconspub" + + // Set and seal config + config := sdk.GetConfig() + config.SetBech32PrefixForAccount(appparams.Bech32PrefixAccAddr, accountPubKeyPrefix) + config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) + config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) +} diff --git a/cmd/quasarnoded/cmd/genaccounts.go b/cmd/quasard/cmd/genaccounts.go similarity index 98% rename from cmd/quasarnoded/cmd/genaccounts.go rename to cmd/quasard/cmd/genaccounts.go index 2f7a5ccef..9687d4bcf 100644 --- a/cmd/quasarnoded/cmd/genaccounts.go +++ b/cmd/quasard/cmd/genaccounts.go @@ -101,7 +101,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + baseVestingAccount, _ := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { diff --git a/cmd/quasarnoded/cmd/root.go b/cmd/quasard/cmd/root.go similarity index 59% rename from cmd/quasarnoded/cmd/root.go rename to cmd/quasard/cmd/root.go index 275fe2a57..8703eaf5a 100644 --- a/cmd/quasarnoded/cmd/root.go +++ b/cmd/quasard/cmd/root.go @@ -6,27 +6,39 @@ import ( "os" "path/filepath" + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/snapshots" + snapshottypes "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" + confixcmd "cosmossdk.io/tools/confix/cmd" + rosettaCmd "cosmossdk.io/tools/rosetta/cmd" + "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - dbm "github.com/cometbft/cometbft-db" tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" - tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/client/snapshot" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/tx/signing" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" @@ -34,112 +46,182 @@ import ( genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/prometheus/client_golang/prometheus" + "github.com/quasar-finance/quasar/app" + appparams "github.com/quasar-finance/quasar/app/params" "github.com/spf13/cast" "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/app" - appparams "github.com/quasarlabs/quasarnode/app/params" + "github.com/spf13/viper" ) // NewRootCmd creates a new root command for a Cosmos SDK application -func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) { - encodingConfig := app.MakeEncodingConfig() +func NewRootCmd() *cobra.Command { + // we "pre"-instantiate the application for getting the injected/configured encoding configuration + initAppOptions := viper.New() + tempDir := tempDir() + initAppOptions.Set(flags.FlagHome, tempDir) + tempApplication := app.New( + log.NewNopLogger(), + dbm.NewMemDB(), + nil, + true, + map[int64]bool{}, + tempDir, + cast.ToUint(initAppOptions.Get(server.FlagInvCheckPeriod)), + initAppOptions, + app.EmptyWasmOpts, + ) + defer func() { + if err := tempApplication.Close(); err != nil { + panic(err) + } + }() + initClientCtx := client.Context{}. - WithCodec(encodingConfig.Marshaler). - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). + WithCodec(tempApplication.AppCodec()). + WithInterfaceRegistry(tempApplication.InterfaceRegistry()). + WithTxConfig(tempApplication.GetTxConfig()). + WithLegacyAmino(tempApplication.LegacyAmino()). WithInput(os.Stdin). WithAccountRetriever(types.AccountRetriever{}). WithHomeDir(app.DefaultNodeHome). WithViper("") rootCmd := &cobra.Command{ - Use: app.Name + "d", + Use: appparams.Name + "d", Short: "Start Quasar QuasarApp", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) cmd.SetErr(cmd.ErrOrStderr()) + + initClientCtx = initClientCtx.WithCmdContext(cmd.Context()) initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) if err != nil { return err } + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) if err != nil { return err } - if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { + // This needs to go after ReadFromClientConfig, as that function + // sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode + // is only available if the client is online. + if !initClientCtx.Offline { + txConfigOpts := tx.ConfigOptions{ + EnabledSignModes: append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL), + TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx), + } + txConfigWithTextual, err := tx.NewTxConfigWithOptions( + initClientCtx.Codec, + txConfigOpts, + ) + if err != nil { + return err + } + initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual) + } + + if err = client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { return err } customAppTemplate, customAppConfig := initAppConfig() - customTMConfig := initTendermintConfig() - return server.InterceptConfigsPreRunHandler( - cmd, customAppTemplate, customAppConfig, customTMConfig, - ) + customCometConfig := initCometConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCometConfig) }, } - initRootCmd(rootCmd, encodingConfig) + initRootCmd(rootCmd, tempApplication.ModuleBasics, tempApplication.AppCodec(), tempApplication.InterfaceRegistry(), tempApplication.GetTxConfig()) + + autoCliOpts := enrichAutoCliOpts(tempApplication.AutoCliOpts(), initClientCtx) + if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } + + return rootCmd +} + +func enrichAutoCliOpts(autoCliOpts autocli.AppOptions, clientCtx client.Context) autocli.AppOptions { + autoCliOpts.AddressCodec = addresscodec.NewBech32Codec(appparams.Bech32PrefixAccAddr) + autoCliOpts.ValidatorAddressCodec = addresscodec.NewBech32Codec(appparams.Bech32PrefixValAddr) + autoCliOpts.ConsensusAddressCodec = addresscodec.NewBech32Codec(appparams.Bech32PrefixConsAddr) - return rootCmd, encodingConfig + autoCliOpts.ClientCtx = clientCtx + + return autoCliOpts } -// initTendermintConfig helps to override default Tendermint Config values. +// initCometConfig helps to override default CometBFT Config values. // return tmcfg.DefaultConfig if no custom configuration is required for the application. -func initTendermintConfig() *tmcfg.Config { +func initCometConfig() *tmcfg.Config { cfg := tmcfg.DefaultConfig() - // TODO - SDK50 - Can get some ref for the default values from quicksilver + // https://github.com/quicksilver-zone/quicksilver/blob/update/sdk47/cmd/quicksilverd/root.go#L137 + // these values put a higher strain on node memory + cfg.P2P.MaxNumInboundPeers = 40 + cfg.P2P.MaxNumOutboundPeers = 10 + return cfg } func initRootCmd( rootCmd *cobra.Command, - encodingConfig appparams.EncodingConfig, + basicManager module.BasicManager, + cdc codec.Codec, + interfaceRegistry codectypes.InterfaceRegistry, + txConfig client.TxConfig, ) { - // Set config - initSDKConfig() - gentxModule := app.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) + + ac := appCreator{} + + debugCmd := debug.Cmd() + debugCmd.AddCommand(ConvertBech32Cmd()) + + gentxModule := basicManager[genutiltypes.ModuleName].(genutil.AppModuleBasic) rootCmd.AddCommand( - genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, gentxModule.GenTxValidator), - genutilcli.MigrateGenesisCmd(), + genutilcli.InitCmd(basicManager, app.DefaultNodeHome), + tmcli.NewCompletionCmd(rootCmd, true), + confixcmd.ConfigCommand(), + pruning.Cmd(ac.newApp, app.DefaultNodeHome), + snapshot.Cmd(ac.newApp), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, + app.DefaultNodeHome, + gentxModule.GenTxValidator, + txConfig.SigningContext().ValidatorAddressCodec()), genutilcli.GenTxCmd( - app.ModuleBasics, - encodingConfig.TxConfig, + basicManager, + txConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, + txConfig.SigningContext().ValidatorAddressCodec(), ), - genutilcli.ValidateGenesisCmd(app.ModuleBasics), + genutilcli.ValidateGenesisCmd(basicManager), AddGenesisAccountCmd(app.DefaultNodeHome), - tmcli.NewCompletionCmd(rootCmd, true), - debug.Cmd(), - config.Cmd(), + debugCmd, + // config.Cmd(), TODO Slinky : Config support to be added. https://github.com/neutron-org/neutron/blob/feat/sdk-50/cmd/neutrond/config.go ) - a := appCreator{ - encodingConfig, - } - // add server commands server.AddCommands( rootCmd, app.DefaultNodeHome, - a.newApp, - a.appExport, + ac.newApp, + ac.appExport, addModuleInitFlags, ) // add keybase, auxiliary RPC, query, and tx child commands rootCmd.AddCommand( - rpc.StatusCommand(), + server.StatusCommand(), queryCommand(), - txCommand(), - keys.Commands(app.DefaultNodeHome), + txCommand(basicManager), + keys.Commands(), ) + + // add rosetta + rootCmd.AddCommand(rosettaCmd.RosettaCommand(interfaceRegistry, cdc)) } // queryCommand returns the sub-command to send queries to the app @@ -154,21 +236,21 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - authcmd.GetAccountCmd(), + authcmd.QueryTxCmd(), rpc.ValidatorCommand(), - rpc.BlockCommand(), + server.QueryBlockCmd(), + server.QueryBlocksCmd(), + server.QueryBlockResultsCmd(), authcmd.QueryTxsByEventsCmd(), - authcmd.QueryTxCmd(), ) - app.ModuleBasics.AddQueryCommands(cmd) cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd } // txCommand returns the sub-command to send transactions to the app -func txCommand() *cobra.Command { +func txCommand(basicManager module.BasicManager) *cobra.Command { cmd := &cobra.Command{ Use: "tx", Short: "Transactions subcommands", @@ -188,7 +270,10 @@ func txCommand() *cobra.Command { authcmd.GetDecodeCommand(), ) - app.ModuleBasics.AddTxCommands(cmd) + // NOTE: this must be registered for now so that submit-legacy-proposal + // message (e.g. consumer-addition proposal) can be routed to the its handler and processed correctly. + basicManager.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd @@ -196,6 +281,7 @@ func txCommand() *cobra.Command { func addModuleInitFlags(startCmd *cobra.Command) { crisis.AddModuleInitFlags(startCmd) + wasm.AddModuleInitFlags(startCmd) } type appCreator struct { @@ -209,7 +295,7 @@ func (a appCreator) newApp( traceStore io.Writer, appOpts servertypes.AppOptions, ) servertypes.Application { - var cache sdk.MultiStorePersistentCache + var cache storetypes.MultiStorePersistentCache if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { cache = store.NewCommitKVStoreCacheManager() @@ -224,12 +310,12 @@ func (a appCreator) newApp( if err != nil { panic(err) } - // SDK 47 - Set chain id + homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) chainID := cast.ToString(appOpts.Get(flags.FlagChainID)) if chainID == "" { - // fallback to genesis chain-ida. - appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json")) + // fallback to genesis chain-id + appGenesis, err := genutiltypes.AppGenesisFromFile(filepath.Join(homeDir, "config", "genesis.json")) if err != nil { panic(err) } @@ -237,8 +323,8 @@ func (a appCreator) newApp( chainID = appGenesis.ChainID } - snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") - snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir) + snapshotDir := filepath.Join(homeDir, "data", "snapshots") + snapshotDB, err := dbm.NewDB("metadata", server.GetAppDBBackend(appOpts), snapshotDir) if err != nil { panic(err) } @@ -264,7 +350,6 @@ func (a appCreator) newApp( skipUpgradeHeights, cast.ToString(appOpts.Get(flags.FlagHome)), cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), - a.encodingConfig, appOpts, wasmOpts, baseapp.SetChainID(chainID), @@ -295,14 +380,23 @@ func (a appCreator) appExport( ) (servertypes.ExportedApp, error) { homePath, ok := appOpts.Get(flags.FlagHome).(string) if !ok || homePath == "" { - return servertypes.ExportedApp{}, errors.New("application home not set") + return servertypes.ExportedApp{}, errors.New("application home is not set") } var loadLatest bool if height == -1 { loadLatest = true } - app := app.New( + // InvCheckPeriod + viperAppOpts, ok := appOpts.(*viper.Viper) + if !ok { + return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") + } + // overwrite the FlagInvCheckPeriod + viperAppOpts.Set(server.FlagInvCheckPeriod, 1) + appOpts = viperAppOpts + + quasarApp := app.New( logger, db, traceStore, @@ -310,18 +404,17 @@ func (a appCreator) appExport( map[int64]bool{}, homePath, uint(1), - a.encodingConfig, appOpts, app.EmptyWasmOpts, ) if height != -1 { - if err := app.LoadHeight(height); err != nil { + if err := quasarApp.LoadHeight(height); err != nil { return servertypes.ExportedApp{}, err } } - return app.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) + return quasarApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) } // initAppConfig helps to override default appConfig template and configs. @@ -379,3 +472,13 @@ lru_size = 0` return customAppTemplate, customAppConfig } + +var tempDir = func() string { + dir, err := os.MkdirTemp("", ".quasarnode") + if err != nil { + dir = app.DefaultNodeHome + } + defer os.RemoveAll(dir) + + return dir +} diff --git a/cmd/quasard/main.go b/cmd/quasard/main.go new file mode 100644 index 000000000..213f221fc --- /dev/null +++ b/cmd/quasard/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "os" + + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + + "github.com/quasar-finance/quasar/app" + appparams "github.com/quasar-finance/quasar/app/params" + "github.com/quasar-finance/quasar/cmd/quasard/cmd" +) + +// "Looks good to me. Ready for launch. LFG" -@valeyo +func main() { + appparams.SetAddressPrefixes() + rootCmd := cmd.NewRootCmd() + + if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { + os.Exit(1) + } +} diff --git a/cmd/quasarnoded/cmd/config.go b/cmd/quasarnoded/cmd/config.go deleted file mode 100644 index f85944232..000000000 --- a/cmd/quasarnoded/cmd/config.go +++ /dev/null @@ -1,38 +0,0 @@ -package cmd - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/app" -) - -func InitTestConfig() { - // Set prefixes - accountPubKeyPrefix := app.AccountAddressPrefix + "pub" - validatorAddressPrefix := app.AccountAddressPrefix + "valoper" - validatorPubKeyPrefix := app.AccountAddressPrefix + "valoperpub" - consNodeAddressPrefix := app.AccountAddressPrefix + "valcons" - consNodePubKeyPrefix := app.AccountAddressPrefix + "valconspub" - - // Set and seal config - config := sdk.GetConfig() - config.SetBech32PrefixForAccount(app.AccountAddressPrefix, accountPubKeyPrefix) - config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) - config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) -} - -func initSDKConfig() { - // Set prefixes - accountPubKeyPrefix := app.AccountAddressPrefix + "pub" - validatorAddressPrefix := app.AccountAddressPrefix + "valoper" - validatorPubKeyPrefix := app.AccountAddressPrefix + "valoperpub" - consNodeAddressPrefix := app.AccountAddressPrefix + "valcons" - consNodePubKeyPrefix := app.AccountAddressPrefix + "valconspub" - - // Set and seal config - config := sdk.GetConfig() - config.SetBech32PrefixForAccount(app.AccountAddressPrefix, accountPubKeyPrefix) - config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) - config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) - config.Seal() -} diff --git a/cmd/quasarnoded/main.go b/cmd/quasarnoded/main.go deleted file mode 100644 index b910dc0b9..000000000 --- a/cmd/quasarnoded/main.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "errors" - "os" - - "github.com/cosmos/cosmos-sdk/server" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - - "github.com/quasarlabs/quasarnode/app" - "github.com/quasarlabs/quasarnode/cmd/quasarnoded/cmd" -) - -// "Looks good to me. Ready for launch. LFG" -@valeyo -func main() { - rootCmd, _ := cmd.NewRootCmd() - - if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { - var e server.ErrorCode - switch { - case errors.As(err, &e): - os.Exit(e.Code) - default: - os.Exit(1) - } - } -} diff --git a/demos/airdrop/airdrop.sh b/demos/airdrop/airdrop.sh index f6b854a63..7c007ac00 100644 --- a/demos/airdrop/airdrop.sh +++ b/demos/airdrop/airdrop.sh @@ -1,6 +1,6 @@ #!/bin/sh -BINARY=quasarnoded +BINARY=quasard CHAIN_ID="quasar" ACCOUNT_NAME="alice" ACCOUNT_ADDRESS="quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" @@ -20,44 +20,44 @@ OUT1=$($BINARY tx wasm instantiate $CODE_ID "$INIT" --from $ACCOUNT_NAME --keyri ADDR1=$($BINARY query wasm list-contract-by-code $CODE_ID --output json | jq -r '.contracts[0]') echo "Got address of primitive 1 contract = $ADDR1" -quasarnoded query wasm contract-state smart $ADDR1 '{"airdrop_config_query":{}}' +quasard query wasm contract-state smart $ADDR1 '{"airdrop_config_query":{}}' echo "Should not fail" -quasarnoded tx wasm execute $ADDR1 '{"admin": {"add_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "2500000000"}, {"address": "quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu", "amount": "2500000000"}, {"address": "quasar1zaavvzxez0elundtn32qnk9lkm8kmcszvnk6zf", "amount": "2500000000"}, {"address": "quasar185fflsvwrz0cx46w6qada7mdy92m6kx4xruj7p", "amount": "2500000000"}]}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx wasm execute $ADDR1 '{"admin": {"add_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "2500000000"}, {"address": "quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu", "amount": "2500000000"}, {"address": "quasar1zaavvzxez0elundtn32qnk9lkm8kmcszvnk6zf", "amount": "2500000000"}, {"address": "quasar185fflsvwrz0cx46w6qada7mdy92m6kx4xruj7p", "amount": "2500000000"}]}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded q wasm contract-state smart $ADDR1 '{"contract_state_query":{}}' +quasard q wasm contract-state smart $ADDR1 '{"contract_state_query":{}}' echo "Set alice amount to a higher amount so that it overflows and it should fail" -quasarnoded tx wasm execute $ADDR1 '{"admin": {"set_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "4500000000"}]}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx wasm execute $ADDR1 '{"admin": {"set_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "4500000000"}]}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block echo "Update set new users to update airdrop amount for alice and bob and it should work" -quasarnoded tx wasm execute $ADDR1 '{"admin": {"set_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "1500000000"}, {"address": "quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu", "amount": "3500000000"}]}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx wasm execute $ADDR1 '{"admin": {"set_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "1500000000"}, {"address": "quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu", "amount": "3500000000"}]}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded q wasm contract-state smart $ADDR1 '{"contract_state_query":{}}' +quasard q wasm contract-state smart $ADDR1 '{"contract_state_query":{}}' echo "Remove alice from the airdrop eligibility" -quasarnoded tx wasm execute $ADDR1 '{"admin": {"remove_users":["quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"]}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx wasm execute $ADDR1 '{"admin": {"remove_users":["quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"]}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded q wasm contract-state smart $ADDR1 '{"contract_state_query":{}}' +quasard q wasm contract-state smart $ADDR1 '{"contract_state_query":{}}' echo "Add alcie to the airdrop eligibility" -quasarnoded tx wasm execute $ADDR1 '{"admin": {"add_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "1500000000"}]}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx wasm execute $ADDR1 '{"admin": {"add_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "1500000000"}]}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block echo "funding contract account" -quasarnoded tx bank send $ACCOUNT_ADDRESS $ADDR1 11000000000uqsr --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx bank send $ACCOUNT_ADDRESS $ADDR1 11000000000uqsr --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded q bank balances $ADDR1 +quasard q bank balances $ADDR1 AIRDROP_START_HEIGHT=15 AIRDROP_END_HEIGHT=25 echo "starting airdrop (but it will start form the given height in future)" -quasarnoded tx wasm execute $ADDR1 '{ "admin" :{"update_airdrop_config": {"airdrop_amount": "11000000000","airdrop_asset": {"native": "uqsr"},"airdrop_title":"Test Title","airdrop_description": "Test description","end_height": '$AIRDROP_END_HEIGHT',"start_height": '$AIRDROP_START_HEIGHT',"total_claimed": "0"}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx wasm execute $ADDR1 '{ "admin" :{"update_airdrop_config": {"airdrop_amount": "11000000000","airdrop_asset": {"native": "uqsr"},"airdrop_title":"Test Title","airdrop_description": "Test description","end_height": '$AIRDROP_END_HEIGHT',"start_height": '$AIRDROP_START_HEIGHT',"total_claimed": "0"}}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded q wasm contract-state smart $ADDR1 '{"contract_state_query":{}}' +quasard q wasm contract-state smart $ADDR1 '{"contract_state_query":{}}' echo ">>> Waiting for the block height to reach $AIRDROP_START_HEIGHT" while true; do - CURRENT_HEIGHT=$(quasarnoded status | jq -r '.SyncInfo.latest_block_height') + CURRENT_HEIGHT=$(quasard status | jq -r '.SyncInfo.latest_block_height') echo "Current height: "$CURRENT_HEIGHT if [ "$CURRENT_HEIGHT" -ge "$AIRDROP_START_HEIGHT" ]; then break @@ -65,19 +65,19 @@ while true; do sleep 5 done -quasarnoded query wasm contract-state smart $ADDR1 '{"airdrop_config_query":{}}' -quasarnoded tx wasm execute $ADDR1 '{"claim_airdrop":[]}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded tx wasm execute $ADDR1 '{"claim_airdrop":[]}' --from bob --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard query wasm contract-state smart $ADDR1 '{"airdrop_config_query":{}}' +quasard tx wasm execute $ADDR1 '{"claim_airdrop":[]}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx wasm execute $ADDR1 '{"claim_airdrop":[]}' --from bob --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded query wasm contract-state smart $ADDR1 '{"airdrop_config_query":{}}' -quasarnoded tx wasm execute $ADDR1 '{"claim_airdrop":[]}' --from user1 --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded tx wasm execute $ADDR1 '{"claim_airdrop":[]}' --from user2 --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard query wasm contract-state smart $ADDR1 '{"airdrop_config_query":{}}' +quasard tx wasm execute $ADDR1 '{"claim_airdrop":[]}' --from user1 --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard tx wasm execute $ADDR1 '{"claim_airdrop":[]}' --from user2 --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded query wasm contract-state smart quasar14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sy9numu '{"contract_state_query":{}}' +quasard query wasm contract-state smart quasar14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sy9numu '{"contract_state_query":{}}' echo ">>> Waiting for the block height to reach $AIRDROP_END_HEIGHT" while true; do - CURRENT_HEIGHT=$(quasarnoded status | jq -r '.SyncInfo.latest_block_height') + CURRENT_HEIGHT=$(quasard status | jq -r '.SyncInfo.latest_block_height') echo "Current height: "$CURRENT_HEIGHT if [ "$CURRENT_HEIGHT" -ge "$AIRDROP_END_HEIGHT" ]; then break @@ -85,6 +85,6 @@ while true; do sleep 5 done -quasarnoded q bank balances $ADDR1 -quasarnoded tx wasm execute $ADDR1 '{"admin": {"withdraw_funds":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block -quasarnoded q bank balances $ADDR1 \ No newline at end of file +quasard q bank balances $ADDR1 +quasard tx wasm execute $ADDR1 '{"admin": {"withdraw_funds":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block +quasard q bank balances $ADDR1 \ No newline at end of file diff --git a/demos/airdrop/quasar_localnet.sh b/demos/airdrop/quasar_localnet.sh index 5362d5154..ee13ef183 100755 --- a/demos/airdrop/quasar_localnet.sh +++ b/demos/airdrop/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/authz-demo/authz_gov_demo.sh b/demos/authz-demo/authz_gov_demo.sh index 6ad795778..346c9e4ce 100755 --- a/demos/authz-demo/authz_gov_demo.sh +++ b/demos/authz-demo/authz_gov_demo.sh @@ -1,6 +1,6 @@ #!/bin/sh set -o xtrace -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar NODE="--node tcp://localhost:26659" diff --git a/demos/authz-demo/quasar_localnet.sh b/demos/authz-demo/quasar_localnet.sh index 8054f95e8..5763ae404 100755 --- a/demos/authz-demo/quasar_localnet.sh +++ b/demos/authz-demo/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar diff --git a/demos/authz-demo/run_authz_gov_demo.sh b/demos/authz-demo/run_authz_gov_demo.sh index 6c7b0160a..474d6aa7a 100755 --- a/demos/authz-demo/run_authz_gov_demo.sh +++ b/demos/authz-demo/run_authz_gov_demo.sh @@ -1,5 +1,5 @@ #!/bin/sh -pkill quasarnoded +pkill quasard ./quasar_localnet.sh diff --git a/demos/burn_contract/burn.sh b/demos/burn_contract/burn.sh index c862d9447..19e2c4252 100644 --- a/demos/burn_contract/burn.sh +++ b/demos/burn_contract/burn.sh @@ -1,6 +1,6 @@ #!/bin/sh -BINARY=quasarnoded +BINARY=quasard CHAIN_ID="quasar" ACCOUNT_NAME="alice" ACCOUNT_ADDRESS="quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" @@ -20,13 +20,13 @@ OUT1=$($BINARY tx wasm instantiate $CODE_ID "{}" --from $ACCOUNT_NAME --keyring- ADDR1=$($BINARY query wasm list-contract-by-code $CODE_ID --output json | jq -r '.contracts[0]') echo "Got address of burn coin contract = $ADDR1" -quasarnoded q bank total +quasard q bank total echo "Should not fail" -quasarnoded tx wasm execute $ADDR1 '{"burn":{}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block --amount 90000000000000000uqsr,200000000stake,20000token +quasard tx wasm execute $ADDR1 '{"burn":{}}' --from $ACCOUNT_NAME --keyring-backend test -y --output json --chain-id $CHAIN_ID --fees 10000uqsr --gas 7000000 -b block --amount 90000000000000000uqsr,200000000stake,20000token -quasarnoded q wasm contract-state smart $ADDR1 '{"total_burnt_query":{}}' +quasard q wasm contract-state smart $ADDR1 '{"total_burnt_query":{}}' -quasarnoded q bank total +quasard q bank total diff --git a/demos/burn_contract/quasar_localnet.sh b/demos/burn_contract/quasar_localnet.sh index 5362d5154..ee13ef183 100755 --- a/demos/burn_contract/quasar_localnet.sh +++ b/demos/burn_contract/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/gas-demo/demo.md b/demos/gas-demo/demo.md index 13e606d91..71a88fb1c 100644 --- a/demos/gas-demo/demo.md +++ b/demos/gas-demo/demo.md @@ -9,14 +9,14 @@ I did a simple experiment to try with gas estimation and payment with other deno ## Estimate the gas using dry run ` -quasarnoded tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10uqsr --home ~/.quasarnode --chain-id quasar --keyring-backend test --gas-prices 0.01stake --gas-adjustment 1 --dry-run +quasard tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10uqsr --home ~/.quasarnode --chain-id quasar --keyring-backend test --gas-prices 0.01stake --gas-adjustment 1 --dry-run ` gas estimate: 68607 ## With Expected gas fee around 200, --gas-prices 0.001stake --gas-adjustment 1 ` -quasarnoded tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10uqsr --home ~/.quasarnode --chain-id quasar --keyring-backend test --gas-prices 0.001stake --gas-adjustment 1 +quasard tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10uqsr --home ~/.quasarnode --chain-id quasar --keyring-backend test --gas-prices 0.001stake --gas-adjustment 1 ` - - Actual Gas was - 66983 @@ -26,12 +26,12 @@ quasarnoded tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar182 ## Expected gas fee 2000, --gas-prices 0.01stake --gas-adjustment 1 ` -quasarnoded tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10uqsr --home ~/.quasarnode --chain-id quasar --keyring-backend test --gas-prices 0.01stake --gas-adjustment 1 --dry-run +quasard tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10uqsr --home ~/.quasarnode --chain-id quasar --keyring-backend test --gas-prices 0.01stake --gas-adjustment 1 --dry-run gas estimate: 68607 ` ` -quasarnoded tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10uqsr --home ~/.quasarnode --chain-id quasar --keyring-backend test --gas-prices 0.01stake --gas-adjustment 1 +quasard tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10uqsr --home ~/.quasarnode --chain-id quasar --keyring-backend test --gas-prices 0.01stake --gas-adjustment 1 ` - Actual Gas was - 66983 @@ -41,7 +41,7 @@ quasarnoded tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar182 ### Determine the expected fee without providing any fee details ; the output will tell you the amount of fees required ` -quasarnoded tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu 10uqsr --node tcp://localhost:26659 --from alice --home ~/.quasarnode --chain-id quasar --keyring-backend test +quasard tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu 10uqsr --node tcp://localhost:26659 --from alice --home ~/.quasarnode --chain-id quasar --keyring-backend test ` -output ` @@ -65,5 +65,5 @@ txhash: 37759D295A02620E72ED356E0A8F5090140CBD73843F02C886A4731FE9807844 ### Do the same tx using -fees flag ;this time the tx will pass through ` -quasarnoded tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu 10uqsr --node tcp://localhost:26659 --from alice --home ~/.quasarnode --chain-id quasar --keyring-backend test --fees 200stake +quasard tx bank send quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu 10uqsr --node tcp://localhost:26659 --from alice --home ~/.quasarnode --chain-id quasar --keyring-backend test --fees 200stake ` diff --git a/demos/gas-demo/quasar_localnet.sh b/demos/gas-demo/quasar_localnet.sh index 28319eb52..c536759e4 100755 --- a/demos/gas-demo/quasar_localnet.sh +++ b/demos/gas-demo/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/gov-add-price-mapping/README.md b/demos/gov-add-price-mapping/README.md index 4d8bd8461..99555f642 100644 --- a/demos/gov-add-price-mapping/README.md +++ b/demos/gov-add-price-mapping/README.md @@ -9,26 +9,26 @@ ignite chain serve -c demos/gov-add-price-mapping/config.yml --home run/quasar/h ` 4. Submit proposal ` -quasarnoded tx gov submit-proposal param-change demos/gov-add-price-mapping/proposal.json --node tcp://localhost:26659 --from alice --home run/quasar/home --chain-id quasar --output json | jq +quasard tx gov submit-proposal param-change demos/gov-add-price-mapping/proposal.json --node tcp://localhost:26659 --from alice --home run/quasar/home --chain-id quasar --output json | jq ` 5. Query the proposal state. ` -quasarnoded q gov proposals --node tcp://localhost:26659 --chain-id quasar --output json | jq +quasard q gov proposals --node tcp://localhost:26659 --chain-id quasar --output json | jq ` 6. Query the qoracle params and notice value ` -quasarnoded q qoracle params --node tcp://localhost:26659 --chain-id quasar --output json | jq +quasard q qoracle params --node tcp://localhost:26659 --chain-id quasar --output json | jq ` 7. Vote ` -quasarnoded tx gov vote 1 yes --node tcp://localhost:26659 --chain-id quasar --from alice --home run/quasar/home --chain-id quasar --output json | jq +quasard tx gov vote 1 yes --node tcp://localhost:26659 --chain-id quasar --from alice --home run/quasar/home --chain-id quasar --output json | jq ` 8. Query the qoracle params again after 5 minutes of configured voting period. ` -quasarnoded q qoracle params --node tcp://localhost:26659 --chain-id quasar --output json | jq +quasard q qoracle params --node tcp://localhost:26659 --chain-id quasar --output json | jq ` \ No newline at end of file diff --git a/demos/ibc-transfer-test/README.md b/demos/ibc-transfer-test/README.md index 2b4734981..e0f96b14a 100644 --- a/demos/ibc-transfer-test/README.md +++ b/demos/ibc-transfer-test/README.md @@ -23,15 +23,15 @@ Build the ibc-transfer-test contract using your favorite build strategy: `cd contracts/ibc-transfer && RUSTFLAGS='-C link-arg=-s' cargo wasm && cd -` ### Store -`quasarnoded tx wasm store ./target/wasm32-unknown-unknown/release/ibc_transfer.wasm --from alice --gas auto --chain-id quasar` +`quasard tx wasm store ./target/wasm32-unknown-unknown/release/ibc_transfer.wasm --from alice --gas auto --chain-id quasar` ### Instantiate -`quasarnoded tx wasm instantiate 1 "{}" --from alice --label "my first contract" --gas-prices 10uqsr --gas auto --gas-adjustment 1.3 -b block -y --no-admin --chain-id quasar` +`quasard tx wasm instantiate 1 "{}" --from alice --label "my first contract" --gas-prices 10uqsr --gas auto --gas-adjustment 1.3 -b block -y --no-admin --chain-id quasar` Make sure to replace code ID with the correct one above ### Query -`quasarnoded query wasm contract-state smart REPLACE_ME_WITH_INSTANTIATED_CONTRACT_ADDR '{"state":{}}'` +`quasard query wasm contract-state smart REPLACE_ME_WITH_INSTANTIATED_CONTRACT_ADDR '{"state":{}}'` This will return ``` @@ -40,12 +40,12 @@ data: ``` ### Execute -`quasarnoded tx wasm execute REPLACE_ME_WITH_INSTANTIATED_CONTRACT_ADDR '{"transfer":{"channel":"channel-0","to_address":"osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq"}}' --from alice --amount 10uqsr --chain-id quasar` +`quasard tx wasm execute REPLACE_ME_WITH_INSTANTIATED_CONTRACT_ADDR '{"transfer":{"channel":"channel-0","to_address":"osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq"}}' --from alice --amount 10uqsr --chain-id quasar` Wait approx 16 seconds ### Query again -`quasarnoded query wasm contract-state smart REPLACE_ME_WITH_INSTANTIATED_CONTRACT_ADDR '{"state":{}}'` +`quasard query wasm contract-state smart REPLACE_ME_WITH_INSTANTIATED_CONTRACT_ADDR '{"state":{}}'` If everything worked, this will return ``` diff --git a/demos/ibc-transfer-test/quasar_localnet.sh b/demos/ibc-transfer-test/quasar_localnet.sh index 22b2d46af..f9ac92cda 100755 --- a/demos/ibc-transfer-test/quasar_localnet.sh +++ b/demos/ibc-transfer-test/quasar_localnet.sh @@ -5,7 +5,7 @@ # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/ica-smart-contract/README.md b/demos/ica-smart-contract/README.md index 6b1ccd4cf..be612bb86 100644 --- a/demos/ica-smart-contract/README.md +++ b/demos/ica-smart-contract/README.md @@ -5,4 +5,4 @@ This demo shows how to set and run the ica smart contract. Currently, this is no Running commands from the ica-smart-contract demo. First, run `./run_all` to setup a quasar and osmosis chain and start the relayer to relay messages between them. Once you see "starting relaying", in a separate terminal, run `./create_and_execute_contract`. This builts the smart contract, deploys it and sends a message over the channel to osmosis. ## Seeing the results -open the log `logs/quasar_osmosis.log`, there should be a transaction in there, check the RecvPacket by querying the hash on Osmosis, like: `osmosisd query tx 7D0AE9B63472766EEC0FEDDA66BABE94C96C1657674DC2C1ABF5F55AF1279A33 --node http://127.0.0.1:26679`, checking the ack on quasar: `quasarnoded query tx CEA4814A9B8578ED82B0CFE7072A2E120C4E5C3E2EA95E7B9CAA0332A2B9F062` \ No newline at end of file +open the log `logs/quasar_osmosis.log`, there should be a transaction in there, check the RecvPacket by querying the hash on Osmosis, like: `osmosisd query tx 7D0AE9B63472766EEC0FEDDA66BABE94C96C1657674DC2C1ABF5F55AF1279A33 --node http://127.0.0.1:26679`, checking the ack on quasar: `quasard query tx CEA4814A9B8578ED82B0CFE7072A2E120C4E5C3E2EA95E7B9CAA0332A2B9F062` \ No newline at end of file diff --git a/demos/ica-smart-contract/create_and_execute_contract.sh b/demos/ica-smart-contract/create_and_execute_contract.sh index f651699f3..a4e257bfa 100755 --- a/demos/ica-smart-contract/create_and_execute_contract.sh +++ b/demos/ica-smart-contract/create_and_execute_contract.sh @@ -17,14 +17,14 @@ cd ../../smart-contracts docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/rust-optimizer:0.12.6 echo "Running store code" -RES=$(quasarnoded tx wasm store artifacts/ica.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/ica.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -OUT=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) -ADDR=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $CODE_ID "$INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) +ADDR=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR" echo "setting up channel" @@ -35,6 +35,6 @@ SENDER=$(rly q channels quasar | jq -s --arg ADDR $ADDR '.[] | select(.port_id= MSG='{"join_pool":{"channel": '$CHANNEL', "sender": '$SENDER', "pool_id": "1", "share_out_amount": "1", "token_in_maxs":[{"denom": "uosmo", "amount": "1"}]}}' # echo "Executing register ica message... ('$MSG')" -quasarnoded tx wasm execute $ADDR "$MSG" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +quasard tx wasm execute $ADDR "$MSG" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID cd - diff --git a/demos/ica-smart-contract/quasar_localnet.sh b/demos/ica-smart-contract/quasar_localnet.sh index 892256bbc..5cc8f4d6f 100755 --- a/demos/ica-smart-contract/quasar_localnet.sh +++ b/demos/ica-smart-contract/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/icq-smart-contract/README.md b/demos/icq-smart-contract/README.md index dda12a765..5c2cffc94 100644 --- a/demos/icq-smart-contract/README.md +++ b/demos/icq-smart-contract/README.md @@ -4,7 +4,7 @@ This demo runs 2 local chains, Quasar and Osmosis, and sets up an ibc connection between them using the `run_all.sh` script. Using the demo, we then compile the icq demo smart contract, deploy the contract, create the necessary IBC channel and send a query over icq using our contract. ## Requirements -In order to run this demo, a local `quasarnoded` and a local `osmosisd` binary need to be present. The local `quasarnoded` only needs to have wasm intergrated, and thus can be built from main or any recent branch. The `osmosisd` binary needs to have icq with the correct packet format integrated. A working version can be built from our osmosis branch found [here](https://github.com/quasar-finance/osmosis/tree/feature/new_icq_packet_format) and should be built with `make install`. +In order to run this demo, a local `quasard` and a local `osmosisd` binary need to be present. The local `quasard` only needs to have wasm intergrated, and thus can be built from main or any recent branch. The `osmosisd` binary needs to have icq with the correct packet format integrated. A working version can be built from our osmosis branch found [here](https://github.com/quasar-finance/osmosis/tree/feature/new_icq_packet_format) and should be built with `make install`. ## Instructions Assuming you're in the icq-smart-contract directory, diff --git a/demos/icq-smart-contract/create_and_execute_contract.sh b/demos/icq-smart-contract/create_and_execute_contract.sh index d0cb3e6d9..2d09631c9 100755 --- a/demos/icq-smart-contract/create_and_execute_contract.sh +++ b/demos/icq-smart-contract/create_and_execute_contract.sh @@ -15,14 +15,14 @@ cd ../../smart-contracts docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/rust-optimizer:0.12.6 echo "Running store code" -RES=$(quasarnoded tx wasm store artifacts/icq.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/icq.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -OUT=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) -ADDR=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $CODE_ID "$INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) +ADDR=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR" # since we should only have the transfer port open in this test setup, the query channel should be one @@ -33,6 +33,6 @@ MSG="{\"query_all_balance\":{\"channel\":$CHANNEL, \"address\":\"osmo194580p9pyx echo "sending test message" -quasarnoded tx wasm execute "$ADDR" "$MSG" --from alice $TXFLAG -echo "executed tx, to replay call \"quasarnoded tx wasm execute "$ADDR" '"$MSG"' --from alice $TXFLAG\"" +quasard tx wasm execute "$ADDR" "$MSG" --from alice $TXFLAG +echo "executed tx, to replay call \"quasard tx wasm execute "$ADDR" '"$MSG"' --from alice $TXFLAG\"" cd - \ No newline at end of file diff --git a/demos/icq-smart-contract/quasar_localnet.sh b/demos/icq-smart-contract/quasar_localnet.sh index a7cabe477..5478be98b 100755 --- a/demos/icq-smart-contract/quasar_localnet.sh +++ b/demos/icq-smart-contract/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/icq-smart-contract/run_hermes.sh b/demos/icq-smart-contract/run_hermes.sh index 236d7e786..d5c97c300 100755 --- a/demos/icq-smart-contract/run_hermes.sh +++ b/demos/icq-smart-contract/run_hermes.sh @@ -13,7 +13,7 @@ hermes keys add --chain osmosis --mnemonic-file keys/osmo.key # hermes keys restore --mnemonic "machine danger crush duck always will liberty popular security shoulder bargain day repair focus fog evoke market gossip love curious question kingdom armor crazy" --hd-path "m/44'/494'/0'/0/0" band-laozi-testnet5 ## Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 # bandd q bank balances band1cjx30d7n4k4pedgqkeqztz90q2l465gqrcymgf --node https://rpc.laozi-testnet5.bandchain.org:443 diff --git a/demos/local-integrated-setup/hermes/run_hermes_v0_nobandchain.sh b/demos/local-integrated-setup/hermes/run_hermes_v0_nobandchain.sh index dbb83f372..122843270 100755 --- a/demos/local-integrated-setup/hermes/run_hermes_v0_nobandchain.sh +++ b/demos/local-integrated-setup/hermes/run_hermes_v0_nobandchain.sh @@ -42,7 +42,7 @@ hermes keys restore --mnemonic "ready hundred phrase theme bar breeze zone syste hermes keys restore --mnemonic "rabbit garlic monitor wish pony magic budget someone room torch celery empower word assume digital rack electric weapon urban foot sketch jelly wet myself" osmosis ## Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 diff --git a/demos/local-integrated-setup/hermes/run_hermes_v0_withbandchain.sh b/demos/local-integrated-setup/hermes/run_hermes_v0_withbandchain.sh index 94205138b..916182c5e 100755 --- a/demos/local-integrated-setup/hermes/run_hermes_v0_withbandchain.sh +++ b/demos/local-integrated-setup/hermes/run_hermes_v0_withbandchain.sh @@ -49,7 +49,7 @@ hermes keys restore --mnemonic "$osmosis_seeds" osmosis hermes keys restore --mnemonic "$band_seeds" --hd-path "m/44'/494'/0'/0/0" band-laozi-testnet5 ## Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 bandd q bank balances band1cjx30d7n4k4pedgqkeqztz90q2l465gqrcymgf --node https://rpc.laozi-testnet5.bandchain.org:443 diff --git a/demos/local-integrated-setup/hermes/run_hermes_v1_nobandchain.sh b/demos/local-integrated-setup/hermes/run_hermes_v1_nobandchain.sh index fa58e6b68..f07b955b2 100755 --- a/demos/local-integrated-setup/hermes/run_hermes_v1_nobandchain.sh +++ b/demos/local-integrated-setup/hermes/run_hermes_v1_nobandchain.sh @@ -44,7 +44,7 @@ hermes keys add --chain osmosis --mnemonic-file osmosis.seeds hermes keys add --chain cosmos --mnemonic-file cosmos.seeds ## Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 diff --git a/demos/local-integrated-setup/hermes/run_hermes_v1_withbandchain.sh b/demos/local-integrated-setup/hermes/run_hermes_v1_withbandchain.sh index f8edb4c84..7c9673871 100755 --- a/demos/local-integrated-setup/hermes/run_hermes_v1_withbandchain.sh +++ b/demos/local-integrated-setup/hermes/run_hermes_v1_withbandchain.sh @@ -49,7 +49,7 @@ BANDCHAIN="band-laozi-testnet5" hermes keys add --chain band-laozi-testnet5 --mnemonic-file band.seeds --hd-path "m/44'/494'/0'/0/0" ## Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 bandd q bank balances band1cjx30d7n4k4pedgqkeqztz90q2l465gqrcymgf --node https://rpc.laozi-testnet5.bandchain.org:443 diff --git a/demos/local-integrated-setup/ibc_channel_status.sh b/demos/local-integrated-setup/ibc_channel_status.sh index 55709b09c..8a6a26e9e 100755 --- a/demos/local-integrated-setup/ibc_channel_status.sh +++ b/demos/local-integrated-setup/ibc_channel_status.sh @@ -2,13 +2,13 @@ #set -o xtrace : ' # Samples -num_channels=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels | length"` -state=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].state" | tr -d '"'` -port_id=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].port_id" | tr -d '"'` -channel_id=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].channel_id" | tr -d '"'` -cp_port_id=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].counterparty.port_id" | tr -d '"'` -cp_channel_id=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].counterparty.channel_id" | tr -d '"'` -cp_chain_id=`quasarnoded q ibc channel client-state transfer channel-0 --node tcp://localhost:26659 -o json | jq ".client_state.chain_id" | tr -d '"'` +num_channels=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels | length"` +state=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].state" | tr -d '"'` +port_id=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].port_id" | tr -d '"'` +channel_id=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].channel_id" | tr -d '"'` +cp_port_id=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].counterparty.port_id" | tr -d '"'` +cp_channel_id=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].counterparty.channel_id" | tr -d '"'` +cp_chain_id=`quasard q ibc channel client-state transfer channel-0 --node tcp://localhost:26659 -o json | jq ".client_state.chain_id" | tr -d '"'` echo $num_channels echo "state | port_id | channel_id | cp_port_id | cp_channel_id " @@ -25,8 +25,8 @@ fi binary_name="" grpc_port="" -declare -a binary_arr=("quasarnoded" "osmosisd" "gaiad") -#declare -a binary_arr=("quasarnoded") +declare -a binary_arr=("quasard" "osmosisd" "gaiad") +#declare -a binary_arr=("quasard") for b in "${binary_arr[@]}" do @@ -34,7 +34,7 @@ do echo " " echo "### $binary_name ############################" case "$binary_name" in - "quasarnoded") grpc_port="26659" + "quasard") grpc_port="26659" ;; "osmosisd") grpc_port="26679" ;; @@ -46,7 +46,7 @@ do echo "grpc_port=$grpc_port" # Get the list of channel info under a connection-id - # quasarnoded q ibc channel connections connection-1 --node tcp://localhost:26659 -o json | jq + # quasard q ibc channel connections connection-1 --node tcp://localhost:26659 -o json | jq # Get the number of channel under a connection-id #num=`$binary_name q ibc channel connections connection-1 --node tcp://localhost:$grpc_port -o json | jq ".channels | length"` declare -a conn_arr=("connection-0" "connection-1") diff --git a/demos/local-integrated-setup/ibc_channel_status_with_bandchain.sh b/demos/local-integrated-setup/ibc_channel_status_with_bandchain.sh index e6c1bce07..9f0e0ab1d 100755 --- a/demos/local-integrated-setup/ibc_channel_status_with_bandchain.sh +++ b/demos/local-integrated-setup/ibc_channel_status_with_bandchain.sh @@ -2,13 +2,13 @@ #set -o xtrace : ' # Samples -num_channels=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels | length"` -state=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].state" | tr -d '"'` -port_id=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].port_id" | tr -d '"'` -channel_id=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].channel_id" | tr -d '"'` -cp_port_id=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].counterparty.port_id" | tr -d '"'` -cp_channel_id=`quasarnoded q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].counterparty.channel_id" | tr -d '"'` -cp_chain_id=`quasarnoded q ibc channel client-state transfer channel-0 --node tcp://localhost:26659 -o json | jq ".client_state.chain_id" | tr -d '"'` +num_channels=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels | length"` +state=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].state" | tr -d '"'` +port_id=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].port_id" | tr -d '"'` +channel_id=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].channel_id" | tr -d '"'` +cp_port_id=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].counterparty.port_id" | tr -d '"'` +cp_channel_id=`quasard q ibc channel channels --node tcp://localhost:26659 -o json | jq ".channels[0].counterparty.channel_id" | tr -d '"'` +cp_chain_id=`quasard q ibc channel client-state transfer channel-0 --node tcp://localhost:26659 -o json | jq ".client_state.chain_id" | tr -d '"'` echo $num_channels echo "state | port_id | channel_id | cp_port_id | cp_channel_id " @@ -25,8 +25,8 @@ fi binary_name="" grpc_port="" -declare -a binary_arr=("quasarnoded" "osmosisd" "gaiad") -#declare -a binary_arr=("quasarnoded") +declare -a binary_arr=("quasard" "osmosisd" "gaiad") +#declare -a binary_arr=("quasard") for b in "${binary_arr[@]}" do @@ -34,7 +34,7 @@ do echo " " echo "### $binary_name ############################" case "$binary_name" in - "quasarnoded") grpc_port="26659" + "quasard") grpc_port="26659" ;; "osmosisd") grpc_port="26679" ;; @@ -46,13 +46,13 @@ do echo "grpc_port=$grpc_port" # Get the list of channel info under a connection-id - # quasarnoded q ibc channel connections connection-1 --node tcp://localhost:26659 -o json | jq + # quasard q ibc channel connections connection-1 --node tcp://localhost:26659 -o json | jq # Get the number of channel under a connection-id #num=`$binary_name q ibc channel connections connection-1 --node tcp://localhost:$grpc_port -o json | jq ".channels | length"` declare -a conn_arr=("connection-0" "connection-1" "connection-2") for conn in "${conn_arr[@]}" do - if [[ "$conn" == "connection-2" && "$binary_name" != "quasarnoded" ]] + if [[ "$conn" == "connection-2" && "$binary_name" != "quasard" ]] then continue fi diff --git a/demos/local-integrated-setup/ibc_connection_status.sh b/demos/local-integrated-setup/ibc_connection_status.sh index f63181ba4..b2b3f08af 100755 --- a/demos/local-integrated-setup/ibc_connection_status.sh +++ b/demos/local-integrated-setup/ibc_connection_status.sh @@ -20,10 +20,10 @@ for i in "${conn_arr[@]}" do echo "##########################" echo "connection-id - $i" - ibc_q_client_id=`quasarnoded q ibc connection end $i --node tcp://localhost:26659 -o json | jq '.connection.client_id' | tr -d '"'` + ibc_q_client_id=`quasard q ibc connection end $i --node tcp://localhost:26659 -o json | jq '.connection.client_id' | tr -d '"'` echo "client id - $ibc_q_client_id" test_error $ibc_q_client_id - ibc_q_cp_chainid=`quasarnoded q ibc client state $ibc_q_client_id --node tcp://localhost:26659 -o json | jq ".client_state.chain_id" | tr -d '""'` + ibc_q_cp_chainid=`quasard q ibc client state $ibc_q_client_id --node tcp://localhost:26659 -o json | jq ".client_state.chain_id" | tr -d '""'` test_error $ibc_q_cp_chainid echo "cp chain id - $ibc_q_cp_chainid" done @@ -37,7 +37,7 @@ do ibc_q_client_id=`osmosisd q ibc connection end $i --node tcp://localhost:26679 -o json | jq '.connection.client_id' | tr -d '"'` test_error $ibc_q_client_id echo "client id - $ibc_q_client_id" - ibc_q_cp_chainid=`quasarnoded q ibc client state $ibc_q_client_id --node tcp://localhost:26679 -o json | jq ".client_state.chain_id" | tr -d '""'` + ibc_q_cp_chainid=`quasard q ibc client state $ibc_q_client_id --node tcp://localhost:26679 -o json | jq ".client_state.chain_id" | tr -d '""'` test_error $ibc_q_cp_chainid echo "cp chain id - $ibc_q_cp_chainid" done @@ -51,7 +51,7 @@ do ibc_q_client_id=`osmosisd q ibc connection end $i --node tcp://localhost:26669 -o json | jq '.connection.client_id' | tr -d '"'` test_error $ibc_q_client_id echo "client id - $ibc_q_client_id" - ibc_q_cp_chainid=`quasarnoded q ibc client state $ibc_q_client_id --node tcp://localhost:26669 -o json | jq ".client_state.chain_id" | tr -d '""'` + ibc_q_cp_chainid=`quasard q ibc client state $ibc_q_client_id --node tcp://localhost:26669 -o json | jq ".client_state.chain_id" | tr -d '""'` test_error $ibc_q_cp_chainid echo "cp chain id - $ibc_q_cp_chainid" done diff --git a/demos/local-integrated-setup/ibc_connection_status_with_bandchain.sh b/demos/local-integrated-setup/ibc_connection_status_with_bandchain.sh index a9fe4e063..c1e411b4f 100755 --- a/demos/local-integrated-setup/ibc_connection_status_with_bandchain.sh +++ b/demos/local-integrated-setup/ibc_connection_status_with_bandchain.sh @@ -20,10 +20,10 @@ for i in "${conn_arr[@]}" do echo "##########################" echo "connection-id - $i" - ibc_q_client_id=`quasarnoded q ibc connection end $i --node tcp://localhost:26659 -o json | jq '.connection.client_id' | tr -d '"'` + ibc_q_client_id=`quasard q ibc connection end $i --node tcp://localhost:26659 -o json | jq '.connection.client_id' | tr -d '"'` echo "client id - $ibc_q_client_id" test_error $ibc_q_client_id - ibc_q_cp_chainid=`quasarnoded q ibc client state $ibc_q_client_id --node tcp://localhost:26659 -o json | jq ".client_state.chain_id" | tr -d '""'` + ibc_q_cp_chainid=`quasard q ibc client state $ibc_q_client_id --node tcp://localhost:26659 -o json | jq ".client_state.chain_id" | tr -d '""'` test_error $ibc_q_cp_chainid echo "cp chain id - $ibc_q_cp_chainid" done @@ -38,7 +38,7 @@ do ibc_q_client_id=`osmosisd q ibc connection end $i --node tcp://localhost:26679 -o json | jq '.connection.client_id' | tr -d '"'` test_error $ibc_q_client_id echo "client id - $ibc_q_client_id" - ibc_q_cp_chainid=`quasarnoded q ibc client state $ibc_q_client_id --node tcp://localhost:26679 -o json | jq ".client_state.chain_id" | tr -d '""'` + ibc_q_cp_chainid=`quasard q ibc client state $ibc_q_client_id --node tcp://localhost:26679 -o json | jq ".client_state.chain_id" | tr -d '""'` test_error $ibc_q_cp_chainid echo "cp chain id - $ibc_q_cp_chainid" done @@ -52,7 +52,7 @@ do ibc_q_client_id=`osmosisd q ibc connection end $i --node tcp://localhost:26669 -o json | jq '.connection.client_id' | tr -d '"'` test_error $ibc_q_client_id echo "client id - $ibc_q_client_id" - ibc_q_cp_chainid=`quasarnoded q ibc client state $ibc_q_client_id --node tcp://localhost:26669 -o json | jq ".client_state.chain_id" | tr -d '""'` + ibc_q_cp_chainid=`quasard q ibc client state $ibc_q_client_id --node tcp://localhost:26669 -o json | jq ".client_state.chain_id" | tr -d '""'` test_error $ibc_q_cp_chainid echo "cp chain id - $ibc_q_cp_chainid" done diff --git a/demos/local-integrated-setup/kill_all.sh b/demos/local-integrated-setup/kill_all.sh index 7eb810ae7..dbfab68c6 100755 --- a/demos/local-integrated-setup/kill_all.sh +++ b/demos/local-integrated-setup/kill_all.sh @@ -1,13 +1,13 @@ #!/bin/sh -qpid=`ps -ef | grep quasarnoded | grep -v "grep" | awk '{ printf $2 }'` +qpid=`ps -ef | grep quasard | grep -v "grep" | awk '{ printf $2 }'` if [ -z "$qpid" ] then - echo "quasarnoded not running." + echo "quasard not running." else - echo "quasarnoded is running with process id $qpid - killing" - pkill quasarnoded + echo "quasard is running with process id $qpid - killing" + pkill quasard fi opid=`ps -ef | grep osmosisd | grep -v "grep" | awk '{ printf $2 }'` diff --git a/demos/local-integrated-setup/quasar_localnet.sh b/demos/local-integrated-setup/quasar_localnet.sh index 8b01d441f..7583d1a46 100755 --- a/demos/local-integrated-setup/quasar_localnet.sh +++ b/demos/local-integrated-setup/quasar_localnet.sh @@ -5,7 +5,7 @@ # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/local-integrated-setup/run_all_chains_with_gentx.sh b/demos/local-integrated-setup/run_all_chains_with_gentx.sh index cbc437f3a..48a166e69 100755 --- a/demos/local-integrated-setup/run_all_chains_with_gentx.sh +++ b/demos/local-integrated-setup/run_all_chains_with_gentx.sh @@ -5,12 +5,12 @@ set -o xtrace sleep 3 -qpid=`ps -ef | grep quasarnoded | grep -v "grep" | awk '{ printf $2 }'` +qpid=`ps -ef | grep quasard | grep -v "grep" | awk '{ printf $2 }'` if [ -z "$qpid" ] then - echo "quasarnoded not running" + echo "quasard not running" else - echo "quasarnoded is running with process id $qpid" + echo "quasard is running with process id $qpid" fi opid=`ps -ef | grep osmosisd | grep -v "grep" | awk '{ printf $2 }'` diff --git a/demos/local-integrated-setup/running_status.sh b/demos/local-integrated-setup/running_status.sh index 5554ec90e..4bc5a477e 100755 --- a/demos/local-integrated-setup/running_status.sh +++ b/demos/local-integrated-setup/running_status.sh @@ -1,11 +1,11 @@ #!/bin/sh -qpid=`ps -ef | grep quasarnoded | grep -v "grep" | awk '{ printf $2 }'` +qpid=`ps -ef | grep quasard | grep -v "grep" | awk '{ printf $2 }'` if [ -z "$qpid" ] then - echo "quasarnoded not running" + echo "quasard not running" else - echo "quasarnoded is running with process id $qpid" + echo "quasard is running with process id $qpid" fi opid=`ps -ef | grep osmosisd | grep -v "grep" | awk '{ printf $2 }'` diff --git a/demos/multisig/multisig_demo.sh b/demos/multisig/multisig_demo.sh index b66ede119..a3d6e568c 100755 --- a/demos/multisig/multisig_demo.sh +++ b/demos/multisig/multisig_demo.sh @@ -1,28 +1,28 @@ #!/bin/bash echo "User 1 balances -" -quasarnoded q bank balances $(quasarnoded keys show user1 -a --keyring-backend test --home ~/.quasarnode/) --node tcp://localhost:26659 +quasard q bank balances $(quasard keys show user1 -a --keyring-backend test --home ~/.quasarnode/) --node tcp://localhost:26659 -quasarnoded tx bank send $(quasarnoded keys show alice -a --keyring-backend test --home ~/.quasarnode) $(quasarnoded keys show user1 -a --keyring-backend test --home ~/.quasarnode) 1000uqsr --chain-id quasar --node tcp://localhost:26659 --from alice --keyring-backend test --home ~/.quasarnode -quasarnoded tx bank send $(quasarnoded keys show bob -a --keyring-backend test --home ~/.quasarnode) $(quasarnoded keys show user1 -a --keyring-backend test --home ~/.quasarnode) 1000uqsr --chain-id quasar --node tcp://localhost:26659 --from bob --keyring-backend test --home ~/.quasarnode +quasard tx bank send $(quasard keys show alice -a --keyring-backend test --home ~/.quasarnode) $(quasard keys show user1 -a --keyring-backend test --home ~/.quasarnode) 1000uqsr --chain-id quasar --node tcp://localhost:26659 --from alice --keyring-backend test --home ~/.quasarnode +quasard tx bank send $(quasard keys show bob -a --keyring-backend test --home ~/.quasarnode) $(quasard keys show user1 -a --keyring-backend test --home ~/.quasarnode) 1000uqsr --chain-id quasar --node tcp://localhost:26659 --from bob --keyring-backend test --home ~/.quasarnode -alice_pub_key=$(quasarnoded keys show alice -p --keyring-backend test --home ~/.quasarnode/) -bob_pub_key=$(quasarnoded keys show bob -p --keyring-backend test --home ~/.quasarnode/) +alice_pub_key=$(quasard keys show alice -p --keyring-backend test --home ~/.quasarnode/) +bob_pub_key=$(quasard keys show bob -p --keyring-backend test --home ~/.quasarnode/) echo "alice pub key $alice_pub_key" echo "bob pub key $bob_pub_key" # The below commands is to be done in the shared machine in the real-world scenario. ## Create multi sig address in shared machine. -quasarnoded keys add alice-bob-multisig --multisig alice,bob --multisig-threshold 2 --keyring-backend test --home ~/.quasarnode +quasard keys add alice-bob-multisig --multisig alice,bob --multisig-threshold 2 --keyring-backend test --home ~/.quasarnode -multi_sig_addr=$(quasarnoded keys show alice-bob-multisig -a --keyring-backend test --home ~/.quasarnode) +multi_sig_addr=$(quasard keys show alice-bob-multisig -a --keyring-backend test --home ~/.quasarnode) echo "multi sig address - $multi_sig_addr" echo "Sending 1000uqsr to the multisig" -quasarnoded tx bank send $(quasarnoded keys show alice -a --keyring-backend test --home ~/.quasarnode) $(quasarnoded keys show alice-bob-multisig -a --keyring-backend test --home ~/.quasarnode) 1000uqsr --chain-id quasar --node tcp://localhost:26659 --from alice --keyring-backend test --home ~/.quasarnode +quasard tx bank send $(quasard keys show alice -a --keyring-backend test --home ~/.quasarnode) $(quasard keys show alice-bob-multisig -a --keyring-backend test --home ~/.quasarnode) 1000uqsr --chain-id quasar --node tcp://localhost:26659 --from alice --keyring-backend test --home ~/.quasarnode sleep 5 @@ -30,30 +30,30 @@ echo "Sending 1000uqsr from multi-sig to user 1" echo "Gen unsinged tx" ## Generate multi-sig in shared tx file. Bank tx to user1. Assuming user1 address is already in the shared machine keyring. ## user1 address is quasar1zaavvzxez0elundtn32qnk9lkm8kmcszvnk6zf -quasarnoded tx bank send $(quasarnoded keys show alice-bob-multisig -a --keyring-backend test --home ~/.quasarnode) $(quasarnoded keys show user1 -a --keyring-backend test --home ~/.quasarnode) 1000uqsr --generate-only --chain-id quasar --node tcp://localhost:26659 > tx.json +quasard tx bank send $(quasard keys show alice-bob-multisig -a --keyring-backend test --home ~/.quasarnode) $(quasard keys show user1 -a --keyring-backend test --home ~/.quasarnode) 1000uqsr --generate-only --chain-id quasar --node tcp://localhost:26659 > tx.json ## To be done in alice machine in real-world scenario echo "Sign from alice" sleep 5 -quasarnoded tx sign tx.json --multisig=$(quasarnoded keys show -a alice-bob-multisig --keyring-backend test --home ~/.quasarnode) --sign-mode amino-json --chain-id quasar --node tcp://localhost:26659 --keyring-backend test --home ~/.quasarnode --from alice > tx-signed-alice.json +quasard tx sign tx.json --multisig=$(quasard keys show -a alice-bob-multisig --keyring-backend test --home ~/.quasarnode) --sign-mode amino-json --chain-id quasar --node tcp://localhost:26659 --keyring-backend test --home ~/.quasarnode --from alice > tx-signed-alice.json echo "Sign from bob" sleep 5 ## To be done in bob machine in real-world scenario -quasarnoded tx sign tx.json --multisig=$(quasarnoded keys show -a alice-bob-multisig --keyring-backend test --home ~/.quasarnode) --sign-mode amino-json --chain-id quasar --node tcp://localhost:26659 --keyring-backend test --home ~/.quasarnode --from bob > tx-signed-bob.json +quasard tx sign tx.json --multisig=$(quasard keys show -a alice-bob-multisig --keyring-backend test --home ~/.quasarnode) --sign-mode amino-json --chain-id quasar --node tcp://localhost:26659 --keyring-backend test --home ~/.quasarnode --from bob > tx-signed-bob.json sleep 5 echo "Multi sign" # Combine signatures into single tx -quasarnoded tx multisign tx.json alice-bob-multisig tx-signed-alice.json tx-signed-bob.json --chain-id quasar --keyring-backend test --home ~/.quasarnode --from alice-bob-multisig > tx_ms.json +quasard tx multisign tx.json alice-bob-multisig tx-signed-alice.json tx-signed-bob.json --chain-id quasar --keyring-backend test --home ~/.quasarnode --from alice-bob-multisig > tx_ms.json echo "Broadcast" sleep 5 -quasarnoded tx broadcast tx_ms.json --chain-id quasar +quasard tx broadcast tx_ms.json --chain-id quasar echo "User1 balances" -quasarnoded q bank balances $(quasarnoded keys show user1 -a --keyring-backend test --home ~/.quasarnode/) --node tcp://localhost:26659 +quasard q bank balances $(quasard keys show user1 -a --keyring-backend test --home ~/.quasarnode/) --node tcp://localhost:26659 diff --git a/demos/orion-manual-demo/LP-strategy-demo.md b/demos/orion-manual-demo/LP-strategy-demo.md index 512835e75..3d33a3dbc 100644 --- a/demos/orion-manual-demo/LP-strategy-demo.md +++ b/demos/orion-manual-demo/LP-strategy-demo.md @@ -4,7 +4,7 @@ The LP strategy demo shows how to test the current version of the LP-strategy. This current version only executes the actual strategy part of the LP-strategy, meaning sending tokens to osmosis, joining a pool through join-swap extern-amount-in and locking the tokens. ## setup -To get this demo working, at the minimum a local [osmosis](https://github.com/osmosis-labs/osmosis) release >= v13 such as the [13.1.2](https://github.com/osmosis-labs/osmosis/releases/tag/v13.1.2) release, the local quasarnoded contained in this repo and the [go relayer](https://github.com/cosmos/relayer/releases/tag/v2.1.2). Optionally, if packet forwarding needs to be tested aswell, a local chain of that token is also needed. Most logical is to try this with [gaiad](https://github.com/cosmos/gaia/releases/tag/v7.1.0) for uatom. +To get this demo working, at the minimum a local [osmosis](https://github.com/osmosis-labs/osmosis) release >= v13 such as the [13.1.2](https://github.com/osmosis-labs/osmosis/releases/tag/v13.1.2) release, the local quasard contained in this repo and the [go relayer](https://github.com/cosmos/relayer/releases/tag/v2.1.2). Optionally, if packet forwarding needs to be tested aswell, a local chain of that token is also needed. Most logical is to try this with [gaiad](https://github.com/cosmos/gaia/releases/tag/v7.1.0) for uatom. ## execution the `run_all.sh` script sets up the local chains, and starts to run the go relayer. The current setup of the go relayer assumes that a local gaiad instance is running. Through `create_and_execute_contract.sh`, a contract is setup and a channel between the contract and the ica host on osmosis is made. The contract is now ready to be interacted with. diff --git a/demos/orion-manual-demo/change_quasar_param.sh b/demos/orion-manual-demo/change_quasar_param.sh index 36d4dd3b7..0c61402fd 100755 --- a/demos/orion-manual-demo/change_quasar_param.sh +++ b/demos/orion-manual-demo/change_quasar_param.sh @@ -1,6 +1,6 @@ #!/bin/bash # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar diff --git a/demos/orion-manual-demo/create_and_execute_3prim.sh b/demos/orion-manual-demo/create_and_execute_3prim.sh index 43119b757..7f64dca60 100755 --- a/demos/orion-manual-demo/create_and_execute_3prim.sh +++ b/demos/orion-manual-demo/create_and_execute_3prim.sh @@ -5,7 +5,7 @@ set -e on_error() { echo "Some error occurred" - quasarnoded q wasm contract-state smart $ADDR1 '{"trapped_errors":{}}' + quasard q wasm contract-state smart $ADDR1 '{"trapped_errors":{}}' afplay /System/Library/Sounds/Sosumi.aiff } @@ -34,24 +34,24 @@ cd ../../smart-contracts docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/workspace-optimizer-arm64:0.12.11 echo "Running store code" -RES=$(quasarnoded tx wasm store artifacts/lp_strategy-aarch64.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/lp_strategy-aarch64.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -OUT1=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT1" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -ADDR1=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT1=$(quasard tx wasm instantiate $CODE_ID "$INIT1" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +ADDR1=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR1" rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icqhost --order unordered --version icq-1 --override rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icahost --order ordered --version '{"version":"ics27-1","encoding":"proto3","tx_type":"sdk_multi_msg","controller_connection_id":"connection-0","host_connection_id":"connection-0"}' --override -# quasarnoded tx wasm execute $ADDR1 '{"bond":{"id": "my-id"}}' -y --from alice --keyring-backend test --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 $TXFLAG +# quasard tx wasm execute $ADDR1 '{"bond":{"id": "my-id"}}' -y --from alice --keyring-backend test --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 $TXFLAG # sleep 6 -OUT2=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT2" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -ADDR2=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[1]') +OUT2=$(quasard tx wasm instantiate $CODE_ID "$INIT2" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +ADDR2=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[1]') echo "Got address of deployed contract = $ADDR2" rly transact channel quasar_osmosis --src-port "wasm.$ADDR2" --dst-port icqhost --order unordered --version icq-1 --override @@ -59,8 +59,8 @@ rly transact channel quasar_osmosis --src-port "wasm.$ADDR2" --dst-port icahost # sleep 6 -OUT3=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT3" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -ADDR3=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[2]') +OUT3=$(quasard tx wasm instantiate $CODE_ID "$INIT3" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +ADDR3=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[2]') echo "Got address of deployed contract = $ADDR3" rly transact channel quasar_osmosis --src-port "wasm.$ADDR3" --dst-port icqhost --order unordered --version icq-1 --override @@ -68,12 +68,12 @@ rly transact channel quasar_osmosis --src-port "wasm.$ADDR3" --dst-port icahost # echo "primitive contracts:\n$ADDR1\n$ADDR2\n$ADDR3\n" -# BOND=$(printf 'quasarnoded tx wasm execute %s "{\"bond\":{\"id\":\"my-id\"}}" -y --from alice --keyring-backend test --gas-prices 10uqsr --gas auto --gas-adjustment 1.3 --node http://127.0.0.1:26659 --chain-id quasar --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518\n' $ADDR) +# BOND=$(printf 'quasard tx wasm execute %s "{\"bond\":{\"id\":\"my-id\"}}" -y --from alice --keyring-backend test --gas-prices 10uqsr --gas auto --gas-adjustment 1.3 --node http://127.0.0.1:26659 --chain-id quasar --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518\n' $ADDR) # echo "bonding tokens, to replay: " # echo $BOND # $BOND -RES=$(quasarnoded tx wasm store artifacts/vault_rewards-aarch64.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/vault_rewards-aarch64.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) VR_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') # VAULT_INIT='{"total_cap":"200000000000","thesis":"yurmom","vault_rewards_code_id":'$VR_CODE_ID',"reward_token":{"native":"uqsr"},"reward_distribution_schedules":[],"decimals":6,"symbol":"ORN","min_withdrawal":"1","name":"ORION","primitives":[{"address":"'$ADDR1'","weight":"0.5","init":{"l_p":'$INIT1'}}]}' @@ -83,7 +83,7 @@ VAULT_INIT='{"total_cap":"200000000000","thesis":"yurmom","vault_rewards_code_id echo $VAULT_INIT echo "Running store code (vault)" -RES=$(quasarnoded tx wasm store artifacts/basic_vault-aarch64.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/basic_vault-aarch64.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') @@ -91,56 +91,56 @@ echo "Got CODE_ID = $VAULT_CODE_ID" echo "Deploying contract (vault)" # # swallow output -OUT=$(quasarnoded tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -VAULT_ADDR=$(quasarnoded query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +VAULT_ADDR=$(quasard query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $VAULT_ADDR (vault)" echo "setting depositor" sleep 6 -quasarnoded tx wasm execute $ADDR1 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y +quasard tx wasm execute $ADDR1 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y sleep 6 -quasarnoded tx wasm execute $ADDR2 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y +quasard tx wasm execute $ADDR2 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y sleep 6 -quasarnoded tx wasm execute $ADDR3 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y +quasard tx wasm execute $ADDR3 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y echo "VAULT: $VAULT_ADDR" # echo "Seeding liquidity" -# quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from user1 --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +# quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from user1 --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 # sleep 5 ### echo "bonding multiple bonds" -### echo "Command: quasarnoded tx wasm execute $VAULT_ADDR '{\"bond\":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1" -### quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +### echo "Command: quasard tx wasm execute $VAULT_ADDR '{\"bond\":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1" +### quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 ### sleep 5 ### echo "second bond" -### quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +### quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 ### sleep 5 ### echo "third bond" -### quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +### quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 ### sleep 5 ### # echo "Sleeping for 80 seconds" ### # sleep 80 ### echo "Querying alice balance" -### quasarnoded query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json +### quasard query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json -### echo "Running unbond, command: quasarnoded tx wasm execute $VAULT_ADDR '{\"unbond\":{\"amount\":\"100\"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID" -### quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID -### echo $(quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID) +### echo "Running unbond, command: quasard tx wasm execute $VAULT_ADDR '{\"unbond\":{\"amount\":\"100\"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID" +### quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +### echo $(quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID) # echo "" # echo "Sleeping 120" # sleep 120 # echo "Running unbond again to get funds back" -# quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"0"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +# quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"0"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID # echo "Sleeping 60" # echo "Alice balances after unbond step:" -# quasarnoded query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json -# quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec +# quasard query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json +# quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec afplay /System/Library/Sounds/Funk.aiff say "I want to die" diff --git a/demos/orion-manual-demo/create_and_execute_contract.sh b/demos/orion-manual-demo/create_and_execute_contract.sh index 1508552e2..708fb83ca 100755 --- a/demos/orion-manual-demo/create_and_execute_contract.sh +++ b/demos/orion-manual-demo/create_and_execute_contract.sh @@ -26,24 +26,24 @@ cd ../../smart-contracts # docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/workspace-optimizer:0.12.11 echo "Running store code" -RES=$(quasarnoded tx wasm store artifacts/lp_strategy.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/lp_strategy.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -OUT1=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT1" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -ADDR1=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT1=$(quasard tx wasm instantiate $CODE_ID "$INIT1" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +ADDR1=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR1" rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icqhost --order unordered --version icq-1 --override rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icahost --order ordered --version '{"version":"ics27-1","encoding":"proto3","tx_type":"sdk_multi_msg","controller_connection_id":"connection-0","host_connection_id":"connection-0"}' --override -# quasarnoded tx wasm execute $ADDR1 '{"bond":{"id": "my-id"}}' -y --from alice --keyring-backend test --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 $TXFLAG +# quasard tx wasm execute $ADDR1 '{"bond":{"id": "my-id"}}' -y --from alice --keyring-backend test --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 $TXFLAG # sleep 6 -# OUT2=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT2" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -# ADDR2=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[1]') +# OUT2=$(quasard tx wasm instantiate $CODE_ID "$INIT2" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +# ADDR2=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[1]') # echo "Got address of deployed contract = $ADDR2" # rly transact channel quasar_osmosis --src-port "wasm.$ADDR2" --dst-port icqhost --order unordered --version icq-1 --override @@ -51,8 +51,8 @@ rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icahost # sleep 6 -# OUT3=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT3" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -# ADDR3=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[2]') +# OUT3=$(quasard tx wasm instantiate $CODE_ID "$INIT3" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +# ADDR3=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[2]') # echo "Got address of deployed contract = $ADDR3" # rly transact channel quasar_osmosis --src-port "wasm.$ADDR3" --dst-port icqhost --order unordered --version icq-1 --override @@ -60,12 +60,12 @@ rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icahost # echo "primitive contracts:\n$ADDR1\n$ADDR2\n$ADDR3\n" -# BOND=$(printf 'quasarnoded tx wasm execute %s "{\"bond\":{\"id\":\"my-id\"}}" -y --from alice --keyring-backend test --gas-prices 10uqsr --gas auto --gas-adjustment 1.3 --node http://127.0.0.1:26659 --chain-id quasar --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518\n' $ADDR) +# BOND=$(printf 'quasard tx wasm execute %s "{\"bond\":{\"id\":\"my-id\"}}" -y --from alice --keyring-backend test --gas-prices 10uqsr --gas auto --gas-adjustment 1.3 --node http://127.0.0.1:26659 --chain-id quasar --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518\n' $ADDR) # echo "bonding tokens, to replay: " # echo $BOND # $BOND -RES=$(quasarnoded tx wasm store artifacts/vault_rewards.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/vault_rewards.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) VR_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') VAULT_INIT='{"deposit_denom":"ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518","total_cap":"200000000000","thesis":"yurmom","vault_rewards_code_id":'$VR_CODE_ID',"reward_token":{"native":"uqsr"},"reward_distribution_schedules":[],"decimals":6,"symbol":"ORN","min_withdrawal":"1","name":"ORION","primitives":[{"address":"'$ADDR1'","weight":"0.5","init":{"l_p":'$INIT1'}}]}' @@ -74,7 +74,7 @@ VAULT_INIT='{"deposit_denom":"ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566 echo $VAULT_INIT echo "Running store code (vault)" -RES=$(quasarnoded tx wasm store artifacts/basic_vault.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/basic_vault.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') @@ -82,53 +82,53 @@ echo "Got CODE_ID = $VAULT_CODE_ID" echo "Deploying contract (vault)" # # swallow output -OUT=$(quasarnoded tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -VAULT_ADDR=$(quasarnoded query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +VAULT_ADDR=$(quasard query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $VAULT_ADDR (vault)" echo "setting depositor" sleep 6 -quasarnoded tx wasm execute $ADDR1 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y -b block +quasard tx wasm execute $ADDR1 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y -b block # sleep 6 -# quasarnoded tx wasm execute $ADDR2 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y +# quasard tx wasm execute $ADDR2 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y echo "VAULT: $VAULT_ADDR" # echo "Seeding liquidity" -# quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from user1 --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +# quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from user1 --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 # sleep 5 ### echo "bonding multiple bonds" -### echo "Command: quasarnoded tx wasm execute $VAULT_ADDR '{\"bond\":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1" -quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +### echo "Command: quasard tx wasm execute $VAULT_ADDR '{\"bond\":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1" +quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 ### sleep 5 ### echo "second bond" -### quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +### quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 ### sleep 5 ### echo "third bond" -### quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +### quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 ### sleep 5 ### # echo "Sleeping for 80 seconds" sleep 80 ### echo "Querying alice balance" -quasarnoded query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json +quasard query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json -### echo "Running unbond, command: quasarnoded tx wasm execute $VAULT_ADDR '{\"unbond\":{\"amount\":\"100\"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID" -### quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID -### echo $(quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID) +### echo "Running unbond, command: quasard tx wasm execute $VAULT_ADDR '{\"unbond\":{\"amount\":\"100\"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID" +### quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +### echo $(quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID) # echo "" # echo "Sleeping 120" # sleep 120 # echo "Running unbond again to get funds back" -quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"0"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"0"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID echo "Sleeping 60" # echo "Alice balances after unbond step:" -quasarnoded query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json -# quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec +quasard query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json +# quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec cd - diff --git a/demos/orion-manual-demo/create_and_execute_contract_manual_migrate.sh b/demos/orion-manual-demo/create_and_execute_contract_manual_migrate.sh index 51114e63c..2646e3322 100755 --- a/demos/orion-manual-demo/create_and_execute_contract_manual_migrate.sh +++ b/demos/orion-manual-demo/create_and_execute_contract_manual_migrate.sh @@ -25,24 +25,24 @@ cd ../../smart-contracts docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/workspace-optimizer:0.12.11 echo "Running store code" -RES=$(quasarnoded tx wasm store artifacts/lp_strategy.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/lp_strategy.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -OUT1=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT1" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -ADDR1=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT1=$(quasard tx wasm instantiate $CODE_ID "$INIT1" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +ADDR1=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR1" rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icqhost --order unordered --version icq-1 --override rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icahost --order ordered --version '{"version":"ics27-1","encoding":"proto3","tx_type":"sdk_multi_msg","controller_connection_id":"connection-0","host_connection_id":"connection-0"}' --override -# quasarnoded tx wasm execute $ADDR1 '{"bond":{"id": "my-id"}}' -y --from alice --keyring-backend test --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 $TXFLAG +# quasard tx wasm execute $ADDR1 '{"bond":{"id": "my-id"}}' -y --from alice --keyring-backend test --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 $TXFLAG # sleep 6 -# OUT2=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT2" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -# ADDR2=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[1]') +# OUT2=$(quasard tx wasm instantiate $CODE_ID "$INIT2" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +# ADDR2=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[1]') # echo "Got address of deployed contract = $ADDR2" # rly transact channel quasar_osmosis --src-port "wasm.$ADDR2" --dst-port icqhost --order unordered --version icq-1 --override @@ -50,8 +50,8 @@ rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icahost # sleep 6 -# OUT3=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT3" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -# ADDR3=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[2]') +# OUT3=$(quasard tx wasm instantiate $CODE_ID "$INIT3" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +# ADDR3=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[2]') # echo "Got address of deployed contract = $ADDR3" # rly transact channel quasar_osmosis --src-port "wasm.$ADDR3" --dst-port icqhost --order unordered --version icq-1 --override @@ -59,12 +59,12 @@ rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icahost # echo "primitive contracts:\n$ADDR1\n$ADDR2\n$ADDR3\n" -# BOND=$(printf 'quasarnoded tx wasm execute %s "{\"bond\":{\"id\":\"my-id\"}}" -y --from alice --keyring-backend test --gas-prices 10uqsr --gas auto --gas-adjustment 1.3 --node http://127.0.0.1:26659 --chain-id quasar --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518\n' $ADDR) +# BOND=$(printf 'quasard tx wasm execute %s "{\"bond\":{\"id\":\"my-id\"}}" -y --from alice --keyring-backend test --gas-prices 10uqsr --gas auto --gas-adjustment 1.3 --node http://127.0.0.1:26659 --chain-id quasar --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518\n' $ADDR) # echo "bonding tokens, to replay: " # echo $BOND # $BOND -RES=$(quasarnoded tx wasm store artifacts/vault_rewards.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/vault_rewards.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) VR_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') VAULT_INIT='{"total_cap":"200000000000","thesis":"yurmom","vault_rewards_code_id":'$VR_CODE_ID',"reward_token":{"native":"uqsr"},"reward_distribution_schedules":[],"decimals":6,"symbol":"ORN","min_withdrawal":"1","name":"ORION","primitives":[{"address":"'$ADDR1'","weight":"0.5","init":{"l_p":'$INIT1'}}]}' @@ -73,7 +73,7 @@ VAULT_INIT='{"total_cap":"200000000000","thesis":"yurmom","vault_rewards_code_id echo $VAULT_INIT echo "Running store code (vault)" -RES=$(quasarnoded tx wasm store artifacts/basic_vault.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/basic_vault.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') @@ -81,72 +81,72 @@ echo "Got CODE_ID = $VAULT_CODE_ID" echo "Deploying contract (vault)" # # swallow output -OUT=$(quasarnoded tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) -VAULT_ADDR=$(quasarnoded query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec $NODE --chain-id $CHAIN_ID) +VAULT_ADDR=$(quasard query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $VAULT_ADDR (vault)" echo "setting depositor" sleep 6 -quasarnoded tx wasm execute $ADDR1 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y -b block +quasard tx wasm execute $ADDR1 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y -b block # sleep 6 -# quasarnoded tx wasm execute $ADDR2 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y +# quasard tx wasm execute $ADDR2 '{"set_depositor":{"depositor":"'$VAULT_ADDR'"}}' --from alice --keyring-backend test $TXFLAG -y echo "VAULT: $VAULT_ADDR" # echo "Seeding liquidity" -# quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from user1 --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 +# quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from user1 --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 # sleep 5 echo "bonding multiple bonds" -# echo "Command: quasarnoded tx wasm execute $VAULT_ADDR '{\"bond\":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1" -quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block > ../demos/orion-manual-demo/logs/bonds.log -quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1100ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block >> ../demos/orion-manual-demo/logs/bonds.log +# echo "Command: quasard tx wasm execute $VAULT_ADDR '{\"bond\":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1" +quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block > ../demos/orion-manual-demo/logs/bonds.log +quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1100ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block >> ../demos/orion-manual-demo/logs/bonds.log # echo "third bond" -quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1200ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block >> ../demos/orion-manual-demo/logs/bonds.log -# quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from bob --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1300ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block >> ./logs/bond.log -# quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from bob --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1400ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block > ./logs/bond.log -# quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from bob --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1500ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block > ./logs/bond.log +quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1200ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block >> ../demos/orion-manual-demo/logs/bonds.log +# quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from bob --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1300ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block >> ./logs/bond.log +# quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from bob --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1400ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block > ./logs/bond.log +# quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from bob --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 1500ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 -b block > ./logs/bond.log # echo "Sleeping for 80 seconds" # sleep 80 echo "Querying alice balance" -quasarnoded query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json +quasard query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json -# echo "Running unbond, command: quasarnoded tx wasm execute $VAULT_ADDR '{\"unbond\":{\"amount\":\"100\"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID" -# quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID || true -# echo $(quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID) +# echo "Running unbond, command: quasard tx wasm execute $VAULT_ADDR '{\"unbond\":{\"amount\":\"100\"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID" +# quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID || true +# echo $(quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"100"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID) echo "Alice should not be able to unbond, since we are not relaying and leaving the bonds hanging" echo "Migrating to manually satisfy the bonds" MIGRATE1="{\"vault_addr\":\"$VAULT_ADDR\", \"callbacks\": [{\"share_amount\": \"1000\",\"bond_id\":\"1\"}]}" # satisfy 1 bond id, alice should have a 1000 shares now -echo "quasarnoded tx wasm migrate $ADDR $CODE_ID "$MIGRATE1" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID" -quasarnoded tx wasm migrate $ADDR1 $CODE_ID "$MIGRATE1" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +echo "quasard tx wasm migrate $ADDR $CODE_ID "$MIGRATE1" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID" +quasard tx wasm migrate $ADDR1 $CODE_ID "$MIGRATE1" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID echo "Querying alice balance again, expect 1000 shares" -quasarnoded query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json +quasard query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json # satisfy 2 bond id, alice should have a 3300 shares now MIGRATE2="{\"vault_addr\":\"$VAULT_ADDR\", \"callbacks\": [{\"share_amount\": \"1100\",\"bond_id\":\"2\"}, {\"share_amount\": \"1200\",\"bond_id\":\"3\"}]}" -quasarnoded tx wasm migrate $ADDR1 $CODE_ID "$MIGRATE2" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +quasard tx wasm migrate $ADDR1 $CODE_ID "$MIGRATE2" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID echo "Querying alice balance again, expect 3300 shares" -quasarnoded query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json +quasard query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json # trying to satisfy more bonds here should fail -quasarnoded tx wasm migrate $ADDR1 $CODE_ID "{\"vault_addr\":\"$VAULT_ADDR\", \"callbacks\": [{\"share_amount\": \"1100\",\"bond_id\":\"2\"}, {\"share_amount\": \"1200\",\"bond_id\":\"3\"}]}" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID || true +quasard tx wasm migrate $ADDR1 $CODE_ID "{\"vault_addr\":\"$VAULT_ADDR\", \"callbacks\": [{\"share_amount\": \"1100\",\"bond_id\":\"2\"}, {\"share_amount\": \"1200\",\"bond_id\":\"3\"}]}" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID || true # echo "Sleeping 120" # sleep 120 # echo "Running unbond again to get funds back" -# quasarnoded tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"0"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +# quasard tx wasm execute $VAULT_ADDR '{"unbond":{"amount":"0"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID # echo "Sleeping 60" # echo "Alice balances after unbond step:" -# quasarnoded query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json -# quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec +# quasard query wasm contract-state smart $VAULT_ADDR '{"balance":{"address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec"}}' --output json +# quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec cd - diff --git a/demos/orion-manual-demo/demo.md b/demos/orion-manual-demo/demo.md index 8cd7893f5..e305f8d4d 100644 --- a/demos/orion-manual-demo/demo.md +++ b/demos/orion-manual-demo/demo.md @@ -93,7 +93,7 @@ Success: Restored key 'testkey3' (osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz) o ### First pre-check relayer balances in each chain ```bash -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 ``` @@ -638,7 +638,7 @@ hermes start - Prechecks all account lists ```bash gaiad keys list --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/cosmos-hub/ - quasarnoded keys list --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/quasarnode/ + quasard keys list --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/quasarnode/ osmosisd keys list --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/osmosis/ ``` @@ -648,8 +648,8 @@ hermes start gaiad q bank balances cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu --node tcp://localhost:26669 gaiad q bank balances cosmos1twes4wv4c28r0x6dnczgda5sm36khlv7ve8m89 --node tcp://localhost:26669 -quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 -quasarnoded q bank balances quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 +quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +quasard q bank balances quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu --node tcp://localhost:26659 osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 osmosisd q bank balances osmo1ez43ye5qn3q2zwh8uvswppvducwnkq6wjqc87d --node tcp://localhost:26679 @@ -660,7 +660,7 @@ osmosisd q bank balances osmo1ez43ye5qn3q2zwh8uvswppvducwnkq6wjqc87d --node tcp: ``` gaiad q bank balances cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu --node tcp://localhost:26669 -quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 ``` - IBC transfer @@ -672,14 +672,14 @@ gaiad tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5h - Post check account balances ``` gaiad q bank balances cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu --node tcp://localhost:26669 -quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 ``` ### IBC token transfer from osmosis to quasar - Precheck balances ``` osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 -quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 ``` - IBC Transfer @@ -692,6 +692,6 @@ osmosisd tx ibc-transfer transfer transfer channel-1 quasar1sqlsc5024sszglyh7psw ``` osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 -quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 ``` \ No newline at end of file diff --git a/demos/orion-manual-demo/quasar_localnet.sh b/demos/orion-manual-demo/quasar_localnet.sh index 54b4236ce..edbd5def9 100755 --- a/demos/orion-manual-demo/quasar_localnet.sh +++ b/demos/orion-manual-demo/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/orion-manual-demo/run_all.sh b/demos/orion-manual-demo/run_all.sh index 9e8aa43fd..137e429a6 100755 --- a/demos/orion-manual-demo/run_all.sh +++ b/demos/orion-manual-demo/run_all.sh @@ -79,7 +79,7 @@ osmosisd tx ibc-transfer transfer transfer channel-0 quasar185fflsvwrz0cx46w6qad sleep 10 -quasarnoded query bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec +quasard query bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec # Check platform platform='unknown' diff --git a/demos/orion-manual-demo/run_all_manual_migrate.sh b/demos/orion-manual-demo/run_all_manual_migrate.sh index 32ac8cdec..ed42bb641 100755 --- a/demos/orion-manual-demo/run_all_manual_migrate.sh +++ b/demos/orion-manual-demo/run_all_manual_migrate.sh @@ -82,7 +82,7 @@ osmosisd tx ibc-transfer transfer transfer channel-0 quasar185fflsvwrz0cx46w6qad sleep 20 -quasarnoded query bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec +quasard query bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec echo "killing relayer to fail bonds" kill $RLY_PID_2 diff --git a/demos/orion-manual-demo/run_contract.sh b/demos/orion-manual-demo/run_contract.sh index b2936e58c..459c8d046 100644 --- a/demos/orion-manual-demo/run_contract.sh +++ b/demos/orion-manual-demo/run_contract.sh @@ -26,17 +26,17 @@ cd ../../smart-contracts docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/rust-optimizer:0.12.6 echo "Running store code" -RES=$(quasarnoded tx wasm store artifacts/intergamm_bindings_test.wasm --from alice -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/intergamm_bindings_test.wasm --from alice -y --output json -b block $TXFLAG) CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -OUT=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT" --from alice --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) -ADDR=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $CODE_ID "$INIT" --from alice --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) +ADDR=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR" echo "Executing register ica message... ('$MSG')" -quasarnoded tx wasm execute $ADDR "$MSG" --from alice --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +quasard tx wasm execute $ADDR "$MSG" --from alice --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID cd - \ No newline at end of file diff --git a/demos/orion-manual-demo/run_hermes_v1.sh b/demos/orion-manual-demo/run_hermes_v1.sh index 97de22e43..d9f8e3395 100755 --- a/demos/orion-manual-demo/run_hermes_v1.sh +++ b/demos/orion-manual-demo/run_hermes_v1.sh @@ -13,7 +13,7 @@ hermes keys add --chain osmosis --mnemonic-file keys/osmo.key # hermes keys restore --mnemonic "machine danger crush duck always will liberty popular security shoulder bargain day repair focus fog evoke market gossip love curious question kingdom armor crazy" --hd-path "m/44'/494'/0'/0/0" band-laozi-testnet5 ## Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 # bandd q bank balances band1cjx30d7n4k4pedgqkeqztz90q2l465gqrcymgf --node https://rpc.laozi-testnet5.bandchain.org:443 diff --git a/demos/orion-manual-demo/run_primitive_and_vault.sh b/demos/orion-manual-demo/run_primitive_and_vault.sh index 071b619c7..5a97b5355 100755 --- a/demos/orion-manual-demo/run_primitive_and_vault.sh +++ b/demos/orion-manual-demo/run_primitive_and_vault.sh @@ -25,22 +25,22 @@ RUSTFLAGS='-C link-arg=-s' cargo wasm cd ../.. echo "Running store code" -RES=$(quasarnoded tx wasm store target/wasm32-unknown-unknown/release/lp_strategy.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store target/wasm32-unknown-unknown/release/lp_strategy.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -OUT=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) -ADDR=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $CODE_ID "$INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) +ADDR=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR" rly transact channel quasar_osmosis --src-port "wasm.$ADDR" --dst-port icqhost --order unordered --version icq-1 --override rly transact channel quasar_osmosis --src-port "wasm.$ADDR" --dst-port icahost --order ordered --version '{"version":"ics27-1","encoding":"proto3","tx_type":"sdk_multi_msg","controller_connection_id":"connection-0","host_connection_id":"connection-0"}' --override QMSG='{"channels": {}}' -CADDR=$(quasarnoded query wasm contract-state smart $ADDR "$QMSG" --output json | jq '.data.channels[] | select(.counterparty_endpoint.port_id=="icahost").channel_type.ica.counter_party_address') -CCHAN=$(quasarnoded query wasm contract-state smart $ADDR "$QMSG" --output json | jq '.data.channels[] | select(.counterparty_endpoint.port_id=="icahost").id') +CADDR=$(quasard query wasm contract-state smart $ADDR "$QMSG" --output json | jq '.data.channels[] | select(.counterparty_endpoint.port_id=="icahost").channel_type.ica.counter_party_address') +CCHAN=$(quasard query wasm contract-state smart $ADDR "$QMSG" --output json | jq '.data.channels[] | select(.counterparty_endpoint.port_id=="icahost").id') echo $CADDR @@ -67,8 +67,8 @@ JOINMSG=$(printf '{ } }') -echo "joining pool, to replay: \"quasarnoded tx wasm execute $ADDR '$JOINMSG' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID\"" -quasarnoded tx wasm execute $ADDR "$JOINMSG" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID +echo "joining pool, to replay: \"quasard tx wasm execute $ADDR '$JOINMSG' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID\"" +quasard tx wasm execute $ADDR "$JOINMSG" -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID ## MULTI ASSET VAULT ZONE echo "Starting multi-asset vault init" @@ -81,7 +81,7 @@ RUSTFLAGS='-C link-arg=-s' cargo wasm # sleep 4 echo "Running store code (vault)" -RES=$(quasarnoded tx wasm store target/wasm32-unknown-unknown/release/basic_vault.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store target/wasm32-unknown-unknown/release/basic_vault.wasm --from alice --keyring-backend test -y --output json -b block $TXFLAG) VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') @@ -89,17 +89,17 @@ echo "Got CODE_ID = $VAULT_CODE_ID" echo "Deploying contract (vault)" # swallow output -OUT=$(quasarnoded tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) -VAULT_ADDR=$(quasarnoded query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from alice --keyring-backend test --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) +VAULT_ADDR=$(quasard query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $VAULT_ADDR (vault)" # echo "Running a primitive deposit manually to circumvent the cold start issue with primitives" -# quasarnoded tx wasm execute $ADDR '{"bond": {"id": "test"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 10ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 +# quasard tx wasm execute $ADDR '{"bond": {"id": "test"}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 10ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 # sleep 4 echo "Running deposit (vault)" -echo "Command: quasarnoded tx wasm execute $VAULT_ADDR '{\"bond\":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 100ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518" -quasarnoded tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 100ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 +echo "Command: quasard tx wasm execute $VAULT_ADDR '{\"bond\":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 100ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518" +quasard tx wasm execute $VAULT_ADDR '{"bond":{}}' -y --from alice --keyring-backend test --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --amount 100ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 cd - diff --git a/demos/orion-manual-demo/setup_pool.sh b/demos/orion-manual-demo/setup_pool.sh index 2b3e544d6..01248e07c 100755 --- a/demos/orion-manual-demo/setup_pool.sh +++ b/demos/orion-manual-demo/setup_pool.sh @@ -1,4 +1,4 @@ -OSMOICA=$(quasarnoded query intergamm interchain-account-from-address connection-2 --output json $ADDR | jq .interchain_account_address) +OSMOICA=$(quasard query intergamm interchain-account-from-address connection-2 --output json $ADDR | jq .interchain_account_address) echo "found osmosis address for ICA $OSMOICA" osmosisd tx gamm create-pool --pool-file ./sample_pool.json --node tcp://localhost:26679 --from bob --chain-id osmosis --gas 583610 diff --git a/demos/osmosis-config/quasar_localnet.sh b/demos/osmosis-config/quasar_localnet.sh index 8a04f79ce..f3916c0d9 100755 --- a/demos/osmosis-config/quasar_localnet.sh +++ b/demos/osmosis-config/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/osmosis-config/run_hermes_only_osmosis.sh b/demos/osmosis-config/run_hermes_only_osmosis.sh index 12746207f..40742a93f 100755 --- a/demos/osmosis-config/run_hermes_only_osmosis.sh +++ b/demos/osmosis-config/run_hermes_only_osmosis.sh @@ -23,7 +23,7 @@ hermes keys add --chain osmosis --mnemonic-file osmosis_key.txt # hermes keys add --chain $BANDCHAIN --mnemonic-file bandchain_key.txt --hd-path "m/44'/494'/0'/0/0" # Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 # Create connections diff --git a/demos/packet-forwarder/README.md b/demos/packet-forwarder/README.md index b06f89c0f..e1224647f 100644 --- a/demos/packet-forwarder/README.md +++ b/demos/packet-forwarder/README.md @@ -54,7 +54,7 @@ Now the 3 blockchains are able to communicate. Users' addresses are already fixed in the yaml config files file with mnemonics. ```bash -quasarnoded keys list --home run/quasar/home/ +quasard keys list --home run/quasar/home/ ``` Alice's address on quasar is: `quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec` @@ -68,7 +68,7 @@ curl http://localhost:1311/bank/balances/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77 or ```bash -quasarnoded q bank balances $(quasarnoded keys show -a alice --home run/quasar/home) --home run/quasar/home/ --node http://localhost:26659 +quasard q bank balances $(quasard keys show -a alice --home run/quasar/home) --home run/quasar/home/ --node http://localhost:26659 ``` 3. Now Bob transfers 2000 uatom from `cosmos` to `quasar` @@ -86,7 +86,7 @@ curl http://localhost:1311/bank/balances/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77 or ```bash -quasarnoded q bank balances $(quasarnoded keys show -a alice --home run/quasar/home) --home run/quasar/home/ --node http://localhost:26659 +quasard q bank balances $(quasard keys show -a alice --home run/quasar/home) --home run/quasar/home/ --node http://localhost:26659 ``` 3. Alice has the ATOM available in the form of an IBC token on `quasar`. We now transfer it to `osmosis` but doing a multi-hop transaction via `cosmos` using the packet forwarder. diff --git a/demos/packet-forwarder/demo b/demos/packet-forwarder/demo index 51abf8f8a..dc125eaf9 100755 --- a/demos/packet-forwarder/demo +++ b/demos/packet-forwarder/demo @@ -140,7 +140,7 @@ tx_bob_cosmos_to_alice_quasar() { tx_alice_quasar_to_alice_osmosis_via_cosmos() { local home_dir="${run_dir}/quasar/home" - quasarnoded \ + quasard \ --home "$home_dir" \ --node=http://localhost:26659 \ --chain-id quasar \ @@ -171,6 +171,6 @@ test -d "${project_dir}/../contrib/osmosis" || fail "osmosis dir not found" cmd_exists "gaiad" cmd_exists "osmosisd" -cmd_exists "quasarnoded" +cmd_exists "quasard" "$@" diff --git a/demos/paramchange/demo.md b/demos/paramchange/demo.md index 3bdc4ec7a..694dbbf1b 100644 --- a/demos/paramchange/demo.md +++ b/demos/paramchange/demo.md @@ -9,26 +9,26 @@ ignite chain serve -c demos/paramchange/quasar.yml --home run/quasar/home --rese ` 4. Submit mind module param change proposal ` -quasarnoded tx gov submit-proposal param-change ./mint_param_change.json --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --home ~/.quasarnode --chain-id quasar --output json | jq +quasard tx gov submit-proposal param-change ./mint_param_change.json --node tcp://localhost:26659 --from quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --home ~/.quasarnode --chain-id quasar --output json | jq ` 5. Query the proposal state. ` -quasarnoded q gov proposals --node tcp://localhost:26659 --chain-id quasar --output json | jq +quasard q gov proposals --node tcp://localhost:26659 --chain-id quasar --output json | jq ` 6. Query the mint param and notice value ` -quasarnoded q mint params --node tcp://localhost:26659 --chain-id quasar --output json | jq +quasard q mint params --node tcp://localhost:26659 --chain-id quasar --output json | jq ` 7. Vote ` -quasarnoded tx gov vote 1 yes --node tcp://localhost:26659 --chain-id quasar --from alice --output json | jq +quasard tx gov vote 1 yes --node tcp://localhost:26659 --chain-id quasar --from alice --output json | jq ` 8. Query the mint param again after 5 minutes of configured voting period. ` -quasarnoded q mint params --node tcp://localhost:26659 --chain-id quasar --output json | jq +quasard q mint params --node tcp://localhost:26659 --chain-id quasar --output json | jq ` diff --git a/demos/qtransfer-demos/balance_check.sh b/demos/qtransfer-demos/balance_check.sh index c5e1525a5..cbf9beefd 100755 --- a/demos/qtransfer-demos/balance_check.sh +++ b/demos/qtransfer-demos/balance_check.sh @@ -5,6 +5,6 @@ echo "user address - $(osmosisd keys show alice -a --keyring-backend test --home osmosisd q bank balances $(osmosisd keys show alice -a --keyring-backend test --home ~/.osmosis) --node tcp://localhost:26679 -o json echo "quasar receiver balance " -echo "user address - $(quasarnoded keys show alice -a --keyring-backend test --home ~/.quasarnode)" -quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 -o json +echo "user address - $(quasard keys show alice -a --keyring-backend test --home ~/.quasarnode)" +quasard q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 -o json diff --git a/demos/qtransfer-demos/ibc_token_transfer-r.sh b/demos/qtransfer-demos/ibc_token_transfer-r.sh index d8dd95cff..094fd4a84 100755 --- a/demos/qtransfer-demos/ibc_token_transfer-r.sh +++ b/demos/qtransfer-demos/ibc_token_transfer-r.sh @@ -5,4 +5,4 @@ #osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq echo "ibc token tx with some random memo - " -quasarnoded tx ibc-transfer transfer transfer channel-0 osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq 100uqsr --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test +quasard tx ibc-transfer transfer transfer channel-0 osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq 100uqsr --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test diff --git a/demos/qtransfer-demos/quasar_localnet.sh b/demos/qtransfer-demos/quasar_localnet.sh index 4d7b43628..65359d4e0 100755 --- a/demos/qtransfer-demos/quasar_localnet.sh +++ b/demos/qtransfer-demos/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/qtransfer-demos/run_hermes.sh b/demos/qtransfer-demos/run_hermes.sh index 0527e32dd..7b7039a7b 100755 --- a/demos/qtransfer-demos/run_hermes.sh +++ b/demos/qtransfer-demos/run_hermes.sh @@ -11,7 +11,7 @@ hermes keys add --chain osmosis --mnemonic-file osmosis_key.txt # SUCCESS Restored key 'osmosiskey' (osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz) on chain osmosis # Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 # Create connections diff --git a/demos/qtransfer-demos/run_test.sh b/demos/qtransfer-demos/run_test.sh index e91e933bf..dd921012a 100755 --- a/demos/qtransfer-demos/run_test.sh +++ b/demos/qtransfer-demos/run_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -pkill quasarnoded +pkill quasard pkill osmosisd ## Run Quasar diff --git a/demos/quasar-bindings-test/deploy_and_exec_contract.sh b/demos/quasar-bindings-test/deploy_and_exec_contract.sh index a5dff2c62..e71f12ea4 100755 --- a/demos/quasar-bindings-test/deploy_and_exec_contract.sh +++ b/demos/quasar-bindings-test/deploy_and_exec_contract.sh @@ -39,7 +39,7 @@ then # Update osmo chain params echo echo "Updating osmosis chain params on quasar" - quasarnoded tx qoracle update-osmosis-chain-params --node tcp://localhost:26659 --from alice --home ~/.quasarnode --chain-id quasar --output json --keyring-backend test + quasard tx qoracle update-osmosis-chain-params --node tcp://localhost:26659 --from alice --home ~/.quasarnode --chain-id quasar --output json --keyring-backend test echo read -p "Do we have chain params? Refresh here until yes (epochs info should not be empty): http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/chain_params (Y/n)" -n 1 -r @@ -78,29 +78,29 @@ cd ../../smart-contracts RUSTFLAGS='-C link-arg=-s' cargo wasm echo "Running store code" -RES=$(quasarnoded tx wasm store target/wasm32-unknown-unknown/release/qoracle_bindings_test.wasm --from alice -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store target/wasm32-unknown-unknown/release/qoracle_bindings_test.wasm --from alice -y --output json -b block $TXFLAG) CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -OUT=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT" --from alice --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) -ADDR=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $CODE_ID "$INIT" --from alice --label "my first contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --no-admin $NODE --chain-id $CHAIN_ID) +ADDR=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR" echo "Executing message... ('$MSG1')" -quasarnoded tx wasm execute $ADDR "$MSG1" --from alice --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --log_level trace +quasard tx wasm execute $ADDR "$MSG1" --from alice --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --log_level trace sleep 5 # keep getting account sequence mismatch echo echo "Executing message... ('$MSG2')" -quasarnoded tx wasm execute $ADDR "$MSG2" --from alice --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --log_level trace +quasard tx wasm execute $ADDR "$MSG2" --from alice --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --log_level trace sleep 5 # keep getting account sequence mismatch echo echo "Executing message... ('$MSG3')" -quasarnoded tx wasm execute $ADDR "$MSG3" --from alice --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --log_level trace +quasard tx wasm execute $ADDR "$MSG3" --from alice --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 $NODE --chain-id $CHAIN_ID --log_level trace cd - \ No newline at end of file diff --git a/demos/quasar-bindings-test/quasar_localnet.sh b/demos/quasar-bindings-test/quasar_localnet.sh index 08fbd6966..f7a33a3d1 100755 --- a/demos/quasar-bindings-test/quasar_localnet.sh +++ b/demos/quasar-bindings-test/quasar_localnet.sh @@ -3,7 +3,7 @@ # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/quasar-bindings-test/run_hermes.sh b/demos/quasar-bindings-test/run_hermes.sh index eca6dd66e..9cf8a6aff 100755 --- a/demos/quasar-bindings-test/run_hermes.sh +++ b/demos/quasar-bindings-test/run_hermes.sh @@ -12,7 +12,7 @@ hermes keys add --chain osmosis --mnemonic-file osmosis_key.txt hermes keys add --chain $BANDCHAIN --mnemonic-file bandchain_key.txt --hd-path "m/44'/494'/0'/0/0" # Checking balance -quasarnoded q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 +quasard q bank balances quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew --node tcp://localhost:26659 osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 # Create connections diff --git a/demos/tokenfactory/README.md b/demos/tokenfactory/README.md index 88fe314d2..d86adfb6c 100644 --- a/demos/tokenfactory/README.md +++ b/demos/tokenfactory/README.md @@ -34,17 +34,17 @@ cd artifacts ### Upload the artifacts ```bash -TX=$(quasarnoded tx wasm store tokenfactory.wasm --from alice --chain-id=quasar --gas-prices 0.1uqsr --keyring-backend test --home ~/.quasarnode --gas auto --gas-adjustment 1.3 -b block --output json -y --node tcp://localhost:26659 | jq -r '.txhash') -CODE_ID=$(quasarnoded query tx $TX --node tcp://localhost:26659 --output json | jq -r '.logs[0].events[-1].attributes[1].value') +TX=$(quasard tx wasm store tokenfactory.wasm --from alice --chain-id=quasar --gas-prices 0.1uqsr --keyring-backend test --home ~/.quasarnode --gas auto --gas-adjustment 1.3 -b block --output json -y --node tcp://localhost:26659 | jq -r '.txhash') +CODE_ID=$(quasard query tx $TX --node tcp://localhost:26659 --output json | jq -r '.logs[0].events[-1].attributes[1].value') echo "Your contract code_id is $CODE_ID" ``` ### Instantiate the contract ```bash -quasarnoded tx wasm instantiate $CODE_ID "{}" --amount 50000uqsr --label "Token Factory Contract" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --gas-prices 0.1uqsr --gas auto --gas-adjustment 1.3 -b block -y --no-admin --node tcp://localhost:26659 +quasard tx wasm instantiate $CODE_ID "{}" --amount 50000uqsr --label "Token Factory Contract" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --gas-prices 0.1uqsr --gas auto --gas-adjustment 1.3 -b block -y --no-admin --node tcp://localhost:26659 -CONTRACT_ADDR=$(quasarnoded query wasm list-contract-by-code $CODE_ID --node tcp://localhost:26659 --output json | jq -r '.contracts[0]') +CONTRACT_ADDR=$(quasard query wasm list-contract-by-code $CODE_ID --node tcp://localhost:26659 --output json | jq -r '.contracts[0]') echo "Your contract address is $CONTRACT_ADDR" ``` @@ -62,19 +62,19 @@ cargo schema # generates schema in the contracts/tokenfactory/schema folder ```bash -quasarnoded tx wasm execute $CONTRACT_ADDR '{ "create_denom": { "subdenom": "mydenom" } }' --from alice --amount 1000000000uqsr -b block --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 +quasard tx wasm execute $CONTRACT_ADDR '{ "create_denom": { "subdenom": "mydenom" } }' --from alice --amount 1000000000uqsr -b block --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -quasarnoded q bank total --denom factory/$CONTRACT_ADDR/mydenom --node tcp://localhost:26659 +quasard q bank total --denom factory/$CONTRACT_ADDR/mydenom --node tcp://localhost:26659 # You should see this: # amount: "0" #denom: factory/osmo1wug8sewp6cedgkmrmvhl3lf3tulagm9hnvy8p0rppz9yjw0g4wtqcm3670/mydenom ``` #### mint -BOB=$(quasarnoded keys show bob --keyring-backend test -a) +BOB=$(quasard keys show bob --keyring-backend test -a) ```bash -quasarnoded tx wasm execute $CONTRACT_ADDR "{ \"mint_tokens\": {\"amount\": \"100\", \"denom\": \"factory/${CONTRACT_ADDR}/mydenom\", \"mint_to_address\": \"$BOB\"}}" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -b block -quasarnoded q bank balances $BOB --node tcp://localhost:26659 -quasarnoded q bank total --denom factory/$CONTRACT_ADDR/mydenom --node tcp://localhost:26659 +quasard tx wasm execute $CONTRACT_ADDR "{ \"mint_tokens\": {\"amount\": \"100\", \"denom\": \"factory/${CONTRACT_ADDR}/mydenom\", \"mint_to_address\": \"$BOB\"}}" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -b block +quasard q bank balances $BOB --node tcp://localhost:26659 +quasard q bank total --denom factory/$CONTRACT_ADDR/mydenom --node tcp://localhost:26659 ``` @@ -83,24 +83,24 @@ quasarnoded q bank total --denom factory/$CONTRACT_ADDR/mydenom --node tcp://loc 2. Burn from contract address. ```bash -quasarnoded tx wasm execute $CONTRACT_ADDR "{ \"mint_tokens\": {\"amount\": \"100\", \"denom\": \"factory/${CONTRACT_ADDR}/mydenom\", \"mint_to_address\": \"$CONTRACT_ADDR\"}}" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -b block -quasarnoded tx wasm execute $CONTRACT_ADDR "{ \"burn_tokens\": {\"amount\": \"50\", \"denom\": \"factory/${CONTRACT_ADDR}/mydenom\", \"burn_from_address\": \"\"}}" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -b block -quasarnoded q bank total --denom factory/$CONTRACT_ADDR/mydenom --node tcp://localhost:26659 -quasarnoded q bank balances $CONTRACT_ADDR --node tcp://localhost:26659 +quasard tx wasm execute $CONTRACT_ADDR "{ \"mint_tokens\": {\"amount\": \"100\", \"denom\": \"factory/${CONTRACT_ADDR}/mydenom\", \"mint_to_address\": \"$CONTRACT_ADDR\"}}" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -b block +quasard tx wasm execute $CONTRACT_ADDR "{ \"burn_tokens\": {\"amount\": \"50\", \"denom\": \"factory/${CONTRACT_ADDR}/mydenom\", \"burn_from_address\": \"\"}}" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -b block +quasard q bank total --denom factory/$CONTRACT_ADDR/mydenom --node tcp://localhost:26659 +quasard q bank balances $CONTRACT_ADDR --node tcp://localhost:26659 ``` ### change Admin ```bash -quasarnoded q tokenfactory denom-authority-metadata factory/quasar14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sy9numu/mydenom --node tcp://localhost:26659 +quasard q tokenfactory denom-authority-metadata factory/quasar14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sy9numu/mydenom --node tcp://localhost:26659 - quasarnoded tx wasm execute $CONTRACT_ADDR "{ \"change_admin\": {\"denom\": \"factory/${CONTRACT_ADDR}/mydenom\", \"new_admin_address\": \"$BOB\"}}" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -b block + quasard tx wasm execute $CONTRACT_ADDR "{ \"change_admin\": {\"denom\": \"factory/${CONTRACT_ADDR}/mydenom\", \"new_admin_address\": \"$BOB\"}}" --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -b block ``` ### Get denom ```bash -quasarnoded query wasm contract-state smart $CONTRACT_ADDR "{ \"get_denom\": {\"creator_address\": \"${CONTRACT_ADDR}\", \"subdenom\": \"mydenom\" }}" --node tcp://localhost:26659 +quasard query wasm contract-state smart $CONTRACT_ADDR "{ \"get_denom\": {\"creator_address\": \"${CONTRACT_ADDR}\", \"subdenom\": \"mydenom\" }}" --node tcp://localhost:26659 ``` \ No newline at end of file diff --git a/demos/tokenfactory/quasar_localnet.sh b/demos/tokenfactory/quasar_localnet.sh index 2aba7443f..f1ece3da5 100755 --- a/demos/tokenfactory/quasar_localnet.sh +++ b/demos/tokenfactory/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar diff --git a/demos/upgrade-handler/README.md b/demos/upgrade-handler/README.md index 3099bbc0b..f1534a68d 100644 --- a/demos/upgrade-handler/README.md +++ b/demos/upgrade-handler/README.md @@ -15,7 +15,7 @@ 1. Update the test script with the necessary details for the new software upgrade proposal, such as title, description, and upgrade height. 2. Run the test script. This will perform the following actions: - - Kill existing quasarnoded processes + - Kill existing quasard processes - Start the local Quasar network using ./quasar_localnet.sh - Submit a software upgrade proposal with the specified details - Sleep for a short duration to allow for proposal submission diff --git a/demos/upgrade-handler/quasar_localnet.sh b/demos/upgrade-handler/quasar_localnet.sh index c95a0a621..cd5e07bd5 100755 --- a/demos/upgrade-handler/quasar_localnet.sh +++ b/demos/upgrade-handler/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar MY_TREASURY="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" @@ -78,5 +78,5 @@ cat $HOME_QSR/config/genesis_original.json | echo "Starting the chain" $BINARY start --home $HOME_QSR > quasar.log 2>&1 & -echo "Sleeping 5 seconds to wait quasarnoded to be executed" +echo "Sleeping 5 seconds to wait quasard to be executed" sleep 5 diff --git a/demos/upgrade-handler/v0.1.1/README.md b/demos/upgrade-handler/v0.1.1/README.md index 1e9c8a4b3..30f2936b7 100644 --- a/demos/upgrade-handler/v0.1.1/README.md +++ b/demos/upgrade-handler/v0.1.1/README.md @@ -15,7 +15,7 @@ After the execution: - Now that the governance proposal has been success the chain should have been halted. You can check the quasar.log file expecting to find: UPGRADE "v0.1.1" NEEDED at height: 30: CONSENSUS FAILURE!!! -- You can now "make install" the new version and check that blocks are produced as expected by running "quasarnoded +- You can now "make install" the new version and check that blocks are produced as expected by running "quasard start". It should start producing blocks from height 31. ## Usage diff --git a/demos/upgrade-handler/v0.1.1/upgrade_handler_v0_1_1.sh b/demos/upgrade-handler/v0.1.1/upgrade_handler_v0_1_1.sh index f94e354eb..deadf5e73 100755 --- a/demos/upgrade-handler/v0.1.1/upgrade_handler_v0_1_1.sh +++ b/demos/upgrade-handler/v0.1.1/upgrade_handler_v0_1_1.sh @@ -3,9 +3,9 @@ # TODO: Before running this script go to the main branch, execute a "git checkout v0.1.0" and "make install" the binary in order to start from the mainnet version. # TODO: Now checkout the upgrade branch and you are able to execute this test script. -# Kill existing quasarnoded processes -echo ">>> Killing existing quasarnoded processes..." -pkill quasarnoded || true +# Kill existing quasard processes +echo ">>> Killing existing quasard processes..." +pkill quasard || true # Entry point to run quasar_localnet.sh ../quasar_localnet.sh @@ -19,13 +19,13 @@ sleep 10 # Submit governance proposal for software-upgrade to v0.1.1 echo ">>> Submitting proposal for software-upgrade" -quasarnoded tx gov submit-proposal software-upgrade "v0.1.1" --title "Software Upgrade to v0.1.1" --description "This software-upgrade v0.1.1 introduces QVesting module for continuous vesting schedule accounts creation" --upgrade-height $UPGRADE_HEIGHT --deposit 1uqsr --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx gov submit-proposal software-upgrade "v0.1.1" --title "Software Upgrade to v0.1.1" --description "This software-upgrade v0.1.1 introduces QVesting module for continuous vesting schedule accounts creation" --upgrade-height $UPGRADE_HEIGHT --deposit 1uqsr --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 60 seconds after submitting proposal" sleep 60 echo ">>> Voting yes to proposal" -quasarnoded tx gov vote 1 yes --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx gov vote 1 yes --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5 seconds after voting proposal" sleep 5 @@ -33,7 +33,7 @@ sleep 5 # Wait for the block height to reach 100, cosmovisor should handle the upgrade echo ">>> Waiting for the block height to reach $UPGRADE_HEIGHT" while true; do - CURRENT_HEIGHT=$(quasarnoded status | jq -r '.SyncInfo.latest_block_height') + CURRENT_HEIGHT=$(quasard status | jq -r '.SyncInfo.latest_block_height') echo "Current height: "$CURRENT_HEIGHT if [ "$CURRENT_HEIGHT" -ge "$UPGRADE_HEIGHT" ]; then break @@ -42,7 +42,7 @@ while true; do done # Check if the upgrade has been successful -quasarnoded query gov proposal 1 --chain-id $CHAIN_ID --output json +quasard query gov proposal 1 --chain-id $CHAIN_ID --output json # TODO: Now that the governance proposal has been success the chain should have been halted. You can check the quasar.log file expecting to find: UPGRADE "v0.1.1" NEEDED at height: 30: CONSENSUS FAILURE!!! -# TODO: You can now "make install" the new version and check that blocks are produced as expected by running "quasarnoded start". It should start producing blocks from height 31. +# TODO: You can now "make install" the new version and check that blocks are produced as expected by running "quasard start". It should start producing blocks from height 31. diff --git a/demos/upgrade-handler/v1.0.0/README.md b/demos/upgrade-handler/v1.0.0/README.md index b7a02cbb9..a71a0a9c7 100644 --- a/demos/upgrade-handler/v1.0.0/README.md +++ b/demos/upgrade-handler/v1.0.0/README.md @@ -16,7 +16,7 @@ After the execution: - Now that the governance proposal has been success the chain should have been halted. You can check the quasar.log file expecting to find: UPGRADE "v0.1.1" NEEDED at height: 30: CONSENSUS FAILURE!!! -- You can now "make install" the new version and check that blocks are produced as expected by running "quasarnoded +- You can now "make install" the new version and check that blocks are produced as expected by running "quasard start". It should start producing blocks from height 31. ## Usage @@ -85,8 +85,8 @@ Each of these steps involves both technical and functional testing to verify tha ## Steps - Download v0.1.1 from Quasar-preview repository -- Put this in your path and name it as `quasarnoded-go-18` -- Checkout to the v1 of Quasar and install it locally as `quasarnoded` +- Put this in your path and name it as `quasard-go-18` +- Checkout to the v1 of Quasar and install it locally as `quasard` - Once the binaries are in place : - Run : ```shell diff --git a/demos/upgrade-handler/v1.0.0/post_upgrade.sh b/demos/upgrade-handler/v1.0.0/post_upgrade.sh index eabcfe51b..3377a0994 100755 --- a/demos/upgrade-handler/v1.0.0/post_upgrade.sh +++ b/demos/upgrade-handler/v1.0.0/post_upgrade.sh @@ -1,7 +1,7 @@ #!/bin/sh ## env variables -BINARY=quasarnoded +BINARY=quasard CHAIN_ID="quasar" ACCOUNT_NAME="my_treasury" RPC="http://127.0.0.1:26659" diff --git a/demos/upgrade-handler/v1.0.0/pre_upgrade.sh b/demos/upgrade-handler/v1.0.0/pre_upgrade.sh index 09c11e472..51df04111 100755 --- a/demos/upgrade-handler/v1.0.0/pre_upgrade.sh +++ b/demos/upgrade-handler/v1.0.0/pre_upgrade.sh @@ -5,7 +5,7 @@ set -e on_error() { echo "Some error occurred" - quasarnoded q wasm contract-state smart $ADDR1 '{"trapped_errors":{}}' + quasard q wasm contract-state smart $ADDR1 '{"trapped_errors":{}}' afplay /System/Library/Sounds/Sosumi.aiff } @@ -42,7 +42,7 @@ cd ../../../smart-contracts docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/workspace-optimizer-arm64:0.12.11 -BINARY=quasarnoded-go-18 +BINARY=quasard-go-18 CHAIN_ID="quasar" ACCOUNT_NAME="my_treasury" ACCOUNT_ADDRESS="quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" diff --git a/demos/upgrade-handler/v1.0.0/quasar_localnet.sh b/demos/upgrade-handler/v1.0.0/quasar_localnet.sh index 883c81e82..317c4298b 100755 --- a/demos/upgrade-handler/v1.0.0/quasar_localnet.sh +++ b/demos/upgrade-handler/v1.0.0/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded-go-18 +BINARY=quasard-go-18 HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar MY_TREASURY="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/demos/upgrade-handler/v1.0.0/restart_v1_0_0_binary.sh b/demos/upgrade-handler/v1.0.0/restart_v1_0_0_binary.sh index 4e5325869..bb256bf36 100755 --- a/demos/upgrade-handler/v1.0.0/restart_v1_0_0_binary.sh +++ b/demos/upgrade-handler/v1.0.0/restart_v1_0_0_binary.sh @@ -1,17 +1,17 @@ #!/bin/bash -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar -version=`quasarnoded version` +version=`quasard version` if [ "$version" != "1.0.0" ]; then echo "You are having incorrect version $version" echo "Please install the current mainnet version v1.0.0" exit 1 fi -pkill quasarnoded || true +pkill quasard || true echo "Starting the quasar $version " $BINARY start --home $HOME_QSR > quasar_new.log 2>&1 & \ No newline at end of file diff --git a/demos/upgrade-handler/v1.0.0/test_upgrade_with_contracts.sh b/demos/upgrade-handler/v1.0.0/test_upgrade_with_contracts.sh index 3d468e2c5..efbca042b 100644 --- a/demos/upgrade-handler/v1.0.0/test_upgrade_with_contracts.sh +++ b/demos/upgrade-handler/v1.0.0/test_upgrade_with_contracts.sh @@ -7,7 +7,7 @@ cleanup() { kill $RLY_PID_1 } -pkill quasarnoded +pkill quasard pkill osmosisd pkill rly @@ -38,7 +38,7 @@ echo "starting go relaying" rly start quasar_osmosis --debug-addr "localhost:7598" -p events --time-threshold 300s >>./logs/quasar_osmosis.log 2>&1 & RLY_PID_1=$! -quasarnoded status +quasard status osmosisd status # run pre upgrade actions like pools creation, contract deployments and bonding actions @@ -68,6 +68,6 @@ fi wait # Run these commands once you have finished with the tests -#pkill quasarnoded +#pkill quasard #pkill osmosisd #pkill rly \ No newline at end of file diff --git a/demos/upgrade-handler/v1.0.0/upgrade.sh b/demos/upgrade-handler/v1.0.0/upgrade.sh index ce36503ba..6377aa74f 100755 --- a/demos/upgrade-handler/v1.0.0/upgrade.sh +++ b/demos/upgrade-handler/v1.0.0/upgrade.sh @@ -2,7 +2,7 @@ ## run chain upgrade procedure echo "RUNNING CHAIN UPGRADE PROCEDURE" -BINARY=quasarnoded-go-18 +BINARY=quasard-go-18 CHAIN_ID="quasar" ACCOUNT_NAME="my_treasury" RPC="http://127.0.0.1:26659" @@ -44,11 +44,11 @@ $BINARY query gov proposal 1 --chain-id $CHAIN_ID --output json sleep 30 echo "killing the old quasar instance to start the new one" -pkill quasarnoded +pkill quasard rm ./logs/quasar.log # run chain upgrade -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode echo "starting with new binary" diff --git a/demos/upgrade-handler/v1.0.0/upgrade_handler_v1.0.0.sh b/demos/upgrade-handler/v1.0.0/upgrade_handler_v1.0.0.sh index 3bf065dee..fc6a19550 100755 --- a/demos/upgrade-handler/v1.0.0/upgrade_handler_v1.0.0.sh +++ b/demos/upgrade-handler/v1.0.0/upgrade_handler_v1.0.0.sh @@ -4,16 +4,16 @@ # Before running this script go to the main branch, execute a "git checkout v0.1.1" and "make install" # the binary in order to start from the mainnet version. -version=`quasarnoded version` +version=`quasard version` if [ "$version" != "0.1.1" ]; then echo "You are having incorrect version $version" echo "Please install the current mainnet version 0.1.1" exit 1 fi -# Kill existing quasarnoded processes -echo ">>> Killing existing quasarnoded processes..." -pkill quasarnoded || true +# Kill existing quasard processes +echo ">>> Killing existing quasard processes..." +pkill quasard || true # Entry point to run quasar_localnet.sh ../quasar_localnet.sh @@ -24,7 +24,7 @@ UPGRADE_HEIGHT=30 echo ">>> Sleeping 10 seconds to create some initial blocks" sleep 10 -current_block=$(quasarnoded status | jq -r '.SyncInfo.latest_block_height') +current_block=$(quasard status | jq -r '.SyncInfo.latest_block_height') echo "current block - $current_block" if [ $((current_block)) -lt 5 ]; then @@ -34,7 +34,7 @@ fi # Submit governance proposal for software-upgrade to v0.1.1 echo ">>> Submitting proposal for software-upgrade" -quasarnoded tx gov submit-proposal software-upgrade "v1" --title "Software Upgrade to v1" --description "This software-upgrade v1 introduces qvesting, token factory and authx module" --upgrade-height $UPGRADE_HEIGHT --deposit 100uqsr --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx gov submit-proposal software-upgrade "v1" --title "Software Upgrade to v1" --description "This software-upgrade v1 introduces qvesting, token factory and authx module" --upgrade-height $UPGRADE_HEIGHT --deposit 100uqsr --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y #sleep 5 @@ -43,7 +43,7 @@ echo ">>> Sleeping 60 seconds after submitting proposal" sleep 60 echo ">>> Voting yes to proposal" -quasarnoded tx gov vote 1 yes --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx gov vote 1 yes --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5 seconds after voting proposal" sleep 5 @@ -51,7 +51,7 @@ sleep 5 # Wait for the block height to reach 100, cosmovisor should handle the upgrade echo ">>> Waiting for the block height to reach $UPGRADE_HEIGHT" while true; do - CURRENT_HEIGHT=$(quasarnoded status | jq -r '.SyncInfo.latest_block_height') + CURRENT_HEIGHT=$(quasard status | jq -r '.SyncInfo.latest_block_height') echo "Current height: "$CURRENT_HEIGHT if [ "$CURRENT_HEIGHT" -ge "$UPGRADE_HEIGHT" ]; then break @@ -60,13 +60,13 @@ while true; do done echo "Check if the upgrade proposal works." -quasarnoded query gov proposal 1 --chain-id $CHAIN_ID --output json +quasard query gov proposal 1 --chain-id $CHAIN_ID --output json ## Post chain halt status - ### Check the binary log, and see if "UPGRADE "v1.0.0" NEEDED at height: 30" is available. ### If , yes chain has been halted and not producing blocks. -### `quasarnoded status | jq -r '.SyncInfo.latest_block_height'` command will be returning 30 , and +### `quasard status | jq -r '.SyncInfo.latest_block_height'` command will be returning 30 , and ### will not update the heights. ### Compile the binary using below commands to get the expected version in place. -### go install -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=quasar -X github.com/cosmos/cosmos-sdk/version.AppName=quasarnoded -X github.com/cosmos/cosmos-sdk/version.Version=1.0.0 -X github.com/cosmos/cosmos-sdk/version.Commit=00df969376c46d124bb35435aba71160c1def817 -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger," -w -s' -trimpath ./cmd/quasarnoded +### go install -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=quasar -X github.com/cosmos/cosmos-sdk/version.AppName=quasard -X github.com/cosmos/cosmos-sdk/version.Version=1.0.0 -X github.com/cosmos/cosmos-sdk/version.Commit=00df969376c46d124bb35435aba71160c1def817 -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger," -w -s' -trimpath ./cmd/quasard diff --git a/demos/upgrade-handler/v2.0.0/upgrade_test.sh b/demos/upgrade-handler/v2.0.0/upgrade_test.sh index 53d667698..8db89c7c2 100644 --- a/demos/upgrade-handler/v2.0.0/upgrade_test.sh +++ b/demos/upgrade-handler/v2.0.0/upgrade_test.sh @@ -6,7 +6,7 @@ # Kill existing quasarnodedv1 processes echo ">>> Killing existing quasarnodedv1 processes..." pkill quasarnodedv1 || true -pkill quasarnoded || true +pkill quasard || true echo ">>> Killing existing osmosisd processes..." pkill osmosisd || true diff --git a/demos/upgrade-handler/v3.0.0/draft_metadata.json b/demos/upgrade-handler/v3.0.0/draft_metadata.json new file mode 100644 index 000000000..4351a7243 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/draft_metadata.json @@ -0,0 +1,10 @@ +{ + "title": "Uprgade to v3", + "authors": [ + "Quasar" + ], + "summary": "Software upgrade to v3", + "details": "a", + "proposal_forum_url": "test.com", + "vote_option_context": "a" +} \ No newline at end of file diff --git a/demos/upgrade-handler/v3.0.0/draft_proposal.json b/demos/upgrade-handler/v3.0.0/draft_proposal.json new file mode 100644 index 000000000..25fd440a1 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/draft_proposal.json @@ -0,0 +1,19 @@ +{ + "messages": [ + { + "@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + "authority": "quasar10d07y265gmmuvt4z0w9aw880jnsr700j5pfcmk", + "plan": { + "name": "v3", + "time": "0001-01-01T00:00:00Z", + "height": "80", + "info": "v3", + "upgraded_client_state": null + } + } + ], + "metadata": "ipfs://CID", + "deposit": "10000uqsr", + "title": "Uprgade to v3", + "summary": "Software upgrade to v3" +} \ No newline at end of file diff --git a/demos/upgrade-handler/v3.0.0/go-relayer-config/chains/osmosis.json b/demos/upgrade-handler/v3.0.0/go-relayer-config/chains/osmosis.json new file mode 100644 index 000000000..8feb65401 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/go-relayer-config/chains/osmosis.json @@ -0,0 +1,16 @@ +{ + "type": "cosmos", + "value": { + "key": "osmokey", + "chain-id": "osmosis", + "rpc-addr": "http://127.0.0.1:26679", + "account-prefix": "osmo", + "keyring-backend": "test", + "gas-adjustment": 1.5, + "gas-prices": "0.1uosmo", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} diff --git a/demos/upgrade-handler/v3.0.0/go-relayer-config/chains/quasar.json b/demos/upgrade-handler/v3.0.0/go-relayer-config/chains/quasar.json new file mode 100644 index 000000000..f266631b1 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/go-relayer-config/chains/quasar.json @@ -0,0 +1,16 @@ +{ + "type": "cosmos", + "value": { + "key": "quasarkey", + "chain-id": "quasar", + "rpc-addr": "http://localhost:26659", + "account-prefix": "quasar", + "keyring-backend": "test", + "gas-adjustment": 2.0, + "gas-prices": "0.1uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} diff --git a/demos/upgrade-handler/v3.0.0/go-relayer-config/paths/quasar_osmosis.json b/demos/upgrade-handler/v3.0.0/go-relayer-config/paths/quasar_osmosis.json new file mode 100644 index 000000000..8979f1b43 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/go-relayer-config/paths/quasar_osmosis.json @@ -0,0 +1,12 @@ +{ + "src": { + "chain-id": "quasar" + }, + "dst": { + "chain-id": "osmosis" + }, + "src-channel-filter": { + "rule": null, + "channel-list": [] + } +} diff --git a/demos/upgrade-handler/v3.0.0/keys/osmo.key b/demos/upgrade-handler/v3.0.0/keys/osmo.key new file mode 100644 index 000000000..771f7031a --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/keys/osmo.key @@ -0,0 +1 @@ +rabbit garlic monitor wish pony magic budget someone room torch celery empower word assume digital rack electric weapon urban foot sketch jelly wet myself diff --git a/demos/upgrade-handler/v3.0.0/keys/qsr.key b/demos/upgrade-handler/v3.0.0/keys/qsr.key new file mode 100644 index 000000000..d47463aa4 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/keys/qsr.key @@ -0,0 +1 @@ +old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license diff --git a/demos/upgrade-handler/v3.0.0/osmosis_localnet.sh b/demos/upgrade-handler/v3.0.0/osmosis_localnet.sh new file mode 100755 index 000000000..8da39ad78 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/osmosis_localnet.sh @@ -0,0 +1,93 @@ +#!/bin/sh + +# Configure variables +BINARY=osmosisd +HOME_OSMOSIS=$HOME/.osmosis +CHAIN_ID=osmosis +ALICE="cruise scene law sea push expose scorpion wire trick repair wave quote task dose inner denial alpha favorite certain blouse motion flash split lunch" +BOB="lizard garlic canyon winner cheese tent drip task because ecology clay bridge junk critic track artefact gather harsh deliver unit vacant earth diesel stool" +USER_1="guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host" +USER_2="fuel obscure melt april direct second usual hair leave hobby beef bacon solid drum used law mercy worry fat super must ritual bring faculty" +RELAYER_ACC="$(cat ./keys/osmo.key)" + +ALICE_GENESIS_COINS=20000000uosmo,2000000000stake,1000000000000fakestake +BOB_GENESIS_COINS=10000000000000uosmo,1000000000stake,1000000000000fakestake,100000000000000usdc +USER_1_GENESIS_COINS=10000000000stake,10000000000uosmo +USER_2_GENESIS_COINS=10000000000stake,10000000000uosmo +RELAYER_ACC_GENESIS_COINS=10000000uosmo,10000000000stake + +echo $HOME_OSMOSIS + +rm -rf $HOME_OSMOSIS +# Bootstrap +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID --home $HOME_OSMOSIS + +echo $ALICE | $BINARY keys add alice --keyring-backend test --recover --home $HOME_OSMOSIS +echo $BOB | $BINARY keys add bob --keyring-backend test --recover --home $HOME_OSMOSIS +echo $USER_1 | $BINARY keys add user1 --keyring-backend test --recover --home $HOME_OSMOSIS +echo $USER_2 | $BINARY keys add user2 --keyring-backend test --recover --home $HOME_OSMOSIS +echo $RELAYER_ACC | $BINARY keys add relayer_acc --keyring-backend test --recover --home $HOME_OSMOSIS +$BINARY add-genesis-account $($BINARY keys show alice --keyring-backend test -a --home $HOME_OSMOSIS) $ALICE_GENESIS_COINS --home $HOME_OSMOSIS +$BINARY add-genesis-account $($BINARY keys show bob --keyring-backend test -a --home $HOME_OSMOSIS) $BOB_GENESIS_COINS --home $HOME_OSMOSIS +$BINARY add-genesis-account $($BINARY keys show user1 --keyring-backend test -a --home $HOME_OSMOSIS) $USER_1_GENESIS_COINS --home $HOME_OSMOSIS +$BINARY add-genesis-account $($BINARY keys show user2 --keyring-backend test -a --home $HOME_OSMOSIS) $USER_2_GENESIS_COINS --home $HOME_OSMOSIS +$BINARY add-genesis-account $($BINARY keys show relayer_acc --keyring-backend test -a --home $HOME_OSMOSIS) $RELAYER_ACC_GENESIS_COINS --home $HOME_OSMOSIS +$BINARY add-genesis-account osmo15td5pfjkmfn8d6l4t8dc67l3apgt9epw4ct298 $RELAYER_ACC_GENESIS_COINS --home $HOME_OSMOSIS +$BINARY gentx alice 10000000uosmo --chain-id $CHAIN_ID --keyring-backend test --home $HOME_OSMOSIS +$BINARY collect-gentxs --home $HOME_OSMOSIS + +# Check platform +platform='unknown' +unamestr=$(uname) +if [ "$unamestr" = 'Linux' ]; then + platform='linux' +elif [ "$unamestr" = 'Darwin' ]; then + platform='macos' +fi + +if [ $platform = 'linux' ]; then + sed -i 's/enable = false/enable = true/g' $HOME_OSMOSIS/config/app.toml + sed -i 's/swagger = false/swagger = true/g' $HOME_OSMOSIS/config/app.toml + sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0uosmo"/g' $HOME_OSMOSIS/config/app.toml + sed -i 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26679"+g' $HOME_OSMOSIS/config/config.toml + sed -i 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26679"+g' $HOME_OSMOSIS/config/client.toml + sed -i 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26662"+g' $HOME_OSMOSIS/config/config.toml + sed -i 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6062"+g' $HOME_OSMOSIS/config/config.toml + sed -i 's+address = "0.0.0.0:9090"+address = "0.0.0.0:9096"+g' $HOME_OSMOSIS/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8092"+g' $HOME_OSMOSIS/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1312"+g' $HOME_OSMOSIS/config/app.toml + sed -i 's+address = ":8080"+address = ":8082"+g' $HOME_OSMOSIS/config/app.toml +elif [ $platform = 'macos' ]; then + sed -i'.original' -e 's/enable = false/enable = true/g' $HOME_OSMOSIS/config/app.toml + sed -i'.original' -e 's/swagger = false/swagger = true/g' $HOME_OSMOSIS/config/app.toml + sed -i'.original' -e 's/minimum-gas-prices = ""/minimum-gas-prices = "0uosmo"/g' $HOME_OSMOSIS/config/app.toml + sed -i'.original' -e 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26679"+g' $HOME_OSMOSIS/config/config.toml + sed -i'.original' -e 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26679"+g' $HOME_OSMOSIS/config/client.toml + sed -i'.original' -e 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26662"+g' $HOME_OSMOSIS/config/config.toml + sed -i'.original' -e 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6062"+g' $HOME_OSMOSIS/config/config.toml + sed -i'.original' -e 's+address = "0.0.0.0:9090"+address = "0.0.0.0:9096"+g' $HOME_OSMOSIS/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8092"+g' $HOME_OSMOSIS/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1312"+g' $HOME_OSMOSIS/config/app.toml + sed -i'.original' -e 's+address = ":8080"+address = ":8082"+g' $HOME_OSMOSIS/config/app.toml +else + echo "only linux and macos platforms are supported, if you are using other platforms you should probably improve this script." + + exit 1 + sed -i '' 's/enable = false/enable = true/g' $HOME_OSMOSIS/config/app.toml + sed -i '' 's/swagger = false/swagger = true/g' $HOME_OSMOSIS/config/app.toml +fi + +cp $HOME_OSMOSIS/config/genesis.json $HOME_OSMOSIS/config/genesis_original.json +cat $HOME_OSMOSIS/config/genesis_original.json | + + jq '.app_state.crisis.constant_fee.denom="uosmo"' | + jq '.app_state.staking.params.bond_denom="uosmo"' | + jq '.app_state.txfees.basedenom="uosmo"' | + jq '.app_state.gov.deposit_params.min_deposit=[{denom:"uosmo",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="30s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' >$HOME_OSMOSIS/config/genesis.json + + +# Start +$BINARY start --home $HOME_OSMOSIS >>./logs/osmo_localnet.log 2>&1 & +#$BINARY start --home $HOME_OSMOSIS \ No newline at end of file diff --git a/demos/upgrade-handler/v3.0.0/post_upgrade.sh b/demos/upgrade-handler/v3.0.0/post_upgrade.sh new file mode 100755 index 000000000..10eec0b6a --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/post_upgrade.sh @@ -0,0 +1,352 @@ +#!/bin/bash + +# Variables +NODE="http://127.0.0.1:26659" + +# Function to check if a value is true +check_true() { + local key="$1" + local value="$2" + if [ "$value" == "true" ]; then + echo "$key is true." + else + echo "$key is not true." + exit 1 + fi +} + +# Function to check if a value is greater than a threshold +check_greater() { + local key="$1" + local value="$2" + local threshold="$3" + if (( $(echo "$value > $threshold" | bc -l) )); then + echo "$key is greater than $threshold." + else + echo "$key is not greater than $threshold." + exit 1 + fi +} + +# Function to check if a value is equal to an expected value +check_equal() { + local key="$1" + local value="$2" + local expected="$3" + if [ "$value" == "$expected" ]; then + echo "$key is $expected." + else + echo "$key is not $expected. Got: $value" + exit 1 + fi +} + +# Check ibc-transfer params +IBC_TRANSFER_PARAMS=$(quasard q ibc-transfer params --output json --node $NODE) +SEND_ENABLED=$(echo $IBC_TRANSFER_PARAMS | jq -r '.send_enabled') +RECEIVE_ENABLED=$(echo $IBC_TRANSFER_PARAMS | jq -r '.receive_enabled') +check_true "send_enabled" "$SEND_ENABLED" +check_true "receive_enabled" "$RECEIVE_ENABLED" + +# Check ibc-wasm checksums +IBC_WASM_CHECKSUMS=$(quasard q ibc-wasm checksums --output json --node $NODE) +CHECKSUMS_LENGTH=$(echo $IBC_WASM_CHECKSUMS | jq -r '.checksums | length') +check_equal "checksums length" "$CHECKSUMS_LENGTH" "0" + +# Check interchain-accounts controller params +ICA_CONTROLLER_PARAMS=$(quasard q interchain-accounts controller params --output json --node $NODE) +CONTROLLER_ENABLED=$(echo $ICA_CONTROLLER_PARAMS | jq -r '.controller_enabled') +check_true "controller_enabled" "$CONTROLLER_ENABLED" + +# Check interchain-accounts host params +ICA_HOST_PARAMS=$(quasard q interchain-accounts host params --output json --node $NODE) +HOST_ENABLED=$(echo $ICA_HOST_PARAMS | jq -r '.host_enabled') +ALLOW_MESSAGES_LENGTH=$(echo $ICA_HOST_PARAMS | jq -r '.allow_messages | length') +check_true "host_enabled" "$HOST_ENABLED" +check_equal "allow_messages length" "$ALLOW_MESSAGES_LENGTH" "1" + +# Check mint params +MINT_PARAMS=$(quasard q mint params --output json --node $NODE) +MINT_DENOM=$(echo $MINT_PARAMS | jq -r '.params.mint_denom') +INFLATION_RATE_CHANGE=$(echo $MINT_PARAMS | jq -r '.params.inflation_rate_change') +check_equal "mint_denom" "$MINT_DENOM" "uqsr" +check_greater "inflation_rate_change" "$INFLATION_RATE_CHANGE" "0" + +# Check params subspace slashing SignedBlocksWindow +#SLASHING_PARAMS=$(quasard q params subspace slashing SignedBlocksWindow --output json --node $NODE) +#SIGNED_BLOCKS_WINDOW=$(echo $SLASHING_PARAMS | jq -r '.value' | tr -d '"') +#check_greater "SignedBlocksWindow" "$SIGNED_BLOCKS_WINDOW" "0" + +# Check slashing params +SLASHING_PARAMS=$(quasard q slashing params --output json --node $NODE) +SIGNED_BLOCKS_WINDOW=$(echo $SLASHING_PARAMS | jq -r '.params.signed_blocks_window') +check_greater "signed_blocks_window" "$SIGNED_BLOCKS_WINDOW" "99" + +# Check staking params +STAKING_PARAMS=$(quasard q staking params --output json --node $NODE) +UNBONDING_TIME=$(echo $STAKING_PARAMS | jq -r '.params.unbonding_time' | sed 's/s//') +MAX_VALIDATORS=$(echo $STAKING_PARAMS | jq -r '.params.max_validators') +check_equal "unbonding_time" "$UNBONDING_TIME" "504h0m0" +check_equal "max_validators" "$MAX_VALIDATORS" "100" + +# Check tendermint-validator-set +VALIDATOR_SET=$(quasard q tendermint-validator-set --output json --node $NODE) +VALIDATORS_COUNT=$(echo $VALIDATOR_SET | jq -r '.validators | length') +check_greater "validators count" "$VALIDATORS_COUNT" "0" + +# Check tokenfactory params +TOKENFACTORY_PARAMS=$(quasard q tokenfactory params --output json --node $NODE) +DENOM_CREATION_FEE_AMOUNT=$(echo $TOKENFACTORY_PARAMS | jq -r '.params.denom_creation_fee[] | select(.denom=="uqsr") | .amount') +check_greater "denom_creation_fee_amount" "$DENOM_CREATION_FEE_AMOUNT" "0" + +# Check upgrade module_versions +UPGRADE_MODULE_VERSIONS=$(quasard q upgrade module_versions --output json --node $NODE) +MODULE_VERSIONS_COUNT=$(echo $UPGRADE_MODULE_VERSIONS | jq -r '.module_versions | length') +check_greater "module_versions count" "$MODULE_VERSIONS_COUNT" "0" + +# Check wasm params +WASM_PARAMS=$(quasard q wasm params --output json --node $NODE) +CODE_UPLOAD_ACCESS=$(echo $WASM_PARAMS | jq -r '.code_upload_access.permission') +check_equal "code_upload_access permission" "$CODE_UPLOAD_ACCESS" "Everybody" + +# Check account info +ACCOUNT_INFO=$(quasard q auth account quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --output json --node $NODE) +ACCOUNT_NUMBER=$(echo $ACCOUNT_INFO | jq -r '.account.value.account_number') +check_greater "account_number" "$ACCOUNT_NUMBER" "0" + +# Check auth params +AUTH_PARAMS=$(quasard q auth params --output json --node $NODE) +MAX_MEMO_CHARACTERS=$(echo $AUTH_PARAMS | jq -r '.params.max_memo_characters') +TX_SIG_LIMIT=$(echo $AUTH_PARAMS | jq -r '.params.tx_sig_limit') +check_greater "max_memo_characters" "$MAX_MEMO_CHARACTERS" "0" +check_greater "tx_sig_limit" "$TX_SIG_LIMIT" "0" + +# Check bank total +BANK_TOTAL=$(quasard q bank total --output json --node $NODE) +UQSR_AMOUNT=$(echo $BANK_TOTAL | jq -r '.supply[] | select(.denom=="uqsr") | .amount') +check_greater "uqsr amount" "$UQSR_AMOUNT" "100000000" + +# Check distribution params +DISTRIBUTION_PARAMS=$(quasard q distribution params --output json --node $NODE) +COMMUNITY_TAX=$(echo $DISTRIBUTION_PARAMS | jq -r '.params.community_tax') +check_greater "community_tax" "$COMMUNITY_TAX" "0" + +# Check epochs info +EPOCHS_INFO=$(quasard q epochs epoch-infos --output json --node $NODE) +CURRENT_EPOCHS=$(echo $EPOCHS_INFO | jq -r '.epochs[].current_epoch') +ALL_VALID=true +for EPOCH in $CURRENT_EPOCHS; do + if [ "$EPOCH" -lt 1 ]; then + ALL_VALID=false + break + fi +done +if [ "$ALL_VALID" = true ]; then + echo "All current epochs are greater than or equal to 1." +else + echo "One or more current epochs are less than 1." + exit 1 +fi + +# Check evidence +EVIDENCE=$(quasard q evidence list --height 21 --output json --node $NODE) +EVIDENCE_COUNT=$(echo $EVIDENCE | jq -r '.pagination | length') +check_equal "evidence count" "$EVIDENCE_COUNT" "0" + +# Check gov params +GOV_PARAMS=$(quasard q gov params --output json --node $NODE) +MIN_DEPOSIT_AMOUNT=$(echo $GOV_PARAMS | jq -r '.params.min_deposit[] | select(.denom=="uqsr") | .amount') +MAX_DEPOSIT_PERIOD=$(echo $GOV_PARAMS | jq -r '.params.max_deposit_period') +check_equal "min_deposit_amount" "$MIN_DEPOSIT_AMOUNT" "1" +check_equal "max_deposit_period" "$MAX_DEPOSIT_PERIOD" "48h0m0s" + +echo "qwuery testing finished" + + + +# Variables +NODE="http://127.0.0.1:26659" +CHAIN_ID="quasar" +KEYRING_BACKEND="test" +HOME_DIR="$HOME/.quasarnode" +SENDER="bob" +RECEIVER="my_treasury" +SENDER_ADDRESS="quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu" +RECEIVER_ADDRESS="quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" +VALIDATOR="quasarvaloper1sqlsc5024sszglyh7pswk5hfpc5xtl77v7z632" +DENOM="uqsr" +GAS_PRICES="0.1uqsr" +CONTRACT_WASM_PATH="./artifacts/airdrop.wasm" +CONTRACT_LABEL="Test Contract" +CONTRACT_INIT_MSG='{"config": {"airdrop_amount": "11000000000","airdrop_asset": {"native": "uqsr"},"airdrop_title":"Test Title","airdrop_description": "Test description","end_height": 0,"start_height": 0,"total_claimed": "0"}}' +SLEEP_DURATION=6 + +# Function to print and execute commands +execute() { + echo "Executing: $*" + eval $* +} + +OLD_CONTRACT_ADDRESS="quasar14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sy9numu" +echo "Interact with old Contract" +CONTRACT_EXECUTE_MSG='{"admin": {"add_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "2500000000"}]}}}' +execute "quasard tx wasm execute $OLD_CONTRACT_ADDRESS '$CONTRACT_EXECUTE_MSG' --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas-adjustment 1.5 --gas auto" +sleep $SLEEP_DURATION + +# Query Contract State +echo "Query old Contract State" +CONTRACT_QUERY_MSG='{"airdrop_config_query": {}}' +execute "quasard query wasm contract-state smart $OLD_CONTRACT_ADDRESS '$CONTRACT_QUERY_MSG' --node $NODE --output json" + +# Bank Send +echo "1. Bank Send" +execute "quasard query bank balances $RECEIVER_ADDRESS --node $NODE" +execute "quasard tx bank send $SENDER_ADDRESS $RECEIVER_ADDRESS 10000000$DENOM --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas auto --gas-adjustment 1.5" +sleep $SLEEP_DURATION +execute "quasard query bank balances $RECEIVER_ADDRESS --node $NODE" + +# Staking +echo "2. Staking" +execute "quasard tx staking delegate $VALIDATOR 1000000$DENOM --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas auto --gas-adjustment 1.5" +sleep $SLEEP_DURATION +execute "quasard query staking delegations $SENDER_ADDRESS --node $NODE" + +# Claim Rewards +echo "3. Claim Rewards" +execute "quasard tx distribution withdraw-rewards $VALIDATOR --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas --gas-adjustment 1.5" +sleep $SLEEP_DURATION +execute "quasard query distribution rewards-by-validator $SENDER_ADDRESS $VALIDATOR --node $NODE" + +# Upload Contract +echo "4. Upload Contract" +execute "quasard tx wasm store $CONTRACT_WASM_PATH --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas auto --gas-adjustment 1.5" +sleep $SLEEP_DURATION + +# Get the code ID +CODE_ID=$(quasard query wasm list-code --node $NODE --output json | jq -r '.code_infos[-1].code_id') +echo "Contract Code ID: $CODE_ID" + +# Instantiate Contract +echo "5. Instantiate Contract" +execute "quasard tx wasm instantiate $CODE_ID '$CONTRACT_INIT_MSG' --from $SENDER --label '$CONTRACT_LABEL' --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --admin $SENDER_ADDRESS --gas auto --gas-adjustment 1.5" +sleep $SLEEP_DURATION + +# Get the contract address +CONTRACT_ADDRESS=$(quasard query wasm list-contract-by-code $CODE_ID --node $NODE --output json | jq -r '.contracts[-1]') +echo "Contract Address: $CONTRACT_ADDRESS" + +# Interact with Contract +echo "6. Interact with Contract" +CONTRACT_EXECUTE_MSG='{"admin": {"add_users": {"users": [{"address": "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec", "amount": "2500000000"}]}}}' +execute "quasard tx wasm execute $CONTRACT_ADDRESS '$CONTRACT_EXECUTE_MSG' --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas auto --gas-adjustment 1.5" +sleep $SLEEP_DURATION + +# Query Contract State +echo "7. Query Contract State" +CONTRACT_QUERY_MSG='{"airdrop_config_query": {}}' +execute "quasard query wasm contract-state smart $CONTRACT_ADDRESS '$CONTRACT_QUERY_MSG' --node $NODE --output json" + +echo "8. Submit Governance Proposal" +PROPOSAL_TITLE="Test Proposal" +PROPOSAL_DESCRIPTION="This is a test proposal." +PROPOSAL_TYPE="Text" +PROPOSAL_DEPOSIT="1$DENOM" +execute "quasard tx gov submit-legacy-proposal --title '$PROPOSAL_TITLE' --description '$PROPOSAL_DESCRIPTION' --type '$PROPOSAL_TYPE' --deposit $PROPOSAL_DEPOSIT --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas auto --gas-adjustment 1.5" +sleep $SLEEP_DURATION + +# Get the proposal ID +PROPOSAL_ID=$(quasard query gov proposals --output json --node $NODE | jq -r '.proposals[-1].id') +echo "Proposal ID: $PROPOSAL_ID" + +# Deposit to the Proposal +echo "9. Deposit to the Proposal" +execute "quasard tx gov deposit $PROPOSAL_ID 5000000$DENOM --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas auto --gas-adjustment 1.5" +sleep $SLEEP_DURATION + +# Vote on the Proposal +echo "10. Vote on the Proposal" +execute "quasard tx gov vote $PROPOSAL_ID yes --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas auto --gas-adjustment 1.5" +sleep $SLEEP_DURATION + +# Query Proposal Status +echo "11. Query Proposal Status" +execute "quasard query gov proposal $PROPOSAL_ID --node $NODE --output json" + +# IBC testing post upgrade +OSMOSIS_NODE="http://127.0.0.1:26679" +OSMOSIS_CHANNEL="channel-0" +OSMOSIS_SENDER="bob" +OSMOSIS_RECEIVER="quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" +OSMOSIS_DENOM="uosmo" +OSMOSIS_AMOUNT="10000" +OSMOSIS_CHAIN_ID="osmosis" +OSMOSIS_HOME="$HOME/.osmosis" + +QUASAR_NODE="http://127.0.0.1:26659" +QUASAR_CHANNEL="channel-0" +QUASAR_SENDER="my_treasury" +QUASAR_RECEIVER="osmo1ez43ye5qn3q2zwh8uvswppvducwnkq6wjqc87d" +QUASAR_DENOM="uqsr" +QUASAR_AMOUNT="10000" +QUASAR_CHAIN_ID="quasar" +QUASAR_HOME="$HOME/.quasarnode" +LOOP_COUNT=15 +SLEEP_DURATION=10 + +SENDER_ADDRESS="quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu" +RECEIVER_ADDRESS="quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" +VALIDATOR="quasarvaloper1sqlsc5024sszglyh7pswk5hfpc5xtl77v7z632" + +echo "12. IBC testing" +# Execute and check balances +for ((i=1; i<=LOOP_COUNT; i++)) +do + echo "Iteration $i" + + # Osmosis to Quasar transfer + echo "Transferring from Osmosis to Quasar" + INITIAL_BALANCE=$(quasard query bank balances $OSMOSIS_RECEIVER --output json | jq -r --arg denom "ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518" '.balances[] | select(.denom==$denom) | .amount') + osmosisd tx ibc-transfer transfer transfer $OSMOSIS_CHANNEL $OSMOSIS_RECEIVER ${OSMOSIS_AMOUNT}${OSMOSIS_DENOM} --from $OSMOSIS_SENDER --keyring-backend test --home $OSMOSIS_HOME --node $OSMOSIS_NODE --chain-id $OSMOSIS_CHAIN_ID -y --gas-prices 1$OSMOSIS_DENOM + sleep $SLEEP_DURATION + rly transact flush + sleep $SLEEP_DURATION + FINAL_BALANCE=$(quasard query bank balances $OSMOSIS_RECEIVER --output json | jq -r --arg denom "ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518" '.balances[] | select(.denom==$denom) | .amount') + check_greater "Balance" "$FINAL_BALANCE" "$INITIAL_BALANCE" + + + # Quasar to Osmosis transfer + echo "Transferring from Quasar to Osmosis" + INITIAL_BALANCE=$(osmosisd query bank balances $QUASAR_RECEIVER --node $OSMOSIS_NODE --output json | jq -r --arg denom "ibc/6BEEEE6CC17BA0EE37857A1E2AF6EC53C50DB6B6F89463A3933D0859C4CF6087" '.balances[] | select(.denom==$denom) | .amount') + quasard tx ibc-transfer transfer transfer $QUASAR_CHANNEL $QUASAR_RECEIVER ${QUASAR_AMOUNT}${QUASAR_DENOM} --from $QUASAR_SENDER --keyring-backend test --home $QUASAR_HOME --chain-id $QUASAR_CHAIN_ID -y --gas-prices 1$QUASAR_DENOM --node $QUASAR_NODE + sleep $SLEEP_DURATION + rly transact flush + sleep $SLEEP_DURATION + FINAL_BALANCE=$(osmosisd query bank balances $QUASAR_RECEIVER --node $OSMOSIS_NODE --output json | jq -r --arg denom "ibc/6BEEEE6CC17BA0EE37857A1E2AF6EC53C50DB6B6F89463A3933D0859C4CF6087" '.balances[] | select(.denom==$denom) | .amount') + check_greater "Balance" "$FINAL_BALANCE" "$INITIAL_BALANCE" + + # other module actions + INITIAL_BALANCE=$(quasard query bank balances $RECEIVER_ADDRESS --output json | jq -r --arg denom "$QUASAR_DENOM" '.balances[] | select(.denom==$denom) | .amount') + quasard tx bank send $SENDER_ADDRESS $RECEIVER_ADDRESS 10000000$DENOM --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y + sleep $SLEEP_DURATION + FINAL_BALANCE=$(quasard query bank balances $RECEIVER_ADDRESS --output json | jq -r --arg denom "$QUASAR_DENOM" '.balances[] | select(.denom==$denom) | .amount') + check_greater "Balance" "$FINAL_BALANCE" "$INITIAL_BALANCE" + + REWARDS=$(quasard query distribution rewards-by-validator $SENDER_ADDRESS $VALIDATOR --output json) + INITIAL_REWARDS=$(echo $REWARDS | jq -r '.rewards[] | sub("uqsr$"; "") | tonumber' ) + quasard tx distribution withdraw-rewards $VALIDATOR --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y + sleep $SLEEP_DURATION + REWARDS=$(quasard query distribution rewards-by-validator $SENDER_ADDRESS $VALIDATOR --output json) + FINAL_REWARDS=$(echo $REWARDS | jq -r '.rewards[] | sub("uqsr$"; "") | tonumber' ) + check_greater "Rewards" "$INITIAL_REWARDS" "$FINAL_REWARDS" + + INITIAL_STAKING=$(quasard query staking delegations $SENDER_ADDRESS --output json) + INITIAL_STAKING_AMOUNT=$(echo $INITIAL_STAKING | jq -r '.delegation_responses[0].balance.amount') + quasard tx staking delegate $VALIDATOR 1000000$DENOM --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y + sleep $SLEEP_DURATION + POST_STAKING=$(quasard query staking delegations $SENDER_ADDRESS --output json) + POST_STAKING_AMOUNT=$(echo $POST_STAKING | jq -r '.delegation_responses[0].balance.amount') + check_greater "Staked Amount" "$POST_STAKING_AMOUNT" "$INITIAL_STAKING_AMOUNT" + +done + +echo "Script completed." diff --git a/demos/upgrade-handler/v3.0.0/pre_upgrade.sh b/demos/upgrade-handler/v3.0.0/pre_upgrade.sh new file mode 100755 index 000000000..2e2539401 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/pre_upgrade.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +# Variables +NODE="http://127.0.0.1:26659" +CHAIN_ID="quasar" +KEYRING_BACKEND="test" +HOME_DIR="$HOME/.quasarnode" +SENDER="bob" +SENDER_ADDRESS="quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu" +GAS_PRICES="0.1uqsr" +CONTRACT_WASM_PATH="./artifacts/airdrop.wasm" +CONTRACT_LABEL="Test Contract" +CONTRACT_INIT_MSG='{"config": {"airdrop_amount": "11000000000","airdrop_asset": {"native": "uqsr"},"airdrop_title":"Test Title","airdrop_description": "Test description","end_height": 0,"start_height": 0,"total_claimed": "0"}}' +SLEEP_DURATION=6 + +# Function to print and execute commands +execute() { + echo "Executing: $*" + eval $* +} + +# Upload Contract +echo "1. Upload Contract" +execute "quasarnoded tx wasm store $CONTRACT_WASM_PATH --from $SENDER --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --gas 2000000" +sleep $SLEEP_DURATION + +# Get the code ID +CODE_ID=$(quasarnoded query wasm list-code --node $NODE --output json | jq -r '.code_infos[-1].code_id') +echo "Contract Code ID: $CODE_ID" + +# Instantiate Contract +echo "2. Instantiate Contract" +execute "quasarnoded tx wasm instantiate $CODE_ID '$CONTRACT_INIT_MSG' --from $SENDER --label '$CONTRACT_LABEL' --chain-id $CHAIN_ID --gas-prices $GAS_PRICES --keyring-backend $KEYRING_BACKEND --home $HOME_DIR -y --admin $SENDER_ADDRESS" +sleep $SLEEP_DURATION + +# Get the contract address +CONTRACT_ADDRESS=$(quasarnoded query wasm list-contract-by-code $CODE_ID --node $NODE --output json | jq -r '.contracts[-1]') +echo "Contract Address: $CONTRACT_ADDRESS" + +# IBC testing post upgrade +OSMOSIS_NODE="http://127.0.0.1:26679" +OSMOSIS_CHANNEL="channel-0" +OSMOSIS_SENDER="bob" +OSMOSIS_RECEIVER="quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" +OSMOSIS_DENOM="uosmo" +OSMOSIS_AMOUNT="10000" +OSMOSIS_CHAIN_ID="osmosis" +OSMOSIS_HOME="$HOME/.osmosis" + +QUASAR_NODE="http://127.0.0.1:26659" +QUASAR_CHANNEL="channel-0" +QUASAR_SENDER="my_treasury" +QUASAR_RECEIVER="osmo1ez43ye5qn3q2zwh8uvswppvducwnkq6wjqc87d" +QUASAR_DENOM="uqsr" +QUASAR_AMOUNT="10000" +QUASAR_CHAIN_ID="quasar" +QUASAR_HOME="$HOME/.quasarnode" +LOOP_COUNT=1 +SLEEP_DURATION=6 + +echo "12. IBC testing" +# Execute and check balances +for ((i=1; i<=LOOP_COUNT; i++)) +do + echo "Iteration $i" + + # Osmosis to Quasar transfer + echo "Transferring from Osmosis to Quasar" + osmosisd tx ibc-transfer transfer transfer $OSMOSIS_CHANNEL $OSMOSIS_RECEIVER ${OSMOSIS_AMOUNT}${OSMOSIS_DENOM} --from $OSMOSIS_SENDER --keyring-backend test --home $OSMOSIS_HOME --node $OSMOSIS_NODE --chain-id $OSMOSIS_CHAIN_ID -y --gas-prices 1$OSMOSIS_DENOM + sleep $SLEEP_DURATION + rly transact flush + sleep $SLEEP_DURATION + quasarnoded query bank balances $OSMOSIS_RECEIVER + + # Quasar to Osmosis transfer + echo "Transferring from Quasar to Osmosis" + quasarnoded tx ibc-transfer transfer transfer $QUASAR_CHANNEL $QUASAR_RECEIVER ${QUASAR_AMOUNT}${QUASAR_DENOM} --from $QUASAR_SENDER --keyring-backend test --home $QUASAR_HOME --chain-id $QUASAR_CHAIN_ID -y --gas-prices $GAS_PRICES --node $QUASAR_NODE + sleep $SLEEP_DURATION + rly transact flush + sleep $SLEEP_DURATION + osmosisd query bank balances $QUASAR_RECEIVER --node $OSMOSIS_NODE +done + +echo "Script completed." \ No newline at end of file diff --git a/demos/upgrade-handler/v3.0.0/quasar_localnet.sh b/demos/upgrade-handler/v3.0.0/quasar_localnet.sh new file mode 100755 index 000000000..f11977e2a --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/quasar_localnet.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +## This script helps to create a basic version of the quasar chain genesis file for development purposes. +## However it will need some manual modifications before you start the chain to incorporate the custom fields. + +# Configure variables +BINARY=quasarnoded +HOME_QSR=$HOME/.quasarnode +CHAIN_ID=quasar +MY_TREASURY="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" +BOB="harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar" +USER_1="guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host" +USER_2="fuel obscure melt april direct second usual hair leave hobby beef bacon solid drum used law mercy worry fat super must ritual bring faculty" +RELAYER_ACC="$(cat ./keys/qsr.key)" +MY_TREASURY_GENESIS_COINS=20000token,200000000stake,1000000000uqsr +BOB_GENESIS_COINS=10000token,100000000stake,1000000000uqsr +USER_1_GENESIS_COINS=10000000000stake,10000000000uqsr +USER_2_GENESIS_COINS=10000000000stake,10000000000uqsr +RELAYER_ACC_GENESIS_COINS=10000000uqsr,10000000000stake + +# Remove previous setup + +rm -rf $HOME_QSR + +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID + +# Bootstrap the quasar local network with single node + +echo $MY_TREASURY | $BINARY keys add my_treasury --keyring-backend test --recover +echo $BOB | $BINARY keys add bob --keyring-backend test --recover +echo $USER_1 | $BINARY keys add user1 --keyring-backend test --recover +echo $USER_2 | $BINARY keys add user2 --keyring-backend test --recover +echo $RELAYER_ACC | $BINARY keys add relayer_acc --keyring-backend test --recover + +$BINARY add-genesis-account $($BINARY keys show bob --keyring-backend test -a) $BOB_GENESIS_COINS +$BINARY add-genesis-account $($BINARY keys show user1 --keyring-backend test -a) $USER_1_GENESIS_COINS +$BINARY add-genesis-account $($BINARY keys show user2 --keyring-backend test -a) $USER_2_GENESIS_COINS +$BINARY add-genesis-account $($BINARY keys show my_treasury --keyring-backend test -a) $MY_TREASURY_GENESIS_COINS +$BINARY add-genesis-account $($BINARY keys show relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY add-genesis-account quasar1mxdu6enz8lzmajpsk9nxsyaw0aysy0e35qrlkd $RELAYER_ACC_GENESIS_COINS + +echo "Creating gentx" +$BINARY gentx my_treasury 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +echo "Collecting gentx" +$BINARY collect-gentxs + +# Check platform +platform='unknown' +unamestr=$(uname) +if [ "$unamestr" = 'Linux' ]; then + platform='linux' +elif [ "$unamestr" = 'Darwin' ]; then + platform='macos' +fi + +if [ $platform = 'linux' ]; then + sed -i 's/enable = false/enable = true/g' $HOME_QSR/config/app.toml + sed -i 's/swagger = false/swagger = true/g' $HOME_QSR/config/app.toml + sed -i 's/minimum-gas-prices = "0uqsr"/minimum-gas-prices = "0.1uqsr"/g' $HOME_QSR/config/app.toml + sed -i 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26659"+g' $HOME_QSR/config/config.toml + sed -i 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26659"+g' $HOME_QSR/config/client.toml + sed -i 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26661"+g' $HOME_QSR/config/config.toml + sed -i 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6061"+g' $HOME_QSR/config/config.toml + sed -i 's+address = "localhost:9090"+address = "localhost:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "localhost:9091"+address = "localhost:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://localhost:1317"+address = "tcp://localhost:1311"+g' $HOME_QSR/config/app.toml + sed -i 's+address = ":8080"+address = ":8081"+g' $HOME_QSR/config/app.toml +elif [ $platform = 'macos' ]; then + sed -i'.original' -e 's/enable = false/enable = true/g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's/swagger = false/swagger = true/g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's/minimum-gas-prices = "0uqsr"/minimum-gas-prices = "0.1uqsr"/g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26659"+g' $HOME_QSR/config/config.toml + sed -i'.original' -e 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26659"+g' $HOME_QSR/config/client.toml + sed -i'.original' -e 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26661"+g' $HOME_QSR/config/config.toml + sed -i'.original' -e 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6061"+g' $HOME_QSR/config/config.toml + sed -i'.original' -e 's+address = "localhost:9090"+address = "localhost:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "localhost:9091"+address = "localhost:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://localhost:1317"+address = "tcp://localhost:1311"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = ":8080"+address = ":8081"+g' $HOME_QSR/config/app.toml +else + echo "only linux and macos platforms are supported, if you are using other platforms you should probably improve this script." + exit 1 +fi + +cp $HOME_QSR/config/genesis.json $HOME_QSR/config/genesis_original.json +cat $HOME_QSR/config/genesis_original.json | + jq '.app_state.crisis.constant_fee.denom="uqsr"' | + jq '.app_state.staking.params.bond_denom="uqsr"' | + jq '.app_state.mint.params.mint_denom="uqsr"' | + jq '.app_state.gov.params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.params.voting_period="30s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' >$HOME_QSR/config/genesis.json + +# jq '.app_state.feemarket.params.min_base_gas_price="0.10000000000000000"' | +# jq '.app_state.feemarket.params.max_block_utilization="120000000"' | +# jq '.app_state.feemarket.state.base_gas_price="0.10000000000000000"' | +# jq '.app_state.feemarket.params."fee_denom"="uqsr" + +# Start +echo "Starting the chain" +$BINARY start --home $HOME_QSR > ./logs/quasar_localnet.log 2>&1 & diff --git a/demos/upgrade-handler/v3.0.0/setup_go_relayer.sh b/demos/upgrade-handler/v3.0.0/setup_go_relayer.sh new file mode 100755 index 000000000..def20a60c --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/setup_go_relayer.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# remove any old configs +RELAYER_CONF="$HOME/.relayer" +rm -rf $RELAYER_CONF &> /dev/null + +rly config init + +# add configs for each chain, +rly chains add-dir ./go-relayer-config/chains + +# restore the keys from the mnemomic phrases, same phrases as the hermes script +OSMOKEY="$(cat ./keys/osmo.key)" +QUASARKEY="$(cat ./keys/qsr.key)" + +rly keys restore quasar quasarkey "$QUASARKEY" +rly keys restore osmosis osmokey "$OSMOKEY" + +rly q balance quasar +rly q balance osmosis + +rly paths add-dir ./go-relayer-config/paths +rly tx link quasar_osmosis --debug --override >> ./logs/rly_qo_setup.log 2>&1 + +rly start quasar_osmosis --debug-addr "localhost:7598" -p events --time-threshold 300s >>./logs/quasar_osmosis.log 2>&1 & diff --git a/demos/upgrade-handler/v3.0.0/upgrade_test.sh b/demos/upgrade-handler/v3.0.0/upgrade_test.sh new file mode 100644 index 000000000..d33fd75b4 --- /dev/null +++ b/demos/upgrade-handler/v3.0.0/upgrade_test.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +# TODO: Before running this script go to the main branch, execute a "git checkout v2.0.1" and "make install" the binary in order to start from the mainnet version. +# TODO: Now checkout the upgrade branch and you are able to execute this test script. + +# Kill existing quasarnodedv1 processes +echo ">>> Killing existing quasarnoded processes..." +pkill quasarnoded || true +pkill quasard || true + +echo ">>> Killing existing osmosisd processes..." +pkill osmosisd || true + +echo ">>> Killing existing rly processes..." +pkill rly || true + +rm -rf ./logs +mkdir ./logs + +# Entry point to run quasar_localnet.sh and osmosis_localnet.sh +./quasar_localnet.sh +sleep 5 +./osmosis_localnet.sh +sleep 5 + +# starting a relayer between the two +./setup_go_relayer.sh +sleep 20 + +# pre upgrade test +./pre_upgrade.sh + +# Define variables +CHAIN_ID=quasar +UPGRADE_HEIGHT=80 + +echo ">>> Sleeping 10 seconds to create some initial blocks" +sleep 5 + +# Submit governance proposal for software-upgrade to v2 +echo ">>> Submitting proposal for software-upgrade" +quasarnoded tx gov submit-proposal draft_proposal.json --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y --fees 100000uqsr --gas 1000000 + +echo ">>> Sleeping 10 seconds after submitting proposal" +sleep 6 + +echo ">>> Voting yes to proposal" +quasarnoded tx gov vote 1 yes --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y --fees 100000uqsr --gas 1000000 + +# Wait for the block height to reach 50, cosmovisor should handle the upgrade +echo ">>> Waiting for the block height to reach $UPGRADE_HEIGHT" +while true; do + CURRENT_HEIGHT=$(quasarnoded status | jq -r '.SyncInfo.latest_block_height') + echo "Current height: "$CURRENT_HEIGHT + if [ "$CURRENT_HEIGHT" -ge "$UPGRADE_HEIGHT" ]; then + break + fi + sleep 5 +done + +# Check if the upgrade has been successful +quasarnoded query gov proposal 1 --chain-id $CHAIN_ID --output json + +sleep 10 + +# Kill existing quasarnoded processes for new version to start +echo ">>> Killing existing quasarnoded processes..." +pkill quasarnoded || true + +quasard start --home $HOME/.quasarnode > ./logs/quasar_post_upgrade.log 2>&1 & + +sleep 10 +# run ibc send manually and monitor +./post_upgrade.sh \ No newline at end of file diff --git a/demos/vesting-schedule/README.md b/demos/vesting-schedule/README.md index 9ba0be58e..2a22acccf 100644 --- a/demos/vesting-schedule/README.md +++ b/demos/vesting-schedule/README.md @@ -44,7 +44,7 @@ distribution module. ## Query CLI command with pagination (optionals) ```bash -quasarnoded query qvesting spendable-balances (--limit 1) (--count-total) +quasard query qvesting spendable-balances (--limit 1) (--count-total) ``` ## Testing with standard account @@ -54,7 +54,7 @@ quasarnoded query qvesting spendable-balances (--limit 1) (--c To create a vesting account, you can use the following command: ```bash -quasarnoded tx qvesting create-vesting-account --from my_treasury --chain-id quasar --keyring-backend test +quasard tx qvesting create-vesting-account --from my_treasury --chain-id quasar --keyring-backend test ``` #### Querying vesting account information @@ -62,7 +62,7 @@ quasarnoded tx qvesting create-vesting-account +quasard query auth account ``` ----- @@ -74,42 +74,42 @@ create-vesting-account transaction with multi-sig accounts, follow these steps: Create multiple accounts to act as signers for the multi-sig transaction: ```bash -quasarnoded keys add signer1 --keyring-backend test -quasarnoded keys add signer2 --keyring-backend test -quasarnoded keys add signer3 --keyring-backend test +quasard keys add signer1 --keyring-backend test +quasard keys add signer2 --keyring-backend test +quasard keys add signer3 --keyring-backend test ``` Create a multi-sig account using the created signer accounts: ```bash -quasarnoded keys add multisig_account --multisig-threshold 2 --multisig "signer1,signer2,signer3" --keyring-backend test +quasard keys add multisig_account --multisig-threshold 2 --multisig "signer1,signer2,signer3" --keyring-backend test ``` Fund the multi-sig account and the signer accounts. ```bash -quasarnoded tx bank send 1000uqsr --from my_treasury --chain-id quasar --keyring-backend test +quasard tx bank send 1000uqsr --from my_treasury --chain-id quasar --keyring-backend test ``` Create a create-vesting-account transaction using the multi-sig account as the signer: ```bash -quasarnoded tx qvesting create-vesting-account --from multisig_account --chain-id quasar --keyring-backend test --generate-only > tx.json +quasard tx qvesting create-vesting-account --from multisig_account --chain-id quasar --keyring-backend test --generate-only > tx.json ``` Sign the transaction with each signer: ```bash -quasarnoded tx sign tx.json --from signer1 --multisig --chain-id quasar --keyring-backend test --output-document tx_signed1.json -quasarnoded tx sign tx.json --from signer2 --multisig --chain-id quasar --keyring-backend test --output-document tx_signed2.json -quasarnoded tx sign tx.json --from signer3 --multisig --chain-id quasar --keyring-backend test --output-document tx_signed3.json +quasard tx sign tx.json --from signer1 --multisig --chain-id quasar --keyring-backend test --output-document tx_signed1.json +quasard tx sign tx.json --from signer2 --multisig --chain-id quasar --keyring-backend test --output-document tx_signed2.json +quasard tx sign tx.json --from signer3 --multisig --chain-id quasar --keyring-backend test --output-document tx_signed3.json ``` Assemble the signatures and broadcast the transaction: ```bash -quasarnoded tx multisign tx.json multisig_account tx_signed1.json tx_signed2.json tx_signed3.json --chain-id quasar --keyring-backend test > tx_multisig.json -quasarnoded tx broadcast tx_multisig.json --chain-id quasar --keyring-backend test -y +quasard tx multisign tx.json multisig_account tx_signed1.json tx_signed2.json tx_signed3.json --chain-id quasar --keyring-backend test > tx_multisig.json +quasard tx broadcast tx_multisig.json --chain-id quasar --keyring-backend test -y ``` Verify the custom vesting account has been created successfully: ```bash -quasarnoded query auth account +quasard query auth account ``` ## Testing with Ledger Hardware Wallet @@ -120,29 +120,29 @@ Connect your Ledger device and ensure the Cosmos app is installed and running. Retrieve the Ledger account address and adding the key to the keyring: ```bash -quasarnoded keys add ledger_account --ledger +quasard keys add ledger_account --ledger ``` Fund the Ledger account. Create a create-vesting-account transaction using the Ledger account as the signer: ```bash -quasarnoded tx qvesting create-vesting-account --from ledger_account --chain-id quasar --keyring-backend test --generate-only > tx.json +quasard tx qvesting create-vesting-account --from ledger_account --chain-id quasar --keyring-backend test --generate-only > tx.json ``` Sign the transaction with the Ledger device: ```bash -quasarnoded tx sign tx.json --from ledger_account --chain-id quasar --keyring-backend test --output-document tx_signed.json +quasard tx sign tx.json --from ledger_account --chain-id quasar --keyring-backend test --output-document tx_signed.json ``` Broadcast the signed transaction: ```bash -quasarnoded tx broadcast tx_signed.json --chain-id quasar +quasard tx broadcast tx_signed.json --chain-id quasar ``` Verify the custom vesting account has been created successfully: ```bash -quasarnoded query auth account +quasard query auth account ``` By performing these tests, you can ensure that the x/qvesting module is compatible with multi-signature diff --git a/demos/vesting-schedule/quasar_localnet.sh b/demos/vesting-schedule/quasar_localnet.sh index c95a0a621..cd5e07bd5 100755 --- a/demos/vesting-schedule/quasar_localnet.sh +++ b/demos/vesting-schedule/quasar_localnet.sh @@ -4,7 +4,7 @@ ## However it will need some manual modifications before you start the chain to incorporate the custom fields. # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar MY_TREASURY="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" @@ -78,5 +78,5 @@ cat $HOME_QSR/config/genesis_original.json | echo "Starting the chain" $BINARY start --home $HOME_QSR > quasar.log 2>&1 & -echo "Sleeping 5 seconds to wait quasarnoded to be executed" +echo "Sleeping 5 seconds to wait quasard to be executed" sleep 5 diff --git a/demos/vesting-schedule/vesting_schedule_ledger.sh b/demos/vesting-schedule/vesting_schedule_ledger.sh index bb5bbc8a2..5f337cbc4 100755 --- a/demos/vesting-schedule/vesting_schedule_ledger.sh +++ b/demos/vesting-schedule/vesting_schedule_ledger.sh @@ -1,8 +1,8 @@ #!/bin/bash -# Kill existing quasarnoded processes -echo ">>> Killing existing quasarnoded processes..." -pkill quasarnoded || true +# Kill existing quasard processes +echo ">>> Killing existing quasard processes..." +pkill quasard || true # Entry point to run quasar_localnet.sh ./quasar_localnet.sh @@ -19,60 +19,60 @@ elif [ "$unamestr" = 'Darwin' ]; then fi # Use the my_treasury address created in quasar_localnet.sh -MY_TREASURY=$(quasarnoded keys show my_treasury -a --keyring-backend test) +MY_TREASURY=$(quasard keys show my_treasury -a --keyring-backend test) echo ">>> Add keys vester_continuous_ok and vester_continuous_ko for further vesting account creation" # Create vester accounts in the local node for testing -quasarnoded keys add vester_continuous_ok --keyring-backend test -VC_OK_ADDRESS=$(quasarnoded keys show vester_continuous_ok -a --keyring-backend test) +quasard keys add vester_continuous_ok --keyring-backend test +VC_OK_ADDRESS=$(quasard keys show vester_continuous_ok -a --keyring-backend test) echo ">>> Create multi-sig account using signer1, signer2, and signer3" -quasarnoded keys add multisig_account --multisig-threshold 2 --multisig "signer1,signer2,signer3" --keyring-backend test -SIGNER1_ADDRESS=$(quasarnoded keys show signer1 -a --ledger) -SIGNER2_ADDRESS=$(quasarnoded keys show signer2 -a --ledger) -SIGNER3_ADDRESS=$(quasarnoded keys show signer3 -a --ledger) -MULTISIG_ADDRESS=$(quasarnoded keys show multisig_account -a --keyring-backend test) +quasard keys add multisig_account --multisig-threshold 2 --multisig "signer1,signer2,signer3" --keyring-backend test +SIGNER1_ADDRESS=$(quasard keys show signer1 -a --ledger) +SIGNER2_ADDRESS=$(quasard keys show signer2 -a --ledger) +SIGNER3_ADDRESS=$(quasard keys show signer3 -a --ledger) +MULTISIG_ADDRESS=$(quasard keys show multisig_account -a --keyring-backend test) echo "Signer 1: $SIGNER1_ADDRESS" echo "Signer 2: $SIGNER2_ADDRESS" echo "Signer 3: $SIGNER3_ADDRESS" echo "Multisig: $MULTISIG_ADDRESS" echo ">>> Fund multisig and signer accounts" -quasarnoded tx bank send $MY_TREASURY $MULTISIG_ADDRESS 1000uqsr --from $MY_TREASURY --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $MY_TREASURY $MULTISIG_ADDRESS 1000uqsr --from $MY_TREASURY --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5/35 seconds to elapse 5/35 before querying multisig account" sleep 5 echo ">>> Create create-vesting-account transaction using multisig as the signer" -quasarnoded tx qvesting create-vesting-account $VC_OK_ADDRESS 1000uqsr $START_TIME_OK $END_TIME_OK --from $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --generate-only > tx.json +quasard tx qvesting create-vesting-account $VC_OK_ADDRESS 1000uqsr $START_TIME_OK $END_TIME_OK --from $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --generate-only > tx.json echo ">>> Sign the transaction with each signer" -quasarnoded tx sign tx.json --from signer1 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --ledger --output-document tx_signed1.json -quasarnoded tx sign tx.json --from signer2 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --ledger --output-document tx_signed2.json -quasarnoded tx sign tx.json --from signer3 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --ledger --output-document tx_signed3.json +quasard tx sign tx.json --from signer1 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --ledger --output-document tx_signed1.json +quasard tx sign tx.json --from signer2 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --ledger --output-document tx_signed2.json +quasard tx sign tx.json --from signer3 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --ledger --output-document tx_signed3.json echo ">>> Assemble the signatures and broadcast the transaction" -quasarnoded tx multisign tx.json multisig_account tx_signed1.json tx_signed2.json tx_signed3.json --chain-id $CHAIN_ID --keyring-backend test > tx_multisig.json -quasarnoded tx broadcast tx_multisig.json --chain-id $CHAIN_ID -y +quasard tx multisign tx.json multisig_account tx_signed1.json tx_signed2.json tx_signed3.json --chain-id $CHAIN_ID --keyring-backend test > tx_multisig.json +quasard tx broadcast tx_multisig.json --chain-id $CHAIN_ID -y echo ">>> Sleeping 30/35 seconds to elapse 30/35 before sending 500uqsr from Vester to MyTreasury" sleep 30 # Transfer vesting tokens from vester1 to vester2 before the time echo ">>> Testing OK accounts to be able to send vesting schedule tokens with amount 500uqsr that is half of vesting total" -quasarnoded tx bank send $VC_OK_ADDRESS $MY_TREASURY 500uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $VC_OK_ADDRESS $MY_TREASURY 500uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5 seconds after sending bank tx from OK case" sleep 5 echo ">>> Testing again OK account to NOT be able to send vesting schedule tokens with amount 250uqsr that is a quarter of vesting total and should be locked already" -quasarnoded tx bank send $VC_OK_ADDRESS $MY_TREASURY 250uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $VC_OK_ADDRESS $MY_TREASURY 250uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5 more seconds..." sleep 5 echo ">>> Expecting OK balances equals to 500uqsr" -quasarnoded query bank balances $VC_OK_ADDRESS +quasard query bank balances $VC_OK_ADDRESS # Remove all the generated .json filed related to transaction signatures rm -rf tx.json tx_signed1.json tx_signed2.json tx_signed3.json tx_multisig.json diff --git a/demos/vesting-schedule/vesting_schedule_multisig.sh b/demos/vesting-schedule/vesting_schedule_multisig.sh index a95c6cafd..d84c1e1e7 100755 --- a/demos/vesting-schedule/vesting_schedule_multisig.sh +++ b/demos/vesting-schedule/vesting_schedule_multisig.sh @@ -1,8 +1,8 @@ #!/bin/bash -# Kill existing quasarnoded processes -echo ">>> Killing existing quasarnoded processes..." -pkill quasarnoded || true +# Kill existing quasard processes +echo ">>> Killing existing quasard processes..." +pkill quasard || true # Entry point to run quasar_localnet.sh ./quasar_localnet.sh @@ -19,23 +19,23 @@ elif [ "$unamestr" = 'Darwin' ]; then fi # Use the my_treasury address created in quasar_localnet.sh -MY_TREASURY=$(quasarnoded keys show my_treasury -a --keyring-backend test) +MY_TREASURY=$(quasard keys show my_treasury -a --keyring-backend test) echo ">>> Add keys vester_continuous_ok and vester_continuous_ko for further vesting account creation" # Create vester accounts in the local node for testing -quasarnoded keys add vester_continuous_ok --keyring-backend test -VC_OK_ADDRESS=$(quasarnoded keys show vester_continuous_ok -a --keyring-backend test) +quasard keys add vester_continuous_ok --keyring-backend test +VC_OK_ADDRESS=$(quasard keys show vester_continuous_ok -a --keyring-backend test) echo ">>> Create signer1, signer2, and signer3 keys" -quasarnoded keys add signer1 --keyring-backend test -quasarnoded keys add signer2 --keyring-backend test -quasarnoded keys add signer3 --keyring-backend test +quasard keys add signer1 --keyring-backend test +quasard keys add signer2 --keyring-backend test +quasard keys add signer3 --keyring-backend test echo ">>> Create multi-sig account using signer1, signer2, and signer3" -quasarnoded keys add multisig_account --multisig-threshold 2 --multisig "signer1,signer2,signer3" --keyring-backend test -SIGNER1_ADDRESS=$(quasarnoded keys show signer1 -a --keyring-backend test) -SIGNER2_ADDRESS=$(quasarnoded keys show signer2 -a --keyring-backend test) -SIGNER3_ADDRESS=$(quasarnoded keys show signer3 -a --keyring-backend test) -MULTISIG_ADDRESS=$(quasarnoded keys show multisig_account -a --keyring-backend test) +quasard keys add multisig_account --multisig-threshold 2 --multisig "signer1,signer2,signer3" --keyring-backend test +SIGNER1_ADDRESS=$(quasard keys show signer1 -a --keyring-backend test) +SIGNER2_ADDRESS=$(quasard keys show signer2 -a --keyring-backend test) +SIGNER3_ADDRESS=$(quasard keys show signer3 -a --keyring-backend test) +MULTISIG_ADDRESS=$(quasard keys show multisig_account -a --keyring-backend test) echo "Signer 1: $SIGNER1_ADDRESS" echo "Signer 2: $SIGNER2_ADDRESS" echo "Signer 3: $SIGNER3_ADDRESS" @@ -43,41 +43,41 @@ echo "Multisig: $MULTISIG_ADDRESS" echo ">>> Fund multisig and signer accounts" -quasarnoded tx bank send $MY_TREASURY $MULTISIG_ADDRESS 1000uqsr --from $MY_TREASURY --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $MY_TREASURY $MULTISIG_ADDRESS 1000uqsr --from $MY_TREASURY --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5/35 seconds to elapse 5/35 before querying multisig account" sleep 5 echo ">>> Create create-vesting-account transaction using multisig as the signer" -quasarnoded tx qvesting create-vesting-account $VC_OK_ADDRESS 1000uqsr $START_TIME_OK $END_TIME_OK --from $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --generate-only > tx.json +quasard tx qvesting create-vesting-account $VC_OK_ADDRESS 1000uqsr $START_TIME_OK $END_TIME_OK --from $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --generate-only > tx.json echo ">>> Sign the transaction with each signer" -quasarnoded tx sign tx.json --from signer1 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --output-document tx_signed1.json -quasarnoded tx sign tx.json --from signer2 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --output-document tx_signed2.json -quasarnoded tx sign tx.json --from signer3 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --output-document tx_signed3.json +quasard tx sign tx.json --from signer1 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --output-document tx_signed1.json +quasard tx sign tx.json --from signer2 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --output-document tx_signed2.json +quasard tx sign tx.json --from signer3 --multisig $MULTISIG_ADDRESS --chain-id $CHAIN_ID --keyring-backend test --output-document tx_signed3.json echo ">>> Assemble the signatures and broadcast the transaction" -quasarnoded tx multisign tx.json multisig_account tx_signed1.json tx_signed2.json tx_signed3.json --chain-id $CHAIN_ID --keyring-backend test > tx_multisig.json -quasarnoded tx broadcast tx_multisig.json --chain-id $CHAIN_ID -y +quasard tx multisign tx.json multisig_account tx_signed1.json tx_signed2.json tx_signed3.json --chain-id $CHAIN_ID --keyring-backend test > tx_multisig.json +quasard tx broadcast tx_multisig.json --chain-id $CHAIN_ID -y echo ">>> Sleeping 30/35 seconds to elapse 35/35 before sending 500uqsr from Vester to MyTreasury" sleep 30 # Transfer vesting tokens from vester1 to vester2 before the time echo ">>> Testing OK accounts to be able to send vesting schedule tokens with amount 500uqsr that is half of vesting total" -quasarnoded tx bank send $VC_OK_ADDRESS $MY_TREASURY 500uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $VC_OK_ADDRESS $MY_TREASURY 500uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5 seconds after sending bank tx from OK case" sleep 5 echo ">>> Testing again OK account to NOT be able to send vesting schedule tokens with amount 250uqsr that is a quarter of vesting total and should be locked already" -quasarnoded tx bank send $VC_OK_ADDRESS $MY_TREASURY 250uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $VC_OK_ADDRESS $MY_TREASURY 250uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5 more seconds..." sleep 5 echo ">>> Expecting OK balances equals to 500uqsr" -quasarnoded query bank balances $VC_OK_ADDRESS +quasard query bank balances $VC_OK_ADDRESS # Remove all the generated .json filed related to transaction signatures rm -rf tx.json tx_signed1.json tx_signed2.json tx_signed3.json tx_multisig.json diff --git a/demos/vesting-schedule/vesting_schedule_standard.sh b/demos/vesting-schedule/vesting_schedule_standard.sh index d147b6ef0..c01464a3d 100755 --- a/demos/vesting-schedule/vesting_schedule_standard.sh +++ b/demos/vesting-schedule/vesting_schedule_standard.sh @@ -1,8 +1,8 @@ #!/bin/bash set -o xtrace -# Kill existing quasarnoded processes -echo ">>> Killing existing quasarnoded processes..." -pkill quasarnoded || true +# Kill existing quasard processes +echo ">>> Killing existing quasard processes..." +pkill quasard || true # Entry point to run quasar_localnet.sh ./quasar_localnet.sh @@ -23,54 +23,54 @@ elif [ "$unamestr" = 'Darwin' ]; then fi # Use the my_treasury address created in quasar_localnet.sh -MY_TREASURY=$(quasarnoded keys show my_treasury -a --keyring-backend test) +MY_TREASURY=$(quasard keys show my_treasury -a --keyring-backend test) echo ">>> Add keys vester_continuous_ok and vester_continuous_ko for further vesting account creation" # Create vester accounts in the local node for testing -quasarnoded keys add vester_continuous_ok --keyring-backend test -quasarnoded keys add vester_continuous_ko --keyring-backend test -VC_OK_ADDRESS=$(quasarnoded keys show vester_continuous_ok -a --keyring-backend test) -VC_KO_ADDRESS=$(quasarnoded keys show vester_continuous_ko -a --keyring-backend test) +quasard keys add vester_continuous_ok --keyring-backend test +quasard keys add vester_continuous_ko --keyring-backend test +VC_OK_ADDRESS=$(quasard keys show vester_continuous_ok -a --keyring-backend test) +VC_KO_ADDRESS=$(quasard keys show vester_continuous_ko -a --keyring-backend test) echo ">>> Creating OK accounts" # Create vesting account executing as my_treasury for vester_continuous_ok -quasarnoded tx qvesting create-vesting-account $VC_OK_ADDRESS 1000uqsr $START_TIME_OK $END_TIME_OK --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx qvesting create-vesting-account $VC_OK_ADDRESS 1000uqsr $START_TIME_OK $END_TIME_OK --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5/35 seconds to elapse 5/35 before querying accounts to check vesting balances and start times" sleep 5 echo ">>> Creating KO accounts" # Create vesting account executing as my_treasury for vester_continuous_ok -quasarnoded tx qvesting create-vesting-account $VC_KO_ADDRESS 1000uqsr $START_TIME_KO $END_TIME_KO --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx qvesting create-vesting-account $VC_KO_ADDRESS 1000uqsr $START_TIME_KO $END_TIME_KO --from my_treasury --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5/35 seconds to elapse 10/35 before querying accounts to check vesting balances and start times" sleep 5 # Check that the vesting account has been created successfully echo ">>> Query accounts" -quasarnoded query auth account $VC_OK_ADDRESS -quasarnoded query auth account $VC_KO_ADDRESS +quasard query auth account $VC_OK_ADDRESS +quasard query auth account $VC_KO_ADDRESS echo ">>> Sleeping 25/35 seconds to elapse 35/35 seconds" sleep 25 # Transfer vesting tokens from vester1 to vester2 before the time echo ">>> Testing OK accounts to be able to send vesting schedule tokens with amount 500uqsr that is half of vesting total" -quasarnoded tx bank send $VC_OK_ADDRESS $MY_TREASURY 500uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $VC_OK_ADDRESS $MY_TREASURY 500uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5 seconds after sending bank tx from OK case" #sleep 5 echo ">>> Testing again OK account to NOT be able to send vesting schedule tokens with amount 250uqsr that is a quarter of vesting total and should be locked already" -quasarnoded tx bank send $VC_OK_ADDRESS $MY_TREASURY 250uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $VC_OK_ADDRESS $MY_TREASURY 250uqsr --from vester_continuous_ok --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Testing KO accounts to be NOT able to send vesting schedule tokens, even 1 should fail as vesting is in the future" -quasarnoded tx bank send $VC_KO_ADDRESS $MY_TREASURY 1uqsr --from vester_continuous_ko --chain-id $CHAIN_ID --keyring-backend test -y +quasard tx bank send $VC_KO_ADDRESS $MY_TREASURY 1uqsr --from vester_continuous_ko --chain-id $CHAIN_ID --keyring-backend test -y echo ">>> Sleeping 5 seconds..." sleep 5 echo ">>> Expecting OK balances equals to 500uqsr" -quasarnoded query bank balances $VC_OK_ADDRESS +quasard query bank balances $VC_OK_ADDRESS echo ">>> Expecting balances equals to 1000uqsr" -quasarnoded query bank balances $VC_KO_ADDRESS +quasard query bank balances $VC_KO_ADDRESS diff --git a/demos/wasm/README.md b/demos/wasm/README.md index 824cf466c..4ab9b2d16 100644 --- a/demos/wasm/README.md +++ b/demos/wasm/README.md @@ -5,8 +5,8 @@ This demo tutorial shows deployment of a wasm smart contract. ## Setup We need to setup the CLI: in the root directory of the repository run -``` go install -mod=readonly ./cmd/quasarnoded/``` -now we can use quasarnoded on the commandline to interact with the wasm module +``` go install -mod=readonly ./cmd/quasard/``` +now we can use quasard on the commandline to interact with the wasm module Now we need an optimized contract to upload and interact with. With this demo, we bundled the name service contract First we compile the contract, from `wasm/nameservice` run @@ -23,9 +23,9 @@ List all wasm bytecodes on chain: And we have show of life! Lets upload a contract, running from the `wasm` dir -``` quasarnoded tx wasm store ./nameservice/artifacts/cw_nameservice.wasm --from alice --gas auto``` +``` quasard tx wasm store ./nameservice/artifacts/cw_nameservice.wasm --from alice --gas auto``` rerunning the list command: -```quasarnoded query wasm list-code --node http://0.0.0.0:26657``` +```quasard query wasm list-code --node http://0.0.0.0:26657``` We now see our created contract and instantiate it. -```quasarnoded tx wasm instantiate 1 {} --label test --no-admin --from alice``` \ No newline at end of file +```quasard tx wasm instantiate 1 {} --label test --no-admin --from alice``` \ No newline at end of file diff --git a/go.mod b/go.mod index a45becace..676d50678 100644 --- a/go.mod +++ b/go.mod @@ -1,79 +1,96 @@ -module github.com/quasarlabs/quasarnode +module github.com/quasar-finance/quasar -go 1.21 +go 1.22.5 require ( - cosmossdk.io/api v0.3.1 + cosmossdk.io/api v0.7.5 + cosmossdk.io/client/v2 v2.0.0-beta.3 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 - github.com/CosmWasm/wasmd v0.45.0 - github.com/CosmWasm/wasmvm v1.5.2 - github.com/cometbft/cometbft v0.37.6 - github.com/cometbft/cometbft-db v0.11.0 + cosmossdk.io/store v1.1.0 + cosmossdk.io/tools/confix v0.1.2 + cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/tx v0.13.4 + cosmossdk.io/x/upgrade v0.1.4 + github.com/CosmWasm/wasmd v0.53.0 + github.com/CosmWasm/wasmvm/v2 v2.1.2 + github.com/cometbft/cometbft v0.38.11 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.47.12 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1 - github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-ibc-go-v7.3-wasmvm-v1.5 - github.com/cosmos/ibc-go/v7 v7.4.0 - github.com/gogo/protobuf v1.3.2 + 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-apps/modules/async-icq/v8 v8.0.0 + github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240806223953-bfecb68c04c1 + github.com/cosmos/ibc-apps/modules/rate-limiting/v8 v8.0.0 + github.com/cosmos/ibc-go/modules/capability v1.0.1 + github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72 + github.com/cosmos/ibc-go/v8 v8.4.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 - github.com/golangci/golangci-lint v1.59.1 - github.com/gorilla/mux v1.8.0 + github.com/golangci/golangci-lint v1.60.2 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cast v1.6.0 + github.com/skip-mev/feemarket v1.0.4 + github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de - google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 - gopkg.in/yaml.v2 v2.4.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f + google.golang.org/grpc v1.64.1 + google.golang.org/protobuf v1.34.2 +) + +require ( + cosmossdk.io/x/circuit v0.1.1 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect + github.com/google/flatbuffers v1.12.1 // indirect ) require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect - cloud.google.com/go v0.112.0 // indirect - cloud.google.com/go/compute v1.24.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.6 // indirect - cloud.google.com/go/storage v1.36.0 // indirect - cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.1 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.8.1 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect + cloud.google.com/go/compute/metadata v0.5.0 // indirect + cloud.google.com/go/iam v1.1.12 // indirect + cloud.google.com/go/storage v1.41.0 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/depinject v1.0.0 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/4meepo/tagalign v1.3.4 // indirect - // github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect + github.com/99designs/keyring v1.2.2 // indirect github.com/Abirdcfly/dupword v0.0.14 // indirect github.com/Antonboom/errname v0.1.13 // indirect github.com/Antonboom/nilnil v0.1.9 // indirect - github.com/Antonboom/testifylint v1.3.1 // indirect - github.com/BurntSushi/toml v1.4.0 // indirect - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/Crocmagnon/fatcontext v0.2.2 // indirect - github.com/DataDog/zstd v1.5.0 // indirect + github.com/Antonboom/testifylint v1.4.3 // indirect + github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect + github.com/Crocmagnon/fatcontext v0.4.0 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect github.com/alecthomas/go-check-sumtype v0.1.4 // indirect github.com/alexkohler/nakedret/v2 v2.0.4 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect - github.com/armon/go-metrics v0.4.1 github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.1.1 // indirect - github.com/aws/aws-sdk-go v1.44.203 // indirect + github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/bkielbasa/cyclop v1.2.1 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v4 v4.2.1 // indirect + github.com/bombsimon/wsl/v4 v4.4.1 // indirect github.com/breml/bidichk v0.2.7 // indirect github.com/breml/errchkjson v0.3.6 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect @@ -82,41 +99,41 @@ require ( github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/ckaznocha/intrange v0.1.2 // 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/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/coinbase/rosetta-sdk-go v0.7.9 // indirect - github.com/confio/ics23/go v0.9.0 // indirect + github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect + github.com/cometbft/cometbft-db v0.14.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.20.1 // indirect + github.com/cosmos/iavl v1.2.0 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect + github.com/creachadair/atomicfile v0.3.3 // indirect + github.com/creachadair/tomledit v0.0.26 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/daixiang0/gci v0.13.4 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/denis-tingaikin/go-header v0.5.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/ristretto v0.1.1 // indirect - github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/distribution/reference v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/dvsekhvalnov/jose2go v1.7.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.17.0 // indirect github.com/fatih/structtag v1.2.0 // indirect @@ -124,13 +141,13 @@ require ( github.com/firefart/nonamedreturns v1.0.5 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/ghostiam/protogetter v0.3.6 // indirect github.com/go-critic/go-critic v0.11.4 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect @@ -143,13 +160,14 @@ require ( github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gofrs/flock v0.8.1 // indirect + github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/gogo/protobuf v1.3.2 + github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect - github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect + github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 // indirect github.com/golangci/misspell v0.6.0 // indirect github.com/golangci/modinfo v0.3.4 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect @@ -157,46 +175,51 @@ require ( github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/gofuzz v1.2.0 // indirect + github.com/google/gofuzz v1.2.0 github.com/google/orderedcode v0.0.1 // indirect - github.com/google/s2a-go v0.1.7 // indirect + github.com/google/s2a-go v0.1.8 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // 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 + 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 v0.5.5-0.20210104140557-80c98217689d // 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/hexops/gotextdiff v1.0.3 // 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 github.com/jgautheron/goconst v1.7.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect - github.com/jjti/go-spancheck v0.6.1 // indirect + github.com/jjti/go-spancheck v0.6.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/julz/importas v0.1.0 // indirect github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect github.com/kisielk/errcheck v1.7.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kulti/thelper v0.6.3 // indirect @@ -207,8 +230,7 @@ require ( github.com/ldez/tagliatelle v0.5.0 // indirect github.com/leonklingele/grouper v1.1.2 // 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.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/lufeee/execinquery v1.2.1 // indirect github.com/macabu/inamedparam v0.1.3 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -219,42 +241,42 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mgechev/revive v1.3.7 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect + github.com/mgechev/revive v1.3.9 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moricho/tparallel v0.3.1 // indirect + github.com/moricho/tparallel v0.3.2 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.16.2 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/polyfloyd/go-errorlint v1.5.2 // indirect - github.com/prometheus/client_golang v1.16.0 - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/polyfloyd/go-errorlint v1.6.0 // indirect + github.com/prometheus/client_golang v1.20.1 + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/quasilyte/go-ruleguard v0.4.2 // indirect github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.4.2 // 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/ryancurrah/gomodguard v1.3.2 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/ryancurrah/gomodguard v1.3.3 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect @@ -262,36 +284,36 @@ require ( github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.26.0 // indirect - github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 // indirect + github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect + github.com/securego/gosec/v2 v2.20.1-0.20240820084340-81cda2f91fbe // indirect + github.com/shamaton/msgpack/v2 v2.2.0 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect - github.com/sivchari/tenv v1.7.1 // indirect + github.com/sivchari/tenv v1.10.0 // indirect github.com/sonatard/noctx v0.0.2 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.18.2 // indirect + github.com/spf13/viper v1.19.0 github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tetafro/godot v1.4.16 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect - github.com/tomarrell/wrapcheck/v2 v2.8.3 // indirect + github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.1.1 // indirect - github.com/uudashr/gocognit v1.1.2 // indirect + github.com/uudashr/gocognit v1.1.3 // indirect github.com/xen0n/gosmopolitan v1.2.2 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.3.0 // indirect @@ -300,40 +322,39 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.12.2 // indirect - go-simpler.org/sloglint v0.7.1 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go-simpler.org/sloglint v0.7.2 // indirect + go.etcd.io/bbolt v1.3.10 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/otel/trace v1.22.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect + go.opentelemetry.io/otel v1.26.0 // indirect + go.opentelemetry.io/otel/metric v1.26.0 // indirect + go.opentelemetry.io/otel/trace v1.26.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect - go.uber.org/multierr v1.9.0 // indirect + go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - //golang.org/x/crypto v0.12.0 // indirect - //golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb // indirect - golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/oauth2 v0.17.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/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect - google.golang.org/api v0.162.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect + golang.org/x/mod v0.20.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.23.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.24.0 // indirect + google.golang.org/api v0.192.0 // indirect + google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.4.7 // indirect - mvdan.cc/gofumpt v0.6.0 // indirect + gotest.tools/v3 v3.5.1 // indirect + honnef.co/go/tools v0.5.1 // indirect + mvdan.cc/gofumpt v0.7.0 // indirect mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v1.1.0 // indirect @@ -351,10 +372,14 @@ require ( replace ( // Use cosmos keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + // github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // following versions might cause unexpected behavior github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 +// github.com/cosmos/ibc-go/modules/light-clients/08-wasm => github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092650-57fcdb9a9a9d - // stick with compatible version or x/exp in v0.47.x line - // x/exp had a breaking change in further commits - golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb +// stick with compatible version or x/exp in v0.47.x line +// x/exp had a breaking change in further commits +// golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb ) + +exclude github.com/gogo/protobuf v1.3.3 diff --git a/go.sum b/go.sum index 69b1a9f93..07fa5d4e1 100644 --- a/go.sum +++ b/go.sum @@ -5,13 +5,11 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -36,8 +34,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.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= -cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= +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= @@ -52,6 +50,10 @@ 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.8.1 h1:QZW9FjC5lZzN864p13YxvAtGUlQ+KgRL+8Sg45Z6vxo= +cloud.google.com/go/auth v0.8.1/go.mod h1:qGVp/Y3kDRSDZ5gFD/XPUfYQ9xW1iI7q8RIRoCyBbJc= +cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= +cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -61,7 +63,6 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= @@ -75,10 +76,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 v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= -cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +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= @@ -116,8 +115,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.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.12 h1:JixGLimRrNGcxvJEQ8+clfLxPlbeZA6MuRJ+qJNQ5Xw= +cloud.google.com/go/iam v1.1.12/go.mod h1:9LDX8J7dN5YRyzVHxwQzrQs9opFFqn0Mxs9nAeB+Hhg= 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= @@ -178,8 +177,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= -cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RBx0= +cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -191,26 +190,43 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= -cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -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/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.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= +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.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/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= -git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= +cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f h1:p/pez1Q7Xwh9AiHWMA0uHxsB+XpReABHr6xCyMWdDAg= +cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f/go.mod h1:kzkqn95F9UonJTmjS+aydreXxsWiaGKe/b4HxHZvwHM= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +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/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.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= github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8= github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -221,32 +237,28 @@ github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHO github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns= github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ= github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ= -github.com/Antonboom/testifylint v1.3.1 h1:Uam4q1Q+2b6H7gvk9RQFw6jyVDdpzIirFOOrbs14eG4= -github.com/Antonboom/testifylint v1.3.1/go.mod h1:NV0hTlteCkViPW9mSR4wEMfwp+Hs1T3dY60bkvSfhpM= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Antonboom/testifylint v1.4.3 h1:ohMt6AHuHgttaQ1xb6SSnxCeK4/rnK7KKzbvs7DmEck= +github.com/Antonboom/testifylint v1.4.3/go.mod h1:+8Q9+AOLsz5ZiQiiYujJKs9mNz398+M6UgslP4qgJLA= +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/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= -github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= -github.com/CosmWasm/wasmd v0.45.0 h1:9zBqrturKJwC2kVsfHvbrA++EN0PS7UTXCffCGbg6JI= -github.com/CosmWasm/wasmd v0.45.0/go.mod h1:RnSAiqbNIZu4QhO+0pd7qGZgnYAMBPGmXpzTADag944= -github.com/CosmWasm/wasmvm v1.5.2 h1:+pKB1Mz9GZVt1vadxB+EDdD1FOz3dMNjIKq/58/lrag= -github.com/CosmWasm/wasmvm v1.5.2/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= -github.com/Crocmagnon/fatcontext v0.2.2 h1:OrFlsDdOj9hW/oBEJBNSuH7QWf+E9WPVHw+x52bXVbk= -github.com/Crocmagnon/fatcontext v0.2.2/go.mod h1:WSn/c/+MMNiD8Pri0ahRj0o9jVpeowzavOQplBJw6u0= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/CosmWasm/wasmd v0.53.0 h1:kdaoAi20bIb4VCsxw9pRaT2g5PpIp82Wqrr9DRVN9ao= +github.com/CosmWasm/wasmd v0.53.0/go.mod h1:FJl/aWjdpGof3usAMFQpDe07Rkx77PUzp0cygFMOvtw= +github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20= +github.com/CosmWasm/wasmvm/v2 v2.1.2/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= +github.com/Crocmagnon/fatcontext v0.4.0 h1:4ykozu23YHA0JB6+thiuEv7iT6xq995qS1vcuWZq0tg= +github.com/Crocmagnon/fatcontext v0.4.0/go.mod h1:ZtWrXkgyfsYPzS6K3O88va6t2GEglG93vnII/F94WC0= +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.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo= -github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 h1:sATXp1x6/axKxz2Gjxv8MALP0bXaNRfQinEwyfMcx8c= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0/go.mod h1:Nl76DrGNJTA1KJ0LePKBw/vznBX1EHbAZX8mwjR82nI= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= @@ -254,22 +266,16 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= 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/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= 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/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= @@ -287,17 +293,11 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/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-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= @@ -307,18 +307,9 @@ github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvx github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= -github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= +github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -330,51 +321,30 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJY= github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bombsimon/wsl/v4 v4.2.1 h1:Cxg6u+XDWff75SIFFmNsqnIOgob+Q9hG6y/ioKbRFiM= -github.com/bombsimon/wsl/v4 v4.2.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= +github.com/bombsimon/wsl/v4 v4.4.1 h1:jfUaCkN+aUpobrMO24zwyAMwMAV5eSziCkOKEauOLdw= +github.com/bombsimon/wsl/v4 v4.4.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= -github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= -github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= -github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= -github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA= github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= @@ -386,12 +356,10 @@ 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/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.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= @@ -412,7 +380,6 @@ github.com/ckaznocha/intrange v0.1.2 h1:3Y4JAxcMntgb/wABQ6e8Q8leMd26JbX2790lIss9 github.com/ckaznocha/intrange v0.1.2/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -422,143 +389,131 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/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/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= -github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= -github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.6 h1:2BSD0lGPbcIyRd99Pf1zH0Sa8o0pbfqVWEDbZ4Ec2Uc= -github.com/cometbft/cometbft v0.37.6/go.mod h1:5FRkFil9uagHZogIX9x8z51c3GIPpQmdIN8Mq46HfzY= -github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= -github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= +github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= +github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= +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.14.0 h1:dKnK/tQL8BwciH6SgFEuZxwKupMokR4NlwYfJWy7C48= +github.com/cometbft/cometbft-db v0.14.0/go.mod h1:JOXKwjrxS/MW5qJ1xuVpELa8HGBVgHpgI+t8j0L0JEo= 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= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +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.47.12 h1:KOZHAVWrcilHywBN/FabBaXbDFMzoFmtdX0hqy5Ory8= -github.com/cosmos/cosmos-sdk v0.47.12/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= 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.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= -github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1 h1:02RCbih5lQ8aGdDMSvxhTnk5JDLEDitn17ytEE1Qhko= -github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1/go.mod h1:LvVkEXTORVgd87W2Yu7ZY3acKKeTMq/txdTworn8EZI= -github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-ibc-go-v7.3-wasmvm-v1.5 h1:sMoHjep+KInjMrppNCEutMVm1p8nI9WhKCuMQ+EcUHw= -github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-ibc-go-v7.3-wasmvm-v1.5/go.mod h1:VR2Hg2i/X1bafbmmNsV2Khwsg0PzNeuWoVKmSN5dAwo= -github.com/cosmos/ibc-go/v7 v7.4.0 h1:8FqYMptvksgMvlbN4UW9jFxTXzsPyfAzEZurujXac8M= -github.com/cosmos/ibc-go/v7 v7.4.0/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo= +github.com/cosmos/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.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-apps/modules/async-icq/v8 v8.0.0 h1:nKP2+Rzlz2iyvTosY5mvP+aEBPe06oaDl3G7xLGBpNI= +github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0/go.mod h1:D3Q380FpWRFtmUQWLosPxachi6w24Og2t5u/Tww5wtY= +github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240806223953-bfecb68c04c1 h1:/EFk6eBaZlXi79l4qTtIkPWGOVqxQqftg1OJpW3UMkg= +github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240806223953-bfecb68c04c1/go.mod h1:9+Z14xz3Y+5uEn5i1CvLcDN1aTthEhYUdI7pphySkY8= +github.com/cosmos/ibc-apps/modules/rate-limiting/v8 v8.0.0 h1:AQO9NIAP3RFqvBCj7IqM/V1LCxmuvcvGUdu0RIEz/c0= +github.com/cosmos/ibc-apps/modules/rate-limiting/v8 v8.0.0/go.mod h1:/ZpKJSW/SKPkFS7jTqkPVn7kOHUUfRNzu+8aS7YOL8o= +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/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72 h1:QjCi4bJoy9AXLL1e4jqi+4rHYN0gGZAQxf937cdWhw4= +github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72/go.mod h1:yiulzyQAZ+Ci802z/kVQqTA3lGiSJOmDpTq7kZxOUNE= +github.com/cosmos/ibc-go/v8 v8.4.0 h1:K2PfX0AZ+1XKZytHGEMuSjQXG/MZshPb83RSTQt2+cE= +github.com/cosmos/ibc-go/v8 v8.4.0/go.mod h1:zh6x1osR0hNvEcFrC/lhGD08sMfQmr9wHVvZ/mRWMCs= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/creachadair/atomicfile v0.3.3 h1:yJlDq8qk9QmD/6ol+jq1X4bcoLNVdYq95+owOnauziE= +github.com/creachadair/atomicfile v0.3.3/go.mod h1:X1r9P4wigJlGkYJO1HXZREdkVn+b1yHrsBBMLSj7tak= +github.com/creachadair/mtest v0.0.0-20231015022703-31f2ea539dce h1:BFjvg2Oq88/2DOcUFu1ScIwKUn7KJYYvLr6AeuCJD54= +github.com/creachadair/mtest v0.0.0-20231015022703-31f2ea539dce/go.mod h1:okn1ft6DY+qjPmnvYynyq7ufIQKJ2x2qwOCJZecei1k= +github.com/creachadair/tomledit v0.0.26 h1:MoDdgHIHZ5PctBVsAZDjxdxreWUEa9ObPKTRkk5PPwA= +github.com/creachadair/tomledit v0.0.26/go.mod h1:SJi1OxKpMyR141tq1lzsbPtIg3j8TeVPM/ZftfieD7o= 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/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/daixiang0/gci v0.13.4 h1:61UGkmpoAcxHM2hhNkZEf5SzwQtWJXTSws7jaPyqwlw= github.com/daixiang0/gci v0.13.4/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= +github.com/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= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= 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/ristretto v0.0.3/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= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= -github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.7.0 h1:bnQc8+GMnidJZA8zc6lLEAb4xNrIqHwO+9TzqvtQZPo= +github.com/dvsekhvalnov/jose2go v1.7.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -570,9 +525,6 @@ 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/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= -github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -581,13 +533,10 @@ github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= 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= @@ -600,11 +549,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghostiam/protogetter v0.3.6 h1:R7qEWaSgFCsy20yYHNIJsU9ZOb8TziSRRxuAOTVKeOk= github.com/ghostiam/protogetter v0.3.6/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw= @@ -613,18 +559,19 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-critic/go-critic v0.11.4 h1:O7kGOCx0NDIni4czrkRIXTnit0mkyKOCePh3My6OyEU= github.com/go-critic/go-critic v0.11.4/go.mod h1:2QAdo4iuLik5S9YG0rT4wcZ8QxwHYkrr6/2MWAiv/vc= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -633,13 +580,10 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= 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= @@ -650,9 +594,9 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= +github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= @@ -681,10 +625,12 @@ github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80 github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= @@ -692,9 +638,8 @@ github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG 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/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= 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= @@ -705,12 +650,9 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +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/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= @@ -753,11 +695,10 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= -github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= -github.com/golangci/golangci-lint v1.59.1 h1:CRRLu1JbhK5avLABFJ/OHVSQ0Ie5c4ulsOId1h3TTks= -github.com/golangci/golangci-lint v1.59.1/go.mod h1:jX5Oif4C7P0j9++YB2MMJmoNrb01NJ8ITqKWNLewThg= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= +github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME= +github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE= +github.com/golangci/golangci-lint v1.60.2 h1:Y8aWnZCMOLY5T7Ga5hcoemyKsZZJCUmIIK3xTD3jIhc= +github.com/golangci/golangci-lint v1.60.2/go.mod h1:4UvjLpOJoQSvmyWkmO1urDR3txhL9R9sn4oM/evJ95g= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= @@ -772,7 +713,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.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +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= @@ -792,7 +734,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= @@ -800,8 +741,8 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -818,15 +759,13 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= 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/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= +github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -844,22 +783,21 @@ 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.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= +github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= 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/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= @@ -874,37 +812,36 @@ github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= 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.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.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/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/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/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.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.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= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -912,8 +849,9 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -922,28 +860,32 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/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= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +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/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= 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.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/orderedmap v0.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= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -951,32 +893,17 @@ github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPt github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -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/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jjti/go-spancheck v0.6.1 h1:ZK/wE5Kyi1VX3PJpUO2oEgeoI4FWOUm7Shb2Gbv5obI= -github.com/jjti/go-spancheck v0.6.1/go.mod h1:vF1QkOO159prdo6mHRxak2CpzDpHAfKiPUDP/NeRnX8= +github.com/jjti/go-spancheck v0.6.2 h1:iYtoxqPMzHUPp7St+5yA8+cONdyXD3ug6KK15n7Pklk= +github.com/jjti/go-spancheck v0.6.2/go.mod h1:+X7lvIrR5ZdUTkxFYqzJ0abr8Sb5LOo80uOhWNqIrYA= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -986,7 +913,6 @@ github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -996,15 +922,11 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym7fCjIP8RPos= github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -1015,22 +937,15 @@ github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.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.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.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= @@ -1041,43 +956,34 @@ github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= +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/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/lasiar/canonicalheader v1.1.1 h1:wC+dY9ZfiqiPwAexUApFush/csSPXeIi4QqyxXmng8I= github.com/lasiar/canonicalheader v1.1.1/go.mod h1:cXkb3Dlk6XXy+8MVQnF23CYKWlyA7kfQhSw2CcZtZb0= github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg= github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 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.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= -github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= -github.com/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/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= @@ -1088,18 +994,13 @@ github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2 github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -1107,22 +1008,14 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 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/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= -github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA= +github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A= +github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -1136,11 +1029,8 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= 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/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= 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= @@ -1148,20 +1038,18 @@ 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/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA= -github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= +github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= +github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= 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= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -1169,7 +1057,6 @@ 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/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= @@ -1180,9 +1067,12 @@ github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5n github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +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= @@ -1192,14 +1082,13 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.17.3 h1:oJcvKpIb7/8uLpDDtnQuf18xVnwKp8DTD7DQ6gTd/MU= -github.com/onsi/ginkgo/v2 v2.17.3/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= +github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= -github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1210,7 +1099,6 @@ github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJ 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= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= @@ -1229,18 +1117,13 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/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= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -1251,12 +1134,11 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.5.2 h1:SJhVik3Umsjh7mte1vE0fVZ5T1gznasQG3PV7U5xFdA= -github.com/polyfloyd/go-errorlint v1.5.2/go.mod h1:sH1QC1pxxi0fFecsVIzBmxtrgd9IF/SkJpA6wqyKAJs= +github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg8/OwcYY= +github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= @@ -1266,35 +1148,32 @@ 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.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/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= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= 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.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +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.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs= github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= @@ -1310,11 +1189,9 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1325,13 +1202,12 @@ 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/ryancurrah/gomodguard v1.3.2 h1:CuG27ulzEB1Gu5Dk5gP8PFxSOZ3ptSdP5iI/3IXxM18= -github.com/ryancurrah/gomodguard v1.3.2/go.mod h1:LqdemiFomEjcxOqirbQCb3JFvSxH2JUYMerTFd3sF2o= +github.com/ryancurrah/gomodguard v1.3.3 h1:eiSQdJVNr9KTNxY2Niij8UReSwR8Xrte3exBrAZfqpg= +github.com/ryancurrah/gomodguard v1.3.3/go.mod h1:rsKQjj4l3LXe8N344Ow7agAy5p9yjsWOtRzUMYmA0QY= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -1348,18 +1224,15 @@ github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71e github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.26.0 h1:LONR2hNVKxRmzIrZR0PhSF3mhCAzvnr+DcUiHgREfXE= -github.com/sashamelentyev/usestdlibvars v1.26.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= +github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= +github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 h1:rnO6Zp1YMQwv8AyxzuwsVohljJgp4L0ZqiCgtACsPsc= -github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9/go.mod h1:dg7lPlu/xK/Ut9SedURCoZbVCR4yC7fM65DtH9/CDHs= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/securego/gosec/v2 v2.20.1-0.20240820084340-81cda2f91fbe h1:exdneYmXwZ4+VaIWv9mQ47uIHkTQSN50DYdCjXJ1cdQ= +github.com/securego/gosec/v2 v2.20.1-0.20240820084340-81cda2f91fbe/go.mod h1:iyeMMRw8QEmueUSZ2VqmkQMiDyDcobfPnG00CV/NWdE= +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/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -1371,8 +1244,12 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= -github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= -github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= +github.com/sivchari/tenv v1.10.0 h1:g/hzMA+dBCKqGXgW8AV/1xIWhAvDrx0zFKNR48NFMg0= +github.com/sivchari/tenv v1.10.0/go.mod h1:tdY24masnVoZFxYrHv/nD6Tc8FbkEtAQEEziXpyMgqY= +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.4 h1:OPZ9D0tlDUa55n+HIjE2DgL+geMOwcDwUXTYdz4ig9Y= +github.com/skip-mev/feemarket v1.0.4/go.mod h1:lszt7zGEEActbDYq1hOKogQvfCsnLEHH5113LwgmYcE= 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= @@ -1384,29 +1261,20 @@ github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIK github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= 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.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +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/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1418,7 +1286,6 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1426,6 +1293,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -1435,8 +1303,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= 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/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= -github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk= github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= @@ -1447,34 +1313,23 @@ github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpR github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0= github.com/tetafro/godot v1.4.16/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck/v2 v2.8.3 h1:5ov+Cbhlgi7s/a42BprYoxsr73CbdMUTzE3bRDFASUs= -github.com/tomarrell/wrapcheck/v2 v2.8.3/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= +github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/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.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= 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= @@ -1484,23 +1339,13 @@ github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/ github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= 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/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= -github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= +github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= +github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= -github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+YcPQN+mW4= github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= @@ -1522,11 +1367,11 @@ go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= go-simpler.org/musttag v0.12.2 h1:J7lRc2ysXOq7eM8rwaTYnNrHd5JwjppzB6mScysB2Cs= go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM= -go-simpler.org/sloglint v0.7.1 h1:qlGLiqHbN5islOxjeLXoPtUdZXb669RW+BDQ+xOSNoU= -go-simpler.org/sloglint v0.7.1/go.mod h1:OlaVDRh/FKKd4X4sIMbsz8st97vomydceL146Fthh/c= +go-simpler.org/sloglint v0.7.2 h1:Wc9Em/Zeuu7JYpl+oKoYOsQSy2X560aVueCW/m6IijY= +go-simpler.org/sloglint v0.7.2/go.mod h1:US+9C80ppl7VsThQclkM7BkCHQAzuz8kHLsW3ppuluo= 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.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= 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= @@ -1539,69 +1384,75 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0/go.mod h1:27iA5uvhuRNmalO+iEUdVn5ZMj2qy10Mm+XRIpRmyuU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0gNihqu9iosIZ5SkBbWo5T8JhhLJFMQL1qmLI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc= +go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= +go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= +go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= +go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= +go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 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/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +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/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -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-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -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/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +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= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1614,8 +1465,12 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -1627,10 +1482,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -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/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +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= @@ -1668,18 +1521,15 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/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-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1697,8 +1547,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.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= @@ -1724,8 +1574,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.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= -golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= +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= @@ -1741,8 +1591,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.1.0/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= @@ -1751,21 +1601,19 @@ 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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-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= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1773,7 +1621,6 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1793,7 +1640,6 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1804,11 +1650,8 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1818,11 +1661,12 @@ 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-20210816183151-1e6c022a8912/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= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1840,7 +1684,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1852,17 +1695,16 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.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/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +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.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.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= @@ -1872,29 +1714,25 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.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= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1904,8 +1742,10 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1917,11 +1757,11 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1957,14 +1797,13 @@ 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.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.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= @@ -1972,14 +1811,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -2029,8 +1863,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.162.0 h1:Vhs54HkaEpkMBdgGdOT2P6F0csGG/vxDS0hWHJzmmps= -google.golang.org/api v0.162.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= +google.golang.org/api v0.192.0 h1:PljqpNAfZaaSpS+TnANfnNAXKdzHM/B9bKhwRlo7JP0= +google.golang.org/api v0.192.0/go.mod h1:9VcphjvAxPKLmSxVSzPlSRXy/5ARMEw5bf58WoVXafQ= 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= @@ -2039,8 +1873,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -2048,7 +1880,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -2056,7 +1887,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= @@ -2149,12 +1979,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-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf h1:OqdXDEakZCVtDiZTjcxfwbHPCT11ycCEsTKesBVKvyY= +google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:mCr1K1c8kX+1iSBREvU3Juo11CB+QOEWxbRS01wWl5M= +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-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/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= @@ -2196,8 +2026,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.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= 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= @@ -2214,8 +2044,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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/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= @@ -2230,12 +2060,9 @@ 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/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -2251,8 +2078,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2263,11 +2088,10 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs= -honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= -mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= -mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA= +honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= +honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= +mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= +mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= @@ -2275,10 +2099,8 @@ nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0 pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/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/osmosis/epochs/types/genesis.pb.go b/osmosis/epochs/types/genesis.pb.go deleted file mode 100644 index 67d7e4197..000000000 --- a/osmosis/epochs/types/genesis.pb.go +++ /dev/null @@ -1,824 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/epochs/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// EpochInfo is a struct that describes the data going into -// a timer defined by the x/epochs module. -type EpochInfo struct { - // identifier is a unique reference to this particular timer. - Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` - // start_time is the time at which the timer first ever ticks. - // If start_time is in the future, the epoch will not begin until the start - // time. - StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` - // duration is the time in between epoch ticks. - // In order for intended behavior to be met, duration should - // be greater than the chains expected block time. - // Duration must be non-zero. - Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` - // current_epoch is the current epoch number, or in other words, - // how many times has the timer 'ticked'. - // The first tick (current_epoch=1) is defined as - // the first block whose blocktime is greater than the EpochInfo start_time. - CurrentEpoch int64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` - // current_epoch_start_time describes the start time of the current timer - // interval. The interval is (current_epoch_start_time, - // current_epoch_start_time + duration] When the timer ticks, this is set to - // current_epoch_start_time = last_epoch_start_time + duration only one timer - // tick for a given identifier can occur per block. - // - // NOTE! The current_epoch_start_time may diverge significantly from the - // wall-clock time the epoch began at. Wall-clock time of epoch start may be - // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, - // duration = 5. Suppose the chain goes offline at t=14, and comes back online - // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) - // * The t=30 block will start the epoch for (10, 15] - // * The t=31 block will start the epoch for (15, 20] - // * The t=32 block will start the epoch for (20, 25] - // * The t=33 block will start the epoch for (25, 30] - // * The t=34 block will start the epoch for (30, 35] - // * The **t=36** block will start the epoch for (35, 40] - CurrentEpochStartTime time.Time `protobuf:"bytes,5,opt,name=current_epoch_start_time,json=currentEpochStartTime,proto3,stdtime" json:"current_epoch_start_time" yaml:"current_epoch_start_time"` - // epoch_counting_started is a boolean, that indicates whether this - // epoch timer has began yet. - EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` - // current_epoch_start_height is the block height at which the current epoch - // started. (The block height at which the timer last ticked) - CurrentEpochStartHeight int64 `protobuf:"varint,8,opt,name=current_epoch_start_height,json=currentEpochStartHeight,proto3" json:"current_epoch_start_height,omitempty"` -} - -func (m *EpochInfo) Reset() { *m = EpochInfo{} } -func (m *EpochInfo) String() string { return proto.CompactTextString(m) } -func (*EpochInfo) ProtoMessage() {} -func (*EpochInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_7dd2db84ad8300ca, []int{0} -} -func (m *EpochInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EpochInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EpochInfo.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 *EpochInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_EpochInfo.Merge(m, src) -} -func (m *EpochInfo) XXX_Size() int { - return m.Size() -} -func (m *EpochInfo) XXX_DiscardUnknown() { - xxx_messageInfo_EpochInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_EpochInfo proto.InternalMessageInfo - -func (m *EpochInfo) GetIdentifier() string { - if m != nil { - return m.Identifier - } - return "" -} - -func (m *EpochInfo) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} - -func (m *EpochInfo) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *EpochInfo) GetCurrentEpoch() int64 { - if m != nil { - return m.CurrentEpoch - } - return 0 -} - -func (m *EpochInfo) GetCurrentEpochStartTime() time.Time { - if m != nil { - return m.CurrentEpochStartTime - } - return time.Time{} -} - -func (m *EpochInfo) GetEpochCountingStarted() bool { - if m != nil { - return m.EpochCountingStarted - } - return false -} - -func (m *EpochInfo) GetCurrentEpochStartHeight() int64 { - if m != nil { - return m.CurrentEpochStartHeight - } - return 0 -} - -// GenesisState defines the epochs module's genesis state. -type GenesisState struct { - Epochs []EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs"` -} - -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_7dd2db84ad8300ca, []int{1} -} -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) GetEpochs() []EpochInfo { - if m != nil { - return m.Epochs - } - return nil -} - -func init() { - proto.RegisterType((*EpochInfo)(nil), "osmosis.epochs.v1beta1.EpochInfo") - proto.RegisterType((*GenesisState)(nil), "osmosis.epochs.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("osmosis/epochs/v1beta1/genesis.proto", fileDescriptor_7dd2db84ad8300ca) -} - -var fileDescriptor_7dd2db84ad8300ca = []byte{ - // 485 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcf, 0x8e, 0xd3, 0x3c, - 0x14, 0xc5, 0xeb, 0xaf, 0xfd, 0x4a, 0xea, 0x19, 0x04, 0x58, 0xc3, 0x10, 0x2a, 0x91, 0x84, 0xc0, - 0x22, 0x12, 0xc8, 0x51, 0x07, 0xd8, 0xc0, 0x02, 0xa9, 0x80, 0xf8, 0xb3, 0x19, 0x29, 0x65, 0x81, - 0xd8, 0x54, 0x4e, 0xeb, 0x26, 0x96, 0x9a, 0x38, 0xc4, 0x0e, 0x52, 0x77, 0x3c, 0x42, 0x97, 0x3c, - 0xd2, 0x2c, 0x67, 0xc9, 0xaa, 0xa0, 0x76, 0xc7, 0x72, 0x9e, 0x00, 0xc5, 0x76, 0x4a, 0x99, 0x19, - 0xc4, 0xce, 0xf1, 0xf9, 0xdd, 0x73, 0x7c, 0xaf, 0x6e, 0xe0, 0x7d, 0x2e, 0x32, 0x2e, 0x98, 0x08, - 0x69, 0xc1, 0x27, 0xa9, 0x08, 0x3f, 0x0f, 0x62, 0x2a, 0xc9, 0x20, 0x4c, 0x68, 0x4e, 0x05, 0x13, - 0xb8, 0x28, 0xb9, 0xe4, 0xe8, 0xd0, 0x50, 0x58, 0x53, 0xd8, 0x50, 0xfd, 0x83, 0x84, 0x27, 0x5c, - 0x21, 0x61, 0x7d, 0xd2, 0x74, 0xdf, 0x49, 0x38, 0x4f, 0xe6, 0x34, 0x54, 0x5f, 0x71, 0x35, 0x0b, - 0xa7, 0x55, 0x49, 0x24, 0xe3, 0xb9, 0xd1, 0xdd, 0xf3, 0xba, 0x64, 0x19, 0x15, 0x92, 0x64, 0x85, - 0x06, 0xfc, 0x65, 0x07, 0xf6, 0x5e, 0xd5, 0x49, 0x6f, 0xf3, 0x19, 0x47, 0x0e, 0x84, 0x6c, 0x4a, - 0x73, 0xc9, 0x66, 0x8c, 0x96, 0x36, 0xf0, 0x40, 0xd0, 0x8b, 0x76, 0x6e, 0xd0, 0x07, 0x08, 0x85, - 0x24, 0xa5, 0x1c, 0xd7, 0x36, 0xf6, 0x7f, 0x1e, 0x08, 0xf6, 0x8e, 0xfa, 0x58, 0x67, 0xe0, 0x26, - 0x03, 0xbf, 0x6f, 0x32, 0x86, 0x77, 0x4e, 0x56, 0x6e, 0xeb, 0x6c, 0xe5, 0xde, 0x58, 0x90, 0x6c, - 0xfe, 0xd4, 0xff, 0x5d, 0xeb, 0x2f, 0xbf, 0xbb, 0x20, 0xea, 0xa9, 0x8b, 0x1a, 0x47, 0x29, 0xb4, - 0x9a, 0xa7, 0xdb, 0x6d, 0xe5, 0x7b, 0xfb, 0x82, 0xef, 0x4b, 0x03, 0x0c, 0x07, 0xb5, 0xed, 0xcf, - 0x95, 0x8b, 0x9a, 0x92, 0x87, 0x3c, 0x63, 0x92, 0x66, 0x85, 0x5c, 0x9c, 0xad, 0xdc, 0x6b, 0x3a, - 0xac, 0xd1, 0xfc, 0xaf, 0x75, 0xd4, 0xd6, 0x1d, 0xdd, 0x83, 0x57, 0x27, 0x55, 0x59, 0xd2, 0x5c, - 0x8e, 0xd5, 0x88, 0xed, 0x8e, 0x07, 0x82, 0x76, 0xb4, 0x6f, 0x2e, 0xd5, 0x30, 0xd0, 0x17, 0x00, - 0xed, 0x3f, 0xa8, 0xf1, 0x4e, 0xdf, 0xff, 0xff, 0xb3, 0xef, 0x07, 0xa6, 0x6f, 0x57, 0x3f, 0xe5, - 0x6f, 0x4e, 0x7a, 0x0a, 0x37, 0x77, 0x93, 0x47, 0xdb, 0x89, 0x3c, 0x86, 0x87, 0x9a, 0x9f, 0xf0, - 0x2a, 0x97, 0x2c, 0x4f, 0x74, 0x21, 0x9d, 0xda, 0x5d, 0x0f, 0x04, 0x56, 0x74, 0xa0, 0xd4, 0x17, - 0x46, 0x1c, 0x69, 0x0d, 0x3d, 0x83, 0xfd, 0xcb, 0xd2, 0x52, 0xca, 0x92, 0x54, 0xda, 0x96, 0x6a, - 0xf5, 0xd6, 0x85, 0xc0, 0x37, 0x4a, 0x7e, 0xd7, 0xb1, 0xae, 0x5c, 0xb7, 0xfc, 0x63, 0xb8, 0xff, - 0x5a, 0xaf, 0xe4, 0x48, 0x12, 0x49, 0xd1, 0x73, 0xd8, 0xd5, 0xbb, 0x68, 0x03, 0xaf, 0x1d, 0xec, - 0x1d, 0xdd, 0xc5, 0x97, 0xaf, 0x28, 0xde, 0xee, 0xd1, 0xb0, 0x53, 0xf7, 0x1f, 0x99, 0xb2, 0xe1, - 0xf1, 0xc9, 0xda, 0x01, 0xa7, 0x6b, 0x07, 0xfc, 0x58, 0x3b, 0x60, 0xb9, 0x71, 0x5a, 0xa7, 0x1b, - 0xa7, 0xf5, 0x6d, 0xe3, 0xb4, 0x3e, 0x3e, 0x49, 0x98, 0x4c, 0xab, 0x18, 0x4f, 0x78, 0x16, 0x7e, - 0xaa, 0x88, 0x20, 0xe5, 0x9c, 0xc4, 0xc2, 0x1c, 0x73, 0x3e, 0xa5, 0xe1, 0xb9, 0x7f, 0x46, 0x2e, - 0x0a, 0x2a, 0xe2, 0xae, 0x1a, 0xf9, 0xa3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x95, 0x3a, - 0x31, 0x52, 0x03, 0x00, 0x00, -} - -func (m *EpochInfo) 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 *EpochInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EpochInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CurrentEpochStartHeight != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentEpochStartHeight)) - i-- - dAtA[i] = 0x40 - } - if m.EpochCountingStarted { - i-- - if m.EpochCountingStarted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CurrentEpochStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentEpochStartTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintGenesis(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x2a - if m.CurrentEpoch != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentEpoch)) - i-- - dAtA[i] = 0x20 - } - n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintGenesis(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x1a - n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintGenesis(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x12 - if len(m.Identifier) > 0 { - i -= len(m.Identifier) - copy(dAtA[i:], m.Identifier) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Identifier))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -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 - if len(m.Epochs) > 0 { - for iNdEx := len(m.Epochs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Epochs[iNdEx].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 *EpochInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Identifier) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovGenesis(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovGenesis(uint64(l)) - if m.CurrentEpoch != 0 { - n += 1 + sovGenesis(uint64(m.CurrentEpoch)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentEpochStartTime) - n += 1 + l + sovGenesis(uint64(l)) - if m.EpochCountingStarted { - n += 2 - } - if m.CurrentEpochStartHeight != 0 { - n += 1 + sovGenesis(uint64(m.CurrentEpochStartHeight)) - } - return n -} - -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Epochs) > 0 { - for _, e := range m.Epochs { - l = e.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 *EpochInfo) 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: EpochInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EpochInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Identifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", 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 := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) - } - m.CurrentEpoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentEpoch |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.CurrentEpochStartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochCountingStarted", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EpochCountingStarted = bool(v != 0) - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartHeight", wireType) - } - m.CurrentEpochStartHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentEpochStartHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 (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 Epochs", 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 - } - m.Epochs = append(m.Epochs, EpochInfo{}) - if err := m.Epochs[len(m.Epochs)-1].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/osmosis/epochs/types/query.pb.go b/osmosis/epochs/types/query.pb.go deleted file mode 100644 index d6d6f0719..000000000 --- a/osmosis/epochs/types/query.pb.go +++ /dev/null @@ -1,912 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/epochs/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "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 - -type QueryEpochsInfoRequest struct { -} - -func (m *QueryEpochsInfoRequest) Reset() { *m = QueryEpochsInfoRequest{} } -func (m *QueryEpochsInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryEpochsInfoRequest) ProtoMessage() {} -func (*QueryEpochsInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_82bf2f47d6aaa9fa, []int{0} -} -func (m *QueryEpochsInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryEpochsInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryEpochsInfoRequest.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 *QueryEpochsInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEpochsInfoRequest.Merge(m, src) -} -func (m *QueryEpochsInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryEpochsInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEpochsInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryEpochsInfoRequest proto.InternalMessageInfo - -type QueryEpochsInfoResponse struct { - Epochs []EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs"` -} - -func (m *QueryEpochsInfoResponse) Reset() { *m = QueryEpochsInfoResponse{} } -func (m *QueryEpochsInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryEpochsInfoResponse) ProtoMessage() {} -func (*QueryEpochsInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_82bf2f47d6aaa9fa, []int{1} -} -func (m *QueryEpochsInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryEpochsInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryEpochsInfoResponse.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 *QueryEpochsInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEpochsInfoResponse.Merge(m, src) -} -func (m *QueryEpochsInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryEpochsInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEpochsInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryEpochsInfoResponse proto.InternalMessageInfo - -func (m *QueryEpochsInfoResponse) GetEpochs() []EpochInfo { - if m != nil { - return m.Epochs - } - return nil -} - -type QueryCurrentEpochRequest struct { - Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` -} - -func (m *QueryCurrentEpochRequest) Reset() { *m = QueryCurrentEpochRequest{} } -func (m *QueryCurrentEpochRequest) String() string { return proto.CompactTextString(m) } -func (*QueryCurrentEpochRequest) ProtoMessage() {} -func (*QueryCurrentEpochRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_82bf2f47d6aaa9fa, []int{2} -} -func (m *QueryCurrentEpochRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCurrentEpochRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCurrentEpochRequest.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 *QueryCurrentEpochRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCurrentEpochRequest.Merge(m, src) -} -func (m *QueryCurrentEpochRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryCurrentEpochRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCurrentEpochRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCurrentEpochRequest proto.InternalMessageInfo - -func (m *QueryCurrentEpochRequest) GetIdentifier() string { - if m != nil { - return m.Identifier - } - return "" -} - -type QueryCurrentEpochResponse struct { - CurrentEpoch int64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` -} - -func (m *QueryCurrentEpochResponse) Reset() { *m = QueryCurrentEpochResponse{} } -func (m *QueryCurrentEpochResponse) String() string { return proto.CompactTextString(m) } -func (*QueryCurrentEpochResponse) ProtoMessage() {} -func (*QueryCurrentEpochResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_82bf2f47d6aaa9fa, []int{3} -} -func (m *QueryCurrentEpochResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCurrentEpochResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCurrentEpochResponse.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 *QueryCurrentEpochResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCurrentEpochResponse.Merge(m, src) -} -func (m *QueryCurrentEpochResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryCurrentEpochResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCurrentEpochResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCurrentEpochResponse proto.InternalMessageInfo - -func (m *QueryCurrentEpochResponse) GetCurrentEpoch() int64 { - if m != nil { - return m.CurrentEpoch - } - return 0 -} - -func init() { - proto.RegisterType((*QueryEpochsInfoRequest)(nil), "osmosis.epochs.v1beta1.QueryEpochsInfoRequest") - proto.RegisterType((*QueryEpochsInfoResponse)(nil), "osmosis.epochs.v1beta1.QueryEpochsInfoResponse") - proto.RegisterType((*QueryCurrentEpochRequest)(nil), "osmosis.epochs.v1beta1.QueryCurrentEpochRequest") - proto.RegisterType((*QueryCurrentEpochResponse)(nil), "osmosis.epochs.v1beta1.QueryCurrentEpochResponse") -} - -func init() { - proto.RegisterFile("osmosis/epochs/v1beta1/query.proto", fileDescriptor_82bf2f47d6aaa9fa) -} - -var fileDescriptor_82bf2f47d6aaa9fa = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x4e, 0xe3, 0x30, - 0x18, 0xc7, 0xe3, 0xf6, 0xae, 0xd2, 0xf9, 0x7a, 0x8b, 0x75, 0xea, 0xe5, 0xa2, 0x93, 0xaf, 0x97, - 0xbb, 0x83, 0x2e, 0xc4, 0xb4, 0x88, 0x85, 0x05, 0x54, 0xc4, 0xc0, 0x84, 0xc8, 0xd8, 0x05, 0x25, - 0xa9, 0x9b, 0x46, 0x6a, 0xed, 0x34, 0x76, 0x90, 0xba, 0xf2, 0x04, 0x48, 0x88, 0x17, 0xe0, 0x59, - 0x18, 0x3a, 0x56, 0x62, 0x61, 0x42, 0xa8, 0xe5, 0x41, 0x50, 0x1c, 0x0b, 0x15, 0x48, 0x10, 0x6c, - 0x8e, 0xbf, 0xdf, 0xff, 0xfb, 0xff, 0xbf, 0x2f, 0x86, 0x36, 0x17, 0x63, 0x2e, 0x22, 0x41, 0x68, - 0xcc, 0x83, 0xa1, 0x20, 0xa7, 0x6d, 0x9f, 0x4a, 0xaf, 0x4d, 0x26, 0x29, 0x4d, 0xa6, 0x4e, 0x9c, - 0x70, 0xc9, 0x51, 0x43, 0x33, 0x4e, 0xce, 0x38, 0x9a, 0xb1, 0xbe, 0x87, 0x3c, 0xe4, 0x0a, 0x21, - 0xd9, 0x29, 0xa7, 0xad, 0x5f, 0x21, 0xe7, 0xe1, 0x88, 0x12, 0x2f, 0x8e, 0x88, 0xc7, 0x18, 0x97, - 0x9e, 0x8c, 0x38, 0x13, 0xba, 0xfa, 0xaf, 0xc4, 0x2f, 0xa4, 0x8c, 0x66, 0x16, 0x8a, 0xb2, 0x4d, - 0xd8, 0x38, 0xce, 0x02, 0x1c, 0x28, 0xe8, 0x90, 0x0d, 0xb8, 0x4b, 0x27, 0x29, 0x15, 0xd2, 0xee, - 0xc1, 0x1f, 0xaf, 0x2a, 0x22, 0xe6, 0x4c, 0x50, 0xb4, 0x0b, 0x6b, 0x79, 0x53, 0x13, 0x34, 0xab, - 0xad, 0xaf, 0x9d, 0x3f, 0x4e, 0x71, 0x6e, 0x47, 0x69, 0x33, 0x69, 0xf7, 0xd3, 0xec, 0xee, 0xb7, - 0xe1, 0x6a, 0x99, 0xbd, 0x03, 0x4d, 0xd5, 0x7b, 0x3f, 0x4d, 0x12, 0xca, 0xa4, 0xc2, 0xb4, 0x2f, - 0xc2, 0x10, 0x46, 0x7d, 0xca, 0x64, 0x34, 0x88, 0x68, 0x62, 0x82, 0x26, 0x68, 0x7d, 0x71, 0x57, - 0x6e, 0xec, 0x3d, 0xf8, 0xb3, 0x40, 0xab, 0x93, 0xfd, 0x85, 0xdf, 0x82, 0xfc, 0xfe, 0x44, 0x59, - 0x29, 0x7d, 0xd5, 0xad, 0x07, 0x2b, 0x70, 0xe7, 0xba, 0x02, 0x3f, 0xab, 0x16, 0xe8, 0x12, 0x40, - 0xf8, 0x94, 0x51, 0x20, 0xa7, 0x6c, 0x8e, 0xe2, 0x15, 0x59, 0xe4, 0xdd, 0x7c, 0x1e, 0xcf, 0x5e, - 0x3b, 0xbb, 0x79, 0xb8, 0xa8, 0x34, 0x11, 0x26, 0x25, 0x3f, 0x27, 0xff, 0x44, 0x57, 0x00, 0xd6, - 0x57, 0xe7, 0x43, 0x9b, 0x6f, 0x3a, 0x15, 0xac, 0xd1, 0x6a, 0x7f, 0x40, 0xa1, 0xd3, 0x6d, 0xa8, - 0x74, 0xeb, 0xe8, 0x7f, 0x59, 0xba, 0x67, 0xab, 0xed, 0x1e, 0xcd, 0x16, 0x18, 0xcc, 0x17, 0x18, - 0xdc, 0x2f, 0x30, 0x38, 0x5f, 0x62, 0x63, 0xbe, 0xc4, 0xc6, 0xed, 0x12, 0x1b, 0xbd, 0xed, 0x30, - 0x92, 0xc3, 0xd4, 0x77, 0x02, 0x3e, 0x26, 0x93, 0xd4, 0x13, 0x5e, 0x32, 0xf2, 0x7c, 0xa1, 0x8f, - 0x8c, 0xf7, 0xe9, 0x4b, 0x03, 0x39, 0x8d, 0xa9, 0xf0, 0x6b, 0xea, 0x49, 0x6e, 0x3d, 0x06, 0x00, - 0x00, 0xff, 0xff, 0x1f, 0x5f, 0xa2, 0x09, 0x2a, 0x03, 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 { - // EpochInfos provide running epochInfos - EpochInfos(ctx context.Context, in *QueryEpochsInfoRequest, opts ...grpc.CallOption) (*QueryEpochsInfoResponse, error) - // CurrentEpoch provide current epoch of specified identifier - CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) EpochInfos(ctx context.Context, in *QueryEpochsInfoRequest, opts ...grpc.CallOption) (*QueryEpochsInfoResponse, error) { - out := new(QueryEpochsInfoResponse) - err := c.cc.Invoke(ctx, "/osmosis.epochs.v1beta1.Query/EpochInfos", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) { - out := new(QueryCurrentEpochResponse) - err := c.cc.Invoke(ctx, "/osmosis.epochs.v1beta1.Query/CurrentEpoch", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // EpochInfos provide running epochInfos - EpochInfos(context.Context, *QueryEpochsInfoRequest) (*QueryEpochsInfoResponse, error) - // CurrentEpoch provide current epoch of specified identifier - CurrentEpoch(context.Context, *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) EpochInfos(ctx context.Context, req *QueryEpochsInfoRequest) (*QueryEpochsInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EpochInfos not implemented") -} -func (*UnimplementedQueryServer) CurrentEpoch(ctx context.Context, req *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CurrentEpoch not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_EpochInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryEpochsInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).EpochInfos(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.epochs.v1beta1.Query/EpochInfos", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EpochInfos(ctx, req.(*QueryEpochsInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryCurrentEpochRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).CurrentEpoch(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.epochs.v1beta1.Query/CurrentEpoch", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).CurrentEpoch(ctx, req.(*QueryCurrentEpochRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "osmosis.epochs.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EpochInfos", - Handler: _Query_EpochInfos_Handler, - }, - { - MethodName: "CurrentEpoch", - Handler: _Query_CurrentEpoch_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "osmosis/epochs/v1beta1/query.proto", -} - -func (m *QueryEpochsInfoRequest) 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 *QueryEpochsInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryEpochsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryEpochsInfoResponse) 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 *QueryEpochsInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryEpochsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Epochs) > 0 { - for iNdEx := len(m.Epochs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Epochs[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 *QueryCurrentEpochRequest) 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 *QueryCurrentEpochRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCurrentEpochRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Identifier) > 0 { - i -= len(m.Identifier) - copy(dAtA[i:], m.Identifier) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Identifier))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryCurrentEpochResponse) 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 *QueryCurrentEpochResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCurrentEpochResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CurrentEpoch != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.CurrentEpoch)) - i-- - dAtA[i] = 0x8 - } - 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 *QueryEpochsInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryEpochsInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Epochs) > 0 { - for _, e := range m.Epochs { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryCurrentEpochRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Identifier) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryCurrentEpochResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CurrentEpoch != 0 { - n += 1 + sovQuery(uint64(m.CurrentEpoch)) - } - 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 *QueryEpochsInfoRequest) 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: QueryEpochsInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEpochsInfoRequest: 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 *QueryEpochsInfoResponse) 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: QueryEpochsInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEpochsInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Epochs", 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.Epochs = append(m.Epochs, EpochInfo{}) - if err := m.Epochs[len(m.Epochs)-1].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 *QueryCurrentEpochRequest) 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: QueryCurrentEpochRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCurrentEpochRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Identifier", 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.Identifier = 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 *QueryCurrentEpochResponse) 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: QueryCurrentEpochResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCurrentEpochResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) - } - m.CurrentEpoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentEpoch |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func 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/osmosis/epochs/types/query.pb.gw.go b/osmosis/epochs/types/query.pb.gw.go deleted file mode 100644 index 579754ffd..000000000 --- a/osmosis/epochs/types/query.pb.gw.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: osmosis/epochs/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_EpochInfos_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryEpochsInfoRequest - var metadata runtime.ServerMetadata - - msg, err := client.EpochInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_EpochInfos_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryEpochsInfoRequest - var metadata runtime.ServerMetadata - - msg, err := server.EpochInfos(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_CurrentEpoch_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryCurrentEpochRequest - 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_CurrentEpoch_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CurrentEpoch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryCurrentEpochRequest - 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_CurrentEpoch_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CurrentEpoch(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_EpochInfos_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_EpochInfos_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_EpochInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_CurrentEpoch_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_CurrentEpoch_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_CurrentEpoch_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_EpochInfos_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_EpochInfos_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_EpochInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_CurrentEpoch_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_CurrentEpoch_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_CurrentEpoch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_EpochInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"osmosis", "epochs", "v1beta1"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_CurrentEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "epochs", "v1beta1", "current_epoch"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_EpochInfos_0 = runtime.ForwardResponseMessage - - forward_Query_CurrentEpoch_0 = runtime.ForwardResponseMessage -) diff --git a/osmosis/gamm/pool-models/balancer/balancerPool.pb.go b/osmosis/gamm/pool-models/balancer/balancerPool.pb.go deleted file mode 100644 index 40d7a2dbe..000000000 --- a/osmosis/gamm/pool-models/balancer/balancerPool.pb.go +++ /dev/null @@ -1,1517 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/gamm/v1beta1/balancerPool.proto - -// this is a legacy package that requires additional migration logic -// in order to use the correct packge. Decision made to use legacy package path -// until clear steps for migration logic and the unknowns for state breaking are -// investigated for changing proto package. - -package balancer - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// Parameters for changing the weights in a balancer pool smoothly from -// a start weight and end weight over a period of time. -// Currently, the only smooth change supported is linear changing between -// the two weights, but more types may be added in the future. -// When these parameters are set, the weight w(t) for pool time `t` is the -// following: -// -// t <= start_time: w(t) = initial_pool_weights -// start_time < t <= start_time + duration: -// w(t) = initial_pool_weights + (t - start_time) * -// (target_pool_weights - initial_pool_weights) / (duration) -// t > start_time + duration: w(t) = target_pool_weights -type SmoothWeightChangeParams struct { - // The start time for beginning the weight change. - // If a parameter change / pool instantiation leaves this blank, - // it should be generated by the state_machine as the current time. - StartTime time.Time `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` - // Duration for the weights to change over - Duration time.Duration `protobuf:"bytes,2,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` - // The initial pool weights. These are copied from the pool's settings - // at the time of weight change instantiation. - // The amount PoolAsset.token.amount field is ignored if present, - // future type refactorings should just have a type with the denom & weight - // here. - InitialPoolWeights []PoolAsset `protobuf:"bytes,3,rep,name=initial_pool_weights,json=initialPoolWeights,proto3" json:"initial_pool_weights" yaml:"initial_pool_weights"` - // The target pool weights. The pool weights will change linearly with respect - // to time between start_time, and start_time + duration. The amount - // PoolAsset.token.amount field is ignored if present, future type - // refactorings should just have a type with the denom & weight here. - TargetPoolWeights []PoolAsset `protobuf:"bytes,4,rep,name=target_pool_weights,json=targetPoolWeights,proto3" json:"target_pool_weights" yaml:"target_pool_weights"` -} - -func (m *SmoothWeightChangeParams) Reset() { *m = SmoothWeightChangeParams{} } -func (m *SmoothWeightChangeParams) String() string { return proto.CompactTextString(m) } -func (*SmoothWeightChangeParams) ProtoMessage() {} -func (*SmoothWeightChangeParams) Descriptor() ([]byte, []int) { - return fileDescriptor_8bed8b78c08e572f, []int{0} -} -func (m *SmoothWeightChangeParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SmoothWeightChangeParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SmoothWeightChangeParams.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 *SmoothWeightChangeParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_SmoothWeightChangeParams.Merge(m, src) -} -func (m *SmoothWeightChangeParams) XXX_Size() int { - return m.Size() -} -func (m *SmoothWeightChangeParams) XXX_DiscardUnknown() { - xxx_messageInfo_SmoothWeightChangeParams.DiscardUnknown(m) -} - -var xxx_messageInfo_SmoothWeightChangeParams proto.InternalMessageInfo - -func (m *SmoothWeightChangeParams) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} - -func (m *SmoothWeightChangeParams) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *SmoothWeightChangeParams) GetInitialPoolWeights() []PoolAsset { - if m != nil { - return m.InitialPoolWeights - } - return nil -} - -func (m *SmoothWeightChangeParams) GetTargetPoolWeights() []PoolAsset { - if m != nil { - return m.TargetPoolWeights - } - return nil -} - -// PoolParams defined the parameters that will be managed by the pool -// governance in the future. This params are not managed by the chain -// governance. Instead they will be managed by the token holders of the pool. -// The pool's token holders are specified in future_pool_governor. -type PoolParams struct { - SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` - SmoothWeightChangeParams *SmoothWeightChangeParams `protobuf:"bytes,3,opt,name=smooth_weight_change_params,json=smoothWeightChangeParams,proto3" json:"smooth_weight_change_params,omitempty" yaml:"smooth_weight_change_params"` -} - -func (m *PoolParams) Reset() { *m = PoolParams{} } -func (m *PoolParams) String() string { return proto.CompactTextString(m) } -func (*PoolParams) ProtoMessage() {} -func (*PoolParams) Descriptor() ([]byte, []int) { - return fileDescriptor_8bed8b78c08e572f, []int{1} -} -func (m *PoolParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PoolParams.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 *PoolParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolParams.Merge(m, src) -} -func (m *PoolParams) XXX_Size() int { - return m.Size() -} -func (m *PoolParams) XXX_DiscardUnknown() { - xxx_messageInfo_PoolParams.DiscardUnknown(m) -} - -var xxx_messageInfo_PoolParams proto.InternalMessageInfo - -func (m *PoolParams) GetSmoothWeightChangeParams() *SmoothWeightChangeParams { - if m != nil { - return m.SmoothWeightChangeParams - } - return nil -} - -// Pool asset is an internal struct that combines the amount of the -// token in the pool, and its balancer weight. -// This is an awkward packaging of data, -// and should be revisited in a future state migration. -type PoolAsset struct { - // Coins we are talking about, - // the denomination must be unique amongst all PoolAssets for this pool. - Token types.Coin `protobuf:"bytes,1,opt,name=token,proto3" json:"token" yaml:"token"` - // Weight that is not normalized. This weight must be less than 2^50 - Weight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"weight" yaml:"weight"` -} - -func (m *PoolAsset) Reset() { *m = PoolAsset{} } -func (m *PoolAsset) String() string { return proto.CompactTextString(m) } -func (*PoolAsset) ProtoMessage() {} -func (*PoolAsset) Descriptor() ([]byte, []int) { - return fileDescriptor_8bed8b78c08e572f, []int{2} -} -func (m *PoolAsset) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PoolAsset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PoolAsset.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 *PoolAsset) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolAsset.Merge(m, src) -} -func (m *PoolAsset) XXX_Size() int { - return m.Size() -} -func (m *PoolAsset) XXX_DiscardUnknown() { - xxx_messageInfo_PoolAsset.DiscardUnknown(m) -} - -var xxx_messageInfo_PoolAsset proto.InternalMessageInfo - -func (m *PoolAsset) GetToken() types.Coin { - if m != nil { - return m.Token - } - return types.Coin{} -} - -type Pool struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - PoolParams PoolParams `protobuf:"bytes,3,opt,name=pool_params,json=poolParams,proto3" json:"pool_params" yaml:"balancer_pool_params"` - // This string specifies who will govern the pool in the future. - // Valid forms of this are: - // {token name},{duration} - // {duration} - // where {token name} if specified is the token which determines the - // governor, and if not specified is the LP token for this pool.duration is - // a time specified as 0w,1w,2w, etc. which specifies how long the token - // would need to be locked up to count in governance. 0w means no lockup. - // TODO: Further improve these docs - FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` - // sum of all LP tokens sent out - TotalShares types.Coin `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` - // These are assumed to be sorted by denomiation. - // They contain the pool asset and the information about the weight - PoolAssets []PoolAsset `protobuf:"bytes,6,rep,name=pool_assets,json=poolAssets,proto3" json:"pool_assets" yaml:"pool_assets"` - // sum of all non-normalized pool weights - TotalWeight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=total_weight,json=totalWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_weight" yaml:"total_weight"` -} - -func (m *Pool) Reset() { *m = Pool{} } -func (m *Pool) String() string { return proto.CompactTextString(m) } -func (*Pool) ProtoMessage() {} -func (*Pool) Descriptor() ([]byte, []int) { - return fileDescriptor_8bed8b78c08e572f, []int{3} -} -func (m *Pool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pool.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 *Pool) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pool.Merge(m, src) -} -func (m *Pool) XXX_Size() int { - return m.Size() -} -func (m *Pool) XXX_DiscardUnknown() { - xxx_messageInfo_Pool.DiscardUnknown(m) -} - -var xxx_messageInfo_Pool proto.InternalMessageInfo - -func init() { - proto.RegisterType((*SmoothWeightChangeParams)(nil), "osmosis.gamm.v1beta1.SmoothWeightChangeParams") - proto.RegisterType((*PoolParams)(nil), "osmosis.gamm.v1beta1.PoolParams") - proto.RegisterType((*PoolAsset)(nil), "osmosis.gamm.v1beta1.PoolAsset") - proto.RegisterType((*Pool)(nil), "osmosis.gamm.v1beta1.Pool") -} - -func init() { - proto.RegisterFile("osmosis/gamm/v1beta1/balancerPool.proto", fileDescriptor_8bed8b78c08e572f) -} - -var fileDescriptor_8bed8b78c08e572f = []byte{ - // 817 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xeb, 0x44, - 0x14, 0x8e, 0x93, 0xdc, 0xe6, 0x76, 0x72, 0xb9, 0xa8, 0xd3, 0x2c, 0x9c, 0x54, 0xc4, 0x65, 0x90, - 0xa0, 0x42, 0xad, 0xad, 0x96, 0x5d, 0x37, 0xa8, 0x6e, 0x0b, 0x62, 0x57, 0x5c, 0xa4, 0x02, 0xaa, - 0x64, 0x4d, 0xe2, 0x89, 0x63, 0xd5, 0xf6, 0x18, 0xcf, 0xa4, 0xa5, 0x6f, 0xc0, 0xb2, 0x4b, 0xd8, - 0xb1, 0x67, 0xcb, 0x2b, 0x20, 0x55, 0xb0, 0xe9, 0x12, 0xb1, 0x30, 0xa8, 0x65, 0xc5, 0x32, 0x4f, - 0x80, 0xe6, 0xc7, 0xf9, 0x29, 0x89, 0x68, 0x75, 0x57, 0x99, 0x39, 0x73, 0xce, 0xf7, 0x9d, 0x9f, - 0xef, 0xc4, 0xe0, 0x03, 0xca, 0x12, 0xca, 0x22, 0xe6, 0x84, 0x38, 0x49, 0x9c, 0xcb, 0xdd, 0x1e, - 0xe1, 0x78, 0xd7, 0xe9, 0xe1, 0x18, 0xa7, 0x7d, 0x92, 0x9f, 0x50, 0x1a, 0xdb, 0x59, 0x4e, 0x39, - 0x85, 0x2d, 0xed, 0x68, 0x0b, 0x47, 0x5b, 0x3b, 0x76, 0xda, 0x7d, 0x69, 0xf6, 0xa5, 0x8f, 0xa3, - 0x2e, 0x2a, 0xa0, 0xd3, 0x0a, 0x69, 0x48, 0x95, 0x5d, 0x9c, 0xb4, 0xb5, 0x1b, 0x52, 0x1a, 0xc6, - 0xc4, 0x91, 0xb7, 0xde, 0x68, 0xe0, 0x04, 0xa3, 0x1c, 0xf3, 0x88, 0xa6, 0xfa, 0xdd, 0x7a, 0xfc, - 0xce, 0xa3, 0x84, 0x30, 0x8e, 0x93, 0xac, 0x04, 0x50, 0x24, 0x4e, 0x0f, 0x33, 0x32, 0xc9, 0xb7, - 0x4f, 0x23, 0x0d, 0x80, 0x7e, 0xab, 0x01, 0xf3, 0x34, 0xa1, 0x94, 0x0f, 0xcf, 0x48, 0x14, 0x0e, - 0xf9, 0xe1, 0x10, 0xa7, 0x21, 0x39, 0xc1, 0x39, 0x4e, 0x18, 0xfc, 0x12, 0x00, 0xc6, 0x71, 0xce, - 0x7d, 0x81, 0x6a, 0x1a, 0x9b, 0xc6, 0x56, 0x73, 0xaf, 0x63, 0x2b, 0x4a, 0xbb, 0xa4, 0xb4, 0xbf, - 0x28, 0x29, 0xdd, 0x77, 0x6e, 0x0b, 0xab, 0x32, 0x2e, 0xac, 0xb5, 0x6b, 0x9c, 0xc4, 0xfb, 0x68, - 0x1a, 0x8b, 0x6e, 0xfe, 0xb4, 0x0c, 0x6f, 0x55, 0x1a, 0x84, 0x3b, 0x1c, 0x82, 0x97, 0x65, 0x25, - 0x66, 0x55, 0xe2, 0xb6, 0xff, 0x83, 0x7b, 0xa4, 0x1d, 0xdc, 0x5d, 0x01, 0xfb, 0x4f, 0x61, 0xc1, - 0x32, 0x64, 0x9b, 0x26, 0x11, 0x27, 0x49, 0xc6, 0xaf, 0xc7, 0x85, 0xf5, 0xb6, 0x22, 0x2b, 0xdf, - 0xd0, 0xf7, 0x82, 0x6a, 0x82, 0x0e, 0x2f, 0x41, 0x2b, 0x4a, 0x23, 0x1e, 0xe1, 0xd8, 0xcf, 0x28, - 0x8d, 0xfd, 0x2b, 0x59, 0x26, 0x33, 0x6b, 0x9b, 0xb5, 0xad, 0xe6, 0x9e, 0x65, 0x2f, 0x9a, 0x93, - 0x2d, 0x06, 0x79, 0xc0, 0x18, 0xe1, 0xee, 0x7b, 0xba, 0xa4, 0x0d, 0xc5, 0xb2, 0x08, 0x0a, 0x79, - 0x50, 0x9b, 0x45, 0x98, 0x6a, 0x23, 0x83, 0x0c, 0xac, 0x73, 0x9c, 0x87, 0x84, 0xcf, 0xd3, 0xd6, - 0x9f, 0x46, 0x8b, 0x34, 0x6d, 0x47, 0xd1, 0x2e, 0x40, 0x42, 0xde, 0x9a, 0xb2, 0xce, 0x90, 0xa2, - 0xbf, 0xab, 0x00, 0x88, 0xbb, 0x9e, 0xdf, 0x39, 0x78, 0xc9, 0xae, 0x70, 0xe6, 0x0f, 0x88, 0x9a, - 0xde, 0xaa, 0x7b, 0x20, 0x70, 0xff, 0x28, 0xac, 0xf7, 0xc3, 0x88, 0x0f, 0x47, 0x3d, 0xbb, 0x4f, - 0x13, 0x2d, 0x43, 0xfd, 0xb3, 0xc3, 0x82, 0x0b, 0x87, 0x5f, 0x67, 0x84, 0xd9, 0x47, 0xa4, 0x3f, - 0x6d, 0x6f, 0x89, 0x83, 0xbc, 0x86, 0x38, 0x7e, 0x42, 0x88, 0x40, 0x27, 0xdf, 0x46, 0x5c, 0xa2, - 0x57, 0xdf, 0x0c, 0xbd, 0xc4, 0x41, 0x5e, 0x43, 0x1c, 0x05, 0xfa, 0x0f, 0x06, 0xd8, 0x60, 0x52, - 0x98, 0xba, 0x62, 0xbf, 0x2f, 0xa5, 0xe9, 0x67, 0xb2, 0x36, 0xb3, 0x26, 0x55, 0x63, 0x2f, 0x6e, - 0xe4, 0x32, 0x45, 0xbb, 0x1f, 0xde, 0x16, 0x96, 0x31, 0x2e, 0x2c, 0xa4, 0xab, 0x5a, 0x4e, 0x80, - 0x3c, 0x93, 0x2d, 0x41, 0x41, 0x3f, 0x19, 0x60, 0x75, 0x32, 0x2b, 0x78, 0x0c, 0x5e, 0x70, 0x7a, - 0x41, 0x52, 0xbd, 0x20, 0x6d, 0x5b, 0xef, 0xb5, 0x58, 0xb9, 0x49, 0x46, 0x87, 0x34, 0x4a, 0xdd, - 0x96, 0x9e, 0xea, 0x2b, 0x3d, 0x55, 0x11, 0x85, 0x3c, 0x15, 0x0d, 0xcf, 0xc0, 0x8a, 0xca, 0x43, - 0x37, 0xf3, 0xe3, 0x67, 0x34, 0xf3, 0xb3, 0x94, 0x8f, 0x0b, 0xeb, 0x2d, 0x05, 0xab, 0x50, 0x90, - 0xa7, 0xe1, 0xd0, 0x2f, 0x75, 0x50, 0x17, 0xd9, 0xc2, 0x6d, 0xd0, 0xc0, 0x41, 0x90, 0x13, 0xc6, - 0xb4, 0x1a, 0xe0, 0xb8, 0xb0, 0x5e, 0xab, 0x20, 0xfd, 0x80, 0xbc, 0xd2, 0x05, 0xbe, 0x06, 0xd5, - 0x28, 0x90, 0xb9, 0xd4, 0xbd, 0x6a, 0x14, 0xc0, 0x01, 0x68, 0x4a, 0xfd, 0xcd, 0xf5, 0x7f, 0x73, - 0xb9, 0x90, 0x75, 0xc7, 0x1f, 0x2d, 0x50, 0xf9, 0x57, 0xe9, 0xcf, 0x60, 0x21, 0x0f, 0x64, 0x53, - 0xd1, 0x7e, 0x0e, 0x5a, 0x83, 0x11, 0x1f, 0xe5, 0x44, 0xb9, 0x84, 0xf4, 0x92, 0xe4, 0x29, 0xcd, - 0xcd, 0xba, 0x4c, 0xd9, 0x9a, 0x42, 0x2d, 0xf2, 0x42, 0x1e, 0x54, 0x66, 0x91, 0xc1, 0xa7, 0xda, - 0x08, 0xbf, 0x02, 0xaf, 0x38, 0xe5, 0x38, 0xf6, 0xd9, 0x10, 0xe7, 0x84, 0x99, 0x2f, 0xfe, 0x6f, - 0x50, 0x1b, 0x3a, 0xe9, 0xf5, 0x72, 0x50, 0xd3, 0x60, 0xe4, 0x35, 0xe5, 0xf5, 0x54, 0xde, 0xe0, - 0xb9, 0xee, 0x0a, 0x16, 0x52, 0x60, 0xe6, 0xca, 0xd3, 0xd6, 0xbb, 0xa3, 0xf1, 0xa1, 0xc2, 0x9f, - 0x41, 0xd0, 0xbd, 0x90, 0x6e, 0x0c, 0x0e, 0xcb, 0xc4, 0xb5, 0x32, 0x1a, 0xb2, 0x07, 0xc7, 0xcf, - 0x56, 0xc6, 0x5c, 0x1d, 0xa5, 0x3e, 0x54, 0x1d, 0x4a, 0xde, 0xfb, 0xef, 0x7e, 0xf7, 0xa3, 0x55, - 0xf9, 0xf5, 0xe7, 0x9d, 0xf6, 0xd2, 0xcc, 0xdd, 0xf3, 0xdb, 0xfb, 0xae, 0x71, 0x77, 0xdf, 0x35, - 0xfe, 0xba, 0xef, 0x1a, 0x37, 0x0f, 0xdd, 0xca, 0xdd, 0x43, 0xb7, 0xf2, 0xfb, 0x43, 0xb7, 0xf2, - 0xb5, 0x3b, 0x93, 0xc8, 0x37, 0x23, 0xcc, 0x70, 0x1e, 0xe3, 0x1e, 0xd3, 0xc7, 0x94, 0x06, 0xc4, - 0x99, 0xfb, 0x6c, 0x8a, 0x02, 0x77, 0x12, 0x1a, 0x90, 0x98, 0x4d, 0x3e, 0x9d, 0xbd, 0x15, 0xf9, - 0xbf, 0xff, 0xd1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x5c, 0x34, 0x02, 0x62, 0x07, 0x00, - 0x00, -} - -func (m *SmoothWeightChangeParams) 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 *SmoothWeightChangeParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SmoothWeightChangeParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TargetPoolWeights) > 0 { - for iNdEx := len(m.TargetPoolWeights) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TargetPoolWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.InitialPoolWeights) > 0 { - for iNdEx := len(m.InitialPoolWeights) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InitialPoolWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintBalancerPool(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintBalancerPool(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PoolParams) 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 *PoolParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SmoothWeightChangeParams != nil { - { - size, err := m.SmoothWeightChangeParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - { - size := m.ExitFee.Size() - i -= size - if _, err := m.ExitFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.SwapFee.Size() - i -= size - if _, err := m.SwapFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PoolAsset) 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 *PoolAsset) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PoolAsset) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Pool) 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 *Pool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TotalWeight.Size() - i -= size - if _, err := m.TotalWeight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.PoolAssets) > 0 { - for iNdEx := len(m.PoolAssets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PoolAssets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - { - size, err := m.TotalShares.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.FuturePoolGovernor) > 0 { - i -= len(m.FuturePoolGovernor) - copy(dAtA[i:], m.FuturePoolGovernor) - i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.FuturePoolGovernor))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBalancerPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Id != 0 { - i = encodeVarintBalancerPool(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x10 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintBalancerPool(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintBalancerPool(dAtA []byte, offset int, v uint64) int { - offset -= sovBalancerPool(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SmoothWeightChangeParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovBalancerPool(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovBalancerPool(uint64(l)) - if len(m.InitialPoolWeights) > 0 { - for _, e := range m.InitialPoolWeights { - l = e.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - } - if len(m.TargetPoolWeights) > 0 { - for _, e := range m.TargetPoolWeights { - l = e.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - } - return n -} - -func (m *PoolParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.SwapFee.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - l = m.ExitFee.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - if m.SmoothWeightChangeParams != nil { - l = m.SmoothWeightChangeParams.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - return n -} - -func (m *PoolAsset) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Token.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - l = m.Weight.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - return n -} - -func (m *Pool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovBalancerPool(uint64(l)) - } - if m.Id != 0 { - n += 1 + sovBalancerPool(uint64(m.Id)) - } - l = m.PoolParams.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - l = len(m.FuturePoolGovernor) - if l > 0 { - n += 1 + l + sovBalancerPool(uint64(l)) - } - l = m.TotalShares.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - if len(m.PoolAssets) > 0 { - for _, e := range m.PoolAssets { - l = e.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - } - } - l = m.TotalWeight.Size() - n += 1 + l + sovBalancerPool(uint64(l)) - return n -} - -func sovBalancerPool(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBalancerPool(x uint64) (n int) { - return sovBalancerPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SmoothWeightChangeParams) 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 ErrIntOverflowBalancerPool - } - 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: SmoothWeightChangeParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SmoothWeightChangeParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialPoolWeights", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InitialPoolWeights = append(m.InitialPoolWeights, PoolAsset{}) - if err := m.InitialPoolWeights[len(m.InitialPoolWeights)-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 TargetPoolWeights", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TargetPoolWeights = append(m.TargetPoolWeights, PoolAsset{}) - if err := m.TargetPoolWeights[len(m.TargetPoolWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PoolParams) 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 ErrIntOverflowBalancerPool - } - 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: PoolParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PoolParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - 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 ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SwapFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - 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 ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SmoothWeightChangeParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SmoothWeightChangeParams == nil { - m.SmoothWeightChangeParams = &SmoothWeightChangeParams{} - } - if err := m.SmoothWeightChangeParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PoolAsset) 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 ErrIntOverflowBalancerPool - } - 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: PoolAsset: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PoolAsset: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - 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 ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Pool) 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 ErrIntOverflowBalancerPool - } - 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: Pool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pool: 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 ErrIntOverflowBalancerPool - } - 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 ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FuturePoolGovernor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - 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 ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FuturePoolGovernor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolAssets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PoolAssets = append(m.PoolAssets, PoolAsset{}) - if err := m.PoolAssets[len(m.PoolAssets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalWeight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBalancerPool - } - 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 ErrInvalidLengthBalancerPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBalancerPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBalancerPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBalancerPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBalancerPool(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, ErrIntOverflowBalancerPool - } - 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, ErrIntOverflowBalancerPool - } - 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, ErrIntOverflowBalancerPool - } - 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, ErrInvalidLengthBalancerPool - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBalancerPool - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBalancerPool - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBalancerPool = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBalancerPool = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBalancerPool = fmt.Errorf("proto: unexpected end of group") -) diff --git a/osmosis/gamm/pool-models/balancer/tx.pb.go b/osmosis/gamm/pool-models/balancer/tx.pb.go deleted file mode 100644 index fb19c1bf8..000000000 --- a/osmosis/gamm/pool-models/balancer/tx.pb.go +++ /dev/null @@ -1,748 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto - -package balancer - -import ( - context "context" - fmt "fmt" - _ "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 - -// ===================== MsgCreatePool -type MsgCreateBalancerPool struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolParams *PoolParams `protobuf:"bytes,2,opt,name=pool_params,json=poolParams,proto3" json:"pool_params,omitempty" yaml:"pool_params"` - PoolAssets []PoolAsset `protobuf:"bytes,3,rep,name=pool_assets,json=poolAssets,proto3" json:"pool_assets"` - FuturePoolGovernor string `protobuf:"bytes,4,opt,name=future_pool_governor,json=futurePoolGovernor,proto3" json:"future_pool_governor,omitempty" yaml:"future_pool_governor"` -} - -func (m *MsgCreateBalancerPool) Reset() { *m = MsgCreateBalancerPool{} } -func (m *MsgCreateBalancerPool) String() string { return proto.CompactTextString(m) } -func (*MsgCreateBalancerPool) ProtoMessage() {} -func (*MsgCreateBalancerPool) Descriptor() ([]byte, []int) { - return fileDescriptor_4d22c5192b37962a, []int{0} -} -func (m *MsgCreateBalancerPool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateBalancerPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateBalancerPool.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 *MsgCreateBalancerPool) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateBalancerPool.Merge(m, src) -} -func (m *MsgCreateBalancerPool) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateBalancerPool) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateBalancerPool.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateBalancerPool proto.InternalMessageInfo - -func (m *MsgCreateBalancerPool) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgCreateBalancerPool) GetPoolParams() *PoolParams { - if m != nil { - return m.PoolParams - } - return nil -} - -func (m *MsgCreateBalancerPool) GetPoolAssets() []PoolAsset { - if m != nil { - return m.PoolAssets - } - return nil -} - -func (m *MsgCreateBalancerPool) GetFuturePoolGovernor() string { - if m != nil { - return m.FuturePoolGovernor - } - return "" -} - -// Returns the poolID -type MsgCreateBalancerPoolResponse struct { - PoolID uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` -} - -func (m *MsgCreateBalancerPoolResponse) Reset() { *m = MsgCreateBalancerPoolResponse{} } -func (m *MsgCreateBalancerPoolResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateBalancerPoolResponse) ProtoMessage() {} -func (*MsgCreateBalancerPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4d22c5192b37962a, []int{1} -} -func (m *MsgCreateBalancerPoolResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateBalancerPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateBalancerPoolResponse.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 *MsgCreateBalancerPoolResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateBalancerPoolResponse.Merge(m, src) -} -func (m *MsgCreateBalancerPoolResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateBalancerPoolResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateBalancerPoolResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateBalancerPoolResponse proto.InternalMessageInfo - -func (m *MsgCreateBalancerPoolResponse) GetPoolID() uint64 { - if m != nil { - return m.PoolID - } - return 0 -} - -func init() { - proto.RegisterType((*MsgCreateBalancerPool)(nil), "osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool") - proto.RegisterType((*MsgCreateBalancerPoolResponse)(nil), "osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPoolResponse") -} - -func init() { - proto.RegisterFile("osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto", fileDescriptor_4d22c5192b37962a) -} - -var fileDescriptor_4d22c5192b37962a = []byte{ - // 431 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xc1, 0x8a, 0xd3, 0x40, - 0x18, 0xc7, 0x3b, 0xdb, 0x52, 0x71, 0x8a, 0x07, 0x87, 0x55, 0x4a, 0xc5, 0xa4, 0xc4, 0x83, 0xf5, - 0xe0, 0x0c, 0xad, 0x37, 0x2f, 0x62, 0x5c, 0x5c, 0xf6, 0xb0, 0xb0, 0xe6, 0xa6, 0x08, 0xcb, 0x64, - 0x33, 0xc6, 0x42, 0x92, 0x2f, 0xce, 0x97, 0x2c, 0xfa, 0x16, 0x3e, 0x81, 0x47, 0x9f, 0xc1, 0x47, - 0xd8, 0xe3, 0x1e, 0x3d, 0x05, 0x49, 0xdf, 0xa0, 0x4f, 0x20, 0x33, 0x49, 0x74, 0xab, 0x11, 0x84, - 0xbd, 0x85, 0x6f, 0xfe, 0xbf, 0xdf, 0x7c, 0xdf, 0x64, 0x86, 0x2e, 0x01, 0x53, 0xc0, 0x35, 0x8a, - 0x58, 0xa6, 0xa9, 0xc8, 0x01, 0x92, 0x14, 0x22, 0x95, 0xa0, 0x08, 0x65, 0x22, 0xb3, 0x33, 0xa5, - 0xc5, 0xf9, 0x32, 0x54, 0x85, 0x5c, 0x8a, 0xe2, 0x23, 0xcf, 0x35, 0x14, 0xc0, 0x16, 0x2d, 0xc2, - 0x0d, 0xc2, 0x7f, 0x23, 0xbc, 0x43, 0x78, 0x8b, 0xcc, 0xf6, 0x63, 0x88, 0xc1, 0x42, 0xc2, 0x7c, - 0x35, 0xfc, 0xec, 0xe1, 0xce, 0x96, 0x9d, 0xbe, 0x83, 0x4f, 0x00, 0x92, 0x26, 0xe8, 0x7d, 0xdb, - 0xa3, 0x77, 0x8e, 0x31, 0x7e, 0xa1, 0x95, 0x2c, 0x94, 0x7f, 0x65, 0x9d, 0x3d, 0xa2, 0x63, 0x54, - 0x59, 0xa4, 0xf4, 0x94, 0xcc, 0xc9, 0xe2, 0xa6, 0x7f, 0x7b, 0x5b, 0xb9, 0xb7, 0x3e, 0xc9, 0x34, - 0x79, 0xea, 0x35, 0x75, 0x2f, 0x68, 0x03, 0xec, 0x35, 0x9d, 0x98, 0x16, 0x4f, 0x73, 0xa9, 0x65, - 0x8a, 0xd3, 0xbd, 0x39, 0x59, 0x4c, 0x56, 0x73, 0xbe, 0x33, 0x43, 0xdb, 0x03, 0x37, 0xee, 0x13, - 0x9b, 0xf3, 0xef, 0x6e, 0x2b, 0x97, 0x35, 0xc6, 0x2b, 0xb8, 0x17, 0xd0, 0xfc, 0x57, 0x86, 0xbd, - 0x6c, 0xd5, 0x12, 0x51, 0x15, 0x38, 0x1d, 0xce, 0x87, 0x8b, 0xc9, 0xca, 0xfd, 0xb7, 0xfa, 0xb9, - 0xc9, 0xf9, 0xa3, 0x8b, 0xca, 0x1d, 0x34, 0x1e, 0x5b, 0x40, 0xf6, 0x8a, 0xee, 0xbf, 0x2b, 0x8b, - 0x52, 0xab, 0x53, 0xab, 0x8b, 0xe1, 0x5c, 0xe9, 0x0c, 0xf4, 0x74, 0x64, 0x67, 0x73, 0xb7, 0x95, - 0x7b, 0xaf, 0xe9, 0xa4, 0x2f, 0xe5, 0x05, 0xac, 0x29, 0x9b, 0x1d, 0x0e, 0xbb, 0xe2, 0x01, 0xbd, - 0xdf, 0x7b, 0x72, 0x81, 0xc2, 0x1c, 0x32, 0x54, 0xec, 0x01, 0xbd, 0x61, 0x35, 0xeb, 0xc8, 0x1e, - 0xe1, 0xc8, 0xa7, 0x75, 0xe5, 0x8e, 0x4d, 0xe4, 0xe8, 0x20, 0x18, 0x9b, 0xa5, 0xa3, 0x68, 0xf5, - 0x95, 0xd0, 0xe1, 0x31, 0xc6, 0xec, 0x0b, 0xa1, 0xac, 0xe7, 0x2f, 0x3c, 0xe3, 0xff, 0x7b, 0x13, - 0x78, 0x6f, 0x33, 0xb3, 0xc3, 0x6b, 0x0a, 0xba, 0x69, 0xfc, 0xb7, 0x17, 0xb5, 0x43, 0x2e, 0x6b, - 0x87, 0xfc, 0xa8, 0x1d, 0xf2, 0x79, 0xe3, 0x0c, 0x2e, 0x37, 0xce, 0xe0, 0xfb, 0xc6, 0x19, 0xbc, - 0xf1, 0xe3, 0x75, 0xf1, 0xbe, 0x0c, 0xf9, 0x19, 0xa4, 0xe2, 0x43, 0x29, 0x51, 0xea, 0x44, 0x86, - 0xd8, 0x7e, 0x66, 0x10, 0x29, 0xf1, 0xd7, 0x03, 0x78, 0xfc, 0xc7, 0x0b, 0x08, 0xc7, 0xf6, 0x3a, - 0x3e, 0xf9, 0x19, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xa1, 0x48, 0x7e, 0x2c, 0x03, 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 { - CreateBalancerPool(ctx context.Context, in *MsgCreateBalancerPool, opts ...grpc.CallOption) (*MsgCreateBalancerPoolResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) CreateBalancerPool(ctx context.Context, in *MsgCreateBalancerPool, opts ...grpc.CallOption) (*MsgCreateBalancerPoolResponse, error) { - out := new(MsgCreateBalancerPoolResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.poolmodels.balancer.v1beta1.Msg/CreateBalancerPool", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - CreateBalancerPool(context.Context, *MsgCreateBalancerPool) (*MsgCreateBalancerPoolResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) CreateBalancerPool(ctx context.Context, req *MsgCreateBalancerPool) (*MsgCreateBalancerPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateBalancerPool not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_CreateBalancerPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateBalancerPool) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateBalancerPool(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.poolmodels.balancer.v1beta1.Msg/CreateBalancerPool", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateBalancerPool(ctx, req.(*MsgCreateBalancerPool)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "osmosis.gamm.poolmodels.balancer.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateBalancerPool", - Handler: _Msg_CreateBalancerPool_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto", -} - -func (m *MsgCreateBalancerPool) 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 *MsgCreateBalancerPool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateBalancerPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FuturePoolGovernor) > 0 { - i -= len(m.FuturePoolGovernor) - copy(dAtA[i:], m.FuturePoolGovernor) - i = encodeVarintTx(dAtA, i, uint64(len(m.FuturePoolGovernor))) - i-- - dAtA[i] = 0x22 - } - if len(m.PoolAssets) > 0 { - for iNdEx := len(m.PoolAssets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PoolAssets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.PoolParams != nil { - { - size, err := m.PoolParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - 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 *MsgCreateBalancerPoolResponse) 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 *MsgCreateBalancerPoolResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateBalancerPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PoolID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolID)) - i-- - dAtA[i] = 0x8 - } - 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 *MsgCreateBalancerPool) 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.PoolParams != nil { - l = m.PoolParams.Size() - n += 1 + l + sovTx(uint64(l)) - } - if len(m.PoolAssets) > 0 { - for _, e := range m.PoolAssets { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.FuturePoolGovernor) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgCreateBalancerPoolResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PoolID != 0 { - n += 1 + sovTx(uint64(m.PoolID)) - } - 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 *MsgCreateBalancerPool) 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: MsgCreateBalancerPool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateBalancerPool: 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 != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolParams", 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.PoolParams == nil { - m.PoolParams = &PoolParams{} - } - if err := m.PoolParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolAssets", 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.PoolAssets = append(m.PoolAssets, PoolAsset{}) - if err := m.PoolAssets[len(m.PoolAssets)-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 FuturePoolGovernor", 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.FuturePoolGovernor = 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 *MsgCreateBalancerPoolResponse) 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: MsgCreateBalancerPoolResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateBalancerPoolResponse: 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) - } - m.PoolID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolID |= 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 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/osmosis/gamm/types/query.pb.go b/osmosis/gamm/types/query.pb.go deleted file mode 100644 index 9c11a2a78..000000000 --- a/osmosis/gamm/types/query.pb.go +++ /dev/null @@ -1,4371 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/gamm/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - 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 - -// =============================== Pool -type QueryPoolRequest struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` -} - -func (m *QueryPoolRequest) Reset() { *m = QueryPoolRequest{} } -func (m *QueryPoolRequest) String() string { return proto.CompactTextString(m) } -func (*QueryPoolRequest) ProtoMessage() {} -func (*QueryPoolRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{0} -} -func (m *QueryPoolRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolRequest.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 *QueryPoolRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolRequest.Merge(m, src) -} -func (m *QueryPoolRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolRequest proto.InternalMessageInfo - -func (m *QueryPoolRequest) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -type QueryPoolResponse struct { - // google.protobuf.Any pool = 1 [ (cosmos_proto.accepts_interface) = "PoolI" ]; - Pool *types.Any `protobuf:"bytes,1,opt,name=pool,proto3" json:"pool,omitempty"` -} - -func (m *QueryPoolResponse) Reset() { *m = QueryPoolResponse{} } -func (m *QueryPoolResponse) String() string { return proto.CompactTextString(m) } -func (*QueryPoolResponse) ProtoMessage() {} -func (*QueryPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{1} -} -func (m *QueryPoolResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolResponse.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 *QueryPoolResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolResponse.Merge(m, src) -} -func (m *QueryPoolResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolResponse proto.InternalMessageInfo - -func (m *QueryPoolResponse) GetPool() *types.Any { - if m != nil { - return m.Pool - } - return nil -} - -// =============================== Pools -type QueryPoolsRequest struct { - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryPoolsRequest) Reset() { *m = QueryPoolsRequest{} } -func (m *QueryPoolsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryPoolsRequest) ProtoMessage() {} -func (*QueryPoolsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{2} -} -func (m *QueryPoolsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolsRequest.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 *QueryPoolsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolsRequest.Merge(m, src) -} -func (m *QueryPoolsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolsRequest proto.InternalMessageInfo - -func (m *QueryPoolsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryPoolsResponse struct { - Pools []*types.Any `protobuf:"bytes,1,rep,name=pools,proto3" json:"pools,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryPoolsResponse) Reset() { *m = QueryPoolsResponse{} } -func (m *QueryPoolsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryPoolsResponse) ProtoMessage() {} -func (*QueryPoolsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{3} -} -func (m *QueryPoolsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolsResponse.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 *QueryPoolsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolsResponse.Merge(m, src) -} -func (m *QueryPoolsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolsResponse proto.InternalMessageInfo - -func (m *QueryPoolsResponse) GetPools() []*types.Any { - if m != nil { - return m.Pools - } - return nil -} - -func (m *QueryPoolsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// =============================== NumPools -type QueryNumPoolsRequest struct { -} - -func (m *QueryNumPoolsRequest) Reset() { *m = QueryNumPoolsRequest{} } -func (m *QueryNumPoolsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryNumPoolsRequest) ProtoMessage() {} -func (*QueryNumPoolsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{4} -} -func (m *QueryNumPoolsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryNumPoolsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryNumPoolsRequest.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 *QueryNumPoolsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryNumPoolsRequest.Merge(m, src) -} -func (m *QueryNumPoolsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryNumPoolsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryNumPoolsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryNumPoolsRequest proto.InternalMessageInfo - -type QueryNumPoolsResponse struct { - NumPools uint64 `protobuf:"varint,1,opt,name=num_pools,json=numPools,proto3" json:"num_pools,omitempty" yaml:"num_pools"` -} - -func (m *QueryNumPoolsResponse) Reset() { *m = QueryNumPoolsResponse{} } -func (m *QueryNumPoolsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryNumPoolsResponse) ProtoMessage() {} -func (*QueryNumPoolsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{5} -} -func (m *QueryNumPoolsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryNumPoolsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryNumPoolsResponse.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 *QueryNumPoolsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryNumPoolsResponse.Merge(m, src) -} -func (m *QueryNumPoolsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryNumPoolsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryNumPoolsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryNumPoolsResponse proto.InternalMessageInfo - -func (m *QueryNumPoolsResponse) GetNumPools() uint64 { - if m != nil { - return m.NumPools - } - return 0 -} - -// =============================== PoolParams -type QueryPoolParamsRequest struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` -} - -func (m *QueryPoolParamsRequest) Reset() { *m = QueryPoolParamsRequest{} } -func (m *QueryPoolParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryPoolParamsRequest) ProtoMessage() {} -func (*QueryPoolParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{6} -} -func (m *QueryPoolParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolParamsRequest.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 *QueryPoolParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolParamsRequest.Merge(m, src) -} -func (m *QueryPoolParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolParamsRequest proto.InternalMessageInfo - -func (m *QueryPoolParamsRequest) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -type QueryPoolParamsResponse struct { - Params *types.Any `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *QueryPoolParamsResponse) Reset() { *m = QueryPoolParamsResponse{} } -func (m *QueryPoolParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryPoolParamsResponse) ProtoMessage() {} -func (*QueryPoolParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{7} -} -func (m *QueryPoolParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolParamsResponse.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 *QueryPoolParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolParamsResponse.Merge(m, src) -} -func (m *QueryPoolParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolParamsResponse proto.InternalMessageInfo - -func (m *QueryPoolParamsResponse) GetParams() *types.Any { - if m != nil { - return m.Params - } - return nil -} - -// =============================== PoolLiquidity -type QueryTotalPoolLiquidityRequest struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` -} - -func (m *QueryTotalPoolLiquidityRequest) Reset() { *m = QueryTotalPoolLiquidityRequest{} } -func (m *QueryTotalPoolLiquidityRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTotalPoolLiquidityRequest) ProtoMessage() {} -func (*QueryTotalPoolLiquidityRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{8} -} -func (m *QueryTotalPoolLiquidityRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTotalPoolLiquidityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTotalPoolLiquidityRequest.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 *QueryTotalPoolLiquidityRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTotalPoolLiquidityRequest.Merge(m, src) -} -func (m *QueryTotalPoolLiquidityRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryTotalPoolLiquidityRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTotalPoolLiquidityRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTotalPoolLiquidityRequest proto.InternalMessageInfo - -func (m *QueryTotalPoolLiquidityRequest) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -type QueryTotalPoolLiquidityResponse struct { - Liquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=liquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"liquidity" yaml:"liquidity"` -} - -func (m *QueryTotalPoolLiquidityResponse) Reset() { *m = QueryTotalPoolLiquidityResponse{} } -func (m *QueryTotalPoolLiquidityResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTotalPoolLiquidityResponse) ProtoMessage() {} -func (*QueryTotalPoolLiquidityResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{9} -} -func (m *QueryTotalPoolLiquidityResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTotalPoolLiquidityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTotalPoolLiquidityResponse.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 *QueryTotalPoolLiquidityResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTotalPoolLiquidityResponse.Merge(m, src) -} -func (m *QueryTotalPoolLiquidityResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTotalPoolLiquidityResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTotalPoolLiquidityResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTotalPoolLiquidityResponse proto.InternalMessageInfo - -func (m *QueryTotalPoolLiquidityResponse) GetLiquidity() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Liquidity - } - return nil -} - -// =============================== TotalShares -type QueryTotalSharesRequest struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` -} - -func (m *QueryTotalSharesRequest) Reset() { *m = QueryTotalSharesRequest{} } -func (m *QueryTotalSharesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTotalSharesRequest) ProtoMessage() {} -func (*QueryTotalSharesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{10} -} -func (m *QueryTotalSharesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTotalSharesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTotalSharesRequest.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 *QueryTotalSharesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTotalSharesRequest.Merge(m, src) -} -func (m *QueryTotalSharesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryTotalSharesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTotalSharesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTotalSharesRequest proto.InternalMessageInfo - -func (m *QueryTotalSharesRequest) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -type QueryTotalSharesResponse struct { - TotalShares types1.Coin `protobuf:"bytes,1,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` -} - -func (m *QueryTotalSharesResponse) Reset() { *m = QueryTotalSharesResponse{} } -func (m *QueryTotalSharesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTotalSharesResponse) ProtoMessage() {} -func (*QueryTotalSharesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{11} -} -func (m *QueryTotalSharesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTotalSharesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTotalSharesResponse.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 *QueryTotalSharesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTotalSharesResponse.Merge(m, src) -} -func (m *QueryTotalSharesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTotalSharesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTotalSharesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTotalSharesResponse proto.InternalMessageInfo - -func (m *QueryTotalSharesResponse) GetTotalShares() types1.Coin { - if m != nil { - return m.TotalShares - } - return types1.Coin{} -} - -// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice -// query. -type QuerySpotPriceRequest struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - BaseAssetDenom string `protobuf:"bytes,2,opt,name=base_asset_denom,json=baseAssetDenom,proto3" json:"base_asset_denom,omitempty" yaml:"base_asset_denom"` - QuoteAssetDenom string `protobuf:"bytes,3,opt,name=quote_asset_denom,json=quoteAssetDenom,proto3" json:"quote_asset_denom,omitempty" yaml:"quote_asset_denom"` -} - -func (m *QuerySpotPriceRequest) Reset() { *m = QuerySpotPriceRequest{} } -func (m *QuerySpotPriceRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySpotPriceRequest) ProtoMessage() {} -func (*QuerySpotPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{12} -} -func (m *QuerySpotPriceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpotPriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpotPriceRequest.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 *QuerySpotPriceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpotPriceRequest.Merge(m, src) -} -func (m *QuerySpotPriceRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySpotPriceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpotPriceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpotPriceRequest proto.InternalMessageInfo - -func (m *QuerySpotPriceRequest) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *QuerySpotPriceRequest) GetBaseAssetDenom() string { - if m != nil { - return m.BaseAssetDenom - } - return "" -} - -func (m *QuerySpotPriceRequest) GetQuoteAssetDenom() string { - if m != nil { - return m.QuoteAssetDenom - } - return "" -} - -// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice -// query. -type QuerySpotPriceResponse struct { - // String of the Dec. Ex) 10.203uatom - SpotPrice string `protobuf:"bytes,1,opt,name=spot_price,json=spotPrice,proto3" json:"spot_price,omitempty" yaml:"spot_price"` -} - -func (m *QuerySpotPriceResponse) Reset() { *m = QuerySpotPriceResponse{} } -func (m *QuerySpotPriceResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySpotPriceResponse) ProtoMessage() {} -func (*QuerySpotPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{13} -} -func (m *QuerySpotPriceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpotPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpotPriceResponse.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 *QuerySpotPriceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpotPriceResponse.Merge(m, src) -} -func (m *QuerySpotPriceResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySpotPriceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpotPriceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpotPriceResponse proto.InternalMessageInfo - -func (m *QuerySpotPriceResponse) GetSpotPrice() string { - if m != nil { - return m.SpotPrice - } - return "" -} - -// =============================== EstimateSwapExactAmountIn -type QuerySwapExactAmountInRequest struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - TokenIn string `protobuf:"bytes,3,opt,name=token_in,json=tokenIn,proto3" json:"token_in,omitempty" yaml:"token_in"` - Routes []SwapAmountInRoute `protobuf:"bytes,4,rep,name=routes,proto3" json:"routes" yaml:"routes"` -} - -func (m *QuerySwapExactAmountInRequest) Reset() { *m = QuerySwapExactAmountInRequest{} } -func (m *QuerySwapExactAmountInRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySwapExactAmountInRequest) ProtoMessage() {} -func (*QuerySwapExactAmountInRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{14} -} -func (m *QuerySwapExactAmountInRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySwapExactAmountInRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySwapExactAmountInRequest.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 *QuerySwapExactAmountInRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySwapExactAmountInRequest.Merge(m, src) -} -func (m *QuerySwapExactAmountInRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySwapExactAmountInRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySwapExactAmountInRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySwapExactAmountInRequest proto.InternalMessageInfo - -func (m *QuerySwapExactAmountInRequest) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *QuerySwapExactAmountInRequest) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *QuerySwapExactAmountInRequest) GetTokenIn() string { - if m != nil { - return m.TokenIn - } - return "" -} - -func (m *QuerySwapExactAmountInRequest) GetRoutes() []SwapAmountInRoute { - if m != nil { - return m.Routes - } - return nil -} - -type QuerySwapExactAmountInResponse struct { - TokenOutAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=token_out_amount,json=tokenOutAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_out_amount" yaml:"token_out_amount"` -} - -func (m *QuerySwapExactAmountInResponse) Reset() { *m = QuerySwapExactAmountInResponse{} } -func (m *QuerySwapExactAmountInResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySwapExactAmountInResponse) ProtoMessage() {} -func (*QuerySwapExactAmountInResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{15} -} -func (m *QuerySwapExactAmountInResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySwapExactAmountInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySwapExactAmountInResponse.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 *QuerySwapExactAmountInResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySwapExactAmountInResponse.Merge(m, src) -} -func (m *QuerySwapExactAmountInResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySwapExactAmountInResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySwapExactAmountInResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySwapExactAmountInResponse proto.InternalMessageInfo - -// =============================== EstimateSwapExactAmountOut -type QuerySwapExactAmountOutRequest struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - Routes []SwapAmountOutRoute `protobuf:"bytes,3,rep,name=routes,proto3" json:"routes" yaml:"routes"` - TokenOut string `protobuf:"bytes,4,opt,name=token_out,json=tokenOut,proto3" json:"token_out,omitempty" yaml:"token_out"` -} - -func (m *QuerySwapExactAmountOutRequest) Reset() { *m = QuerySwapExactAmountOutRequest{} } -func (m *QuerySwapExactAmountOutRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySwapExactAmountOutRequest) ProtoMessage() {} -func (*QuerySwapExactAmountOutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{16} -} -func (m *QuerySwapExactAmountOutRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySwapExactAmountOutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySwapExactAmountOutRequest.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 *QuerySwapExactAmountOutRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySwapExactAmountOutRequest.Merge(m, src) -} -func (m *QuerySwapExactAmountOutRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySwapExactAmountOutRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySwapExactAmountOutRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySwapExactAmountOutRequest proto.InternalMessageInfo - -func (m *QuerySwapExactAmountOutRequest) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *QuerySwapExactAmountOutRequest) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *QuerySwapExactAmountOutRequest) GetRoutes() []SwapAmountOutRoute { - if m != nil { - return m.Routes - } - return nil -} - -func (m *QuerySwapExactAmountOutRequest) GetTokenOut() string { - if m != nil { - return m.TokenOut - } - return "" -} - -type QuerySwapExactAmountOutResponse struct { - TokenInAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=token_in_amount,json=tokenInAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_in_amount" yaml:"token_in_amount"` -} - -func (m *QuerySwapExactAmountOutResponse) Reset() { *m = QuerySwapExactAmountOutResponse{} } -func (m *QuerySwapExactAmountOutResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySwapExactAmountOutResponse) ProtoMessage() {} -func (*QuerySwapExactAmountOutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{17} -} -func (m *QuerySwapExactAmountOutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySwapExactAmountOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySwapExactAmountOutResponse.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 *QuerySwapExactAmountOutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySwapExactAmountOutResponse.Merge(m, src) -} -func (m *QuerySwapExactAmountOutResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySwapExactAmountOutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySwapExactAmountOutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySwapExactAmountOutResponse proto.InternalMessageInfo - -type QueryTotalLiquidityRequest struct { -} - -func (m *QueryTotalLiquidityRequest) Reset() { *m = QueryTotalLiquidityRequest{} } -func (m *QueryTotalLiquidityRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTotalLiquidityRequest) ProtoMessage() {} -func (*QueryTotalLiquidityRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{18} -} -func (m *QueryTotalLiquidityRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTotalLiquidityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTotalLiquidityRequest.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 *QueryTotalLiquidityRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTotalLiquidityRequest.Merge(m, src) -} -func (m *QueryTotalLiquidityRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryTotalLiquidityRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTotalLiquidityRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTotalLiquidityRequest proto.InternalMessageInfo - -type QueryTotalLiquidityResponse struct { - Liquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=liquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"liquidity" yaml:"liquidity"` -} - -func (m *QueryTotalLiquidityResponse) Reset() { *m = QueryTotalLiquidityResponse{} } -func (m *QueryTotalLiquidityResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTotalLiquidityResponse) ProtoMessage() {} -func (*QueryTotalLiquidityResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d9a717df9ca609ef, []int{19} -} -func (m *QueryTotalLiquidityResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTotalLiquidityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTotalLiquidityResponse.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 *QueryTotalLiquidityResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTotalLiquidityResponse.Merge(m, src) -} -func (m *QueryTotalLiquidityResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTotalLiquidityResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTotalLiquidityResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTotalLiquidityResponse proto.InternalMessageInfo - -func (m *QueryTotalLiquidityResponse) GetLiquidity() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Liquidity - } - return nil -} - -func init() { - proto.RegisterType((*QueryPoolRequest)(nil), "osmosis.gamm.v1beta1.QueryPoolRequest") - proto.RegisterType((*QueryPoolResponse)(nil), "osmosis.gamm.v1beta1.QueryPoolResponse") - proto.RegisterType((*QueryPoolsRequest)(nil), "osmosis.gamm.v1beta1.QueryPoolsRequest") - proto.RegisterType((*QueryPoolsResponse)(nil), "osmosis.gamm.v1beta1.QueryPoolsResponse") - proto.RegisterType((*QueryNumPoolsRequest)(nil), "osmosis.gamm.v1beta1.QueryNumPoolsRequest") - proto.RegisterType((*QueryNumPoolsResponse)(nil), "osmosis.gamm.v1beta1.QueryNumPoolsResponse") - proto.RegisterType((*QueryPoolParamsRequest)(nil), "osmosis.gamm.v1beta1.QueryPoolParamsRequest") - proto.RegisterType((*QueryPoolParamsResponse)(nil), "osmosis.gamm.v1beta1.QueryPoolParamsResponse") - proto.RegisterType((*QueryTotalPoolLiquidityRequest)(nil), "osmosis.gamm.v1beta1.QueryTotalPoolLiquidityRequest") - proto.RegisterType((*QueryTotalPoolLiquidityResponse)(nil), "osmosis.gamm.v1beta1.QueryTotalPoolLiquidityResponse") - proto.RegisterType((*QueryTotalSharesRequest)(nil), "osmosis.gamm.v1beta1.QueryTotalSharesRequest") - proto.RegisterType((*QueryTotalSharesResponse)(nil), "osmosis.gamm.v1beta1.QueryTotalSharesResponse") - proto.RegisterType((*QuerySpotPriceRequest)(nil), "osmosis.gamm.v1beta1.QuerySpotPriceRequest") - proto.RegisterType((*QuerySpotPriceResponse)(nil), "osmosis.gamm.v1beta1.QuerySpotPriceResponse") - proto.RegisterType((*QuerySwapExactAmountInRequest)(nil), "osmosis.gamm.v1beta1.QuerySwapExactAmountInRequest") - proto.RegisterType((*QuerySwapExactAmountInResponse)(nil), "osmosis.gamm.v1beta1.QuerySwapExactAmountInResponse") - proto.RegisterType((*QuerySwapExactAmountOutRequest)(nil), "osmosis.gamm.v1beta1.QuerySwapExactAmountOutRequest") - proto.RegisterType((*QuerySwapExactAmountOutResponse)(nil), "osmosis.gamm.v1beta1.QuerySwapExactAmountOutResponse") - proto.RegisterType((*QueryTotalLiquidityRequest)(nil), "osmosis.gamm.v1beta1.QueryTotalLiquidityRequest") - proto.RegisterType((*QueryTotalLiquidityResponse)(nil), "osmosis.gamm.v1beta1.QueryTotalLiquidityResponse") -} - -func init() { proto.RegisterFile("osmosis/gamm/v1beta1/query.proto", fileDescriptor_d9a717df9ca609ef) } - -var fileDescriptor_d9a717df9ca609ef = []byte{ - // 1326 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x97, 0xcb, 0x6f, 0x1c, 0xc5, - 0x13, 0xc7, 0x3d, 0xce, 0xda, 0xb1, 0xdb, 0xbf, 0x38, 0x76, 0xc7, 0x49, 0xd6, 0xe3, 0x78, 0x27, - 0xbf, 0x46, 0xc4, 0x26, 0xb1, 0x67, 0x70, 0x62, 0x2e, 0x11, 0x10, 0xb2, 0xc4, 0x4e, 0x1c, 0x91, - 0x07, 0x13, 0x04, 0xe2, 0x21, 0xad, 0xda, 0xde, 0x61, 0x33, 0xca, 0xee, 0xf4, 0x78, 0xbb, 0x07, - 0xc7, 0x42, 0x11, 0x12, 0x42, 0x9c, 0x38, 0x20, 0x45, 0xdc, 0x22, 0x85, 0x03, 0x87, 0x88, 0x33, - 0xff, 0x02, 0x52, 0x84, 0x84, 0x14, 0xc4, 0x05, 0x71, 0x58, 0x50, 0xc2, 0x81, 0xf3, 0xfe, 0x03, - 0xa0, 0xe9, 0xae, 0x79, 0xac, 0x77, 0xbc, 0x2f, 0x84, 0xc4, 0xc9, 0xb3, 0x5d, 0xd5, 0xdf, 0xfe, - 0x54, 0x55, 0x3f, 0xca, 0xe8, 0x24, 0xe3, 0x35, 0xc6, 0x5d, 0x6e, 0x55, 0x68, 0xad, 0x66, 0x7d, - 0xb4, 0xb2, 0xe9, 0x08, 0xba, 0x62, 0x6d, 0x07, 0x4e, 0x7d, 0xd7, 0xf4, 0xeb, 0x4c, 0x30, 0x3c, - 0x03, 0x1e, 0x66, 0xe8, 0x61, 0x82, 0x87, 0x3e, 0x53, 0x61, 0x15, 0x26, 0x1d, 0xac, 0xf0, 0x4b, - 0xf9, 0xea, 0xf3, 0x99, 0x6a, 0xe2, 0x2e, 0x98, 0x0b, 0x5b, 0xd2, 0x6e, 0x6d, 0x52, 0xee, 0xc4, - 0xd6, 0x2d, 0xe6, 0x7a, 0x60, 0x3f, 0x9d, 0xb6, 0x4b, 0x86, 0xd8, 0xcb, 0xa7, 0x15, 0xd7, 0xa3, - 0xc2, 0x65, 0x91, 0xef, 0x89, 0x0a, 0x63, 0x95, 0xaa, 0x63, 0x51, 0xdf, 0xb5, 0xa8, 0xe7, 0x31, - 0x21, 0x8d, 0x1c, 0xac, 0xb3, 0x60, 0x95, 0xbf, 0x36, 0x83, 0x0f, 0x2d, 0xea, 0xed, 0x46, 0x26, - 0xb5, 0x48, 0x49, 0xc1, 0xab, 0x1f, 0xca, 0x44, 0x2e, 0xa0, 0xa9, 0x37, 0xc3, 0x55, 0x6f, 0x32, - 0x56, 0xb5, 0x9d, 0xed, 0xc0, 0xe1, 0x02, 0x9f, 0x41, 0x07, 0x7d, 0xc6, 0xaa, 0x25, 0xb7, 0x9c, - 0xd7, 0x4e, 0x6a, 0x8b, 0xb9, 0x22, 0x6e, 0x36, 0x8c, 0xc9, 0x5d, 0x5a, 0xab, 0x9e, 0x27, 0x60, - 0x20, 0xf6, 0x68, 0xf8, 0xb5, 0x51, 0x26, 0x1f, 0xa0, 0xe9, 0x94, 0x00, 0xf7, 0x99, 0xc7, 0x1d, - 0x7c, 0x19, 0xe5, 0x42, 0xb3, 0x9c, 0x3e, 0x71, 0x76, 0xc6, 0x54, 0x68, 0x66, 0x84, 0x66, 0x5e, - 0xf4, 0x76, 0x8b, 0xf3, 0x3f, 0x7c, 0xb7, 0x3c, 0x9b, 0x95, 0x68, 0x53, 0x4a, 0x49, 0x01, 0xf2, - 0x7e, 0x4a, 0x9d, 0x47, 0x7c, 0xeb, 0x08, 0x25, 0xb9, 0xc9, 0x0f, 0xcb, 0x35, 0x4e, 0x99, 0x10, - 0x56, 0x98, 0x48, 0x53, 0x15, 0x33, 0xd6, 0xa3, 0x15, 0x07, 0xe6, 0xda, 0xa9, 0x99, 0xe4, 0x91, - 0x86, 0x70, 0x5a, 0x1d, 0xe0, 0x37, 0xd0, 0x48, 0xb8, 0x36, 0xcf, 0x6b, 0x27, 0x0f, 0x0c, 0x4a, - 0xaf, 0x14, 0xf0, 0xe5, 0x0c, 0xd2, 0x85, 0xae, 0xa4, 0x8a, 0xa3, 0x05, 0xf5, 0x18, 0x9a, 0x91, - 0xa4, 0xd7, 0x83, 0x5a, 0x3a, 0x15, 0xe4, 0x2a, 0x3a, 0xba, 0x67, 0x1c, 0x82, 0x58, 0x41, 0xe3, - 0x5e, 0x50, 0x2b, 0x45, 0x81, 0x84, 0x55, 0x9c, 0x69, 0x36, 0x8c, 0x29, 0x55, 0xc5, 0xd8, 0x44, - 0xec, 0x31, 0x0f, 0xa6, 0x92, 0x35, 0x74, 0x2c, 0xce, 0xc6, 0x4d, 0x5a, 0xa7, 0x35, 0x3e, 0xd0, - 0x86, 0xb8, 0x8c, 0x8e, 0xb7, 0xc9, 0x00, 0xd4, 0x12, 0x1a, 0xf5, 0xe5, 0x48, 0xa7, 0x8d, 0x61, - 0x83, 0x0f, 0xb9, 0x86, 0x0a, 0x52, 0xe8, 0x2d, 0x26, 0x68, 0x35, 0x54, 0x7b, 0xc3, 0xdd, 0x0e, - 0xdc, 0xb2, 0x2b, 0x76, 0x07, 0xe2, 0xfa, 0x5a, 0x43, 0xc6, 0xbe, 0x7a, 0x00, 0x78, 0x0f, 0x8d, - 0x57, 0xa3, 0x41, 0x28, 0xff, 0x6c, 0x4b, 0xb9, 0xa2, 0x42, 0xbd, 0xce, 0x5c, 0xaf, 0x78, 0xe9, - 0x71, 0xc3, 0x18, 0x4a, 0x92, 0x1a, 0xcf, 0x24, 0xdf, 0xfe, 0x66, 0x2c, 0x56, 0x5c, 0x71, 0x3b, - 0xd8, 0x34, 0xb7, 0x58, 0x0d, 0x0e, 0x1c, 0xfc, 0x59, 0xe6, 0xe5, 0x3b, 0x96, 0xd8, 0xf5, 0x1d, - 0x2e, 0x45, 0xb8, 0x9d, 0xac, 0x48, 0xd6, 0x21, 0x75, 0x92, 0xf0, 0xd6, 0x6d, 0x5a, 0x77, 0x06, - 0x2b, 0x41, 0x80, 0xf2, 0xed, 0x3a, 0x10, 0xe2, 0xbb, 0xe8, 0x7f, 0x22, 0x1c, 0x2e, 0x71, 0x39, - 0x0e, 0x95, 0xe8, 0x10, 0xe5, 0x1c, 0x44, 0x79, 0x44, 0x2d, 0x96, 0x9e, 0x4c, 0xec, 0x09, 0x91, - 0x2c, 0x41, 0xfe, 0xd4, 0x60, 0x37, 0xde, 0xf2, 0x99, 0xb8, 0x59, 0x77, 0xb7, 0x9c, 0x41, 0xe8, - 0xf1, 0x1a, 0x9a, 0x0a, 0x29, 0x4a, 0x94, 0x73, 0x47, 0x94, 0xca, 0x8e, 0xc7, 0x6a, 0xf2, 0xe8, - 0x8c, 0x17, 0xe7, 0x9a, 0x0d, 0xe3, 0xb8, 0x9a, 0xb5, 0xd7, 0x83, 0xd8, 0x93, 0xe1, 0xd0, 0xc5, - 0x70, 0xe4, 0x52, 0x38, 0x80, 0xaf, 0xa0, 0xe9, 0xed, 0x80, 0x89, 0x56, 0x9d, 0x03, 0x52, 0xe7, - 0x44, 0xb3, 0x61, 0xe4, 0x95, 0x4e, 0x9b, 0x0b, 0xb1, 0x0f, 0xcb, 0xb1, 0x44, 0xe9, 0x6a, 0x6e, - 0x2c, 0x37, 0x35, 0x62, 0x4f, 0xec, 0xb8, 0xe2, 0xf6, 0xad, 0x1d, 0xea, 0xaf, 0x3b, 0x0e, 0xb9, - 0x0e, 0x67, 0x25, 0x15, 0x29, 0xe4, 0x77, 0x15, 0x21, 0xee, 0x33, 0x51, 0xf2, 0xc3, 0x51, 0x19, - 0xed, 0x78, 0xf1, 0x68, 0xb3, 0x61, 0x4c, 0xab, 0xf5, 0x12, 0x1b, 0xb1, 0xc7, 0x79, 0x34, 0x9b, - 0xfc, 0xa5, 0xa1, 0x79, 0x25, 0xb8, 0x43, 0xfd, 0xb5, 0xbb, 0x74, 0x4b, 0x5c, 0xac, 0xb1, 0xc0, - 0x13, 0x1b, 0x5e, 0x94, 0xc2, 0x17, 0xd0, 0x28, 0x77, 0xbc, 0xb2, 0x53, 0x07, 0xcd, 0xe9, 0x66, - 0xc3, 0x38, 0x04, 0x9a, 0x72, 0x9c, 0xd8, 0xe0, 0x90, 0xce, 0xf6, 0x70, 0xd7, 0x6c, 0x9b, 0x68, - 0x4c, 0xb0, 0x3b, 0x8e, 0x57, 0x72, 0x3d, 0xc8, 0xce, 0x91, 0x66, 0xc3, 0x38, 0x1c, 0x15, 0x5b, - 0x59, 0x88, 0x7d, 0x50, 0x7e, 0x6e, 0x78, 0xf8, 0x6d, 0x34, 0x5a, 0x67, 0x81, 0x70, 0x78, 0x3e, - 0x27, 0xcf, 0xc7, 0x82, 0x99, 0x79, 0x0b, 0x86, 0x71, 0xc4, 0x21, 0x84, 0xfe, 0xc5, 0xa3, 0xb0, - 0x8f, 0x00, 0x5a, 0x89, 0x10, 0x1b, 0xd4, 0xc8, 0x57, 0x1a, 0x1c, 0xf7, 0x8c, 0x0c, 0x40, 0x6a, - 0x39, 0x9a, 0x52, 0x40, 0x2c, 0x10, 0x25, 0x2a, 0xad, 0x90, 0x8c, 0x8d, 0x50, 0xfb, 0xd7, 0x86, - 0x71, 0xaa, 0x87, 0x53, 0xb7, 0xe1, 0x89, 0x64, 0x1b, 0xed, 0xd5, 0x23, 0xf6, 0xa4, 0x1c, 0xba, - 0x11, 0xc0, 0xf2, 0xe4, 0xb3, 0xe1, 0x6c, 0xae, 0x1b, 0x81, 0xf8, 0xb7, 0x4b, 0xf3, 0x4e, 0x9c, - 0xea, 0x03, 0x32, 0xd5, 0x8b, 0xdd, 0x52, 0x1d, 0x32, 0xf5, 0x90, 0xeb, 0xf0, 0x71, 0x88, 0x03, - 0xcf, 0xe7, 0x24, 0x73, 0xea, 0x71, 0x88, 0x4d, 0xc4, 0x1e, 0x8b, 0x92, 0x41, 0xee, 0x47, 0xb7, - 0x67, 0x56, 0x1a, 0xa0, 0x3e, 0x3e, 0x3a, 0x1c, 0x6d, 0x98, 0xd6, 0xf2, 0x5c, 0xe9, 0xbb, 0x3c, - 0xc7, 0x5a, 0xf7, 0x5f, 0x5c, 0x9d, 0x43, 0xb0, 0x0d, 0xa1, 0x38, 0x27, 0x90, 0x9e, 0x5c, 0x74, - 0x7b, 0x9f, 0x07, 0xf2, 0x40, 0x43, 0x73, 0x99, 0xe6, 0xff, 0xc4, 0x6d, 0x7f, 0xf6, 0xe1, 0x21, - 0x34, 0x22, 0xf1, 0xf0, 0x27, 0x68, 0x44, 0x3e, 0xc1, 0x78, 0x9f, 0xc3, 0xd4, 0xd6, 0x02, 0xe9, - 0x8b, 0xdd, 0x1d, 0x55, 0x90, 0xe4, 0xb9, 0x4f, 0x7f, 0xfe, 0xe3, 0xfe, 0xf0, 0x3c, 0x9e, 0xb3, - 0x32, 0x1b, 0x55, 0xd5, 0xa7, 0x7c, 0xa1, 0xa1, 0xb1, 0xa8, 0x85, 0xc0, 0xa7, 0x3b, 0x68, 0xef, - 0xe9, 0x3f, 0xf4, 0x33, 0x3d, 0xf9, 0x02, 0xca, 0x82, 0x44, 0xf9, 0x3f, 0x36, 0xb2, 0x51, 0xe2, - 0xa6, 0x04, 0x7f, 0xa3, 0xa1, 0xc9, 0xd6, 0x9a, 0xe1, 0x17, 0x3b, 0x2c, 0x94, 0x59, 0x7d, 0x7d, - 0xa5, 0x8f, 0x19, 0x00, 0xb8, 0x2c, 0x01, 0x17, 0xf0, 0xf3, 0xd9, 0x80, 0xea, 0xe9, 0x8b, 0x0b, - 0x88, 0x3f, 0xd7, 0x50, 0x2e, 0x8c, 0x10, 0x9f, 0xea, 0x52, 0x8d, 0x08, 0x69, 0xa1, 0xab, 0x5f, - 0x6f, 0x20, 0x32, 0x4b, 0xd6, 0xc7, 0x70, 0x61, 0xdc, 0xc3, 0x0f, 0x35, 0x84, 0x92, 0x76, 0x0b, - 0x2f, 0x75, 0x59, 0xa6, 0xa5, 0xb9, 0xd3, 0x97, 0x7b, 0xf4, 0x06, 0xb4, 0x55, 0x89, 0x66, 0xe2, - 0xa5, 0x9e, 0xd0, 0x2c, 0xd5, 0xcb, 0xe1, 0xef, 0x35, 0x84, 0xdb, 0xfb, 0x2e, 0xbc, 0xda, 0xad, - 0x46, 0x59, 0x6d, 0x9f, 0xfe, 0x52, 0x9f, 0xb3, 0x80, 0xbc, 0x28, 0xc9, 0x5f, 0xc6, 0xe7, 0x7b, - 0x23, 0x57, 0xd5, 0x96, 0x3f, 0x93, 0x92, 0x3f, 0xd2, 0xd0, 0x44, 0xaa, 0xab, 0xc2, 0xcb, 0xdd, - 0x50, 0x5a, 0xba, 0x38, 0xdd, 0xec, 0xd5, 0x1d, 0x90, 0xcf, 0x4b, 0xe4, 0x55, 0x7c, 0xb6, 0x1f, - 0x64, 0xd5, 0x9b, 0xe1, 0x07, 0x1a, 0x1a, 0x8f, 0xdb, 0x13, 0xdc, 0xe9, 0xa0, 0xee, 0x6d, 0xd7, - 0xf4, 0xa5, 0xde, 0x9c, 0x07, 0xdc, 0x11, 0xe1, 0x64, 0x8e, 0x7f, 0xd4, 0xd0, 0xec, 0x1a, 0x17, - 0x6e, 0x8d, 0x0a, 0xa7, 0xed, 0xc9, 0xc7, 0xe7, 0x3a, 0x11, 0xec, 0xd3, 0x22, 0xe9, 0xab, 0xfd, - 0x4d, 0x02, 0xfc, 0x35, 0x89, 0x7f, 0x01, 0xbf, 0x92, 0x8d, 0x9f, 0x80, 0x3b, 0x40, 0x6b, 0xf1, - 0x1d, 0xea, 0x97, 0x9c, 0x50, 0x0c, 0xde, 0xa5, 0x92, 0xeb, 0xe1, 0x9f, 0x34, 0xa4, 0xef, 0x13, - 0xcf, 0x8d, 0x40, 0xe0, 0x3e, 0xd8, 0x92, 0xce, 0xa2, 0xe3, 0x4e, 0xdf, 0xff, 0x21, 0x26, 0xeb, - 0x32, 0xa4, 0xd7, 0xf0, 0xab, 0xff, 0x20, 0x24, 0x16, 0x88, 0xe2, 0xb5, 0xc7, 0x4f, 0x0b, 0xda, - 0x93, 0xa7, 0x05, 0xed, 0xf7, 0xa7, 0x05, 0xed, 0xcb, 0x67, 0x85, 0xa1, 0x27, 0xcf, 0x0a, 0x43, - 0xbf, 0x3c, 0x2b, 0x0c, 0xbd, 0x77, 0x2e, 0xf5, 0xe0, 0x6d, 0x07, 0x94, 0xd3, 0x7a, 0x95, 0x6e, - 0x72, 0xf8, 0xf4, 0x58, 0xd9, 0x69, 0x5d, 0x59, 0xbe, 0x80, 0x9b, 0xa3, 0xf2, 0xdf, 0xbc, 0x73, - 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x48, 0xf1, 0x33, 0x81, 0x11, 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 { - Pools(ctx context.Context, in *QueryPoolsRequest, opts ...grpc.CallOption) (*QueryPoolsResponse, error) - NumPools(ctx context.Context, in *QueryNumPoolsRequest, opts ...grpc.CallOption) (*QueryNumPoolsResponse, error) - TotalLiquidity(ctx context.Context, in *QueryTotalLiquidityRequest, opts ...grpc.CallOption) (*QueryTotalLiquidityResponse, error) - // Per Pool gRPC Endpoints - Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) - PoolParams(ctx context.Context, in *QueryPoolParamsRequest, opts ...grpc.CallOption) (*QueryPoolParamsResponse, error) - TotalPoolLiquidity(ctx context.Context, in *QueryTotalPoolLiquidityRequest, opts ...grpc.CallOption) (*QueryTotalPoolLiquidityResponse, error) - TotalShares(ctx context.Context, in *QueryTotalSharesRequest, opts ...grpc.CallOption) (*QueryTotalSharesResponse, error) - // SpotPrice defines a gRPC query handler that returns the spot price given - // a base denomination and a quote denomination. - SpotPrice(ctx context.Context, in *QuerySpotPriceRequest, opts ...grpc.CallOption) (*QuerySpotPriceResponse, error) - // Estimate the swap. - EstimateSwapExactAmountIn(ctx context.Context, in *QuerySwapExactAmountInRequest, opts ...grpc.CallOption) (*QuerySwapExactAmountInResponse, error) - EstimateSwapExactAmountOut(ctx context.Context, in *QuerySwapExactAmountOutRequest, opts ...grpc.CallOption) (*QuerySwapExactAmountOutResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Pools(ctx context.Context, in *QueryPoolsRequest, opts ...grpc.CallOption) (*QueryPoolsResponse, error) { - out := new(QueryPoolsResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/Pools", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) NumPools(ctx context.Context, in *QueryNumPoolsRequest, opts ...grpc.CallOption) (*QueryNumPoolsResponse, error) { - out := new(QueryNumPoolsResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/NumPools", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TotalLiquidity(ctx context.Context, in *QueryTotalLiquidityRequest, opts ...grpc.CallOption) (*QueryTotalLiquidityResponse, error) { - out := new(QueryTotalLiquidityResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/TotalLiquidity", in, out, opts...) - if err != nil { - return nil, err - } - 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, "/osmosis.gamm.v1beta1.Query/Pool", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) PoolParams(ctx context.Context, in *QueryPoolParamsRequest, opts ...grpc.CallOption) (*QueryPoolParamsResponse, error) { - out := new(QueryPoolParamsResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/PoolParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TotalPoolLiquidity(ctx context.Context, in *QueryTotalPoolLiquidityRequest, opts ...grpc.CallOption) (*QueryTotalPoolLiquidityResponse, error) { - out := new(QueryTotalPoolLiquidityResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/TotalPoolLiquidity", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TotalShares(ctx context.Context, in *QueryTotalSharesRequest, opts ...grpc.CallOption) (*QueryTotalSharesResponse, error) { - out := new(QueryTotalSharesResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/TotalShares", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) SpotPrice(ctx context.Context, in *QuerySpotPriceRequest, opts ...grpc.CallOption) (*QuerySpotPriceResponse, error) { - out := new(QuerySpotPriceResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/SpotPrice", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) EstimateSwapExactAmountIn(ctx context.Context, in *QuerySwapExactAmountInRequest, opts ...grpc.CallOption) (*QuerySwapExactAmountInResponse, error) { - out := new(QuerySwapExactAmountInResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/EstimateSwapExactAmountIn", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) EstimateSwapExactAmountOut(ctx context.Context, in *QuerySwapExactAmountOutRequest, opts ...grpc.CallOption) (*QuerySwapExactAmountOutResponse, error) { - out := new(QuerySwapExactAmountOutResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/EstimateSwapExactAmountOut", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - Pools(context.Context, *QueryPoolsRequest) (*QueryPoolsResponse, error) - NumPools(context.Context, *QueryNumPoolsRequest) (*QueryNumPoolsResponse, error) - TotalLiquidity(context.Context, *QueryTotalLiquidityRequest) (*QueryTotalLiquidityResponse, error) - // Per Pool gRPC Endpoints - Pool(context.Context, *QueryPoolRequest) (*QueryPoolResponse, error) - PoolParams(context.Context, *QueryPoolParamsRequest) (*QueryPoolParamsResponse, error) - TotalPoolLiquidity(context.Context, *QueryTotalPoolLiquidityRequest) (*QueryTotalPoolLiquidityResponse, error) - TotalShares(context.Context, *QueryTotalSharesRequest) (*QueryTotalSharesResponse, error) - // SpotPrice defines a gRPC query handler that returns the spot price given - // a base denomination and a quote denomination. - SpotPrice(context.Context, *QuerySpotPriceRequest) (*QuerySpotPriceResponse, error) - // Estimate the swap. - EstimateSwapExactAmountIn(context.Context, *QuerySwapExactAmountInRequest) (*QuerySwapExactAmountInResponse, error) - EstimateSwapExactAmountOut(context.Context, *QuerySwapExactAmountOutRequest) (*QuerySwapExactAmountOutResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Pools(ctx context.Context, req *QueryPoolsRequest) (*QueryPoolsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Pools not implemented") -} -func (*UnimplementedQueryServer) NumPools(ctx context.Context, req *QueryNumPoolsRequest) (*QueryNumPoolsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NumPools not implemented") -} -func (*UnimplementedQueryServer) TotalLiquidity(ctx context.Context, req *QueryTotalLiquidityRequest) (*QueryTotalLiquidityResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TotalLiquidity not implemented") -} -func (*UnimplementedQueryServer) Pool(ctx context.Context, req *QueryPoolRequest) (*QueryPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Pool not implemented") -} -func (*UnimplementedQueryServer) PoolParams(ctx context.Context, req *QueryPoolParamsRequest) (*QueryPoolParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PoolParams not implemented") -} -func (*UnimplementedQueryServer) TotalPoolLiquidity(ctx context.Context, req *QueryTotalPoolLiquidityRequest) (*QueryTotalPoolLiquidityResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TotalPoolLiquidity not implemented") -} -func (*UnimplementedQueryServer) TotalShares(ctx context.Context, req *QueryTotalSharesRequest) (*QueryTotalSharesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TotalShares not implemented") -} -func (*UnimplementedQueryServer) SpotPrice(ctx context.Context, req *QuerySpotPriceRequest) (*QuerySpotPriceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SpotPrice not implemented") -} -func (*UnimplementedQueryServer) EstimateSwapExactAmountIn(ctx context.Context, req *QuerySwapExactAmountInRequest) (*QuerySwapExactAmountInResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EstimateSwapExactAmountIn not implemented") -} -func (*UnimplementedQueryServer) EstimateSwapExactAmountOut(ctx context.Context, req *QuerySwapExactAmountOutRequest) (*QuerySwapExactAmountOutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EstimateSwapExactAmountOut not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Pools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPoolsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Pools(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/Pools", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Pools(ctx, req.(*QueryPoolsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_NumPools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryNumPoolsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).NumPools(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/NumPools", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).NumPools(ctx, req.(*QueryNumPoolsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TotalLiquidity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTotalLiquidityRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TotalLiquidity(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/TotalLiquidity", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TotalLiquidity(ctx, req.(*QueryTotalLiquidityRequest)) - } - return interceptor(ctx, in, info, handler) -} - -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 interceptor == nil { - return srv.(QueryServer).Pool(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/Pool", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Pool(ctx, req.(*QueryPoolRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_PoolParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPoolParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).PoolParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/PoolParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PoolParams(ctx, req.(*QueryPoolParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TotalPoolLiquidity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTotalPoolLiquidityRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TotalPoolLiquidity(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/TotalPoolLiquidity", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TotalPoolLiquidity(ctx, req.(*QueryTotalPoolLiquidityRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TotalShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTotalSharesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TotalShares(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/TotalShares", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TotalShares(ctx, req.(*QueryTotalSharesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_SpotPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySpotPriceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SpotPrice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/SpotPrice", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SpotPrice(ctx, req.(*QuerySpotPriceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_EstimateSwapExactAmountIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySwapExactAmountInRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).EstimateSwapExactAmountIn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/EstimateSwapExactAmountIn", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EstimateSwapExactAmountIn(ctx, req.(*QuerySwapExactAmountInRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_EstimateSwapExactAmountOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySwapExactAmountOutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).EstimateSwapExactAmountOut(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Query/EstimateSwapExactAmountOut", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EstimateSwapExactAmountOut(ctx, req.(*QuerySwapExactAmountOutRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "osmosis.gamm.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Pools", - Handler: _Query_Pools_Handler, - }, - { - MethodName: "NumPools", - Handler: _Query_NumPools_Handler, - }, - { - MethodName: "TotalLiquidity", - Handler: _Query_TotalLiquidity_Handler, - }, - { - MethodName: "Pool", - Handler: _Query_Pool_Handler, - }, - { - MethodName: "PoolParams", - Handler: _Query_PoolParams_Handler, - }, - { - MethodName: "TotalPoolLiquidity", - Handler: _Query_TotalPoolLiquidity_Handler, - }, - { - MethodName: "TotalShares", - Handler: _Query_TotalShares_Handler, - }, - { - MethodName: "SpotPrice", - Handler: _Query_SpotPrice_Handler, - }, - { - MethodName: "EstimateSwapExactAmountIn", - Handler: _Query_EstimateSwapExactAmountIn_Handler, - }, - { - MethodName: "EstimateSwapExactAmountOut", - Handler: _Query_EstimateSwapExactAmountOut_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "osmosis/gamm/v1beta1/query.proto", -} - -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 - if m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - 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 - } - 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 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 - } - return len(dAtA) - i, nil -} - -func (m *QueryPoolsRequest) 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 *QueryPoolsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPoolsRequest) 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 *QueryPoolsResponse) 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 *QueryPoolsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPoolsResponse) 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 len(m.Pools) > 0 { - for iNdEx := len(m.Pools) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pools[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 *QueryNumPoolsRequest) 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 *QueryNumPoolsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryNumPoolsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryNumPoolsResponse) 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 *QueryNumPoolsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryNumPoolsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumPools != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.NumPools)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryPoolParamsRequest) 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 *QueryPoolParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPoolParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryPoolParamsResponse) 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 *QueryPoolParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPoolParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - 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 *QueryTotalPoolLiquidityRequest) 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 *QueryTotalPoolLiquidityRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTotalPoolLiquidityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryTotalPoolLiquidityResponse) 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 *QueryTotalPoolLiquidityResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTotalPoolLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Liquidity) > 0 { - for iNdEx := len(m.Liquidity) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Liquidity[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 *QueryTotalSharesRequest) 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 *QueryTotalSharesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTotalSharesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryTotalSharesResponse) 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 *QueryTotalSharesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTotalSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.TotalShares.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 *QuerySpotPriceRequest) 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 *QuerySpotPriceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpotPriceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QuoteAssetDenom) > 0 { - i -= len(m.QuoteAssetDenom) - copy(dAtA[i:], m.QuoteAssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.QuoteAssetDenom))) - i-- - dAtA[i] = 0x1a - } - if len(m.BaseAssetDenom) > 0 { - i -= len(m.BaseAssetDenom) - copy(dAtA[i:], m.BaseAssetDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.BaseAssetDenom))) - i-- - dAtA[i] = 0x12 - } - if m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QuerySpotPriceResponse) 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 *QuerySpotPriceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpotPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SpotPrice) > 0 { - i -= len(m.SpotPrice) - copy(dAtA[i:], m.SpotPrice) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SpotPrice))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySwapExactAmountInRequest) 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 *QuerySwapExactAmountInRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySwapExactAmountInRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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] = 0x22 - } - } - 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 m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x10 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySwapExactAmountInResponse) 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 *QuerySwapExactAmountInResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySwapExactAmountInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenOutAmount.Size() - i -= size - if _, err := m.TokenOutAmount.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 *QuerySwapExactAmountOutRequest) 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 *QuerySwapExactAmountOutRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySwapExactAmountOutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = 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 - } - 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 m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x10 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySwapExactAmountOutResponse) 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 *QuerySwapExactAmountOutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySwapExactAmountOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenInAmount.Size() - i -= size - if _, err := m.TokenInAmount.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 *QueryTotalLiquidityRequest) 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 *QueryTotalLiquidityRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTotalLiquidityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryTotalLiquidityResponse) 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 *QueryTotalLiquidityResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTotalLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Liquidity) > 0 { - for iNdEx := len(m.Liquidity) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Liquidity[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 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 *QueryPoolRequest) 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 *QueryPoolsRequest) 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 *QueryPoolsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Pools) > 0 { - for _, e := range m.Pools { - 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 *QueryNumPoolsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryNumPoolsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NumPools != 0 { - n += 1 + sovQuery(uint64(m.NumPools)) - } - return n -} - -func (m *QueryPoolParamsRequest) 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 *QueryPoolParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryTotalPoolLiquidityRequest) 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 *QueryTotalPoolLiquidityResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Liquidity) > 0 { - for _, e := range m.Liquidity { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryTotalSharesRequest) 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 *QueryTotalSharesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TotalShares.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QuerySpotPriceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PoolId != 0 { - n += 1 + sovQuery(uint64(m.PoolId)) - } - l = len(m.BaseAssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.QuoteAssetDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySpotPriceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SpotPrice) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySwapExactAmountInRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.PoolId != 0 { - n += 1 + sovQuery(uint64(m.PoolId)) - } - l = len(m.TokenIn) - 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)) - } - } - return n -} - -func (m *QuerySwapExactAmountInResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TokenOutAmount.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QuerySwapExactAmountOutRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.PoolId != 0 { - n += 1 + sovQuery(uint64(m.PoolId)) - } - if len(m.Routes) > 0 { - for _, e := range m.Routes { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - l = len(m.TokenOut) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySwapExactAmountOutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TokenInAmount.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryTotalLiquidityRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryTotalLiquidityResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Liquidity) > 0 { - for _, e := range m.Liquidity { - l = e.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 *QueryPoolRequest) 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: QueryPoolRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolRequest: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *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 - } - 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 Pool", 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.Pool == nil { - m.Pool = &types.Any{} - } - 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 - } - 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 *QueryPoolsRequest) 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: QueryPoolsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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 - 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 *QueryPoolsResponse) 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: QueryPoolsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pools", 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.Pools = append(m.Pools, &types.Any{}) - if err := m.Pools[len(m.Pools)-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 *QueryNumPoolsRequest) 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: QueryNumPoolsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNumPoolsRequest: 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 *QueryNumPoolsResponse) 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: QueryNumPoolsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNumPoolsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumPools", wireType) - } - m.NumPools = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumPools |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryPoolParamsRequest) 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: QueryPoolParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolParamsRequest: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryPoolParamsResponse) 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: QueryPoolParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolParamsResponse: 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 m.Params == nil { - m.Params = &types.Any{} - } - 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 *QueryTotalPoolLiquidityRequest) 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: QueryTotalPoolLiquidityRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTotalPoolLiquidityRequest: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTotalPoolLiquidityResponse) 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: QueryTotalPoolLiquidityResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTotalPoolLiquidityResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Liquidity", 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.Liquidity = append(m.Liquidity, types1.Coin{}) - if err := m.Liquidity[len(m.Liquidity)-1].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 *QueryTotalSharesRequest) 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: QueryTotalSharesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTotalSharesRequest: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTotalSharesResponse) 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: QueryTotalSharesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTotalSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalShares", 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.TotalShares.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 *QuerySpotPriceRequest) 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: QuerySpotPriceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpotPriceRequest: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseAssetDenom", 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.BaseAssetDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuoteAssetDenom", 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.QuoteAssetDenom = 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 *QuerySpotPriceResponse) 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: QuerySpotPriceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpotPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpotPrice", 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.SpotPrice = 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 *QuerySwapExactAmountInRequest) 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: QuerySwapExactAmountInRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySwapExactAmountInRequest: 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 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.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(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 Routes", 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.Routes = append(m.Routes, SwapAmountInRoute{}) - if err := m.Routes[len(m.Routes)-1].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 *QuerySwapExactAmountInResponse) 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: QuerySwapExactAmountInResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySwapExactAmountInResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOutAmount", 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.TokenOutAmount.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 *QuerySwapExactAmountOutRequest) 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: QuerySwapExactAmountOutRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySwapExactAmountOutRequest: 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 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.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Routes", 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.Routes = append(m.Routes, SwapAmountOutRoute{}) - 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 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 postIndex > l { - return io.ErrUnexpectedEOF - } - m.TokenOut = 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 *QuerySwapExactAmountOutResponse) 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: QuerySwapExactAmountOutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySwapExactAmountOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInAmount", 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.TokenInAmount.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 *QueryTotalLiquidityRequest) 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: QueryTotalLiquidityRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTotalLiquidityRequest: 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 *QueryTotalLiquidityResponse) 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: QueryTotalLiquidityResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTotalLiquidityResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Liquidity", 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.Liquidity = append(m.Liquidity, types1.Coin{}) - if err := m.Liquidity[len(m.Liquidity)-1].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/osmosis/gamm/types/query.pb.gw.go b/osmosis/gamm/types/query.pb.gw.go deleted file mode 100644 index b6bbea8d0..000000000 --- a/osmosis/gamm/types/query.pb.gw.go +++ /dev/null @@ -1,1062 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: osmosis/gamm/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 - -var ( - filter_Query_Pools_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Pools_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolsRequest - 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_Pools_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Pools(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Pools_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolsRequest - 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_Pools_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Pools(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_NumPools_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryNumPoolsRequest - var metadata runtime.ServerMetadata - - msg, err := client.NumPools(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_NumPools_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryNumPoolsRequest - var metadata runtime.ServerMetadata - - msg, err := server.NumPools(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_TotalLiquidity_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTotalLiquidityRequest - var metadata runtime.ServerMetadata - - msg, err := client.TotalLiquidity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TotalLiquidity_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTotalLiquidityRequest - var metadata runtime.ServerMetadata - - msg, err := server.TotalLiquidity(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Pool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := client.Pool(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Pool_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := server.Pool(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_PoolParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolParamsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := client.PoolParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_PoolParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolParamsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := server.PoolParams(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_TotalPoolLiquidity_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTotalPoolLiquidityRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := client.TotalPoolLiquidity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TotalPoolLiquidity_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTotalPoolLiquidityRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := server.TotalPoolLiquidity(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_TotalShares_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTotalSharesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := client.TotalShares(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TotalShares_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTotalSharesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := server.TotalShares(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_SpotPrice_0 = &utilities.DoubleArray{Encoding: map[string]int{"pool_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_SpotPrice_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpotPriceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_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_SpotPrice_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SpotPrice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SpotPrice_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpotPriceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_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_SpotPrice_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SpotPrice(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_EstimateSwapExactAmountIn_0 = &utilities.DoubleArray{Encoding: map[string]int{"pool_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_EstimateSwapExactAmountIn_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySwapExactAmountInRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_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_EstimateSwapExactAmountIn_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.EstimateSwapExactAmountIn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_EstimateSwapExactAmountIn_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySwapExactAmountInRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_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_EstimateSwapExactAmountIn_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.EstimateSwapExactAmountIn(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_EstimateSwapExactAmountOut_0 = &utilities.DoubleArray{Encoding: map[string]int{"pool_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_EstimateSwapExactAmountOut_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySwapExactAmountOutRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_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_EstimateSwapExactAmountOut_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.EstimateSwapExactAmountOut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_EstimateSwapExactAmountOut_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySwapExactAmountOutRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_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_EstimateSwapExactAmountOut_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.EstimateSwapExactAmountOut(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_Pools_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_Pools_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_Pools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_NumPools_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_NumPools_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_NumPools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TotalLiquidity_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_TotalLiquidity_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_TotalLiquidity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Pool_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_Pool_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_Pool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_PoolParams_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_PoolParams_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_PoolParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TotalPoolLiquidity_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_TotalPoolLiquidity_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_TotalPoolLiquidity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TotalShares_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_TotalShares_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_TotalShares_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SpotPrice_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_SpotPrice_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_SpotPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_EstimateSwapExactAmountIn_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_EstimateSwapExactAmountIn_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_EstimateSwapExactAmountIn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_EstimateSwapExactAmountOut_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_EstimateSwapExactAmountOut_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_EstimateSwapExactAmountOut_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_Pools_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_Pools_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_Pools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_NumPools_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_NumPools_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_NumPools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TotalLiquidity_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_TotalLiquidity_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_TotalLiquidity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Pool_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_Pool_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_Pool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_PoolParams_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_PoolParams_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_PoolParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TotalPoolLiquidity_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_TotalPoolLiquidity_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_TotalPoolLiquidity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TotalShares_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_TotalShares_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_TotalShares_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SpotPrice_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_SpotPrice_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_SpotPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_EstimateSwapExactAmountIn_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_EstimateSwapExactAmountIn_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_EstimateSwapExactAmountIn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_EstimateSwapExactAmountOut_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_EstimateSwapExactAmountOut_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_EstimateSwapExactAmountOut_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Pools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "gamm", "v1beta1", "pools"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_NumPools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "gamm", "v1beta1", "num_pools"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_TotalLiquidity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "gamm", "v1beta1", "total_liquidity"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Pool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "gamm", "v1beta1", "pools", "pool_id"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_PoolParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"osmosis", "gamm", "v1beta1", "pools", "pool_id", "params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_TotalPoolLiquidity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"osmosis", "gamm", "v1beta1", "pools", "pool_id", "total_pool_liquidity"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_TotalShares_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"osmosis", "gamm", "v1beta1", "pools", "pool_id", "total_shares"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_SpotPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"osmosis", "gamm", "v1beta1", "pools", "pool_id", "prices"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_EstimateSwapExactAmountIn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 2, 5}, []string{"osmosis", "gamm", "v1beta1", "pool_id", "estimate", "swap_exact_amount_in"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_EstimateSwapExactAmountOut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 2, 5}, []string{"osmosis", "gamm", "v1beta1", "pool_id", "estimate", "swap_exact_amount_out"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_Pools_0 = runtime.ForwardResponseMessage - - forward_Query_NumPools_0 = runtime.ForwardResponseMessage - - forward_Query_TotalLiquidity_0 = runtime.ForwardResponseMessage - - forward_Query_Pool_0 = runtime.ForwardResponseMessage - - forward_Query_PoolParams_0 = runtime.ForwardResponseMessage - - forward_Query_TotalPoolLiquidity_0 = runtime.ForwardResponseMessage - - forward_Query_TotalShares_0 = runtime.ForwardResponseMessage - - forward_Query_SpotPrice_0 = runtime.ForwardResponseMessage - - forward_Query_EstimateSwapExactAmountIn_0 = runtime.ForwardResponseMessage - - forward_Query_EstimateSwapExactAmountOut_0 = runtime.ForwardResponseMessage -) diff --git a/osmosis/gamm/types/tx.pb.go b/osmosis/gamm/types/tx.pb.go deleted file mode 100644 index ee1f7a23d..000000000 --- a/osmosis/gamm/types/tx.pb.go +++ /dev/null @@ -1,4971 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/gamm/v1beta1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - 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 - -// ===================== MsgJoinPool -// This is really MsgJoinPoolNoSwap -type MsgJoinPool struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - ShareOutAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=share_out_amount,json=shareOutAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_out_amount" yaml:"pool_amount_out"` - TokenInMaxs []types.Coin `protobuf:"bytes,4,rep,name=token_in_maxs,json=tokenInMaxs,proto3" json:"token_in_maxs" yaml:"token_in_max_amounts"` -} - -func (m *MsgJoinPool) Reset() { *m = MsgJoinPool{} } -func (m *MsgJoinPool) String() string { return proto.CompactTextString(m) } -func (*MsgJoinPool) ProtoMessage() {} -func (*MsgJoinPool) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{0} -} -func (m *MsgJoinPool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgJoinPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgJoinPool.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 *MsgJoinPool) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgJoinPool.Merge(m, src) -} -func (m *MsgJoinPool) XXX_Size() int { - return m.Size() -} -func (m *MsgJoinPool) XXX_DiscardUnknown() { - xxx_messageInfo_MsgJoinPool.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgJoinPool proto.InternalMessageInfo - -func (m *MsgJoinPool) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgJoinPool) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *MsgJoinPool) GetTokenInMaxs() []types.Coin { - if m != nil { - return m.TokenInMaxs - } - return nil -} - -type MsgJoinPoolResponse struct { - ShareOutAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=share_out_amount,json=shareOutAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_out_amount" yaml:"share_out_amount"` - TokenIn []types.Coin `protobuf:"bytes,2,rep,name=token_in,json=tokenIn,proto3" json:"token_in" yaml:"token_in"` -} - -func (m *MsgJoinPoolResponse) Reset() { *m = MsgJoinPoolResponse{} } -func (m *MsgJoinPoolResponse) String() string { return proto.CompactTextString(m) } -func (*MsgJoinPoolResponse) ProtoMessage() {} -func (*MsgJoinPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{1} -} -func (m *MsgJoinPoolResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgJoinPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgJoinPoolResponse.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 *MsgJoinPoolResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgJoinPoolResponse.Merge(m, src) -} -func (m *MsgJoinPoolResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgJoinPoolResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgJoinPoolResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgJoinPoolResponse proto.InternalMessageInfo - -func (m *MsgJoinPoolResponse) GetTokenIn() []types.Coin { - if m != nil { - return m.TokenIn - } - return nil -} - -// ===================== MsgExitPool -type MsgExitPool struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - ShareInAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=share_in_amount,json=shareInAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_in_amount" yaml:"share_in_amount"` - TokenOutMins []types.Coin `protobuf:"bytes,4,rep,name=token_out_mins,json=tokenOutMins,proto3" json:"token_out_mins" yaml:"token_out_min_amounts"` -} - -func (m *MsgExitPool) Reset() { *m = MsgExitPool{} } -func (m *MsgExitPool) String() string { return proto.CompactTextString(m) } -func (*MsgExitPool) ProtoMessage() {} -func (*MsgExitPool) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{2} -} -func (m *MsgExitPool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExitPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExitPool.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 *MsgExitPool) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExitPool.Merge(m, src) -} -func (m *MsgExitPool) XXX_Size() int { - return m.Size() -} -func (m *MsgExitPool) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExitPool.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExitPool proto.InternalMessageInfo - -func (m *MsgExitPool) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgExitPool) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *MsgExitPool) GetTokenOutMins() []types.Coin { - if m != nil { - return m.TokenOutMins - } - return nil -} - -type MsgExitPoolResponse struct { - TokenOut []types.Coin `protobuf:"bytes,1,rep,name=token_out,json=tokenOut,proto3" json:"token_out" yaml:"token_out"` -} - -func (m *MsgExitPoolResponse) Reset() { *m = MsgExitPoolResponse{} } -func (m *MsgExitPoolResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExitPoolResponse) ProtoMessage() {} -func (*MsgExitPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{3} -} -func (m *MsgExitPoolResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExitPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExitPoolResponse.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 *MsgExitPoolResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExitPoolResponse.Merge(m, src) -} -func (m *MsgExitPoolResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgExitPoolResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExitPoolResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExitPoolResponse proto.InternalMessageInfo - -func (m *MsgExitPoolResponse) GetTokenOut() []types.Coin { - if m != nil { - return m.TokenOut - } - return nil -} - -// ===================== MsgSwapExactAmountIn -type SwapAmountInRoute struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - TokenOutDenom string `protobuf:"bytes,2,opt,name=token_out_denom,json=tokenOutDenom,proto3" json:"token_out_denom,omitempty" yaml:"token_out_denom"` -} - -func (m *SwapAmountInRoute) Reset() { *m = SwapAmountInRoute{} } -func (m *SwapAmountInRoute) String() string { return proto.CompactTextString(m) } -func (*SwapAmountInRoute) ProtoMessage() {} -func (*SwapAmountInRoute) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{4} -} -func (m *SwapAmountInRoute) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SwapAmountInRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SwapAmountInRoute.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 *SwapAmountInRoute) XXX_Merge(src proto.Message) { - xxx_messageInfo_SwapAmountInRoute.Merge(m, src) -} -func (m *SwapAmountInRoute) XXX_Size() int { - return m.Size() -} -func (m *SwapAmountInRoute) XXX_DiscardUnknown() { - xxx_messageInfo_SwapAmountInRoute.DiscardUnknown(m) -} - -var xxx_messageInfo_SwapAmountInRoute proto.InternalMessageInfo - -func (m *SwapAmountInRoute) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *SwapAmountInRoute) GetTokenOutDenom() string { - if m != nil { - return m.TokenOutDenom - } - return "" -} - -type MsgSwapExactAmountIn struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - Routes []SwapAmountInRoute `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes"` - TokenIn types.Coin `protobuf:"bytes,3,opt,name=token_in,json=tokenIn,proto3" json:"token_in" yaml:"token_in"` - TokenOutMinAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=token_out_min_amount,json=tokenOutMinAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_out_min_amount" yaml:"token_out_min_amount"` -} - -func (m *MsgSwapExactAmountIn) Reset() { *m = MsgSwapExactAmountIn{} } -func (m *MsgSwapExactAmountIn) String() string { return proto.CompactTextString(m) } -func (*MsgSwapExactAmountIn) ProtoMessage() {} -func (*MsgSwapExactAmountIn) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{5} -} -func (m *MsgSwapExactAmountIn) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSwapExactAmountIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSwapExactAmountIn.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 *MsgSwapExactAmountIn) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSwapExactAmountIn.Merge(m, src) -} -func (m *MsgSwapExactAmountIn) XXX_Size() int { - return m.Size() -} -func (m *MsgSwapExactAmountIn) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSwapExactAmountIn.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSwapExactAmountIn proto.InternalMessageInfo - -func (m *MsgSwapExactAmountIn) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgSwapExactAmountIn) GetRoutes() []SwapAmountInRoute { - if m != nil { - return m.Routes - } - return nil -} - -func (m *MsgSwapExactAmountIn) GetTokenIn() types.Coin { - if m != nil { - return m.TokenIn - } - return types.Coin{} -} - -type MsgSwapExactAmountInResponse struct { - TokenOutAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=token_out_amount,json=tokenOutAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_out_amount" yaml:"token_out_amount"` -} - -func (m *MsgSwapExactAmountInResponse) Reset() { *m = MsgSwapExactAmountInResponse{} } -func (m *MsgSwapExactAmountInResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSwapExactAmountInResponse) ProtoMessage() {} -func (*MsgSwapExactAmountInResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{6} -} -func (m *MsgSwapExactAmountInResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSwapExactAmountInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSwapExactAmountInResponse.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 *MsgSwapExactAmountInResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSwapExactAmountInResponse.Merge(m, src) -} -func (m *MsgSwapExactAmountInResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSwapExactAmountInResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSwapExactAmountInResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSwapExactAmountInResponse proto.InternalMessageInfo - -// ===================== MsgSwapExactAmountOut -type SwapAmountOutRoute struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - TokenInDenom string `protobuf:"bytes,2,opt,name=token_in_denom,json=tokenInDenom,proto3" json:"token_in_denom,omitempty" yaml:"token_out_denom"` -} - -func (m *SwapAmountOutRoute) Reset() { *m = SwapAmountOutRoute{} } -func (m *SwapAmountOutRoute) String() string { return proto.CompactTextString(m) } -func (*SwapAmountOutRoute) ProtoMessage() {} -func (*SwapAmountOutRoute) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{7} -} -func (m *SwapAmountOutRoute) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SwapAmountOutRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SwapAmountOutRoute.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 *SwapAmountOutRoute) XXX_Merge(src proto.Message) { - xxx_messageInfo_SwapAmountOutRoute.Merge(m, src) -} -func (m *SwapAmountOutRoute) XXX_Size() int { - return m.Size() -} -func (m *SwapAmountOutRoute) XXX_DiscardUnknown() { - xxx_messageInfo_SwapAmountOutRoute.DiscardUnknown(m) -} - -var xxx_messageInfo_SwapAmountOutRoute proto.InternalMessageInfo - -func (m *SwapAmountOutRoute) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *SwapAmountOutRoute) GetTokenInDenom() string { - if m != nil { - return m.TokenInDenom - } - return "" -} - -type MsgSwapExactAmountOut struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - Routes []SwapAmountOutRoute `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes"` - TokenInMaxAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=token_in_max_amount,json=tokenInMaxAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_in_max_amount" yaml:"token_in_max_amount"` - TokenOut types.Coin `protobuf:"bytes,4,opt,name=token_out,json=tokenOut,proto3" json:"token_out" yaml:"token_out"` -} - -func (m *MsgSwapExactAmountOut) Reset() { *m = MsgSwapExactAmountOut{} } -func (m *MsgSwapExactAmountOut) String() string { return proto.CompactTextString(m) } -func (*MsgSwapExactAmountOut) ProtoMessage() {} -func (*MsgSwapExactAmountOut) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{8} -} -func (m *MsgSwapExactAmountOut) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSwapExactAmountOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSwapExactAmountOut.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 *MsgSwapExactAmountOut) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSwapExactAmountOut.Merge(m, src) -} -func (m *MsgSwapExactAmountOut) XXX_Size() int { - return m.Size() -} -func (m *MsgSwapExactAmountOut) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSwapExactAmountOut.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSwapExactAmountOut proto.InternalMessageInfo - -func (m *MsgSwapExactAmountOut) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgSwapExactAmountOut) GetRoutes() []SwapAmountOutRoute { - if m != nil { - return m.Routes - } - return nil -} - -func (m *MsgSwapExactAmountOut) GetTokenOut() types.Coin { - if m != nil { - return m.TokenOut - } - return types.Coin{} -} - -type MsgSwapExactAmountOutResponse struct { - TokenInAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=token_in_amount,json=tokenInAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_in_amount" yaml:"token_in_amount"` -} - -func (m *MsgSwapExactAmountOutResponse) Reset() { *m = MsgSwapExactAmountOutResponse{} } -func (m *MsgSwapExactAmountOutResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSwapExactAmountOutResponse) ProtoMessage() {} -func (*MsgSwapExactAmountOutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{9} -} -func (m *MsgSwapExactAmountOutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSwapExactAmountOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSwapExactAmountOutResponse.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 *MsgSwapExactAmountOutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSwapExactAmountOutResponse.Merge(m, src) -} -func (m *MsgSwapExactAmountOutResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSwapExactAmountOutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSwapExactAmountOutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSwapExactAmountOutResponse proto.InternalMessageInfo - -// ===================== MsgJoinSwapExternAmountIn -// TODO: Rename to MsgJoinSwapExactAmountIn -type MsgJoinSwapExternAmountIn struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - TokenIn types.Coin `protobuf:"bytes,3,opt,name=token_in,json=tokenIn,proto3" json:"token_in" yaml:"token_in"` - ShareOutMinAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=share_out_min_amount,json=shareOutMinAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_out_min_amount" yaml:"share_out_min_amount"` -} - -func (m *MsgJoinSwapExternAmountIn) Reset() { *m = MsgJoinSwapExternAmountIn{} } -func (m *MsgJoinSwapExternAmountIn) String() string { return proto.CompactTextString(m) } -func (*MsgJoinSwapExternAmountIn) ProtoMessage() {} -func (*MsgJoinSwapExternAmountIn) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{10} -} -func (m *MsgJoinSwapExternAmountIn) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgJoinSwapExternAmountIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgJoinSwapExternAmountIn.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 *MsgJoinSwapExternAmountIn) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgJoinSwapExternAmountIn.Merge(m, src) -} -func (m *MsgJoinSwapExternAmountIn) XXX_Size() int { - return m.Size() -} -func (m *MsgJoinSwapExternAmountIn) XXX_DiscardUnknown() { - xxx_messageInfo_MsgJoinSwapExternAmountIn.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgJoinSwapExternAmountIn proto.InternalMessageInfo - -func (m *MsgJoinSwapExternAmountIn) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgJoinSwapExternAmountIn) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *MsgJoinSwapExternAmountIn) GetTokenIn() types.Coin { - if m != nil { - return m.TokenIn - } - return types.Coin{} -} - -type MsgJoinSwapExternAmountInResponse struct { - ShareOutAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=share_out_amount,json=shareOutAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_out_amount" yaml:"share_out_amount"` -} - -func (m *MsgJoinSwapExternAmountInResponse) Reset() { *m = MsgJoinSwapExternAmountInResponse{} } -func (m *MsgJoinSwapExternAmountInResponse) String() string { return proto.CompactTextString(m) } -func (*MsgJoinSwapExternAmountInResponse) ProtoMessage() {} -func (*MsgJoinSwapExternAmountInResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{11} -} -func (m *MsgJoinSwapExternAmountInResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgJoinSwapExternAmountInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgJoinSwapExternAmountInResponse.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 *MsgJoinSwapExternAmountInResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgJoinSwapExternAmountInResponse.Merge(m, src) -} -func (m *MsgJoinSwapExternAmountInResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgJoinSwapExternAmountInResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgJoinSwapExternAmountInResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgJoinSwapExternAmountInResponse proto.InternalMessageInfo - -// ===================== MsgJoinSwapShareAmountOut -type MsgJoinSwapShareAmountOut struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - TokenInDenom string `protobuf:"bytes,3,opt,name=token_in_denom,json=tokenInDenom,proto3" json:"token_in_denom,omitempty" yaml:"token_in_denom"` - ShareOutAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=share_out_amount,json=shareOutAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_out_amount" yaml:"share_out_amount"` - TokenInMaxAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=token_in_max_amount,json=tokenInMaxAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_in_max_amount" yaml:"token_in_max_amount"` -} - -func (m *MsgJoinSwapShareAmountOut) Reset() { *m = MsgJoinSwapShareAmountOut{} } -func (m *MsgJoinSwapShareAmountOut) String() string { return proto.CompactTextString(m) } -func (*MsgJoinSwapShareAmountOut) ProtoMessage() {} -func (*MsgJoinSwapShareAmountOut) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{12} -} -func (m *MsgJoinSwapShareAmountOut) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgJoinSwapShareAmountOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgJoinSwapShareAmountOut.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 *MsgJoinSwapShareAmountOut) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgJoinSwapShareAmountOut.Merge(m, src) -} -func (m *MsgJoinSwapShareAmountOut) XXX_Size() int { - return m.Size() -} -func (m *MsgJoinSwapShareAmountOut) XXX_DiscardUnknown() { - xxx_messageInfo_MsgJoinSwapShareAmountOut.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgJoinSwapShareAmountOut proto.InternalMessageInfo - -func (m *MsgJoinSwapShareAmountOut) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgJoinSwapShareAmountOut) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *MsgJoinSwapShareAmountOut) GetTokenInDenom() string { - if m != nil { - return m.TokenInDenom - } - return "" -} - -type MsgJoinSwapShareAmountOutResponse struct { - TokenInAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=token_in_amount,json=tokenInAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_in_amount" yaml:"token_in_amount"` -} - -func (m *MsgJoinSwapShareAmountOutResponse) Reset() { *m = MsgJoinSwapShareAmountOutResponse{} } -func (m *MsgJoinSwapShareAmountOutResponse) String() string { return proto.CompactTextString(m) } -func (*MsgJoinSwapShareAmountOutResponse) ProtoMessage() {} -func (*MsgJoinSwapShareAmountOutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{13} -} -func (m *MsgJoinSwapShareAmountOutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgJoinSwapShareAmountOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgJoinSwapShareAmountOutResponse.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 *MsgJoinSwapShareAmountOutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgJoinSwapShareAmountOutResponse.Merge(m, src) -} -func (m *MsgJoinSwapShareAmountOutResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgJoinSwapShareAmountOutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgJoinSwapShareAmountOutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgJoinSwapShareAmountOutResponse proto.InternalMessageInfo - -// ===================== MsgExitSwapShareAmountIn -type MsgExitSwapShareAmountIn struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - TokenOutDenom string `protobuf:"bytes,3,opt,name=token_out_denom,json=tokenOutDenom,proto3" json:"token_out_denom,omitempty" yaml:"token_out_denom"` - ShareInAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=share_in_amount,json=shareInAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_in_amount" yaml:"share_in_amount"` - TokenOutMinAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=token_out_min_amount,json=tokenOutMinAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_out_min_amount" yaml:"token_out_min_amount"` -} - -func (m *MsgExitSwapShareAmountIn) Reset() { *m = MsgExitSwapShareAmountIn{} } -func (m *MsgExitSwapShareAmountIn) String() string { return proto.CompactTextString(m) } -func (*MsgExitSwapShareAmountIn) ProtoMessage() {} -func (*MsgExitSwapShareAmountIn) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{14} -} -func (m *MsgExitSwapShareAmountIn) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExitSwapShareAmountIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExitSwapShareAmountIn.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 *MsgExitSwapShareAmountIn) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExitSwapShareAmountIn.Merge(m, src) -} -func (m *MsgExitSwapShareAmountIn) XXX_Size() int { - return m.Size() -} -func (m *MsgExitSwapShareAmountIn) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExitSwapShareAmountIn.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExitSwapShareAmountIn proto.InternalMessageInfo - -func (m *MsgExitSwapShareAmountIn) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgExitSwapShareAmountIn) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *MsgExitSwapShareAmountIn) GetTokenOutDenom() string { - if m != nil { - return m.TokenOutDenom - } - return "" -} - -type MsgExitSwapShareAmountInResponse struct { - TokenOutAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=token_out_amount,json=tokenOutAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"token_out_amount" yaml:"token_out_amount"` -} - -func (m *MsgExitSwapShareAmountInResponse) Reset() { *m = MsgExitSwapShareAmountInResponse{} } -func (m *MsgExitSwapShareAmountInResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExitSwapShareAmountInResponse) ProtoMessage() {} -func (*MsgExitSwapShareAmountInResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{15} -} -func (m *MsgExitSwapShareAmountInResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExitSwapShareAmountInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExitSwapShareAmountInResponse.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 *MsgExitSwapShareAmountInResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExitSwapShareAmountInResponse.Merge(m, src) -} -func (m *MsgExitSwapShareAmountInResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgExitSwapShareAmountInResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExitSwapShareAmountInResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExitSwapShareAmountInResponse proto.InternalMessageInfo - -// ===================== MsgExitSwapExternAmountOut -type MsgExitSwapExternAmountOut struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` - PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - TokenOut types.Coin `protobuf:"bytes,3,opt,name=token_out,json=tokenOut,proto3" json:"token_out" yaml:"token_out"` - ShareInMaxAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=share_in_max_amount,json=shareInMaxAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_in_max_amount" yaml:"share_in_max_amount"` -} - -func (m *MsgExitSwapExternAmountOut) Reset() { *m = MsgExitSwapExternAmountOut{} } -func (m *MsgExitSwapExternAmountOut) String() string { return proto.CompactTextString(m) } -func (*MsgExitSwapExternAmountOut) ProtoMessage() {} -func (*MsgExitSwapExternAmountOut) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{16} -} -func (m *MsgExitSwapExternAmountOut) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExitSwapExternAmountOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExitSwapExternAmountOut.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 *MsgExitSwapExternAmountOut) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExitSwapExternAmountOut.Merge(m, src) -} -func (m *MsgExitSwapExternAmountOut) XXX_Size() int { - return m.Size() -} -func (m *MsgExitSwapExternAmountOut) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExitSwapExternAmountOut.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExitSwapExternAmountOut proto.InternalMessageInfo - -func (m *MsgExitSwapExternAmountOut) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgExitSwapExternAmountOut) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *MsgExitSwapExternAmountOut) GetTokenOut() types.Coin { - if m != nil { - return m.TokenOut - } - return types.Coin{} -} - -type MsgExitSwapExternAmountOutResponse struct { - ShareInAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=share_in_amount,json=shareInAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_in_amount" yaml:"share_in_amount"` -} - -func (m *MsgExitSwapExternAmountOutResponse) Reset() { *m = MsgExitSwapExternAmountOutResponse{} } -func (m *MsgExitSwapExternAmountOutResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExitSwapExternAmountOutResponse) ProtoMessage() {} -func (*MsgExitSwapExternAmountOutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{17} -} -func (m *MsgExitSwapExternAmountOutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExitSwapExternAmountOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExitSwapExternAmountOutResponse.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 *MsgExitSwapExternAmountOutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExitSwapExternAmountOutResponse.Merge(m, src) -} -func (m *MsgExitSwapExternAmountOutResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgExitSwapExternAmountOutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExitSwapExternAmountOutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExitSwapExternAmountOutResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgJoinPool)(nil), "osmosis.gamm.v1beta1.MsgJoinPool") - proto.RegisterType((*MsgJoinPoolResponse)(nil), "osmosis.gamm.v1beta1.MsgJoinPoolResponse") - proto.RegisterType((*MsgExitPool)(nil), "osmosis.gamm.v1beta1.MsgExitPool") - proto.RegisterType((*MsgExitPoolResponse)(nil), "osmosis.gamm.v1beta1.MsgExitPoolResponse") - proto.RegisterType((*SwapAmountInRoute)(nil), "osmosis.gamm.v1beta1.SwapAmountInRoute") - proto.RegisterType((*MsgSwapExactAmountIn)(nil), "osmosis.gamm.v1beta1.MsgSwapExactAmountIn") - proto.RegisterType((*MsgSwapExactAmountInResponse)(nil), "osmosis.gamm.v1beta1.MsgSwapExactAmountInResponse") - proto.RegisterType((*SwapAmountOutRoute)(nil), "osmosis.gamm.v1beta1.SwapAmountOutRoute") - proto.RegisterType((*MsgSwapExactAmountOut)(nil), "osmosis.gamm.v1beta1.MsgSwapExactAmountOut") - proto.RegisterType((*MsgSwapExactAmountOutResponse)(nil), "osmosis.gamm.v1beta1.MsgSwapExactAmountOutResponse") - proto.RegisterType((*MsgJoinSwapExternAmountIn)(nil), "osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn") - proto.RegisterType((*MsgJoinSwapExternAmountInResponse)(nil), "osmosis.gamm.v1beta1.MsgJoinSwapExternAmountInResponse") - proto.RegisterType((*MsgJoinSwapShareAmountOut)(nil), "osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut") - proto.RegisterType((*MsgJoinSwapShareAmountOutResponse)(nil), "osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOutResponse") - proto.RegisterType((*MsgExitSwapShareAmountIn)(nil), "osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn") - proto.RegisterType((*MsgExitSwapShareAmountInResponse)(nil), "osmosis.gamm.v1beta1.MsgExitSwapShareAmountInResponse") - proto.RegisterType((*MsgExitSwapExternAmountOut)(nil), "osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut") - proto.RegisterType((*MsgExitSwapExternAmountOutResponse)(nil), "osmosis.gamm.v1beta1.MsgExitSwapExternAmountOutResponse") -} - -func init() { proto.RegisterFile("osmosis/gamm/v1beta1/tx.proto", fileDescriptor_cfc8fd3ac7df3247) } - -var fileDescriptor_cfc8fd3ac7df3247 = []byte{ - // 1120 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4b, 0x6f, 0x1b, 0x45, - 0x1c, 0xcf, 0xd8, 0x6e, 0x1e, 0x93, 0xe6, 0xb5, 0x4d, 0x1a, 0x67, 0xdb, 0xda, 0xe9, 0x80, 0x20, - 0xa5, 0x62, 0x97, 0x26, 0x12, 0x20, 0x2e, 0x80, 0x21, 0x08, 0x23, 0x2c, 0x57, 0xdb, 0x4b, 0xc5, - 0xc5, 0x5a, 0xc7, 0x2b, 0x77, 0xd5, 0xec, 0x8c, 0xf1, 0xcc, 0x16, 0x57, 0x48, 0x20, 0xf1, 0xb8, - 0x83, 0x10, 0x8f, 0x4f, 0x80, 0xf8, 0x0a, 0x1c, 0xe0, 0x00, 0x97, 0x1e, 0x7b, 0x83, 0x72, 0xb0, - 0x50, 0xf2, 0x0d, 0xfc, 0x09, 0xaa, 0xdd, 0x99, 0x7d, 0x7a, 0x37, 0xf6, 0x26, 0x76, 0x72, 0x8a, - 0xb3, 0xf3, 0x7f, 0xff, 0x7f, 0xf3, 0xfb, 0xff, 0x77, 0xe1, 0x0d, 0x42, 0x2d, 0x42, 0x4d, 0xaa, - 0xb6, 0x75, 0xcb, 0x52, 0x1f, 0xdd, 0x69, 0x1a, 0x4c, 0xbf, 0xa3, 0xb2, 0x9e, 0xd2, 0xe9, 0x12, - 0x46, 0xa4, 0x75, 0x71, 0xac, 0x38, 0xc7, 0x8a, 0x38, 0x96, 0xd7, 0xdb, 0xa4, 0x4d, 0x5c, 0x01, - 0xd5, 0xf9, 0xc5, 0x65, 0xe5, 0xd2, 0x81, 0x2b, 0xac, 0x36, 0x75, 0x6a, 0xf8, 0x96, 0x0e, 0x88, - 0x89, 0xf9, 0x39, 0xfa, 0x23, 0x07, 0x17, 0x6b, 0xb4, 0xfd, 0x11, 0x31, 0xf1, 0x5d, 0x42, 0x0e, - 0xa5, 0x5b, 0x70, 0x96, 0x1a, 0xb8, 0x65, 0x74, 0x8b, 0x60, 0x1b, 0xec, 0x2c, 0x54, 0xd6, 0x06, - 0xfd, 0xf2, 0xd2, 0x63, 0xdd, 0x3a, 0x7c, 0x0b, 0xf1, 0xe7, 0x48, 0x13, 0x02, 0xd2, 0x6d, 0x38, - 0xd7, 0x21, 0xe4, 0xb0, 0x61, 0xb6, 0x8a, 0xb9, 0x6d, 0xb0, 0x53, 0xa8, 0x48, 0x83, 0x7e, 0x79, - 0x99, 0xcb, 0x8a, 0x03, 0xa4, 0xcd, 0x3a, 0xbf, 0xaa, 0x2d, 0xa9, 0x0b, 0x57, 0xe9, 0x03, 0xbd, - 0x6b, 0x34, 0x88, 0xcd, 0x1a, 0xba, 0x45, 0x6c, 0xcc, 0x8a, 0x79, 0xd7, 0xc3, 0x87, 0x4f, 0xfa, - 0xe5, 0x99, 0xff, 0xfa, 0xe5, 0x97, 0xda, 0x26, 0x7b, 0x60, 0x37, 0x95, 0x03, 0x62, 0xa9, 0x22, - 0x68, 0xfe, 0xe7, 0x55, 0xda, 0x7a, 0xa8, 0xb2, 0xc7, 0x1d, 0x83, 0x2a, 0x55, 0xcc, 0x06, 0xfd, - 0xf2, 0xd5, 0x90, 0x0f, 0x6e, 0xca, 0xb1, 0x8a, 0xb4, 0x65, 0xd7, 0x43, 0xdd, 0x66, 0xef, 0xba, - 0x0f, 0xa5, 0x26, 0x5c, 0x62, 0xe4, 0xa1, 0x81, 0x1b, 0x26, 0x6e, 0x58, 0x7a, 0x8f, 0x16, 0x0b, - 0xdb, 0xf9, 0x9d, 0xc5, 0xdd, 0x2d, 0x85, 0xdb, 0x55, 0x9c, 0x9a, 0x78, 0xe5, 0x53, 0xde, 0x23, - 0x26, 0xae, 0xbc, 0xe0, 0xc4, 0x32, 0xe8, 0x97, 0xaf, 0x71, 0x0f, 0x61, 0x6d, 0xe1, 0x89, 0x22, - 0x6d, 0xd1, 0x7d, 0x5c, 0xc5, 0x35, 0xbd, 0x47, 0xd1, 0x33, 0x00, 0xaf, 0x84, 0xea, 0xa7, 0x19, - 0xb4, 0x43, 0x30, 0x35, 0x24, 0x9a, 0x90, 0x2f, 0xaf, 0x68, 0x35, 0x73, 0xbe, 0x9b, 0xa2, 0xfe, - 0x31, 0x7b, 0xc3, 0x09, 0xd7, 0xe0, 0xbc, 0x17, 0x72, 0x31, 0x37, 0x2a, 0xd7, 0x4d, 0x91, 0xeb, - 0x4a, 0x34, 0x57, 0xa4, 0xcd, 0x89, 0xfc, 0xd0, 0x9f, 0x1c, 0x1b, 0xfb, 0x3d, 0x93, 0x4d, 0x15, - 0x1b, 0x1d, 0xb8, 0xc2, 0x73, 0x33, 0xf1, 0x84, 0xa0, 0x11, 0x33, 0x87, 0xb4, 0x25, 0xf7, 0x49, - 0x15, 0x8b, 0x42, 0x19, 0x70, 0x99, 0xe7, 0xeb, 0x54, 0xd3, 0x32, 0xf1, 0x18, 0xd0, 0x78, 0x51, - 0x94, 0xeb, 0x7a, 0xb8, 0x5c, 0x42, 0x3d, 0xc0, 0xc6, 0x65, 0xf7, 0x79, 0xdd, 0x66, 0x35, 0x13, - 0x53, 0xd4, 0x76, 0xb1, 0xe1, 0xd5, 0xcf, 0xc7, 0xc6, 0x5d, 0xb8, 0xe0, 0xab, 0x17, 0xc1, 0x28, - 0xc7, 0x45, 0xe1, 0x78, 0x35, 0xe6, 0x18, 0x69, 0xf3, 0x9e, 0x33, 0xf4, 0x0d, 0x80, 0x6b, 0xf7, - 0x3e, 0xd3, 0x3b, 0x3c, 0xbd, 0x2a, 0xd6, 0x88, 0xcd, 0x8c, 0x70, 0x13, 0xc0, 0xc8, 0x26, 0x54, - 0xe0, 0x4a, 0x90, 0x53, 0xcb, 0xc0, 0xc4, 0x72, 0x3b, 0xb7, 0x50, 0x91, 0x83, 0xb2, 0xc6, 0x04, - 0x90, 0xb6, 0xe4, 0x45, 0xf0, 0xbe, 0xfb, 0xff, 0x3f, 0x39, 0xb8, 0x5e, 0xa3, 0x6d, 0x27, 0x92, - 0xfd, 0x9e, 0x7e, 0xc0, 0xbc, 0x70, 0xb2, 0x20, 0x67, 0x1f, 0xce, 0x76, 0x9d, 0xe8, 0xa9, 0x40, - 0xf0, 0xcb, 0x4a, 0x12, 0xdb, 0x29, 0x43, 0xd9, 0x56, 0x0a, 0x4e, 0x9d, 0x34, 0xa1, 0x1c, 0xb9, - 0x0a, 0x0e, 0x98, 0xce, 0x76, 0x15, 0xa4, 0x2f, 0xe0, 0x7a, 0x52, 0xc7, 0x8b, 0x05, 0x37, 0x9d, - 0x5a, 0x66, 0x9c, 0x5e, 0x4b, 0x47, 0x11, 0xd2, 0xd6, 0x42, 0x20, 0xe2, 0x39, 0xa2, 0x1f, 0x00, - 0xbc, 0x9e, 0x54, 0xd9, 0x30, 0xdf, 0x04, 0xc6, 0x26, 0xc3, 0x37, 0x71, 0x7b, 0x48, 0x5b, 0xf6, - 0x02, 0x13, 0x51, 0x7d, 0x0d, 0xa0, 0x14, 0x34, 0xa2, 0x6e, 0xb3, 0x53, 0xe0, 0xee, 0x1d, 0xef, - 0x2a, 0x9a, 0x78, 0x6c, 0xd8, 0x5d, 0x16, 0x6d, 0xe1, 0xa8, 0x7b, 0x96, 0x83, 0x1b, 0xc3, 0xb5, - 0xa9, 0xdb, 0x2c, 0x0b, 0xec, 0x3e, 0x88, 0xc1, 0x6e, 0x67, 0x14, 0xec, 0xbc, 0x6c, 0x63, 0xb8, - 0xfb, 0x1c, 0x5e, 0x49, 0x98, 0x1a, 0x82, 0xcf, 0x3e, 0xce, 0xdc, 0x0a, 0x39, 0x75, 0x10, 0x21, - 0x6d, 0x35, 0x98, 0x43, 0x82, 0xd6, 0x22, 0xc4, 0x52, 0x18, 0x85, 0xfa, 0x71, 0x88, 0xe5, 0x7b, - 0x00, 0x6f, 0x24, 0xd6, 0xd6, 0x07, 0x5e, 0xc7, 0xe3, 0x8d, 0xe0, 0x52, 0x80, 0xb3, 0x91, 0x77, - 0xcc, 0x9c, 0xc7, 0x32, 0x1e, 0x79, 0xa3, 0xbf, 0x72, 0x70, 0x4b, 0x8c, 0x5c, 0x1e, 0x17, 0x33, - 0xba, 0xf8, 0x34, 0x54, 0x93, 0x69, 0x48, 0x4d, 0x9e, 0x50, 0x82, 0x79, 0x3e, 0x39, 0x42, 0x49, - 0xb2, 0x89, 0xb4, 0x35, 0x6f, 0x4f, 0x08, 0x08, 0xe5, 0x17, 0x00, 0x6f, 0xa6, 0x16, 0xf1, 0x42, - 0xb7, 0x18, 0xf4, 0x6b, 0x3e, 0xd2, 0xdf, 0x7b, 0xce, 0xe9, 0xa9, 0xee, 0x74, 0xa6, 0xfe, 0xbe, - 0x3d, 0xc4, 0x43, 0xfc, 0xce, 0x6e, 0x0d, 0xfa, 0xe5, 0x8d, 0x18, 0x30, 0x93, 0x68, 0x28, 0xb1, - 0x56, 0x85, 0x69, 0x6f, 0x7c, 0x29, 0x74, 0x73, 0xe9, 0x3c, 0xe8, 0x06, 0xfd, 0x18, 0xc5, 0x50, - 0xb4, 0x51, 0x17, 0x48, 0x10, 0xbf, 0xe5, 0x61, 0x51, 0xec, 0x5d, 0xb1, 0xb8, 0xa6, 0xc8, 0x0f, - 0x09, 0xfb, 0x53, 0x3e, 0xe3, 0xfe, 0x94, 0xb4, 0x08, 0x17, 0xa6, 0xbb, 0x08, 0xa7, 0xed, 0x35, - 0x97, 0xce, 0x69, 0xaf, 0xf9, 0x19, 0xc0, 0xed, 0xb4, 0x56, 0x5d, 0xec, 0x6e, 0xf3, 0x77, 0x0e, - 0xca, 0xa1, 0xc8, 0xc2, 0x04, 0x39, 0x4d, 0x1a, 0x8a, 0x8c, 0xf0, 0xfc, 0x04, 0x46, 0xb8, 0x43, - 0x11, 0x3e, 0x0a, 0x42, 0x14, 0x51, 0x38, 0x1b, 0x45, 0x24, 0x98, 0x44, 0xda, 0xaa, 0x00, 0x57, - 0x40, 0x11, 0x3f, 0x01, 0x88, 0xd2, 0xab, 0x18, 0xe6, 0x88, 0x38, 0xf0, 0xc1, 0x54, 0x81, 0xbf, - 0xfb, 0xfb, 0x1c, 0xcc, 0xd7, 0x68, 0x5b, 0xba, 0x0f, 0xe7, 0xfd, 0x6f, 0x1f, 0x37, 0x93, 0x77, - 0xbe, 0xd0, 0xeb, 0xbd, 0x7c, 0x6b, 0xa4, 0x88, 0x9f, 0xd3, 0x7d, 0x38, 0xef, 0xbf, 0x39, 0xa7, - 0x5b, 0xf6, 0x44, 0x4e, 0xb0, 0x3c, 0xf4, 0xfe, 0x48, 0xf9, 0xcb, 0x5e, 0xf4, 0x15, 0xeb, 0x95, - 0x54, 0xfd, 0x21, 0x59, 0x79, 0x77, 0x7c, 0x59, 0xdf, 0xe9, 0x23, 0xbe, 0xea, 0xc7, 0x36, 0xec, - 0xdb, 0xe3, 0x5a, 0xaa, 0xdb, 0x4c, 0xde, 0xcb, 0x20, 0xec, 0xfb, 0xfd, 0x0a, 0xc0, 0xab, 0x29, - 0xab, 0x9e, 0x7a, 0x62, 0x33, 0x86, 0x15, 0xe4, 0x37, 0x32, 0x2a, 0x24, 0x06, 0x11, 0xdb, 0x47, - 0x46, 0x07, 0x11, 0x55, 0x18, 0x23, 0x88, 0x94, 0x41, 0xfa, 0x2d, 0x80, 0x9b, 0x69, 0x74, 0xf4, - 0xda, 0x89, 0xe8, 0x49, 0xd0, 0x90, 0xdf, 0xcc, 0xaa, 0xe1, 0xc7, 0xf1, 0x25, 0xdc, 0x48, 0x1e, - 0xad, 0xca, 0x48, 0x93, 0x11, 0x79, 0xf9, 0xf5, 0x6c, 0xf2, 0x5e, 0x00, 0x95, 0xda, 0x93, 0xa3, - 0x12, 0x78, 0x7a, 0x54, 0x02, 0xff, 0x1f, 0x95, 0xc0, 0x77, 0xc7, 0xa5, 0x99, 0xa7, 0xc7, 0xa5, - 0x99, 0x7f, 0x8f, 0x4b, 0x33, 0x9f, 0xec, 0x85, 0x68, 0xe2, 0x53, 0x5b, 0xa7, 0x7a, 0xf7, 0x50, - 0x6f, 0x52, 0xf1, 0x13, 0x93, 0x96, 0xa1, 0x46, 0xbe, 0xac, 0xba, 0xbc, 0xd1, 0x9c, 0x75, 0xbf, - 0x84, 0xee, 0x3d, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x73, 0x03, 0xbf, 0xaf, 0x76, 0x15, 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 { - JoinPool(ctx context.Context, in *MsgJoinPool, opts ...grpc.CallOption) (*MsgJoinPoolResponse, error) - ExitPool(ctx context.Context, in *MsgExitPool, opts ...grpc.CallOption) (*MsgExitPoolResponse, error) - SwapExactAmountIn(ctx context.Context, in *MsgSwapExactAmountIn, opts ...grpc.CallOption) (*MsgSwapExactAmountInResponse, error) - SwapExactAmountOut(ctx context.Context, in *MsgSwapExactAmountOut, opts ...grpc.CallOption) (*MsgSwapExactAmountOutResponse, error) - JoinSwapExternAmountIn(ctx context.Context, in *MsgJoinSwapExternAmountIn, opts ...grpc.CallOption) (*MsgJoinSwapExternAmountInResponse, error) - JoinSwapShareAmountOut(ctx context.Context, in *MsgJoinSwapShareAmountOut, opts ...grpc.CallOption) (*MsgJoinSwapShareAmountOutResponse, error) - ExitSwapExternAmountOut(ctx context.Context, in *MsgExitSwapExternAmountOut, opts ...grpc.CallOption) (*MsgExitSwapExternAmountOutResponse, error) - ExitSwapShareAmountIn(ctx context.Context, in *MsgExitSwapShareAmountIn, opts ...grpc.CallOption) (*MsgExitSwapShareAmountInResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) JoinPool(ctx context.Context, in *MsgJoinPool, opts ...grpc.CallOption) (*MsgJoinPoolResponse, error) { - out := new(MsgJoinPoolResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Msg/JoinPool", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ExitPool(ctx context.Context, in *MsgExitPool, opts ...grpc.CallOption) (*MsgExitPoolResponse, error) { - out := new(MsgExitPoolResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Msg/ExitPool", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SwapExactAmountIn(ctx context.Context, in *MsgSwapExactAmountIn, opts ...grpc.CallOption) (*MsgSwapExactAmountInResponse, error) { - out := new(MsgSwapExactAmountInResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Msg/SwapExactAmountIn", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SwapExactAmountOut(ctx context.Context, in *MsgSwapExactAmountOut, opts ...grpc.CallOption) (*MsgSwapExactAmountOutResponse, error) { - out := new(MsgSwapExactAmountOutResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Msg/SwapExactAmountOut", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) JoinSwapExternAmountIn(ctx context.Context, in *MsgJoinSwapExternAmountIn, opts ...grpc.CallOption) (*MsgJoinSwapExternAmountInResponse, error) { - out := new(MsgJoinSwapExternAmountInResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Msg/JoinSwapExternAmountIn", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) JoinSwapShareAmountOut(ctx context.Context, in *MsgJoinSwapShareAmountOut, opts ...grpc.CallOption) (*MsgJoinSwapShareAmountOutResponse, error) { - out := new(MsgJoinSwapShareAmountOutResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Msg/JoinSwapShareAmountOut", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ExitSwapExternAmountOut(ctx context.Context, in *MsgExitSwapExternAmountOut, opts ...grpc.CallOption) (*MsgExitSwapExternAmountOutResponse, error) { - out := new(MsgExitSwapExternAmountOutResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Msg/ExitSwapExternAmountOut", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ExitSwapShareAmountIn(ctx context.Context, in *MsgExitSwapShareAmountIn, opts ...grpc.CallOption) (*MsgExitSwapShareAmountInResponse, error) { - out := new(MsgExitSwapShareAmountInResponse) - err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Msg/ExitSwapShareAmountIn", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - JoinPool(context.Context, *MsgJoinPool) (*MsgJoinPoolResponse, error) - ExitPool(context.Context, *MsgExitPool) (*MsgExitPoolResponse, error) - SwapExactAmountIn(context.Context, *MsgSwapExactAmountIn) (*MsgSwapExactAmountInResponse, error) - SwapExactAmountOut(context.Context, *MsgSwapExactAmountOut) (*MsgSwapExactAmountOutResponse, error) - JoinSwapExternAmountIn(context.Context, *MsgJoinSwapExternAmountIn) (*MsgJoinSwapExternAmountInResponse, error) - JoinSwapShareAmountOut(context.Context, *MsgJoinSwapShareAmountOut) (*MsgJoinSwapShareAmountOutResponse, error) - ExitSwapExternAmountOut(context.Context, *MsgExitSwapExternAmountOut) (*MsgExitSwapExternAmountOutResponse, error) - ExitSwapShareAmountIn(context.Context, *MsgExitSwapShareAmountIn) (*MsgExitSwapShareAmountInResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) JoinPool(ctx context.Context, req *MsgJoinPool) (*MsgJoinPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method JoinPool not implemented") -} -func (*UnimplementedMsgServer) ExitPool(ctx context.Context, req *MsgExitPool) (*MsgExitPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExitPool not implemented") -} -func (*UnimplementedMsgServer) SwapExactAmountIn(ctx context.Context, req *MsgSwapExactAmountIn) (*MsgSwapExactAmountInResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SwapExactAmountIn not implemented") -} -func (*UnimplementedMsgServer) SwapExactAmountOut(ctx context.Context, req *MsgSwapExactAmountOut) (*MsgSwapExactAmountOutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SwapExactAmountOut not implemented") -} -func (*UnimplementedMsgServer) JoinSwapExternAmountIn(ctx context.Context, req *MsgJoinSwapExternAmountIn) (*MsgJoinSwapExternAmountInResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method JoinSwapExternAmountIn not implemented") -} -func (*UnimplementedMsgServer) JoinSwapShareAmountOut(ctx context.Context, req *MsgJoinSwapShareAmountOut) (*MsgJoinSwapShareAmountOutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method JoinSwapShareAmountOut not implemented") -} -func (*UnimplementedMsgServer) ExitSwapExternAmountOut(ctx context.Context, req *MsgExitSwapExternAmountOut) (*MsgExitSwapExternAmountOutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExitSwapExternAmountOut not implemented") -} -func (*UnimplementedMsgServer) ExitSwapShareAmountIn(ctx context.Context, req *MsgExitSwapShareAmountIn) (*MsgExitSwapShareAmountInResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExitSwapShareAmountIn not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_JoinPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgJoinPool) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).JoinPool(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Msg/JoinPool", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).JoinPool(ctx, req.(*MsgJoinPool)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ExitPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExitPool) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ExitPool(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Msg/ExitPool", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ExitPool(ctx, req.(*MsgExitPool)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SwapExactAmountIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSwapExactAmountIn) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SwapExactAmountIn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Msg/SwapExactAmountIn", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SwapExactAmountIn(ctx, req.(*MsgSwapExactAmountIn)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SwapExactAmountOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSwapExactAmountOut) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SwapExactAmountOut(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Msg/SwapExactAmountOut", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SwapExactAmountOut(ctx, req.(*MsgSwapExactAmountOut)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_JoinSwapExternAmountIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgJoinSwapExternAmountIn) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).JoinSwapExternAmountIn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Msg/JoinSwapExternAmountIn", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).JoinSwapExternAmountIn(ctx, req.(*MsgJoinSwapExternAmountIn)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_JoinSwapShareAmountOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgJoinSwapShareAmountOut) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).JoinSwapShareAmountOut(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Msg/JoinSwapShareAmountOut", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).JoinSwapShareAmountOut(ctx, req.(*MsgJoinSwapShareAmountOut)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ExitSwapExternAmountOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExitSwapExternAmountOut) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ExitSwapExternAmountOut(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Msg/ExitSwapExternAmountOut", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ExitSwapExternAmountOut(ctx, req.(*MsgExitSwapExternAmountOut)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ExitSwapShareAmountIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExitSwapShareAmountIn) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ExitSwapShareAmountIn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.gamm.v1beta1.Msg/ExitSwapShareAmountIn", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ExitSwapShareAmountIn(ctx, req.(*MsgExitSwapShareAmountIn)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "osmosis.gamm.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "JoinPool", - Handler: _Msg_JoinPool_Handler, - }, - { - MethodName: "ExitPool", - Handler: _Msg_ExitPool_Handler, - }, - { - MethodName: "SwapExactAmountIn", - Handler: _Msg_SwapExactAmountIn_Handler, - }, - { - MethodName: "SwapExactAmountOut", - Handler: _Msg_SwapExactAmountOut_Handler, - }, - { - MethodName: "JoinSwapExternAmountIn", - Handler: _Msg_JoinSwapExternAmountIn_Handler, - }, - { - MethodName: "JoinSwapShareAmountOut", - Handler: _Msg_JoinSwapShareAmountOut_Handler, - }, - { - MethodName: "ExitSwapExternAmountOut", - Handler: _Msg_ExitSwapExternAmountOut_Handler, - }, - { - MethodName: "ExitSwapShareAmountIn", - Handler: _Msg_ExitSwapShareAmountIn_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "osmosis/gamm/v1beta1/tx.proto", -} - -func (m *MsgJoinPool) 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 *MsgJoinPool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgJoinPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TokenInMaxs) > 0 { - for iNdEx := len(m.TokenInMaxs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TokenInMaxs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - { - size := m.ShareOutAmount.Size() - i -= size - if _, err := m.ShareOutAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.PoolId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) - 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 *MsgJoinPoolResponse) 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 *MsgJoinPoolResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgJoinPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TokenIn) > 0 { - for iNdEx := len(m.TokenIn) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TokenIn[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size := m.ShareOutAmount.Size() - i -= size - if _, err := m.ShareOutAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgExitPool) 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 *MsgExitPool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExitPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TokenOutMins) > 0 { - for iNdEx := len(m.TokenOutMins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TokenOutMins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - { - size := m.ShareInAmount.Size() - i -= size - if _, err := m.ShareInAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.PoolId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) - 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 *MsgExitPoolResponse) 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 *MsgExitPoolResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExitPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TokenOut) > 0 { - for iNdEx := len(m.TokenOut) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TokenOut[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SwapAmountInRoute) 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 *SwapAmountInRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SwapAmountInRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TokenOutDenom) > 0 { - i -= len(m.TokenOutDenom) - copy(dAtA[i:], m.TokenOutDenom) - i = encodeVarintTx(dAtA, i, uint64(len(m.TokenOutDenom))) - i-- - dAtA[i] = 0x12 - } - if m.PoolId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgSwapExactAmountIn) 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 *MsgSwapExactAmountIn) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSwapExactAmountIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenOutMinAmount.Size() - i -= size - if _, err := m.TokenOutMinAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.TokenIn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - 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 *MsgSwapExactAmountInResponse) 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 *MsgSwapExactAmountInResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSwapExactAmountInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenOutAmount.Size() - i -= size - if _, err := m.TokenOutAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *SwapAmountOutRoute) 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 *SwapAmountOutRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SwapAmountOutRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TokenInDenom) > 0 { - i -= len(m.TokenInDenom) - copy(dAtA[i:], m.TokenInDenom) - i = encodeVarintTx(dAtA, i, uint64(len(m.TokenInDenom))) - i-- - dAtA[i] = 0x12 - } - if m.PoolId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgSwapExactAmountOut) 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 *MsgSwapExactAmountOut) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSwapExactAmountOut) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.TokenOut.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.TokenInMaxAmount.Size() - i -= size - if _, err := m.TokenInMaxAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - 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 = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - 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 *MsgSwapExactAmountOutResponse) 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 *MsgSwapExactAmountOutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSwapExactAmountOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenInAmount.Size() - i -= size - if _, err := m.TokenInAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgJoinSwapExternAmountIn) 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 *MsgJoinSwapExternAmountIn) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgJoinSwapExternAmountIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.ShareOutMinAmount.Size() - i -= size - if _, err := m.ShareOutMinAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.TokenIn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.PoolId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) - 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 *MsgJoinSwapExternAmountInResponse) 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 *MsgJoinSwapExternAmountInResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgJoinSwapExternAmountInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.ShareOutAmount.Size() - i -= size - if _, err := m.ShareOutAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgJoinSwapShareAmountOut) 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 *MsgJoinSwapShareAmountOut) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgJoinSwapShareAmountOut) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenInMaxAmount.Size() - i -= size - if _, err := m.TokenInMaxAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.ShareOutAmount.Size() - i -= size - if _, err := m.ShareOutAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.TokenInDenom) > 0 { - i -= len(m.TokenInDenom) - copy(dAtA[i:], m.TokenInDenom) - i = encodeVarintTx(dAtA, i, uint64(len(m.TokenInDenom))) - i-- - dAtA[i] = 0x1a - } - if m.PoolId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) - 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 *MsgJoinSwapShareAmountOutResponse) 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 *MsgJoinSwapShareAmountOutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgJoinSwapShareAmountOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenInAmount.Size() - i -= size - if _, err := m.TokenInAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgExitSwapShareAmountIn) 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 *MsgExitSwapShareAmountIn) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExitSwapShareAmountIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenOutMinAmount.Size() - i -= size - if _, err := m.TokenOutMinAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.ShareInAmount.Size() - i -= size - if _, err := m.ShareInAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.TokenOutDenom) > 0 { - i -= len(m.TokenOutDenom) - copy(dAtA[i:], m.TokenOutDenom) - i = encodeVarintTx(dAtA, i, uint64(len(m.TokenOutDenom))) - i-- - dAtA[i] = 0x1a - } - if m.PoolId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) - 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 *MsgExitSwapShareAmountInResponse) 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 *MsgExitSwapShareAmountInResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExitSwapShareAmountInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.TokenOutAmount.Size() - i -= size - if _, err := m.TokenOutAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgExitSwapExternAmountOut) 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 *MsgExitSwapExternAmountOut) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExitSwapExternAmountOut) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.ShareInMaxAmount.Size() - i -= size - if _, err := m.ShareInMaxAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.TokenOut.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.PoolId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) - 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 *MsgExitSwapExternAmountOutResponse) 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 *MsgExitSwapExternAmountOutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExitSwapExternAmountOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.ShareInAmount.Size() - i -= size - if _, err := m.ShareInAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - 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 *MsgJoinPool) 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.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = m.ShareOutAmount.Size() - n += 1 + l + sovTx(uint64(l)) - if len(m.TokenInMaxs) > 0 { - for _, e := range m.TokenInMaxs { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgJoinPoolResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ShareOutAmount.Size() - n += 1 + l + sovTx(uint64(l)) - if len(m.TokenIn) > 0 { - for _, e := range m.TokenIn { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgExitPool) 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.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = m.ShareInAmount.Size() - n += 1 + l + sovTx(uint64(l)) - if len(m.TokenOutMins) > 0 { - for _, e := range m.TokenOutMins { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgExitPoolResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.TokenOut) > 0 { - for _, e := range m.TokenOut { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *SwapAmountInRoute) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = len(m.TokenOutDenom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSwapExactAmountIn) 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 len(m.Routes) > 0 { - for _, e := range m.Routes { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = m.TokenIn.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.TokenOutMinAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgSwapExactAmountInResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TokenOutAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *SwapAmountOutRoute) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = len(m.TokenInDenom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSwapExactAmountOut) 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 len(m.Routes) > 0 { - for _, e := range m.Routes { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = m.TokenInMaxAmount.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.TokenOut.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgSwapExactAmountOutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TokenInAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgJoinSwapExternAmountIn) 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.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = m.TokenIn.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.ShareOutMinAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgJoinSwapExternAmountInResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ShareOutAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgJoinSwapShareAmountOut) 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.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = len(m.TokenInDenom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.ShareOutAmount.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.TokenInMaxAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgJoinSwapShareAmountOutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TokenInAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgExitSwapShareAmountIn) 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.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = len(m.TokenOutDenom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.ShareInAmount.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.TokenOutMinAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgExitSwapShareAmountInResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TokenOutAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgExitSwapExternAmountOut) 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.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = m.TokenOut.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.ShareInMaxAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgExitSwapExternAmountOutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ShareInAmount.Size() - n += 1 + l + sovTx(uint64(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 *MsgJoinPool) 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: MsgJoinPool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgJoinPool: 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 PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareOutAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareOutAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInMaxs", 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.TokenInMaxs = append(m.TokenInMaxs, types.Coin{}) - if err := m.TokenInMaxs[len(m.TokenInMaxs)-1].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 *MsgJoinPoolResponse) 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: MsgJoinPoolResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgJoinPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareOutAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareOutAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", 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.TokenIn = append(m.TokenIn, types.Coin{}) - if err := m.TokenIn[len(m.TokenIn)-1].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 *MsgExitPool) 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: MsgExitPool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExitPool: 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 PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareInAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareInAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOutMins", 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.TokenOutMins = append(m.TokenOutMins, types.Coin{}) - if err := m.TokenOutMins[len(m.TokenOutMins)-1].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 *MsgExitPoolResponse) 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: MsgExitPoolResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExitPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOut", 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.TokenOut = append(m.TokenOut, types.Coin{}) - if err := m.TokenOut[len(m.TokenOut)-1].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 *SwapAmountInRoute) 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: SwapAmountInRoute: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SwapAmountInRoute: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOutDenom", 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.TokenOutDenom = 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 *MsgSwapExactAmountIn) 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: MsgSwapExactAmountIn: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSwapExactAmountIn: 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 != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Routes", 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.Routes = append(m.Routes, SwapAmountInRoute{}) - if err := m.Routes[len(m.Routes)-1].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) - } - 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.TokenIn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOutMinAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TokenOutMinAmount.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 *MsgSwapExactAmountInResponse) 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: MsgSwapExactAmountInResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSwapExactAmountInResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOutAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TokenOutAmount.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 *SwapAmountOutRoute) 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: SwapAmountOutRoute: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SwapAmountOutRoute: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInDenom", 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.TokenInDenom = 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 *MsgSwapExactAmountOut) 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: MsgSwapExactAmountOut: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSwapExactAmountOut: 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 != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Routes", 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.Routes = append(m.Routes, SwapAmountOutRoute{}) - if err := m.Routes[len(m.Routes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInMaxAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TokenInMaxAmount.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) - } - 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.TokenOut.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 *MsgSwapExactAmountOutResponse) 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: MsgSwapExactAmountOutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSwapExactAmountOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TokenInAmount.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 *MsgJoinSwapExternAmountIn) 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: MsgJoinSwapExternAmountIn: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgJoinSwapExternAmountIn: 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 PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", 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.TokenIn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareOutMinAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareOutMinAmount.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 *MsgJoinSwapExternAmountInResponse) 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: MsgJoinSwapExternAmountInResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgJoinSwapExternAmountInResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareOutAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareOutAmount.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 *MsgJoinSwapShareAmountOut) 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: MsgJoinSwapShareAmountOut: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgJoinSwapShareAmountOut: 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 PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInDenom", 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.TokenInDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareOutAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareOutAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInMaxAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TokenInMaxAmount.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 *MsgJoinSwapShareAmountOutResponse) 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: MsgJoinSwapShareAmountOutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgJoinSwapShareAmountOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TokenInAmount.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 *MsgExitSwapShareAmountIn) 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: MsgExitSwapShareAmountIn: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExitSwapShareAmountIn: 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 PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOutDenom", 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.TokenOutDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareInAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareInAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOutMinAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TokenOutMinAmount.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 *MsgExitSwapShareAmountInResponse) 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: MsgExitSwapShareAmountInResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExitSwapShareAmountInResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOutAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TokenOutAmount.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 *MsgExitSwapExternAmountOut) 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: MsgExitSwapExternAmountOut: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExitSwapExternAmountOut: 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 PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenOut", 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.TokenOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareInMaxAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareInMaxAmount.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 *MsgExitSwapExternAmountOutResponse) 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: MsgExitSwapExternAmountOutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExitSwapExternAmountOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareInAmount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ShareInAmount.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 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/osmosis/incentives/types/gauge.pb.go b/osmosis/incentives/types/gauge.pb.go deleted file mode 100644 index deb2ebf22..000000000 --- a/osmosis/incentives/types/gauge.pb.go +++ /dev/null @@ -1,869 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/incentives/gauge.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - types "github.com/quasarlabs/quasarnode/osmosis/lockup/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// Gauge is an object that stores and distributes yields to recipients who -// satisfy certain conditions. Currently gauges support conditions around the -// duration for which a given denom is locked. -type Gauge struct { - // id is the unique ID of a Gauge - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge - // Non-perpetual gauges distribute their tokens equally per epoch while the - // gauge is in the active period. Perpetual gauges distribute all their tokens - // at a single time and only distribute their tokens again once the gauge is - // refilled, Intended for use with incentives that get refilled daily. - IsPerpetual bool `protobuf:"varint,2,opt,name=is_perpetual,json=isPerpetual,proto3" json:"is_perpetual,omitempty"` - // distribute_to is where the gauge rewards are distributed to. - // This is queried via lock duration or by timestamp - DistributeTo types.QueryCondition `protobuf:"bytes,3,opt,name=distribute_to,json=distributeTo,proto3" json:"distribute_to"` - // coins is the total amount of coins that have been in the gauge - // Can distribute multiple coin denoms - Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` - // start_time is the distribution start time - StartTime time.Time `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` - // num_epochs_paid_over is the number of total epochs distribution will be - // completed over - NumEpochsPaidOver uint64 `protobuf:"varint,6,opt,name=num_epochs_paid_over,json=numEpochsPaidOver,proto3" json:"num_epochs_paid_over,omitempty"` - // filled_epochs is the number of epochs distribution has been completed on - // already - FilledEpochs uint64 `protobuf:"varint,7,opt,name=filled_epochs,json=filledEpochs,proto3" json:"filled_epochs,omitempty"` - // distributed_coins are coins that have been distributed already - DistributedCoins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=distributed_coins,json=distributedCoins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"distributed_coins"` -} - -func (m *Gauge) Reset() { *m = Gauge{} } -func (m *Gauge) String() string { return proto.CompactTextString(m) } -func (*Gauge) ProtoMessage() {} -func (*Gauge) Descriptor() ([]byte, []int) { - return fileDescriptor_c0304e2bb0159901, []int{0} -} -func (m *Gauge) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Gauge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Gauge.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 *Gauge) XXX_Merge(src proto.Message) { - xxx_messageInfo_Gauge.Merge(m, src) -} -func (m *Gauge) XXX_Size() int { - return m.Size() -} -func (m *Gauge) XXX_DiscardUnknown() { - xxx_messageInfo_Gauge.DiscardUnknown(m) -} - -var xxx_messageInfo_Gauge proto.InternalMessageInfo - -func (m *Gauge) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Gauge) GetIsPerpetual() bool { - if m != nil { - return m.IsPerpetual - } - return false -} - -func (m *Gauge) GetDistributeTo() types.QueryCondition { - if m != nil { - return m.DistributeTo - } - return types.QueryCondition{} -} - -func (m *Gauge) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Coins - } - return nil -} - -func (m *Gauge) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} - -func (m *Gauge) GetNumEpochsPaidOver() uint64 { - if m != nil { - return m.NumEpochsPaidOver - } - return 0 -} - -func (m *Gauge) GetFilledEpochs() uint64 { - if m != nil { - return m.FilledEpochs - } - return 0 -} - -func (m *Gauge) GetDistributedCoins() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.DistributedCoins - } - return nil -} - -type LockableDurationsInfo struct { - // List of incentivised durations that gauges will pay out to - LockableDurations []time.Duration `protobuf:"bytes,1,rep,name=lockable_durations,json=lockableDurations,proto3,stdduration" json:"lockable_durations" yaml:"lockable_durations"` -} - -func (m *LockableDurationsInfo) Reset() { *m = LockableDurationsInfo{} } -func (m *LockableDurationsInfo) String() string { return proto.CompactTextString(m) } -func (*LockableDurationsInfo) ProtoMessage() {} -func (*LockableDurationsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c0304e2bb0159901, []int{1} -} -func (m *LockableDurationsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LockableDurationsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LockableDurationsInfo.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 *LockableDurationsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_LockableDurationsInfo.Merge(m, src) -} -func (m *LockableDurationsInfo) XXX_Size() int { - return m.Size() -} -func (m *LockableDurationsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_LockableDurationsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_LockableDurationsInfo proto.InternalMessageInfo - -func (m *LockableDurationsInfo) GetLockableDurations() []time.Duration { - if m != nil { - return m.LockableDurations - } - return nil -} - -func init() { - proto.RegisterType((*Gauge)(nil), "osmosis.incentives.Gauge") - proto.RegisterType((*LockableDurationsInfo)(nil), "osmosis.incentives.LockableDurationsInfo") -} - -func init() { proto.RegisterFile("osmosis/incentives/gauge.proto", fileDescriptor_c0304e2bb0159901) } - -var fileDescriptor_c0304e2bb0159901 = []byte{ - // 544 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcf, 0x6e, 0xd3, 0x30, - 0x1c, 0xc7, 0x9b, 0xad, 0x1b, 0xc3, 0xed, 0x10, 0xb5, 0x86, 0x94, 0x56, 0x22, 0x2d, 0x45, 0x48, - 0xbd, 0x60, 0xb3, 0x71, 0x82, 0x63, 0x07, 0x42, 0x93, 0x90, 0x18, 0x65, 0x07, 0xc4, 0x25, 0x72, - 0x12, 0x37, 0xb3, 0x9a, 0xe4, 0x17, 0x62, 0xbb, 0xa2, 0x6f, 0xc0, 0x71, 0xe2, 0xc4, 0x33, 0xf0, - 0x24, 0x3b, 0xee, 0xc8, 0x69, 0x43, 0xed, 0x1b, 0xf0, 0x04, 0x28, 0x76, 0xa2, 0x4e, 0x85, 0x23, - 0x27, 0x3b, 0xbf, 0xef, 0xef, 0xdf, 0xf7, 0x23, 0x07, 0x79, 0x20, 0x53, 0x90, 0x42, 0x52, 0x91, - 0x85, 0x3c, 0x53, 0x62, 0xce, 0x25, 0x8d, 0x99, 0x8e, 0x39, 0xc9, 0x0b, 0x50, 0x80, 0x71, 0xa5, - 0x93, 0xb5, 0xde, 0x3b, 0x88, 0x21, 0x06, 0x23, 0xd3, 0xf2, 0x66, 0x33, 0x7b, 0x5e, 0x0c, 0x10, - 0x27, 0x9c, 0x9a, 0xaf, 0x40, 0x4f, 0x69, 0xa4, 0x0b, 0xa6, 0x04, 0x64, 0x95, 0xde, 0xdf, 0xd4, - 0x95, 0x48, 0xb9, 0x54, 0x2c, 0xcd, 0xeb, 0x06, 0xa1, 0x99, 0x45, 0x03, 0x26, 0x39, 0x9d, 0x1f, - 0x06, 0x5c, 0xb1, 0x43, 0x1a, 0x82, 0xa8, 0x1b, 0x74, 0xeb, 0x55, 0x13, 0x08, 0x67, 0x3a, 0x37, - 0x87, 0x95, 0x86, 0xdf, 0x9a, 0x68, 0xe7, 0x4d, 0xb9, 0x35, 0xbe, 0x87, 0xb6, 0x44, 0xe4, 0x3a, - 0x03, 0x67, 0xd4, 0x9c, 0x6c, 0x89, 0x08, 0x3f, 0x42, 0x6d, 0x21, 0xfd, 0x9c, 0x17, 0x39, 0x57, - 0x9a, 0x25, 0xee, 0xd6, 0xc0, 0x19, 0xed, 0x4d, 0x5a, 0x42, 0x9e, 0xd6, 0x21, 0x7c, 0x82, 0xf6, - 0x23, 0x21, 0x55, 0x21, 0x02, 0xad, 0xb8, 0xaf, 0xc0, 0xdd, 0x1e, 0x38, 0xa3, 0xd6, 0x91, 0x47, - 0x6a, 0xeb, 0x76, 0x1e, 0x79, 0xaf, 0x79, 0xb1, 0x38, 0x86, 0x2c, 0x12, 0xa5, 0xab, 0x71, 0xf3, - 0xf2, 0xba, 0xdf, 0x98, 0xb4, 0xd7, 0xa5, 0x67, 0x80, 0x19, 0xda, 0x29, 0x17, 0x96, 0x6e, 0x73, - 0xb0, 0x3d, 0x6a, 0x1d, 0x75, 0x89, 0xb5, 0x44, 0x4a, 0x4b, 0xa4, 0xb2, 0x44, 0x8e, 0x41, 0x64, - 0xe3, 0x67, 0x65, 0xf5, 0x8f, 0x9b, 0xfe, 0x28, 0x16, 0xea, 0x5c, 0x07, 0x24, 0x84, 0x94, 0x56, - 0xfe, 0xed, 0xf1, 0x54, 0x46, 0x33, 0xaa, 0x16, 0x39, 0x97, 0xa6, 0x40, 0x4e, 0x6c, 0x67, 0xfc, - 0x11, 0x21, 0xa9, 0x58, 0xa1, 0xfc, 0x12, 0x9f, 0xbb, 0x63, 0x56, 0xed, 0x11, 0xcb, 0x96, 0xd4, - 0x6c, 0xc9, 0x59, 0xcd, 0x76, 0xfc, 0xb0, 0x1c, 0xf4, 0xfb, 0xba, 0xdf, 0x59, 0xb0, 0x34, 0x79, - 0x39, 0x5c, 0xd7, 0x0e, 0x2f, 0x6e, 0xfa, 0xce, 0xe4, 0xae, 0x09, 0x94, 0xe9, 0x98, 0xa2, 0x83, - 0x4c, 0xa7, 0x3e, 0xcf, 0x21, 0x3c, 0x97, 0x7e, 0xce, 0x44, 0xe4, 0xc3, 0x9c, 0x17, 0xee, 0xae, - 0x81, 0xd9, 0xc9, 0x74, 0xfa, 0xda, 0x48, 0xa7, 0x4c, 0x44, 0xef, 0xe6, 0xbc, 0xc0, 0x8f, 0xd1, - 0xfe, 0x54, 0x24, 0x09, 0x8f, 0xaa, 0x1a, 0xf7, 0x8e, 0xc9, 0x6c, 0xdb, 0xa0, 0x4d, 0xc6, 0x5f, - 0x50, 0x67, 0x8d, 0x28, 0xf2, 0x2d, 0x9e, 0xbd, 0xff, 0x8f, 0xe7, 0xfe, 0xad, 0x29, 0x26, 0x32, - 0xfc, 0xea, 0xa0, 0x07, 0x6f, 0x21, 0x9c, 0xb1, 0x20, 0xe1, 0xaf, 0xaa, 0xb7, 0x28, 0x4f, 0xb2, - 0x29, 0x60, 0x40, 0x38, 0xa9, 0x04, 0xbf, 0x7e, 0xa5, 0xd2, 0x75, 0xaa, 0xa5, 0x36, 0x59, 0xd6, - 0xb5, 0xe3, 0x27, 0x15, 0xca, 0xae, 0x45, 0xf9, 0x77, 0x8b, 0xe1, 0xf7, 0x12, 0x69, 0x27, 0xd9, - 0x1c, 0x3a, 0xfe, 0x70, 0xb9, 0xf4, 0x9c, 0xab, 0xa5, 0xe7, 0xfc, 0x5a, 0x7a, 0xce, 0xc5, 0xca, - 0x6b, 0x5c, 0xad, 0xbc, 0xc6, 0xcf, 0x95, 0xd7, 0xf8, 0xf4, 0xe2, 0x96, 0xc1, 0xcf, 0x9a, 0x49, - 0x56, 0x24, 0x2c, 0x90, 0xd5, 0x35, 0x83, 0x88, 0xd3, 0x7f, 0xfc, 0xa0, 0xc6, 0x77, 0xb0, 0x6b, - 0x36, 0x7c, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0x73, 0xd0, 0x2c, 0x32, 0xc3, 0x03, 0x00, 0x00, -} - -func (m *Gauge) 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 *Gauge) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Gauge) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DistributedCoins) > 0 { - for iNdEx := len(m.DistributedCoins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DistributedCoins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGauge(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if m.FilledEpochs != 0 { - i = encodeVarintGauge(dAtA, i, uint64(m.FilledEpochs)) - i-- - dAtA[i] = 0x38 - } - if m.NumEpochsPaidOver != 0 { - i = encodeVarintGauge(dAtA, i, uint64(m.NumEpochsPaidOver)) - i-- - dAtA[i] = 0x30 - } - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintGauge(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x2a - if len(m.Coins) > 0 { - for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGauge(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - { - size, err := m.DistributeTo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGauge(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.IsPerpetual { - i-- - if m.IsPerpetual { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintGauge(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LockableDurationsInfo) 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 *LockableDurationsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LockableDurationsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LockableDurations) > 0 { - for iNdEx := len(m.LockableDurations) - 1; iNdEx >= 0; iNdEx-- { - n, err := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.LockableDurations[iNdEx], dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.LockableDurations[iNdEx]):]) - if err != nil { - return 0, err - } - i -= n - i = encodeVarintGauge(dAtA, i, uint64(n)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGauge(dAtA []byte, offset int, v uint64) int { - offset -= sovGauge(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Gauge) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovGauge(uint64(m.Id)) - } - if m.IsPerpetual { - n += 2 - } - l = m.DistributeTo.Size() - n += 1 + l + sovGauge(uint64(l)) - if len(m.Coins) > 0 { - for _, e := range m.Coins { - l = e.Size() - n += 1 + l + sovGauge(uint64(l)) - } - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovGauge(uint64(l)) - if m.NumEpochsPaidOver != 0 { - n += 1 + sovGauge(uint64(m.NumEpochsPaidOver)) - } - if m.FilledEpochs != 0 { - n += 1 + sovGauge(uint64(m.FilledEpochs)) - } - if len(m.DistributedCoins) > 0 { - for _, e := range m.DistributedCoins { - l = e.Size() - n += 1 + l + sovGauge(uint64(l)) - } - } - return n -} - -func (m *LockableDurationsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.LockableDurations) > 0 { - for _, e := range m.LockableDurations { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(e) - n += 1 + l + sovGauge(uint64(l)) - } - } - return n -} - -func sovGauge(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGauge(x uint64) (n int) { - return sovGauge(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Gauge) 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 ErrIntOverflowGauge - } - 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: Gauge: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Gauge: 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 ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsPerpetual", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsPerpetual = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributeTo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGauge - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGauge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DistributeTo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGauge - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGauge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Coins = append(m.Coins, types1.Coin{}) - if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGauge - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGauge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumEpochsPaidOver", wireType) - } - m.NumEpochsPaidOver = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumEpochsPaidOver |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FilledEpochs", wireType) - } - m.FilledEpochs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FilledEpochs |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributedCoins", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGauge - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGauge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DistributedCoins = append(m.DistributedCoins, types1.Coin{}) - if err := m.DistributedCoins[len(m.DistributedCoins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGauge(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGauge - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LockableDurationsInfo) 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 ErrIntOverflowGauge - } - 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: LockableDurationsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LockableDurationsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LockableDurations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGauge - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGauge - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGauge - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LockableDurations = append(m.LockableDurations, time.Duration(0)) - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&(m.LockableDurations[len(m.LockableDurations)-1]), dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGauge(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGauge - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGauge(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, ErrIntOverflowGauge - } - 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, ErrIntOverflowGauge - } - 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, ErrIntOverflowGauge - } - 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, ErrInvalidLengthGauge - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGauge - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGauge - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGauge = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGauge = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGauge = fmt.Errorf("proto: unexpected end of group") -) diff --git a/osmosis/lockup/types/lock.pb.go b/osmosis/lockup/types/lock.pb.go deleted file mode 100644 index f77f9c224..000000000 --- a/osmosis/lockup/types/lock.pb.go +++ /dev/null @@ -1,1230 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/lockup/lock.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// LockQueryType defines the type of the lock query that can -// either be by duration or start time of the lock. -type LockQueryType int32 - -const ( - ByDuration LockQueryType = 0 - ByTime LockQueryType = 1 -) - -var LockQueryType_name = map[int32]string{ - 0: "ByDuration", - 1: "ByTime", -} - -var LockQueryType_value = map[string]int32{ - "ByDuration": 0, - "ByTime": 1, -} - -func (x LockQueryType) String() string { - return proto.EnumName(LockQueryType_name, int32(x)) -} - -func (LockQueryType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7e9d7527a237b489, []int{0} -} - -// PeriodLock is a single lock unit by period defined by the x/lockup module. -// It's a record of a locked coin at a specific time. It stores owner, duration, -// unlock time and the number of coins locked. A state of a period lock is -// created upon lock creation, and deleted once the lock has been matured after -// the `duration` has passed since unbonding started. -type PeriodLock struct { - // ID is the unique id of the lock. - // The ID of the lock is decided upon lock creation, incrementing by 1 for - // every lock. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // Owner is the account address of the lock owner. - // Only the owner can modify the state of the lock. - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - // Duration is the time needed for a lock to mature after unlocking has - // started. - Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` - // EndTime refers to the time at which the lock would mature and get deleted. - // This value is first initialized when an unlock has started for the lock, - // end time being block time + duration. - EndTime time.Time `protobuf:"bytes,4,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - // Coins are the tokens locked within the lock, kept in the module account. - Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` -} - -func (m *PeriodLock) Reset() { *m = PeriodLock{} } -func (m *PeriodLock) String() string { return proto.CompactTextString(m) } -func (*PeriodLock) ProtoMessage() {} -func (*PeriodLock) Descriptor() ([]byte, []int) { - return fileDescriptor_7e9d7527a237b489, []int{0} -} -func (m *PeriodLock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PeriodLock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PeriodLock.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 *PeriodLock) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeriodLock.Merge(m, src) -} -func (m *PeriodLock) XXX_Size() int { - return m.Size() -} -func (m *PeriodLock) XXX_DiscardUnknown() { - xxx_messageInfo_PeriodLock.DiscardUnknown(m) -} - -var xxx_messageInfo_PeriodLock proto.InternalMessageInfo - -func (m *PeriodLock) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *PeriodLock) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *PeriodLock) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *PeriodLock) GetEndTime() time.Time { - if m != nil { - return m.EndTime - } - return time.Time{} -} - -func (m *PeriodLock) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Coins - } - return nil -} - -// QueryCondition is a struct used for querying locks upon different conditions. -// Duration field and timestamp fields could be optional, depending on the -// LockQueryType. -type QueryCondition struct { - // LockQueryType is a type of lock query, ByLockDuration | ByLockTime - LockQueryType LockQueryType `protobuf:"varint,1,opt,name=lock_query_type,json=lockQueryType,proto3,enum=osmosis.lockup.LockQueryType" json:"lock_query_type,omitempty"` - // Denom represents the token denomination we are looking to lock up - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - // Duration is used to query locks with longer duration than the specified - // duration. Duration field must not be nil when the lock query type is - // `ByLockDuration`. - Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration" yaml:"duration"` - // Timestamp is used by locks started before the specified duration. - // Timestamp field must not be nil when the lock query type is `ByLockTime`. - // Querying locks with timestamp is currently not implemented. - Timestamp time.Time `protobuf:"bytes,4,opt,name=timestamp,proto3,stdtime" json:"timestamp" yaml:"timestamp"` -} - -func (m *QueryCondition) Reset() { *m = QueryCondition{} } -func (m *QueryCondition) String() string { return proto.CompactTextString(m) } -func (*QueryCondition) ProtoMessage() {} -func (*QueryCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_7e9d7527a237b489, []int{1} -} -func (m *QueryCondition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCondition.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 *QueryCondition) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCondition.Merge(m, src) -} -func (m *QueryCondition) XXX_Size() int { - return m.Size() -} -func (m *QueryCondition) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCondition.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCondition proto.InternalMessageInfo - -func (m *QueryCondition) GetLockQueryType() LockQueryType { - if m != nil { - return m.LockQueryType - } - return ByDuration -} - -func (m *QueryCondition) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *QueryCondition) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *QueryCondition) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -// SyntheticLock is creating virtual lockup where new denom is combination of -// original denom and synthetic suffix. At the time of synthetic lockup creation -// and deletion, accumulation store is also being updated and on querier side, -// they can query as freely as native lockup. -type SyntheticLock struct { - // Underlying Lock ID is the underlying native lock's id for this synthetic - // lockup. A synthetic lock MUST have an underlying lock. - UnderlyingLockId uint64 `protobuf:"varint,1,opt,name=underlying_lock_id,json=underlyingLockId,proto3" json:"underlying_lock_id,omitempty"` - // SynthDenom is the synthetic denom that is a combination of - // gamm share + bonding status + validator address. - SynthDenom string `protobuf:"bytes,2,opt,name=synth_denom,json=synthDenom,proto3" json:"synth_denom,omitempty"` - // used for unbonding synthetic lockups, for active synthetic lockups, this - // value is set to uninitialized value - EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - // Duration is the duration for a synthetic lock to mature - // at the point of unbonding has started. - Duration time.Duration `protobuf:"bytes,4,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` -} - -func (m *SyntheticLock) Reset() { *m = SyntheticLock{} } -func (m *SyntheticLock) String() string { return proto.CompactTextString(m) } -func (*SyntheticLock) ProtoMessage() {} -func (*SyntheticLock) Descriptor() ([]byte, []int) { - return fileDescriptor_7e9d7527a237b489, []int{2} -} -func (m *SyntheticLock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SyntheticLock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SyntheticLock.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 *SyntheticLock) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyntheticLock.Merge(m, src) -} -func (m *SyntheticLock) XXX_Size() int { - return m.Size() -} -func (m *SyntheticLock) XXX_DiscardUnknown() { - xxx_messageInfo_SyntheticLock.DiscardUnknown(m) -} - -var xxx_messageInfo_SyntheticLock proto.InternalMessageInfo - -func (m *SyntheticLock) GetUnderlyingLockId() uint64 { - if m != nil { - return m.UnderlyingLockId - } - return 0 -} - -func (m *SyntheticLock) GetSynthDenom() string { - if m != nil { - return m.SynthDenom - } - return "" -} - -func (m *SyntheticLock) GetEndTime() time.Time { - if m != nil { - return m.EndTime - } - return time.Time{} -} - -func (m *SyntheticLock) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func init() { - proto.RegisterEnum("osmosis.lockup.LockQueryType", LockQueryType_name, LockQueryType_value) - proto.RegisterType((*PeriodLock)(nil), "osmosis.lockup.PeriodLock") - proto.RegisterType((*QueryCondition)(nil), "osmosis.lockup.QueryCondition") - proto.RegisterType((*SyntheticLock)(nil), "osmosis.lockup.SyntheticLock") -} - -func init() { proto.RegisterFile("osmosis/lockup/lock.proto", fileDescriptor_7e9d7527a237b489) } - -var fileDescriptor_7e9d7527a237b489 = []byte{ - // 596 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x6d, 0x27, 0x29, 0xed, 0x95, 0xa4, 0xd1, 0xa9, 0x43, 0x1a, 0xc0, 0x8e, 0x3c, 0xa0, - 0x08, 0x15, 0x9b, 0x14, 0xb1, 0x30, 0xba, 0x61, 0x88, 0x84, 0x04, 0x98, 0x8a, 0x81, 0x25, 0xf2, - 0x9f, 0xc3, 0x39, 0xc5, 0xf6, 0xb9, 0x3e, 0x1b, 0xe4, 0x6f, 0xc0, 0xd8, 0x11, 0x24, 0x36, 0x36, - 0x3e, 0x49, 0xc7, 0x8e, 0x4c, 0x29, 0x4a, 0xc4, 0xc2, 0xd8, 0x4f, 0x80, 0xee, 0xce, 0x4e, 0xd2, - 0x20, 0xa4, 0x0e, 0x30, 0xf9, 0xee, 0x9e, 0x7b, 0x9f, 0x7b, 0xef, 0x77, 0x8f, 0x0c, 0x0e, 0x08, - 0x8d, 0x08, 0xc5, 0xd4, 0x0c, 0x89, 0x37, 0xcd, 0x13, 0xfe, 0x31, 0x92, 0x94, 0x64, 0x04, 0xb6, - 0x4a, 0xc9, 0x10, 0x52, 0x77, 0x3f, 0x20, 0x01, 0xe1, 0x92, 0xc9, 0x46, 0x62, 0x57, 0x57, 0x0d, - 0x08, 0x09, 0x42, 0x64, 0xf2, 0x99, 0x9b, 0xbf, 0x33, 0xfd, 0x3c, 0x75, 0x32, 0x4c, 0xe2, 0x52, - 0xd7, 0x36, 0xf5, 0x0c, 0x47, 0x88, 0x66, 0x4e, 0x94, 0x54, 0x06, 0x1e, 0x3f, 0xc7, 0x74, 0x1d, - 0x8a, 0xcc, 0xf7, 0x03, 0x17, 0x65, 0xce, 0xc0, 0xf4, 0x08, 0x2e, 0x0d, 0xf4, 0x9f, 0x0a, 0x00, - 0x2f, 0x51, 0x8a, 0x89, 0xff, 0x9c, 0x78, 0x53, 0xd8, 0x02, 0xca, 0x68, 0xd8, 0x91, 0x7b, 0x72, - 0xbf, 0x6e, 0x2b, 0xa3, 0x21, 0xbc, 0x0f, 0x1a, 0xe4, 0x43, 0x8c, 0xd2, 0x8e, 0xd2, 0x93, 0xfb, - 0x3b, 0x56, 0xfb, 0x6a, 0xa6, 0xdd, 0x2e, 0x9c, 0x28, 0x7c, 0xaa, 0xf3, 0x65, 0xdd, 0x16, 0x32, - 0x9c, 0x80, 0xed, 0xaa, 0xb3, 0x4e, 0xad, 0x27, 0xf7, 0x77, 0x8f, 0x0e, 0x0c, 0xd1, 0x9a, 0x51, - 0xb5, 0x66, 0x0c, 0xcb, 0x0d, 0xd6, 0xe0, 0x7c, 0xa6, 0x49, 0xbf, 0x66, 0x1a, 0xac, 0x4a, 0x0e, - 0x49, 0x84, 0x33, 0x14, 0x25, 0x59, 0x71, 0x35, 0xd3, 0xf6, 0x84, 0x7f, 0xa5, 0xe9, 0x9f, 0x2e, - 0x35, 0xd9, 0x5e, 0xba, 0x43, 0x1b, 0x6c, 0xa3, 0xd8, 0x1f, 0xb3, 0x7b, 0x76, 0xea, 0xfc, 0xa4, - 0xee, 0x1f, 0x27, 0x9d, 0x54, 0x10, 0xac, 0x3b, 0xec, 0xa8, 0x95, 0x69, 0x55, 0xa9, 0x9f, 0x31, - 0xd3, 0x5b, 0x28, 0xf6, 0xd9, 0x56, 0xe8, 0x80, 0x06, 0x43, 0x42, 0x3b, 0x8d, 0x5e, 0x8d, 0xb7, - 0x2e, 0xa0, 0x19, 0x0c, 0x9a, 0x51, 0x42, 0x33, 0x8e, 0x09, 0x8e, 0xad, 0x47, 0xcc, 0xef, 0xdb, - 0xa5, 0xd6, 0x0f, 0x70, 0x36, 0xc9, 0x5d, 0xc3, 0x23, 0x91, 0x59, 0x12, 0x16, 0x9f, 0x87, 0xd4, - 0x9f, 0x9a, 0x59, 0x91, 0x20, 0xca, 0x0b, 0xa8, 0x2d, 0x9c, 0xf5, 0xcf, 0x0a, 0x68, 0xbd, 0xca, - 0x51, 0x5a, 0x1c, 0x93, 0xd8, 0xc7, 0xfc, 0x26, 0xcf, 0xc0, 0x1e, 0x7b, 0xfb, 0xf1, 0x29, 0x5b, - 0x1e, 0xb3, 0x1a, 0x0e, 0xbe, 0x75, 0x74, 0xcf, 0xb8, 0x9e, 0x0d, 0x83, 0x3d, 0x0d, 0x2f, 0x3e, - 0x29, 0x12, 0x64, 0x37, 0xc3, 0xf5, 0x29, 0xdc, 0x07, 0x0d, 0x1f, 0xc5, 0x24, 0x12, 0x4f, 0x64, - 0x8b, 0x09, 0xc3, 0x74, 0xf3, 0x07, 0xd9, 0xa0, 0xf4, 0x37, 0xf4, 0x6f, 0xc0, 0xce, 0x32, 0x5e, - 0x37, 0x60, 0x7f, 0xb7, 0x74, 0x6d, 0x0b, 0xd7, 0x65, 0xa9, 0x80, 0xbf, 0xb2, 0xd2, 0xbf, 0x28, - 0xa0, 0xf9, 0xba, 0x88, 0xb3, 0x09, 0xca, 0xb0, 0xc7, 0x63, 0x78, 0x08, 0x60, 0x1e, 0xfb, 0x28, - 0x0d, 0x0b, 0x1c, 0x07, 0x63, 0x4e, 0x09, 0xfb, 0x65, 0x2c, 0xdb, 0x2b, 0x85, 0xed, 0x1d, 0xf9, - 0x50, 0x03, 0xbb, 0x94, 0x95, 0x8f, 0xd7, 0x39, 0x00, 0xbe, 0x34, 0xac, 0x60, 0x2c, 0x33, 0x53, - 0xfb, 0x47, 0x99, 0x59, 0x4f, 0x7c, 0xfd, 0x7f, 0x26, 0xfe, 0xc1, 0x00, 0x34, 0xaf, 0x05, 0x00, - 0xb6, 0x00, 0xb0, 0x8a, 0xca, 0xbb, 0x2d, 0x41, 0x00, 0xb6, 0xac, 0x82, 0x35, 0xd5, 0x96, 0xbb, - 0xf5, 0x8f, 0x5f, 0x55, 0xc9, 0x7a, 0x71, 0x3e, 0x57, 0xe5, 0x8b, 0xb9, 0x2a, 0xff, 0x98, 0xab, - 0xf2, 0xd9, 0x42, 0x95, 0x2e, 0x16, 0xaa, 0xf4, 0x7d, 0xa1, 0x4a, 0x6f, 0x9f, 0xac, 0x05, 0xf7, - 0x34, 0x77, 0xa8, 0x93, 0x86, 0x8e, 0x4b, 0xcb, 0x61, 0x4c, 0x7c, 0x64, 0x6e, 0xfc, 0xb2, 0x78, - 0x96, 0xdd, 0x2d, 0x7e, 0xa7, 0xc7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x42, 0x57, 0x6f, 0xbf, - 0xd1, 0x04, 0x00, 0x00, -} - -func (m *PeriodLock) 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 *PeriodLock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PeriodLock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Coins) > 0 { - for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLock(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintLock(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x22 - n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintLock(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x1a - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintLock(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0x12 - } - if m.ID != 0 { - i = encodeVarintLock(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryCondition) 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 *QueryCondition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintLock(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x22 - n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintLock(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x1a - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintLock(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x12 - } - if m.LockQueryType != 0 { - i = encodeVarintLock(dAtA, i, uint64(m.LockQueryType)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SyntheticLock) 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 *SyntheticLock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SyntheticLock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintLock(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x22 - n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintLock(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x1a - if len(m.SynthDenom) > 0 { - i -= len(m.SynthDenom) - copy(dAtA[i:], m.SynthDenom) - i = encodeVarintLock(dAtA, i, uint64(len(m.SynthDenom))) - i-- - dAtA[i] = 0x12 - } - if m.UnderlyingLockId != 0 { - i = encodeVarintLock(dAtA, i, uint64(m.UnderlyingLockId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintLock(dAtA []byte, offset int, v uint64) int { - offset -= sovLock(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PeriodLock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovLock(uint64(m.ID)) - } - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovLock(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovLock(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovLock(uint64(l)) - if len(m.Coins) > 0 { - for _, e := range m.Coins { - l = e.Size() - n += 1 + l + sovLock(uint64(l)) - } - } - return n -} - -func (m *QueryCondition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.LockQueryType != 0 { - n += 1 + sovLock(uint64(m.LockQueryType)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovLock(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovLock(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovLock(uint64(l)) - return n -} - -func (m *SyntheticLock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.UnderlyingLockId != 0 { - n += 1 + sovLock(uint64(m.UnderlyingLockId)) - } - l = len(m.SynthDenom) - if l > 0 { - n += 1 + l + sovLock(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovLock(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovLock(uint64(l)) - return n -} - -func sovLock(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozLock(x uint64) (n int) { - return sovLock(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PeriodLock) 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 ErrIntOverflowLock - } - 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: PeriodLock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PeriodLock: 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 ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - 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 ErrInvalidLengthLock - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Coins = append(m.Coins, types.Coin{}) - if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLock(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLock - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCondition) 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 ErrIntOverflowLock - } - 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: QueryCondition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCondition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LockQueryType", wireType) - } - m.LockQueryType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LockQueryType |= LockQueryType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - 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 ErrInvalidLengthLock - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLock(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLock - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SyntheticLock) 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 ErrIntOverflowLock - } - 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: SyntheticLock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SyntheticLock: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UnderlyingLockId", wireType) - } - m.UnderlyingLockId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UnderlyingLockId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SynthDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - 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 ErrInvalidLengthLock - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SynthDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLock(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLock - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipLock(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, ErrIntOverflowLock - } - 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, ErrIntOverflowLock - } - 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, ErrIntOverflowLock - } - 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, ErrInvalidLengthLock - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupLock - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthLock - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthLock = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLock = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupLock = fmt.Errorf("proto: unexpected end of group") -) diff --git a/osmosis/lockup/types/tx.pb.go b/osmosis/lockup/types/tx.pb.go deleted file mode 100644 index 453bde543..000000000 --- a/osmosis/lockup/types/tx.pb.go +++ /dev/null @@ -1,2015 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/lockup/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - _ "google.golang.org/protobuf/types/known/durationpb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -type MsgLockTokens struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - Duration time.Duration `protobuf:"bytes,2,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` - Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` -} - -func (m *MsgLockTokens) Reset() { *m = MsgLockTokens{} } -func (m *MsgLockTokens) String() string { return proto.CompactTextString(m) } -func (*MsgLockTokens) ProtoMessage() {} -func (*MsgLockTokens) Descriptor() ([]byte, []int) { - return fileDescriptor_bcdad5af0d24735f, []int{0} -} -func (m *MsgLockTokens) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgLockTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgLockTokens.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 *MsgLockTokens) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgLockTokens.Merge(m, src) -} -func (m *MsgLockTokens) XXX_Size() int { - return m.Size() -} -func (m *MsgLockTokens) XXX_DiscardUnknown() { - xxx_messageInfo_MsgLockTokens.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgLockTokens proto.InternalMessageInfo - -func (m *MsgLockTokens) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *MsgLockTokens) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *MsgLockTokens) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Coins - } - return nil -} - -type MsgLockTokensResponse struct { - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` -} - -func (m *MsgLockTokensResponse) Reset() { *m = MsgLockTokensResponse{} } -func (m *MsgLockTokensResponse) String() string { return proto.CompactTextString(m) } -func (*MsgLockTokensResponse) ProtoMessage() {} -func (*MsgLockTokensResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bcdad5af0d24735f, []int{1} -} -func (m *MsgLockTokensResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgLockTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgLockTokensResponse.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 *MsgLockTokensResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgLockTokensResponse.Merge(m, src) -} -func (m *MsgLockTokensResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgLockTokensResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgLockTokensResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgLockTokensResponse proto.InternalMessageInfo - -func (m *MsgLockTokensResponse) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -type MsgBeginUnlockingAll struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` -} - -func (m *MsgBeginUnlockingAll) Reset() { *m = MsgBeginUnlockingAll{} } -func (m *MsgBeginUnlockingAll) String() string { return proto.CompactTextString(m) } -func (*MsgBeginUnlockingAll) ProtoMessage() {} -func (*MsgBeginUnlockingAll) Descriptor() ([]byte, []int) { - return fileDescriptor_bcdad5af0d24735f, []int{2} -} -func (m *MsgBeginUnlockingAll) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBeginUnlockingAll) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBeginUnlockingAll.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 *MsgBeginUnlockingAll) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBeginUnlockingAll.Merge(m, src) -} -func (m *MsgBeginUnlockingAll) XXX_Size() int { - return m.Size() -} -func (m *MsgBeginUnlockingAll) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBeginUnlockingAll.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBeginUnlockingAll proto.InternalMessageInfo - -func (m *MsgBeginUnlockingAll) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -type MsgBeginUnlockingAllResponse struct { - Unlocks []*PeriodLock `protobuf:"bytes,1,rep,name=unlocks,proto3" json:"unlocks,omitempty"` -} - -func (m *MsgBeginUnlockingAllResponse) Reset() { *m = MsgBeginUnlockingAllResponse{} } -func (m *MsgBeginUnlockingAllResponse) String() string { return proto.CompactTextString(m) } -func (*MsgBeginUnlockingAllResponse) ProtoMessage() {} -func (*MsgBeginUnlockingAllResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bcdad5af0d24735f, []int{3} -} -func (m *MsgBeginUnlockingAllResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBeginUnlockingAllResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBeginUnlockingAllResponse.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 *MsgBeginUnlockingAllResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBeginUnlockingAllResponse.Merge(m, src) -} -func (m *MsgBeginUnlockingAllResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgBeginUnlockingAllResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBeginUnlockingAllResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBeginUnlockingAllResponse proto.InternalMessageInfo - -func (m *MsgBeginUnlockingAllResponse) GetUnlocks() []*PeriodLock { - if m != nil { - return m.Unlocks - } - return nil -} - -type MsgBeginUnlocking struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - ID uint64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - // Amount of unlocking coins. Unlock all if not set. - Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` -} - -func (m *MsgBeginUnlocking) Reset() { *m = MsgBeginUnlocking{} } -func (m *MsgBeginUnlocking) String() string { return proto.CompactTextString(m) } -func (*MsgBeginUnlocking) ProtoMessage() {} -func (*MsgBeginUnlocking) Descriptor() ([]byte, []int) { - return fileDescriptor_bcdad5af0d24735f, []int{4} -} -func (m *MsgBeginUnlocking) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBeginUnlocking) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBeginUnlocking.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 *MsgBeginUnlocking) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBeginUnlocking.Merge(m, src) -} -func (m *MsgBeginUnlocking) XXX_Size() int { - return m.Size() -} -func (m *MsgBeginUnlocking) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBeginUnlocking.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBeginUnlocking proto.InternalMessageInfo - -func (m *MsgBeginUnlocking) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *MsgBeginUnlocking) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *MsgBeginUnlocking) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Coins - } - return nil -} - -type MsgBeginUnlockingResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` -} - -func (m *MsgBeginUnlockingResponse) Reset() { *m = MsgBeginUnlockingResponse{} } -func (m *MsgBeginUnlockingResponse) String() string { return proto.CompactTextString(m) } -func (*MsgBeginUnlockingResponse) ProtoMessage() {} -func (*MsgBeginUnlockingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bcdad5af0d24735f, []int{5} -} -func (m *MsgBeginUnlockingResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBeginUnlockingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBeginUnlockingResponse.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 *MsgBeginUnlockingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBeginUnlockingResponse.Merge(m, src) -} -func (m *MsgBeginUnlockingResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgBeginUnlockingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBeginUnlockingResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBeginUnlockingResponse proto.InternalMessageInfo - -func (m *MsgBeginUnlockingResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -// MsgExtendLockup extends the existing lockup's duration. -// The new duration is longer than the original. -type MsgExtendLockup struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - ID uint64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - // duration to be set. fails if lower than the current duration, or is - // unlocking - Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` -} - -func (m *MsgExtendLockup) Reset() { *m = MsgExtendLockup{} } -func (m *MsgExtendLockup) String() string { return proto.CompactTextString(m) } -func (*MsgExtendLockup) ProtoMessage() {} -func (*MsgExtendLockup) Descriptor() ([]byte, []int) { - return fileDescriptor_bcdad5af0d24735f, []int{6} -} -func (m *MsgExtendLockup) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExtendLockup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExtendLockup.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 *MsgExtendLockup) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExtendLockup.Merge(m, src) -} -func (m *MsgExtendLockup) XXX_Size() int { - return m.Size() -} -func (m *MsgExtendLockup) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExtendLockup.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExtendLockup proto.InternalMessageInfo - -func (m *MsgExtendLockup) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *MsgExtendLockup) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *MsgExtendLockup) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -type MsgExtendLockupResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` -} - -func (m *MsgExtendLockupResponse) Reset() { *m = MsgExtendLockupResponse{} } -func (m *MsgExtendLockupResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExtendLockupResponse) ProtoMessage() {} -func (*MsgExtendLockupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bcdad5af0d24735f, []int{7} -} -func (m *MsgExtendLockupResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExtendLockupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExtendLockupResponse.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 *MsgExtendLockupResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExtendLockupResponse.Merge(m, src) -} -func (m *MsgExtendLockupResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgExtendLockupResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExtendLockupResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExtendLockupResponse proto.InternalMessageInfo - -func (m *MsgExtendLockupResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func init() { - proto.RegisterType((*MsgLockTokens)(nil), "osmosis.lockup.MsgLockTokens") - proto.RegisterType((*MsgLockTokensResponse)(nil), "osmosis.lockup.MsgLockTokensResponse") - proto.RegisterType((*MsgBeginUnlockingAll)(nil), "osmosis.lockup.MsgBeginUnlockingAll") - proto.RegisterType((*MsgBeginUnlockingAllResponse)(nil), "osmosis.lockup.MsgBeginUnlockingAllResponse") - proto.RegisterType((*MsgBeginUnlocking)(nil), "osmosis.lockup.MsgBeginUnlocking") - proto.RegisterType((*MsgBeginUnlockingResponse)(nil), "osmosis.lockup.MsgBeginUnlockingResponse") - proto.RegisterType((*MsgExtendLockup)(nil), "osmosis.lockup.MsgExtendLockup") - proto.RegisterType((*MsgExtendLockupResponse)(nil), "osmosis.lockup.MsgExtendLockupResponse") -} - -func init() { proto.RegisterFile("osmosis/lockup/tx.proto", fileDescriptor_bcdad5af0d24735f) } - -var fileDescriptor_bcdad5af0d24735f = []byte{ - // 588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x3f, 0x6f, 0xd3, 0x40, - 0x1c, 0x8d, 0x1d, 0x4a, 0xcb, 0x51, 0x5a, 0x6a, 0x15, 0x35, 0xb1, 0xc0, 0x0e, 0x16, 0xd0, 0x20, - 0x95, 0x3b, 0xd2, 0xd2, 0x85, 0x01, 0x89, 0x10, 0x86, 0x4a, 0x44, 0x20, 0xab, 0x48, 0x88, 0x01, - 0xc9, 0x76, 0x8e, 0xab, 0x15, 0xc7, 0x67, 0xf2, 0xb3, 0xa1, 0xd9, 0xf9, 0x00, 0x8c, 0x7c, 0x06, - 0x06, 0x16, 0xbe, 0x44, 0xc7, 0x8e, 0x4c, 0x29, 0x4a, 0x36, 0xc6, 0xce, 0x0c, 0xc8, 0xe7, 0xd8, - 0x4a, 0x9c, 0x88, 0x44, 0x48, 0x30, 0xd9, 0x77, 0xef, 0xfd, 0xfe, 0xbc, 0x97, 0x17, 0xa3, 0x2d, - 0x0e, 0x1d, 0x0e, 0x2e, 0x10, 0x8f, 0x3b, 0xed, 0x28, 0x20, 0xe1, 0x31, 0x0e, 0xba, 0x3c, 0xe4, - 0xca, 0xda, 0x08, 0xc0, 0x09, 0xa0, 0x6e, 0x32, 0xce, 0xb8, 0x80, 0x48, 0xfc, 0x96, 0xb0, 0x54, - 0x8d, 0x71, 0xce, 0x3c, 0x4a, 0xc4, 0xc9, 0x8e, 0xde, 0x92, 0x56, 0xd4, 0xb5, 0x42, 0x97, 0xfb, - 0x29, 0xee, 0x88, 0x36, 0xc4, 0xb6, 0x80, 0x92, 0xf7, 0x35, 0x9b, 0x86, 0x56, 0x8d, 0x38, 0xdc, - 0x4d, 0xf1, 0x72, 0x6e, 0x7c, 0xfc, 0x48, 0x20, 0xe3, 0xa3, 0x8c, 0xae, 0x34, 0x81, 0x3d, 0xe3, - 0x4e, 0xfb, 0x90, 0xb7, 0xa9, 0x0f, 0xca, 0x1d, 0xb4, 0xc4, 0x3f, 0xf8, 0xb4, 0x5b, 0x92, 0x2a, - 0x52, 0xf5, 0x52, 0xfd, 0xea, 0x79, 0x5f, 0x5f, 0xed, 0x59, 0x1d, 0xef, 0xa1, 0x21, 0xae, 0x0d, - 0x33, 0x81, 0x95, 0x23, 0xb4, 0x92, 0xae, 0x51, 0x92, 0x2b, 0x52, 0xf5, 0xf2, 0x6e, 0x19, 0x27, - 0x7b, 0xe2, 0x74, 0x4f, 0xdc, 0x18, 0x11, 0xea, 0xb5, 0x93, 0xbe, 0x5e, 0xf8, 0xd9, 0xd7, 0x95, - 0xb4, 0x64, 0x87, 0x77, 0xdc, 0x90, 0x76, 0x82, 0xb0, 0x77, 0xde, 0xd7, 0xd7, 0x93, 0xfe, 0x29, - 0x66, 0x7c, 0x3e, 0xd3, 0x25, 0x33, 0xeb, 0xae, 0x58, 0x68, 0x29, 0x16, 0x03, 0xa5, 0x62, 0xa5, - 0x28, 0xc6, 0x24, 0x72, 0x71, 0x2c, 0x17, 0x8f, 0xe4, 0xe2, 0x27, 0xdc, 0xf5, 0xeb, 0xf7, 0xe3, - 0x31, 0x5f, 0xce, 0xf4, 0x2a, 0x73, 0xc3, 0xa3, 0xc8, 0xc6, 0x0e, 0xef, 0x90, 0x91, 0x37, 0xc9, - 0xe3, 0x1e, 0xb4, 0xda, 0x24, 0xec, 0x05, 0x14, 0x44, 0x01, 0x98, 0x49, 0x67, 0x63, 0x1b, 0x5d, - 0x9b, 0x70, 0xc1, 0xa4, 0x10, 0x70, 0x1f, 0xa8, 0xb2, 0x86, 0xe4, 0x83, 0x86, 0xb0, 0xe2, 0x82, - 0x29, 0x1f, 0x34, 0x8c, 0x47, 0x68, 0xb3, 0x09, 0xac, 0x4e, 0x99, 0xeb, 0xbf, 0xf4, 0x63, 0x1f, - 0x5d, 0x9f, 0x3d, 0xf6, 0xbc, 0x45, 0x5d, 0x33, 0x0e, 0xd1, 0xf5, 0x59, 0xf5, 0xd9, 0xbc, 0x07, - 0x68, 0x39, 0x12, 0xf7, 0x50, 0x92, 0x84, 0x5a, 0x15, 0x4f, 0x46, 0x04, 0xbf, 0xa0, 0x5d, 0x97, - 0xb7, 0xe2, 0x55, 0xcd, 0x94, 0x6a, 0x7c, 0x95, 0xd0, 0xc6, 0x54, 0xdb, 0x85, 0x7f, 0xc9, 0x44, - 0xa3, 0x9c, 0x6a, 0xfc, 0x1f, 0x7e, 0xef, 0xa3, 0xf2, 0xd4, 0xbe, 0x99, 0x07, 0x25, 0xb4, 0x0c, - 0x91, 0xe3, 0x50, 0x00, 0xb1, 0xf9, 0x8a, 0x99, 0x1e, 0x8d, 0x6f, 0x12, 0x5a, 0x6f, 0x02, 0x7b, - 0x7a, 0x1c, 0x52, 0x5f, 0x58, 0x10, 0x05, 0x7f, 0xad, 0x72, 0x3c, 0xbf, 0xc5, 0x7f, 0x99, 0x5f, - 0x63, 0x0f, 0x6d, 0xe5, 0x96, 0x9e, 0x2f, 0x75, 0xf7, 0x97, 0x8c, 0x8a, 0x4d, 0x60, 0x8a, 0x89, - 0xd0, 0xd8, 0x9f, 0xf3, 0x46, 0x3e, 0x0d, 0x13, 0xa9, 0x55, 0x6f, 0xff, 0x11, 0xce, 0xa6, 0x32, - 0xb4, 0x31, 0x9d, 0xe0, 0x5b, 0x33, 0x6a, 0xa7, 0x58, 0xea, 0xce, 0x22, 0xac, 0x6c, 0xd0, 0x1b, - 0xb4, 0x96, 0xcb, 0xe4, 0xcd, 0xb9, 0xf5, 0xea, 0xdd, 0xb9, 0x94, 0xac, 0xff, 0x2b, 0xb4, 0x3a, - 0x91, 0x05, 0x7d, 0x46, 0xe9, 0x38, 0x41, 0xdd, 0x9e, 0x43, 0x48, 0x3b, 0xd7, 0x9f, 0x9f, 0x0c, - 0x34, 0xe9, 0x74, 0xa0, 0x49, 0x3f, 0x06, 0x9a, 0xf4, 0x69, 0xa8, 0x15, 0x4e, 0x87, 0x5a, 0xe1, - 0xfb, 0x50, 0x2b, 0xbc, 0xde, 0x1f, 0xcb, 0xfa, 0xbb, 0xc8, 0x02, 0xab, 0xeb, 0x59, 0x36, 0x8c, - 0x5e, 0x7d, 0xde, 0xa2, 0x24, 0xff, 0xb1, 0x8f, 0xe3, 0x6f, 0x5f, 0x14, 0xa1, 0xda, 0xfb, 0x1d, - 0x00, 0x00, 0xff, 0xff, 0x3a, 0x8c, 0x2a, 0x3e, 0x0b, 0x06, 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 { - // LockTokens lock tokens - LockTokens(ctx context.Context, in *MsgLockTokens, opts ...grpc.CallOption) (*MsgLockTokensResponse, error) - // BeginUnlockingAll begin unlocking all tokens - BeginUnlockingAll(ctx context.Context, in *MsgBeginUnlockingAll, opts ...grpc.CallOption) (*MsgBeginUnlockingAllResponse, error) - // MsgBeginUnlocking begins unlocking tokens by lock ID - BeginUnlocking(ctx context.Context, in *MsgBeginUnlocking, opts ...grpc.CallOption) (*MsgBeginUnlockingResponse, error) - // MsgEditLockup edits the existing lockups by lock ID - ExtendLockup(ctx context.Context, in *MsgExtendLockup, opts ...grpc.CallOption) (*MsgExtendLockupResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) LockTokens(ctx context.Context, in *MsgLockTokens, opts ...grpc.CallOption) (*MsgLockTokensResponse, error) { - out := new(MsgLockTokensResponse) - err := c.cc.Invoke(ctx, "/osmosis.lockup.Msg/LockTokens", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) BeginUnlockingAll(ctx context.Context, in *MsgBeginUnlockingAll, opts ...grpc.CallOption) (*MsgBeginUnlockingAllResponse, error) { - out := new(MsgBeginUnlockingAllResponse) - err := c.cc.Invoke(ctx, "/osmosis.lockup.Msg/BeginUnlockingAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) BeginUnlocking(ctx context.Context, in *MsgBeginUnlocking, opts ...grpc.CallOption) (*MsgBeginUnlockingResponse, error) { - out := new(MsgBeginUnlockingResponse) - err := c.cc.Invoke(ctx, "/osmosis.lockup.Msg/BeginUnlocking", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ExtendLockup(ctx context.Context, in *MsgExtendLockup, opts ...grpc.CallOption) (*MsgExtendLockupResponse, error) { - out := new(MsgExtendLockupResponse) - err := c.cc.Invoke(ctx, "/osmosis.lockup.Msg/ExtendLockup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // LockTokens lock tokens - LockTokens(context.Context, *MsgLockTokens) (*MsgLockTokensResponse, error) - // BeginUnlockingAll begin unlocking all tokens - BeginUnlockingAll(context.Context, *MsgBeginUnlockingAll) (*MsgBeginUnlockingAllResponse, error) - // MsgBeginUnlocking begins unlocking tokens by lock ID - BeginUnlocking(context.Context, *MsgBeginUnlocking) (*MsgBeginUnlockingResponse, error) - // MsgEditLockup edits the existing lockups by lock ID - ExtendLockup(context.Context, *MsgExtendLockup) (*MsgExtendLockupResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) LockTokens(ctx context.Context, req *MsgLockTokens) (*MsgLockTokensResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LockTokens not implemented") -} -func (*UnimplementedMsgServer) BeginUnlockingAll(ctx context.Context, req *MsgBeginUnlockingAll) (*MsgBeginUnlockingAllResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BeginUnlockingAll not implemented") -} -func (*UnimplementedMsgServer) BeginUnlocking(ctx context.Context, req *MsgBeginUnlocking) (*MsgBeginUnlockingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BeginUnlocking not implemented") -} -func (*UnimplementedMsgServer) ExtendLockup(ctx context.Context, req *MsgExtendLockup) (*MsgExtendLockupResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExtendLockup not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_LockTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgLockTokens) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).LockTokens(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.lockup.Msg/LockTokens", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).LockTokens(ctx, req.(*MsgLockTokens)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_BeginUnlockingAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgBeginUnlockingAll) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).BeginUnlockingAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.lockup.Msg/BeginUnlockingAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).BeginUnlockingAll(ctx, req.(*MsgBeginUnlockingAll)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_BeginUnlocking_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgBeginUnlocking) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).BeginUnlocking(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.lockup.Msg/BeginUnlocking", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).BeginUnlocking(ctx, req.(*MsgBeginUnlocking)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ExtendLockup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExtendLockup) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ExtendLockup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.lockup.Msg/ExtendLockup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ExtendLockup(ctx, req.(*MsgExtendLockup)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "osmosis.lockup.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "LockTokens", - Handler: _Msg_LockTokens_Handler, - }, - { - MethodName: "BeginUnlockingAll", - Handler: _Msg_BeginUnlockingAll_Handler, - }, - { - MethodName: "BeginUnlocking", - Handler: _Msg_BeginUnlocking_Handler, - }, - { - MethodName: "ExtendLockup", - Handler: _Msg_ExtendLockup_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "osmosis/lockup/tx.proto", -} - -func (m *MsgLockTokens) 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 *MsgLockTokens) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgLockTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Coins) > 0 { - for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintTx(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgLockTokensResponse) 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 *MsgLockTokensResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgLockTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgBeginUnlockingAll) 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 *MsgBeginUnlockingAll) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBeginUnlockingAll) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgBeginUnlockingAllResponse) 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 *MsgBeginUnlockingAllResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBeginUnlockingAllResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Unlocks) > 0 { - for iNdEx := len(m.Unlocks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Unlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgBeginUnlocking) 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 *MsgBeginUnlocking) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBeginUnlocking) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Coins) > 0 { - for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.ID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x10 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgBeginUnlockingResponse) 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 *MsgBeginUnlockingResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBeginUnlockingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Success { - i-- - if m.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgExtendLockup) 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 *MsgExtendLockup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExtendLockup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintTx(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x1a - if m.ID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x10 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgExtendLockupResponse) 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 *MsgExtendLockupResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExtendLockupResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Success { - i-- - if m.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - 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 *MsgLockTokens) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovTx(uint64(l)) - if len(m.Coins) > 0 { - for _, e := range m.Coins { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgLockTokensResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovTx(uint64(m.ID)) - } - return n -} - -func (m *MsgBeginUnlockingAll) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgBeginUnlockingAllResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Unlocks) > 0 { - for _, e := range m.Unlocks { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgBeginUnlocking) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.ID != 0 { - n += 1 + sovTx(uint64(m.ID)) - } - if len(m.Coins) > 0 { - for _, e := range m.Coins { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgBeginUnlockingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Success { - n += 2 - } - return n -} - -func (m *MsgExtendLockup) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.ID != 0 { - n += 1 + sovTx(uint64(m.ID)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgExtendLockupResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Success { - n += 2 - } - 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 *MsgLockTokens) 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: MsgLockTokens: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgLockTokens: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", 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 := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coins", 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.Coins = append(m.Coins, types.Coin{}) - if err := m.Coins[len(m.Coins)-1].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 *MsgLockTokensResponse) 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: MsgLockTokensResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgLockTokensResponse: 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 ErrIntOverflowTx - } - 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 := 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 *MsgBeginUnlockingAll) 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: MsgBeginUnlockingAll: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBeginUnlockingAll: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = 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 *MsgBeginUnlockingAllResponse) 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: MsgBeginUnlockingAllResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBeginUnlockingAllResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unlocks", 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.Unlocks = append(m.Unlocks, &PeriodLock{}) - if err := m.Unlocks[len(m.Unlocks)-1].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 *MsgBeginUnlocking) 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: MsgBeginUnlocking: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBeginUnlocking: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coins", 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.Coins = append(m.Coins, types.Coin{}) - if err := m.Coins[len(m.Coins)-1].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 *MsgBeginUnlockingResponse) 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: MsgBeginUnlockingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBeginUnlockingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Success = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgExtendLockup) 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: MsgExtendLockup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExtendLockup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", 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 := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, 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 *MsgExtendLockupResponse) 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: MsgExtendLockupResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExtendLockupResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Success = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func 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/osmosis/mint/types/mint.pb.go b/osmosis/mint/types/mint.pb.go deleted file mode 100644 index 5b39f8076..000000000 --- a/osmosis/mint/types/mint.pb.go +++ /dev/null @@ -1,1405 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/mint/v1beta1/mint.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - 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 - -// Minter represents the minting state. -type Minter struct { - // epoch_provisions represent rewards for the current epoch. - EpochProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=epoch_provisions,json=epochProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"epoch_provisions" yaml:"epoch_provisions"` -} - -func (m *Minter) Reset() { *m = Minter{} } -func (m *Minter) String() string { return proto.CompactTextString(m) } -func (*Minter) ProtoMessage() {} -func (*Minter) Descriptor() ([]byte, []int) { - return fileDescriptor_ccb38f8335e0f45b, []int{0} -} -func (m *Minter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Minter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Minter.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 *Minter) XXX_Merge(src proto.Message) { - xxx_messageInfo_Minter.Merge(m, src) -} -func (m *Minter) XXX_Size() int { - return m.Size() -} -func (m *Minter) XXX_DiscardUnknown() { - xxx_messageInfo_Minter.DiscardUnknown(m) -} - -var xxx_messageInfo_Minter proto.InternalMessageInfo - -// WeightedAddress represents an address with a weight assigned to it. -// The weight is used to determine the proportion of the total minted -// tokens to be minted to the address. -type WeightedAddress struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` - Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight" yaml:"weight"` -} - -func (m *WeightedAddress) Reset() { *m = WeightedAddress{} } -func (m *WeightedAddress) String() string { return proto.CompactTextString(m) } -func (*WeightedAddress) ProtoMessage() {} -func (*WeightedAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_ccb38f8335e0f45b, []int{1} -} -func (m *WeightedAddress) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WeightedAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WeightedAddress.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 *WeightedAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_WeightedAddress.Merge(m, src) -} -func (m *WeightedAddress) XXX_Size() int { - return m.Size() -} -func (m *WeightedAddress) XXX_DiscardUnknown() { - xxx_messageInfo_WeightedAddress.DiscardUnknown(m) -} - -var xxx_messageInfo_WeightedAddress proto.InternalMessageInfo - -func (m *WeightedAddress) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -// DistributionProportions defines the distribution proportions of the minted -// denom. In other words, defines which stakeholders will receive the minted -// denoms and how much. -type DistributionProportions struct { - // staking defines the proportion of the minted mint_denom that is to be - // allocated as staking rewards. - Staking github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=staking,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"staking" yaml:"staking"` - // pool_incentives defines the proportion of the minted mint_denom that is - // to be allocated as pool incentives. - PoolIncentives github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=pool_incentives,json=poolIncentives,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"pool_incentives" yaml:"pool_incentives"` - // developer_rewards defines the proportion of the minted mint_denom that is - // to be allocated to developer rewards address. - DeveloperRewards github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=developer_rewards,json=developerRewards,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"developer_rewards" yaml:"developer_rewards"` - // community_pool defines the proportion of the minted mint_denom that is - // to be allocated to the community pool. - CommunityPool github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=community_pool,json=communityPool,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_pool" yaml:"community_pool"` -} - -func (m *DistributionProportions) Reset() { *m = DistributionProportions{} } -func (m *DistributionProportions) String() string { return proto.CompactTextString(m) } -func (*DistributionProportions) ProtoMessage() {} -func (*DistributionProportions) Descriptor() ([]byte, []int) { - return fileDescriptor_ccb38f8335e0f45b, []int{2} -} -func (m *DistributionProportions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DistributionProportions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DistributionProportions.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 *DistributionProportions) XXX_Merge(src proto.Message) { - xxx_messageInfo_DistributionProportions.Merge(m, src) -} -func (m *DistributionProportions) XXX_Size() int { - return m.Size() -} -func (m *DistributionProportions) XXX_DiscardUnknown() { - xxx_messageInfo_DistributionProportions.DiscardUnknown(m) -} - -var xxx_messageInfo_DistributionProportions proto.InternalMessageInfo - -// Params holds parameters for the x/mint module. -type Params struct { - // mint_denom is the denom of the coin to mint. - MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` - // genesis_epoch_provisions epoch provisions from the first epoch. - GenesisEpochProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=genesis_epoch_provisions,json=genesisEpochProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"genesis_epoch_provisions" yaml:"genesis_epoch_provisions"` - // epoch_identifier mint epoch identifier e.g. (day, week). - EpochIdentifier string `protobuf:"bytes,3,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty" yaml:"epoch_identifier"` - // reduction_period_in_epochs the number of epochs it takes - // to reduce the rewards. - ReductionPeriodInEpochs int64 `protobuf:"varint,4,opt,name=reduction_period_in_epochs,json=reductionPeriodInEpochs,proto3" json:"reduction_period_in_epochs,omitempty" yaml:"reduction_period_in_epochs"` - // reduction_factor is the reduction multiplier to execute - // at the end of each period set by reduction_period_in_epochs. - ReductionFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=reduction_factor,json=reductionFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reduction_factor" yaml:"reduction_factor"` - // distribution_proportions defines the distribution proportions of the minted - // denom. In other words, defines which stakeholders will receive the minted - // denoms and how much. - DistributionProportions DistributionProportions `protobuf:"bytes,6,opt,name=distribution_proportions,json=distributionProportions,proto3" json:"distribution_proportions"` - // weighted_developer_rewards_receivers is the address to receive developer - // rewards with weights assignedt to each address. The final amount that each - // address receives is: epoch_provisions * - // distribution_proportions.developer_rewards * Address's Weight. - WeightedDeveloperRewardsReceivers []WeightedAddress `protobuf:"bytes,7,rep,name=weighted_developer_rewards_receivers,json=weightedDeveloperRewardsReceivers,proto3" json:"weighted_developer_rewards_receivers" yaml:"developer_rewards_receiver"` - // minting_rewards_distribution_start_epoch start epoch to distribute minting - // rewards - MintingRewardsDistributionStartEpoch int64 `protobuf:"varint,8,opt,name=minting_rewards_distribution_start_epoch,json=mintingRewardsDistributionStartEpoch,proto3" json:"minting_rewards_distribution_start_epoch,omitempty" yaml:"minting_rewards_distribution_start_epoch"` -} - -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_ccb38f8335e0f45b, []int{3} -} -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) GetMintDenom() string { - if m != nil { - return m.MintDenom - } - return "" -} - -func (m *Params) GetEpochIdentifier() string { - if m != nil { - return m.EpochIdentifier - } - return "" -} - -func (m *Params) GetReductionPeriodInEpochs() int64 { - if m != nil { - return m.ReductionPeriodInEpochs - } - return 0 -} - -func (m *Params) GetDistributionProportions() DistributionProportions { - if m != nil { - return m.DistributionProportions - } - return DistributionProportions{} -} - -func (m *Params) GetWeightedDeveloperRewardsReceivers() []WeightedAddress { - if m != nil { - return m.WeightedDeveloperRewardsReceivers - } - return nil -} - -func (m *Params) GetMintingRewardsDistributionStartEpoch() int64 { - if m != nil { - return m.MintingRewardsDistributionStartEpoch - } - return 0 -} - -func init() { - proto.RegisterType((*Minter)(nil), "osmosis.mint.v1beta1.Minter") - proto.RegisterType((*WeightedAddress)(nil), "osmosis.mint.v1beta1.WeightedAddress") - proto.RegisterType((*DistributionProportions)(nil), "osmosis.mint.v1beta1.DistributionProportions") - proto.RegisterType((*Params)(nil), "osmosis.mint.v1beta1.Params") -} - -func init() { proto.RegisterFile("osmosis/mint/v1beta1/mint.proto", fileDescriptor_ccb38f8335e0f45b) } - -var fileDescriptor_ccb38f8335e0f45b = []byte{ - // 726 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xbf, 0x4f, 0x1b, 0x49, - 0x14, 0xf6, 0x9e, 0x39, 0x73, 0x0c, 0x02, 0x73, 0x2b, 0x0e, 0xaf, 0x38, 0x9d, 0x17, 0x46, 0x70, - 0xf2, 0x49, 0x87, 0x2d, 0xa0, 0x4b, 0x93, 0xc4, 0x72, 0x48, 0x1c, 0x09, 0xc9, 0x99, 0x14, 0x48, - 0x34, 0xab, 0xf5, 0xee, 0x60, 0x46, 0x78, 0x67, 0x96, 0x99, 0xb1, 0x2d, 0x9a, 0xfc, 0x03, 0x69, - 0x52, 0xa6, 0xcd, 0x7f, 0x43, 0x49, 0xba, 0x28, 0x85, 0x15, 0xc1, 0x7f, 0xe0, 0x2e, 0x5d, 0x34, - 0x3f, 0x6c, 0x63, 0x83, 0xa5, 0x58, 0xa9, 0x3c, 0xfe, 0xe6, 0xed, 0xf7, 0xbd, 0x7d, 0xef, 0x7d, - 0x6f, 0x81, 0xcf, 0x44, 0xc2, 0x04, 0x11, 0x95, 0x84, 0x50, 0x59, 0xe9, 0xee, 0x37, 0xb1, 0x0c, - 0xf7, 0xf5, 0x9f, 0x72, 0xca, 0x99, 0x64, 0xee, 0xba, 0x0d, 0x28, 0x6b, 0xcc, 0x06, 0x6c, 0xae, - 0xb7, 0x58, 0x8b, 0xe9, 0x80, 0x8a, 0x3a, 0x99, 0x58, 0xf8, 0x0e, 0xe4, 0x8e, 0x09, 0x95, 0x98, - 0xbb, 0x12, 0xac, 0xe1, 0x94, 0x45, 0xe7, 0x41, 0xca, 0x59, 0x97, 0x08, 0xc2, 0xa8, 0xf0, 0x9c, - 0x2d, 0xa7, 0xb4, 0x54, 0xad, 0x5f, 0xf7, 0xfd, 0xcc, 0xd7, 0xbe, 0xff, 0x6f, 0x8b, 0xc8, 0xf3, - 0x4e, 0xb3, 0x1c, 0xb1, 0xa4, 0x12, 0x69, 0x0d, 0xfb, 0xb3, 0x27, 0xe2, 0x8b, 0x8a, 0xbc, 0x4a, - 0xb1, 0x28, 0xd7, 0x70, 0x34, 0xe8, 0xfb, 0x85, 0xab, 0x30, 0x69, 0x3f, 0x81, 0xd3, 0x7c, 0x10, - 0xe5, 0x35, 0xd4, 0x18, 0x23, 0x1f, 0x1d, 0x90, 0x3f, 0xc1, 0xa4, 0x75, 0x2e, 0x71, 0xfc, 0x3c, - 0x8e, 0x39, 0x16, 0xc2, 0xfd, 0x1f, 0x2c, 0x86, 0xe6, 0x68, 0x13, 0x70, 0x07, 0x7d, 0x7f, 0xd5, - 0x50, 0xda, 0x0b, 0x88, 0x86, 0x21, 0xee, 0x09, 0xc8, 0xf5, 0x34, 0x81, 0xf7, 0x9b, 0x0e, 0x7e, - 0x3a, 0x77, 0xb6, 0x2b, 0x86, 0xda, 0xb0, 0x40, 0x64, 0xe9, 0xe0, 0xe7, 0x2c, 0x28, 0xd4, 0x88, - 0x90, 0x9c, 0x34, 0x3b, 0x92, 0x30, 0xda, 0xe0, 0x2c, 0x65, 0x5c, 0x9d, 0x84, 0x7b, 0x0a, 0x16, - 0x85, 0x0c, 0x2f, 0x08, 0x6d, 0xd9, 0x14, 0x9f, 0xcd, 0xad, 0x6a, 0x5f, 0xc8, 0xd2, 0x40, 0x34, - 0x24, 0x74, 0x2f, 0x41, 0x3e, 0x65, 0xac, 0x1d, 0x10, 0x1a, 0x61, 0x2a, 0x49, 0x17, 0x0b, 0xfb, - 0x66, 0xaf, 0xe6, 0xd6, 0xd8, 0x30, 0x1a, 0x53, 0x74, 0x10, 0xad, 0x2a, 0xa4, 0x3e, 0x02, 0xdc, - 0x1e, 0xf8, 0x33, 0xc6, 0x5d, 0xdc, 0x66, 0x29, 0xe6, 0x01, 0xc7, 0xbd, 0x90, 0xc7, 0xc2, 0xcb, - 0x6a, 0xd1, 0xd7, 0x73, 0x8b, 0x7a, 0x46, 0xf4, 0x01, 0x21, 0x44, 0x6b, 0x23, 0x0c, 0x19, 0xc8, - 0xa5, 0x60, 0x35, 0x62, 0x49, 0xd2, 0xa1, 0x44, 0x5e, 0x05, 0x2a, 0x29, 0x6f, 0x41, 0xab, 0xbe, - 0x9c, 0x5b, 0xf5, 0x2f, 0xa3, 0x3a, 0xc9, 0x06, 0xd1, 0xca, 0x08, 0x68, 0xa8, 0xff, 0xdf, 0x73, - 0x20, 0xd7, 0x08, 0x79, 0x98, 0x08, 0xf7, 0x1f, 0x00, 0x94, 0x3f, 0x82, 0x18, 0x53, 0x96, 0x98, - 0x2e, 0xa2, 0x25, 0x85, 0xd4, 0x14, 0xe0, 0xbe, 0x77, 0x80, 0xd7, 0xc2, 0x14, 0x0b, 0x22, 0x82, - 0x07, 0xbe, 0x30, 0xfd, 0x78, 0x33, 0x77, 0x92, 0xbe, 0x49, 0x72, 0x16, 0x2f, 0x44, 0x1b, 0xf6, - 0xea, 0xc5, 0xa4, 0x4d, 0xdc, 0xa3, 0xa1, 0x39, 0x49, 0xac, 0x7a, 0x76, 0x46, 0x30, 0xb7, 0xfd, - 0xf9, 0x7b, 0xda, 0x6e, 0xe3, 0x88, 0xa1, 0xdd, 0xea, 0x23, 0xc4, 0x6d, 0x82, 0x4d, 0x8e, 0xe3, - 0x4e, 0xa4, 0xa6, 0x38, 0x48, 0x31, 0x27, 0x2c, 0x0e, 0x08, 0x35, 0x89, 0x08, 0x5d, 0xfb, 0x6c, - 0x75, 0x77, 0xd0, 0xf7, 0xb7, 0x0d, 0xe3, 0xec, 0x58, 0x88, 0x0a, 0xa3, 0xcb, 0x86, 0xbe, 0xab, - 0x53, 0x9d, 0xb4, 0x50, 0x8b, 0x64, 0xfc, 0xdc, 0x59, 0x18, 0x49, 0xc6, 0xbd, 0xdf, 0x7f, 0x6d, - 0x91, 0x4c, 0xf3, 0x41, 0x94, 0x1f, 0x41, 0x47, 0x1a, 0x71, 0x29, 0xf0, 0xe2, 0x7b, 0x66, 0x55, - 0x55, 0x1d, 0xba, 0xd5, 0xcb, 0x6d, 0x39, 0xa5, 0xe5, 0x83, 0xbd, 0xf2, 0x63, 0x7b, 0xb1, 0x3c, - 0xc3, 0xe2, 0xd5, 0x05, 0x95, 0x2c, 0x2a, 0xc4, 0x33, 0x36, 0xc0, 0x27, 0x07, 0xec, 0xf4, 0xec, - 0xe2, 0x0a, 0x1e, 0xcc, 0x7a, 0xc0, 0x71, 0x84, 0x49, 0x17, 0x73, 0xe1, 0x2d, 0x6e, 0x65, 0x4b, - 0xcb, 0x07, 0xbb, 0x8f, 0x8b, 0x4f, 0xad, 0xbe, 0xea, 0x7f, 0x4a, 0x74, 0x5c, 0xff, 0xd9, 0xbc, - 0x10, 0x6d, 0x0f, 0xd5, 0x6b, 0x53, 0xa6, 0x42, 0x43, 0x69, 0x35, 0xc3, 0x25, 0x25, 0x47, 0x68, - 0x6b, 0x44, 0x30, 0x51, 0x24, 0x21, 0x43, 0x2e, 0x4d, 0x47, 0xbd, 0x3f, 0x74, 0xf3, 0x0f, 0x07, - 0x7d, 0xbf, 0x62, 0xc4, 0x7f, 0xf6, 0x49, 0x88, 0x76, 0x6c, 0xa8, 0x4d, 0xe0, 0x7e, 0x45, 0xdf, - 0xaa, 0x38, 0x3d, 0x18, 0xd5, 0xe3, 0xeb, 0xdb, 0xa2, 0x73, 0x73, 0x5b, 0x74, 0xbe, 0xdd, 0x16, - 0x9d, 0x0f, 0x77, 0xc5, 0xcc, 0xcd, 0x5d, 0x31, 0xf3, 0xe5, 0xae, 0x98, 0x39, 0x3d, 0xbc, 0x37, - 0x0f, 0x97, 0x9d, 0x50, 0x84, 0xbc, 0x1d, 0x36, 0x85, 0x3d, 0x52, 0x16, 0xe3, 0xca, 0xc4, 0x27, - 0x4f, 0x0f, 0x48, 0x33, 0xa7, 0x3f, 0x60, 0x87, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x6d, - 0x11, 0x22, 0x0f, 0x07, 0x00, 0x00, -} - -func (m *Minter) 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 *Minter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Minter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.EpochProvisions.Size() - i -= size - if _, err := m.EpochProvisions.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *WeightedAddress) 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 *WeightedAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WeightedAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintMint(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DistributionProportions) 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 *DistributionProportions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DistributionProportions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.CommunityPool.Size() - i -= size - if _, err := m.CommunityPool.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.DeveloperRewards.Size() - i -= size - if _, err := m.DeveloperRewards.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.PoolIncentives.Size() - i -= size - if _, err := m.PoolIncentives.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.Staking.Size() - i -= size - if _, err := m.Staking.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -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 m.MintingRewardsDistributionStartEpoch != 0 { - i = encodeVarintMint(dAtA, i, uint64(m.MintingRewardsDistributionStartEpoch)) - i-- - dAtA[i] = 0x40 - } - if len(m.WeightedDeveloperRewardsReceivers) > 0 { - for iNdEx := len(m.WeightedDeveloperRewardsReceivers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.WeightedDeveloperRewardsReceivers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - { - size, err := m.DistributionProportions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.ReductionFactor.Size() - i -= size - if _, err := m.ReductionFactor.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.ReductionPeriodInEpochs != 0 { - i = encodeVarintMint(dAtA, i, uint64(m.ReductionPeriodInEpochs)) - i-- - dAtA[i] = 0x20 - } - if len(m.EpochIdentifier) > 0 { - i -= len(m.EpochIdentifier) - copy(dAtA[i:], m.EpochIdentifier) - i = encodeVarintMint(dAtA, i, uint64(len(m.EpochIdentifier))) - i-- - dAtA[i] = 0x1a - } - { - size := m.GenesisEpochProvisions.Size() - i -= size - if _, err := m.GenesisEpochProvisions.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.MintDenom) > 0 { - i -= len(m.MintDenom) - copy(dAtA[i:], m.MintDenom) - i = encodeVarintMint(dAtA, i, uint64(len(m.MintDenom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintMint(dAtA []byte, offset int, v uint64) int { - offset -= sovMint(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Minter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.EpochProvisions.Size() - n += 1 + l + sovMint(uint64(l)) - return n -} - -func (m *WeightedAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = m.Weight.Size() - n += 1 + l + sovMint(uint64(l)) - return n -} - -func (m *DistributionProportions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Staking.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.PoolIncentives.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.DeveloperRewards.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.CommunityPool.Size() - n += 1 + l + sovMint(uint64(l)) - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MintDenom) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = m.GenesisEpochProvisions.Size() - n += 1 + l + sovMint(uint64(l)) - l = len(m.EpochIdentifier) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - if m.ReductionPeriodInEpochs != 0 { - n += 1 + sovMint(uint64(m.ReductionPeriodInEpochs)) - } - l = m.ReductionFactor.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.DistributionProportions.Size() - n += 1 + l + sovMint(uint64(l)) - if len(m.WeightedDeveloperRewardsReceivers) > 0 { - for _, e := range m.WeightedDeveloperRewardsReceivers { - l = e.Size() - n += 1 + l + sovMint(uint64(l)) - } - } - if m.MintingRewardsDistributionStartEpoch != 0 { - n += 1 + sovMint(uint64(m.MintingRewardsDistributionStartEpoch)) - } - return n -} - -func sovMint(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMint(x uint64) (n int) { - return sovMint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Minter) 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 ErrIntOverflowMint - } - 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: Minter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Minter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochProvisions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.EpochProvisions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WeightedAddress) 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 ErrIntOverflowMint - } - 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: WeightedAddress: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WeightedAddress: 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 ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - 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 Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DistributionProportions) 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 ErrIntOverflowMint - } - 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: DistributionProportions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DistributionProportions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Staking", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Staking.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolIncentives", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PoolIncentives.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeveloperRewards", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DeveloperRewards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommunityPool", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CommunityPool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -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 ErrIntOverflowMint - } - 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 MintDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MintDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenesisEpochProvisions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.GenesisEpochProvisions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochIdentifier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EpochIdentifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReductionPeriodInEpochs", wireType) - } - m.ReductionPeriodInEpochs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ReductionPeriodInEpochs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReductionFactor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ReductionFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionProportions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DistributionProportions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WeightedDeveloperRewardsReceivers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WeightedDeveloperRewardsReceivers = append(m.WeightedDeveloperRewardsReceivers, WeightedAddress{}) - if err := m.WeightedDeveloperRewardsReceivers[len(m.WeightedDeveloperRewardsReceivers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MintingRewardsDistributionStartEpoch", wireType) - } - m.MintingRewardsDistributionStartEpoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MintingRewardsDistributionStartEpoch |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMint(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, ErrIntOverflowMint - } - 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, ErrIntOverflowMint - } - 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, ErrIntOverflowMint - } - 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, ErrInvalidLengthMint - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMint - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMint - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMint = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMint = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMint = fmt.Errorf("proto: unexpected end of group") -) diff --git a/osmosis/mint/types/query.pb.go b/osmosis/mint/types/query.pb.go deleted file mode 100644 index d3465629d..000000000 --- a/osmosis/mint/types/query.pb.go +++ /dev/null @@ -1,870 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/mint/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryParamsRequest 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_cd2f42111e753fbb, []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 - -// QueryParamsResponse 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_cd2f42111e753fbb, []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{} -} - -// QueryEpochProvisionsRequest is the request type for the -// Query/EpochProvisions RPC method. -type QueryEpochProvisionsRequest struct { -} - -func (m *QueryEpochProvisionsRequest) Reset() { *m = QueryEpochProvisionsRequest{} } -func (m *QueryEpochProvisionsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryEpochProvisionsRequest) ProtoMessage() {} -func (*QueryEpochProvisionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd2f42111e753fbb, []int{2} -} -func (m *QueryEpochProvisionsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryEpochProvisionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryEpochProvisionsRequest.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 *QueryEpochProvisionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEpochProvisionsRequest.Merge(m, src) -} -func (m *QueryEpochProvisionsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryEpochProvisionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEpochProvisionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryEpochProvisionsRequest proto.InternalMessageInfo - -// QueryEpochProvisionsResponse is the response type for the -// Query/EpochProvisions RPC method. -type QueryEpochProvisionsResponse struct { - // epoch_provisions is the current minting per epoch provisions value. - EpochProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=epoch_provisions,json=epochProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"epoch_provisions"` -} - -func (m *QueryEpochProvisionsResponse) Reset() { *m = QueryEpochProvisionsResponse{} } -func (m *QueryEpochProvisionsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryEpochProvisionsResponse) ProtoMessage() {} -func (*QueryEpochProvisionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd2f42111e753fbb, []int{3} -} -func (m *QueryEpochProvisionsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryEpochProvisionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryEpochProvisionsResponse.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 *QueryEpochProvisionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEpochProvisionsResponse.Merge(m, src) -} -func (m *QueryEpochProvisionsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryEpochProvisionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEpochProvisionsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryEpochProvisionsResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "osmosis.mint.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "osmosis.mint.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryEpochProvisionsRequest)(nil), "osmosis.mint.v1beta1.QueryEpochProvisionsRequest") - proto.RegisterType((*QueryEpochProvisionsResponse)(nil), "osmosis.mint.v1beta1.QueryEpochProvisionsResponse") -} - -func init() { proto.RegisterFile("osmosis/mint/v1beta1/query.proto", fileDescriptor_cd2f42111e753fbb) } - -var fileDescriptor_cd2f42111e753fbb = []byte{ - // 396 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x6a, 0xe2, 0x40, - 0x18, 0xc7, 0x13, 0xd9, 0xf5, 0x30, 0xbb, 0xe0, 0x32, 0xeb, 0x61, 0xc9, 0x66, 0xa3, 0x84, 0x45, - 0xdc, 0xc3, 0xce, 0xa0, 0xde, 0xf6, 0x28, 0xdb, 0x63, 0x41, 0xbd, 0xb5, 0x97, 0x32, 0x89, 0x43, - 0x0c, 0x35, 0xf9, 0x62, 0x66, 0x22, 0x78, 0x6d, 0x5f, 0xa0, 0xd0, 0x97, 0xe8, 0x23, 0xf4, 0x11, - 0x3c, 0x0a, 0xbd, 0x94, 0x1e, 0xa4, 0x68, 0x1f, 0xa4, 0x64, 0x32, 0x2d, 0xd5, 0x86, 0xd2, 0x9e, - 0x32, 0xcc, 0xf7, 0xff, 0xe6, 0xf7, 0xff, 0xbe, 0x7f, 0x50, 0x13, 0x44, 0x04, 0x22, 0x14, 0x34, - 0x0a, 0x63, 0x49, 0xe7, 0x1d, 0x8f, 0x4b, 0xd6, 0xa1, 0xb3, 0x8c, 0xa7, 0x0b, 0x92, 0xa4, 0x20, - 0x01, 0xd7, 0xb5, 0x82, 0xe4, 0x0a, 0xa2, 0x15, 0x56, 0x3d, 0x80, 0x00, 0x94, 0x80, 0xe6, 0xa7, - 0x42, 0x6b, 0xd9, 0x01, 0x40, 0x30, 0xe5, 0x94, 0x25, 0x21, 0x65, 0x71, 0x0c, 0x92, 0xc9, 0x10, - 0x62, 0xa1, 0xab, 0x8d, 0x52, 0x96, 0x7a, 0x56, 0x09, 0xdc, 0x3a, 0xc2, 0xc3, 0x9c, 0x3c, 0x60, - 0x29, 0x8b, 0xc4, 0x88, 0xcf, 0x32, 0x2e, 0xa4, 0x3b, 0x44, 0xdf, 0x77, 0x6e, 0x45, 0x02, 0xb1, - 0xe0, 0xf8, 0x1f, 0xaa, 0x26, 0xea, 0xe6, 0x87, 0xd9, 0x34, 0xdb, 0x5f, 0xba, 0x36, 0x29, 0x33, - 0x4a, 0x8a, 0xae, 0xfe, 0xa7, 0xe5, 0xba, 0x61, 0x8c, 0x74, 0x87, 0xfb, 0x0b, 0xfd, 0x54, 0x4f, - 0x1e, 0x24, 0xe0, 0x4f, 0x06, 0x29, 0xcc, 0x43, 0x91, 0xfb, 0x7c, 0x22, 0x2e, 0x90, 0x5d, 0x5e, - 0xd6, 0xe8, 0x23, 0xf4, 0x8d, 0xe7, 0xa5, 0x93, 0xe4, 0xb9, 0xa6, 0x4c, 0x7c, 0xed, 0x93, 0x1c, - 0x73, 0xb7, 0x6e, 0xb4, 0x82, 0x50, 0x4e, 0x32, 0x8f, 0xf8, 0x10, 0x51, 0x5f, 0xf9, 0xd2, 0x9f, - 0xbf, 0x62, 0x7c, 0x4a, 0xe5, 0x22, 0xe1, 0x82, 0xfc, 0xe7, 0xfe, 0xa8, 0xc6, 0x77, 0x11, 0xdd, - 0xeb, 0x0a, 0xfa, 0xac, 0xd8, 0xf8, 0xdc, 0x44, 0xd5, 0xc2, 0x3c, 0x6e, 0x97, 0x8f, 0xf6, 0x7a, - 0x57, 0xd6, 0x9f, 0x77, 0x28, 0x8b, 0x21, 0xdc, 0xdf, 0x67, 0x37, 0x0f, 0x97, 0x15, 0x07, 0xdb, - 0xb4, 0x34, 0x96, 0x62, 0x53, 0xf8, 0xca, 0x44, 0xb5, 0xbd, 0x35, 0xe0, 0xce, 0x1b, 0x90, 0xf2, - 0x8d, 0x5a, 0xdd, 0x8f, 0xb4, 0x68, 0x83, 0x44, 0x19, 0x6c, 0xe3, 0x56, 0xb9, 0xc1, 0xfd, 0x04, - 0xfa, 0x87, 0xcb, 0x8d, 0x63, 0xae, 0x36, 0x8e, 0x79, 0xbf, 0x71, 0xcc, 0x8b, 0xad, 0x63, 0xac, - 0xb6, 0x8e, 0x71, 0xbb, 0x75, 0x8c, 0xe3, 0xde, 0x8b, 0x34, 0x66, 0x19, 0x13, 0x2c, 0x9d, 0x32, - 0x4f, 0xe8, 0x63, 0x0c, 0x63, 0xbe, 0x4b, 0x50, 0xf1, 0x78, 0x55, 0xf5, 0x4f, 0xf6, 0x1e, 0x03, - 0x00, 0x00, 0xff, 0xff, 0x1d, 0x31, 0x3c, 0x8b, 0x22, 0x03, 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 returns the total set of minting parameters. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // EpochProvisions returns the current minting epoch provisions value. - EpochProvisions(ctx context.Context, in *QueryEpochProvisionsRequest, opts ...grpc.CallOption) (*QueryEpochProvisionsResponse, 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, "/osmosis.mint.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) EpochProvisions(ctx context.Context, in *QueryEpochProvisionsRequest, opts ...grpc.CallOption) (*QueryEpochProvisionsResponse, error) { - out := new(QueryEpochProvisionsResponse) - err := c.cc.Invoke(ctx, "/osmosis.mint.v1beta1.Query/EpochProvisions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Params returns the total set of minting parameters. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // EpochProvisions returns the current minting epoch provisions value. - EpochProvisions(context.Context, *QueryEpochProvisionsRequest) (*QueryEpochProvisionsResponse, 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 (*UnimplementedQueryServer) EpochProvisions(ctx context.Context, req *QueryEpochProvisionsRequest) (*QueryEpochProvisionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EpochProvisions 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: "/osmosis.mint.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) -} - -func _Query_EpochProvisions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryEpochProvisionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).EpochProvisions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.mint.v1beta1.Query/EpochProvisions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).EpochProvisions(ctx, req.(*QueryEpochProvisionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "osmosis.mint.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "EpochProvisions", - Handler: _Query_EpochProvisions_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "osmosis/mint/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 (m *QueryEpochProvisionsRequest) 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 *QueryEpochProvisionsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryEpochProvisionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryEpochProvisionsResponse) 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 *QueryEpochProvisionsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryEpochProvisionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.EpochProvisions.Size() - i -= size - if _, err := m.EpochProvisions.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - 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 (m *QueryEpochProvisionsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryEpochProvisionsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.EpochProvisions.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 *QueryEpochProvisionsRequest) 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: QueryEpochProvisionsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEpochProvisionsRequest: 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 *QueryEpochProvisionsResponse) 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: QueryEpochProvisionsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEpochProvisionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochProvisions", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.EpochProvisions.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/osmosis/mint/types/query.pb.gw.go b/osmosis/mint/types/query.pb.gw.go deleted file mode 100644 index 3f8efd590..000000000 --- a/osmosis/mint/types/query.pb.gw.go +++ /dev/null @@ -1,218 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: osmosis/mint/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 - -} - -func request_Query_EpochProvisions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryEpochProvisionsRequest - var metadata runtime.ServerMetadata - - msg, err := client.EpochProvisions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_EpochProvisions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryEpochProvisionsRequest - var metadata runtime.ServerMetadata - - msg, err := server.EpochProvisions(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()...) - - }) - - mux.Handle("GET", pattern_Query_EpochProvisions_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_EpochProvisions_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_EpochProvisions_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()...) - - }) - - mux.Handle("GET", pattern_Query_EpochProvisions_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_EpochProvisions_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_EpochProvisions_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{"osmosis", "mint", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_EpochProvisions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "mint", "v1beta1", "epoch_provisions"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_EpochProvisions_0 = runtime.ForwardResponseMessage -) diff --git a/osmosis/pool-incentives/types/incentives.pb.go b/osmosis/pool-incentives/types/incentives.pb.go deleted file mode 100644 index 818c0c003..000000000 --- a/osmosis/pool-incentives/types/incentives.pb.go +++ /dev/null @@ -1,1407 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/poolincentives/v1beta1/incentives.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -type Params struct { - // minted_denom is the denomination of the coin expected to be minted by the - // minting module. Pool-incentives module doesn’t actually mint the coin - // itself, but rather manages the distribution of coins that matches the - // defined minted_denom. - MintedDenom string `protobuf:"bytes,1,opt,name=minted_denom,json=mintedDenom,proto3" json:"minted_denom,omitempty" yaml:"minted_denom"` -} - -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_71a21c85a9e39348, []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) GetMintedDenom() string { - if m != nil { - return m.MintedDenom - } - return "" -} - -type LockableDurationsInfo struct { - LockableDurations []time.Duration `protobuf:"bytes,1,rep,name=lockable_durations,json=lockableDurations,proto3,stdduration" json:"lockable_durations" yaml:"lockable_durations"` -} - -func (m *LockableDurationsInfo) Reset() { *m = LockableDurationsInfo{} } -func (m *LockableDurationsInfo) String() string { return proto.CompactTextString(m) } -func (*LockableDurationsInfo) ProtoMessage() {} -func (*LockableDurationsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_71a21c85a9e39348, []int{1} -} -func (m *LockableDurationsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LockableDurationsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LockableDurationsInfo.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 *LockableDurationsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_LockableDurationsInfo.Merge(m, src) -} -func (m *LockableDurationsInfo) XXX_Size() int { - return m.Size() -} -func (m *LockableDurationsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_LockableDurationsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_LockableDurationsInfo proto.InternalMessageInfo - -func (m *LockableDurationsInfo) GetLockableDurations() []time.Duration { - if m != nil { - return m.LockableDurations - } - return nil -} - -type DistrInfo struct { - TotalWeight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=total_weight,json=totalWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_weight" yaml:"total_weight"` - Records []DistrRecord `protobuf:"bytes,2,rep,name=records,proto3" json:"records"` -} - -func (m *DistrInfo) Reset() { *m = DistrInfo{} } -func (m *DistrInfo) String() string { return proto.CompactTextString(m) } -func (*DistrInfo) ProtoMessage() {} -func (*DistrInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_71a21c85a9e39348, []int{2} -} -func (m *DistrInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DistrInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DistrInfo.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 *DistrInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_DistrInfo.Merge(m, src) -} -func (m *DistrInfo) XXX_Size() int { - return m.Size() -} -func (m *DistrInfo) XXX_DiscardUnknown() { - xxx_messageInfo_DistrInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_DistrInfo proto.InternalMessageInfo - -func (m *DistrInfo) GetRecords() []DistrRecord { - if m != nil { - return m.Records - } - return nil -} - -type DistrRecord struct { - GaugeId uint64 `protobuf:"varint,1,opt,name=gauge_id,json=gaugeId,proto3" json:"gauge_id,omitempty" yaml:"gauge_id"` - Weight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"weight"` -} - -func (m *DistrRecord) Reset() { *m = DistrRecord{} } -func (m *DistrRecord) String() string { return proto.CompactTextString(m) } -func (*DistrRecord) ProtoMessage() {} -func (*DistrRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_71a21c85a9e39348, []int{3} -} -func (m *DistrRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DistrRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DistrRecord.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 *DistrRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_DistrRecord.Merge(m, src) -} -func (m *DistrRecord) XXX_Size() int { - return m.Size() -} -func (m *DistrRecord) XXX_DiscardUnknown() { - xxx_messageInfo_DistrRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_DistrRecord proto.InternalMessageInfo - -func (m *DistrRecord) GetGaugeId() uint64 { - if m != nil { - return m.GaugeId - } - return 0 -} - -type PoolToGauge struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - GaugeId uint64 `protobuf:"varint,2,opt,name=gauge_id,json=gaugeId,proto3" json:"gauge_id,omitempty" yaml:"gauge"` - Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration" yaml:"duration"` -} - -func (m *PoolToGauge) Reset() { *m = PoolToGauge{} } -func (m *PoolToGauge) String() string { return proto.CompactTextString(m) } -func (*PoolToGauge) ProtoMessage() {} -func (*PoolToGauge) Descriptor() ([]byte, []int) { - return fileDescriptor_71a21c85a9e39348, []int{4} -} -func (m *PoolToGauge) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PoolToGauge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PoolToGauge.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 *PoolToGauge) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolToGauge.Merge(m, src) -} -func (m *PoolToGauge) XXX_Size() int { - return m.Size() -} -func (m *PoolToGauge) XXX_DiscardUnknown() { - xxx_messageInfo_PoolToGauge.DiscardUnknown(m) -} - -var xxx_messageInfo_PoolToGauge proto.InternalMessageInfo - -func (m *PoolToGauge) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *PoolToGauge) GetGaugeId() uint64 { - if m != nil { - return m.GaugeId - } - return 0 -} - -func (m *PoolToGauge) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -type PoolToGauges struct { - PoolToGauge []PoolToGauge `protobuf:"bytes,2,rep,name=pool_to_gauge,json=poolToGauge,proto3" json:"pool_to_gauge"` -} - -func (m *PoolToGauges) Reset() { *m = PoolToGauges{} } -func (m *PoolToGauges) String() string { return proto.CompactTextString(m) } -func (*PoolToGauges) ProtoMessage() {} -func (*PoolToGauges) Descriptor() ([]byte, []int) { - return fileDescriptor_71a21c85a9e39348, []int{5} -} -func (m *PoolToGauges) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PoolToGauges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PoolToGauges.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 *PoolToGauges) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolToGauges.Merge(m, src) -} -func (m *PoolToGauges) XXX_Size() int { - return m.Size() -} -func (m *PoolToGauges) XXX_DiscardUnknown() { - xxx_messageInfo_PoolToGauges.DiscardUnknown(m) -} - -var xxx_messageInfo_PoolToGauges proto.InternalMessageInfo - -func (m *PoolToGauges) GetPoolToGauge() []PoolToGauge { - if m != nil { - return m.PoolToGauge - } - return nil -} - -func init() { - proto.RegisterType((*Params)(nil), "osmosis.poolincentives.v1beta1.Params") - proto.RegisterType((*LockableDurationsInfo)(nil), "osmosis.poolincentives.v1beta1.LockableDurationsInfo") - proto.RegisterType((*DistrInfo)(nil), "osmosis.poolincentives.v1beta1.DistrInfo") - proto.RegisterType((*DistrRecord)(nil), "osmosis.poolincentives.v1beta1.DistrRecord") - proto.RegisterType((*PoolToGauge)(nil), "osmosis.poolincentives.v1beta1.PoolToGauge") - proto.RegisterType((*PoolToGauges)(nil), "osmosis.poolincentives.v1beta1.PoolToGauges") -} - -func init() { - proto.RegisterFile("osmosis/poolincentives/v1beta1/incentives.proto", fileDescriptor_71a21c85a9e39348) -} - -var fileDescriptor_71a21c85a9e39348 = []byte{ - // 559 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xce, 0xa5, 0x51, 0xd2, 0x9e, 0xc3, 0x2f, 0x17, 0x44, 0x5a, 0x24, 0x3b, 0xb2, 0x04, 0xaa, - 0x14, 0xf5, 0xac, 0xc2, 0x96, 0x81, 0x21, 0x0a, 0xa0, 0x08, 0x86, 0xca, 0x02, 0x81, 0x58, 0xa2, - 0x73, 0x7c, 0x75, 0xac, 0xda, 0x7e, 0xc1, 0x77, 0x29, 0xea, 0x7f, 0x80, 0xc4, 0xc2, 0xc8, 0xc8, - 0xff, 0xc1, 0xc6, 0xd4, 0xb1, 0x23, 0x62, 0x30, 0x28, 0x59, 0x98, 0xf3, 0x17, 0x20, 0x9f, 0xcf, - 0xe4, 0x0a, 0x52, 0x05, 0x93, 0xdf, 0xf3, 0xbb, 0xef, 0x7b, 0xdf, 0xf7, 0xde, 0xe9, 0xb0, 0x0b, - 0x3c, 0x01, 0x1e, 0x71, 0x77, 0x06, 0x10, 0x47, 0xe9, 0x84, 0xa5, 0x22, 0x3a, 0x61, 0xdc, 0x3d, - 0x39, 0xf0, 0x99, 0xa0, 0x07, 0xee, 0xfa, 0x17, 0x99, 0x65, 0x20, 0xc0, 0xb4, 0x14, 0x80, 0x5c, - 0x04, 0x10, 0x05, 0xd8, 0xbd, 0x19, 0x42, 0x08, 0xf2, 0xa8, 0x5b, 0x44, 0x25, 0x6a, 0xd7, 0x0a, - 0x01, 0xc2, 0x98, 0xb9, 0x32, 0xf3, 0xe7, 0x47, 0x6e, 0x30, 0xcf, 0xa8, 0x88, 0x20, 0x2d, 0xeb, - 0xce, 0x10, 0x37, 0x0f, 0x69, 0x46, 0x13, 0x6e, 0xf6, 0x71, 0x3b, 0x89, 0x52, 0xc1, 0x82, 0x71, - 0xc0, 0x52, 0x48, 0x3a, 0xa8, 0x8b, 0xf6, 0xb6, 0x06, 0xb7, 0x57, 0xb9, 0xbd, 0x7d, 0x4a, 0x93, - 0xb8, 0xef, 0xe8, 0x55, 0xc7, 0x33, 0xca, 0x74, 0x28, 0xb3, 0x77, 0x08, 0xdf, 0x7a, 0x06, 0x93, - 0x63, 0xea, 0xc7, 0x6c, 0xa8, 0x1a, 0xf0, 0x51, 0x7a, 0x04, 0x26, 0x60, 0x33, 0x56, 0x85, 0x71, - 0xd5, 0x9a, 0x77, 0x50, 0x77, 0x63, 0xcf, 0xb8, 0xbf, 0x43, 0x4a, 0x71, 0xa4, 0x12, 0x47, 0x2a, - 0xec, 0xe0, 0xee, 0x59, 0x6e, 0xd7, 0x56, 0xb9, 0xbd, 0x53, 0xb6, 0xfe, 0x9b, 0xc2, 0xf9, 0xf8, - 0xdd, 0x46, 0xde, 0x8d, 0xf8, 0xcf, 0xa6, 0xce, 0x17, 0x84, 0xb7, 0x86, 0x11, 0x17, 0x99, 0x6c, - 0x3f, 0xc5, 0x6d, 0x01, 0x82, 0xc6, 0xe3, 0xb7, 0x2c, 0x0a, 0xa7, 0x42, 0x99, 0x7a, 0x54, 0xb0, - 0x7f, 0xcb, 0xed, 0x7b, 0x61, 0x24, 0xa6, 0x73, 0x9f, 0x4c, 0x20, 0x71, 0x27, 0x72, 0xbc, 0xea, - 0xb3, 0xcf, 0x83, 0x63, 0x57, 0x9c, 0xce, 0x18, 0x27, 0xa3, 0x54, 0xac, 0x47, 0xa0, 0x73, 0x39, - 0x9e, 0x21, 0xd3, 0x97, 0x32, 0x33, 0x9f, 0xe2, 0x56, 0xc6, 0x26, 0x90, 0x05, 0xbc, 0x53, 0x97, - 0xee, 0x7a, 0xe4, 0xf2, 0x85, 0x11, 0xa9, 0xd2, 0x93, 0x98, 0x41, 0xa3, 0x50, 0xe4, 0x55, 0x0c, - 0xce, 0x7b, 0x84, 0x0d, 0xad, 0x6c, 0x12, 0xbc, 0x19, 0xd2, 0x79, 0xc8, 0xc6, 0x51, 0x20, 0x2d, - 0x34, 0x06, 0xdb, 0xab, 0xdc, 0xbe, 0x56, 0x8a, 0xaa, 0x2a, 0x8e, 0xd7, 0x92, 0xe1, 0x28, 0x30, - 0x1f, 0xe3, 0xa6, 0x32, 0x5c, 0x97, 0x86, 0xc9, 0xff, 0x19, 0xf6, 0x14, 0xba, 0xdf, 0xf8, 0xf9, - 0xc9, 0x46, 0xce, 0x67, 0x84, 0x8d, 0x43, 0x80, 0xf8, 0x39, 0x3c, 0x29, 0xf8, 0xcd, 0x1e, 0x6e, - 0x15, 0x96, 0xd6, 0x62, 0xcc, 0x55, 0x6e, 0x5f, 0x2d, 0xc5, 0xa8, 0x82, 0xe3, 0x35, 0x8b, 0x68, - 0x14, 0x98, 0x3d, 0x4d, 0x7a, 0x5d, 0x9e, 0xbe, 0xbe, 0xca, 0xed, 0xb6, 0x26, 0x5d, 0xd3, 0xed, - 0xe1, 0xcd, 0x6a, 0xc3, 0x9d, 0x8d, 0x2e, 0xba, 0xfc, 0x8e, 0xdc, 0x51, 0x77, 0x44, 0x8d, 0xa1, - 0x02, 0x96, 0x37, 0xe3, 0x37, 0x8f, 0xc3, 0x70, 0x5b, 0x13, 0xcf, 0xcd, 0x17, 0xf8, 0x8a, 0x14, - 0x29, 0x60, 0x2c, 0xdb, 0xfe, 0xeb, 0xba, 0x34, 0x12, 0xb5, 0x2e, 0x63, 0xa6, 0xfd, 0x7a, 0x75, - 0xb6, 0xb0, 0xd0, 0xf9, 0xc2, 0x42, 0x3f, 0x16, 0x16, 0xfa, 0xb0, 0xb4, 0x6a, 0xe7, 0x4b, 0xab, - 0xf6, 0x75, 0x69, 0xd5, 0x5e, 0x3f, 0xd4, 0x86, 0xfe, 0x66, 0x4e, 0x39, 0xcd, 0x62, 0xea, 0x73, - 0x15, 0xa6, 0x10, 0xb0, 0x0b, 0x4f, 0xc1, 0xbe, 0xf6, 0x16, 0xc8, 0x85, 0xf8, 0x4d, 0x69, 0xfd, - 0xc1, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x62, 0x0e, 0x65, 0x8b, 0x32, 0x04, 0x00, 0x00, -} - -func (this *DistrRecord) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DistrRecord) - if !ok { - that2, ok := that.(DistrRecord) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.GaugeId != that1.GaugeId { - return false - } - if !this.Weight.Equal(that1.Weight) { - return false - } - return true -} -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.MintedDenom) > 0 { - i -= len(m.MintedDenom) - copy(dAtA[i:], m.MintedDenom) - i = encodeVarintIncentives(dAtA, i, uint64(len(m.MintedDenom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LockableDurationsInfo) 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 *LockableDurationsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LockableDurationsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LockableDurations) > 0 { - for iNdEx := len(m.LockableDurations) - 1; iNdEx >= 0; iNdEx-- { - n, err := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.LockableDurations[iNdEx], dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.LockableDurations[iNdEx]):]) - if err != nil { - return 0, err - } - i -= n - i = encodeVarintIncentives(dAtA, i, uint64(n)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *DistrInfo) 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 *DistrInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DistrInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Records) > 0 { - for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintIncentives(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size := m.TotalWeight.Size() - i -= size - if _, err := m.TotalWeight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintIncentives(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *DistrRecord) 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 *DistrRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DistrRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintIncentives(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.GaugeId != 0 { - i = encodeVarintIncentives(dAtA, i, uint64(m.GaugeId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PoolToGauge) 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 *PoolToGauge) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PoolToGauge) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintIncentives(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x1a - if m.GaugeId != 0 { - i = encodeVarintIncentives(dAtA, i, uint64(m.GaugeId)) - i-- - dAtA[i] = 0x10 - } - if m.PoolId != 0 { - i = encodeVarintIncentives(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PoolToGauges) 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 *PoolToGauges) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PoolToGauges) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PoolToGauge) > 0 { - for iNdEx := len(m.PoolToGauge) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PoolToGauge[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintIncentives(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - return len(dAtA) - i, nil -} - -func encodeVarintIncentives(dAtA []byte, offset int, v uint64) int { - offset -= sovIncentives(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.MintedDenom) - if l > 0 { - n += 1 + l + sovIncentives(uint64(l)) - } - return n -} - -func (m *LockableDurationsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.LockableDurations) > 0 { - for _, e := range m.LockableDurations { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(e) - n += 1 + l + sovIncentives(uint64(l)) - } - } - return n -} - -func (m *DistrInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TotalWeight.Size() - n += 1 + l + sovIncentives(uint64(l)) - if len(m.Records) > 0 { - for _, e := range m.Records { - l = e.Size() - n += 1 + l + sovIncentives(uint64(l)) - } - } - return n -} - -func (m *DistrRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GaugeId != 0 { - n += 1 + sovIncentives(uint64(m.GaugeId)) - } - l = m.Weight.Size() - n += 1 + l + sovIncentives(uint64(l)) - return n -} - -func (m *PoolToGauge) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PoolId != 0 { - n += 1 + sovIncentives(uint64(m.PoolId)) - } - if m.GaugeId != 0 { - n += 1 + sovIncentives(uint64(m.GaugeId)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovIncentives(uint64(l)) - return n -} - -func (m *PoolToGauges) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PoolToGauge) > 0 { - for _, e := range m.PoolToGauge { - l = e.Size() - n += 1 + l + sovIncentives(uint64(l)) - } - } - return n -} - -func sovIncentives(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozIncentives(x uint64) (n int) { - return sovIncentives(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 ErrIntOverflowIncentives - } - 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 MintedDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - 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 ErrInvalidLengthIncentives - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIncentives - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MintedDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIncentives(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIncentives - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LockableDurationsInfo) 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 ErrIntOverflowIncentives - } - 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: LockableDurationsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LockableDurationsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LockableDurations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIncentives - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIncentives - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LockableDurations = append(m.LockableDurations, time.Duration(0)) - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&(m.LockableDurations[len(m.LockableDurations)-1]), dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIncentives(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIncentives - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DistrInfo) 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 ErrIntOverflowIncentives - } - 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: DistrInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DistrInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalWeight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - 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 ErrInvalidLengthIncentives - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIncentives - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TotalWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIncentives - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIncentives - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Records = append(m.Records, DistrRecord{}) - if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIncentives(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIncentives - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DistrRecord) 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 ErrIntOverflowIncentives - } - 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: DistrRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DistrRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GaugeId", wireType) - } - m.GaugeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GaugeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - 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 ErrInvalidLengthIncentives - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIncentives - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIncentives(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIncentives - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PoolToGauge) 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 ErrIntOverflowIncentives - } - 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: PoolToGauge: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PoolToGauge: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GaugeId", wireType) - } - m.GaugeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GaugeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIncentives - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIncentives - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIncentives(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIncentives - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PoolToGauges) 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 ErrIntOverflowIncentives - } - 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: PoolToGauges: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PoolToGauges: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolToGauge", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIncentives - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIncentives - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIncentives - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PoolToGauge = append(m.PoolToGauge, PoolToGauge{}) - if err := m.PoolToGauge[len(m.PoolToGauge)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIncentives(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIncentives - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipIncentives(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, ErrIntOverflowIncentives - } - 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, ErrIntOverflowIncentives - } - 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, ErrIntOverflowIncentives - } - 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, ErrInvalidLengthIncentives - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupIncentives - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthIncentives - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthIncentives = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowIncentives = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupIncentives = fmt.Errorf("proto: unexpected end of group") -) diff --git a/osmosis/pool-incentives/types/query.pb.go b/osmosis/pool-incentives/types/query.pb.go deleted file mode 100644 index 4be072b46..000000000 --- a/osmosis/pool-incentives/types/query.pb.go +++ /dev/null @@ -1,2793 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: osmosis/poolincentives/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - types "github.com/quasarlabs/quasarnode/osmosis/incentives/types" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - _ "google.golang.org/protobuf/types/known/durationpb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -type QueryGaugeIdsRequest struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` -} - -func (m *QueryGaugeIdsRequest) Reset() { *m = QueryGaugeIdsRequest{} } -func (m *QueryGaugeIdsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGaugeIdsRequest) ProtoMessage() {} -func (*QueryGaugeIdsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{0} -} -func (m *QueryGaugeIdsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGaugeIdsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGaugeIdsRequest.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 *QueryGaugeIdsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGaugeIdsRequest.Merge(m, src) -} -func (m *QueryGaugeIdsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGaugeIdsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGaugeIdsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGaugeIdsRequest proto.InternalMessageInfo - -func (m *QueryGaugeIdsRequest) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -type QueryGaugeIdsResponse struct { - GaugeIdsWithDuration []*QueryGaugeIdsResponse_GaugeIdWithDuration `protobuf:"bytes,1,rep,name=gauge_ids_with_duration,json=gaugeIdsWithDuration,proto3" json:"gauge_ids_with_duration,omitempty" yaml:"gauge_ids_with_duration"` -} - -func (m *QueryGaugeIdsResponse) Reset() { *m = QueryGaugeIdsResponse{} } -func (m *QueryGaugeIdsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGaugeIdsResponse) ProtoMessage() {} -func (*QueryGaugeIdsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{1} -} -func (m *QueryGaugeIdsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGaugeIdsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGaugeIdsResponse.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 *QueryGaugeIdsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGaugeIdsResponse.Merge(m, src) -} -func (m *QueryGaugeIdsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGaugeIdsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGaugeIdsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGaugeIdsResponse proto.InternalMessageInfo - -func (m *QueryGaugeIdsResponse) GetGaugeIdsWithDuration() []*QueryGaugeIdsResponse_GaugeIdWithDuration { - if m != nil { - return m.GaugeIdsWithDuration - } - return nil -} - -type QueryGaugeIdsResponse_GaugeIdWithDuration struct { - GaugeId uint64 `protobuf:"varint,1,opt,name=gauge_id,json=gaugeId,proto3" json:"gauge_id,omitempty" yaml:"gauge_id"` - Duration time.Duration `protobuf:"bytes,2,opt,name=duration,proto3,stdduration" json:"duration"` - GaugeIncentivePercentage string `protobuf:"bytes,3,opt,name=gauge_incentive_percentage,json=gaugeIncentivePercentage,proto3" json:"gauge_incentive_percentage,omitempty"` -} - -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) Reset() { - *m = QueryGaugeIdsResponse_GaugeIdWithDuration{} -} -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) String() string { - return proto.CompactTextString(m) -} -func (*QueryGaugeIdsResponse_GaugeIdWithDuration) ProtoMessage() {} -func (*QueryGaugeIdsResponse_GaugeIdWithDuration) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{1, 0} -} -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGaugeIdsResponse_GaugeIdWithDuration.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 *QueryGaugeIdsResponse_GaugeIdWithDuration) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGaugeIdsResponse_GaugeIdWithDuration.Merge(m, src) -} -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) XXX_Size() int { - return m.Size() -} -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGaugeIdsResponse_GaugeIdWithDuration.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGaugeIdsResponse_GaugeIdWithDuration proto.InternalMessageInfo - -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) GetGaugeId() uint64 { - if m != nil { - return m.GaugeId - } - return 0 -} - -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) GetGaugeIncentivePercentage() string { - if m != nil { - return m.GaugeIncentivePercentage - } - return "" -} - -type QueryDistrInfoRequest struct { -} - -func (m *QueryDistrInfoRequest) Reset() { *m = QueryDistrInfoRequest{} } -func (m *QueryDistrInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDistrInfoRequest) ProtoMessage() {} -func (*QueryDistrInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{2} -} -func (m *QueryDistrInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDistrInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDistrInfoRequest.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 *QueryDistrInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDistrInfoRequest.Merge(m, src) -} -func (m *QueryDistrInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDistrInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDistrInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDistrInfoRequest proto.InternalMessageInfo - -type QueryDistrInfoResponse struct { - DistrInfo DistrInfo `protobuf:"bytes,1,opt,name=distr_info,json=distrInfo,proto3" json:"distr_info" yaml:"distr_info"` -} - -func (m *QueryDistrInfoResponse) Reset() { *m = QueryDistrInfoResponse{} } -func (m *QueryDistrInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDistrInfoResponse) ProtoMessage() {} -func (*QueryDistrInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{3} -} -func (m *QueryDistrInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDistrInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDistrInfoResponse.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 *QueryDistrInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDistrInfoResponse.Merge(m, src) -} -func (m *QueryDistrInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDistrInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDistrInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDistrInfoResponse proto.InternalMessageInfo - -func (m *QueryDistrInfoResponse) GetDistrInfo() DistrInfo { - if m != nil { - return m.DistrInfo - } - return DistrInfo{} -} - -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_c9aea78c6f643155, []int{4} -} -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 - -type QueryParamsResponse struct { - 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_c9aea78c6f643155, []int{5} -} -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{} -} - -type QueryLockableDurationsRequest struct { -} - -func (m *QueryLockableDurationsRequest) Reset() { *m = QueryLockableDurationsRequest{} } -func (m *QueryLockableDurationsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryLockableDurationsRequest) ProtoMessage() {} -func (*QueryLockableDurationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{6} -} -func (m *QueryLockableDurationsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLockableDurationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLockableDurationsRequest.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 *QueryLockableDurationsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLockableDurationsRequest.Merge(m, src) -} -func (m *QueryLockableDurationsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryLockableDurationsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLockableDurationsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLockableDurationsRequest proto.InternalMessageInfo - -type QueryLockableDurationsResponse struct { - LockableDurations []time.Duration `protobuf:"bytes,1,rep,name=lockable_durations,json=lockableDurations,proto3,stdduration" json:"lockable_durations" yaml:"lockable_durations"` -} - -func (m *QueryLockableDurationsResponse) Reset() { *m = QueryLockableDurationsResponse{} } -func (m *QueryLockableDurationsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryLockableDurationsResponse) ProtoMessage() {} -func (*QueryLockableDurationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{7} -} -func (m *QueryLockableDurationsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLockableDurationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLockableDurationsResponse.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 *QueryLockableDurationsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLockableDurationsResponse.Merge(m, src) -} -func (m *QueryLockableDurationsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryLockableDurationsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLockableDurationsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLockableDurationsResponse proto.InternalMessageInfo - -func (m *QueryLockableDurationsResponse) GetLockableDurations() []time.Duration { - if m != nil { - return m.LockableDurations - } - return nil -} - -type QueryIncentivizedPoolsRequest struct { -} - -func (m *QueryIncentivizedPoolsRequest) Reset() { *m = QueryIncentivizedPoolsRequest{} } -func (m *QueryIncentivizedPoolsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryIncentivizedPoolsRequest) ProtoMessage() {} -func (*QueryIncentivizedPoolsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{8} -} -func (m *QueryIncentivizedPoolsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryIncentivizedPoolsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryIncentivizedPoolsRequest.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 *QueryIncentivizedPoolsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIncentivizedPoolsRequest.Merge(m, src) -} -func (m *QueryIncentivizedPoolsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryIncentivizedPoolsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIncentivizedPoolsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryIncentivizedPoolsRequest proto.InternalMessageInfo - -type IncentivizedPool struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` - LockableDuration time.Duration `protobuf:"bytes,2,opt,name=lockable_duration,json=lockableDuration,proto3,stdduration" json:"lockable_duration" yaml:"lockable_duration"` - GaugeId uint64 `protobuf:"varint,3,opt,name=gauge_id,json=gaugeId,proto3" json:"gauge_id,omitempty" yaml:"gauge_id"` -} - -func (m *IncentivizedPool) Reset() { *m = IncentivizedPool{} } -func (m *IncentivizedPool) String() string { return proto.CompactTextString(m) } -func (*IncentivizedPool) ProtoMessage() {} -func (*IncentivizedPool) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{9} -} -func (m *IncentivizedPool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IncentivizedPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IncentivizedPool.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 *IncentivizedPool) XXX_Merge(src proto.Message) { - xxx_messageInfo_IncentivizedPool.Merge(m, src) -} -func (m *IncentivizedPool) XXX_Size() int { - return m.Size() -} -func (m *IncentivizedPool) XXX_DiscardUnknown() { - xxx_messageInfo_IncentivizedPool.DiscardUnknown(m) -} - -var xxx_messageInfo_IncentivizedPool proto.InternalMessageInfo - -func (m *IncentivizedPool) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - -func (m *IncentivizedPool) GetLockableDuration() time.Duration { - if m != nil { - return m.LockableDuration - } - return 0 -} - -func (m *IncentivizedPool) GetGaugeId() uint64 { - if m != nil { - return m.GaugeId - } - return 0 -} - -type QueryIncentivizedPoolsResponse struct { - IncentivizedPools []IncentivizedPool `protobuf:"bytes,1,rep,name=incentivized_pools,json=incentivizedPools,proto3" json:"incentivized_pools" yaml:"incentivized_pools"` -} - -func (m *QueryIncentivizedPoolsResponse) Reset() { *m = QueryIncentivizedPoolsResponse{} } -func (m *QueryIncentivizedPoolsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryIncentivizedPoolsResponse) ProtoMessage() {} -func (*QueryIncentivizedPoolsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{10} -} -func (m *QueryIncentivizedPoolsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryIncentivizedPoolsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryIncentivizedPoolsResponse.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 *QueryIncentivizedPoolsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIncentivizedPoolsResponse.Merge(m, src) -} -func (m *QueryIncentivizedPoolsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryIncentivizedPoolsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIncentivizedPoolsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryIncentivizedPoolsResponse proto.InternalMessageInfo - -func (m *QueryIncentivizedPoolsResponse) GetIncentivizedPools() []IncentivizedPool { - if m != nil { - return m.IncentivizedPools - } - return nil -} - -type QueryExternalIncentiveGaugesRequest struct { -} - -func (m *QueryExternalIncentiveGaugesRequest) Reset() { *m = QueryExternalIncentiveGaugesRequest{} } -func (m *QueryExternalIncentiveGaugesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryExternalIncentiveGaugesRequest) ProtoMessage() {} -func (*QueryExternalIncentiveGaugesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{11} -} -func (m *QueryExternalIncentiveGaugesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryExternalIncentiveGaugesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryExternalIncentiveGaugesRequest.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 *QueryExternalIncentiveGaugesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryExternalIncentiveGaugesRequest.Merge(m, src) -} -func (m *QueryExternalIncentiveGaugesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryExternalIncentiveGaugesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryExternalIncentiveGaugesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryExternalIncentiveGaugesRequest proto.InternalMessageInfo - -type QueryExternalIncentiveGaugesResponse struct { - Data []types.Gauge `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` -} - -func (m *QueryExternalIncentiveGaugesResponse) Reset() { *m = QueryExternalIncentiveGaugesResponse{} } -func (m *QueryExternalIncentiveGaugesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryExternalIncentiveGaugesResponse) ProtoMessage() {} -func (*QueryExternalIncentiveGaugesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c9aea78c6f643155, []int{12} -} -func (m *QueryExternalIncentiveGaugesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryExternalIncentiveGaugesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryExternalIncentiveGaugesResponse.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 *QueryExternalIncentiveGaugesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryExternalIncentiveGaugesResponse.Merge(m, src) -} -func (m *QueryExternalIncentiveGaugesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryExternalIncentiveGaugesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryExternalIncentiveGaugesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryExternalIncentiveGaugesResponse proto.InternalMessageInfo - -func (m *QueryExternalIncentiveGaugesResponse) GetData() []types.Gauge { - if m != nil { - return m.Data - } - return nil -} - -func init() { - proto.RegisterType((*QueryGaugeIdsRequest)(nil), "osmosis.poolincentives.v1beta1.QueryGaugeIdsRequest") - proto.RegisterType((*QueryGaugeIdsResponse)(nil), "osmosis.poolincentives.v1beta1.QueryGaugeIdsResponse") - proto.RegisterType((*QueryGaugeIdsResponse_GaugeIdWithDuration)(nil), "osmosis.poolincentives.v1beta1.QueryGaugeIdsResponse.GaugeIdWithDuration") - proto.RegisterType((*QueryDistrInfoRequest)(nil), "osmosis.poolincentives.v1beta1.QueryDistrInfoRequest") - proto.RegisterType((*QueryDistrInfoResponse)(nil), "osmosis.poolincentives.v1beta1.QueryDistrInfoResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "osmosis.poolincentives.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "osmosis.poolincentives.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryLockableDurationsRequest)(nil), "osmosis.poolincentives.v1beta1.QueryLockableDurationsRequest") - proto.RegisterType((*QueryLockableDurationsResponse)(nil), "osmosis.poolincentives.v1beta1.QueryLockableDurationsResponse") - proto.RegisterType((*QueryIncentivizedPoolsRequest)(nil), "osmosis.poolincentives.v1beta1.QueryIncentivizedPoolsRequest") - proto.RegisterType((*IncentivizedPool)(nil), "osmosis.poolincentives.v1beta1.IncentivizedPool") - proto.RegisterType((*QueryIncentivizedPoolsResponse)(nil), "osmosis.poolincentives.v1beta1.QueryIncentivizedPoolsResponse") - proto.RegisterType((*QueryExternalIncentiveGaugesRequest)(nil), "osmosis.poolincentives.v1beta1.QueryExternalIncentiveGaugesRequest") - proto.RegisterType((*QueryExternalIncentiveGaugesResponse)(nil), "osmosis.poolincentives.v1beta1.QueryExternalIncentiveGaugesResponse") -} - -func init() { - proto.RegisterFile("osmosis/poolincentives/v1beta1/query.proto", fileDescriptor_c9aea78c6f643155) -} - -var fileDescriptor_c9aea78c6f643155 = []byte{ - // 924 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x34, 0x21, 0x4d, 0x26, 0x12, 0xd4, 0x93, 0x40, 0x9c, 0x15, 0xac, 0xc3, 0xd0, 0x42, - 0x4a, 0x95, 0x5d, 0x6a, 0xb7, 0x3d, 0x94, 0x50, 0x24, 0x37, 0x08, 0x45, 0xe2, 0x10, 0xf6, 0x02, - 0x82, 0x83, 0x35, 0xce, 0x4e, 0x36, 0x23, 0x36, 0x3b, 0xce, 0xce, 0xba, 0x10, 0x50, 0x2f, 0x95, - 0xb8, 0x83, 0xb8, 0x70, 0x46, 0xf4, 0xcc, 0x89, 0x7f, 0xc0, 0xa1, 0x37, 0x2a, 0x71, 0xe1, 0x82, - 0x41, 0x09, 0x07, 0xce, 0xfe, 0x05, 0x68, 0x67, 0xdf, 0x6e, 0xed, 0xb5, 0xd7, 0x6b, 0xa7, 0xb7, - 0xf5, 0xbe, 0xf7, 0xbe, 0xf7, 0x7d, 0xf3, 0xde, 0x7c, 0x6b, 0xfc, 0xb6, 0x54, 0xc7, 0x52, 0x09, - 0x65, 0x77, 0xa4, 0xf4, 0x45, 0x70, 0xc0, 0x83, 0x48, 0x3c, 0xe0, 0xca, 0x7e, 0x70, 0xb3, 0xcd, - 0x23, 0x76, 0xd3, 0x3e, 0xe9, 0xf2, 0xf0, 0xd4, 0xea, 0x84, 0x32, 0x92, 0xc4, 0x84, 0x5c, 0x6b, - 0x38, 0xd7, 0x82, 0x5c, 0x63, 0xcd, 0x93, 0x9e, 0xd4, 0xa9, 0x76, 0xfc, 0x94, 0x54, 0x19, 0xaf, - 0x7a, 0x52, 0x7a, 0x3e, 0xb7, 0x59, 0x47, 0xd8, 0x2c, 0x08, 0x64, 0xc4, 0x22, 0x21, 0x03, 0x05, - 0x51, 0x13, 0xa2, 0xfa, 0x57, 0xbb, 0x7b, 0x68, 0xbb, 0xdd, 0x50, 0x27, 0xa4, 0xf1, 0x94, 0xdf, - 0x00, 0x37, 0x8f, 0x75, 0x3d, 0x0e, 0x71, 0xbb, 0x84, 0xff, 0x00, 0x4d, 0x5d, 0x40, 0xef, 0xe3, - 0xb5, 0x8f, 0x63, 0x4d, 0x1f, 0xc6, 0x20, 0x7b, 0xae, 0x72, 0xf8, 0x49, 0x97, 0xab, 0x88, 0xdc, - 0xc0, 0x97, 0x63, 0x88, 0x96, 0x70, 0xab, 0x68, 0x13, 0x6d, 0x2d, 0x34, 0x49, 0xbf, 0x57, 0x7b, - 0xf1, 0x94, 0x1d, 0xfb, 0x77, 0x29, 0x04, 0xa8, 0xb3, 0x18, 0x3f, 0xed, 0xb9, 0xf4, 0xdb, 0x79, - 0xfc, 0x72, 0x0e, 0x45, 0x75, 0x64, 0xa0, 0x38, 0xf9, 0x19, 0xe1, 0x75, 0xcd, 0xaf, 0x25, 0x5c, - 0xd5, 0xfa, 0x52, 0x44, 0x47, 0xad, 0x54, 0x51, 0x15, 0x6d, 0xce, 0x6f, 0xad, 0xd4, 0xf7, 0xac, - 0xc9, 0xc7, 0x68, 0x8d, 0x05, 0xb6, 0xe0, 0xc5, 0x27, 0x22, 0x3a, 0xda, 0x05, 0xc0, 0x26, 0xed, - 0xf7, 0x6a, 0x66, 0x42, 0xb1, 0xa0, 0x27, 0x75, 0xd6, 0x3c, 0x40, 0x1a, 0xac, 0x34, 0x7e, 0x43, - 0x78, 0x75, 0x0c, 0x22, 0xb1, 0xf0, 0x52, 0x8a, 0x04, 0xc7, 0xb0, 0xda, 0xef, 0xd5, 0x5e, 0x1a, - 0xee, 0x41, 0x9d, 0xcb, 0x00, 0x4a, 0xde, 0xc7, 0x4b, 0x99, 0xbc, 0x4b, 0x9b, 0x68, 0x6b, 0xa5, - 0xbe, 0x61, 0x25, 0x13, 0xb5, 0xd2, 0x89, 0x5a, 0x19, 0xdd, 0xa5, 0x27, 0xbd, 0xda, 0xdc, 0x8f, - 0x7f, 0xd7, 0x90, 0x93, 0x15, 0x91, 0x1d, 0x6c, 0x00, 0x6c, 0x7a, 0x10, 0xad, 0x0e, 0x0f, 0xe3, - 0x47, 0xe6, 0xf1, 0xea, 0xfc, 0x26, 0xda, 0x5a, 0x76, 0xaa, 0x49, 0xb7, 0x34, 0x61, 0x3f, 0x8b, - 0xd3, 0x75, 0x18, 0xc3, 0xae, 0x50, 0x51, 0xb8, 0x17, 0x1c, 0x4a, 0x98, 0x26, 0x7d, 0x88, 0x5f, - 0xc9, 0x07, 0x60, 0x40, 0x07, 0x18, 0xbb, 0xf1, 0xcb, 0x96, 0x08, 0x0e, 0xa5, 0xd6, 0xb8, 0x52, - 0xbf, 0x5e, 0x36, 0x92, 0x0c, 0xa6, 0xb9, 0x11, 0x6b, 0xe8, 0xf7, 0x6a, 0x95, 0xe4, 0x48, 0x9e, - 0x41, 0x51, 0x67, 0xd9, 0x4d, 0xb3, 0xe8, 0x1a, 0x26, 0xba, 0xfd, 0x3e, 0x0b, 0xd9, 0x71, 0xba, - 0x62, 0xf4, 0x73, 0xbc, 0x3a, 0xf4, 0x16, 0x18, 0xed, 0xe2, 0xc5, 0x8e, 0x7e, 0x03, 0x6c, 0xde, - 0x2c, 0x63, 0x93, 0xd4, 0x37, 0x17, 0x62, 0x2a, 0x0e, 0xd4, 0xd2, 0x1a, 0x7e, 0x4d, 0x83, 0x7f, - 0x24, 0x0f, 0xbe, 0x60, 0x6d, 0x9f, 0xa7, 0xa7, 0x9e, 0x75, 0xff, 0x1e, 0x61, 0xb3, 0x28, 0x03, - 0x98, 0x48, 0x4c, 0x7c, 0x08, 0x66, 0x1b, 0xa4, 0x60, 0x6d, 0x27, 0xcc, 0xf5, 0x1a, 0x9c, 0xc9, - 0x46, 0x72, 0x26, 0xa3, 0x10, 0x54, 0x0f, 0xbd, 0xe2, 0xe7, 0x1b, 0x67, 0xa4, 0xd3, 0xd9, 0x8a, - 0xaf, 0xb9, 0xbb, 0x2f, 0xa5, 0x9f, 0x91, 0xfe, 0x0b, 0xe1, 0x2b, 0xf9, 0xe0, 0x4c, 0x57, 0x95, - 0xf8, 0xb8, 0x32, 0x42, 0xa8, 0x7c, 0x55, 0xaf, 0x82, 0xa4, 0x6a, 0x81, 0xa4, 0x44, 0xd1, 0x95, - 0xbc, 0xa2, 0xa1, 0xfb, 0x33, 0x5f, 0x7e, 0x7f, 0xe8, 0xe3, 0x74, 0x28, 0x63, 0x4e, 0x00, 0x86, - 0xf2, 0x08, 0x61, 0x22, 0x06, 0xa2, 0xad, 0x58, 0x58, 0x3a, 0x95, 0x77, 0xca, 0x76, 0x25, 0x8f, - 0xdb, 0x7c, 0x7d, 0x78, 0x58, 0xa3, 0xc8, 0xd4, 0xa9, 0x88, 0x3c, 0x19, 0x7a, 0x0d, 0xbf, 0xa1, - 0x69, 0x7e, 0xf0, 0x55, 0xc4, 0xc3, 0x80, 0xf9, 0xd9, 0x65, 0xd4, 0x26, 0x32, 0xb0, 0xe1, 0x57, - 0x27, 0xa7, 0x81, 0xa6, 0x06, 0x5e, 0x70, 0x59, 0xc4, 0xb2, 0xd5, 0x4a, 0x45, 0x0c, 0x08, 0xd0, - 0x15, 0xb0, 0xe3, 0x3a, 0xb9, 0xfe, 0x78, 0x19, 0xbf, 0xa0, 0xd1, 0xc9, 0xaf, 0x08, 0x2f, 0xa5, - 0x06, 0x49, 0x6e, 0xcd, 0xe8, 0xa7, 0x9a, 0xa9, 0x71, 0xfb, 0x42, 0x2e, 0x4c, 0x77, 0x1e, 0xfd, - 0xf1, 0xef, 0x0f, 0x97, 0xee, 0x90, 0x5b, 0x43, 0xdf, 0x9d, 0xed, 0x31, 0x1f, 0x1e, 0x3d, 0xe1, - 0x6d, 0xe1, 0x2a, 0xfb, 0x1b, 0xd8, 0xc9, 0x87, 0xe4, 0x17, 0x84, 0x97, 0x33, 0x2b, 0x21, 0xd3, - 0x51, 0xc8, 0x5b, 0x9b, 0x71, 0x67, 0xd6, 0x32, 0xa0, 0xde, 0xd0, 0xd4, 0xb7, 0xc9, 0x8d, 0x52, - 0xea, 0xcf, 0x4c, 0x8d, 0xfc, 0x84, 0xf0, 0x62, 0x62, 0x37, 0xa4, 0x3e, 0x55, 0xdf, 0x21, 0xc7, - 0x33, 0x1a, 0x33, 0xd5, 0x00, 0x51, 0x5b, 0x13, 0xbd, 0x4e, 0xde, 0x2a, 0x25, 0x9a, 0x58, 0x1f, - 0xf9, 0x1d, 0xe1, 0xca, 0x88, 0xa9, 0x91, 0xf7, 0xa6, 0xea, 0x5d, 0x64, 0x97, 0xc6, 0xbd, 0x8b, - 0x96, 0x83, 0x8a, 0x77, 0xb5, 0x8a, 0xdb, 0xa4, 0x51, 0xaa, 0x62, 0xd4, 0x2f, 0xb5, 0xa2, 0x11, - 0x47, 0x98, 0x52, 0x51, 0x91, 0x97, 0x4e, 0xa9, 0xa8, 0xd0, 0x88, 0x66, 0x50, 0x34, 0x6a, 0x2a, - 0xe4, 0x3f, 0x84, 0xd7, 0x0b, 0x5c, 0x81, 0xdc, 0x9f, 0x8a, 0xd8, 0x64, 0xeb, 0x31, 0x76, 0x9f, - 0x0f, 0x04, 0x34, 0x36, 0xb5, 0xc6, 0x1d, 0x72, 0xb7, 0x54, 0x23, 0x07, 0xa4, 0x81, 0x3f, 0x2e, - 0xfa, 0xca, 0xab, 0xe6, 0xa7, 0x4f, 0xce, 0x4c, 0xf4, 0xf4, 0xcc, 0x44, 0xff, 0x9c, 0x99, 0xe8, - 0xbb, 0x73, 0x73, 0xee, 0xe9, 0xb9, 0x39, 0xf7, 0xe7, 0xb9, 0x39, 0xf7, 0xd9, 0x3d, 0x4f, 0x44, - 0x47, 0xdd, 0xb6, 0x75, 0x20, 0x8f, 0xed, 0x93, 0x2e, 0x53, 0x2c, 0xf4, 0x59, 0x5b, 0xc1, 0x63, - 0x20, 0x5d, 0x5e, 0xd8, 0x35, 0x3a, 0xed, 0x70, 0xd5, 0x5e, 0xd4, 0x1f, 0xaa, 0xc6, 0xff, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x72, 0xe8, 0x37, 0x41, 0xb5, 0x0b, 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 { - // GaugeIds takes the pool id and returns the matching gauge ids and durations - GaugeIds(ctx context.Context, in *QueryGaugeIdsRequest, opts ...grpc.CallOption) (*QueryGaugeIdsResponse, error) - // DistrInfo returns the pool's matching gauge ids and weights. - DistrInfo(ctx context.Context, in *QueryDistrInfoRequest, opts ...grpc.CallOption) (*QueryDistrInfoResponse, error) - // Params returns pool incentives params. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // LockableDurations returns lock durations for pools. - LockableDurations(ctx context.Context, in *QueryLockableDurationsRequest, opts ...grpc.CallOption) (*QueryLockableDurationsResponse, error) - // IncentivizedPools returns currently incentivized pools - IncentivizedPools(ctx context.Context, in *QueryIncentivizedPoolsRequest, opts ...grpc.CallOption) (*QueryIncentivizedPoolsResponse, error) - // ExternalIncentiveGauges returns external incentive gauges. - ExternalIncentiveGauges(ctx context.Context, in *QueryExternalIncentiveGaugesRequest, opts ...grpc.CallOption) (*QueryExternalIncentiveGaugesResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) GaugeIds(ctx context.Context, in *QueryGaugeIdsRequest, opts ...grpc.CallOption) (*QueryGaugeIdsResponse, error) { - out := new(QueryGaugeIdsResponse) - err := c.cc.Invoke(ctx, "/osmosis.poolincentives.v1beta1.Query/GaugeIds", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) DistrInfo(ctx context.Context, in *QueryDistrInfoRequest, opts ...grpc.CallOption) (*QueryDistrInfoResponse, error) { - out := new(QueryDistrInfoResponse) - err := c.cc.Invoke(ctx, "/osmosis.poolincentives.v1beta1.Query/DistrInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/osmosis.poolincentives.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) LockableDurations(ctx context.Context, in *QueryLockableDurationsRequest, opts ...grpc.CallOption) (*QueryLockableDurationsResponse, error) { - out := new(QueryLockableDurationsResponse) - err := c.cc.Invoke(ctx, "/osmosis.poolincentives.v1beta1.Query/LockableDurations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) IncentivizedPools(ctx context.Context, in *QueryIncentivizedPoolsRequest, opts ...grpc.CallOption) (*QueryIncentivizedPoolsResponse, error) { - out := new(QueryIncentivizedPoolsResponse) - err := c.cc.Invoke(ctx, "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ExternalIncentiveGauges(ctx context.Context, in *QueryExternalIncentiveGaugesRequest, opts ...grpc.CallOption) (*QueryExternalIncentiveGaugesResponse, error) { - out := new(QueryExternalIncentiveGaugesResponse) - err := c.cc.Invoke(ctx, "/osmosis.poolincentives.v1beta1.Query/ExternalIncentiveGauges", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // GaugeIds takes the pool id and returns the matching gauge ids and durations - GaugeIds(context.Context, *QueryGaugeIdsRequest) (*QueryGaugeIdsResponse, error) - // DistrInfo returns the pool's matching gauge ids and weights. - DistrInfo(context.Context, *QueryDistrInfoRequest) (*QueryDistrInfoResponse, error) - // Params returns pool incentives params. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // LockableDurations returns lock durations for pools. - LockableDurations(context.Context, *QueryLockableDurationsRequest) (*QueryLockableDurationsResponse, error) - // IncentivizedPools returns currently incentivized pools - IncentivizedPools(context.Context, *QueryIncentivizedPoolsRequest) (*QueryIncentivizedPoolsResponse, error) - // ExternalIncentiveGauges returns external incentive gauges. - ExternalIncentiveGauges(context.Context, *QueryExternalIncentiveGaugesRequest) (*QueryExternalIncentiveGaugesResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) GaugeIds(ctx context.Context, req *QueryGaugeIdsRequest) (*QueryGaugeIdsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GaugeIds not implemented") -} -func (*UnimplementedQueryServer) DistrInfo(ctx context.Context, req *QueryDistrInfoRequest) (*QueryDistrInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DistrInfo not implemented") -} -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) LockableDurations(ctx context.Context, req *QueryLockableDurationsRequest) (*QueryLockableDurationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LockableDurations not implemented") -} -func (*UnimplementedQueryServer) IncentivizedPools(ctx context.Context, req *QueryIncentivizedPoolsRequest) (*QueryIncentivizedPoolsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IncentivizedPools not implemented") -} -func (*UnimplementedQueryServer) ExternalIncentiveGauges(ctx context.Context, req *QueryExternalIncentiveGaugesRequest) (*QueryExternalIncentiveGaugesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExternalIncentiveGauges not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_GaugeIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGaugeIdsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GaugeIds(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.poolincentives.v1beta1.Query/GaugeIds", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GaugeIds(ctx, req.(*QueryGaugeIdsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_DistrInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDistrInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DistrInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.poolincentives.v1beta1.Query/DistrInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DistrInfo(ctx, req.(*QueryDistrInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -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: "/osmosis.poolincentives.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) -} - -func _Query_LockableDurations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLockableDurationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LockableDurations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.poolincentives.v1beta1.Query/LockableDurations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LockableDurations(ctx, req.(*QueryLockableDurationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_IncentivizedPools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryIncentivizedPoolsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).IncentivizedPools(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).IncentivizedPools(ctx, req.(*QueryIncentivizedPoolsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ExternalIncentiveGauges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryExternalIncentiveGaugesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ExternalIncentiveGauges(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/osmosis.poolincentives.v1beta1.Query/ExternalIncentiveGauges", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ExternalIncentiveGauges(ctx, req.(*QueryExternalIncentiveGaugesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "osmosis.poolincentives.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GaugeIds", - Handler: _Query_GaugeIds_Handler, - }, - { - MethodName: "DistrInfo", - Handler: _Query_DistrInfo_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "LockableDurations", - Handler: _Query_LockableDurations_Handler, - }, - { - MethodName: "IncentivizedPools", - Handler: _Query_IncentivizedPools_Handler, - }, - { - MethodName: "ExternalIncentiveGauges", - Handler: _Query_ExternalIncentiveGauges_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "osmosis/poolincentives/v1beta1/query.proto", -} - -func (m *QueryGaugeIdsRequest) 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 *QueryGaugeIdsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGaugeIdsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryGaugeIdsResponse) 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 *QueryGaugeIdsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGaugeIdsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GaugeIdsWithDuration) > 0 { - for iNdEx := len(m.GaugeIdsWithDuration) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.GaugeIdsWithDuration[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 *QueryGaugeIdsResponse_GaugeIdWithDuration) 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 *QueryGaugeIdsResponse_GaugeIdWithDuration) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GaugeIncentivePercentage) > 0 { - i -= len(m.GaugeIncentivePercentage) - copy(dAtA[i:], m.GaugeIncentivePercentage) - i = encodeVarintQuery(dAtA, i, uint64(len(m.GaugeIncentivePercentage))) - i-- - dAtA[i] = 0x1a - } - n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintQuery(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - if m.GaugeId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.GaugeId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDistrInfoRequest) 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 *QueryDistrInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDistrInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryDistrInfoResponse) 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 *QueryDistrInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDistrInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.DistrInfo.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 *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 (m *QueryLockableDurationsRequest) 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 *QueryLockableDurationsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLockableDurationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryLockableDurationsResponse) 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 *QueryLockableDurationsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLockableDurationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LockableDurations) > 0 { - for iNdEx := len(m.LockableDurations) - 1; iNdEx >= 0; iNdEx-- { - n, err := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.LockableDurations[iNdEx], dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.LockableDurations[iNdEx]):]) - if err != nil { - return 0, err - } - i -= n - i = encodeVarintQuery(dAtA, i, uint64(n)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryIncentivizedPoolsRequest) 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 *QueryIncentivizedPoolsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryIncentivizedPoolsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *IncentivizedPool) 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 *IncentivizedPool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IncentivizedPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.GaugeId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.GaugeId)) - i-- - dAtA[i] = 0x18 - } - n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.LockableDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.LockableDuration):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintQuery(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x12 - if m.PoolId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryIncentivizedPoolsResponse) 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 *QueryIncentivizedPoolsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryIncentivizedPoolsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.IncentivizedPools) > 0 { - for iNdEx := len(m.IncentivizedPools) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.IncentivizedPools[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 *QueryExternalIncentiveGaugesRequest) 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 *QueryExternalIncentiveGaugesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryExternalIncentiveGaugesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryExternalIncentiveGaugesResponse) 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 *QueryExternalIncentiveGaugesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryExternalIncentiveGaugesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Data[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 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 *QueryGaugeIdsRequest) 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 *QueryGaugeIdsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.GaugeIdsWithDuration) > 0 { - for _, e := range m.GaugeIdsWithDuration { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryGaugeIdsResponse_GaugeIdWithDuration) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GaugeId != 0 { - n += 1 + sovQuery(uint64(m.GaugeId)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovQuery(uint64(l)) - l = len(m.GaugeIncentivePercentage) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDistrInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryDistrInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.DistrInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -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 (m *QueryLockableDurationsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryLockableDurationsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.LockableDurations) > 0 { - for _, e := range m.LockableDurations { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(e) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryIncentivizedPoolsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *IncentivizedPool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PoolId != 0 { - n += 1 + sovQuery(uint64(m.PoolId)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.LockableDuration) - n += 1 + l + sovQuery(uint64(l)) - if m.GaugeId != 0 { - n += 1 + sovQuery(uint64(m.GaugeId)) - } - return n -} - -func (m *QueryIncentivizedPoolsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.IncentivizedPools) > 0 { - for _, e := range m.IncentivizedPools { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryExternalIncentiveGaugesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryExternalIncentiveGaugesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Data) > 0 { - for _, e := range m.Data { - l = e.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 *QueryGaugeIdsRequest) 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: QueryGaugeIdsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGaugeIdsRequest: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGaugeIdsResponse) 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: QueryGaugeIdsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGaugeIdsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GaugeIdsWithDuration", 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.GaugeIdsWithDuration = append(m.GaugeIdsWithDuration, &QueryGaugeIdsResponse_GaugeIdWithDuration{}) - if err := m.GaugeIdsWithDuration[len(m.GaugeIdsWithDuration)-1].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 *QueryGaugeIdsResponse_GaugeIdWithDuration) 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: GaugeIdWithDuration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GaugeIdWithDuration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GaugeId", wireType) - } - m.GaugeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GaugeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", 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 := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GaugeIncentivePercentage", 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.GaugeIncentivePercentage = 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 *QueryDistrInfoRequest) 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: QueryDistrInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDistrInfoRequest: 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 *QueryDistrInfoResponse) 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: QueryDistrInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDistrInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistrInfo", 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.DistrInfo.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 *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 *QueryLockableDurationsRequest) 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: QueryLockableDurationsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLockableDurationsRequest: 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 *QueryLockableDurationsResponse) 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: QueryLockableDurationsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLockableDurationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LockableDurations", 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.LockableDurations = append(m.LockableDurations, time.Duration(0)) - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&(m.LockableDurations[len(m.LockableDurations)-1]), 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 *QueryIncentivizedPoolsRequest) 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: QueryIncentivizedPoolsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIncentivizedPoolsRequest: 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 *IncentivizedPool) 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: IncentivizedPool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IncentivizedPool: 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) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LockableDuration", 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 := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.LockableDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GaugeId", wireType) - } - m.GaugeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GaugeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryIncentivizedPoolsResponse) 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: QueryIncentivizedPoolsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIncentivizedPoolsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IncentivizedPools", 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.IncentivizedPools = append(m.IncentivizedPools, IncentivizedPool{}) - if err := m.IncentivizedPools[len(m.IncentivizedPools)-1].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 *QueryExternalIncentiveGaugesRequest) 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: QueryExternalIncentiveGaugesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExternalIncentiveGaugesRequest: 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 *QueryExternalIncentiveGaugesResponse) 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: QueryExternalIncentiveGaugesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExternalIncentiveGaugesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", 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.Data = append(m.Data, types.Gauge{}) - if err := m.Data[len(m.Data)-1].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/osmosis/pool-incentives/types/query.pb.gw.go b/osmosis/pool-incentives/types/query.pb.gw.go deleted file mode 100644 index 9fe13ef43..000000000 --- a/osmosis/pool-incentives/types/query.pb.gw.go +++ /dev/null @@ -1,514 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: osmosis/poolincentives/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_GaugeIds_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGaugeIdsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := client.GaugeIds(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GaugeIds_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGaugeIdsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["pool_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") - } - - protoReq.PoolId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) - } - - msg, err := server.GaugeIds(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_DistrInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDistrInfoRequest - var metadata runtime.ServerMetadata - - msg, err := client.DistrInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DistrInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDistrInfoRequest - var metadata runtime.ServerMetadata - - msg, err := server.DistrInfo(ctx, &protoReq) - return msg, metadata, err - -} - -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 - -} - -func request_Query_LockableDurations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLockableDurationsRequest - var metadata runtime.ServerMetadata - - msg, err := client.LockableDurations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_LockableDurations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLockableDurationsRequest - var metadata runtime.ServerMetadata - - msg, err := server.LockableDurations(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_IncentivizedPools_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryIncentivizedPoolsRequest - var metadata runtime.ServerMetadata - - msg, err := client.IncentivizedPools(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_IncentivizedPools_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryIncentivizedPoolsRequest - var metadata runtime.ServerMetadata - - msg, err := server.IncentivizedPools(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ExternalIncentiveGauges_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryExternalIncentiveGaugesRequest - var metadata runtime.ServerMetadata - - msg, err := client.ExternalIncentiveGauges(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ExternalIncentiveGauges_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryExternalIncentiveGaugesRequest - var metadata runtime.ServerMetadata - - msg, err := server.ExternalIncentiveGauges(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_GaugeIds_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_GaugeIds_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_GaugeIds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DistrInfo_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_DistrInfo_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_DistrInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - 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()...) - - }) - - mux.Handle("GET", pattern_Query_LockableDurations_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_LockableDurations_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_LockableDurations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_IncentivizedPools_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_IncentivizedPools_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_IncentivizedPools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ExternalIncentiveGauges_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_ExternalIncentiveGauges_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_ExternalIncentiveGauges_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_GaugeIds_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_GaugeIds_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_GaugeIds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DistrInfo_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_DistrInfo_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_DistrInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - 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()...) - - }) - - mux.Handle("GET", pattern_Query_LockableDurations_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_LockableDurations_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_LockableDurations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_IncentivizedPools_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_IncentivizedPools_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_IncentivizedPools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ExternalIncentiveGauges_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_ExternalIncentiveGauges_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_ExternalIncentiveGauges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_GaugeIds_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "pool-incentives", "v1beta1", "gauge-ids", "pool_id"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_DistrInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "pool-incentives", "v1beta1", "distr_info"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "pool-incentives", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_LockableDurations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "pool-incentives", "v1beta1", "lockable_durations"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_IncentivizedPools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "pool-incentives", "v1beta1", "incentivized_pools"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_ExternalIncentiveGauges_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "pool-incentives", "v1beta1", "external_incentive_gauges"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_GaugeIds_0 = runtime.ForwardResponseMessage - - forward_Query_DistrInfo_0 = runtime.ForwardResponseMessage - - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_LockableDurations_0 = runtime.ForwardResponseMessage - - forward_Query_IncentivizedPools_0 = runtime.ForwardResponseMessage - - forward_Query_ExternalIncentiveGauges_0 = runtime.ForwardResponseMessage -) diff --git a/proto/Dockerfile b/proto/Dockerfile new file mode 100644 index 000000000..e54b85fff --- /dev/null +++ b/proto/Dockerfile @@ -0,0 +1,35 @@ +# This Dockerfile is used for proto generation +# To build, run `make proto-image-build` + +FROM bufbuild/buf:1.7.0 as BUILDER + +FROM golang:1.22-alpine + + +RUN apk add --no-cache \ + nodejs \ + npm \ + git \ + make + +ENV GOLANG_PROTOBUF_VERSION=1.28.0 \ + GOGO_PROTOBUF_VERSION=1.3.2 \ + GRPC_GATEWAY_VERSION=1.16.0 + + +RUN go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} +RUN go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \ + github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} + +# install all gogo protobuf binaries +RUN git clone https://github.com/regen-network/protobuf.git; \ + cd protobuf; \ + go mod download; \ + make install + +# we need to use git clone because we use 'replace' directive in go.mod +# protoc-gen-gocosmos was moved to to in cosmos/gogoproto but pending a migration there. +RUN git clone https://github.com/regen-network/cosmos-proto.git; \ + cd cosmos-proto/protoc-gen-gocosmos; \ + go install . \ No newline at end of file diff --git a/proto/buf.gen.swagger.yaml b/proto/buf.gen.swagger.yaml index c6915c9fd..50837b9f5 100644 --- a/proto/buf.gen.swagger.yaml +++ b/proto/buf.gen.swagger.yaml @@ -1,5 +1,9 @@ version: v1 plugins: - name: swagger - out: ./tmp-swagger-gen - opt: logtostderr=true,fqn_for_swagger_name=true,simple_operation_ids=true \ No newline at end of file + out: ../tmp-swagger-gen + opt: + - logtostderr=true + - fqn_for_swagger_name=true + - simple_operation_ids=true + strategy: all \ No newline at end of file diff --git a/proto/buf.yaml b/proto/buf.yaml index 8e1fc299e..26b2b4312 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,4 +1,5 @@ version: v1 +name: buf.build/quasar-finance/quasar deps: - buf.build/cosmos/cosmos-proto - buf.build/cosmos/cosmos-sdk:v0.47.0 @@ -11,7 +12,23 @@ breaking: lint: use: - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE except: + - UNARY_RPC + - COMMENT_FIELD + - COMMENT_MESSAGE + - COMMENT_SERVICE + - COMMENT_RPC - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX - RPC_REQUEST_STANDARD_NAME + - PACKAGE_SAME_GO_PACKAGE + - PACKAGE_SAME_DIRECTORY + - PACKAGE_DIRECTORY_MATCH - RPC_RESPONSE_STANDARD_NAME + - COMMENT_ENUM_VALUE + - COMMENT_ENUM + - ENUM_ZERO_VALUE_SUFFIX + ignore: + - tendermint \ No newline at end of file diff --git a/proto/generate.sh b/proto/generate.sh index 701e9f7ab..59a6dbbbb 100644 --- a/proto/generate.sh +++ b/proto/generate.sh @@ -12,6 +12,6 @@ cd .. echo "Copying ..." PWD=$(pwd) echo "$PWD" -cp -r github.com/quasarlabs/quasarnode/* ./ +cp -r github.com/quasar-finance/quasar/* ./ # rm -rf github.com diff --git a/proto/osmosis/README.md b/proto/osmosis/README.md deleted file mode 100644 index 3bd910725..000000000 --- a/proto/osmosis/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Note -This directory contains proto files necessary for IBC communication (Both ICA and ICQ) with osmosis chain. - -**Current files were taken from https://github.com/osmosis-labs/osmosis/tree/v12.0.0** - -# Upgrade Procedure -To upgrade the proto files to a newer version of osmosis follow the below steps. - -## 1. Remove current osmosis proto files -Remove all the files and directories under this directory (`proto/osmosis`) except this file. - -## 2. Copy the needed proto files from osmosis -Copy the needed proto files from the latest stable version of osmosis (or any other stable versions desired) with keeping the directory structure of files to this directory. -Note that not all of the module proto files are needed. In most cases for ICA you should copy the `tx.proto` file and for ICQ `query.proto` with all the imported dependency files recursively`. - -## 3. Changes in proto files -Change the `go_package` option in all of the imported osmosis proto files from `github.com/osmosis-labs/osmosis/{version}/x/{module}/...` to `github.com/quasarlabs/quasarnode/osmosis/{module}/types` - -As an example: -``` -option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/types"; --> -option go_package = "github.com/quasarlabs/quasarnode/osmosis/gamm/types"; -``` - -Remove all the `option (gogoproto.goproto_stringer) = false;` statements from imported osmosis proto files. - -## 4. Resolve `sdk.Msg` implementation issues -All the Msg types defined the `tx.proto` files are required to implement the `sdk.Msg` cosmos interface which means we have to implement `GetSigners` and `ValidateBasic` methods for each one of them. But because we only use them in ICA we don't need any special or accurate implementation, just a dummy implementation like below will suffice. -```go -var ( - _ sdk.Msg = &MsgCreateBalancerPool{} -) - -func (msg MsgCreateBalancerPool) ValidateBasic() error { - panic("not implemented") -} - -func (msg MsgCreateBalancerPool) GetSigners() []sdk.AccAddress { - panic("not implemented") -} -``` - -## 5. Generating the go files -To regenerate the go files simply run `make proto-gen` in the root directory of repository. \ No newline at end of file diff --git a/proto/osmosis/epochs/v1beta1/genesis.proto b/proto/osmosis/epochs/v1beta1/genesis.proto deleted file mode 100644 index 8907759d4..000000000 --- a/proto/osmosis/epochs/v1beta1/genesis.proto +++ /dev/null @@ -1,72 +0,0 @@ -syntax = "proto3"; -package osmosis.epochs.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/epochs/types"; - -// EpochInfo is a struct that describes the data going into -// a timer defined by the x/epochs module. -message EpochInfo { - // identifier is a unique reference to this particular timer. - string identifier = 1; - // start_time is the time at which the timer first ever ticks. - // If start_time is in the future, the epoch will not begin until the start - // time. - google.protobuf.Timestamp start_time = 2 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"start_time\"" - ]; - // duration is the time in between epoch ticks. - // In order for intended behavior to be met, duration should - // be greater than the chains expected block time. - // Duration must be non-zero. - google.protobuf.Duration duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - // current_epoch is the current epoch number, or in other words, - // how many times has the timer 'ticked'. - // The first tick (current_epoch=1) is defined as - // the first block whose blocktime is greater than the EpochInfo start_time. - int64 current_epoch = 4; - // current_epoch_start_time describes the start time of the current timer - // interval. The interval is (current_epoch_start_time, - // current_epoch_start_time + duration] When the timer ticks, this is set to - // current_epoch_start_time = last_epoch_start_time + duration only one timer - // tick for a given identifier can occur per block. - // - // NOTE! The current_epoch_start_time may diverge significantly from the - // wall-clock time the epoch began at. Wall-clock time of epoch start may be - // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, - // duration = 5. Suppose the chain goes offline at t=14, and comes back online - // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) - // * The t=30 block will start the epoch for (10, 15] - // * The t=31 block will start the epoch for (15, 20] - // * The t=32 block will start the epoch for (20, 25] - // * The t=33 block will start the epoch for (25, 30] - // * The t=34 block will start the epoch for (30, 35] - // * The **t=36** block will start the epoch for (35, 40] - google.protobuf.Timestamp current_epoch_start_time = 5 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"current_epoch_start_time\"" - ]; - // epoch_counting_started is a boolean, that indicates whether this - // epoch timer has began yet. - bool epoch_counting_started = 6; - reserved 7; - // current_epoch_start_height is the block height at which the current epoch - // started. (The block height at which the timer last ticked) - int64 current_epoch_start_height = 8; -} - -// GenesisState defines the epochs module's genesis state. -message GenesisState { - repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/osmosis/epochs/v1beta1/query.proto b/proto/osmosis/epochs/v1beta1/query.proto deleted file mode 100644 index 208b5aa1e..000000000 --- a/proto/osmosis/epochs/v1beta1/query.proto +++ /dev/null @@ -1,29 +0,0 @@ -syntax = "proto3"; -package osmosis.epochs.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "osmosis/epochs/v1beta1/genesis.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/epochs/types"; - -// Query defines the gRPC querier service. -service Query { - // EpochInfos provide running epochInfos - rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) { - option (google.api.http).get = "/osmosis/epochs/v1beta1/epochs"; - } - // CurrentEpoch provide current epoch of specified identifier - rpc CurrentEpoch(QueryCurrentEpochRequest) - returns (QueryCurrentEpochResponse) { - option (google.api.http).get = "/osmosis/epochs/v1beta1/current_epoch"; - } -} - -message QueryEpochsInfoRequest {} -message QueryEpochsInfoResponse { - repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ]; -} - -message QueryCurrentEpochRequest { string identifier = 1; } -message QueryCurrentEpochResponse { int64 current_epoch = 1; } \ No newline at end of file diff --git a/proto/osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto b/proto/osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto deleted file mode 100644 index 8631a7f65..000000000 --- a/proto/osmosis/gamm/poolmodels/balancer/v1beta1/tx.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; -package osmosis.gamm.poolmodels.balancer.v1beta1; - -import "gogoproto/gogo.proto"; -import "osmosis/gamm/v1beta1/balancerPool.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer"; - -service Msg { - rpc CreateBalancerPool(MsgCreateBalancerPool) - returns (MsgCreateBalancerPoolResponse); -} - -// ===================== MsgCreatePool -message MsgCreateBalancerPool { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - - osmosis.gamm.v1beta1.PoolParams pool_params = 2 - [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; - - repeated osmosis.gamm.v1beta1.PoolAsset pool_assets = 3 - [ (gogoproto.nullable) = false ]; - - string future_pool_governor = 4 - [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; -} - -// Returns the poolID -message MsgCreateBalancerPoolResponse { - uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ]; -} diff --git a/proto/osmosis/gamm/v1beta1/balancerPool.proto b/proto/osmosis/gamm/v1beta1/balancerPool.proto deleted file mode 100644 index 0b6be3adf..000000000 --- a/proto/osmosis/gamm/v1beta1/balancerPool.proto +++ /dev/null @@ -1,149 +0,0 @@ -syntax = "proto3"; -// this is a legacy package that requires additional migration logic -// in order to use the correct packge. Decision made to use legacy package path -// until clear steps for migration logic and the unknowns for state breaking are -// investigated for changing proto package. -package osmosis.gamm.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer"; - -// Parameters for changing the weights in a balancer pool smoothly from -// a start weight and end weight over a period of time. -// Currently, the only smooth change supported is linear changing between -// the two weights, but more types may be added in the future. -// When these parameters are set, the weight w(t) for pool time `t` is the -// following: -// t <= start_time: w(t) = initial_pool_weights -// start_time < t <= start_time + duration: -// w(t) = initial_pool_weights + (t - start_time) * -// (target_pool_weights - initial_pool_weights) / (duration) -// t > start_time + duration: w(t) = target_pool_weights -message SmoothWeightChangeParams { - // The start time for beginning the weight change. - // If a parameter change / pool instantiation leaves this blank, - // it should be generated by the state_machine as the current time. - google.protobuf.Timestamp start_time = 1 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"start_time\"" - ]; - // Duration for the weights to change over - google.protobuf.Duration duration = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - // The initial pool weights. These are copied from the pool's settings - // at the time of weight change instantiation. - // The amount PoolAsset.token.amount field is ignored if present, - // future type refactorings should just have a type with the denom & weight - // here. - repeated osmosis.gamm.v1beta1.PoolAsset initial_pool_weights = 3 [ - (gogoproto.moretags) = "yaml:\"initial_pool_weights\"", - (gogoproto.nullable) = false - ]; - // The target pool weights. The pool weights will change linearly with respect - // to time between start_time, and start_time + duration. The amount - // PoolAsset.token.amount field is ignored if present, future type - // refactorings should just have a type with the denom & weight here. - repeated osmosis.gamm.v1beta1.PoolAsset target_pool_weights = 4 [ - (gogoproto.moretags) = "yaml:\"target_pool_weights\"", - (gogoproto.nullable) = false - ]; - // Intermediate variable for the 'slope' of pool weights. This is equal to - // (target_pool_weights - initial_pool_weights) / (duration) - // TODO: Work out precision, and decide if this is good to add - // repeated PoolAsset poolWeightSlope = 5 [ - // (gogoproto.moretags) = "yaml:\"pool_weight_slope\"", - // (gogoproto.nullable) = false - // ]; -} - -// PoolParams defined the parameters that will be managed by the pool -// governance in the future. This params are not managed by the chain -// governance. Instead they will be managed by the token holders of the pool. -// The pool's token holders are specified in future_pool_governor. -message PoolParams { - string swap_fee = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"swap_fee\"", - (gogoproto.nullable) = false - ]; - string exit_fee = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"exit_fee\"", - (gogoproto.nullable) = false - ]; - SmoothWeightChangeParams smooth_weight_change_params = 3 [ - (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"", - (gogoproto.nullable) = true - ]; -} - -// Pool asset is an internal struct that combines the amount of the -// token in the pool, and its balancer weight. -// This is an awkward packaging of data, -// and should be revisited in a future state migration. -message PoolAsset { - // Coins we are talking about, - // the denomination must be unique amongst all PoolAssets for this pool. - cosmos.base.v1beta1.Coin token = 1 - [ (gogoproto.moretags) = "yaml:\"token\"", (gogoproto.nullable) = false ]; - // Weight that is not normalized. This weight must be less than 2^50 - string weight = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"weight\"", - (gogoproto.nullable) = false - ]; -} - -message Pool { - option (gogoproto.goproto_getters) = false; - // option (cosmos_proto.implements_interface) = "PoolI"; - option (cosmos_proto.implements_interface) = "osmosis.gamm.v1beta1.Pool"; - string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - uint64 id = 2; - - PoolParams pool_params = 3 [ - (gogoproto.moretags) = "yaml:\"balancer_pool_params\"", - (gogoproto.nullable) = false - ]; - - // This string specifies who will govern the pool in the future. - // Valid forms of this are: - // {token name},{duration} - // {duration} - // where {token name} if specified is the token which determines the - // governor, and if not specified is the LP token for this pool.duration is - // a time specified as 0w,1w,2w, etc. which specifies how long the token - // would need to be locked up to count in governance. 0w means no lockup. - // TODO: Further improve these docs - string future_pool_governor = 4 - [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; - // sum of all LP tokens sent out - cosmos.base.v1beta1.Coin total_shares = 5 [ - (gogoproto.moretags) = "yaml:\"total_shares\"", - (gogoproto.nullable) = false - ]; - // These are assumed to be sorted by denomiation. - // They contain the pool asset and the information about the weight - repeated osmosis.gamm.v1beta1.PoolAsset pool_assets = 6 [ - (gogoproto.moretags) = "yaml:\"pool_assets\"", - (gogoproto.nullable) = false - ]; - // sum of all non-normalized pool weights - string total_weight = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"total_weight\"", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/osmosis/gamm/v1beta1/query.proto b/proto/osmosis/gamm/v1beta1/query.proto deleted file mode 100644 index 60a6d63b0..000000000 --- a/proto/osmosis/gamm/v1beta1/query.proto +++ /dev/null @@ -1,192 +0,0 @@ -syntax = "proto3"; -package osmosis.gamm.v1beta1; - -import "gogoproto/gogo.proto"; -import "osmosis/gamm/v1beta1/tx.proto"; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/api/annotations.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/gamm/types"; - -service Query { - rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) { - option (google.api.http).get = "/osmosis/gamm/v1beta1/pools"; - } - - rpc NumPools(QueryNumPoolsRequest) returns (QueryNumPoolsResponse) { - option (google.api.http).get = "/osmosis/gamm/v1beta1/num_pools"; - } - - rpc TotalLiquidity(QueryTotalLiquidityRequest) - returns (QueryTotalLiquidityResponse) { - option (google.api.http).get = "/osmosis/gamm/v1beta1/total_liquidity"; - } - - // Per Pool gRPC Endpoints - rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { - option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{pool_id}"; - } - - rpc PoolParams(QueryPoolParamsRequest) returns (QueryPoolParamsResponse) { - option (google.api.http).get = - "/osmosis/gamm/v1beta1/pools/{pool_id}/params"; - } - - rpc TotalPoolLiquidity(QueryTotalPoolLiquidityRequest) - returns (QueryTotalPoolLiquidityResponse) { - option (google.api.http).get = - "/osmosis/gamm/v1beta1/pools/{pool_id}/total_pool_liquidity"; - } - - rpc TotalShares(QueryTotalSharesRequest) returns (QueryTotalSharesResponse) { - option (google.api.http).get = - "/osmosis/gamm/v1beta1/pools/{pool_id}/total_shares"; - } - - // SpotPrice defines a gRPC query handler that returns the spot price given - // a base denomination and a quote denomination. - rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) { - option (google.api.http).get = - "/osmosis/gamm/v1beta1/pools/{pool_id}/prices"; - } - - // Estimate the swap. - rpc EstimateSwapExactAmountIn(QuerySwapExactAmountInRequest) - returns (QuerySwapExactAmountInResponse) { - option (google.api.http).get = - "/osmosis/gamm/v1beta1/{pool_id}/estimate/swap_exact_amount_in"; - } - - rpc EstimateSwapExactAmountOut(QuerySwapExactAmountOutRequest) - returns (QuerySwapExactAmountOutResponse) { - option (google.api.http).get = - "/osmosis/gamm/v1beta1/{pool_id}/estimate/swap_exact_amount_out"; - } -} - -//=============================== Pool -message QueryPoolRequest { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; -} -message QueryPoolResponse { - google.protobuf.Any pool = 1 [ (cosmos_proto.accepts_interface) = "osmosis.gamm.v1beta1.Pool" ]; -} - -//=============================== Pools -message QueryPoolsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} -message QueryPoolsResponse { - repeated google.protobuf.Any pools = 1 - [ (cosmos_proto.accepts_interface) = "osmosis.gamm.v1beta1.Pool" ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -//=============================== NumPools -message QueryNumPoolsRequest {} -message QueryNumPoolsResponse { - uint64 num_pools = 1 [ (gogoproto.moretags) = "yaml:\"num_pools\"" ]; -} - -//=============================== PoolParams -message QueryPoolParamsRequest { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; -} -message QueryPoolParamsResponse { google.protobuf.Any params = 1; } - -//=============================== PoolLiquidity -message QueryTotalPoolLiquidityRequest { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; -} - -message QueryTotalPoolLiquidityResponse { - repeated cosmos.base.v1beta1.Coin liquidity = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"liquidity\"", - (gogoproto.nullable) = false - ]; -} - -//=============================== TotalShares -message QueryTotalSharesRequest { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; -} -message QueryTotalSharesResponse { - cosmos.base.v1beta1.Coin total_shares = 1 [ - (gogoproto.moretags) = "yaml:\"total_shares\"", - (gogoproto.nullable) = false - ]; -} - -// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice -// query. -message QuerySpotPriceRequest { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string base_asset_denom = 2 - [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; - string quote_asset_denom = 3 - [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ]; - reserved 4; - reserved "withSwapFee"; -} - -// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice -// query. -message QuerySpotPriceResponse { - // String of the Dec. Ex) 10.203uatom - string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; -} - -//=============================== EstimateSwapExactAmountIn -message QuerySwapExactAmountInRequest { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string token_in = 3 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; - repeated SwapAmountInRoute routes = 4 [ - (gogoproto.moretags) = "yaml:\"routes\"", - (gogoproto.nullable) = false - ]; -} - -message QuerySwapExactAmountInResponse { - string token_out_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_out_amount\"", - (gogoproto.nullable) = false - ]; -} - -//=============================== EstimateSwapExactAmountOut -message QuerySwapExactAmountOutRequest { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - repeated SwapAmountOutRoute routes = 3 [ - (gogoproto.moretags) = "yaml:\"routes\"", - (gogoproto.nullable) = false - ]; - string token_out = 4 [ (gogoproto.moretags) = "yaml:\"token_out\"" ]; -} - -message QuerySwapExactAmountOutResponse { - string token_in_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_in_amount\"", - (gogoproto.nullable) = false - ]; -} - -message QueryTotalLiquidityRequest {} - -message QueryTotalLiquidityResponse { - repeated cosmos.base.v1beta1.Coin liquidity = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"liquidity\"", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/osmosis/gamm/v1beta1/tx.proto b/proto/osmosis/gamm/v1beta1/tx.proto deleted file mode 100644 index 72189c0b0..000000000 --- a/proto/osmosis/gamm/v1beta1/tx.proto +++ /dev/null @@ -1,232 +0,0 @@ -syntax = "proto3"; -package osmosis.gamm.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/gamm/types"; - -service Msg { - rpc JoinPool(MsgJoinPool) returns (MsgJoinPoolResponse); - rpc ExitPool(MsgExitPool) returns (MsgExitPoolResponse); - rpc SwapExactAmountIn(MsgSwapExactAmountIn) - returns (MsgSwapExactAmountInResponse); - rpc SwapExactAmountOut(MsgSwapExactAmountOut) - returns (MsgSwapExactAmountOutResponse); - rpc JoinSwapExternAmountIn(MsgJoinSwapExternAmountIn) - returns (MsgJoinSwapExternAmountInResponse); - rpc JoinSwapShareAmountOut(MsgJoinSwapShareAmountOut) - returns (MsgJoinSwapShareAmountOutResponse); - rpc ExitSwapExternAmountOut(MsgExitSwapExternAmountOut) - returns (MsgExitSwapExternAmountOutResponse); - rpc ExitSwapShareAmountIn(MsgExitSwapShareAmountIn) - returns (MsgExitSwapShareAmountInResponse); -} - -// ===================== MsgJoinPool -// This is really MsgJoinPoolNoSwap -message MsgJoinPool { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string share_out_amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"pool_amount_out\"", - (gogoproto.nullable) = false - ]; - repeated cosmos.base.v1beta1.Coin token_in_maxs = 4 [ - (gogoproto.moretags) = "yaml:\"token_in_max_amounts\"", - (gogoproto.nullable) = false - ]; -} - -message MsgJoinPoolResponse { - string share_out_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"share_out_amount\"", - (gogoproto.nullable) = false - ]; - repeated cosmos.base.v1beta1.Coin token_in = 2 [ - (gogoproto.moretags) = "yaml:\"token_in\"", - (gogoproto.nullable) = false - ]; -} - -// ===================== MsgExitPool -message MsgExitPool { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string share_in_amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"share_in_amount\"", - (gogoproto.nullable) = false - ]; - - repeated cosmos.base.v1beta1.Coin token_out_mins = 4 [ - (gogoproto.moretags) = "yaml:\"token_out_min_amounts\"", - (gogoproto.nullable) = false - ]; -} - -message MsgExitPoolResponse { - repeated cosmos.base.v1beta1.Coin token_out = 1 [ - (gogoproto.moretags) = "yaml:\"token_out\"", - (gogoproto.nullable) = false - ]; -} - -// ===================== MsgSwapExactAmountIn -message SwapAmountInRoute { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string token_out_denom = 2 - [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ]; -} - -message MsgSwapExactAmountIn { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - repeated SwapAmountInRoute routes = 2 [ (gogoproto.nullable) = false ]; - cosmos.base.v1beta1.Coin token_in = 3 [ - (gogoproto.moretags) = "yaml:\"token_in\"", - (gogoproto.nullable) = false - ]; - string token_out_min_amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_out_min_amount\"", - (gogoproto.nullable) = false - ]; -} - -message MsgSwapExactAmountInResponse { - string token_out_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_out_amount\"", - (gogoproto.nullable) = false - ]; -} - -// ===================== MsgSwapExactAmountOut -message SwapAmountOutRoute { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string token_in_denom = 2 - [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ]; -} - -message MsgSwapExactAmountOut { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - repeated SwapAmountOutRoute routes = 2 [ (gogoproto.nullable) = false ]; - string token_in_max_amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_in_max_amount\"", - (gogoproto.nullable) = false - ]; - cosmos.base.v1beta1.Coin token_out = 4 [ - (gogoproto.moretags) = "yaml:\"token_out\"", - (gogoproto.nullable) = false - ]; -} - -message MsgSwapExactAmountOutResponse { - string token_in_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_in_amount\"", - (gogoproto.nullable) = false - ]; -} - -// ===================== MsgJoinSwapExternAmountIn -// TODO: Rename to MsgJoinSwapExactAmountIn -message MsgJoinSwapExternAmountIn { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - cosmos.base.v1beta1.Coin token_in = 3 [ - (gogoproto.moretags) = "yaml:\"token_in\"", - (gogoproto.nullable) = false - ]; - string share_out_min_amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"share_out_min_amount\"", - (gogoproto.nullable) = false - ]; -} - -message MsgJoinSwapExternAmountInResponse { - string share_out_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"share_out_amount\"", - (gogoproto.nullable) = false - ]; -} - -// ===================== MsgJoinSwapShareAmountOut -message MsgJoinSwapShareAmountOut { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string token_in_denom = 3 - [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ]; - string share_out_amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"share_out_amount\"", - (gogoproto.nullable) = false - ]; - string token_in_max_amount = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_in_max_amount\"", - (gogoproto.nullable) = false - ]; -} - -message MsgJoinSwapShareAmountOutResponse { - string token_in_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_in_amount\"", - (gogoproto.nullable) = false - ]; -} - -// ===================== MsgExitSwapShareAmountIn -message MsgExitSwapShareAmountIn { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string token_out_denom = 3 - [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ]; - string share_in_amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"share_in_amount\"", - (gogoproto.nullable) = false - ]; - string token_out_min_amount = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_out_min_amount\"", - (gogoproto.nullable) = false - ]; -} - -message MsgExitSwapShareAmountInResponse { - string token_out_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_out_amount\"", - (gogoproto.nullable) = false - ]; -} - -// ===================== MsgExitSwapExternAmountOut -message MsgExitSwapExternAmountOut { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - cosmos.base.v1beta1.Coin token_out = 3 [ - (gogoproto.moretags) = "yaml:\"token_out\"", - (gogoproto.nullable) = false - ]; - string share_in_max_amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"share_in_max_amount\"", - (gogoproto.nullable) = false - ]; -} - -message MsgExitSwapExternAmountOutResponse { - string share_in_amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"share_in_amount\"", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/osmosis/incentives/gauge.proto b/proto/osmosis/incentives/gauge.proto deleted file mode 100644 index 8f3c2c9a5..000000000 --- a/proto/osmosis/incentives/gauge.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; -package osmosis.incentives; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "osmosis/lockup/lock.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/incentives/types"; - -// Gauge is an object that stores and distributes yields to recipients who -// satisfy certain conditions. Currently gauges support conditions around the -// duration for which a given denom is locked. -message Gauge { - // id is the unique ID of a Gauge - uint64 id = 1; - // is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge - // Non-perpetual gauges distribute their tokens equally per epoch while the - // gauge is in the active period. Perpetual gauges distribute all their tokens - // at a single time and only distribute their tokens again once the gauge is - // refilled, Intended for use with incentives that get refilled daily. - bool is_perpetual = 2; - // distribute_to is where the gauge rewards are distributed to. - // This is queried via lock duration or by timestamp - osmosis.lockup.QueryCondition distribute_to = 3 - [ (gogoproto.nullable) = false ]; - // coins is the total amount of coins that have been in the gauge - // Can distribute multiple coin denoms - repeated cosmos.base.v1beta1.Coin coins = 4 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // start_time is the distribution start time - google.protobuf.Timestamp start_time = 5 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"start_time\"" - ]; - // num_epochs_paid_over is the number of total epochs distribution will be - // completed over - uint64 num_epochs_paid_over = 6; - // filled_epochs is the number of epochs distribution has been completed on - // already - uint64 filled_epochs = 7; - // distributed_coins are coins that have been distributed already - repeated cosmos.base.v1beta1.Coin distributed_coins = 8 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -message LockableDurationsInfo { - // List of incentivised durations that gauges will pay out to - repeated google.protobuf.Duration lockable_durations = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"lockable_durations\"" - ]; -} \ No newline at end of file diff --git a/proto/osmosis/lockup/lock.proto b/proto/osmosis/lockup/lock.proto deleted file mode 100644 index 114852c9c..000000000 --- a/proto/osmosis/lockup/lock.proto +++ /dev/null @@ -1,108 +0,0 @@ -syntax = "proto3"; -package osmosis.lockup; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/lockup/types"; - -// PeriodLock is a single lock unit by period defined by the x/lockup module. -// It's a record of a locked coin at a specific time. It stores owner, duration, -// unlock time and the number of coins locked. A state of a period lock is -// created upon lock creation, and deleted once the lock has been matured after -// the `duration` has passed since unbonding started. -message PeriodLock { - // ID is the unique id of the lock. - // The ID of the lock is decided upon lock creation, incrementing by 1 for - // every lock. - uint64 ID = 1; - // Owner is the account address of the lock owner. - // Only the owner can modify the state of the lock. - string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; - // Duration is the time needed for a lock to mature after unlocking has - // started. - google.protobuf.Duration duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - // EndTime refers to the time at which the lock would mature and get deleted. - // This value is first initialized when an unlock has started for the lock, - // end time being block time + duration. - google.protobuf.Timestamp end_time = 4 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"end_time\"" - ]; - // Coins are the tokens locked within the lock, kept in the module account. - repeated cosmos.base.v1beta1.Coin coins = 5 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// LockQueryType defines the type of the lock query that can -// either be by duration or start time of the lock. -enum LockQueryType { - option (gogoproto.goproto_enum_prefix) = false; - - ByDuration = 0; - ByTime = 1; -} - -// QueryCondition is a struct used for querying locks upon different conditions. -// Duration field and timestamp fields could be optional, depending on the -// LockQueryType. -message QueryCondition { - // LockQueryType is a type of lock query, ByLockDuration | ByLockTime - LockQueryType lock_query_type = 1; - // Denom represents the token denomination we are looking to lock up - string denom = 2; - // Duration is used to query locks with longer duration than the specified - // duration. Duration field must not be nil when the lock query type is - // `ByLockDuration`. - google.protobuf.Duration duration = 3 [ - (gogoproto.stdduration) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - // Timestamp is used by locks started before the specified duration. - // Timestamp field must not be nil when the lock query type is `ByLockTime`. - // Querying locks with timestamp is currently not implemented. - google.protobuf.Timestamp timestamp = 4 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"timestamp\"" - ]; -} - -// SyntheticLock is creating virtual lockup where new denom is combination of -// original denom and synthetic suffix. At the time of synthetic lockup creation -// and deletion, accumulation store is also being updated and on querier side, -// they can query as freely as native lockup. -message SyntheticLock { - // Underlying Lock ID is the underlying native lock's id for this synthetic - // lockup. A synthetic lock MUST have an underlying lock. - uint64 underlying_lock_id = 1; - // SynthDenom is the synthetic denom that is a combination of - // gamm share + bonding status + validator address. - string synth_denom = 2; - // used for unbonding synthetic lockups, for active synthetic lockups, this - // value is set to uninitialized value - google.protobuf.Timestamp end_time = 3 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"end_time\"" - ]; - // Duration is the duration for a synthetic lock to mature - // at the point of unbonding has started. - google.protobuf.Duration duration = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; -} diff --git a/proto/osmosis/lockup/tx.proto b/proto/osmosis/lockup/tx.proto deleted file mode 100644 index 845e07de1..000000000 --- a/proto/osmosis/lockup/tx.proto +++ /dev/null @@ -1,73 +0,0 @@ -syntax = "proto3"; -package osmosis.lockup; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "osmosis/lockup/lock.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/lockup/types"; - -// Msg defines the Msg service. -service Msg { - // LockTokens lock tokens - rpc LockTokens(MsgLockTokens) returns (MsgLockTokensResponse); - // BeginUnlockingAll begin unlocking all tokens - rpc BeginUnlockingAll(MsgBeginUnlockingAll) - returns (MsgBeginUnlockingAllResponse); - // MsgBeginUnlocking begins unlocking tokens by lock ID - rpc BeginUnlocking(MsgBeginUnlocking) returns (MsgBeginUnlockingResponse); - // MsgEditLockup edits the existing lockups by lock ID - rpc ExtendLockup(MsgExtendLockup) returns (MsgExtendLockupResponse); -} - -message MsgLockTokens { - string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; - google.protobuf.Duration duration = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - repeated cosmos.base.v1beta1.Coin coins = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} -message MsgLockTokensResponse { uint64 ID = 1; } - -message MsgBeginUnlockingAll { - string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; -} -message MsgBeginUnlockingAllResponse { repeated PeriodLock unlocks = 1; } - -message MsgBeginUnlocking { - string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; - uint64 ID = 2; - // Amount of unlocking coins. Unlock all if not set. - repeated cosmos.base.v1beta1.Coin coins = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} -message MsgBeginUnlockingResponse { bool success = 1; } - -// MsgExtendLockup extends the existing lockup's duration. -// The new duration is longer than the original. -message MsgExtendLockup { - string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; - uint64 ID = 2; - - // duration to be set. fails if lower than the current duration, or is - // unlocking - google.protobuf.Duration duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - - // extend for other edit, e.g. cancel unlocking -} - -message MsgExtendLockupResponse { bool success = 1; } diff --git a/proto/osmosis/mint/v1beta1/mint.proto b/proto/osmosis/mint/v1beta1/mint.proto deleted file mode 100644 index 511fbc6fc..000000000 --- a/proto/osmosis/mint/v1beta1/mint.proto +++ /dev/null @@ -1,107 +0,0 @@ -syntax = "proto3"; -package osmosis.mint.v1beta1; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/mint/types"; - -import "gogoproto/gogo.proto"; - -// Minter represents the minting state. -message Minter { - // epoch_provisions represent rewards for the current epoch. - string epoch_provisions = 1 [ - (gogoproto.moretags) = "yaml:\"epoch_provisions\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// WeightedAddress represents an address with a weight assigned to it. -// The weight is used to determine the proportion of the total minted -// tokens to be minted to the address. -message WeightedAddress { - string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - string weight = 2 [ - (gogoproto.moretags) = "yaml:\"weight\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// DistributionProportions defines the distribution proportions of the minted -// denom. In other words, defines which stakeholders will receive the minted -// denoms and how much. -message DistributionProportions { - // staking defines the proportion of the minted mint_denom that is to be - // allocated as staking rewards. - string staking = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"staking\"", - (gogoproto.nullable) = false - ]; - // pool_incentives defines the proportion of the minted mint_denom that is - // to be allocated as pool incentives. - string pool_incentives = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"pool_incentives\"", - (gogoproto.nullable) = false - ]; - // developer_rewards defines the proportion of the minted mint_denom that is - // to be allocated to developer rewards address. - string developer_rewards = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"developer_rewards\"", - (gogoproto.nullable) = false - ]; - // community_pool defines the proportion of the minted mint_denom that is - // to be allocated to the community pool. - string community_pool = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"community_pool\"", - (gogoproto.nullable) = false - ]; -} - -// Params holds parameters for the x/mint module. -message Params { - - // mint_denom is the denom of the coin to mint. - string mint_denom = 1; - // genesis_epoch_provisions epoch provisions from the first epoch. - string genesis_epoch_provisions = 2 [ - (gogoproto.moretags) = "yaml:\"genesis_epoch_provisions\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // epoch_identifier mint epoch identifier e.g. (day, week). - string epoch_identifier = 3 - [ (gogoproto.moretags) = "yaml:\"epoch_identifier\"" ]; - // reduction_period_in_epochs the number of epochs it takes - // to reduce the rewards. - int64 reduction_period_in_epochs = 4 - [ (gogoproto.moretags) = "yaml:\"reduction_period_in_epochs\"" ]; - // reduction_factor is the reduction multiplier to execute - // at the end of each period set by reduction_period_in_epochs. - string reduction_factor = 5 [ - (gogoproto.moretags) = "yaml:\"reduction_factor\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // distribution_proportions defines the distribution proportions of the minted - // denom. In other words, defines which stakeholders will receive the minted - // denoms and how much. - DistributionProportions distribution_proportions = 6 - [ (gogoproto.nullable) = false ]; - // weighted_developer_rewards_receivers is the address to receive developer - // rewards with weights assignedt to each address. The final amount that each - // address receives is: epoch_provisions * - // distribution_proportions.developer_rewards * Address's Weight. - repeated WeightedAddress weighted_developer_rewards_receivers = 7 [ - (gogoproto.moretags) = "yaml:\"developer_rewards_receiver\"", - (gogoproto.nullable) = false - ]; - // minting_rewards_distribution_start_epoch start epoch to distribute minting - // rewards - int64 minting_rewards_distribution_start_epoch = 8 - [ (gogoproto.moretags) = - "yaml:\"minting_rewards_distribution_start_epoch\"" ]; -} diff --git a/proto/osmosis/mint/v1beta1/query.proto b/proto/osmosis/mint/v1beta1/query.proto deleted file mode 100644 index fa256643d..000000000 --- a/proto/osmosis/mint/v1beta1/query.proto +++ /dev/null @@ -1,45 +0,0 @@ -syntax = "proto3"; -package osmosis.mint.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "osmosis/mint/v1beta1/mint.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/mint/types"; - -// Query provides defines the gRPC querier service. -service Query { - // Params returns the total set of minting parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/osmosis/mint/v1beta1/params"; - } - - // EpochProvisions returns the current minting epoch provisions value. - rpc EpochProvisions(QueryEpochProvisionsRequest) - returns (QueryEpochProvisionsResponse) { - option (google.api.http).get = "/osmosis/mint/v1beta1/epoch_provisions"; - } -} - -// 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 [ (gogoproto.nullable) = false ]; -} - -// QueryEpochProvisionsRequest is the request type for the -// Query/EpochProvisions RPC method. -message QueryEpochProvisionsRequest {} - -// QueryEpochProvisionsResponse is the response type for the -// Query/EpochProvisions RPC method. -message QueryEpochProvisionsResponse { - // epoch_provisions is the current minting per epoch provisions value. - bytes epoch_provisions = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/osmosis/poolincentives/v1beta1/incentives.proto b/proto/osmosis/poolincentives/v1beta1/incentives.proto deleted file mode 100644 index 6294e9ed4..000000000 --- a/proto/osmosis/poolincentives/v1beta1/incentives.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; -package osmosis.poolincentives.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types"; - -message Params { - // minted_denom is the denomination of the coin expected to be minted by the - // minting module. Pool-incentives module doesn’t actually mint the coin - // itself, but rather manages the distribution of coins that matches the - // defined minted_denom. - string minted_denom = 1 [ (gogoproto.moretags) = "yaml:\"minted_denom\"" ]; -} - -message LockableDurationsInfo { - repeated google.protobuf.Duration lockable_durations = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"lockable_durations\"" - ]; -} - -message DistrInfo { - string total_weight = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"total_weight\"", - (gogoproto.nullable) = false - ]; - repeated DistrRecord records = 2 [ (gogoproto.nullable) = false ]; -} - -message DistrRecord { - option (gogoproto.equal) = true; - - uint64 gauge_id = 1 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ]; - string weight = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -message PoolToGauge { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - uint64 gauge_id = 2 [ (gogoproto.moretags) = "yaml:\"gauge\"" ]; - google.protobuf.Duration duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"duration\"" - ]; -} - -message PoolToGauges { - repeated PoolToGauge pool_to_gauge = 2 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file diff --git a/proto/osmosis/poolincentives/v1beta1/query.proto b/proto/osmosis/poolincentives/v1beta1/query.proto deleted file mode 100644 index 320ccd577..000000000 --- a/proto/osmosis/poolincentives/v1beta1/query.proto +++ /dev/null @@ -1,108 +0,0 @@ -syntax = "proto3"; -package osmosis.poolincentives.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "google/protobuf/duration.proto"; -import "osmosis/incentives/gauge.proto"; -import "osmosis/poolincentives/v1beta1/incentives.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types"; - -service Query { - // GaugeIds takes the pool id and returns the matching gauge ids and durations - rpc GaugeIds(QueryGaugeIdsRequest) returns (QueryGaugeIdsResponse) { - option (google.api.http).get = - "/osmosis/pool-incentives/v1beta1/gauge-ids/{pool_id}"; - } - // DistrInfo returns the pool's matching gauge ids and weights. - rpc DistrInfo(QueryDistrInfoRequest) returns (QueryDistrInfoResponse) { - option (google.api.http).get = - "/osmosis/pool-incentives/v1beta1/distr_info"; - } - - // Params returns pool incentives params. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/osmosis/pool-incentives/v1beta1/params"; - } - - // LockableDurations returns lock durations for pools. - rpc LockableDurations(QueryLockableDurationsRequest) - returns (QueryLockableDurationsResponse) { - option (google.api.http).get = - "/osmosis/pool-incentives/v1beta1/lockable_durations"; - } - - // IncentivizedPools returns currently incentivized pools - rpc IncentivizedPools(QueryIncentivizedPoolsRequest) - returns (QueryIncentivizedPoolsResponse) { - option (google.api.http).get = - "/osmosis/pool-incentives/v1beta1/incentivized_pools"; - } - - // ExternalIncentiveGauges returns external incentive gauges. - rpc ExternalIncentiveGauges(QueryExternalIncentiveGaugesRequest) - returns (QueryExternalIncentiveGaugesResponse) { - option (google.api.http).get = - "/osmosis/pool-incentives/v1beta1/external_incentive_gauges"; - } -} - -message QueryGaugeIdsRequest { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; -} -message QueryGaugeIdsResponse { - message GaugeIdWithDuration { - uint64 gauge_id = 1 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ]; - google.protobuf.Duration duration = 2 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - string gauge_incentive_percentage = 3; - } - - repeated GaugeIdWithDuration gauge_ids_with_duration = 1 - [ (gogoproto.moretags) = "yaml:\"gauge_ids_with_duration\"" ]; -} - -message QueryDistrInfoRequest {} -message QueryDistrInfoResponse { - DistrInfo distr_info = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"distr_info\"" - ]; -} - -message QueryParamsRequest {} -message QueryParamsResponse { - Params params = 1 [ (gogoproto.nullable) = false ]; -} - -message QueryLockableDurationsRequest {} -message QueryLockableDurationsResponse { - repeated google.protobuf.Duration lockable_durations = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"lockable_durations\"" - ]; -} - -message QueryIncentivizedPoolsRequest {} -message IncentivizedPool { - uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - google.protobuf.Duration lockable_duration = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"lockable_duration\"" - ]; - uint64 gauge_id = 3 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ]; -} -message QueryIncentivizedPoolsResponse { - repeated IncentivizedPool incentivized_pools = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"incentivized_pools\"" - ]; -} - -message QueryExternalIncentiveGaugesRequest {} -message QueryExternalIncentiveGaugesResponse { - repeated osmosis.incentives.Gauge data = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/quasarlabs/quasarnode/epochs/genesis.proto b/proto/quasar/epochs/v1beta1/genesis.proto similarity index 90% rename from proto/quasarlabs/quasarnode/epochs/genesis.proto rename to proto/quasar/epochs/v1beta1/genesis.proto index ec3e96dd1..03fe4de01 100644 --- a/proto/quasarlabs/quasarnode/epochs/genesis.proto +++ b/proto/quasar/epochs/v1beta1/genesis.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package quasarlabs.quasarnode.epochs; +package quasar.epochs.v1beta1; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/quasarlabs/quasarnode/x/epochs/types"; +option go_package = "github.com/quasar-finance/quasar/x/epochs/types"; message EpochInfo { string identifier = 1; diff --git a/proto/quasarlabs/quasarnode/epochs/query.proto b/proto/quasar/epochs/v1beta1/query.proto similarity index 58% rename from proto/quasarlabs/quasarnode/epochs/query.proto rename to proto/quasar/epochs/v1beta1/query.proto index 60b49073b..c19270ea3 100644 --- a/proto/quasarlabs/quasarnode/epochs/query.proto +++ b/proto/quasar/epochs/v1beta1/query.proto @@ -1,22 +1,32 @@ syntax = "proto3"; -package quasarlabs.quasarnode.epochs; +package quasar.epochs.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "quasarlabs/quasarnode/epochs/genesis.proto"; +import "quasar/epochs/v1beta1/genesis.proto"; -option go_package = "github.com/quasarlabs/quasarnode/x/epochs/types"; +option go_package = "github.com/quasar-finance/quasar/x/epochs/types"; // Query defines the gRPC querier service. service Query { // EpochInfos provide running epochInfos rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) { - option (google.api.http).get = "/quasarlabs/epochs/v1beta1/epochs"; + option (google.api.http) = { + get: "/quasar/epochs/v1beta1/epochs" + additional_bindings { + get: "/quasarlabs/epochs/v1beta1/epochs" + } + }; } // CurrentEpoch provide current epoch of specified identifier rpc CurrentEpoch(QueryCurrentEpochRequest) returns (QueryCurrentEpochResponse) { - option (google.api.http).get = "/quasarlabs/epochs/v1beta1/current_epoch"; + option (google.api.http) = { + get: "/quasar/epochs/v1beta1/current_epoch" + additional_bindings { + get: "/quasarlabs/epochs/v1beta1/current_epoch" + } + }; } } diff --git a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/authorityMetadata.proto b/proto/quasar/tokenfactory/v1beta1/authorityMetadata.proto similarity index 81% rename from proto/quasarlabs/quasarnode/tokenfactory/v1beta1/authorityMetadata.proto rename to proto/quasar/tokenfactory/v1beta1/authorityMetadata.proto index a8af6712a..885de534d 100644 --- a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/authorityMetadata.proto +++ b/proto/quasar/tokenfactory/v1beta1/authorityMetadata.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package quasarlabs.quasarnode.tokenfactory.v1beta1; +package quasar.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/quasarlabs/quasarnode/x/tokenfactory/types"; +option go_package = "github.com/quasar-finance/quasar/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/quasarlabs/quasarnode/tokenfactory/v1beta1/genesis.proto b/proto/quasar/tokenfactory/v1beta1/genesis.proto similarity index 76% rename from proto/quasarlabs/quasarnode/tokenfactory/v1beta1/genesis.proto rename to proto/quasar/tokenfactory/v1beta1/genesis.proto index 3e9b629cc..d740ed6ea 100644 --- a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/genesis.proto +++ b/proto/quasar/tokenfactory/v1beta1/genesis.proto @@ -1,12 +1,11 @@ syntax = "proto3"; -package quasarlabs.quasarnode.tokenfactory.v1beta1; +package quasar.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; -import "quasarlabs/quasarnode/tokenfactory/v1beta1/authorityMetadata.proto"; -import "quasarlabs/quasarnode/tokenfactory/v1beta1/params.proto"; +import "quasar/tokenfactory/v1beta1/authorityMetadata.proto"; +import "quasar/tokenfactory/v1beta1/params.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/tokenfactory/types"; +option go_package = "github.com/quasar-finance/quasar/x/tokenfactory/types"; // GenesisState defines the tokenfactory module's genesis state. message GenesisState { diff --git a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/params.proto b/proto/quasar/tokenfactory/v1beta1/params.proto similarity index 52% rename from proto/quasarlabs/quasarnode/tokenfactory/v1beta1/params.proto rename to proto/quasar/tokenfactory/v1beta1/params.proto index 79899ea26..5903de3bf 100644 --- a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/params.proto +++ b/proto/quasar/tokenfactory/v1beta1/params.proto @@ -1,24 +1,28 @@ syntax = "proto3"; -package quasarlabs.quasarnode.tokenfactory.v1beta1; +package quasar.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; -import "quasarlabs/quasarnode/tokenfactory/v1beta1/authorityMetadata.proto"; +import "quasar/tokenfactory/v1beta1/authorityMetadata.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/quasarlabs/quasarnode/x/tokenfactory/types"; +option go_package = "github.com/quasar-finance/quasar/x/tokenfactory/types"; // Params defines the parameters for the tokenfactory module. message Params { + // DenomCreationFee defines the fee to be charged on the creation of a new + // denom. The fee is drawn from the MsgCreateDenom's sender account, and + // transferred to the community pool. repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", (gogoproto.nullable) = false ]; - // if denom_creation_fee is an empty array, then this field is used to add more gas consumption - // to the base cost. - // https://github.com/CosmWasm/token-factory/issues/11 + // DenomCreationGasConsume defines the gas cost for creating a new denom. + // This is intended as a spam deterrence mechanism. + // + // See: https://github.com/CosmWasm/token-factory/issues/11 uint64 denom_creation_gas_consume = 2 [ (gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"", (gogoproto.nullable) = true diff --git a/proto/quasar/tokenfactory/v1beta1/query.proto b/proto/quasar/tokenfactory/v1beta1/query.proto new file mode 100644 index 000000000..40ed0f635 --- /dev/null +++ b/proto/quasar/tokenfactory/v1beta1/query.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; +package quasar.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "quasar/tokenfactory/v1beta1/authorityMetadata.proto"; +import "quasar/tokenfactory/v1beta1/params.proto"; + +option go_package = "github.com/quasar-finance/quasar/x/tokenfactory/types"; + +// Query defines the gRPC querier service. +service Query { + // Params defines a gRPC query method that returns the tokenfactory module's + // parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http) = { + get: "/quasar/tokenfactory/v1beta1/params" + additional_bindings { + get: "/quasarlabs.quasarnode.tokenfactory.v1beta1/params" + } + }; + } + + // DenomAuthorityMetadata defines a gRPC query method for fetching + // DenomAuthorityMetadata for a particular denom. + rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) + returns (QueryDenomAuthorityMetadataResponse) { + option (google.api.http) = { + get: "/quasar/tokenfactory/v1beta1/denoms/{denom}/authority_metadata" + additional_bindings { + get: "/quasarlabs.quasarnode.tokenfactory.v1beta1/denoms/{denom}/authority_metadata" + } + }; + } + + // DenomsFromCreator defines a gRPC query method for fetching all + // denominations created by a specific admin/creator. + rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) + returns (QueryDenomsFromCreatorResponse) { + option (google.api.http) = { + get: "/quasar/tokenfactory/v1beta1/denoms_from_creator/{creator}" + additional_bindings { + get: "/quasarlabs.quasarnode.tokenfactory.v1beta1/denoms_from_creator/{creator}" + } + }; + } + + // BeforeSendHookAddress defines a gRPC query method for + // getting the address registered for the before send hook. + rpc BeforeSendHookAddress(QueryBeforeSendHookAddressRequest) + returns (QueryBeforeSendHookAddressResponse) { + option (google.api.http).get = + "/quasar/tokenfactory/v1beta1/denoms/{denom}/before_send_hook"; + } + + // AllBeforeSendHooksAddresses defines a gRPC query method for + // getting all addresses with before send hook registered. + // The response returns two arrays, an array with a list of denom and an array + // of before send hook addresses. The idx of denom corresponds to before send + // hook addresse's idx. + rpc AllBeforeSendHooksAddresses(QueryAllBeforeSendHooksAddressesRequest) + returns (QueryAllBeforeSendHooksAddressesResponse) { + option (google.api.http).get = + "/osmosis/tokenfactory/v1beta1/all_before_send_hooks"; + } +} + +// 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 [ (gogoproto.nullable) = false ]; +} + +// QueryDenomAuthorityMetadataRequest defines the request structure for the +// DenomAuthorityMetadata gRPC query. +message QueryDenomAuthorityMetadataRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +// QueryDenomAuthorityMetadataResponse defines the response structure for the +// DenomAuthorityMetadata gRPC query. +message QueryDenomAuthorityMetadataResponse { + DenomAuthorityMetadata authority_metadata = 1 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} + +// QueryDenomsFromCreatorRequest defines the request structure for the +// DenomsFromCreator gRPC query. +message QueryDenomsFromCreatorRequest { + string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; +} + +// QueryDenomsFromCreatorRequest defines the response structure for the +// DenomsFromCreator gRPC query. +message QueryDenomsFromCreatorResponse { + repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; +} + +message QueryBeforeSendHookAddressRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +// QueryBeforeSendHookAddressResponse defines the response structure for the +// DenomBeforeSendHook gRPC query. +message QueryBeforeSendHookAddressResponse { + string cosmwasm_address = 1 + [ (gogoproto.moretags) = "yaml:\"cosmwasm_address\"" ]; +} + +message QueryAllBeforeSendHooksAddressesRequest {} + +// QueryAllBeforeSendHooksAddressesResponse defines the response structure for +// the AllBeforeSendHooksAddresses gRPC query. +message QueryAllBeforeSendHooksAddressesResponse { + repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; + repeated string before_send_hook_addresses = 2 + [ (gogoproto.moretags) = "yaml:\"before_send_addresses\"" ]; +} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/tx.proto b/proto/quasar/tokenfactory/v1beta1/tx.proto similarity index 59% rename from proto/quasarlabs/quasarnode/tokenfactory/v1beta1/tx.proto rename to proto/quasar/tokenfactory/v1beta1/tx.proto index 3c2688ba5..029eb3094 100644 --- a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/tx.proto +++ b/proto/quasar/tokenfactory/v1beta1/tx.proto @@ -1,24 +1,27 @@ syntax = "proto3"; -package quasarlabs.quasarnode.tokenfactory.v1beta1; +package quasar.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos/msg/v1/msg.proto"; -option go_package = "github.com/quasarlabs/quasarnode/x/tokenfactory/types"; +option go_package = "github.com/quasar-finance/quasar/x/tokenfactory/types"; // Msg defines the tokefactory module's gRPC message service. service Msg { + option (cosmos.msg.v1.service) = true; rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); rpc Mint(MsgMint) returns (MsgMintResponse); rpc Burn(MsgBurn) returns (MsgBurnResponse); rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse); rpc SetDenomMetadata(MsgSetDenomMetadata) returns (MsgSetDenomMetadataResponse); - - // ForceTransfer is deactivated for now because we need to think through edge - // cases rpc ForceTransfer(MsgForceTransfer) returns - // (MsgForceTransferResponse); + rpc SetBeforeSendHook(MsgSetBeforeSendHook) + returns (MsgSetBeforeSendHookResponse); + rpc ForceTransfer(MsgForceTransfer) returns (MsgForceTransferResponse); } // MsgCreateDenom defines the message structure for the CreateDenom gRPC service @@ -31,6 +34,8 @@ service Msg { // originally set to be the creator, but this can be changed later. The token // denom does not indicate the current admin. message MsgCreateDenom { + option (amino.name) = "quasar/tokenfactory/create-denom"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; // subdenom can be up to 44 "alphanumeric" characters long. string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; @@ -44,29 +49,37 @@ message MsgCreateDenomResponse { } // MsgMint is the sdk.Msg type for allowing an admin account to mint -// more of a token. For now, we only support minting to the sender account +// more of a token. +// Only the admin of the token factory denom has permission to mint unless +// the denom does not have any admin. message MsgMint { + option (amino.name) = "quasar/tokenfactory/mint"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; string mintToAddress = 3 - [ (gogoproto.moretags) = "yaml:\"mint_to_address\"" ]; + [ (gogoproto.moretags) = "yaml:\"mint_to_address\"" ]; } message MsgMintResponse {} // MsgBurn is the sdk.Msg type for allowing an admin account to burn -// a token. For now, we only support burning from the sender account. +// a token. +// Only the admin of the token factory denom has permission to burn unless +// the denom does not have any admin. message MsgBurn { + option (amino.name) = "quasar/tokenfactory/burn"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; string burnFromAddress = 3 - [ (gogoproto.moretags) = "yaml:\"burn_from_address\"" ]; + [ (gogoproto.moretags) = "yaml:\"burn_from_address\"" ]; } message MsgBurnResponse {} @@ -74,6 +87,8 @@ message MsgBurnResponse {} // MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign // adminship of a denom to a new account message MsgChangeAdmin { + option (amino.name) = "quasar/tokenfactory/change-admin"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; @@ -83,19 +98,20 @@ message MsgChangeAdmin { // MsgChangeAdmin message. message MsgChangeAdminResponse {} -// message MsgForceTransfer { -// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; -// cosmos.base.v1beta1.Coin amount = 2 [ -// (gogoproto.moretags) = "yaml:\"amount\"", -// (gogoproto.nullable) = false -// ]; -// string transferFromAddress = 3 -// [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; -// string transferToAddress = 4 -// [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; -// } +// MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to +// assign a CosmWasm contract to call with a BeforeSend hook +message MsgSetBeforeSendHook { + option (amino.name) = "quasar/tokenfactory/set-beforesend-hook"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string cosmwasm_address = 3 + [ (gogoproto.moretags) = "yaml:\"cosmwasm_address\"" ]; +} -// message MsgForceTransferResponse {} +// MsgSetBeforeSendHookResponse defines the response structure for an executed +// MsgSetBeforeSendHook message. +message MsgSetBeforeSendHookResponse {} // MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set // the denom's bank metadata @@ -109,4 +125,20 @@ message MsgSetDenomMetadata { // MsgSetDenomMetadataResponse defines the response structure for an executed // MsgSetDenomMetadata message. -message MsgSetDenomMetadataResponse {} \ No newline at end of file +message MsgSetDenomMetadataResponse {} + +message MsgForceTransfer { + option (amino.name) = "quasar/tokenfactory/force-transfer"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string transferFromAddress = 3 + [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; + string transferToAddress = 4 + [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; +} + +message MsgForceTransferResponse {} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qoracle/genesis.proto b/proto/quasarlabs/quasarnode/qoracle/genesis.proto deleted file mode 100644 index fe6b521c9..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/genesis.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle; - -import "gogoproto/gogo.proto"; -import "quasarlabs/quasarnode/qoracle/params.proto"; -import "quasarlabs/quasarnode/qoracle/osmosis/params.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/genesis/types"; - -// GenesisState defines the qoracle module's genesis state. -message GenesisState { - Params params = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"params\""]; - - OsmosisGenesisState osmosis_genesis_state = 4 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"osmosis_genesis_state\""]; -} - -// OsmosisGenesisState defines the qoracle osmosis submodule's genesis state. -message OsmosisGenesisState { - string port = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - quasarlabs.quasarnode.qoracle.osmosis.Params params = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"params\""]; -} diff --git a/proto/quasarlabs/quasarnode/qoracle/osmosis/osmosis.proto b/proto/quasarlabs/quasarnode/qoracle/osmosis/osmosis.proto deleted file mode 100644 index 103c84439..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/osmosis/osmosis.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle.osmosis; - -import "gogoproto/gogo.proto"; -import "osmosis/poolincentives/v1beta1/query.proto"; -import "osmosis/epochs/v1beta1/genesis.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types"; - -message OsmosisRequestState { - uint64 packet_sequence = 1; - bool acknowledged = 2; - bool failed = 3; - int64 updated_at_height = 4; -} - -message IncentivizedPools { - repeated .osmosis.poolincentives.v1beta1.IncentivizedPool incentivized_pools = 1 [(gogoproto.nullable) = false]; -} - -message EpochsInfo { - repeated .osmosis.epochs.v1beta1.EpochInfo epochs_info = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qoracle/osmosis/params.proto b/proto/quasarlabs/quasarnode/qoracle/osmosis/params.proto deleted file mode 100644 index cb1cad0b9..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/osmosis/params.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle.osmosis; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "ibc/core/client/v1/client.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types"; - -message Params { - option (gogoproto.goproto_stringer) = false; - - bool enabled = 1 [(gogoproto.moretags) = "yaml:\"enabled\""]; - string epoch_identifier = 2 [(gogoproto.moretags) = "yaml:\"epoch_identifier\""]; // Identifier of the epoch that we trigger the icq request - string authorized_channel = 3 [(gogoproto.moretags) = "yaml:\"authorized_channel\""]; // Identifier of authorized channel that we are allowed to send/receive packets - ibc.core.client.v1.Height packet_timeout_height = 4 - [(gogoproto.moretags) = "yaml:\"packet_timeout_height\"", (gogoproto.nullable) = false]; // Timeout height relative to the current block height. The timeout is disabled when set to 0. - uint64 packet_timeout_timestamp = 5 [(gogoproto.moretags) = "yaml:\"packet_timeout_timestamp\""]; // Timeout timestamp relative to counterparty chain current time. The timeout is disabled when set to 0. -} diff --git a/proto/quasarlabs/quasarnode/qoracle/osmosis/query.proto b/proto/quasarlabs/quasarnode/qoracle/osmosis/query.proto deleted file mode 100644 index 3b6506c74..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/osmosis/query.proto +++ /dev/null @@ -1,90 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle.osmosis; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "quasarlabs/quasarnode/qoracle/osmosis/params.proto"; -import "quasarlabs/quasarnode/qoracle/osmosis/osmosis.proto"; -import "osmosis/epochs/v1beta1/genesis.proto"; -import "osmosis/mint/v1beta1/mint.proto"; -import "osmosis/poolincentives/v1beta1/incentives.proto"; -import "osmosis/poolincentives/v1beta1/query.proto"; -import "osmosis/gamm/v1beta1/balancerPool.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types"; - -// Query defines the gRPC querier service. -service Query { - // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/osmosis/params"; - } - - // Queries the state of oracle requests. - rpc State(QueryStateRequest) returns (QueryStateResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/osmosis/state"; - } - - // Queries latest fetched params from osmosis chain. - rpc ChainParams(QueryChainParamsRequest) returns (QueryChainParamsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/osmosis/chain_params"; - } - - // Queries latest fetched list of incentivized pools from osmosis. - rpc IncentivizedPools(QueryIncentivizedPoolsRequest) returns (QueryIncentivizedPoolsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/osmosis/incentivized_pools"; - } - - // Queries latest fetched list of pool details from osmosis. - rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/osmosis/pools"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -message QueryStateRequest { -} - -message QueryStateResponse { - OsmosisRequestState params_request_state = 2 [(gogoproto.nullable) = false]; - OsmosisRequestState incentivized_pools_state = 3 [(gogoproto.nullable) = false]; - OsmosisRequestState pools_state = 4 [(gogoproto.nullable) = false]; -} - -message QueryChainParamsRequest { -} - -message QueryChainParamsResponse { - repeated .osmosis.epochs.v1beta1.EpochInfo epochs_info = 1 [(gogoproto.nullable) = false]; - repeated int64 lockable_durations = 2 [(gogoproto.casttype) = "time.Duration"]; - .osmosis.mint.v1beta1.Params mint_params = 3 [(gogoproto.nullable) = false]; - bytes mint_epoch_provisions = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - .osmosis.poolincentives.v1beta1.DistrInfo distr_info = 5 [(gogoproto.nullable) = false]; -} - -message QueryIncentivizedPoolsRequest { -} - -message QueryIncentivizedPoolsResponse { - repeated .osmosis.poolincentives.v1beta1.IncentivizedPool incentivized_pools = 1 [(gogoproto.nullable) = false]; -} - -message QueryPoolsRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryPoolsResponse { - repeated .osmosis.gamm.v1beta1.Pool pools = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qoracle/osmosis/tx.proto b/proto/quasarlabs/quasarnode/qoracle/osmosis/tx.proto deleted file mode 100644 index c04478760..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/osmosis/tx.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle.osmosis; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types"; - -// Msg defines the Msg service. -service Msg { - // rpc UpdateChainParams(MsgUpdateChainParams) returns (MsgUpdateChainParamsResponse); -} - -/* -message MsgUpdateChainParams { - string creator = 1; -} - -message MsgUpdateChainParamsResponse { - uint64 packet_sequence = 1; -} -*/ \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qoracle/params.proto b/proto/quasarlabs/quasarnode/qoracle/params.proto deleted file mode 100644 index 04eb812d3..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/params.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - - // uint64 denom_prices_exp_duration = 1 [(gogoproto.moretags) = "yaml:\"denom_prices_exp_duration\""]; // Maximum time in which the denom price list is valid between updates in seconds. - // repeated DenomSymbolMapping mappings = 2 [(gogoproto.nullable) = false]; // TODO TAG - // repeated DenomSymbolMapping mappings = 2 - // [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"mappings\""]; -} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qoracle/pool.proto b/proto/quasarlabs/quasarnode/qoracle/pool.proto deleted file mode 100644 index 2a68a11f2..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/pool.proto +++ /dev/null @@ -1,29 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "osmosis/gamm/v1beta1/balancerPool.proto"; -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/types"; - -// Pool defines the generalized structure of a liquidity pool coming from any source chain to qoracle. -message Pool { - string id = 1; // The identifier of this pool in the source chain - repeated cosmos.base.v1beta1.Coin assets = 2 - [(gogoproto.moretags) = "yaml:\"token\"", (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; // List of assets with their current volume in pool - bytes tvl = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.customname) = "TVL", - (gogoproto.nullable) = false - ]; // Total volume locked in the pool - bytes apy = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.customname) = "APY", - (gogoproto.nullable) = false - ]; // Annual percentage yield of the pool - google.protobuf.Any raw = 5 [ (cosmos_proto.accepts_interface) = "osmosis.gamm.v1beta1.Pool" ] ; // Raw data of pool structure stored in the source chain - google.protobuf.Timestamp updated_at = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // Last time this pool was updated -} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qoracle/price_list.proto b/proto/quasarlabs/quasarnode/qoracle/price_list.proto deleted file mode 100644 index 0063adad8..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/price_list.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/types"; -/* -message SymbolPriceList { - repeated cosmos.base.v1beta1.DecCoin prices = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; - google.protobuf.Timestamp updated_at = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - */ \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qoracle/query.proto b/proto/quasarlabs/quasarnode/qoracle/query.proto deleted file mode 100644 index 715af8153..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/query.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "quasarlabs/quasarnode/qoracle/params.proto"; -import "quasarlabs/quasarnode/qoracle/pool.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/types"; - -// Query defines the gRPC querier service. -service Query { - // Params queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/params"; - } - - /* - // DenomMappings queries list of denom-> symbol mappings which maps the denoms to their corresponding symbol fetched from price oracles. - rpc DenomMappings(QueryDenomMappingsRequest) returns (QueryDenomMappingsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/denom_mappings"; - } - - // DenomPrices queries list of denom prices. - rpc DenomPrices(QueryDenomPricesRequest) returns (QueryDenomPricesResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/denom_prices"; - } - */ - // Pools queries the pools collected from pool oracles. - rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qoracle/pools"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryPoolsRequest is request type for the Query/Pools RPC method. -message QueryPoolsRequest { - // denom filters the pools by their denom. If empty, pools with any denom returned. - string denom = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryPoolsResponse is response type for the Query/Pools RPC method. -message QueryPoolsResponse { - repeated Pool pools = 1 [(gogoproto.nullable) = false]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qoracle/tx.proto b/proto/quasarlabs/quasarnode/qoracle/tx.proto deleted file mode 100644 index d7267cc49..000000000 --- a/proto/quasarlabs/quasarnode/qoracle/tx.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qoracle; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qoracle/types"; - -// Msg defines the Msg service. -service Msg { - -} diff --git a/proto/quasarlabs/quasarnode/qtransfer/genesis.proto b/proto/quasarlabs/quasarnode/qtransfer/genesis.proto deleted file mode 100644 index 9f2ceb1c9..000000000 --- a/proto/quasarlabs/quasarnode/qtransfer/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qtransfer; - -import "gogoproto/gogo.proto"; -import "quasarlabs/quasarnode/qtransfer/params.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qtransfer/types"; - -// GenesisState defines the qtransfer module's genesis state. -message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; -} diff --git a/proto/quasarlabs/quasarnode/qtransfer/params.proto b/proto/quasarlabs/quasarnode/qtransfer/params.proto deleted file mode 100644 index dedf10d51..000000000 --- a/proto/quasarlabs/quasarnode/qtransfer/params.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qtransfer; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qtransfer/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - - bool wasm_hooks_enabled = 1 [ - (gogoproto.moretags) = "yaml:\"wasm_hooks_enabled\"" - ]; -} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qtransfer/query.proto b/proto/quasarlabs/quasarnode/qtransfer/query.proto deleted file mode 100644 index ff99b07c5..000000000 --- a/proto/quasarlabs/quasarnode/qtransfer/query.proto +++ /dev/null @@ -1,27 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qtransfer; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "quasarlabs/quasarnode/qtransfer/params.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qtransfer/types"; - -// Query defines the gRPC querier service. -service Query { -// Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qtransfer/params"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qvesting/genesis.proto b/proto/quasarlabs/quasarnode/qvesting/genesis.proto deleted file mode 100644 index 990769d97..000000000 --- a/proto/quasarlabs/quasarnode/qvesting/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qvesting; - -import "gogoproto/gogo.proto"; -import "quasarlabs/quasarnode/qvesting/params.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qvesting/types"; - -// GenesisState defines the qvesting module's genesis state. -message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; -} diff --git a/proto/quasarlabs/quasarnode/qvesting/params.proto b/proto/quasarlabs/quasarnode/qvesting/params.proto deleted file mode 100644 index 3383198f2..000000000 --- a/proto/quasarlabs/quasarnode/qvesting/params.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qvesting; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qvesting/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - -} diff --git a/proto/quasarlabs/quasarnode/qvesting/query.proto b/proto/quasarlabs/quasarnode/qvesting/query.proto deleted file mode 100644 index 57d2817e6..000000000 --- a/proto/quasarlabs/quasarnode/qvesting/query.proto +++ /dev/null @@ -1,92 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qvesting; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "quasarlabs/quasarnode/qvesting/params.proto"; -import "google/protobuf/any.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qvesting/types"; - -// Query defines the gRPC querier service. -service Query { - // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qvesting/params"; - } - // SpendableBalances queries the spenable balance of all coins for a single account. - rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qvesting/spendable_balances/{address}"; - } - // VestingAccounts returns all the existing vesting accounts - rpc VestingAccounts(QueryVestingAccountsRequest) returns (QueryVestingAccountsResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qvesting/accounts"; - } - // VestingAccounts returns all the existing vesting accounts - rpc VestingLockedSupply(QueryVestingLockedSupplyRequest) returns (QueryVestingLockedSupplyResponse) { - option (google.api.http).get = "/quasarlabs/quasarnode/qvesting/locked_supply/{denom}"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QuerySpendableBalancesRequest defines the gRPC request structure for querying -// an account's spendable balances. -message QuerySpendableBalancesRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query spendable balances for. - string address = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QuerySpendableBalancesResponse defines the gRPC response structure for querying -// an account's spendable balances. -message QuerySpendableBalancesResponse { - // balances is the spendable balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryVestingAccountsRequest is the request type for the Query/Accounts RPC method. -message QueryVestingAccountsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryVestingAccountsResponse is the response type for the Query/Accounts RPC method. -message QueryVestingAccountsResponse { - // accounts are the existing vesting accounts - // repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "VestingAccount"]; - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryVestingLockedSupplyRequest is the request type for the Query/VestingLockedSupply RPC method. -message QueryVestingLockedSupplyRequest { - // denom is the coin denom to query locked supply for. - string denom = 1; -} - -// QueryVestingAccountsResponse is the response type for the Query/VestingLockedSupply RPC method. -message QueryVestingLockedSupplyResponse { - // amount is the supply of the coin. - cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file diff --git a/proto/quasarlabs/quasarnode/qvesting/tx.proto b/proto/quasarlabs/quasarnode/qvesting/tx.proto deleted file mode 100644 index 0708f12c2..000000000 --- a/proto/quasarlabs/quasarnode/qvesting/tx.proto +++ /dev/null @@ -1,27 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.qvesting; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/qvesting/types"; - -// Msg defines the Msg service. -service Msg { - rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); -} - -message MsgCreateVestingAccount { - option (gogoproto.equal) = true; - - string fromAddress = 1; - string toAddress = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - int64 startTime = 4; - int64 endTime = 5; -} - -message MsgCreateVestingAccountResponse { -} - diff --git a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/query.proto b/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/query.proto deleted file mode 100644 index 6addec058..000000000 --- a/proto/quasarlabs/quasarnode/tokenfactory/v1beta1/query.proto +++ /dev/null @@ -1,71 +0,0 @@ -syntax = "proto3"; -package quasarlabs.quasarnode.tokenfactory.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "quasarlabs/quasarnode/tokenfactory/v1beta1/authorityMetadata.proto"; -import "quasarlabs/quasarnode/tokenfactory/v1beta1/params.proto"; - -option go_package = "github.com/quasarlabs/quasarnode/x/tokenfactory/types"; - -// Query defines the gRPC querier service. -service Query { - // Params defines a gRPC query method that returns the tokenfactory module's - // parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/quasarlabs.quasarnode.tokenfactory.v1beta1/params"; - } - - // DenomAuthorityMetadata defines a gRPC query method for fetching - // DenomAuthorityMetadata for a particular denom. - rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) - returns (QueryDenomAuthorityMetadataResponse) { - option (google.api.http).get = - "/quasarlabs.quasarnode.tokenfactory.v1beta1/denoms/{denom}/authority_metadata"; - } - - // DenomsFromCreator defines a gRPC query method for fetching all - // denominations created by a specific admin/creator. - rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) - returns (QueryDenomsFromCreatorResponse) { - option (google.api.http).get = - "/quasarlabs.quasarnode.tokenfactory.v1beta1/denoms_from_creator/{creator}"; - } -} - -// 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 [ (gogoproto.nullable) = false ]; -} - -// QueryDenomAuthorityMetadataRequest defines the request structure for the -// DenomAuthorityMetadata gRPC query. -message QueryDenomAuthorityMetadataRequest { - string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; -} - -// QueryDenomAuthorityMetadataResponse defines the response structure for the -// DenomAuthorityMetadata gRPC query. -message QueryDenomAuthorityMetadataResponse { - DenomAuthorityMetadata authority_metadata = 1 [ - (gogoproto.moretags) = "yaml:\"authority_metadata\"", - (gogoproto.nullable) = false - ]; -} - -// QueryDenomsFromCreatorRequest defines the request structure for the -// DenomsFromCreator gRPC query. -message QueryDenomsFromCreatorRequest { - string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; -} - -// QueryDenomsFromCreatorRequest defines the response structure for the -// DenomsFromCreator gRPC query. -message QueryDenomsFromCreatorResponse { - repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; -} diff --git a/scripts/deploy_contracts.sh b/scripts/deploy_contracts.sh index b338c51db..878c4916e 100755 --- a/scripts/deploy_contracts.sh +++ b/scripts/deploy_contracts.sh @@ -20,16 +20,16 @@ cd ../smart-contracts # docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/workspace-optimizer-arm64:0.12.11 echo "Running store code" -RES=$(quasarnoded tx wasm store artifacts/lp_strategy-aarch64.wasm --from testnet-relayer --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/lp_strategy-aarch64.wasm --from testnet-relayer --keyring-backend test -y --output json -b block $TXFLAG) echo $RES CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') echo "Got CODE_ID = $CODE_ID" echo "Deploying contract" # swallow output -# quasarnoded tx wasm instantiate $CODE_ID "$INIT1" --from testnet-relayer --keyring-backend test -y --label "primitive-1" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID -OUT1=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT1" --from testnet-relayer --keyring-backend test -y --label "primitive-1" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) -ADDR1=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') +# quasard tx wasm instantiate $CODE_ID "$INIT1" --from testnet-relayer --keyring-backend test -y --label "primitive-1" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID +OUT1=$(quasard tx wasm instantiate $CODE_ID "$INIT1" --from testnet-relayer --keyring-backend test -y --label "primitive-1" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) +ADDR1=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $ADDR1" # rly transact channel quasar_osmosis --src-port "wasm.$ADDR1" --dst-port icqhost --order unordered --version icq-1 --override @@ -37,9 +37,9 @@ echo "Got address of deployed contract = $ADDR1" # sleep 6 -OUT2=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT2" --from testnet-relayer --keyring-backend test --label "primitive-2" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) -# quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE -ADDR2=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[1]') +OUT2=$(quasard tx wasm instantiate $CODE_ID "$INIT2" --from testnet-relayer --keyring-backend test --label "primitive-2" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) +# quasard query wasm list-contract-by-code $CODE_ID --output json $NODE +ADDR2=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[1]') echo "Got address of deployed contract = $ADDR2" # rly transact channel quasar_osmosis --src-port "wasm.$ADDR2" --dst-port icqhost --order unordered --version icq-1 --override @@ -47,8 +47,8 @@ echo "Got address of deployed contract = $ADDR2" # sleep 6 -# OUT3=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT3" --from testnet-relayer --keyring-backend test --label "primitive-3" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) -# ADDR3=$(quasarnoded query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[2]') +# OUT3=$(quasard tx wasm instantiate $CODE_ID "$INIT3" --from testnet-relayer --keyring-backend test --label "primitive-3" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) +# ADDR3=$(quasard query wasm list-contract-by-code $CODE_ID --output json $NODE | jq -r '.contracts[2]') # echo "Got address of deployed contract = $ADDR3" # rly transact channel quasar_osmosis --src-port "wasm.$ADDR3" --dst-port icqhost --order unordered --version icq-1 --override @@ -61,7 +61,7 @@ VAULT_INIT='{"thesis":"yurmum","decimals":6,"symbol":"ORN","min_withdrawal":"1", echo $VAULT_INIT echo "Running store code (vault)" -RES=$(quasarnoded tx wasm store artifacts/basic_vault-aarch64.wasm --from testnet-relayer --keyring-backend test -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/basic_vault-aarch64.wasm --from testnet-relayer --keyring-backend test -y --output json -b block $TXFLAG) VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') @@ -69,7 +69,7 @@ echo "Got CODE_ID = $VAULT_CODE_ID" echo "Deploying contract (vault)" # swallow output -OUT=$(quasarnoded tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from testnet-relayer --keyring-backend test --label "vault-contract" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) -VAULT_ADDR=$(quasarnoded query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from testnet-relayer --keyring-backend test --label "vault-contract" --gas-prices $FEE --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) +VAULT_ADDR=$(quasard query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $VAULT_ADDR (vault)" diff --git a/scripts/deploy_vault.sh b/scripts/deploy_vault.sh index 7442d7039..f01d68227 100755 --- a/scripts/deploy_vault.sh +++ b/scripts/deploy_vault.sh @@ -27,7 +27,7 @@ VAULT_INIT='{"decimals":6,"symbol":"ORN","min_withdrawal":"1","name":"ORION","pr echo $VAULT_INIT echo "Running store code (vault)" -RES=$(quasarnoded tx wasm store artifacts/basic_vault.wasm --from test-laurens --keyring-backend os -y --output json -b block $TXFLAG) +RES=$(quasard tx wasm store artifacts/basic_vault.wasm --from test-laurens --keyring-backend os -y --output json -b block $TXFLAG) VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') @@ -35,7 +35,7 @@ echo "Got CODE_ID = $VAULT_CODE_ID" echo "Deploying contract (vault)" # swallow output -OUT=$(quasarnoded tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from test-laurens --keyring-backend os --label "vault-contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) -VAULT_ADDR=$(quasarnoded query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') +OUT=$(quasard tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from test-laurens --keyring-backend os --label "vault-contract" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) +VAULT_ADDR=$(quasard query wasm list-contract-by-code $VAULT_CODE_ID --output json $NODE | jq -r '.contracts[0]') echo "Got address of deployed contract = $VAULT_ADDR (vault)" \ No newline at end of file diff --git a/scripts/generate-proto.sh b/scripts/generate-proto.sh index e76e5a6af..ff79971af 100644 --- a/scripts/generate-proto.sh +++ b/scripts/generate-proto.sh @@ -40,10 +40,5 @@ PWD=$(pwd) echo "PWD is - $PWD" # Copy the generated Go files to the desired location -cp -r github.com/quasarlabs/quasarnode/* . -cp -r github.com github.com.bkp - -# Generate rust files -cd ${project_dir}/smart-contracts/quasar -cargo run --bin proto-build -cd - \ No newline at end of file +cp -r github.com/quasar-finance/quasar/* . +cp -r github.com github.com.bkp \ No newline at end of file diff --git a/scripts/localnet b/scripts/localnet index deb6ee52c..fe7037425 100755 --- a/scripts/localnet +++ b/scripts/localnet @@ -23,7 +23,7 @@ json_pp() { gen_config() { local n="$1" ; shift - "${project_dir}/build/quasarnoded" testnet -n "$n" -o "$run_dir" + "${project_dir}/build/quasard" testnet -n "$n" -o "$run_dir" } for_all_nodes() { @@ -48,32 +48,32 @@ run_for_node() { local action="$1" if [ "$action" == "tx" ] ; then - "${home_dir}/cosmovisor/current/bin/quasarnoded" --home "$home_dir" --keyring-backend=test --from main "$@" + "${home_dir}/cosmovisor/current/bin/quasard" --home "$home_dir" --keyring-backend=test --from main "$@" else - "${home_dir}/cosmovisor/current/bin/quasarnoded" --home "$home_dir" "$@" + "${home_dir}/cosmovisor/current/bin/quasard" --home "$home_dir" "$@" fi } start() { if ! is_running ; then ( - export DAEMON_NAME="quasarnoded" + export DAEMON_NAME="quasard" export DAEMON_HOME="$home_dir" export DAEMON_RESTART_AFTER_UPGRADE=true - nohup cosmovisor run start --home "$home_dir" >| "quasarnoded.log" 2>&1 & - echo "$!" >| "quasarnoded.pid" + nohup cosmovisor run start --home "$home_dir" >| "quasard.log" 2>&1 & + echo "$!" >| "quasard.pid" ) fi } stop() { - kill "$(cat "quasarnoded.pid" 2> /dev/null)" > /dev/null 2>&1 || true - rm -f "quasarnoded.pid" + kill "$(cat "quasard.pid" 2> /dev/null)" > /dev/null 2>&1 || true + rm -f "quasard.pid" } is_running() { - ps -p "$(cat "quasarnoded.pid" 2> /dev/null)" > /dev/null 2>&1 + ps -p "$(cat "quasard.pid" 2> /dev/null)" > /dev/null 2>&1 } status() { @@ -85,7 +85,7 @@ run_for_node() { } log() { - tail -f "quasarnoded.log" + tail -f "quasard.log" } "$@" @@ -120,11 +120,11 @@ install_binary() { mkdir -p "${node_dir}/home/cosmovisor/upgrades" if [ "$name" == "genesis" ] ; then - cp "${project_dir}/build/quasarnoded" "${node_dir}/home/cosmovisor/genesis/bin/quasarnoded" + cp "${project_dir}/build/quasard" "${node_dir}/home/cosmovisor/genesis/bin/quasard" ln -sf "${node_dir}/home/cosmovisor/genesis" "${node_dir}/home/cosmovisor/current" else mkdir -p "${node_dir}/home/cosmovisor/upgrades/${name}/bin" - cp "${project_dir}/build/quasarnoded" "${node_dir}/home/cosmovisor/upgrades/${name}/bin/quasarnoded" + cp "${project_dir}/build/quasard" "${node_dir}/home/cosmovisor/upgrades/${name}/bin/quasard" fi } diff --git a/scripts/makefiles/build.mk b/scripts/makefiles/build.mk new file mode 100644 index 000000000..b0fabc6e8 --- /dev/null +++ b/scripts/makefiles/build.mk @@ -0,0 +1,98 @@ +############################################################################### +### Build ### +############################################################################### + +build-help: + @echo "build subcommands" + @echo "" + @echo "Usage:" + @echo " make build-[command]" + @echo "" + @echo "Available Commands:" + @echo " all Build all targets" + @echo " check-version Check Go version" + @echo " dev-build Build development version" + @echo " dev-install Install development build" + @echo " linux Build for Linux" + @echo " reproducible Build reproducible binaries" + @echo " reproducible-amd64 Build reproducible amd64 binary" + @echo " reproducible-arm64 Build reproducible arm64 binary" + +build-check-version: + @echo "Go version: $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION)" + @if [ $(GO_MAJOR_VERSION) -gt $(GO_MINIMUM_MAJOR_VERSION) ]; then \ + echo "Go version is sufficient"; \ + exit 0; \ + elif [ $(GO_MAJOR_VERSION) -lt $(GO_MINIMUM_MAJOR_VERSION) ]; then \ + echo '$(GO_VERSION_ERR_MSG)'; \ + exit 1; \ + elif [ $(GO_MINOR_VERSION) -lt $(GO_MINIMUM_MINOR_VERSION) ]; then \ + echo '$(GO_VERSION_ERR_MSG)'; \ + exit 1; \ + fi + +build-all: build-check-version go.sum + mkdir -p $(BUILDDIR)/ + GOWORK=off go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./... + +build-linux: go.sum + LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build + +# disables optimization, inlining and symbol removal +GC_FLAGS := -gcflags="all=-N -l" +REMOVE_STRING := -w -s +DEBUG_BUILD_FLAGS:= $(subst $(REMOVE_STRING),,$(BUILD_FLAGS)) +DEBUG_LDFLAGS = $(subst $(REMOVE_STRING),,$(ldflags)) + +build-dev-install: go.sum + GOWORK=off go install $(DEBUG_BUILD_FLAGS) $(GC_FLAGS) $(GO_MODULE)/cmd/quasard + +build-dev-build: + mkdir -p $(BUILDDIR)/ + GOWORK=off go build $(GC_FLAGS) -mod=readonly -ldflags '$(DEBUG_LDFLAGS)' -gcflags "all=-N -l" -trimpath -o $(BUILDDIR) ./...; + +############################################################################### +### Build reproducible ### +############################################################################### + +build-reproducible: build-reproducible-amd64 build-reproducible-arm64 + +build-reproducible-amd64: go.sum + mkdir -p $(BUILDDIR) + $(DOCKER) buildx create --name quasarbuilder || true + $(DOCKER) buildx use quasarbuilder + $(DOCKER) buildx build \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + --platform linux/amd64 \ + -t quasar-amd64 \ + --load \ + -f Dockerfile . + $(DOCKER) rm -f quasarbinary || true + $(DOCKER) create -ti --name quasarbinary quasar-amd64 + $(DOCKER) cp quasarbinary:/bin/quasard $(BUILDDIR)/quasard-linux-amd64 + $(DOCKER) rm -f quasarbinary + +build-reproducible-arm64: go.sum + mkdir -p $(BUILDDIR) + $(DOCKER) buildx create --name quasarbuilder || true + $(DOCKER) buildx use quasarbuilder + $(DOCKER) buildx build \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + --platform linux/arm64 \ + -t quasar-arm64 \ + --load \ + -f Dockerfile . + $(DOCKER) rm -f quasarbinary || true + $(DOCKER) create -ti --name quasarbinary quasar-arm64 + $(DOCKER) cp quasarbinary:/bin/quasard $(BUILDDIR)/quasard-linux-arm64 + $(DOCKER) rm -f quasarbinary + +go.sum: go.mod + @echo "--> Ensure dependencies have not been modified" + @go mod verify diff --git a/scripts/makefiles/docker.mk b/scripts/makefiles/docker.mk new file mode 100644 index 000000000..39684e9d9 --- /dev/null +++ b/scripts/makefiles/docker.mk @@ -0,0 +1,123 @@ +############################################################################### +### Docker ### +############################################################################### + +RUNNER_BASE_IMAGE_DISTROLESS := gcr.io/distroless/static-debian11 +RUNNER_BASE_IMAGE_ALPINE := alpine:3.17 +RUNNER_BASE_IMAGE_NONROOT := gcr.io/distroless/static-debian11:nonroot + +docker-help: + @echo "docker subcommands" + @echo "" + @echo "Usage:" + @echo " make docker-[command]" + @echo "" + @echo "Available Commands:" + @echo " build Build Docker image (distroless)" + @echo " build-alpine Build alpine Docker image" + @echo " build-nonroot Build nonroot Docker image" + @echo " compose-up Launching local env, building images if not available" + @echo " compose-up-recreate Recreate local env (will destroy application state)" + @echo " compose-build Rebuilding image for local env" + @echo " compose-rebuild Rebuilding images and restarting containers" + @echo " compose-stop Stop docker containers without removing them" + @echo " compose-down Stopping docker containers and REMOVING THEM" + @echo " attach-quasar Connecting to quasar docker container" + @echo " attach-osmosis Connecting to osmosis docker container" + @echo " attach-relayer Connecting to relayer docker container" + @echo " test-e2e Running e2e tests" + @echo " e2e-build Build e2e docker images of the chain needed for interchaintest" + +docker: docker-help + +docker-build: + @DOCKER_BUILDKIT=1 docker build \ + -t quasar:local \ + -t quasar:local-distroless \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + -f Dockerfile . + +docker-build-alpine: + @DOCKER_BUILDKIT=1 docker build \ + -t quasar:local-alpine \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_ALPINE) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + -f Dockerfile . + +docker-build-nonroot: + @DOCKER_BUILDKIT=1 docker build \ + -t quasar:local-nonroot \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_NONROOT) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + -f Dockerfile . + + +# This is not available to avoid missbehavior since it seems to be a bug in docker compose -p localenv: +# https://github.com/docker/compose/issues/10068 +# docker-compose-up-attached: ##@docker Run (and build if needed) env in docker compose. Attach if running in background. +# @echo "Launching local env with docker-compose" +# DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml up + +docker-compose-up: ##@docker Run local env, build only if no images available + @echo "Launching local env, building images if not available" + DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml up -d + +docker-compose-up-recreate: ##@docker DESTROY env containers and respawn them + @echo "Recreate local env (will destroy application state)" + DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml up -d --force-recreate + +docker-compose-build: ##@docker Build new image if there are code changes, won't recreate containers. + @echo "Rebuilding image for local env" + DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml build + +docker-compose-rebuild: docker-compose-build docker-compose-up-recreate ##@docker Recreate containers building new code if needed + @echo "Rebuilding images and restarting containers" + +docker-compose-stop: ##@docker Stop containers without deleting them + @echo "Stop docker containers without removing them" + DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml stop + +docker-compose-down: ##@docker Stop AND DELETE delete the containers + @echo "Stopping docker containers and REMOVING THEM" + DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -p localenv -f tests/docker/docker-compose.yml down + +docker-attach-quasar: ##@docker Connect to a terminal prompt in QUASAR node container + @echo "Connecting to quasar docker container" + docker exec -it localenv-quasar-1 /bin/bash + +docker-attach-osmosis: ##@docker Connect to a terminal prompt in OSMOSIS node container + @echo "Connecting to osmosis docker container" + docker exec -it localenv-osmosis-1 /bin/ash + +docker-attach-relayer: ##@docker Connect to a terminal prompt in RLY node container + @echo "Connecting to relayer docker container" + docker exec -it localenv-relayer-1 /bin/bash + +docker-test-e2e: docker-compose-up + @echo "Running e2e tests" + cd ./tests/shell/ && ./create_and_execute_contract.sh + +############################################################################### +### Docker E2E InterchainTest ### +############################################################################### + +docker-e2e-build: + $(eval CHAINS=$(filter-out $@,$(MAKECMDGOALS))) + @for chain in $(CHAINS); do + echo "Building $$chain" + DOCKER_BUILDKIT=1 docker build \ + -t $$chain:local \ + -t $$chain:local-distroless \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + -f ./tests/e2e/dockerfiles/$$chain.Dockerfile . + done diff --git a/scripts/makefiles/lint.mk b/scripts/makefiles/lint.mk new file mode 100644 index 000000000..f4e721ea6 --- /dev/null +++ b/scripts/makefiles/lint.mk @@ -0,0 +1,47 @@ +############################################################################### +### Linting ### +############################################################################### +lint-help: + @echo "lint subcommands" + @echo "" + @echo "Usage:" + @echo " make lint-[command]" + @echo "" + @echo "Available Commands:" + @echo " all Run all linters" + @echo " fix-typo Run codespell to fix typos" + @echo " format Run linters with auto-fix" + @echo " markdown Run markdown linter with auto-fix" + @echo " mdlint Run markdown linter" + @echo " setup-pre-commit Set pre-commit git hook" + @echo " typo Run codespell to check typos" +lint: lint-help + +lint-all: + @echo "--> Running linter" + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" + +lint-format: + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix + @go run mvdan.cc/gofumpt -l -w x/ app/ ante/ tests/ + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + +lint-mdlint: + @echo "--> Running markdown linter" + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" + +lint-markdown: + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + +lint-typo: + @codespell + +lint-fix-typo: + @codespell -w + +lint-setup-pre-commit: + @cp .git/hooks/pre-commit .git/hooks/pre-commit.bak 2>/dev/null || true + @echo "Installing pre-commit hook..." + @ln -sf ../../scripts/hooks/pre-commit.sh .git/hooks/pre-commit + @echo "Pre-commit hook installed successfully"` \ No newline at end of file diff --git a/scripts/makefiles/proto.mk b/scripts/makefiles/proto.mk new file mode 100644 index 000000000..2f18c660c --- /dev/null +++ b/scripts/makefiles/proto.mk @@ -0,0 +1,97 @@ +############################################################################### +### Proto & Mock Generation ### +############################################################################### + +PROTO_BUILDER_IMAGE=ghcr.io/cosmos/proto-builder:0.14.0 +protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) +protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) + +proto-help: + @echo "proto subcommands" + @echo "" + @echo "Usage:" + @echo " make proto-[command]" + @echo "" + @echo "Available Commands:" + @echo " all Run proto-format and proto-gen" + @echo " format Format Protobuf files" + @echo " gen Generate Protobuf files" + @echo " download-deps Download proto deps" + @echo " docs Push the protobuf Docker image" + +proto: proto-help +proto-all: proto-format proto-gen + +proto-gen: + @echo "Generating Protobuf files" + @$(DOCKER) run --rm -u 0 -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) sh ./scripts/protocgen.sh + +proto-format: + @echo "Formatting Protobuf files" + @$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ + find ./proto -name "*.proto" -exec clang-format -i {} \; + +SWAGGER_DIR=./swagger-proto +THIRD_PARTY_DIR=$(SWAGGER_DIR)/third_party + +proto-download-deps: + mkdir -p "$(THIRD_PARTY_DIR)/cosmos_tmp" && \ + cd "$(THIRD_PARTY_DIR)/cosmos_tmp" && \ + git init && \ + git remote add origin "https://github.com/cosmos/cosmos-sdk.git" && \ + git config core.sparseCheckout true && \ + printf "proto\nthird_party\n" > .git/info/sparse-checkout && \ + git pull origin main && \ + rm -f ./proto/buf.* && \ + mv ./proto/* .. + rm -rf "$(THIRD_PARTY_DIR)/cosmos_tmp" + + mkdir -p "$(THIRD_PARTY_DIR)/ibc_tmp" && \ + cd "$(THIRD_PARTY_DIR)/ibc_tmp" && \ + git init && \ + git remote add origin "https://github.com/cosmos/ibc-go.git" && \ + git config core.sparseCheckout true && \ + printf "proto\n" > .git/info/sparse-checkout && \ + git pull origin main && \ + rm -f ./proto/buf.* && \ + mv ./proto/* .. + rm -rf "$(THIRD_PARTY_DIR)/ibc_tmp" + + mkdir -p "$(THIRD_PARTY_DIR)/cosmos_proto_tmp" && \ + cd "$(THIRD_PARTY_DIR)/cosmos_proto_tmp" && \ + git init && \ + git remote add origin "https://github.com/cosmos/cosmos-proto.git" && \ + git config core.sparseCheckout true && \ + printf "proto\n" > .git/info/sparse-checkout && \ + git pull origin main && \ + rm -f ./proto/buf.* && \ + mv ./proto/* .. + rm -rf "$(THIRD_PARTY_DIR)/cosmos_proto_tmp" + + mkdir -p "$(THIRD_PARTY_DIR)/gogoproto" && \ + curl -SSL https://raw.githubusercontent.com/cosmos/gogoproto/main/gogoproto/gogo.proto > "$(THIRD_PARTY_DIR)/gogoproto/gogo.proto" + + mkdir -p "$(THIRD_PARTY_DIR)/google/api" && \ + curl -sSL https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/annotations.proto > "$(THIRD_PARTY_DIR)/google/api/annotations.proto" + curl -sSL https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/http.proto > "$(THIRD_PARTY_DIR)/google/api/http.proto" + + mkdir -p "$(THIRD_PARTY_DIR)/cosmos/ics23/v1" && \ + curl -sSL https://raw.githubusercontent.com/cosmos/ics23/master/proto/cosmos/ics23/v1/proofs.proto > "$(THIRD_PARTY_DIR)/cosmos/ics23/v1/proofs.proto" + +proto-docs: + @echo + @echo "=========== Generate Message ============" + @echo + @make proto-download-deps + ./scripts/generate-docs.sh + + statik -src=client/docs/static -dest=client/docs -f -m + @if [ -n "$(git status --porcelain)" ]; then \ + echo "\033[91mSwagger docs are out of sync!!!\033[0m";\ + exit 1;\ + else \ + echo "\033[92mSwagger docs are in sync\033[0m";\ + fi + @echo + @echo "=========== Generate Complete ============" + @echo diff --git a/scripts/makefiles/test.mk b/scripts/makefiles/test.mk new file mode 100644 index 000000000..c013367f6 --- /dev/null +++ b/scripts/makefiles/test.mk @@ -0,0 +1,62 @@ +############################################################################### +### Tests ### +############################################################################### + +PACKAGES_UNIT=$(shell go list ./... ) +PACKAGES_E2E=$(shell go list ./... | grep '/tests/e2e') +PACKAGES_SIM=$(shell go list ./... ) +TEST_PACKAGES=./... +SIMAPP = ./app + +SIM_NUM_BLOCKS ?= 500 +SIM_BLOCK_SIZE ?= 200 +SIM_COMMIT ?= true + +test-help: + @echo "test subcommands" + @echo "" + @echo "Usage:" + @echo " make test-[command]" + @echo "" + @echo "Available Commands:" + @echo " all Run all tests" + @echo " benchmark Run benchmark tests" + @echo " cover Run coverage tests" + @echo " race Run race tests" + @echo " sim-app Run sim app tests" + @echo " sim-bench Run sim benchmark tests" + @echo " sim-determinism Run sim determinism tests" + @echo " sim-suite Run sim suite tests" + @echo " unit Run unit tests" + +test: test-help + +test-all: test-unit test-race test-sim-app + +test-unit: + @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock norace' $(PACKAGES_UNIT) + +test-race: + @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' $(PACKAGES_UNIT) + +test-cover: + @VERSION=$(VERSION) go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic $(PACKAGES_UNIT) + +test-sim-suite: + @VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_SIM) + +test-sim-app: + @VERSION=$(VERSION) go test -mod=readonly -run ^TestFullAppSimulation -v $(PACKAGES_SIM) + +test-sim-determinism: + @VERSION=$(VERSION) go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \ + -NumBlocks=100 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h + +test-sim-benchmark: + @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" + @VERSION=$(VERSION) go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h + +test-sim-profile: + @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" + @@VERSION=$(VERSION) go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \ + -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h -cpuprofile cpu.out -memprofile mem.out diff --git a/scripts/migrate_primitives.sh b/scripts/migrate_primitives.sh index 55c025c60..2dbb5af17 100755 --- a/scripts/migrate_primitives.sh +++ b/scripts/migrate_primitives.sh @@ -19,6 +19,6 @@ CONFIG3='{"lock_period":300,"pool_id":3,"pool_denom":"gamm/pool/3","base_denom": PRIM1="quasar1qum2tr7hh4y7ruzew68c64myjec0dq2s2njf6waja5t0w879lutqtvz03d" PRIM2="quasar1tqwwyth34550lg2437m05mjnjp8w7h5ka7m70jtzpxn4uh2ktsmqqthn5d" PRIM3="quasar1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfsah6jpz" -quasarnoded tx wasm migrate $PRIM1 $PRIM_CODE_ID "{\"config\": $CONFIG1}" --from test-laurens --keyring-backend test -b block $TXFLAG -quasarnoded tx wasm migrate $PRIM2 $PRIM_CODE_ID "{\"config\": $CONFIG2}" --from test-laurens --keyring-backend test -b block $TXFLAG -quasarnoded tx wasm migrate $PRIM3 $PRIM_CODE_ID "{\"config\": $CONFIG3}" --from test-laurens --keyring-backend test -b block $TXFLAG +quasard tx wasm migrate $PRIM1 $PRIM_CODE_ID "{\"config\": $CONFIG1}" --from test-laurens --keyring-backend test -b block $TXFLAG +quasard tx wasm migrate $PRIM2 $PRIM_CODE_ID "{\"config\": $CONFIG2}" --from test-laurens --keyring-backend test -b block $TXFLAG +quasard tx wasm migrate $PRIM3 $PRIM_CODE_ID "{\"config\": $CONFIG3}" --from test-laurens --keyring-backend test -b block $TXFLAG diff --git a/scripts/migrate_vault.sh b/scripts/migrate_vault.sh index 557f5398f..6574cd547 100755 --- a/scripts/migrate_vault.sh +++ b/scripts/migrate_vault.sh @@ -8,4 +8,4 @@ NODE="--node $RPC" TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" VAULT_ADDR="quasar1xt4ahzz2x8hpkc0tk6ekte9x6crw4w6u0r67cyt3kz9syh24pd7slqr7s5" -quasarnoded tx wasm migrate $VAULT_ADDR 5 '{}' --from test-laurens --keyring-backend test $TXFLAG \ No newline at end of file +quasard tx wasm migrate $VAULT_ADDR 5 '{}' --from test-laurens --keyring-backend test $TXFLAG \ No newline at end of file diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index eed40dca1..fbfaeb2d7 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -30,7 +30,9 @@ echo "Copying ..." PWD=$(pwd) echo "PWD is - $PWD" # Copy the generated go files over -cp -r github.com/quasarlabs/quasarnode/* . +cp -r github.com/quasar-finance/quasar/* . cp -r github.com github.com.bkp +rm -r github.com.bkp + diff --git a/scripts/simple_test.sh b/scripts/simple_test.sh index 3e103fbc6..9452b0f2b 100644 --- a/scripts/simple_test.sh +++ b/scripts/simple_test.sh @@ -11,30 +11,30 @@ TRACE="" # remove existing daemon rm -rf ~/.quasarnode* -quasarnoded config keyring-backend $KEYRING -quasarnoded config chain-id $CHAINID +quasard config keyring-backend $KEYRING +quasard config chain-id $CHAINID # if $KEY exists it should be deleted -quasarnoded keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO +quasard keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO # Set moniker and chain-id for cosmic-ether (Moniker can be anything, chain-id must be str-int) -quasarnoded init $MONIKER --chain-id $CHAINID +quasard init $MONIKER --chain-id $CHAINID # Allocate genesis accounts (cosmos formatted addresses) -quasarnoded add-genesis-account $KEY 100000000000000000000000000stake --keyring-backend $KEYRING +quasard add-genesis-account $KEY 100000000000000000000000000stake --keyring-backend $KEYRING # Sign genesis transaction -quasarnoded gentx $KEY 1000000000000000000000stake --keyring-backend $KEYRING --chain-id $CHAINID +quasard gentx $KEY 1000000000000000000000stake --keyring-backend $KEYRING --chain-id $CHAINID # Collect genesis tx -quasarnoded collect-gentxs +quasard collect-gentxs # Run this to ensure everything worked and that the genesis file is setup correctly -quasarnoded validate-genesis +quasard validate-genesis if [[ $1 == "pending" ]]; then echo "pending mode is on, please wait for the first block committed." fi # Start the node (remove the --pruning=nothing flag if historical queries are not needed) -quasarnoded start --pruning=nothing \ No newline at end of file +quasard start --pruning=nothing \ No newline at end of file diff --git a/smart-contracts/contracts/ica/create_and_execute.sh b/smart-contracts/contracts/ica/create_and_execute.sh new file mode 100755 index 000000000..e69de29bb diff --git a/smart-contracts/contracts/intergamm-bindings-test/README.md b/smart-contracts/contracts/intergamm-bindings-test/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/smart-contracts/osmosis/contracts/README.md b/smart-contracts/osmosis/contracts/README.md index c1bd74377..e6350d1d5 100644 --- a/smart-contracts/osmosis/contracts/README.md +++ b/smart-contracts/osmosis/contracts/README.md @@ -4,7 +4,7 @@ A Quasar vault is a smart contract to receive Cosmos native tokens The packages directory provides packages for strategists to ease development ## Building the CLI -These smart contracts are build on the Quasar chain. Using ``` go install -mod=readonly ./cmd/quasarnoded/``` from the quasar root directory. we build de quasarnoded CLI +These smart contracts are build on the Quasar chain. Using ``` go install -mod=readonly ./cmd/quasard/``` from the quasar root directory. we build de quasard CLI ## Running the chain locally These smart contracts are build on the Quasar chain, thus we also want to run the chain. ``` @@ -29,11 +29,11 @@ We need to use the workspace optimizer because we have a separate directory wher Now that we have our CLI, a running chain and our compiled contract, we can now upload the contract and instantiate it. to upload the contract: ``` -quasarnoded tx wasm store ./artifacts/cw_4626.wasm --from alice --gas auto +quasard tx wasm store ./artifacts/cw_4626.wasm --from alice --gas auto ``` check that it's uploaded: ``` -quasarnoded query wasm list-code --node http://0.0.0.0:26657 +quasard query wasm list-code --node http://0.0.0.0:26657 ``` now to instantiate it, we first create the instantaite message and safe that into an env var for later user: @@ -42,7 +42,7 @@ INSTANTIATE='{"name":"test-vault","symbol":"TEV","reserve_denom":"uqsar","reserv ``` For easy editing, the instantion of the vault can also be found in `readme_instantion.json` ``` -quasarnoded tx wasm instantiate 1 "$INSTANTIATE" --label test --no-admin --from alice +quasard tx wasm instantiate 1 "$INSTANTIATE" --label test --no-admin --from alice ``` ## Interacting with the contract @@ -51,7 +51,7 @@ Now lets deposit some funds: EXECUTE='{"deposit":{}}' ``` ``` - quasarnoded tx wasm execute YOUR_CONTRACT_ADDRESS "$EXECUTE" --amount 1000uatom --from alice + quasard tx wasm execute YOUR_CONTRACT_ADDRESS "$EXECUTE" --amount 1000uatom --from alice ``` diff --git a/smart-contracts/osmosis/contracts/token-burner/README.md b/smart-contracts/osmosis/contracts/token-burner/README.md index 048e13984..a19482402 100644 --- a/smart-contracts/osmosis/contracts/token-burner/README.md +++ b/smart-contracts/osmosis/contracts/token-burner/README.md @@ -38,17 +38,17 @@ Here's an example of how to interact with the Burn Coins Contract: 1. **Instantiate the Contract**: ``` - quasarnoded tx wasm instantiate "" --from --keyring-backend --label "burn coins contract" --gas auto --fees -b block -y --admin + quasard tx wasm instantiate "" --from --keyring-backend --label "burn coins contract" --gas auto --fees -b block -y --admin ``` 2. **Execute Coin Burning**: ``` - quasarnoded tx wasm execute '{"burn":{}}' -y --from --keyring-backend --gas auto --fees --chain-id --amount + quasard tx wasm execute '{"burn":{}}' -y --from --keyring-backend --gas auto --fees --chain-id --amount ``` 3. **Query Total Burnt Amount**: ``` - # quasarnoded query wasm contract-state smart '{"total_burnt_query":{}}' --output json + # quasard query wasm contract-state smart '{"total_burnt_query":{}}' --output json ``` ## Considerations diff --git a/tests/docker/bootstrap-scripts/quasar_localnet.sh b/tests/docker/bootstrap-scripts/quasar_localnet.sh index 2ed1cab66..a0c392e41 100755 --- a/tests/docker/bootstrap-scripts/quasar_localnet.sh +++ b/tests/docker/bootstrap-scripts/quasar_localnet.sh @@ -5,7 +5,7 @@ # Configure variables -BINARY=quasarnoded +BINARY=quasard HOME_QSR=$HOME/.quasarnode CHAIN_ID=quasar ALICE="edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit" diff --git a/tests/docker/docker-compose.yml b/tests/docker/docker-compose.yml index 1243c70b0..0cc390953 100644 --- a/tests/docker/docker-compose.yml +++ b/tests/docker/docker-compose.yml @@ -13,7 +13,7 @@ services: - "1317:1317" - "26657:26657" - "9090:9090" - command: "quasarnoded start >> ./logs/quasar_quasar.log 2>&1" + command: "quasard start >> ./logs/quasar_quasar.log 2>&1" osmosis: build: diff --git a/tests/e2e/Makefile b/tests/e2e/Makefile index 3c7347b18..fed8947b6 100644 --- a/tests/e2e/Makefile +++ b/tests/e2e/Makefile @@ -1,8 +1,20 @@ +e2e-help: + @echo "e2e subcommands" + @echo "" + @echo "Usage:" + @echo " make e2e-[command]" + @echo "" + @echo "Available Commands:" + @echo " test Run tests in the specified folders serially, if CASES is defined; otherwise, run all." + @echo " test-parallel Run tests in the specified folders in parallel, if CASES is defined; otherwise, run all." + +e2e: e2e-help + # Find all folders inside ./cases, excluding ones that start with an underscore -TEST_FOLDERS=$(shell find ./cases -mindepth 1 -maxdepth 1 -type d \( -name "[!_]*" \)) +TEST_FOLDERS=$(shell find ./tests/e2e/cases -mindepth 1 -maxdepth 1 -type d \( -name "[!_]*" \)) # Run tests in the specified folders serially, if CASES is defined; otherwise, run all. -test-e2e: +e2e-test: ifdef CASES # Loop through each folder specified in CASES and run the tests @for folder in $(filter $(CASES), $(TEST_FOLDERS)); do \ @@ -18,7 +30,7 @@ else endif # Run tests in the specified folders in parallel, if CASES is defined; otherwise, run all. -test-e2e-parallel: +e2e-test-parallel: ifdef CASES @for folder in $(filter $(CASES), $(TEST_FOLDERS)); do \ echo "\nRunning tests in directory: $$folder"; \ diff --git a/tests/e2e/cases/_helpers/ibc.go b/tests/e2e/cases/_helpers/ibc.go index 8615674a6..0f36ad80e 100644 --- a/tests/e2e/cases/_helpers/ibc.go +++ b/tests/e2e/cases/_helpers/ibc.go @@ -1,8 +1,8 @@ package helpers import ( - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) // IbcDenomFromChannel returns ibc denom according to the given channel port, id and denom diff --git a/tests/e2e/cases/osmosis_gauge/osmosis_gauge_test.go b/tests/e2e/cases/osmosis_gauge/osmosis_gauge_test.go index 60083c036..f876184ae 100644 --- a/tests/e2e/cases/osmosis_gauge/osmosis_gauge_test.go +++ b/tests/e2e/cases/osmosis_gauge/osmosis_gauge_test.go @@ -3,17 +3,16 @@ package osmosis_gauge import ( "context" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/quasarlabs/quasarnode/tests/e2e/cases/_helpers" - "github.com/strangelove-ventures/interchaintest/v4/ibc" "os" "strconv" "testing" "time" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - testsuite "github.com/quasarlabs/quasarnode/tests/e2e/suite" + sdk "github.com/cosmos/cosmos-sdk/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + testsuite "github.com/quasar-finance/quasar/tests/e2e/suite" + "github.com/strangelove-ventures/interchaintest/v4/ibc" "github.com/strangelove-ventures/interchaintest/v4/testutil" "github.com/stretchr/testify/suite" ) diff --git a/tests/e2e/cases/qtransfer/qtransfer_helpers_test.go b/tests/e2e/cases/qtransfer/qtransfer_helpers_test.go index f26a861f6..d5e2a10ea 100644 --- a/tests/e2e/cases/qtransfer/qtransfer_helpers_test.go +++ b/tests/e2e/cases/qtransfer/qtransfer_helpers_test.go @@ -3,10 +3,10 @@ package qtransfer import ( "context" "fmt" - testsuite "github.com/quasarlabs/quasarnode/tests/e2e/suite" "os" sdk "github.com/cosmos/cosmos-sdk/types" + testsuite "github.com/quasar-finance/quasar/tests/e2e/suite" "github.com/strangelove-ventures/interchaintest/v4/ibc" ) diff --git a/tests/e2e/cases/qtransfer/qtransfer_test.go b/tests/e2e/cases/qtransfer/qtransfer_test.go index 05dcf8933..9eda77f60 100644 --- a/tests/e2e/cases/qtransfer/qtransfer_test.go +++ b/tests/e2e/cases/qtransfer/qtransfer_test.go @@ -3,15 +3,14 @@ package qtransfer import ( "context" "encoding/json" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/quasarlabs/quasarnode/tests/e2e/cases/_helpers" - "github.com/strangelove-ventures/interchaintest/v4/ibc" "strconv" "testing" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - testsuite "github.com/quasarlabs/quasarnode/tests/e2e/suite" + sdk "github.com/cosmos/cosmos-sdk/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + testsuite "github.com/quasar-finance/quasar/tests/e2e/suite" + "github.com/strangelove-ventures/interchaintest/v4/ibc" "github.com/strangelove-ventures/interchaintest/v4/testutil" "github.com/stretchr/testify/suite" ) diff --git a/tests/e2e/cases/wasmd_deposit/wasmd_helpers_test.go b/tests/e2e/cases/wasmd_deposit/wasmd_helpers_test.go index df04930ed..872a31748 100644 --- a/tests/e2e/cases/wasmd_deposit/wasmd_helpers_test.go +++ b/tests/e2e/cases/wasmd_deposit/wasmd_helpers_test.go @@ -3,10 +3,10 @@ package wasmd_deposit import ( "context" "fmt" - testsuite "github.com/quasarlabs/quasarnode/tests/e2e/suite" "os" sdk "github.com/cosmos/cosmos-sdk/types" + testsuite "github.com/quasar-finance/quasar/tests/e2e/suite" "github.com/strangelove-ventures/interchaintest/v4/ibc" ) diff --git a/tests/e2e/cases/wasmd_deposit/wasmd_strategy_lp_deposit_test.go b/tests/e2e/cases/wasmd_deposit/wasmd_strategy_lp_deposit_test.go index 3b371e51e..7b3fc8e7d 100644 --- a/tests/e2e/cases/wasmd_deposit/wasmd_strategy_lp_deposit_test.go +++ b/tests/e2e/cases/wasmd_deposit/wasmd_strategy_lp_deposit_test.go @@ -6,12 +6,11 @@ import ( "strconv" "testing" - helpers "github.com/quasarlabs/quasarnode/tests/e2e/cases/_helpers" - sdk "github.com/cosmos/cosmos-sdk/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - testsuite "github.com/quasarlabs/quasarnode/tests/e2e/suite" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + helpers "github.com/quasar-finance/quasar/tests/e2e/cases/_helpers" + testsuite "github.com/quasar-finance/quasar/tests/e2e/suite" "github.com/strangelove-ventures/interchaintest/v4/ibc" "github.com/strangelove-ventures/interchaintest/v4/testutil" "github.com/stretchr/testify/suite" diff --git a/tests/e2e/cases/wasmd_retry/wasmd_helpers_test.go b/tests/e2e/cases/wasmd_retry/wasmd_helpers_test.go index 4170cef3a..c6d4692ec 100644 --- a/tests/e2e/cases/wasmd_retry/wasmd_helpers_test.go +++ b/tests/e2e/cases/wasmd_retry/wasmd_helpers_test.go @@ -3,10 +3,10 @@ package wasmd_deposit import ( "context" "fmt" - testsuite "github.com/quasarlabs/quasarnode/tests/e2e/suite" "os" sdk "github.com/cosmos/cosmos-sdk/types" + testsuite "github.com/quasar-finance/quasar/tests/e2e/suite" "github.com/strangelove-ventures/interchaintest/v4/ibc" ) diff --git a/tests/e2e/cases/wasmd_retry/wasmd_strategy_lp_retry_test.go b/tests/e2e/cases/wasmd_retry/wasmd_strategy_lp_retry_test.go index 941c244a0..0281d90f8 100644 --- a/tests/e2e/cases/wasmd_retry/wasmd_strategy_lp_retry_test.go +++ b/tests/e2e/cases/wasmd_retry/wasmd_strategy_lp_retry_test.go @@ -3,14 +3,13 @@ package wasmd_deposit import ( "context" "encoding/json" - "github.com/quasarlabs/quasarnode/tests/e2e/cases/_helpers" "strconv" "testing" sdk "github.com/cosmos/cosmos-sdk/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - testsuite "github.com/quasarlabs/quasarnode/tests/e2e/suite" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + testsuite "github.com/quasar-finance/quasar/tests/e2e/suite" "github.com/strangelove-ventures/interchaintest/v4/ibc" "github.com/strangelove-ventures/interchaintest/v4/testutil" "github.com/stretchr/testify/suite" diff --git a/tests/e2e/dockerfiles/osmosis.Dockerfile b/tests/e2e/dockerfiles/osmosis.Dockerfile index 92a953a08..bd57b4c58 100644 --- a/tests/e2e/dockerfiles/osmosis.Dockerfile +++ b/tests/e2e/dockerfiles/osmosis.Dockerfile @@ -34,7 +34,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ go mod download # Cosmwasm - Download correct libwasmvm version -RUN export WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | awk '{print $NF}') && \ +RUN export WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | awk '{print $NF}') && \ wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \ -O /lib/libwasmvm_muslc.a # && \ diff --git a/tests/e2e/dockerfiles/quasar.Dockerfile b/tests/e2e/dockerfiles/quasar.Dockerfile index 237a98f12..54092f920 100644 --- a/tests/e2e/dockerfiles/quasar.Dockerfile +++ b/tests/e2e/dockerfiles/quasar.Dockerfile @@ -25,7 +25,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ go mod download # Cosmwasm - Download correct libwasmvm version -RUN export WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | awk '{print $NF}') && \ +RUN export WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | awk '{print $NF}') && \ wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \ -O /lib/libwasmvm_muslc.a && \ # verify checksum @@ -35,9 +35,9 @@ RUN export WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | awk '{print # Copy the remaining files COPY . . -# Build quasarnoded binary +# Build quasard binary # force it to use static lib (from above) not standard libgo_cosmwasm.so file -# then log output of file /quasar/build/quasarnoded +# then log output of file /quasar/build/quasard # then ensure static linking RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/root/go/pkg/mod \ @@ -46,13 +46,13 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ -tags "netgo,ledger,muslc" \ -ldflags \ "-X github.com/cosmos/cosmos-sdk/version.Name="quasar" \ - -X github.com/cosmos/cosmos-sdk/version.AppName="quasarnoded" \ + -X github.com/cosmos/cosmos-sdk/version.AppName="quasard" \ -X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \ -X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \ -X github.com/cosmos/cosmos-sdk/version.BuildTags='netgo,ledger,muslc' \ -w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \ -trimpath \ - -o build/quasarnoded ./cmd/quasarnoded + -o build/quasard ./cmd/quasard # -------------------------------------------------------- @@ -65,7 +65,7 @@ ENV PACKAGES bash RUN apk add --no-cache $PACKAGES -COPY --from=builder /quasar/build/quasarnoded /bin/quasarnoded +COPY --from=builder /quasar/build/quasard /bin/quasard ENV HOME /quasar WORKDIR $HOME diff --git a/tests/e2e/go.mod b/tests/e2e/go.mod index 05ee7a159..0c1894bec 100644 --- a/tests/e2e/go.mod +++ b/tests/e2e/go.mod @@ -1,11 +1,11 @@ -module github.com/quasarlabs/quasarnode/tests/e2e +module github.com/quasar-finance/quasar/tests/e2e go 1.19 require ( github.com/CosmWasm/wasmd v0.31.0 - github.com/cosmos/cosmos-sdk v0.46.10 - github.com/cosmos/ibc-go/v4 v4.3.0 + github.com/cosmos/cosmos-sdk v0.50.8 + github.com/cosmos/ibc-go/v8 v8.3.0 github.com/docker/docker v20.10.19+incompatible github.com/docker/go-connections v0.4.0 github.com/gogo/protobuf v1.3.3 diff --git a/tests/e2e/suite/chains.go b/tests/e2e/suite/chains.go index a0a64f1c1..c5db6fff9 100644 --- a/tests/e2e/suite/chains.go +++ b/tests/e2e/suite/chains.go @@ -15,7 +15,7 @@ var ( Version: "local", }, }, - Bin: "quasarnoded", + Bin: "quasard", Bech32Prefix: "quasar", CoinType: "118", Denom: "uqsr", diff --git a/tests/e2e/suite/grpc_query.go b/tests/e2e/suite/grpc_query.go index ad2e886be..f7ee01ffd 100644 --- a/tests/e2e/suite/grpc_query.go +++ b/tests/e2e/suite/grpc_query.go @@ -6,9 +6,9 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v4/ibc" "google.golang.org/grpc" diff --git a/tests/e2e/suite/proposal.go b/tests/e2e/suite/proposal.go index 112604836..09faa3ecc 100644 --- a/tests/e2e/suite/proposal.go +++ b/tests/e2e/suite/proposal.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramsutils "github.com/cosmos/cosmos-sdk/x/params/client/utils" - "github.com/quasarlabs/quasarnode/tests/e2e/dockerutil" + "github.com/quasar-finance/quasar/tests/e2e/dockerutil" "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" "go.uber.org/zap" ) diff --git a/tests/e2e/suite/suite.go b/tests/e2e/suite/suite.go index dcc98fe7f..c68b16973 100644 --- a/tests/e2e/suite/suite.go +++ b/tests/e2e/suite/suite.go @@ -6,8 +6,8 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - ibctenderminttypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + ibctenderminttypes "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/types" dockerclient "github.com/docker/docker/client" "github.com/gogo/protobuf/proto" "github.com/pkg/errors" diff --git a/tests/e2e/suite/wasm.go b/tests/e2e/suite/wasm.go index 25ad94dad..6de53431c 100644 --- a/tests/e2e/suite/wasm.go +++ b/tests/e2e/suite/wasm.go @@ -9,7 +9,7 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/quasarlabs/quasarnode/tests/e2e/dockerutil" + "github.com/quasar-finance/quasar/tests/e2e/dockerutil" "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v4/ibc" "go.uber.org/zap" diff --git a/tests/shell/create_and_execute_contract.sh b/tests/shell/create_and_execute_contract.sh index 7d5796549..80267cccc 100755 --- a/tests/shell/create_and_execute_contract.sh +++ b/tests/shell/create_and_execute_contract.sh @@ -5,14 +5,14 @@ set -e on_error() { echo "Some error occurred" - quasarnoded q wasm contract-state smart $ADDR1 '{"trapped_errors":{}}' + quasard q wasm contract-state smart $ADDR1 '{"trapped_errors":{}}' # afplay /System/Library/Sounds/Sosumi.aiff } trap 'on_error' ERR -BINARY="docker exec localenv-quasar-1 quasarnoded" +BINARY="docker exec localenv-quasar-1 quasard" CHAIN_ID="quasar" TESTNET_NAME="quasar" diff --git a/testutil/keeper/common.go b/testutil/keeper/common.go index a0e181965..c10c5cfec 100644 --- a/testutil/keeper/common.go +++ b/testutil/keeper/common.go @@ -1,14 +1,14 @@ package keeper import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/runtime" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -16,6 +16,8 @@ import ( paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" ) const ( @@ -23,8 +25,8 @@ const ( ) func (kf KeeperFactory) ParamsKeeper() paramskeeper.Keeper { - storeKey := sdk.NewKVStoreKey(paramstypes.StoreKey) - transientStoreKey := sdk.NewTransientStoreKey(paramstypes.TStoreKey) + storeKey := storetypes.NewKVStoreKey(paramstypes.StoreKey) + transientStoreKey := storetypes.NewTransientStoreKey(paramstypes.TStoreKey) kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) kf.StateStore.MountStoreWithDB(transientStoreKey, storetypes.StoreTypeTransient, kf.DB) @@ -34,14 +36,15 @@ func (kf KeeperFactory) ParamsKeeper() paramskeeper.Keeper { } func (kf KeeperFactory) AccountKeeper(paramsKeeper paramskeeper.Keeper, maccPerms map[string][]string) authkeeper.AccountKeeper { - storeKey := sdk.NewKVStoreKey(authtypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(authtypes.StoreKey) kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) accountKeeper := authkeeper.NewAccountKeeper( kf.EncodingConfig.Marshaler, - storeKey, + runtime.NewKVStoreService(storeKey), authtypes.ProtoBaseAccount, maccPerms, + address.NewBech32Codec(AccountAddressPrefix), AccountAddressPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -50,22 +53,23 @@ func (kf KeeperFactory) AccountKeeper(paramsKeeper paramskeeper.Keeper, maccPerm } func (kf KeeperFactory) BankKeeper(paramsKeeper paramskeeper.Keeper, accountKeeper authkeeper.AccountKeeper, blockedMaccAddresses map[string]bool) bankkeeper.Keeper { - storeKey := sdk.NewKVStoreKey(banktypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(banktypes.StoreKey) kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) bankKeeper := bankkeeper.NewBaseKeeper( kf.EncodingConfig.Marshaler, - storeKey, + runtime.NewKVStoreService(storeKey), accountKeeper, blockedMaccAddresses, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + log.NewNopLogger(), ) return bankKeeper } func (kf KeeperFactory) CapabilityKeeper() capabilitykeeper.Keeper { - storeKey := sdk.NewKVStoreKey(capabilitytypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(capabilitytypes.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(capabilitytypes.MemStoreKey) kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) kf.StateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) @@ -81,15 +85,19 @@ func (kf KeeperFactory) StakingKeeper( accountKeeper authkeeper.AccountKeeper, bankKeeper bankkeeper.Keeper, ) stakingkeeper.Keeper { - storeKey := sdk.NewKVStoreKey(stakingtypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(stakingtypes.StoreKey) kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) + storeService := runtime.NewKVStoreService(storeKey) + stakingKeeper := stakingkeeper.NewKeeper( kf.EncodingConfig.Marshaler, - storeKey, + storeService, accountKeeper, bankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + address.NewBech32Codec("cosmosvaloper"), + address.NewBech32Codec("cosmosvalcons"), ) return *stakingKeeper @@ -102,12 +110,12 @@ func (kf KeeperFactory) DistributionKeeper( feeCollectorName string, ) distrkeeper.Keeper { - storeKey := sdk.NewKVStoreKey(distrtypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(distrtypes.StoreKey) kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) disrKeeper := distrkeeper.NewKeeper( kf.EncodingConfig.Marshaler, - storeKey, + runtime.NewKVStoreService(storeKey), accountKeeper, bankKeeper, stakingKeeper, diff --git a/testutil/keeper/epochs.go b/testutil/keeper/epochs.go index 604d37981..73faa46c4 100644 --- a/testutil/keeper/epochs.go +++ b/testutil/keeper/epochs.go @@ -1,15 +1,14 @@ package keeper import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - "github.com/quasarlabs/quasarnode/x/epochs/keeper" - "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasar-finance/quasar/x/epochs/keeper" + "github.com/quasar-finance/quasar/x/epochs/types" ) func (kf KeeperFactory) EpochsKeeper(paramsKeeper paramskeeper.Keeper) *keeper.Keeper { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) paramsKeeper.Subspace(types.ModuleName) diff --git a/testutil/keeper/factory.go b/testutil/keeper/factory.go index 4b0d1c5fe..747090d4f 100644 --- a/testutil/keeper/factory.go +++ b/testutil/keeper/factory.go @@ -1,26 +1,25 @@ package keeper import ( - tmdb "github.com/cometbft/cometbft-db" - "github.com/cosmos/cosmos-sdk/store" + "cosmossdk.io/store" + dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - "github.com/quasarlabs/quasarnode/app" - "github.com/quasarlabs/quasarnode/app/params" + "github.com/quasar-finance/quasar/app" + "github.com/quasar-finance/quasar/app/params" ) -// Structure holding storage context for initializing test keepers +// KeeperFactory Structure holding storage context for initializing test keepers. type KeeperFactory struct { - DB *tmdb.MemDB + DB *dbm.MemDB StateStore store.CommitMultiStore Ctx sdk.Context EncodingConfig params.EncodingConfig } -// Create an KeeperFactory with in memory database and default codecs +// NewKeeperFactory Creates with in memory database and default codecs. func NewKeeperFactory( - db *tmdb.MemDB, + db *dbm.MemDB, stateStore store.CommitMultiStore, ctx sdk.Context, encodingConfig params.EncodingConfig, @@ -33,14 +32,13 @@ func NewKeeperFactory( } } -// TestModuleAccountPerms returns module account permissions for testing +// TestModuleAccountPerms returns module account permissions for testing. func (kf KeeperFactory) TestModuleAccountPerms() map[string][]string { - moduleAccPerms := app.GetMaccPerms() - // moduleAccPerms[oriontypes.CreateOrionRewardGloablMaccName()] = []string{authtypes.Minter, authtypes.Burner, authtypes.Staking} + moduleAccPerms := app.ModuleAccountPermissions return moduleAccPerms } -// BlockedModuleAccountAddrs returns all the app's module account addresses that are active +// BlockedModuleAccountAddrs returns all the app's module account addresses that are active. func (kf KeeperFactory) BlockedModuleAccountAddrs(maccPerms map[string][]string) map[string]bool { modAccAddrs := make(map[string]bool) for acc := range maccPerms { diff --git a/testutil/keeper/qoracle.go b/testutil/keeper/qoracle.go deleted file mode 100644 index 5e7eb726c..000000000 --- a/testutil/keeper/qoracle.go +++ /dev/null @@ -1,75 +0,0 @@ -package keeper - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - - "github.com/quasarlabs/quasarnode/x/qoracle/keeper" - qosmokeeper "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/keeper" - qosmotypes "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -func (kf KeeperFactory) QosmosisKeeper( - paramsKeeper paramskeeper.Keeper, - authority string, - clientKeeper types.ClientKeeper, - ics4Wrapper porttypes.ICS4Wrapper, - channelKeeper types.ChannelKeeper, - portKeeper types.PortKeeper, - scopedKeeper capabilitykeeper.ScopedKeeper, - qoracleKeeper qosmotypes.QOracle, -) qosmokeeper.Keeper { - storeKey := sdk.NewKVStoreKey(qosmotypes.StoreKey) - - kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) - - paramsSubspace := paramsKeeper.Subspace(qosmotypes.SubModuleName) - k := qosmokeeper.NewKeeper( - kf.EncodingConfig.Marshaler, - storeKey, - paramsSubspace, - authority, - clientKeeper, - ics4Wrapper, - channelKeeper, - portKeeper, - scopedKeeper, - qoracleKeeper, - ) - - return k -} - -func (kf KeeperFactory) SetQosmosisDefaultParams(k qosmokeeper.Keeper) { - k.SetParams(kf.Ctx, qosmotypes.DefaultParams()) -} - -func (kf KeeperFactory) QoracleKeeper(paramsKeeper paramskeeper.Keeper, authority string) keeper.Keeper { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - memKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - tKey := sdk.NewTransientStoreKey(types.TStoreKey) - - kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) - kf.StateStore.MountStoreWithDB(memKey, storetypes.StoreTypeMemory, kf.DB) - kf.StateStore.MountStoreWithDB(tKey, storetypes.StoreTypeTransient, kf.DB) - - paramsSubspace := paramsKeeper.Subspace(types.ModuleName) - k := keeper.NewKeeper( - kf.EncodingConfig.Marshaler, - storeKey, - memKey, - tKey, - paramsSubspace, - authority, - ) - - return k -} - -func (kf KeeperFactory) SetQoracleDefaultParams(k keeper.Keeper) { - k.SetParams(kf.Ctx, types.DefaultParams()) -} diff --git a/testutil/keeper/qtransfer.go b/testutil/keeper/qtransfer.go deleted file mode 100644 index 5854a312f..000000000 --- a/testutil/keeper/qtransfer.go +++ /dev/null @@ -1,31 +0,0 @@ -package keeper - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - - "github.com/quasarlabs/quasarnode/x/qtransfer/keeper" - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -func (kf KeeperFactory) QTransferKeeper(paramsKeeper paramskeeper.Keeper, accountKeeper authkeeper.AccountKeeper) keeper.Keeper { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - - kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) - - paramsSubspace := paramsKeeper.Subspace(types.ModuleName) - k := keeper.NewKeeper( - kf.EncodingConfig.Marshaler, - storeKey, - paramsSubspace, - accountKeeper, - ) - - return k -} - -func (kf KeeperFactory) SetQTransferDefaultParams(k keeper.Keeper) { - k.SetParams(kf.Ctx, types.DefaultParams()) -} diff --git a/testutil/keeper/qvesting.go b/testutil/keeper/qvesting.go deleted file mode 100644 index 64bd2ae15..000000000 --- a/testutil/keeper/qvesting.go +++ /dev/null @@ -1,99 +0,0 @@ -package keeper - -import ( - "testing" - - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/x/qvesting/keeper" - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -func QVestingKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) - - registry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(registry) - - paramsSubspace := typesparams.NewSubspace(cdc, - types.Amino, - storeKey, - memStoreKey, - "QVestingParams", - ) - k := keeper.NewKeeper( - cdc, - storeKey, - memStoreKey, - paramsSubspace, - nil, - nil, - ) - - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - - // Initialize params - k.SetParams(ctx, types.DefaultParams()) - - return k, ctx -} - -func (kf KeeperFactory) QVestingKeeper(paramsKeeper paramskeeper.Keeper, accountKeeper authkeeper.AccountKeeper, - bankKeeper bankkeeper.Keeper) keeper.Keeper { - - storeKey := sdk.NewKVStoreKey(types.StoreKey) - kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) - - //storeKey := sdk.NewKVStoreKey(types.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) - - //db := tmdb.NewMemDB() - //stateStore := store.NewCommitMultiStore(db) - //stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - //stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) - //require.NoError(t, stateStore.LoadLatestVersion()) - - registry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(registry) - - //paramsSubspace := typesparams.NewSubspace(cdc, - // types.Amino, - // storeKey, - // memStoreKey, - // "QVestingParams", - //) - paramsSubspace := paramsKeeper.Subspace(types.ModuleName) - - k := keeper.NewKeeper( - cdc, - storeKey, - memStoreKey, - paramsSubspace, - accountKeeper, - bankKeeper, - ) - - // Initialize params - // k.SetParams(ctx, types.DefaultParams()) - - return *k -} diff --git a/testutil/keeper/tfkeeper.go b/testutil/keeper/tfkeeper.go index 5198c33c9..cb79d9866 100644 --- a/testutil/keeper/tfkeeper.go +++ b/testutil/keeper/tfkeeper.go @@ -1,29 +1,29 @@ package keeper import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "github.com/quasar-finance/quasar/x/tokenfactory/keeper" + "github.com/quasar-finance/quasar/x/tokenfactory/types" ) func (kf KeeperFactory) TfKeeper(paramsKeeper paramskeeper.Keeper, accountKeeper authkeeper.AccountKeeper, bankKeeper bankkeeper.Keeper, - communityPoolKeeper distrkeeper.Keeper) keeper.Keeper { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + communityPoolKeeper distrkeeper.Keeper, +) keeper.Keeper { + storeKey := storetypes.NewKVStoreKey(types.StoreKey) kf.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, kf.DB) - + paramsSubspace := paramsKeeper.Subspace(types.ModuleName) tfKeeper := keeper.NewKeeper( storeKey, paramsSubspace, + nil, accountKeeper, bankKeeper, communityPoolKeeper) diff --git a/testutil/mock/ibc_channel_mocks.go b/testutil/mock/ibc_channel_mocks.go index 5e8f3abe5..49c1b3afd 100644 --- a/testutil/mock/ibc_channel_mocks.go +++ b/testutil/mock/ibc_channel_mocks.go @@ -8,8 +8,8 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - types0 "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - exported "github.com/cosmos/ibc-go/v7/modules/core/exported" + types0 "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + exported "github.com/cosmos/ibc-go/v8/modules/core/exported" gomock "github.com/golang/mock/gomock" ) diff --git a/testutil/mock/ibc_client_mocks.go b/testutil/mock/ibc_client_mocks.go index c9727f89d..2310fe1e2 100644 --- a/testutil/mock/ibc_client_mocks.go +++ b/testutil/mock/ibc_client_mocks.go @@ -7,9 +7,9 @@ package mock import ( reflect "reflect" - types "github.com/cosmos/cosmos-sdk/store/types" + types "cosmossdk.io/store/types" types0 "github.com/cosmos/cosmos-sdk/types" - exported "github.com/cosmos/ibc-go/v7/modules/core/exported" + exported "github.com/cosmos/ibc-go/v8/modules/core/exported" gomock "github.com/golang/mock/gomock" ) diff --git a/testutil/mock/ibc_connection_mocks.go b/testutil/mock/ibc_connection_mocks.go index 4f54d7f15..b030b7096 100644 --- a/testutil/mock/ibc_connection_mocks.go +++ b/testutil/mock/ibc_connection_mocks.go @@ -8,7 +8,7 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - types0 "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + types0 "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" gomock "github.com/golang/mock/gomock" ) diff --git a/testutil/mock/ibc_mocks.go b/testutil/mock/ibc_mocks.go index 1225eec86..cf98c9b9e 100644 --- a/testutil/mock/ibc_mocks.go +++ b/testutil/mock/ibc_mocks.go @@ -8,8 +8,8 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - types0 "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - types1 "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + types0 "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + types1 "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" gomock "github.com/golang/mock/gomock" bytes "github.com/cometbft/cometbft/libs/bytes" ) diff --git a/testutil/mock/ibc_port_mocks.go b/testutil/mock/ibc_port_mocks.go index 590f00516..432104ab2 100644 --- a/testutil/mock/ibc_port_mocks.go +++ b/testutil/mock/ibc_port_mocks.go @@ -8,7 +8,7 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - types0 "github.com/cosmos/cosmos-sdk/x/capability/types" + types0 "github.com/cosmos/ibc-go/modules/capability/types" gomock "github.com/golang/mock/gomock" ) diff --git a/testutil/mock/ica_mocks.go b/testutil/mock/ica_mocks.go index 75175aab7..cb6d94461 100644 --- a/testutil/mock/ica_mocks.go +++ b/testutil/mock/ica_mocks.go @@ -8,8 +8,8 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - types0 "github.com/cosmos/cosmos-sdk/x/capability/types" - types1 "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + types0 "github.com/cosmos/ibc-go/modules/capability/types" + types1 "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" gomock "github.com/golang/mock/gomock" ) diff --git a/testutil/mock/ics4_wrapper_mocks.go b/testutil/mock/ics4_wrapper_mocks.go index 97fc78fea..2e8d91701 100644 --- a/testutil/mock/ics4_wrapper_mocks.go +++ b/testutil/mock/ics4_wrapper_mocks.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/cosmos/ibc-go/v7/modules/core/05-port/types +// Source: github.com/cosmos/ibc-go/v8/modules/core/05-port/types // Package mock is a generated GoMock package. package mock @@ -8,10 +8,10 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - types0 "github.com/cosmos/cosmos-sdk/x/capability/types" - types1 "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - types2 "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - exported "github.com/cosmos/ibc-go/v7/modules/core/exported" + types0 "github.com/cosmos/ibc-go/modules/capability/types" + types1 "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + types2 "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + exported "github.com/cosmos/ibc-go/v8/modules/core/exported" gomock "github.com/golang/mock/gomock" ) diff --git a/testutil/network/network.go b/testutil/network/network.go index f857228b7..8f6608a9b 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -5,19 +5,18 @@ import ( "testing" "time" - tmdb "github.com/cometbft/cometbft-db" + "cosmossdk.io/store/pruning/types" tmrand "github.com/cometbft/cometbft/libs/rand" + db "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" servertypes "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - "github.com/quasarlabs/quasarnode/app" + "github.com/quasar-finance/quasar/app" ) type ( @@ -48,7 +47,7 @@ func New(t *testing.T, configs ...network.Config) *network.Network { } // DefaultConfig will initialize config for the network with custom application, -// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig +// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig. func DefaultConfig() network.Config { encoding := app.MakeEncodingConfig() return network.Config{ @@ -60,13 +59,12 @@ func DefaultConfig() network.Config { AppConstructor: func(val network.ValidatorI) servertypes.Application { return app.New( val.GetCtx().Logger, - tmdb.NewMemDB(), + db.NewMemDB(), nil, true, map[int64]bool{}, val.GetCtx().Config.RootDir, 0, - encoding, sims.EmptyAppOptions{}, app.EmptyWasmOpts, baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), @@ -81,7 +79,7 @@ func DefaultConfig() network.Config { AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction), StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction), BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), - PruningStrategy: pruningtypes.PruningOptionNothing, + PruningStrategy: types.PruningOptionNothing, CleanupDir: true, SigningAlgo: string(hd.Secp256k1Type), KeyringOptions: []keyring.Option{}, diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go index 0a5897b3f..7c8a98f7a 100644 --- a/testutil/sample/sample.go +++ b/testutil/sample/sample.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// AccAddress returns a sample account address +// AccAddress returns a sample account address. func AccAddress() sdk.AccAddress { pk := ed25519.GenPrivKey().PubKey() addr := pk.Address() diff --git a/testutil/setup.go b/testutil/setup.go index cf6a39212..eba512c40 100644 --- a/testutil/setup.go +++ b/testutil/setup.go @@ -3,58 +3,54 @@ package testutil import ( "testing" - tmdb "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + "cosmossdk.io/store" + storemetrics "cosmossdk.io/store/metrics" "github.com/cometbft/cometbft/crypto/ed25519" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" "github.com/golang/mock/gomock" + "github.com/quasar-finance/quasar/app" + appparams "github.com/quasar-finance/quasar/app/params" + "github.com/quasar-finance/quasar/testutil/keeper" + "github.com/quasar-finance/quasar/testutil/mock" + epochskeeper "github.com/quasar-finance/quasar/x/epochs/keeper" + tfkeeper "github.com/quasar-finance/quasar/x/tokenfactory/keeper" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/app" - "github.com/quasarlabs/quasarnode/testutil/keeper" - "github.com/quasarlabs/quasarnode/testutil/mock" - epochskeeper "github.com/quasarlabs/quasarnode/x/epochs/keeper" - qoraclekeeper "github.com/quasarlabs/quasarnode/x/qoracle/keeper" - qosmokeeper "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/keeper" - qosmotypes "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - qtransferkeeper "github.com/quasarlabs/quasarnode/x/qtransfer/keeper" - qvestingkeeper "github.com/quasarlabs/quasarnode/x/qvesting/keeper" - tfkeeper "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" ) func init() { // Set prefixes - accountPubKeyPrefix := app.AccountAddressPrefix + "pub" - validatorAddressPrefix := app.AccountAddressPrefix + "valoper" - validatorPubKeyPrefix := app.AccountAddressPrefix + "valoperpub" - consNodeAddressPrefix := app.AccountAddressPrefix + "valcons" - consNodePubKeyPrefix := app.AccountAddressPrefix + "valconspub" + accountPubKeyPrefix := appparams.Bech32PrefixAccAddr + "pub" + validatorAddressPrefix := appparams.Bech32PrefixAccAddr + "valoper" + validatorPubKeyPrefix := appparams.Bech32PrefixAccAddr + "valoperpub" + consNodeAddressPrefix := appparams.Bech32PrefixAccAddr + "valcons" + consNodePubKeyPrefix := appparams.Bech32PrefixAccAddr + "valconspub" // Set and seal config config := sdk.GetConfig() - config.SetBech32PrefixForAccount(app.AccountAddressPrefix, accountPubKeyPrefix) + config.SetBech32PrefixForAccount(appparams.Bech32PrefixAccAddr, accountPubKeyPrefix) config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) config.Seal() } + func CreateRandomAccounts(numAccts int) []sdk.AccAddress { testAddrs := make([]sdk.AccAddress, numAccts) + for i := 0; i < numAccts; i++ { pk := ed25519.GenPrivKey().PubKey() testAddrs[i] = sdk.AccAddress(pk.Address()) @@ -66,7 +62,7 @@ func CreateRandomAccounts(numAccts int) []sdk.AccAddress { // FundAcc funds target address with specified amount. func (ts *TestSetup) FundAcc(t testing.TB, acc sdk.AccAddress, amounts sdk.Coins) { // TODO - implement alternative solution to the simapp.FundAcc - err := testutil.FundAccount(ts.Keepers.BankKeeper, ts.Ctx, acc, amounts) + err := testutil.FundAccount(ts.Ctx, ts.Keepers.BankKeeper, acc, amounts) require.NoError(t, err) } @@ -86,13 +82,13 @@ func (ts *TestSetup) MintCoins(t testing.TB, coins sdk.Coins) { func NewTestSetup(t testing.TB, controller ...*gomock.Controller) *TestSetup { // Test setup params - logger := log.TestingLogger() + logger := log.NewTestLogger(t) // Use nop logger if logging becomes too verbose for test output // logger := log.NewNopLogger() logger.Debug("creating test setup") - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, logger, storemetrics.NewNoOpMetrics()) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, logger) encodingConfig := app.MakeEncodingConfig() @@ -101,16 +97,15 @@ func NewTestSetup(t testing.TB, controller ...*gomock.Controller) *TestSetup { // If no controller is given, no mock is needed so we don't need to check that mocks were called var ctl *gomock.Controller - switch len(controller) { + controllerLength := len(controller) + + switch controllerLength { case 0: ctl = gomock.NewController(t) default: ctl = controller[0] } - ibcClientKeeperMock := mock.NewMockClientKeeper(ctl) - ibcChannelKeeperMock := mock.NewMockChannelKeeper(ctl) icaControllerKeeperMock := mock.NewMockICAControllerKeeper(ctl) - ics4WrapperMock := mock.NewMockICS4Wrapper(ctl) ibcPortKeeperMock := mock.NewMockPortKeeper(ctl) // Set BindPort method for mock and return a mock capability ibcPortKeeperMock.EXPECT().BindPort(gomock.Any(), gomock.Any()).AnyTimes().Return(capabilitytypes.NewCapability(1)) @@ -132,14 +127,6 @@ func NewTestSetup(t testing.TB, controller ...*gomock.Controller) *TestSetup { capabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) stakingKeeper := factory.StakingKeeper(accountKeeper, bankKeeper) distrKeeper := factory.DistributionKeeper(accountKeeper, bankKeeper, stakingKeeper, "feeCollectorName") - qosmoScopedKeeper := capabilityKeeper.ScopeToModule(qosmotypes.SubModuleName) - - qoracleKeeper := factory.QoracleKeeper(paramsKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - qosmosisKeeper := factory.QosmosisKeeper(paramsKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ibcClientKeeperMock, ics4WrapperMock, ibcChannelKeeperMock, ibcPortKeeperMock, qosmoScopedKeeper, qoracleKeeper) - qoracleKeeper.RegisterPoolOracle(qosmosisKeeper) - qoracleKeeper.Seal() - qtransferkeeper := factory.QTransferKeeper(paramsKeeper, accountKeeper) - qvestingKeeper := factory.QVestingKeeper(paramsKeeper, accountKeeper, bankKeeper) tfKeeper := factory.TfKeeper(paramsKeeper, accountKeeper, bankKeeper, distrKeeper) // Note: the relative order of LoadLatestVersion and Set*DefaultParams is important. @@ -148,8 +135,6 @@ func NewTestSetup(t testing.TB, controller ...*gomock.Controller) *TestSetup { require.NoError(t, factory.StateStore.LoadLatestVersion()) - factory.SetQoracleDefaultParams(qoracleKeeper) - factory.SetQosmosisDefaultParams(qosmosisKeeper) testAccts := CreateRandomAccounts(3) // Init Genesis of Keepers @@ -170,10 +155,6 @@ func NewTestSetup(t testing.TB, controller ...*gomock.Controller) *TestSetup { AccountKeeper: accountKeeper, BankKeeper: bankKeeper, CapabilityKeeper: capabilityKeeper, - QoracleKeeper: qoracleKeeper, - QosmosisKeeper: qosmosisKeeper, - QTransfer: qtransferkeeper, - QVestingKeeper: qvestingKeeper, TfKeeper: tfKeeper, }, TestAccs: testAccts, @@ -201,9 +182,5 @@ type testKeepers struct { StakingKeeper stakingKeeper.Keeper DistributedKeeper distrkeeper.Keeper CapabilityKeeper capabilitykeeper.Keeper - QoracleKeeper qoraclekeeper.Keeper - QosmosisKeeper qosmokeeper.Keeper - QTransfer qtransferkeeper.Keeper - QVestingKeeper qvestingkeeper.Keeper TfKeeper tfkeeper.Keeper } diff --git a/testutil/test_setup.go b/testutil/test_setup.go new file mode 100644 index 000000000..8666fb3c6 --- /dev/null +++ b/testutil/test_setup.go @@ -0,0 +1,202 @@ +package testutil + +import ( + "encoding/json" + "os" + "testing" + "time" + + "cosmossdk.io/log" + "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/client/flags" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/testutil/mock" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + 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" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/quasar-finance/quasar/app" + "github.com/spf13/cast" + "github.com/spf13/viper" + "github.com/stretchr/testify/require" +) + +// DefaultConsensusParams defines the default Tendermint consensus params used +// in quasarApp testing. +var DefaultConsensusParams = &tmproto.ConsensusParams{ + Block: &tmproto.BlockParams{ + MaxBytes: 200000, + MaxGas: 2000000, + }, + Evidence: &tmproto.EvidenceParams{ + MaxAgeNumBlocks: 302400, + MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration + MaxBytes: 10000, + }, + Validator: &tmproto.ValidatorParams{ + PubKeyTypes: []string{ + tmtypes.ABCIPubKeyTypeEd25519, + }, + }, +} + +type PV struct { + PrivKey cryptotypes.PrivKey +} + +func Setup(t *testing.T) *app.QuasarApp { + t.Helper() + + privVal := mock.NewPV() + pubKey, err := privVal.GetPubKey() + require.NoError(t, err) + // create validator set with single validator + validator := tmtypes.NewValidator(pubKey, 1) + valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + + // generate genesis account + senderPrivKey := mock.NewPV() + senderPubKey := senderPrivKey.PrivKey.PubKey() + + acc := authtypes.NewBaseAccount(senderPubKey.Address().Bytes(), senderPubKey, 0, 0) + balance := banktypes.Balance{ + Address: acc.GetAddress().String(), + Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000000000000))), + } + genesisAccounts := []authtypes.GenesisAccount{acc} + app := SetupWithGenesisValSet(t, valSet, genesisAccounts, balance) + + return app +} + +// SetupWithGenesisValSet initializes a new quasarApp with a validator set and genesis accounts +// that also act as delegators. For simplicity, each validator is bonded with a delegation +// of one consensus engine unit in the default token of the quasarApp from first genesis +// account. A Nop logger is set in quasarApp. +func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *app.QuasarApp { + t.Helper() + + quasarApp, genesisState := setup() + genesisState = genesisStateWithValSet(t, quasarApp, genesisState, valSet, genAccs, balances...) + + stateBytes, err := json.MarshalIndent(genesisState, "", " ") + require.NoError(t, err) + + // init chain will set the validator set and initialize the genesis accounts + _, err = quasarApp.InitChain( + &abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{}, + ConsensusParams: DefaultConsensusParams, + AppStateBytes: stateBytes, + }, + ) + require.NoError(t, err) + + require.NoError(t, err) + _, err = quasarApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + Height: quasarApp.LastBlockHeight() + 1, + Hash: quasarApp.LastCommitID().Hash, + NextValidatorsHash: valSet.Hash(), + }) + require.NoError(t, err) + + return quasarApp +} + +func setup() (*app.QuasarApp, app.GenesisState) { + dir, err := os.MkdirTemp("", "quasar-test-app") + if err != nil { + panic(err) + } + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[server.FlagInvCheckPeriod] = 5 + appOptions[server.FlagMinGasPrices] = "0uqsr" + + initAppOptions := viper.New() + initAppOptions.Set(flags.FlagHome, dir) + quasarApp := app.New( + log.NewNopLogger(), + dbm.NewMemDB(), + nil, + true, + map[int64]bool{}, + dir, + cast.ToUint(initAppOptions.Get(server.FlagInvCheckPeriod)), + initAppOptions, + app.EmptyWasmOpts, + ) + return quasarApp, quasarApp.ModuleBasics.DefaultGenesis(quasarApp.AppCodec()) +} + +func genesisStateWithValSet(t *testing.T, + app *app.QuasarApp, genesisState app.GenesisState, + valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, + balances ...banktypes.Balance, +) app.GenesisState { + t.Helper() + // set genesis accounts + authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) + genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) + + validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) + delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) + + bondAmt := sdk.DefaultPowerReduction + + for _, val := range valSet.Validators { + pk, err := cryptocodec.FromCmtPubKeyInterface(val.PubKey) + require.NoError(t, err) + pkAny, err := codectypes.NewAnyWithValue(pk) + require.NoError(t, err) + validator := stakingtypes.Validator{ + OperatorAddress: sdk.ValAddress(val.Address).String(), + ConsensusPubkey: pkAny, + Jailed: false, + Status: stakingtypes.Bonded, + Tokens: bondAmt, + DelegatorShares: math.LegacyOneDec(), + Description: stakingtypes.Description{}, + UnbondingHeight: int64(0), + UnbondingTime: time.Unix(0, 0).UTC(), + Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), + } + validators = append(validators, validator) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), math.LegacyOneDec())) + + } + // set validators and delegations + stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations) + genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(stakingGenesis) + + totalSupply := sdk.NewCoins() + for _, b := range balances { + // add genesis acc tokens to total supply + totalSupply = totalSupply.Add(b.Coins...) + } + + for range delegations { + // add delegated tokens to total supply + totalSupply = totalSupply.Add(sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)) + } + + // add bonded amount to bonded pool module account + balances = append(balances, banktypes.Balance{ + Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), + Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)}, + }) + + // update total supply + bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}, []banktypes.SendEnabled{}) + genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) + + return genesisState +} 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 a505b4637..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/v7/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 8c237a152..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/v7/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/host/v1/host.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto deleted file mode 100644 index 18cc1d13d..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/v7/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 b89ed8ed8..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/v7/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 6c30957f8..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/v7/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) = "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/genesis.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/genesis.proto deleted file mode 100644 index ea5efda40..000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/genesis.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/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 -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\""]; -} - -// 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/v1/metadata.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto deleted file mode 100644 index 9ea7eeca3..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/v7/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 d2dcf518e..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/v7/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/genesis.proto b/third_party/proto/ibc/applications/transfer/v1/genesis.proto deleted file mode 100644 index 5e09a34ab..000000000 --- a/third_party/proto/ibc/applications/transfer/v1/genesis.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; - -import "ibc/applications/transfer/v1/transfer.proto"; -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]; -} diff --git a/third_party/proto/ibc/applications/transfer/v1/query.proto b/third_party/proto/ibc/applications/transfer/v1/query.proto deleted file mode 100644 index c732b830e..000000000 --- a/third_party/proto/ibc/applications/transfer/v1/query.proto +++ /dev/null @@ -1,105 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/applications/transfer/v1/transfer.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; - -// Query provides defines the gRPC querier service. -service Query { - // DenomTrace queries a denomination trace information. - rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash}"; - } - - // DenomTraces queries all denomination traces. - rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces"; - } - - // Params queries all parameters of the ibc-transfer module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/params"; - } - - // DenomHash queries a denomination hash information. - rpc DenomHash(QueryDenomHashRequest) returns (QueryDenomHashResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace}"; - } - - // EscrowAddress returns the escrow address for a particular port and channel id. - rpc EscrowAddress(QueryEscrowAddressRequest) returns (QueryEscrowAddressResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address"; - } -} - -// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC -// method -message QueryDenomTraceRequest { - // hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. - string hash = 1; -} - -// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC -// method. -message QueryDenomTraceResponse { - // denom_trace returns the requested denomination trace information. - DenomTrace denom_trace = 1; -} - -// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC -// method -message QueryDenomTracesRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC -// method. -message QueryDenomTracesResponse { - // denom_traces returns all denominations trace information. - repeated DenomTrace denom_traces = 1 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// 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; -} - -// QueryDenomHashRequest is the request type for the Query/DenomHash RPC -// method -message QueryDenomHashRequest { - // The denomination trace ([port_id]/[channel_id])+/[denom] - string trace = 1; -} - -// QueryDenomHashResponse is the response type for the Query/DenomHash RPC -// method. -message QueryDenomHashResponse { - // hash (in hex format) of the denomination trace information. - string hash = 1; -} - -// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. -message QueryEscrowAddressRequest { - // unique port identifier - string port_id = 1; - // unique channel identifier - string channel_id = 2; -} - -// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. -message QueryEscrowAddressResponse { - // the escrow account address - string escrow_address = 1; -} \ No newline at end of file diff --git a/third_party/proto/ibc/applications/transfer/v1/transfer.proto b/third_party/proto/ibc/applications/transfer/v1/transfer.proto deleted file mode 100644 index 217107479..000000000 --- a/third_party/proto/ibc/applications/transfer/v1/transfer.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/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 { - // path defines the chain of port/channel identifiers used for tracing the - // source of the fungible token. - string path = 1; - // base denomination of the relayed fungible token. - string base_denom = 2; -} - -// Params defines the set of IBC transfer parameters. -// NOTE: To prevent a single token from being transferred, set the -// TransfersEnabled parameter to true and then set the bank module's SendEnabled -// parameter for the denomination to false. -message Params { - // send_enabled enables or disables all cross-chain token transfers from this - // chain. - bool send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled\""]; - // receive_enabled enables or disables all cross-chain token transfers to this - // chain. - bool receive_enabled = 2 [(gogoproto.moretags) = "yaml:\"receive_enabled\""]; -} diff --git a/third_party/proto/ibc/applications/transfer/v1/tx.proto b/third_party/proto/ibc/applications/transfer/v1/tx.proto deleted file mode 100644 index eb3d0cda6..000000000 --- a/third_party/proto/ibc/applications/transfer/v1/tx.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "ibc/core/client/v1/client.proto"; - -// Msg defines the ibc/transfer Msg service. -service Msg { - // Transfer defines a rpc handler method for MsgTransfer. - rpc Transfer(MsgTransfer) returns (MsgTransferResponse); -} - -// 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 (gogoproto.goproto_getters) = false; - - // the port on which the packet will be sent - string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; - // the channel by which the packet will be sent - string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; - // the tokens to be transferred - cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; - // 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]; - // 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\""]; -} - -// MsgTransferResponse defines the Msg/Transfer response type. -message MsgTransferResponse {} diff --git a/third_party/proto/ibc/applications/transfer/v2/packet.proto b/third_party/proto/ibc/applications/transfer/v2/packet.proto deleted file mode 100644 index 1942cf633..000000000 --- a/third_party/proto/ibc/applications/transfer/v2/packet.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v2; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; - -// FungibleTokenPacketData defines a struct for the packet payload -// See FungibleTokenPacketData spec: -// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures -message FungibleTokenPacketData { - // the token denomination to be transferred - string denom = 1; - // the token amount to be transferred - string amount = 2; - // the sender address - string sender = 3; - // the recipient address on the destination chain - string receiver = 4; -} diff --git a/third_party/proto/ibc/core/channel/v1/channel.proto b/third_party/proto/ibc/core/channel/v1/channel.proto deleted file mode 100644 index ea25a81ff..000000000 --- a/third_party/proto/ibc/core/channel/v1/channel.proto +++ /dev/null @@ -1,148 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/client/v1/client.proto"; - -// Channel defines pipeline for exactly-once packet delivery between specific -// modules on separate blockchains, which has at least one end capable of -// sending packets and one end capable of receiving packets. -message Channel { - option (gogoproto.goproto_getters) = false; - - // current state of the channel end - State state = 1; - // whether the channel is ordered or unordered - Order ordering = 2; - // counterparty channel end - 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\""]; - // opaque channel version, which is agreed upon during the handshake - string version = 5; -} - -// IdentifiedChannel defines a channel with additional port and channel -// identifier fields. -message IdentifiedChannel { - option (gogoproto.goproto_getters) = false; - - // current state of the channel end - State state = 1; - // whether the channel is ordered or unordered - Order ordering = 2; - // counterparty channel end - 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\""]; - // 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; -} - -// State defines if a channel is in one of the following states: -// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. -enum State { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; - // A channel has just started the opening handshake. - STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; - // A channel has acknowledged the handshake step on the counterparty chain. - STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; - // A channel has completed the handshake. Open channels are - // ready to send and receive packets. - STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; - // A channel has been closed and can no longer be used to send or receive - // packets. - STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; -} - -// Order defines if a channel is ORDERED or UNORDERED -enum Order { - option (gogoproto.goproto_enum_prefix) = false; - - // zero-value for channel ordering - ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"]; - // packets can be delivered in any order, which may differ from the order in - // which they were sent. - ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"]; - // packets are delivered exactly in the order which they were sent - ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"]; -} - -// Counterparty defines a channel end counterparty -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\""]; - // channel end on the counterparty chain - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; -} - -// Packet defines a type that carries data across different chains through IBC -message Packet { - option (gogoproto.goproto_getters) = false; - - // number corresponds to the order of sends and receives, where a Packet - // with an earlier sequence number must be sent and received before a 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\""]; - // identifies the channel end on the sending chain. - string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""]; - // identifies the port on the receiving chain. - string destination_port = 4 [(gogoproto.moretags) = "yaml:\"destination_port\""]; - // identifies the channel end on the receiving chain. - string destination_channel = 5 [(gogoproto.moretags) = "yaml:\"destination_channel\""]; - // 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]; - // block timestamp (in nanoseconds) after which the packet times out - uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; -} - -// PacketState defines the generic type necessary to retrieve and store -// packet commitments, acknowledgements, and receipts. -// Caller is responsible for knowing the context necessary to interpret this -// state as a commitment, acknowledgement, or a receipt. -message PacketState { - option (gogoproto.goproto_getters) = false; - - // channel port identifier. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // channel unique identifier. - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // packet sequence. - uint64 sequence = 3; - // embedded data that represents packet state. - bytes data = 4; -} - -// Acknowledgement is the recommended acknowledgement format to be used by -// app-specific protocols. -// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental -// conflicts with other protobuf message formats used for acknowledgements. -// The first byte of any message with this format will be the non-ASCII values -// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: -// https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope -message Acknowledgement { - // response contains either a result or an error and must be non-empty - oneof response { - bytes result = 21; - string error = 22; - } -} diff --git a/third_party/proto/ibc/core/channel/v1/genesis.proto b/third_party/proto/ibc/core/channel/v1/genesis.proto deleted file mode 100644 index 65cc928aa..000000000 --- a/third_party/proto/ibc/core/channel/v1/genesis.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// GenesisState defines the ibc channel submodule's genesis state. -message GenesisState { - repeated IdentifiedChannel channels = 1 [(gogoproto.casttype) = "IdentifiedChannel", (gogoproto.nullable) = false]; - 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\""]; - // the sequence for the next generated channel identifier - uint64 next_channel_sequence = 8 [(gogoproto.moretags) = "yaml:\"next_channel_sequence\""]; -} - -// 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\""]; - 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 deleted file mode 100644 index 2d5bdb2fc..000000000 --- a/third_party/proto/ibc/core/channel/v1/query.proto +++ /dev/null @@ -1,376 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; - -import "ibc/core/client/v1/client.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/core/channel/v1/channel.proto"; -import "google/api/annotations.proto"; -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; - -// Query provides defines the gRPC querier service -service Query { - // Channel queries an IBC Channel. - rpc Channel(QueryChannelRequest) returns (QueryChannelResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}"; - } - - // Channels queries all the IBC channels of a chain. - rpc Channels(QueryChannelsRequest) returns (QueryChannelsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels"; - } - - // ConnectionChannels queries all the channels associated with a connection - // end. - rpc ConnectionChannels(QueryConnectionChannelsRequest) returns (QueryConnectionChannelsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/connections/{connection}/channels"; - } - - // ChannelClientState queries for the client state for the channel associated - // with the provided channel identifiers. - rpc ChannelClientState(QueryChannelClientStateRequest) returns (QueryChannelClientStateResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/client_state"; - } - - // ChannelConsensusState queries for the consensus state for the channel - // associated with the provided channel identifiers. - rpc ChannelConsensusState(QueryChannelConsensusStateRequest) returns (QueryChannelConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/consensus_state/revision/" - "{revision_number}/height/{revision_height}"; - } - - // PacketCommitment queries a stored packet commitment hash. - rpc PacketCommitment(QueryPacketCommitmentRequest) returns (QueryPacketCommitmentResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/" - "packet_commitments/{sequence}"; - } - - // PacketCommitments returns all the packet commitments hashes associated - // with a channel. - rpc PacketCommitments(QueryPacketCommitmentsRequest) returns (QueryPacketCommitmentsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_commitments"; - } - - // PacketReceipt queries if a given packet sequence has been received on the - // queried chain - rpc PacketReceipt(QueryPacketReceiptRequest) returns (QueryPacketReceiptResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_receipts/{sequence}"; - } - - // PacketAcknowledgement queries a stored packet acknowledgement hash. - rpc PacketAcknowledgement(QueryPacketAcknowledgementRequest) returns (QueryPacketAcknowledgementResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_acks/{sequence}"; - } - - // PacketAcknowledgements returns all the packet acknowledgements associated - // with a channel. - rpc PacketAcknowledgements(QueryPacketAcknowledgementsRequest) returns (QueryPacketAcknowledgementsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_acknowledgements"; - } - - // UnreceivedPackets returns all the unreceived IBC packets associated with a - // channel and sequences. - rpc UnreceivedPackets(QueryUnreceivedPacketsRequest) returns (QueryUnreceivedPacketsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/" - "packet_commitments/" - "{packet_commitment_sequences}/unreceived_packets"; - } - - // UnreceivedAcks returns all the unreceived IBC acknowledgements associated - // with a channel and sequences. - rpc UnreceivedAcks(QueryUnreceivedAcksRequest) returns (QueryUnreceivedAcksResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_commitments/" - "{packet_ack_sequences}/unreceived_acks"; - } - - // NextSequenceReceive returns the next receive sequence for a given channel. - rpc NextSequenceReceive(QueryNextSequenceReceiveRequest) returns (QueryNextSequenceReceiveResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/next_sequence"; - } -} - -// QueryChannelRequest is the request type for the Query/Channel RPC method -message QueryChannelRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; -} - -// QueryChannelResponse is the response type for the Query/Channel RPC method. -// Besides the Channel end, it includes a proof and the height from which the -// proof was retrieved. -message QueryChannelResponse { - // channel associated with the request identifiers - ibc.core.channel.v1.Channel channel = 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]; -} - -// QueryChannelsRequest is the request type for the Query/Channels RPC method -message QueryChannelsRequest { - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryChannelsResponse is the response type for the Query/Channels RPC method. -message QueryChannelsResponse { - // list of stored channels of the chain. - repeated ibc.core.channel.v1.IdentifiedChannel channels = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConnectionChannelsRequest is the request type for the -// Query/QueryConnectionChannels RPC method -message QueryConnectionChannelsRequest { - // connection unique identifier - string connection = 1; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryConnectionChannelsResponse is the Response type for the -// Query/QueryConnectionChannels RPC method -message QueryConnectionChannelsResponse { - // list of channels associated with a connection. - repeated ibc.core.channel.v1.IdentifiedChannel channels = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryChannelClientStateRequest is the request type for the Query/ClientState -// RPC method -message QueryChannelClientStateRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; -} - -// QueryChannelClientStateResponse is the Response type for the -// Query/QueryChannelClientState RPC method -message QueryChannelClientStateResponse { - // client state associated with the channel - ibc.core.client.v1.IdentifiedClientState identified_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]; -} - -// QueryChannelConsensusStateRequest is the request type for the -// Query/ConsensusState RPC method -message QueryChannelConsensusStateRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // revision number of the consensus state - uint64 revision_number = 3; - // revision height of the consensus state - uint64 revision_height = 4; -} - -// QueryChannelClientStateResponse is the Response type for the -// Query/QueryChannelClientState RPC method -message QueryChannelConsensusStateResponse { - // consensus state associated with the channel - google.protobuf.Any consensus_state = 1; - // client ID associated with the consensus state - string client_id = 2; - // merkle proof of existence - bytes proof = 3; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; -} - -// QueryPacketCommitmentRequest is the request type for the -// Query/PacketCommitment RPC method -message QueryPacketCommitmentRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // packet sequence - uint64 sequence = 3; -} - -// QueryPacketCommitmentResponse defines the client query response for a packet -// which also includes a proof and the height from which the proof was -// retrieved -message QueryPacketCommitmentResponse { - // packet associated with the request fields - bytes commitment = 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]; -} - -// QueryPacketCommitmentsRequest is the request type for the -// Query/QueryPacketCommitments RPC method -message QueryPacketCommitmentsRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 3; -} - -// QueryPacketCommitmentsResponse is the request type for the -// Query/QueryPacketCommitments RPC method -message QueryPacketCommitmentsResponse { - repeated ibc.core.channel.v1.PacketState commitments = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryPacketReceiptRequest is the request type for the -// Query/PacketReceipt RPC method -message QueryPacketReceiptRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // packet sequence - uint64 sequence = 3; -} - -// QueryPacketReceiptResponse defines the client query response for a packet -// receipt which also includes a proof, and the height from which the proof was -// retrieved -message QueryPacketReceiptResponse { - // success flag for if receipt exists - bool received = 2; - // merkle proof of existence - bytes proof = 3; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; -} - -// QueryPacketAcknowledgementRequest is the request type for the -// Query/PacketAcknowledgement RPC method -message QueryPacketAcknowledgementRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // packet sequence - uint64 sequence = 3; -} - -// QueryPacketAcknowledgementResponse defines the client query response for a -// packet which also includes a proof and the height from which the -// proof was retrieved -message QueryPacketAcknowledgementResponse { - // packet associated with the request fields - bytes acknowledgement = 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]; -} - -// QueryPacketAcknowledgementsRequest is the request type for the -// Query/QueryPacketCommitments RPC method -message QueryPacketAcknowledgementsRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 3; - // list of packet sequences - repeated uint64 packet_commitment_sequences = 4; -} - -// QueryPacketAcknowledgemetsResponse is the request type for the -// Query/QueryPacketAcknowledgements RPC method -message QueryPacketAcknowledgementsResponse { - repeated ibc.core.channel.v1.PacketState acknowledgements = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryUnreceivedPacketsRequest is the request type for the -// Query/UnreceivedPackets RPC method -message QueryUnreceivedPacketsRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // list of packet sequences - repeated uint64 packet_commitment_sequences = 3; -} - -// QueryUnreceivedPacketsResponse is the response type for the -// Query/UnreceivedPacketCommitments RPC method -message QueryUnreceivedPacketsResponse { - // list of unreceived packet sequences - repeated uint64 sequences = 1; - // query block height - ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; -} - -// QueryUnreceivedAcks is the request type for the -// Query/UnreceivedAcks RPC method -message QueryUnreceivedAcksRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // list of acknowledgement sequences - repeated uint64 packet_ack_sequences = 3; -} - -// QueryUnreceivedAcksResponse is the response type for the -// Query/UnreceivedAcks RPC method -message QueryUnreceivedAcksResponse { - // list of unreceived acknowledgement sequences - repeated uint64 sequences = 1; - // query block height - ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; -} - -// QueryNextSequenceReceiveRequest is the request type for the -// Query/QueryNextSequenceReceiveRequest RPC method -message QueryNextSequenceReceiveRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; -} - -// QuerySequenceResponse is the request type for the -// Query/QueryNextSequenceReceiveResponse RPC method -message QueryNextSequenceReceiveResponse { - // next sequence receive number - uint64 next_sequence_receive = 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]; -} diff --git a/third_party/proto/ibc/core/channel/v1/tx.proto b/third_party/proto/ibc/core/channel/v1/tx.proto deleted file mode 100644 index f6738101b..000000000 --- a/third_party/proto/ibc/core/channel/v1/tx.proto +++ /dev/null @@ -1,246 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/client/v1/client.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// Msg defines the ibc/channel Msg service. -service Msg { - // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); - - // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); - - // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); - - // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); - - // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); - - // ChannelCloseConfirm defines a rpc handler method for - // MsgChannelCloseConfirm. - rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); - - // RecvPacket defines a rpc handler method for MsgRecvPacket. - rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); - - // Timeout defines a rpc handler method for MsgTimeout. - rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); - - // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); - - // Acknowledgement defines a rpc handler method for MsgAcknowledgement. - rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); -} - -// ResponseResultType defines the possible outcomes of the execution of a message -enum ResponseResultType { - option (gogoproto.goproto_enum_prefix) = false; - - // Default zero value enumeration - RESPONSE_RESULT_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - RESPONSE_RESULT_TYPE_NOOP = 1 [(gogoproto.enumvalue_customname) = "NOOP"]; - // The message was executed successfully - RESPONSE_RESULT_TYPE_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "SUCCESS"]; -} - -// 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 (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - 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\""]; - string version = 2; -} - -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel -// 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 (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // in the case of crossing hello's, when both chains call OpenInit, we need - // the channel identifier of the previous channel in state INIT - string previous_channel_id = 2 [(gogoproto.moretags) = "yaml:\"previous_channel_id\""]; - // 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; -} - -// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. -message MsgChannelOpenTryResponse { - string version = 1; -} - -// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge -// the change of channel state to TRYOPEN on Chain B. -message MsgChannelOpenAck { - option (gogoproto.equal) = false; - 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; -} - -// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. -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 (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; -} - -// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response -// type. -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 (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string signer = 3; -} - -// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. -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 (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; -} - -// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response -// type. -message MsgChannelCloseConfirmResponse {} - -// MsgRecvPacket receives incoming IBC packet -message MsgRecvPacket { - option (gogoproto.equal) = false; - 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; -} - -// MsgRecvPacketResponse defines the Msg/RecvPacket response type. -message MsgRecvPacketResponse { - option (gogoproto.goproto_getters) = false; - - ResponseResultType result = 1; -} - -// MsgTimeout receives timed-out packet -message MsgTimeout { - option (gogoproto.equal) = false; - 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; -} - -// MsgTimeoutResponse defines the Msg/Timeout response type. -message MsgTimeoutResponse { - option (gogoproto.goproto_getters) = false; - - ResponseResultType result = 1; -} - -// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. -message MsgTimeoutOnClose { - option (gogoproto.equal) = false; - 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; -} - -// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. -message MsgTimeoutOnCloseResponse { - option (gogoproto.goproto_getters) = false; - - ResponseResultType result = 1; -} - -// MsgAcknowledgement receives incoming IBC acknowledgement -message MsgAcknowledgement { - option (gogoproto.equal) = false; - 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; -} - -// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -message MsgAcknowledgementResponse { - option (gogoproto.goproto_getters) = false; - - ResponseResultType result = 1; -} diff --git a/third_party/proto/ibc/core/client/v1/client.proto b/third_party/proto/ibc/core/client/v1/client.proto deleted file mode 100644 index 266649ba0..000000000 --- a/third_party/proto/ibc/core/client/v1/client.proto +++ /dev/null @@ -1,103 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/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"; - -// IdentifiedClientState defines a client state with an additional client -// identifier field. -message IdentifiedClientState { - // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} - -// ConsensusStateWithHeight defines a consensus state with an additional height -// field. -message ConsensusStateWithHeight { - // consensus state height - Height height = 1 [(gogoproto.nullable) = false]; - // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ClientConsensusStates defines all the stored consensus states for a given -// client. -message ClientConsensusStates { - // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // consensus states and their heights associated with the client - repeated ConsensusStateWithHeight consensus_states = 2 - [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; -} - -// ClientUpdateProposal is a 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). -message ClientUpdateProposal { - option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - // the title of the update proposal - string title = 1; - // the description of the proposal - string description = 2; - // the client identifier for the client to be updated if the proposal passes - string subject_client_id = 3 [(gogoproto.moretags) = "yaml:\"subject_client_id\""]; - // the substitute client identifier for the client standing in for the subject - // client - string substitute_client_id = 4 [(gogoproto.moretags) = "yaml:\"substitute_client_id\""]; -} - -// UpgradeProposal is a gov Content type for initiating an IBC breaking -// upgrade. -message UpgradeProposal { - 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; - cosmos.upgrade.v1beta1.Plan plan = 3 [(gogoproto.nullable) = false]; - - // An UpgradedClientState must be provided to perform an IBC breaking upgrade. - // This will make the chain commit to the correct upgraded (self) client state - // before the upgrade occurs, so that connecting chains can verify that the - // new upgraded client is valid by verifying a proof on the previous version - // of the chain. This will allow IBC connections to persist smoothly across - // 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. - 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 deleted file mode 100644 index 788212441..000000000 --- a/third_party/proto/ibc/core/client/v1/genesis.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"; - -import "ibc/core/client/v1/client.proto"; -import "gogoproto/gogo.proto"; - -// GenesisState defines the ibc client submodule's genesis state. -message GenesisState { - // client states with their corresponding identifiers - repeated IdentifiedClientState clients = 1 - [(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\"" - ]; - // 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\""]; - // the sequence for the next generated client identifier - uint64 next_client_sequence = 6 [(gogoproto.moretags) = "yaml:\"next_client_sequence\""]; -} - -// GenesisMetadata defines the genesis type for metadata that clients may return -// with ExportMetadata -message GenesisMetadata { - option (gogoproto.goproto_getters) = false; - - // store key of metadata without clientID-prefix - bytes key = 1; - // metadata value - bytes value = 2; -} - -// 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\""]; -} 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 7f7877fc5..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/v7/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. - rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) { - option (google.api.http).get = "/ibc/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 685d408db..000000000 --- a/third_party/proto/ibc/core/client/v1/tx.proto +++ /dev/null @@ -1,99 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/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 header. -message MsgUpdateClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // header to update the light client - google.protobuf.Any header = 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. -message MsgSubmitMisbehaviour { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // misbehaviour used for freezing the light client - google.protobuf.Any misbehaviour = 2; - // signer address - string signer = 3; -} - -// 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 deleted file mode 100644 index 40a574055..000000000 --- a/third_party/proto/ibc/core/commitment/v1/commitment.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -package ibc.core.commitment.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types"; - -import "gogoproto/gogo.proto"; -import "proofs.proto"; - -// MerkleRoot defines a merkle root hash. -// In the Cosmos SDK, the AppHash of a block header becomes the root. -message MerkleRoot { - option (gogoproto.goproto_getters) = false; - - bytes hash = 1; -} - -// MerklePrefix is merkle path prefixed to the key. -// 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\""]; -} - -// 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\""]; -} - -// MerkleProof is a wrapper type over a chain of CommitmentProofs. -// It demonstrates membership or non-membership for an element or set of -// elements, verifiable in conjunction with a known commitment root. Proofs -// should be succinct. -// MerkleProofs are ordered from leaf-to-root -message MerkleProof { - repeated ics23.CommitmentProof proofs = 1; -} diff --git a/third_party/proto/ibc/core/connection/v1/connection.proto b/third_party/proto/ibc/core/connection/v1/connection.proto deleted file mode 100644 index ba367c14d..000000000 --- a/third_party/proto/ibc/core/connection/v1/connection.proto +++ /dev/null @@ -1,114 +0,0 @@ -syntax = "proto3"; - -package ibc.core.connection.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/commitment/v1/commitment.proto"; - -// ICS03 - Connection Data Structures as defined in -// https://github.com/cosmos/ibc/blob/master/spec/core/ics-003-connection-semantics#data-structures - -// ConnectionEnd defines a stateful object on a chain connected to another -// separate one. -// NOTE: there must only be 2 defined ConnectionEnds to establish -// a connection between two chains. -message ConnectionEnd { - option (gogoproto.goproto_getters) = false; - // client associated with this connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // IBC version which can be utilised to determine encodings or protocols for - // channels or packets utilising this connection. - repeated Version versions = 2; - // current state of the connection end. - State state = 3; - // counterparty chain associated with this connection. - Counterparty counterparty = 4 [(gogoproto.nullable) = false]; - // 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\""]; -} - -// IdentifiedConnection defines a connection with additional connection -// identifier field. -message IdentifiedConnection { - option (gogoproto.goproto_getters) = false; - // connection identifier. - string id = 1 [(gogoproto.moretags) = "yaml:\"id\""]; - // client associated with this connection. - string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // IBC version which can be utilised to determine encodings or protocols for - // channels or packets utilising this connection - repeated Version versions = 3; - // current state of the connection end. - State state = 4; - // 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\""]; -} - -// State defines if a connection is in one of the following states: -// INIT, TRYOPEN, OPEN or UNINITIALIZED. -enum State { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; - // A connection end has just started the opening handshake. - STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; - // A connection end has acknowledged the handshake step on the counterparty - // chain. - STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; - // A connection end has completed the handshake. - STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; -} - -// Counterparty defines the counterparty chain associated with a connection end. -message Counterparty { - option (gogoproto.goproto_getters) = false; - - // identifies the client on the counterparty chain associated with a given - // connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // identifies the connection end on the counterparty chain associated with a - // given connection. - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - // commitment merkle prefix of the counterparty chain. - ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false]; -} - -// ClientPaths define all the connection paths for a client state. -message ClientPaths { - // list of connection paths - repeated string paths = 1; -} - -// 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\""]; - // list of connection paths - repeated string paths = 2; -} - -// Version defines the versioning scheme used to negotiate the IBC verison in -// the connection handshake. -message Version { - option (gogoproto.goproto_getters) = false; - - // unique version identifier - string identifier = 1; - // list of features compatible with the specified identifier - repeated string features = 2; -} - -// Params defines the set of Connection parameters. -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\""]; -} diff --git a/third_party/proto/ibc/core/connection/v1/genesis.proto b/third_party/proto/ibc/core/connection/v1/genesis.proto deleted file mode 100644 index 122c5a465..000000000 --- a/third_party/proto/ibc/core/connection/v1/genesis.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package ibc.core.connection.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; - -import "gogoproto/gogo.proto"; -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\""]; - // the sequence for the next generated connection identifier - uint64 next_connection_sequence = 3 [(gogoproto.moretags) = "yaml:\"next_connection_sequence\""]; - 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 deleted file mode 100644 index 8961d8a17..000000000 --- a/third_party/proto/ibc/core/connection/v1/query.proto +++ /dev/null @@ -1,138 +0,0 @@ -syntax = "proto3"; - -package ibc.core.connection.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/core/client/v1/client.proto"; -import "ibc/core/connection/v1/connection.proto"; -import "google/api/annotations.proto"; -import "google/protobuf/any.proto"; - -// Query provides defines the gRPC querier service -service Query { - // Connection queries an IBC connection end. - rpc Connection(QueryConnectionRequest) returns (QueryConnectionResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}"; - } - - // Connections queries all the IBC connections of a chain. - rpc Connections(QueryConnectionsRequest) returns (QueryConnectionsResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/connections"; - } - - // ClientConnections queries the connection paths associated with a client - // state. - rpc ClientConnections(QueryClientConnectionsRequest) returns (QueryClientConnectionsResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/client_connections/{client_id}"; - } - - // ConnectionClientState queries the client state associated with the - // connection. - rpc ConnectionClientState(QueryConnectionClientStateRequest) returns (QueryConnectionClientStateResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/client_state"; - } - - // ConnectionConsensusState queries the consensus state associated with the - // connection. - rpc ConnectionConsensusState(QueryConnectionConsensusStateRequest) returns (QueryConnectionConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/consensus_state/" - "revision/{revision_number}/height/{revision_height}"; - } -} - -// QueryConnectionRequest is the request type for the Query/Connection RPC -// method -message QueryConnectionRequest { - // connection unique identifier - string connection_id = 1; -} - -// QueryConnectionResponse is the response type for the Query/Connection RPC -// method. Besides the connection end, it includes a proof and the height from -// which the proof was retrieved. -message QueryConnectionResponse { - // connection associated with the request identifier - ibc.core.connection.v1.ConnectionEnd connection = 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]; -} - -// QueryConnectionsRequest is the request type for the Query/Connections RPC -// method -message QueryConnectionsRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryConnectionsResponse is the response type for the Query/Connections RPC -// method. -message QueryConnectionsResponse { - // list of stored connections of the chain. - repeated ibc.core.connection.v1.IdentifiedConnection connections = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryClientConnectionsRequest is the request type for the -// Query/ClientConnections RPC method -message QueryClientConnectionsRequest { - // client identifier associated with a connection - string client_id = 1; -} - -// QueryClientConnectionsResponse is the response type for the -// Query/ClientConnections RPC method -message QueryClientConnectionsResponse { - // slice of all the connection paths associated with a client. - repeated string connection_paths = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was generated - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConnectionClientStateRequest is the request type for the -// Query/ConnectionClientState RPC method -message QueryConnectionClientStateRequest { - // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; -} - -// QueryConnectionClientStateResponse is the response type for the -// Query/ConnectionClientState RPC method -message QueryConnectionClientStateResponse { - // client state associated with the channel - ibc.core.client.v1.IdentifiedClientState identified_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]; -} - -// QueryConnectionConsensusStateRequest is the request type for the -// Query/ConnectionConsensusState RPC method -message QueryConnectionConsensusStateRequest { - // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - uint64 revision_number = 2; - uint64 revision_height = 3; -} - -// QueryConnectionConsensusStateResponse is the response type for the -// Query/ConnectionConsensusState RPC method -message QueryConnectionConsensusStateResponse { - // consensus state associated with the channel - google.protobuf.Any consensus_state = 1; - // client ID associated with the consensus state - string client_id = 2; - // merkle proof of existence - bytes proof = 3; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/core/connection/v1/tx.proto b/third_party/proto/ibc/core/connection/v1/tx.proto deleted file mode 100644 index 75accab31..000000000 --- a/third_party/proto/ibc/core/connection/v1/tx.proto +++ /dev/null @@ -1,119 +0,0 @@ -syntax = "proto3"; - -package ibc.core.connection.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; - -import "gogoproto/gogo.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 { - // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); - - // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); - - // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); - - // ConnectionOpenConfirm defines a rpc handler method for - // MsgConnectionOpenConfirm. - rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); -} - -// 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 (gogoproto.goproto_getters) = false; - - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - Counterparty counterparty = 2 [(gogoproto.nullable) = false]; - Version version = 3; - uint64 delay_period = 4 [(gogoproto.moretags) = "yaml:\"delay_period\""]; - string signer = 5; -} - -// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response -// type. -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 (gogoproto.goproto_getters) = false; - - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // in the case of crossing hello's, when both chains call OpenInit, we need - // the connection identifier of the previous connection in state INIT - string previous_connection_id = 2 [(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]; - // proof of the initialization the connection on Chain A: `UNITIALIZED -> - // INIT` - bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - // proof of client state included in message - bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; - // 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; -} - -// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. -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 (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]; - // proof of the initialization the connection on Chain B: `UNITIALIZED -> - // TRYOPEN` - bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - // proof of client state included in message - bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""]; - // 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; -} - -// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. -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 (gogoproto.goproto_getters) = false; - - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - // 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; -} - -// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm -// response type. -message MsgConnectionOpenConfirmResponse {} diff --git a/third_party/proto/ibc/core/types/v1/genesis.proto b/third_party/proto/ibc/core/types/v1/genesis.proto deleted file mode 100644 index 4e07551f8..000000000 --- a/third_party/proto/ibc/core/types/v1/genesis.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; - -package ibc.core.types.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/client/v1/genesis.proto"; -import "ibc/core/connection/v1/genesis.proto"; -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\""]; - // ICS003 - Connections genesis state - ibc.core.connection.v1.GenesisState connection_genesis = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"connection_genesis\""]; - // ICS004 - Channel genesis state - ibc.core.channel.v1.GenesisState channel_genesis = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"channel_genesis\""]; -} diff --git a/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto b/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto deleted file mode 100644 index 58c49fde6..000000000 --- a/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.localhost.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/light-clients/09-localhost/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/client/v1/client.proto"; - -// ClientState defines a loopback (localhost) client. It requires (read-only) -// access to keys outside the client prefix. -message ClientState { - option (gogoproto.goproto_getters) = false; - // self chain ID - string chain_id = 1 [(gogoproto.moretags) = "yaml:\"chain_id\""]; - // self latest block height - ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto deleted file mode 100644 index 698a03eeb..000000000 --- a/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto +++ /dev/null @@ -1,189 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.solomachine.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/legacy/v100"; - -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 - uint64 frozen_sequence = 2 [(gogoproto.moretags) = "yaml:\"frozen_sequence\""]; - 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/v2/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto deleted file mode 100644 index 46597cbf8..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/v7/modules/light-clients/06-solomachine/types"; - -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/tendermint/v1/tendermint.proto b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto deleted file mode 100644 index 0d445aa30..000000000 --- a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto +++ /dev/null @@ -1,114 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.tendermint.v1; - -option go_package = "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/types"; - -import "tendermint/types/validator.proto"; -import "tendermint/types/types.proto"; -import "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 ics23.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/tendermint/tendermint/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; - - string client_id = 1 [(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/types/errors/errors.go b/types/errors/errors.go new file mode 100644 index 000000000..0b1962dee --- /dev/null +++ b/types/errors/errors.go @@ -0,0 +1,40 @@ +package errors + +import ( + errorsmod "cosmossdk.io/errors" +) + +const codespace = "gaia" + +var ( + // ErrTxDecode is returned if we cannot parse a transaction + ErrTxDecode = errorsmod.Register(codespace, 1, "tx parse error") + // ErrUnauthorized is used whenever a request without sufficient + // authorization is handled. + ErrUnauthorized = errorsmod.Register(codespace, 2, "unauthorized") + + // ErrInsufficientFunds is used when the account cannot pay requested amount. + ErrInsufficientFunds = errorsmod.Register(codespace, 3, "insufficient funds") + + // ErrInsufficientFunds is used when the account cannot pay requested amount. + ErrInsufficientFee = errorsmod.Register(codespace, 4, "insufficient fee") + + // ErrInvalidCoins is used when sdk.Coins are invalid. + ErrInvalidCoins = errorsmod.Register(codespace, 5, "invalid coins") + + // ErrInvalidType defines an error an invalid type. + ErrInvalidType = errorsmod.Register(codespace, 6, "invalid type") + + // ErrLogic defines an internal logic error, e.g. an invariant or assertion + // that is violated. It is a programmer error, not a user-facing error. + ErrLogic = errorsmod.Register(codespace, 7, "internal logic error") + + // ErrNotFound defines an error when requested entity doesn't exist in the state. + ErrNotFound = errorsmod.Register(codespace, 8, "not found") + + // ErrInsufficientStake is used when the account has insufficient staked tokens. + ErrInsufficientStake = errorsmod.Register(codespace, 9, "insufficient stake") + + // ErrInvalidExpeditedProposal is used when an expedite proposal is submitted for an unsupported proposal type. + ErrInvalidExpeditedProposal = errorsmod.Register(codespace, 10, "unsupported expedited proposal type") +) diff --git a/wasmbinding/README.md b/wasmbinding/README.md deleted file mode 100644 index bf32cf1a1..000000000 --- a/wasmbinding/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# CosmWasm support - -This package contains CosmWasm integration points. - -This package provides first class support for: - -- Queries - - -- Messages / Execution - - Sending tokens -## Command line interface (CLI) - -- Commands - -```sh - quasarnoded tx wasm -h -``` - -- Query - -```sh - quasarnoded query wasm -h -``` - -## Tests - -TODO diff --git a/wasmbinding/bindings/msg.go b/wasmbinding/bindings/msg.go deleted file mode 100644 index fdf74dba3..000000000 --- a/wasmbinding/bindings/msg.go +++ /dev/null @@ -1,94 +0,0 @@ -package bindings - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -type QuasarMsg struct { - /// Trigger test scenario - TestScenario *TestScenario `json:"test_scenario,omitempty"` - - /// Contracts can send tokens - SendToken *SendToken `json:"send_token,omitempty"` - - // Contracts can register interchain accounts - RegisterICAOnZone *RegisterICAOnZone `json:"register_ica_on_zone,omitempty"` - - /// Contracts can transmit JoinPool Messages over IBC - OsmosisJoinPool *OsmosisJoinPool `json:"join_pool,omitempty"` - - /// Contracts can transmit ExitPool Messages over IBC - OsmosisExitPool *OsmosisExitPool `json:"exit_pool,omitempty"` - - /// Contracts can transmit LockTokens Messages over IBC - OsmosisLockTokens *OsmosisLockTokens `json:"lock_tokens,omitempty"` - - /// Contracts can start the unbonding process over IBC - OsmosisBeginUnlocking *OsmosisBeginUnlocking `json:"begin_unlocking,omitempty"` - - // Contracts can transmit JoinSwapExternAmountIn Messages over IBC - OsmosisJoinSwapExternAmountIn *OsmosisJoinSwapExternAmountIn `json:"join_swap_extern_amount_in,omitempty"` - - // Contracts can transmit ExitSwapExternAmountOut Messages over IBC - OsmosisExitSwapExternAmountOut *OsmosisExitSwapExternAmountOut `json:"exit_swap_extern_amount_out,omitempty"` -} - -type TestScenario struct { - Scenario string `json:"scenario"` -} - -type RegisterICAOnZone struct { - ZoneId string `json:"zone_id"` -} - -type SendToken struct { - DestinationLocalZoneId string `json:"destination_local_zone_id"` - Receiver string `json:"receiver"` - Coin sdk.Coin `json:"coin"` -} - -type OsmosisJoinPool struct { - ConnectionId string `json:"connection_id"` - TimeoutTimestamp uint64 `json:"timeout_timestamp"` - PoolId uint64 `json:"pool_id"` - ShareOutAmount int64 `json:"share_out_amount"` - TokenInMaxs []sdk.Coin `json:"token_in_maxs"` -} - -type OsmosisExitPool struct { - ConnectionId string `json:"connection_id"` - TimeoutTimestamp uint64 `json:"timeout_timestamp"` - PoolId uint64 `json:"pool_id"` - ShareInAmount int64 `json:"share_in_amount"` - TokenOutMins []sdk.Coin `json:"token_out_mins"` -} - -type OsmosisLockTokens struct { - ConnectionId string `json:"connection_id"` - TimeoutTimestamp uint64 `json:"timeout_timestamp"` - Duration uint64 `json:"duration"` - Coins []sdk.Coin `json:"coins"` -} - -type OsmosisBeginUnlocking struct { - ConnectionId string `json:"connection_id"` - TimeoutTimestamp uint64 `json:"timeout_timestamp"` - Id uint64 `json:"id"` - Coins []sdk.Coin `json:"coins"` -} - -type OsmosisJoinSwapExternAmountIn struct { - ConnectionId string `json:"connection_id"` - TimeoutTimestamp uint64 `json:"timeout_timestamp"` - PoolId uint64 `json:"pool_id"` - ShareOutMinAmount int64 `json:"share_out_min_amount"` - TokenIn sdk.Coin `json:"token_in"` -} - -type OsmosisExitSwapExternAmountOut struct { - ConnectionId string `json:"connection_id"` - TimeoutTimestamp uint64 `json:"timeout_timestamp"` - PoolId uint64 `json:"pool_id"` - ShareInAmount int64 `json:"share_in_amount"` - TokenOutMins sdk.Coin `json:"token_out_mins"` -} diff --git a/wasmbinding/bindings/query.go b/wasmbinding/bindings/query.go deleted file mode 100644 index 18b8e7767..000000000 --- a/wasmbinding/bindings/query.go +++ /dev/null @@ -1,25 +0,0 @@ -package bindings - -// QuasarQuery contains quasar custom queries. -type QuasarQuery struct { - // Query all pools - PoolsRankedByAPY *PoolsRankedByAPYRequest `json:"pools_ranked_by_apy,omitempty"` - - // Query pool details - Pool *PoolRequest `json:"pool,omitempty"` - - // Query token price - TokenPrice *TokenPriceRequest `json:"token_price,omitempty"` -} - -type PoolsRankedByAPYRequest struct { - Denom string `json:"denom"` -} - -type PoolRequest struct { - Id string `json:"id"` -} - -type TokenPriceRequest struct { - Denom string `json:"denom"` -} diff --git a/wasmbinding/callback.go b/wasmbinding/callback.go deleted file mode 100644 index f94cf1e4f..000000000 --- a/wasmbinding/callback.go +++ /dev/null @@ -1,165 +0,0 @@ -package wasmbinding - -import ( - "encoding/json" - "strconv" - - wasmk "github.com/CosmWasm/wasmd/x/wasm/keeper" - "github.com/cometbft/cometbft/libs/log" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// NewCallbackPlugin if we want to use this plugin to also call the execute entrypoint, we also need to give the ContractOpsKeeper(https://github.com/CosmWasm/wasmd/blob/main/x/wasm/types/exported_keepers.go) -func NewCallbackPlugin(k *wasmk.Keeper, callBackAddress sdk.AccAddress) *CallbackPlugin { - return &CallbackPlugin{ - sentMessages: map[key]sdk.AccAddress{}, - contractKeeper: wasmk.NewDefaultPermissionKeeper(k), - callBackAddress: callBackAddress, - } -} - -type CallbackPlugin struct { - contractKeeper *wasmk.PermissionedKeeper - sentMessages map[key]sdk.AccAddress - // the address from which the smart contract will be called - callBackAddress sdk.AccAddress -} - -type key struct { - seq uint64 - channel string - portId string -} - -func (c *CallbackPlugin) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("wasm callback plugin") -} - -/* -func (c *CallbackPlugin) Handle(ctx sdk.Context, ex intergammtypes.AckExchange[*ibctransfertypes.MsgTransfer, *ibctransfertypes.MsgTransferResponse]) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "handle") -} - -func (c *CallbackPlugin) HandleAckMsgCreateBalancerPool( - ctx sdk.Context, - ex intergammtypes.AckExchange[*gammbalancer.MsgCreateBalancerPool, *gammbalancer.MsgCreateBalancerPoolResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "create_balancer_pool") -} - -func (c *CallbackPlugin) HandleAckMsgJoinPool( - ctx sdk.Context, - ex intergammtypes.AckExchange[*gammtypes.MsgJoinPool, *gammtypes.MsgJoinPoolResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "join_pool") -} - -func (c *CallbackPlugin) HandleAckMsgExitPool( - ctx sdk.Context, - ex intergammtypes.AckExchange[*gammtypes.MsgExitPool, *gammtypes.MsgExitPoolResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "exit_pool") -} - -func (c *CallbackPlugin) HandleAckMsgJoinSwapExternAmountIn( - ctx sdk.Context, - ex intergammtypes.AckExchange[*gammtypes.MsgJoinSwapExternAmountIn, *gammtypes.MsgJoinSwapExternAmountInResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "join_swap_extern_amount_in") -} - -func (c *CallbackPlugin) HandleAckMsgExitSwapExternAmountOut( - ctx sdk.Context, - ex intergammtypes.AckExchange[*gammtypes.MsgExitSwapExternAmountOut, *gammtypes.MsgExitSwapExternAmountOutResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "exit_swap_extern_amount_out") -} - -func (c *CallbackPlugin) HandleAckMsgJoinSwapShareAmountOut( - ctx sdk.Context, - ex intergammtypes.AckExchange[*gammtypes.MsgJoinSwapShareAmountOut, *gammtypes.MsgJoinSwapShareAmountOutResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "join_swap_share_amount_out") -} - -func (c *CallbackPlugin) HandleAckMsgExitSwapShareAmountIn( - ctx sdk.Context, - ex intergammtypes.AckExchange[*gammtypes.MsgExitSwapShareAmountIn, *gammtypes.MsgExitSwapShareAmountInResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "exit_swap_share_amount_in") -} - -func (c *CallbackPlugin) HandleAckMsgLockTokens( - ctx sdk.Context, - ex intergammtypes.AckExchange[*lockuptypes.MsgLockTokens, *lockuptypes.MsgLockTokensResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "lock_tokens") -} - -func (c *CallbackPlugin) HandleAckMsgBeginUnlocking( - ctx sdk.Context, - ex intergammtypes.AckExchange[*lockuptypes.MsgBeginUnlocking, *lockuptypes.MsgBeginUnlockingResponse], -) error { - return c.doHandle(ctx, ex.Sequence, ex.Channel, ex.PortId, ex.Response, "begin_unlocking") -} - -// doHandle the easiest way for the smart contract to handle the response is to -func (c *CallbackPlugin) doHandle(ctx sdk.Context, seq uint64, channel string, portId string, response proto.Message, caller string) error { - addr, exists := c.sentMessages[key{seq, channel, portId}] - if !exists { - // if the address does not exist, someone other than a smart contract called intergamm, thus we return nil. - c.Logger(ctx).Error(fmt.Sprintf("wasm callback plugin called: no sent message found for: %v", seq)) - return nil - } - - m := jsonpb.Marshaler{} - resp := new(bytes.Buffer) - err := m.Marshal(resp, response) - if err != nil { - return errorsmod.Wrap(err, "ibc ack callback marshalling") - } - - data, err := json.Marshal(ContractAck{ - AckTriggered: struct { - Sequence uint64 `json:"sequence_number"` - Error string `json:"error,omitempty"` - Response map[string]json.RawMessage `json:"response,omitempty"` - }{ - Sequence: seq, - Response: map[string]json.RawMessage{ - caller: resp.Bytes(), - }, - }, - }) - - if err != nil { - return errorsmod.Wrap(err, "ibc ack callback") - } - c.Logger(ctx).Info(fmt.Sprintf("Preparing callback message: %v", string(data))) - - _, err = c.contractKeeper.Execute(ctx, addr, c.callBackAddress, data, nil) - if err != nil { - return errorsmod.Wrap(err, "ack callback execute") - } - - return nil -} -*/ - -type ContractAck struct { - AckTriggered struct { - Sequence uint64 `json:"sequence_number"` - Error string `json:"error,omitempty"` - Response map[string]json.RawMessage `json:"response,omitempty"` - } `json:"ack"` -} - -// OnSendPacket registers a packet's sequence number and address of the corresponding wasm contract -func (c *CallbackPlugin) OnSendPacket(ctx sdk.Context, seq uint64, channel string, portID string, addr sdk.AccAddress) { - if c.sentMessages == nil { - c.sentMessages = make(map[key]sdk.AccAddress) - } - c.sentMessages[key{seq, channel, portID}] = addr - - c.Logger(ctx).Info("Registering SEQ for contract addr", strconv.FormatUint(seq, 10), addr.String()) -} diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go deleted file mode 100644 index c8be7a11d..000000000 --- a/wasmbinding/message_plugin.go +++ /dev/null @@ -1,348 +0,0 @@ -package wasmbinding - -import ( - errorsmod "cosmossdk.io/errors" - "encoding/json" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - - "github.com/quasarlabs/quasarnode/wasmbinding/bindings" -) - -func CustomMessageDecorator(bank *bankkeeper.BaseKeeper, callback *CallbackPlugin) func(wasmkeeper.Messenger) wasmkeeper.Messenger { - return func(old wasmkeeper.Messenger) wasmkeeper.Messenger { - return &CustomMessenger{ - wrapped: old, - bank: bank, - callback: callback, - } - } -} - -type CustomMessenger struct { - wrapped wasmkeeper.Messenger - bank *bankkeeper.BaseKeeper - callback *CallbackPlugin -} - -var _ wasmkeeper.Messenger = (*CustomMessenger)(nil) - -func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) ([]sdk.Event, [][]byte, error) { - if msg.Custom != nil { - // only handle the happy path where this is really creating / minting / swapping ... - // leave everything else for the wrapped version - var contractMsg bindings.QuasarMsg - if err := json.Unmarshal(msg.Custom, &contractMsg); err != nil { - return nil, nil, errorsmod.Wrap(err, "osmosis msg") - } - if contractMsg.TestScenario != nil { - return nil, nil, nil - // return m.testScenario(ctx, contractAddr, contractMsg.TestScenario) - } - - /* - if contractMsg.SendToken != nil { - return m.sendToken(ctx, contractAddr, contractMsg.SendToken) - } - - if contractMsg.RegisterICAOnZone != nil { - return m.RegisterICAOnZone(ctx, contractAddr, contractMsg.RegisterICAOnZone) - } - if contractMsg.OsmosisJoinPool != nil { - return m.OsmosisJoinPool(ctx, contractAddr, contractMsg.OsmosisJoinPool) - } - if contractMsg.OsmosisExitPool != nil { - return m.OsmosisExitPool(ctx, contractAddr, contractMsg.OsmosisExitPool) - } - if contractMsg.OsmosisLockTokens != nil { - return m.OsmosisLockTokens(ctx, contractAddr, contractMsg.OsmosisLockTokens) - } - if contractMsg.OsmosisBeginUnlocking != nil { - return m.OsmosisBeginUnlocking(ctx, contractAddr, contractMsg.OsmosisBeginUnlocking) - } - if contractMsg.OsmosisJoinSwapExternAmountIn != nil { - return m.OsmosisJoinSwapExternAmountIn(ctx, contractAddr, contractMsg.OsmosisJoinSwapExternAmountIn) - } - if contractMsg.OsmosisExitSwapExternAmountOut != nil { - return m.OsmosisExitSwapExternAmountOut(ctx, contractAddr, contractMsg.OsmosisExitSwapExternAmountOut) - } - - */ - } - return m.wrapped.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg) -} - -/* -func (m *CustomMessenger) testScenario(ctx sdk.Context, contractAddr sdk.AccAddress, testScenario *bindings.TestScenario) ([]sdk.Event, [][]byte, error) { - err := PerformTestScenario(m.intergammKeeper, ctx, contractAddr, testScenario) - // err := PerformCreateDenom(m.tokenFactory, m.bank, ctx, contractAddr, createDenom) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "perform test scenario") - } - return nil, nil, nil -} -*/ - -/* - func PerformTestScenario(k *intergammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, testScenario *bindings.TestScenario) error { - if testScenario == nil { - return wasmvmtypes.InvalidRequest{Err: "test scenario null"} - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - - msgTestScenario := intergammtypes.NewMsgTestScenario(contractAddr.String(), testScenario.Scenario) - - // msgCreateDenom := tokenfactorytypes.NewMsgCreateDenom(contractAddr.String(), createDenom.Subdenom) - - if err := msgTestScenario.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "failed validating MsgTestScenario") - } - - // Run the test scenario - _, err := msgServer.TestScenario( - sdk.WrapSDKContext(ctx), - msgTestScenario, - ) - if err != nil { - return errorsmod.Wrap(err, "running test scenario") - } - return nil - } - - -*/ - -/* -func (m *CustomMessenger) sendToken(ctx sdk.Context, contractAddr sdk.AccAddress, send *bindings.SendToken) ([]sdk.Event, [][]byte, error) { - err := PerformSendToken(m.intergammKeeper, m.bank, ctx, contractAddr, send, m.callback) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "send token") - } - return nil, nil, nil -} -*/ -/* -func PerformSendToken(k *intergammkeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, send *bindings.SendToken, cb *CallbackPlugin) error { - if send == nil { - return wasmvmtypes.InvalidRequest{Err: "send token null"} - } - sdkMsg := intergammtypes.NewMsgSendToken(contractAddr.String(), send.DestinationLocalZoneId, send.Receiver, send.Coin) - if err := sdkMsg.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "basic validate msg") - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - res, err := msgServer.SendToken(sdk.WrapSDKContext(ctx), sdkMsg) - if err != nil { - return errorsmod.Wrap(err, "sending tokens") - } - - // register the packet as sent with the callback plugin - cb.OnSendPacket(ctx, res.GetSeq(), res.Channel, res.PortId, contractAddr) - return nil -} -*/ -/* -func (m *CustomMessenger) RegisterICAOnZone(ctx sdk.Context, contractAddr sdk.Address, register *bindings.RegisterICAOnZone) ([]sdk.Event, [][]byte, error) { - err := PerformRegisterICAOnZone(m.intergammKeeper, ctx, contractAddr, register) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "register ica account") - } - return nil, nil, nil -} -*/ -/* -func PerformRegisterICAOnZone(k *intergammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.Address, register *bindings.RegisterICAOnZone) error { - if register == nil { - return wasmvmtypes.InvalidRequest{Err: "register interchain account null"} - } - - sdkMsg := intergammtypes.NewMsgRegisterICAOnZone(contractAddr.String(), register.ZoneId) - if err := sdkMsg.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "basic validate msg") - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - _, err := msgServer.RegisterICAOnZone(sdk.WrapSDKContext(ctx), sdkMsg) - if err != nil { - return errorsmod.Wrap(err, "register interchain account") - } - return nil -} - -func (m *CustomMessenger) OsmosisJoinPool(ctx sdk.Context, contractAddr sdk.AccAddress, join *bindings.OsmosisJoinPool) ([]sdk.Event, [][]byte, error) { - err := PerformOsmosisJoinPool(m.intergammKeeper, ctx, contractAddr, join, m.callback) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "join pool") - } - return nil, nil, nil -} - -func PerformOsmosisJoinPool(k *intergammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, join *bindings.OsmosisJoinPool, cb *CallbackPlugin) error { - if join == nil { - return wasmvmtypes.InvalidRequest{Err: "join pool null"} - } - - // TODO see if hardcoding creator like this works - sdkMsg := intergammtypes.NewMsgTransmitIbcJoinPool(contractAddr.String(), join.ConnectionId, join.TimeoutTimestamp, join.PoolId, join.ShareOutAmount, join.TokenInMaxs) - if err := sdkMsg.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "basic validate msg") - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - res, err := msgServer.TransmitIbcJoinPool(sdk.WrapSDKContext(ctx), sdkMsg) - if err != nil { - return errorsmod.Wrap(err, "join pool") - } - - cb.OnSendPacket(ctx, res.Seq, res.Channel, res.PortId, contractAddr) - return nil -} - -func (m *CustomMessenger) OsmosisExitPool(ctx sdk.Context, contractAddr sdk.AccAddress, exit *bindings.OsmosisExitPool) ([]sdk.Event, [][]byte, error) { - err := PerformOsmosisExitPool(m.intergammKeeper, ctx, contractAddr, exit, m.callback) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "exit pool") - } - return nil, nil, nil -} - -func PerformOsmosisExitPool(k *intergammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, exit *bindings.OsmosisExitPool, cb *CallbackPlugin) error { - if exit == nil { - return wasmvmtypes.InvalidRequest{Err: "exit pool null"} - } - - sdkMsg := intergammtypes.NewMsgTransmitIbcExitPool(contractAddr.String(), exit.ConnectionId, exit.TimeoutTimestamp, exit.PoolId, exit.ShareInAmount, exit.TokenOutMins) - if err := sdkMsg.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "basic validate msg") - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - res, err := msgServer.TransmitIbcExitPool(sdk.WrapSDKContext(ctx), sdkMsg) - if err != nil { - return errorsmod.Wrap(err, "exit pool") - } - - cb.OnSendPacket(ctx, res.GetSeq(), res.Channel, res.PortId, contractAddr) - return nil -} - -func (m *CustomMessenger) OsmosisLockTokens(ctx sdk.Context, contractAddr sdk.AccAddress, withdraw *bindings.OsmosisLockTokens) ([]sdk.Event, [][]byte, error) { - err := PerformOsmosisLockTokens(m.intergammKeeper, ctx, contractAddr, withdraw, m.callback) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "withdraw") - } - return nil, nil, nil -} - -func PerformOsmosisLockTokens(k *intergammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, lock *bindings.OsmosisLockTokens, cb *CallbackPlugin) error { - if lock == nil { - return wasmvmtypes.InvalidRequest{Err: "withdraw null"} - } - - // TODO: lets make sure the way we do durations is correct - sdkMsg := intergammtypes.NewMsgTransmitIbcLockTokens(contractAddr.String(), lock.ConnectionId, lock.TimeoutTimestamp, time.Duration(lock.Duration), lock.Coins) - if err := sdkMsg.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "basic validate msg") - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - res, err := msgServer.TransmitIbcLockTokens(sdk.WrapSDKContext(ctx), sdkMsg) - if err != nil { - return errorsmod.Wrap(err, "lock tokens") - } - - cb.OnSendPacket(ctx, res.GetSeq(), res.Channel, res.PortId, contractAddr) - return nil -} - -func (m *CustomMessenger) OsmosisBeginUnlocking(ctx sdk.Context, contractAddr sdk.AccAddress, begin *bindings.OsmosisBeginUnlocking) ([]sdk.Event, [][]byte, error) { - err := PerformOsmosisBeginUnlocking(m.intergammKeeper, ctx, contractAddr, begin, m.callback) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "begin unlocking") - } - return nil, nil, nil -} - -func PerformOsmosisBeginUnlocking(k *intergammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, begin *bindings.OsmosisBeginUnlocking, cb *CallbackPlugin) error { - if begin == nil { - return wasmvmtypes.InvalidRequest{Err: "begin unlocking null"} - } - - sdkMsg := intergammtypes.NewMsgTransmitIbcBeginUnlocking(contractAddr.String(), begin.ConnectionId, begin.TimeoutTimestamp, begin.Id, begin.Coins) - if err := sdkMsg.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "basic validate msg") - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - res, err := msgServer.TransmitIbcBeginUnlocking(sdk.WrapSDKContext(ctx), sdkMsg) - if err != nil { - return errorsmod.Wrap(err, "begin unlocking") - } - - cb.OnSendPacket(ctx, res.GetSeq(), res.Channel, res.PortId, contractAddr) - return nil -} - -func (m *CustomMessenger) OsmosisJoinSwapExternAmountIn(ctx sdk.Context, contractAddr sdk.AccAddress, join *bindings.OsmosisJoinSwapExternAmountIn) ([]sdk.Event, [][]byte, error) { - err := PerformOsmosisJoinSwapExternAmountIn(m.intergammKeeper, ctx, contractAddr, join, m.callback) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "join swap extern amount in") - } - return nil, nil, nil -} - -func PerformOsmosisJoinSwapExternAmountIn(k *intergammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, join *bindings.OsmosisJoinSwapExternAmountIn, cb *CallbackPlugin) error { - if join == nil { - return wasmvmtypes.InvalidRequest{Err: "join swap extern amount in null"} - } - - sdkMsg := intergammtypes.NewMsgTransmitIbcJoinSwapExternAmountIn(contractAddr.String(), join.ConnectionId, join.TimeoutTimestamp, join.PoolId, join.ShareOutMinAmount, join.TokenIn) - if err := sdkMsg.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "basic validate msg") - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - res, err := msgServer.TransmitIbcJoinSwapExternAmountIn(sdk.WrapSDKContext(ctx), sdkMsg) - if err != nil { - return errorsmod.Wrap(err, "join swap extern amount in") - } - - cb.OnSendPacket(ctx, res.GetSeq(), res.Channel, res.PortId, contractAddr) - - return nil -} - -func (m *CustomMessenger) OsmosisExitSwapExternAmountOut(ctx sdk.Context, contractAddr sdk.AccAddress, exit *bindings.OsmosisExitSwapExternAmountOut) ([]sdk.Event, [][]byte, error) { - err := PerformOsmosisExitSwapExternAmountOut(m.intergammKeeper, ctx, contractAddr, exit, m.callback) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "exit swap extern amount out") - } - return nil, nil, nil -} - -func PerformOsmosisExitSwapExternAmountOut(k *intergammkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, exit *bindings.OsmosisExitSwapExternAmountOut, cb *CallbackPlugin) error { - if exit == nil { - return wasmvmtypes.InvalidRequest{Err: "exit swap extern amount out null"} - } - - sdkMsg := intergammtypes.NewMsgTransmitIbcExitSwapExternAmountOut(contractAddr.String(), exit.ConnectionId, exit.TimeoutTimestamp, exit.PoolId, exit.ShareInAmount, exit.TokenOutMins) - if err := sdkMsg.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "basic validate msg") - } - - msgServer := intergammkeeper.NewMsgServerImpl(k) - res, err := msgServer.TransmitIbcExitSwapExternAmountOut(sdk.WrapSDKContext(ctx), sdkMsg) - if err != nil { - return errorsmod.Wrap(err, "join swap extern amount out") - } - - cb.OnSendPacket(ctx, res.GetSeq(), res.Channel, res.PortId, contractAddr) - - return nil -} -*/ diff --git a/wasmbinding/query_plugin.go b/wasmbinding/query_plugin.go deleted file mode 100644 index 950f7a517..000000000 --- a/wasmbinding/query_plugin.go +++ /dev/null @@ -1,59 +0,0 @@ -package wasmbinding - -import ( - errorsmod "cosmossdk.io/errors" - "encoding/json" - - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/quasarlabs/quasarnode/wasmbinding/bindings" - qoraclekeeper "github.com/quasarlabs/quasarnode/x/qoracle/keeper" -) - -func CustomQuerier(qk qoraclekeeper.Keeper) func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { - return func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { - var contractQuery bindings.QuasarQuery - if err := json.Unmarshal(request, &contractQuery); err != nil { - return nil, errorsmod.Wrap(err, "osmosis query") - } - - switch { - case contractQuery.PoolsRankedByAPY != nil: - pools := qk.GetPoolsRankedByAPY(ctx, contractQuery.PoolsRankedByAPY.Denom) - - bz, err := json.Marshal(pools) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to marshal quasar qoracle pools") - } - return bz, nil - case contractQuery.Pool != nil: - pool, found := qk.GetPool(ctx, contractQuery.Pool.Id) - if !found { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "pool not found") - } - - bz, err := json.Marshal(pool) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to marshal quasar pool") - } - return bz, nil - /* - case contractQuery.TokenPrice != nil: - price, err := qk.GetDenomPrice(ctx, contractQuery.TokenPrice.Denom) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to get token price") - } - - bz, err := price.MarshalJSON() - if err != nil { - return nil, errorsmod.Wrap(err, "failed to marshal quasar token price") - } - return bz, nil - - */ - default: - return nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown custom query variant"} - } - } -} diff --git a/wasmbinding/wasm.go b/wasmbinding/wasm.go deleted file mode 100644 index b598ea589..000000000 --- a/wasmbinding/wasm.go +++ /dev/null @@ -1,27 +0,0 @@ -package wasmbinding - -import ( - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - - qoraclekeeper "github.com/quasarlabs/quasarnode/x/qoracle/keeper" -) - -func RegisterCustomPlugins( - // intergammKeeper *intergammkeeper.Keeper, - qoracleKeeper qoraclekeeper.Keeper, - bank *bankkeeper.BaseKeeper, - callback *CallbackPlugin, -) []wasmkeeper.Option { - queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{ - Custom: CustomQuerier(qoracleKeeper), - }) - messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator( - CustomMessageDecorator(bank, callback), - ) - - return []wasmkeeper.Option{ - queryPluginOpt, - messengerDecoratorOpt, - } -} diff --git a/wasmbindings/stargate_allowlist.go b/wasmbindings/stargate_allowlist.go new file mode 100644 index 000000000..6edc08043 --- /dev/null +++ b/wasmbindings/stargate_allowlist.go @@ -0,0 +1,36 @@ +package wasmbindings + +import ( + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + tokenfactorytypes "github.com/quasar-finance/quasar/x/tokenfactory/types" +) + +func AcceptedStargateQueries() wasmkeeper.AcceptedQueries { + return wasmkeeper.AcceptedQueries{ + //ibc + "/ibc.core.client.v1.Query/ClientState": &ibcclienttypes.QueryClientStateResponse{}, + "/ibc.core.client.v1.Query/ConsensusState": &ibcclienttypes.QueryConsensusStateResponse{}, + "/ibc.core.connection.v1.Query/Connection": &ibcconnectiontypes.QueryConnectionResponse{}, + "/ibc.core.channel.v1.Query/ChannelClientState": &ibcchanneltypes.QueryChannelClientStateResponse{}, + + //token factory + // token factory + "/quasar.tokenfactory.v1beta1.Query/Params": &tokenfactorytypes.QueryParamsResponse{}, + "/quasar.tokenfactory.v1beta1.Query/DenomAuthorityMetadata": &tokenfactorytypes.QueryDenomAuthorityMetadataResponse{}, + "/quasar.tokenfactory.v1beta1.Query/DenomsFromCreator": &tokenfactorytypes.QueryDenomsFromCreatorResponse{}, + "/quasar.tokenfactory.v1beta1.Query/BeforeSendHookAddress": &tokenfactorytypes.QueryBeforeSendHookAddressResponse{}, + + // interchain accounts + "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount": &icacontrollertypes.QueryInterchainAccountResponse{}, + + // transfer + "/ibc.applications.transfer.v1.Query/DenomTrace": &ibctransfertypes.QueryDenomTraceResponse{}, + + // TODO: after adding slinky or any other module, add the required queries here + } +} diff --git a/x/epochs/abci.go b/x/epochs/abci.go index 81277c3db..018a8f596 100644 --- a/x/epochs/abci.go +++ b/x/epochs/abci.go @@ -6,13 +6,12 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/epochs/keeper" - "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasar-finance/quasar/x/epochs/keeper" + "github.com/quasar-finance/quasar/x/epochs/types" ) // BeginBlocker of epochs module. -func BeginBlocker(ctx sdk.Context, k *keeper.Keeper) { +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) k.IterateEpochInfo(ctx, func(index int64, epochInfo types.EpochInfo) (stop bool) { logger := k.Logger(ctx) diff --git a/x/epochs/abci_test.go b/x/epochs/abci_test.go index 6482c1716..b4e8f98b8 100644 --- a/x/epochs/abci_test.go +++ b/x/epochs/abci_test.go @@ -4,11 +4,10 @@ import ( "testing" "time" + "github.com/quasar-finance/quasar/testutil" + "github.com/quasar-finance/quasar/x/epochs" + "github.com/quasar-finance/quasar/x/epochs/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/epochs" - "github.com/quasarlabs/quasarnode/x/epochs/types" ) func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { @@ -33,7 +32,7 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) epochInfo = k.GetEpochInfo(ctx, "monthly") }, }, @@ -44,7 +43,7 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) epochInfo = k.GetEpochInfo(ctx, "monthly") }, }, @@ -55,9 +54,9 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 31)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) epochInfo = k.GetEpochInfo(ctx, "monthly") }, }, @@ -69,9 +68,9 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 32)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) epochInfo = k.GetEpochInfo(ctx, "monthly") }, }, @@ -82,11 +81,11 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 32)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) ctx.WithBlockHeight(4).WithBlockTime(now.Add(time.Hour * 24 * 33)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) epochInfo = k.GetEpochInfo(ctx, "monthly") }, }, @@ -97,13 +96,13 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 32)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) numBlocksSinceStart, _ := k.NumBlocksSinceEpochStart(ctx, "monthly") require.Equal(t, int64(0), numBlocksSinceStart) ctx = ctx.WithBlockHeight(4).WithBlockTime(now.Add(time.Hour * 24 * 33)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) epochInfo = k.GetEpochInfo(ctx, "monthly") numBlocksSinceStart, _ = k.NumBlocksSinceEpochStart(ctx, "monthly") require.Equal(t, int64(1), numBlocksSinceStart) @@ -189,7 +188,7 @@ func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { // after 1 week ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(week)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) // epoch not started yet epochInfo = k.GetEpochInfo(ctx, "monthly") @@ -200,7 +199,7 @@ func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { // after 1 month ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(month)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) // epoch started epochInfo = k.GetEpochInfo(ctx, "monthly") @@ -243,11 +242,11 @@ func TestLegacyEpochSerialization(t *testing.T) { // Do not increment epoch ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) // Increment epoch ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 32)) - epochs.BeginBlocker(ctx, k) + epochs.BeginBlocker(ctx, *k) epochInfo := k.GetEpochInfo(ctx, "monthly") require.NotEqual(t, epochInfo.CurrentEpochStartHeight, int64(0)) diff --git a/x/epochs/client/cli/query.go b/x/epochs/client/cli/query.go index 37abee4ea..b3468be84 100644 --- a/x/epochs/client/cli/query.go +++ b/x/epochs/client/cli/query.go @@ -7,9 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" + "github.com/quasar-finance/quasar/x/epochs/types" "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/epochs/types" ) // GetQueryCmd returns the cli query commands for this module. diff --git a/x/epochs/client/cli/tx.go b/x/epochs/client/cli/tx.go index c00d9f824..48a0ba92f 100644 --- a/x/epochs/client/cli/tx.go +++ b/x/epochs/client/cli/tx.go @@ -4,9 +4,8 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/client" + "github.com/quasar-finance/quasar/x/epochs/types" "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/epochs/types" ) // GetTxCmd returns the transaction commands for this module. diff --git a/x/epochs/genesis.go b/x/epochs/genesis.go index cca73f7c5..82880ced7 100644 --- a/x/epochs/genesis.go +++ b/x/epochs/genesis.go @@ -2,9 +2,8 @@ package epochs import ( sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/epochs/keeper" - "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasar-finance/quasar/x/epochs/keeper" + "github.com/quasar-finance/quasar/x/epochs/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/epochs/genesis_test.go b/x/epochs/genesis_test.go index 2b583be7a..4b489d12e 100644 --- a/x/epochs/genesis_test.go +++ b/x/epochs/genesis_test.go @@ -4,11 +4,10 @@ import ( "testing" "time" + "github.com/quasar-finance/quasar/testutil" + "github.com/quasar-finance/quasar/x/epochs" + "github.com/quasar-finance/quasar/x/epochs/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/epochs" - "github.com/quasarlabs/quasarnode/x/epochs/types" ) func TestEpochsExportGenesis(t *testing.T) { diff --git a/x/epochs/handler.go b/x/epochs/handler.go index 1b2e235bd..232e7a87f 100644 --- a/x/epochs/handler.go +++ b/x/epochs/handler.go @@ -1,14 +1,14 @@ package epochs +/* import ( - errorsmod "cosmossdk.io/errors" "fmt" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/quasarlabs/quasarnode/x/epochs/keeper" - "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasar-finance/quasar/x/epochs/keeper" + "github.com/quasar-finance/quasar/x/epochs/types" ) // NewHandler returns a handler for epochs module messages. @@ -21,3 +21,4 @@ func NewHandler(k *keeper.Keeper) sdk.Handler { } } } +*/ diff --git a/x/epochs/keeper/abci.go b/x/epochs/keeper/abci.go new file mode 100644 index 000000000..e2204fef3 --- /dev/null +++ b/x/epochs/keeper/abci.go @@ -0,0 +1,64 @@ +package keeper + +import ( + "fmt" + "time" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasar-finance/quasar/x/epochs/types" +) + +// BeginBlocker of epochs module. +func (k Keeper) BeginBlocker(ctx sdk.Context) { + defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + k.IterateEpochInfo(ctx, func(index int64, epochInfo types.EpochInfo) (stop bool) { + logger := k.Logger(ctx) + + // If blocktime < initial epoch start time, return + if ctx.BlockTime().Before(epochInfo.StartTime) { + return + } + // if epoch counting hasn't started, signal we need to start. + shouldInitialEpochStart := !epochInfo.EpochCountingStarted + + epochEndTime := epochInfo.CurrentEpochStartTime.Add(epochInfo.Duration) + shouldEpochStart := (ctx.BlockTime().After(epochEndTime)) || shouldInitialEpochStart + + if !shouldEpochStart { + return false + } + epochInfo.CurrentEpochStartHeight = ctx.BlockHeight() + + if shouldInitialEpochStart { + epochInfo.EpochCountingStarted = true + epochInfo.CurrentEpoch = 1 + epochInfo.CurrentEpochStartTime = epochInfo.StartTime + logger.Info(fmt.Sprintf("Starting new epoch with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } else { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeEpochEnd, + sdk.NewAttribute(types.AttributeEpochNumber, fmt.Sprintf("%d", epochInfo.CurrentEpoch)), + ), + ) + k.AfterEpochEnd(ctx, epochInfo.Identifier, epochInfo.CurrentEpoch) + epochInfo.CurrentEpoch += 1 + epochInfo.CurrentEpochStartTime = epochInfo.CurrentEpochStartTime.Add(epochInfo.Duration) + logger.Info(fmt.Sprintf("Starting epoch with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } + + // emit new epoch start event, set epoch info, and run BeforeEpochStart hook + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeEpochStart, + sdk.NewAttribute(types.AttributeEpochNumber, fmt.Sprintf("%d", epochInfo.CurrentEpoch)), + sdk.NewAttribute(types.AttributeEpochStartTime, fmt.Sprintf("%d", epochInfo.CurrentEpochStartTime.Unix())), + ), + ) + k.SetEpochInfo(ctx, epochInfo) + k.BeforeEpochStart(ctx, epochInfo.Identifier, epochInfo.CurrentEpoch) + + return false + }) +} diff --git a/x/epochs/keeper/epoch.go b/x/epochs/keeper/epoch.go index 96749b132..775911d2c 100644 --- a/x/epochs/keeper/epoch.go +++ b/x/epochs/keeper/epoch.go @@ -4,10 +4,10 @@ import ( "fmt" "time" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/gogoproto/proto" - - "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasar-finance/quasar/x/epochs/types" ) // GetEpochInfo returns epoch info by identifier. @@ -67,7 +67,7 @@ func (k Keeper) DeleteEpochInfo(ctx sdk.Context, identifier string) { func (k Keeper) IterateEpochInfo(ctx sdk.Context, fn func(index int64, epochInfo types.EpochInfo) (stop bool)) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixEpoch) + iterator := storetypes.KVStorePrefixIterator(store, types.KeyPrefixEpoch) defer iterator.Close() i := int64(0) diff --git a/x/epochs/keeper/epoch_test.go b/x/epochs/keeper/epoch_test.go index 8c4eec52a..1d04a63c2 100644 --- a/x/epochs/keeper/epoch_test.go +++ b/x/epochs/keeper/epoch_test.go @@ -4,11 +4,10 @@ import ( "testing" "time" + "github.com/quasar-finance/quasar/testutil" + "github.com/quasar-finance/quasar/x/epochs" + "github.com/quasar-finance/quasar/x/epochs/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/epochs" - "github.com/quasarlabs/quasarnode/x/epochs/types" ) func TestEpochLifeCycle(t *testing.T) { diff --git a/x/epochs/keeper/grpc_query.go b/x/epochs/keeper/grpc_query.go index 57d0b031f..f010df710 100644 --- a/x/epochs/keeper/grpc_query.go +++ b/x/epochs/keeper/grpc_query.go @@ -3,12 +3,11 @@ package keeper import ( "context" "errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasar-finance/quasar/x/epochs/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) var _ types.QueryServer = Querier{} @@ -16,10 +15,10 @@ var _ types.QueryServer = Querier{} // Querier defines a wrapper around the x/epochs keeper providing gRPC method // handlers. type Querier struct { - *Keeper + Keeper } -func NewQuerier(k *Keeper) Querier { +func NewQuerier(k Keeper) Querier { return Querier{Keeper: k} } diff --git a/x/epochs/keeper/grpc_query_test.go b/x/epochs/keeper/grpc_query_test.go index 8461de2e5..f15b7b712 100644 --- a/x/epochs/keeper/grpc_query_test.go +++ b/x/epochs/keeper/grpc_query_test.go @@ -2,30 +2,26 @@ package keeper_test import ( "testing" - "time" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasar-finance/quasar/testutil" + "github.com/quasar-finance/quasar/x/epochs" + "github.com/quasar-finance/quasar/x/epochs/keeper" + "github.com/quasar-finance/quasar/x/epochs/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/epochs" - "github.com/quasarlabs/quasarnode/x/epochs/keeper" - "github.com/quasarlabs/quasarnode/x/epochs/types" ) func TestQueryEpochInfos(t *testing.T) { setup := testutil.NewTestSetup(t) ctx, k := setup.Ctx, setup.Keepers.EpochsKeeper epochs.InitGenesis(ctx, k, *types.DefaultGenesis()) - goCtx := sdk.WrapSDKContext(ctx) chainStartTime := ctx.BlockTime() - querier := keeper.NewQuerier(k) + querier := keeper.NewQuerier(*k) // Invalid param - epochInfosResponse, err := querier.EpochInfos(goCtx, &types.QueryEpochsInfoRequest{}) + epochInfosResponse, err := querier.EpochInfos(ctx, &types.QueryEpochsInfoRequest{}) require.NoError(t, err) require.Len(t, epochInfosResponse.Epochs, 4) diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go index db04421bb..564a03c7b 100644 --- a/x/epochs/keeper/keeper.go +++ b/x/epochs/keeper/keeper.go @@ -3,17 +3,17 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + // "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasar-finance/quasar/x/epochs/types" ) type ( Keeper struct { - cdc codec.Codec + // cdc codec.Codec storeKey storetypes.StoreKey hooks types.EpochHooks } @@ -21,7 +21,7 @@ type ( func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey) *Keeper { return &Keeper{ - cdc: cdc, + // cdc: cdc, storeKey: storeKey, } } diff --git a/x/epochs/module.go b/x/epochs/module.go index 9ffd052ba..e0eeef300 100644 --- a/x/epochs/module.go +++ b/x/epochs/module.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/appmodule" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -14,17 +14,21 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/quasar-finance/quasar/x/epochs/client/cli" + "github.com/quasar-finance/quasar/x/epochs/keeper" + "github.com/quasar-finance/quasar/x/epochs/simulation" + "github.com/quasar-finance/quasar/x/epochs/types" "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/epochs/client/cli" - "github.com/quasarlabs/quasarnode/x/epochs/keeper" - "github.com/quasarlabs/quasarnode/x/epochs/simulation" - "github.com/quasarlabs/quasarnode/x/epochs/types" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasGenesisBasics = AppModuleBasic{} + + _ appmodule.AppModule = AppModule{} + _ module.HasConsensusVersion = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} ) // ---------------------------------------------------------------------------- @@ -33,11 +37,12 @@ var ( // AppModuleBasic implements the AppModuleBasic interface for the capability module. type AppModuleBasic struct { - cdc codec.Codec + // cdc codec.Codec } -func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} +func NewAppModuleBasic() AppModuleBasic { + // return AppModuleBasic{cdc: cdc} + return AppModuleBasic{} } // Name returns the capability module's name. @@ -101,16 +106,22 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { type AppModule struct { AppModuleBasic - keeper *keeper.Keeper + keeper keeper.Keeper } -func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper) AppModule { +func NewAppModule(keeper keeper.Keeper) AppModule { return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), + AppModuleBasic: NewAppModuleBasic(), keeper: keeper, } } +// 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 capability module's name. func (am AppModule) Name() string { return am.AppModuleBasic.Name() @@ -130,32 +141,33 @@ func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { +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) - InitGenesis(ctx, am.keeper, genState) - - return []abci.ValidatorUpdate{} + InitGenesis(ctx, &am.keeper, genState) } // ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - genState := ExportGenesis(ctx, am.keeper) + genState := ExportGenesis(ctx, &am.keeper) return cdc.MustMarshalJSON(genState) } -// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - BeginBlocker(ctx, am.keeper) +func (am AppModule) BeginBlock(context context.Context) error { + ctx := sdk.UnwrapSDKContext(context) + am.keeper.BeginBlocker(ctx) + return nil } +/* // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } +*/ // ___________________________________________________________________________ @@ -172,8 +184,7 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We } // RegisterStoreDecoder registers a decoder for supply module's types. -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -} +// func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { diff --git a/x/epochs/simulation/genesis.go b/x/epochs/simulation/genesis.go index 50548b00c..186dd7677 100644 --- a/x/epochs/simulation/genesis.go +++ b/x/epochs/simulation/genesis.go @@ -8,8 +8,7 @@ import ( "time" "github.com/cosmos/cosmos-sdk/types/module" - - "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasar-finance/quasar/x/epochs/types" ) // RandomizedGenState generates a random GenesisState for mint. diff --git a/x/epochs/types/codec.go b/x/epochs/types/codec.go index a7a04d308..e2abb411f 100644 --- a/x/epochs/types/codec.go +++ b/x/epochs/types/codec.go @@ -10,8 +10,3 @@ func RegisterCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { } - -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(amino) -) diff --git a/x/epochs/types/genesis.pb.go b/x/epochs/types/genesis.pb.go index cdd89feda..23ab79fd7 100644 --- a/x/epochs/types/genesis.pb.go +++ b/x/epochs/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/epochs/genesis.proto +// source: quasar/epochs/v1beta1/genesis.proto package types @@ -42,7 +42,7 @@ func (m *EpochInfo) Reset() { *m = EpochInfo{} } func (m *EpochInfo) String() string { return proto.CompactTextString(m) } func (*EpochInfo) ProtoMessage() {} func (*EpochInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_b6dd69dcf7d929bd, []int{0} + return fileDescriptor_ee05c986a34052a9, []int{0} } func (m *EpochInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -129,7 +129,7 @@ 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_b6dd69dcf7d929bd, []int{1} + return fileDescriptor_ee05c986a34052a9, []int{1} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -166,46 +166,46 @@ func (m *GenesisState) GetEpochs() []EpochInfo { } func init() { - proto.RegisterType((*EpochInfo)(nil), "quasarlabs.quasarnode.epochs.EpochInfo") - proto.RegisterType((*GenesisState)(nil), "quasarlabs.quasarnode.epochs.GenesisState") + proto.RegisterType((*EpochInfo)(nil), "quasar.epochs.v1beta1.EpochInfo") + proto.RegisterType((*GenesisState)(nil), "quasar.epochs.v1beta1.GenesisState") } func init() { - proto.RegisterFile("quasarlabs/quasarnode/epochs/genesis.proto", fileDescriptor_b6dd69dcf7d929bd) -} - -var fileDescriptor_b6dd69dcf7d929bd = []byte{ - // 473 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x31, 0x8f, 0xd3, 0x30, - 0x14, 0xae, 0x69, 0x29, 0xa9, 0xef, 0x10, 0x60, 0x1d, 0x10, 0x2a, 0x48, 0xa2, 0x30, 0x10, 0x01, - 0x72, 0xc4, 0xc1, 0x04, 0x5b, 0xe1, 0x04, 0xc7, 0x98, 0x82, 0x84, 0x58, 0xaa, 0xb4, 0x75, 0x13, - 0x4b, 0x4d, 0x1c, 0xe2, 0x17, 0x89, 0x6e, 0xfc, 0x84, 0x8e, 0xfc, 0xa4, 0x1b, 0x6f, 0x64, 0x0a, - 0xa8, 0xdd, 0x18, 0xef, 0x17, 0xa0, 0xd8, 0x49, 0x5b, 0xb8, 0x03, 0x36, 0xfb, 0x7d, 0xdf, 0xfb, - 0x3e, 0xbf, 0x4f, 0xcf, 0xf8, 0xe1, 0xa7, 0x22, 0x94, 0x61, 0x3e, 0x0f, 0xc7, 0xd2, 0xd7, 0xc7, - 0x54, 0x4c, 0x99, 0xcf, 0x32, 0x31, 0x89, 0xa5, 0x1f, 0xb1, 0x94, 0x49, 0x2e, 0x69, 0x96, 0x0b, - 0x10, 0xe4, 0xee, 0x96, 0x4b, 0xb7, 0x5c, 0xaa, 0xb9, 0xfd, 0x83, 0x48, 0x44, 0x42, 0x11, 0xfd, - 0xea, 0xa4, 0x7b, 0xfa, 0x56, 0x24, 0x44, 0x34, 0x67, 0xbe, 0xba, 0x8d, 0x8b, 0x99, 0x3f, 0x2d, - 0xf2, 0x10, 0xb8, 0x48, 0x6b, 0xdc, 0xfe, 0x13, 0x07, 0x9e, 0x30, 0x09, 0x61, 0x92, 0x69, 0x82, - 0xbb, 0xec, 0xe0, 0xde, 0x51, 0xe5, 0x70, 0x9c, 0xce, 0x04, 0xb1, 0x30, 0xe6, 0x53, 0x96, 0x02, - 0x9f, 0x71, 0x96, 0x9b, 0xc8, 0x41, 0x5e, 0x2f, 0xd8, 0xa9, 0x90, 0x0f, 0x18, 0x4b, 0x08, 0x73, - 0x18, 0x55, 0x32, 0xe6, 0x25, 0x07, 0x79, 0x7b, 0x87, 0x7d, 0xaa, 0x3d, 0x68, 0xe3, 0x41, 0xdf, - 0x35, 0x1e, 0x83, 0x7b, 0x27, 0xa5, 0xdd, 0x3a, 0x2b, 0xed, 0x1b, 0x8b, 0x30, 0x99, 0x3f, 0x77, - 0xb7, 0xbd, 0xee, 0xf2, 0xbb, 0x8d, 0x82, 0x9e, 0x2a, 0x54, 0x74, 0x12, 0x63, 0xa3, 0x79, 0xba, - 0xd9, 0x56, 0xba, 0x77, 0xce, 0xe9, 0xbe, 0xaa, 0x09, 0x83, 0x27, 0x95, 0xec, 0xcf, 0xd2, 0x26, - 0x4d, 0xcb, 0x63, 0x91, 0x70, 0x60, 0x49, 0x06, 0x8b, 0xb3, 0xd2, 0xbe, 0xa6, 0xcd, 0x1a, 0xcc, - 0xfd, 0x5a, 0x59, 0x6d, 0xd4, 0xc9, 0x7d, 0x7c, 0x75, 0x52, 0xe4, 0x39, 0x4b, 0x61, 0xa4, 0xa2, - 0x35, 0x3b, 0x0e, 0xf2, 0xda, 0xc1, 0x7e, 0x5d, 0x54, 0x61, 0x90, 0x2f, 0x08, 0x9b, 0xbf, 0xb1, - 0x46, 0x3b, 0x73, 0x5f, 0xfe, 0xef, 0xdc, 0x8f, 0xea, 0xb9, 0x6d, 0xfd, 0x94, 0xbf, 0x29, 0xe9, - 0x14, 0x6e, 0xee, 0x3a, 0x0f, 0x37, 0x89, 0x3c, 0xc3, 0xb7, 0x34, 0x7f, 0x22, 0x8a, 0x14, 0x78, - 0x1a, 0xe9, 0x46, 0x36, 0x35, 0xbb, 0x0e, 0xf2, 0x8c, 0xe0, 0x40, 0xa1, 0x2f, 0x6b, 0x70, 0xa8, - 0x31, 0xf2, 0x02, 0xf7, 0x2f, 0x72, 0x8b, 0x19, 0x8f, 0x62, 0x30, 0x0d, 0x35, 0xea, 0xed, 0x73, - 0x86, 0x6f, 0x14, 0xfc, 0xb6, 0x63, 0x5c, 0xb9, 0x6e, 0xb8, 0xef, 0xf1, 0xfe, 0x6b, 0xbd, 0x98, - 0x43, 0x08, 0x81, 0x91, 0x23, 0xdc, 0xd5, 0x3b, 0x68, 0x22, 0xa7, 0xed, 0xed, 0x1d, 0x3e, 0xa0, - 0xff, 0x5a, 0x54, 0xba, 0xd9, 0xa6, 0x41, 0xa7, 0x4a, 0x21, 0xa8, 0x9b, 0x07, 0xc7, 0x27, 0x2b, - 0x0b, 0x9d, 0xae, 0x2c, 0xf4, 0x63, 0x65, 0xa1, 0xe5, 0xda, 0x6a, 0x9d, 0xae, 0xad, 0xd6, 0xb7, - 0xb5, 0xd5, 0xfa, 0xe8, 0x47, 0x1c, 0xe2, 0x62, 0x4c, 0x27, 0x22, 0xf1, 0x2f, 0xfe, 0x2f, 0x9f, - 0x9b, 0x1f, 0x03, 0x8b, 0x8c, 0xc9, 0x71, 0x57, 0x45, 0xfe, 0xf4, 0x57, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x27, 0x49, 0x1d, 0xa0, 0x5e, 0x03, 0x00, 0x00, + proto.RegisterFile("quasar/epochs/v1beta1/genesis.proto", fileDescriptor_ee05c986a34052a9) +} + +var fileDescriptor_ee05c986a34052a9 = []byte{ + // 479 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x31, 0x8f, 0xd3, 0x30, + 0x14, 0xc7, 0x6b, 0x5a, 0x4a, 0xea, 0x3b, 0x04, 0x58, 0x77, 0x10, 0x2a, 0x91, 0x44, 0xb9, 0x25, + 0x12, 0x60, 0xab, 0x07, 0x13, 0x48, 0x0c, 0x05, 0x04, 0xc7, 0xc0, 0x90, 0x32, 0x20, 0x96, 0xca, + 0x4d, 0xdd, 0xc4, 0xd2, 0xc5, 0x0e, 0x89, 0x83, 0xe8, 0xc6, 0x47, 0xe8, 0xc8, 0x47, 0xba, 0xf1, + 0x46, 0xa6, 0x82, 0xda, 0x8d, 0xf1, 0x3e, 0x01, 0x8a, 0x9d, 0x94, 0xc2, 0x15, 0xb1, 0xc5, 0xfe, + 0xff, 0xde, 0xff, 0xef, 0xf7, 0xf4, 0x02, 0x8f, 0x3e, 0x96, 0xb4, 0xa0, 0x39, 0x61, 0x99, 0x8c, + 0x92, 0x82, 0x7c, 0x1a, 0x4c, 0x98, 0xa2, 0x03, 0x12, 0x33, 0xc1, 0x0a, 0x5e, 0xe0, 0x2c, 0x97, + 0x4a, 0xa2, 0x43, 0x03, 0x61, 0x03, 0xe1, 0x1a, 0xea, 0x1f, 0xc4, 0x32, 0x96, 0x9a, 0x20, 0xd5, + 0x97, 0x81, 0xfb, 0x4e, 0x2c, 0x65, 0x7c, 0xca, 0x88, 0x3e, 0x4d, 0xca, 0x19, 0x99, 0x96, 0x39, + 0x55, 0x5c, 0x8a, 0x5a, 0x77, 0xff, 0xd6, 0x15, 0x4f, 0x59, 0xa1, 0x68, 0x9a, 0x19, 0xc0, 0x5f, + 0x74, 0x60, 0xef, 0x65, 0x95, 0x74, 0x22, 0x66, 0x12, 0x39, 0x10, 0xf2, 0x29, 0x13, 0x8a, 0xcf, + 0x38, 0xcb, 0x6d, 0xe0, 0x81, 0xa0, 0x17, 0x6e, 0xdd, 0xa0, 0xf7, 0x10, 0x16, 0x8a, 0xe6, 0x6a, + 0x5c, 0xd9, 0xd8, 0x57, 0x3c, 0x10, 0xec, 0x1d, 0xf7, 0xb1, 0xc9, 0xc0, 0x4d, 0x06, 0x7e, 0xd7, + 0x64, 0x0c, 0xef, 0x9d, 0x2d, 0xdd, 0xd6, 0xc5, 0xd2, 0xbd, 0x35, 0xa7, 0xe9, 0xe9, 0x13, 0xff, + 0x77, 0xad, 0xbf, 0xf8, 0xee, 0x82, 0xb0, 0xa7, 0x2f, 0x2a, 0x1c, 0x25, 0xd0, 0x6a, 0x9e, 0x6e, + 0xb7, 0xb5, 0xef, 0xdd, 0x4b, 0xbe, 0x2f, 0x6a, 0x60, 0x38, 0xa8, 0x6c, 0x7f, 0x2e, 0x5d, 0xd4, + 0x94, 0x3c, 0x90, 0x29, 0x57, 0x2c, 0xcd, 0xd4, 0xfc, 0x62, 0xe9, 0xde, 0x30, 0x61, 0x8d, 0xe6, + 0x7f, 0xad, 0xa2, 0x36, 0xee, 0xe8, 0x08, 0x5e, 0x8f, 0xca, 0x3c, 0x67, 0x42, 0x8d, 0xf5, 0x88, + 0xed, 0x8e, 0x07, 0x82, 0x76, 0xb8, 0x5f, 0x5f, 0xea, 0x61, 0xa0, 0x2f, 0x00, 0xda, 0x7f, 0x50, + 0xe3, 0xad, 0xbe, 0xaf, 0xfe, 0xb7, 0xef, 0xfb, 0x75, 0xdf, 0xae, 0x79, 0xca, 0xbf, 0x9c, 0xcc, + 0x14, 0x0e, 0xb7, 0x93, 0x47, 0x9b, 0x89, 0x3c, 0x86, 0xb7, 0x0d, 0x1f, 0xc9, 0x52, 0x28, 0x2e, + 0x62, 0x53, 0xc8, 0xa6, 0x76, 0xd7, 0x03, 0x81, 0x15, 0x1e, 0x68, 0xf5, 0x79, 0x2d, 0x8e, 0x8c, + 0x86, 0x9e, 0xc2, 0xfe, 0xae, 0xb4, 0x84, 0xf1, 0x38, 0x51, 0xb6, 0xa5, 0x5b, 0xbd, 0x73, 0x29, + 0xf0, 0xb5, 0x96, 0xdf, 0x74, 0xac, 0x6b, 0x37, 0x2d, 0xff, 0x2d, 0xdc, 0x7f, 0x65, 0x36, 0x72, + 0xa4, 0xa8, 0x62, 0xe8, 0x19, 0xec, 0x9a, 0x5d, 0xb4, 0x81, 0xd7, 0x0e, 0xf6, 0x8e, 0x3d, 0xbc, + 0x73, 0x43, 0xf1, 0x66, 0x8d, 0x86, 0x9d, 0xaa, 0xfd, 0xb0, 0xae, 0x1a, 0x9e, 0x9c, 0xad, 0x1c, + 0x70, 0xbe, 0x72, 0xc0, 0x8f, 0x95, 0x03, 0x16, 0x6b, 0xa7, 0x75, 0xbe, 0x76, 0x5a, 0xdf, 0xd6, + 0x4e, 0xeb, 0x03, 0x89, 0xb9, 0x4a, 0xca, 0x09, 0x8e, 0x64, 0x4a, 0x8c, 0xe7, 0xc3, 0x19, 0x17, + 0x54, 0x44, 0xac, 0x3e, 0x92, 0xcf, 0xcd, 0xbf, 0xa2, 0xe6, 0x19, 0x2b, 0x26, 0x5d, 0x3d, 0xeb, + 0x47, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x57, 0x35, 0x50, 0x49, 0x03, 0x00, 0x00, } func (m *EpochInfo) Marshal() (dAtA []byte, err error) { diff --git a/x/epochs/types/query.pb.go b/x/epochs/types/query.pb.go index 7d668bd96..7ebcd4f52 100644 --- a/x/epochs/types/query.pb.go +++ b/x/epochs/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/epochs/query.proto +// source: quasar/epochs/v1beta1/query.proto package types @@ -36,7 +36,7 @@ func (m *QueryEpochsInfoRequest) Reset() { *m = QueryEpochsInfoRequest{} func (m *QueryEpochsInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryEpochsInfoRequest) ProtoMessage() {} func (*QueryEpochsInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5fad1bb1ee634904, []int{0} + return fileDescriptor_93eebb84b480b091, []int{0} } func (m *QueryEpochsInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -73,7 +73,7 @@ func (m *QueryEpochsInfoResponse) Reset() { *m = QueryEpochsInfoResponse func (m *QueryEpochsInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryEpochsInfoResponse) ProtoMessage() {} func (*QueryEpochsInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5fad1bb1ee634904, []int{1} + return fileDescriptor_93eebb84b480b091, []int{1} } func (m *QueryEpochsInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,7 +117,7 @@ func (m *QueryCurrentEpochRequest) Reset() { *m = QueryCurrentEpochReque func (m *QueryCurrentEpochRequest) String() string { return proto.CompactTextString(m) } func (*QueryCurrentEpochRequest) ProtoMessage() {} func (*QueryCurrentEpochRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5fad1bb1ee634904, []int{2} + return fileDescriptor_93eebb84b480b091, []int{2} } func (m *QueryCurrentEpochRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -161,7 +161,7 @@ func (m *QueryCurrentEpochResponse) Reset() { *m = QueryCurrentEpochResp func (m *QueryCurrentEpochResponse) String() string { return proto.CompactTextString(m) } func (*QueryCurrentEpochResponse) ProtoMessage() {} func (*QueryCurrentEpochResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5fad1bb1ee634904, []int{3} + return fileDescriptor_93eebb84b480b091, []int{3} } func (m *QueryCurrentEpochResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -198,43 +198,42 @@ func (m *QueryCurrentEpochResponse) GetCurrentEpoch() int64 { } func init() { - proto.RegisterType((*QueryEpochsInfoRequest)(nil), "quasarlabs.quasarnode.epochs.QueryEpochsInfoRequest") - proto.RegisterType((*QueryEpochsInfoResponse)(nil), "quasarlabs.quasarnode.epochs.QueryEpochsInfoResponse") - proto.RegisterType((*QueryCurrentEpochRequest)(nil), "quasarlabs.quasarnode.epochs.QueryCurrentEpochRequest") - proto.RegisterType((*QueryCurrentEpochResponse)(nil), "quasarlabs.quasarnode.epochs.QueryCurrentEpochResponse") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/epochs/query.proto", fileDescriptor_5fad1bb1ee634904) -} - -var fileDescriptor_5fad1bb1ee634904 = []byte{ - // 394 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x3d, 0x6e, 0xdb, 0x30, - 0x14, 0x16, 0xed, 0xd6, 0x40, 0x59, 0x77, 0x21, 0x8a, 0x56, 0x15, 0x0c, 0xd5, 0x95, 0x87, 0xaa, - 0x1e, 0xc4, 0xda, 0xfd, 0x03, 0x3a, 0x15, 0x2e, 0x3c, 0x78, 0xac, 0xc6, 0x2e, 0xad, 0x24, 0xd3, - 0xb2, 0x00, 0x87, 0x94, 0x45, 0x2a, 0x88, 0xd7, 0x9c, 0x20, 0x40, 0xae, 0x90, 0x0b, 0xe4, 0x16, - 0x1e, 0x0d, 0x64, 0xc9, 0x14, 0x04, 0x72, 0x0e, 0x12, 0x88, 0x62, 0x62, 0x05, 0x11, 0x84, 0x78, - 0x23, 0xdf, 0xfb, 0xfe, 0xde, 0x23, 0xa1, 0xbd, 0x4c, 0x3d, 0xee, 0x25, 0x0b, 0xcf, 0xe7, 0xb8, - 0x38, 0x52, 0x36, 0x25, 0x98, 0xc4, 0x2c, 0x98, 0xe7, 0x15, 0x92, 0xac, 0x9c, 0x38, 0x61, 0x82, - 0xa1, 0xce, 0x0e, 0xe9, 0xec, 0x90, 0x4e, 0x81, 0x34, 0x5e, 0x87, 0x2c, 0x64, 0x12, 0x88, 0xf3, - 0x53, 0xc1, 0x31, 0x3a, 0x21, 0x63, 0xe1, 0x82, 0x60, 0x2f, 0x8e, 0xb0, 0x47, 0x29, 0x13, 0x9e, - 0x88, 0x18, 0xe5, 0xaa, 0xdb, 0xaf, 0xf5, 0x0e, 0x09, 0x25, 0x3c, 0x52, 0x58, 0x4b, 0x87, 0x6f, - 0xfe, 0xe4, 0x61, 0xc6, 0xb2, 0x39, 0xa1, 0x33, 0xe6, 0x92, 0x65, 0x4a, 0xb8, 0xb0, 0xfe, 0xc3, - 0xb7, 0x8f, 0x3a, 0x3c, 0x66, 0x94, 0x13, 0x34, 0x86, 0xad, 0x42, 0x4c, 0x07, 0xdd, 0xa6, 0xfd, - 0x72, 0xf8, 0xd1, 0xa9, 0x9b, 0xc1, 0x91, 0x0a, 0xb9, 0xc0, 0xe8, 0xd9, 0xfa, 0xea, 0xbd, 0xe6, - 0x2a, 0xb2, 0xf5, 0x13, 0xea, 0xd2, 0xe1, 0x77, 0x9a, 0x24, 0x84, 0x0a, 0x09, 0x53, 0xee, 0xc8, - 0x84, 0x30, 0x9a, 0x12, 0x2a, 0xa2, 0x59, 0x44, 0x12, 0x1d, 0x74, 0x81, 0xfd, 0xc2, 0x2d, 0x55, - 0xac, 0x5f, 0xf0, 0x5d, 0x05, 0x57, 0xe5, 0xeb, 0xc1, 0x57, 0x41, 0x51, 0xff, 0x27, 0xad, 0x24, - 0xbf, 0xe9, 0xb6, 0x83, 0x12, 0x78, 0x98, 0x35, 0xe0, 0x73, 0x29, 0x81, 0xce, 0x00, 0x84, 0xf7, - 0x19, 0x39, 0xfa, 0x5a, 0x3f, 0x4d, 0xf5, 0xba, 0x8c, 0x6f, 0x7b, 0xb2, 0x8a, 0xa8, 0xd6, 0xa7, - 0xe3, 0x8b, 0x9b, 0xd3, 0x46, 0x0f, 0x7d, 0xc0, 0xa5, 0x47, 0x53, 0x2f, 0x75, 0x38, 0xf0, 0x89, - 0xf0, 0x06, 0xea, 0x8a, 0xce, 0x01, 0x6c, 0x97, 0xc7, 0x45, 0xdf, 0x9f, 0x60, 0x59, 0xb1, 0x5b, - 0xe3, 0xc7, 0xde, 0x3c, 0x15, 0xf6, 0xb3, 0x0c, 0xdb, 0x47, 0x76, 0x4d, 0xd8, 0x07, 0x8b, 0x1f, - 0x4d, 0xd6, 0x99, 0x09, 0x36, 0x99, 0x09, 0xae, 0x33, 0x13, 0x9c, 0x6c, 0x4d, 0x6d, 0xb3, 0x35, - 0xb5, 0xcb, 0xad, 0xa9, 0xfd, 0xc5, 0x61, 0x24, 0xe6, 0xa9, 0xef, 0x04, 0xec, 0x00, 0x57, 0xff, - 0xd7, 0xa3, 0x3b, 0x69, 0xb1, 0x8a, 0x09, 0xf7, 0x5b, 0xf2, 0xc3, 0x7e, 0xb9, 0x0d, 0x00, 0x00, - 0xff, 0xff, 0xaa, 0xec, 0x3e, 0x29, 0x5a, 0x03, 0x00, 0x00, + proto.RegisterType((*QueryEpochsInfoRequest)(nil), "quasar.epochs.v1beta1.QueryEpochsInfoRequest") + proto.RegisterType((*QueryEpochsInfoResponse)(nil), "quasar.epochs.v1beta1.QueryEpochsInfoResponse") + proto.RegisterType((*QueryCurrentEpochRequest)(nil), "quasar.epochs.v1beta1.QueryCurrentEpochRequest") + proto.RegisterType((*QueryCurrentEpochResponse)(nil), "quasar.epochs.v1beta1.QueryCurrentEpochResponse") +} + +func init() { proto.RegisterFile("quasar/epochs/v1beta1/query.proto", fileDescriptor_93eebb84b480b091) } + +var fileDescriptor_93eebb84b480b091 = []byte{ + // 413 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0x8f, 0x12, 0x31, + 0x18, 0xc6, 0xa7, 0xa2, 0x24, 0x56, 0xbc, 0x34, 0xfe, 0x19, 0x27, 0x3a, 0xc2, 0xe0, 0x81, 0x98, + 0x30, 0x15, 0xbc, 0x79, 0x30, 0x06, 0xf5, 0x80, 0x37, 0xe7, 0xa4, 0x5c, 0x4c, 0x67, 0x2c, 0x43, + 0x13, 0x6c, 0x87, 0x69, 0xc7, 0xc8, 0xd5, 0x2f, 0xa0, 0xc9, 0x7e, 0x98, 0xfd, 0x0a, 0x24, 0x7b, + 0x21, 0xd9, 0xcb, 0x9e, 0x36, 0x1b, 0xd8, 0x0f, 0xb2, 0xa1, 0x2d, 0x1b, 0xd8, 0x1d, 0x08, 0xb7, + 0x99, 0xbe, 0xbf, 0xe7, 0x79, 0x9f, 0xbe, 0x6f, 0x61, 0x63, 0x52, 0x10, 0x49, 0x72, 0x4c, 0x33, + 0x91, 0x8c, 0x24, 0xfe, 0xdd, 0x89, 0xa9, 0x22, 0x1d, 0x3c, 0x29, 0x68, 0x3e, 0x0d, 0xb3, 0x5c, + 0x28, 0x81, 0x1e, 0x1b, 0x24, 0x34, 0x48, 0x68, 0x11, 0xef, 0x51, 0x2a, 0x52, 0xa1, 0x09, 0xbc, + 0xfa, 0x32, 0xb0, 0xf7, 0x3c, 0x15, 0x22, 0x1d, 0x53, 0x4c, 0x32, 0x86, 0x09, 0xe7, 0x42, 0x11, + 0xc5, 0x04, 0x97, 0xb6, 0xda, 0x2c, 0xef, 0x96, 0x52, 0x4e, 0x25, 0xb3, 0x50, 0xe0, 0xc2, 0x27, + 0x5f, 0x57, 0xed, 0x3f, 0x6b, 0xa8, 0xcf, 0x87, 0x22, 0xa2, 0x93, 0x82, 0x4a, 0x15, 0x7c, 0x87, + 0x4f, 0x6f, 0x55, 0x64, 0x26, 0xb8, 0xa4, 0xe8, 0x3d, 0xac, 0x1a, 0x53, 0x17, 0xd4, 0x2b, 0xad, + 0x07, 0xdd, 0x7a, 0x58, 0x9a, 0x3a, 0xd4, 0xd2, 0x95, 0xb2, 0x77, 0x77, 0x76, 0xfe, 0xd2, 0x89, + 0xac, 0x2a, 0x78, 0x07, 0x5d, 0x6d, 0xfd, 0xb1, 0xc8, 0x73, 0xca, 0x95, 0xc6, 0x6c, 0x5b, 0xe4, + 0x43, 0xc8, 0x7e, 0x52, 0xae, 0xd8, 0x90, 0xd1, 0xdc, 0x05, 0x75, 0xd0, 0xba, 0x1f, 0x6d, 0x9c, + 0x04, 0x1f, 0xe0, 0xb3, 0x12, 0xad, 0x0d, 0xd6, 0x84, 0x0f, 0x13, 0x73, 0xfe, 0x43, 0xb7, 0xd2, + 0xfa, 0x4a, 0x54, 0x4b, 0x36, 0xe0, 0xee, 0xbf, 0x0a, 0xbc, 0xa7, 0x2d, 0xd0, 0x31, 0x80, 0xf0, + 0x3a, 0xa3, 0x44, 0xed, 0x1d, 0xd7, 0x28, 0x1f, 0x90, 0x17, 0x1e, 0x8a, 0x9b, 0x70, 0xc1, 0x97, + 0xbf, 0xa7, 0x97, 0x47, 0x77, 0x3e, 0x0d, 0x9a, 0xa8, 0x81, 0x8d, 0x72, 0x4c, 0x62, 0x79, 0x73, + 0x3d, 0xe6, 0x17, 0xbd, 0xc0, 0xe5, 0xdb, 0xb3, 0xe5, 0x13, 0x00, 0x6b, 0x9b, 0x13, 0x40, 0x78, + 0x5f, 0x98, 0x92, 0x39, 0x7b, 0x6f, 0x0e, 0x17, 0xd8, 0xfc, 0xdf, 0x74, 0xfe, 0x68, 0xf0, 0x1a, + 0xb5, 0xf6, 0xe4, 0xdf, 0x9a, 0x3f, 0x7a, 0xb5, 0xe3, 0x1a, 0x5b, 0x54, 0xaf, 0x3f, 0x5b, 0xf8, + 0x60, 0xbe, 0xf0, 0xc1, 0xc5, 0xc2, 0x07, 0xff, 0x97, 0xbe, 0x33, 0x5f, 0xfa, 0xce, 0xd9, 0xd2, + 0x77, 0x06, 0x38, 0x65, 0x6a, 0x54, 0xc4, 0x61, 0x22, 0x7e, 0x59, 0xa7, 0xf6, 0x90, 0x71, 0xc2, + 0x13, 0xba, 0x36, 0xfe, 0xb3, 0xb6, 0x56, 0xd3, 0x8c, 0xca, 0xb8, 0xaa, 0x9f, 0xf5, 0xdb, 0xab, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x31, 0xcc, 0x58, 0x6b, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -265,7 +264,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) EpochInfos(ctx context.Context, in *QueryEpochsInfoRequest, opts ...grpc.CallOption) (*QueryEpochsInfoResponse, error) { out := new(QueryEpochsInfoResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.epochs.Query/EpochInfos", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.epochs.v1beta1.Query/EpochInfos", in, out, opts...) if err != nil { return nil, err } @@ -274,7 +273,7 @@ func (c *queryClient) EpochInfos(ctx context.Context, in *QueryEpochsInfoRequest func (c *queryClient) CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) { out := new(QueryCurrentEpochResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.epochs.Query/CurrentEpoch", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.epochs.v1beta1.Query/CurrentEpoch", in, out, opts...) if err != nil { return nil, err } @@ -314,7 +313,7 @@ func _Query_EpochInfos_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.epochs.Query/EpochInfos", + FullMethod: "/quasar.epochs.v1beta1.Query/EpochInfos", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).EpochInfos(ctx, req.(*QueryEpochsInfoRequest)) @@ -332,7 +331,7 @@ func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.epochs.Query/CurrentEpoch", + FullMethod: "/quasar.epochs.v1beta1.Query/CurrentEpoch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).CurrentEpoch(ctx, req.(*QueryCurrentEpochRequest)) @@ -341,7 +340,7 @@ func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func( } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.epochs.Query", + ServiceName: "quasar.epochs.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -354,7 +353,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/epochs/query.proto", + Metadata: "quasar/epochs/v1beta1/query.proto", } func (m *QueryEpochsInfoRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/epochs/types/query.pb.gw.go b/x/epochs/types/query.pb.gw.go index 57c2c8aaa..ba448300c 100644 --- a/x/epochs/types/query.pb.gw.go +++ b/x/epochs/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: quasarlabs/quasarnode/epochs/query.proto +// source: quasar/epochs/v1beta1/query.proto /* Package types is a reverse proxy. @@ -51,6 +51,24 @@ func local_request_Query_EpochInfos_0(ctx context.Context, marshaler runtime.Mar } +func request_Query_EpochInfos_1(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEpochsInfoRequest + var metadata runtime.ServerMetadata + + msg, err := client.EpochInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_EpochInfos_1(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEpochsInfoRequest + var metadata runtime.ServerMetadata + + msg, err := server.EpochInfos(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_CurrentEpoch_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -87,6 +105,42 @@ func local_request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.M } +var ( + filter_Query_CurrentEpoch_1 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_CurrentEpoch_1(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCurrentEpochRequest + 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_CurrentEpoch_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CurrentEpoch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CurrentEpoch_1(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCurrentEpochRequest + 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_CurrentEpoch_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CurrentEpoch(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. @@ -116,6 +170,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_EpochInfos_1, 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_EpochInfos_1(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_EpochInfos_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_CurrentEpoch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -139,6 +216,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_CurrentEpoch_1, 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_CurrentEpoch_1(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_CurrentEpoch_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -200,6 +300,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_EpochInfos_1, 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_EpochInfos_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EpochInfos_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_CurrentEpoch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -220,17 +340,45 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_CurrentEpoch_1, 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_CurrentEpoch_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CurrentEpoch_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_Query_EpochInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"quasarlabs", "epochs", "v1beta1"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_EpochInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"quasar", "epochs", "v1beta1"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_EpochInfos_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"quasarlabs", "epochs", "v1beta1"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_CurrentEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"quasarlabs", "epochs", "v1beta1", "current_epoch"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_CurrentEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"quasar", "epochs", "v1beta1", "current_epoch"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_CurrentEpoch_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"quasarlabs", "epochs", "v1beta1", "current_epoch"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_Query_EpochInfos_0 = runtime.ForwardResponseMessage + forward_Query_EpochInfos_1 = runtime.ForwardResponseMessage + forward_Query_CurrentEpoch_0 = runtime.ForwardResponseMessage + + forward_Query_CurrentEpoch_1 = runtime.ForwardResponseMessage ) diff --git a/x/qoracle/client/cli/cli.go b/x/qoracle/client/cli/cli.go deleted file mode 100644 index 1c5a747f9..000000000 --- a/x/qoracle/client/cli/cli.go +++ /dev/null @@ -1,32 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" - - qosmocli "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/client/cli" - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd() *cobra.Command { - // Group qoracle 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( - CmdQueryParams(), - // CmdQueryDenomPrices(), - CmdQueryPools(), - qosmocli.GetQueryCmd(), - ) - - return cmd -} diff --git a/x/qoracle/client/cli/query.go b/x/qoracle/client/cli/query.go deleted file mode 100644 index e63fd9c36..000000000 --- a/x/qoracle/client/cli/query.go +++ /dev/null @@ -1,81 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -const ( - flagSource = "source" - flagDenom = "denom" -) - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(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 -} - -func CmdQueryPools() *cobra.Command { - cmd := &cobra.Command{ - Use: "pools", - Short: "shows the list of pools", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - denom := cmd.Flag(flagDenom).Value.String() - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - req := &types.QueryPoolsRequest{ - Denom: denom, - Pagination: pageReq, - } - res, err := queryClient.Pools(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - cmd.Flags().String(flagDenom, "", "denom to filter pools") - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "pools") - - return cmd -} diff --git a/x/qoracle/client/cli/tx.go b/x/qoracle/client/cli/tx.go deleted file mode 100644 index 4aea4188c..000000000 --- a/x/qoracle/client/cli/tx.go +++ /dev/null @@ -1,25 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" - - qosmocli "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/client/cli" - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(qosmocli.GetTxCmd()) - return cmd -} diff --git a/x/qoracle/genesis.go b/x/qoracle/genesis.go deleted file mode 100644 index 589674480..000000000 --- a/x/qoracle/genesis.go +++ /dev/null @@ -1,30 +0,0 @@ -package qoracle - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - genesistypes "github.com/quasarlabs/quasarnode/x/qoracle/genesis/types" - qoraclekeeper "github.com/quasarlabs/quasarnode/x/qoracle/keeper" - qosmokeeper "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/keeper" -) - -func InitGenesis( - ctx sdk.Context, - qKeeper qoraclekeeper.Keeper, - osmoKeeper qosmokeeper.Keeper, - state genesistypes.GenesisState, -) { - qKeeper.SetParams(ctx, state.Params) - qosmokeeper.InitGenesis(ctx, osmoKeeper, state.OsmosisGenesisState) -} - -func ExportGenesis( - ctx sdk.Context, - qKeeper qoraclekeeper.Keeper, - osmoKeeper qosmokeeper.Keeper, -) *genesistypes.GenesisState { - return genesistypes.NewGenesisState( - qKeeper.GetParams(ctx), - qosmokeeper.ExportGenesis(ctx, osmoKeeper), - ) -} diff --git a/x/qoracle/genesis/types/genesis.go b/x/qoracle/genesis/types/genesis.go deleted file mode 100644 index 00ee76cc9..000000000 --- a/x/qoracle/genesis/types/genesis.go +++ /dev/null @@ -1,68 +0,0 @@ -package types - -import ( - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - - qosmotypes "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - qoracletypes "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -// DefaultGenesis returns the default Capability genesis state -func DefaultGenesis() *GenesisState { - return &GenesisState{ - Params: qoracletypes.DefaultParams(), - OsmosisGenesisState: DefaultOsmosisGenesis(), - } -} - -// NewGenesisState creates and returns a new GenesisState instance from the provided controller and host genesis state types -func NewGenesisState(params qoracletypes.Params, osmosisGenesisState OsmosisGenesisState) *GenesisState { - return &GenesisState{ - Params: params, - OsmosisGenesisState: osmosisGenesisState, - } -} - -// 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 - } - - if err := gs.OsmosisGenesisState.Validate(); err != nil { - return err - } - - return nil -} - -// DefaultOsmosisGenesis creates and returns the default qoracle DefaultOsmosisGenesis -func DefaultOsmosisGenesis() OsmosisGenesisState { - return OsmosisGenesisState{ - Port: qosmotypes.PortID, - Params: qosmotypes.DefaultParams(), - } -} - -// NewOsmosisGenesisState creates a returns a new OsmosisGenesisState instance -func NewOsmosisGenesisState(port string, params qosmotypes.Params) OsmosisGenesisState { - return OsmosisGenesisState{ - Port: port, - Params: params, - } -} - -// Validate performs basic validation of the OsmosisGenesisState -func (gs OsmosisGenesisState) Validate() error { - - if err := host.PortIdentifierValidator(gs.Port); err != nil { - return err - } - - if err := gs.Params.Validate(); err != nil { - return err - } - - return nil -} diff --git a/x/qoracle/genesis/types/genesis.pb.go b/x/qoracle/genesis/types/genesis.pb.go deleted file mode 100644 index dd04725ab..000000000 --- a/x/qoracle/genesis/types/genesis.pb.go +++ /dev/null @@ -1,610 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - types "github.com/quasarlabs/quasarnode/x/qoracle/types" - 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 qoracle module's genesis state. -type GenesisState struct { - Params types.Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params" yaml:"params"` - OsmosisGenesisState OsmosisGenesisState `protobuf:"bytes,4,opt,name=osmosis_genesis_state,json=osmosisGenesisState,proto3" json:"osmosis_genesis_state" yaml:"osmosis_genesis_state"` -} - -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_325cd2493e63d866, []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() types.Params { - if m != nil { - return m.Params - } - return types.Params{} -} - -func (m *GenesisState) GetOsmosisGenesisState() OsmosisGenesisState { - if m != nil { - return m.OsmosisGenesisState - } - return OsmosisGenesisState{} -} - -// OsmosisGenesisState defines the qoracle osmosis submodule's genesis state. -type OsmosisGenesisState struct { - Port string `protobuf:"bytes,1,opt,name=port,proto3" json:"port,omitempty" yaml:"port_id"` - Params types1.Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params" yaml:"params"` -} - -func (m *OsmosisGenesisState) Reset() { *m = OsmosisGenesisState{} } -func (m *OsmosisGenesisState) String() string { return proto.CompactTextString(m) } -func (*OsmosisGenesisState) ProtoMessage() {} -func (*OsmosisGenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_325cd2493e63d866, []int{1} -} -func (m *OsmosisGenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *OsmosisGenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OsmosisGenesisState.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 *OsmosisGenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_OsmosisGenesisState.Merge(m, src) -} -func (m *OsmosisGenesisState) XXX_Size() int { - return m.Size() -} -func (m *OsmosisGenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_OsmosisGenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_OsmosisGenesisState proto.InternalMessageInfo - -func (m *OsmosisGenesisState) GetPort() string { - if m != nil { - return m.Port - } - return "" -} - -func (m *OsmosisGenesisState) GetParams() types1.Params { - if m != nil { - return m.Params - } - return types1.Params{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "quasarlabs.quasarnode.qoracle.GenesisState") - proto.RegisterType((*OsmosisGenesisState)(nil), "quasarlabs.quasarnode.qoracle.OsmosisGenesisState") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/genesis.proto", fileDescriptor_325cd2493e63d866) -} - -var fileDescriptor_325cd2493e63d866 = []byte{ - // 325 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2e, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x0b, 0xf3, - 0x8b, 0x12, 0x93, 0x73, 0x52, 0xf5, 0xd3, 0x53, 0xf3, 0x52, 0x8b, 0x33, 0x8b, 0xf5, 0x0a, 0x8a, - 0xf2, 0x4b, 0xf2, 0x85, 0x64, 0x11, 0x8a, 0xf5, 0x10, 0x8a, 0xf5, 0xa0, 0x8a, 0xa5, 0x44, 0xd2, - 0xf3, 0xd3, 0xf3, 0xc1, 0x2a, 0xf5, 0x41, 0x2c, 0x88, 0x26, 0x29, 0x2d, 0xfc, 0x36, 0x14, 0x24, - 0x16, 0x25, 0xe6, 0x42, 0x2d, 0x90, 0x32, 0xc2, 0xaf, 0x36, 0xbf, 0x38, 0x37, 0xbf, 0x38, 0xb3, - 0x18, 0x45, 0x8f, 0xd2, 0x67, 0x46, 0x2e, 0x1e, 0x77, 0x88, 0x33, 0x83, 0x4b, 0x12, 0x4b, 0x52, - 0x85, 0x42, 0xb8, 0xd8, 0x20, 0x0a, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x54, 0xf5, 0xf0, - 0x3a, 0x5b, 0x2f, 0x00, 0xac, 0xd8, 0x49, 0xf4, 0xc4, 0x3d, 0x79, 0x86, 0x4f, 0xf7, 0xe4, 0x79, - 0x2b, 0x13, 0x73, 0x73, 0xac, 0x94, 0x20, 0x46, 0x28, 0x05, 0x41, 0xcd, 0x12, 0xea, 0x61, 0xe4, - 0x12, 0x85, 0xda, 0x1f, 0x0f, 0x0d, 0x95, 0xf8, 0x62, 0x90, 0x7d, 0x12, 0x2c, 0x60, 0x5b, 0x8c, - 0x08, 0xd8, 0xe2, 0x0f, 0xd1, 0x8b, 0xec, 0x52, 0x27, 0x15, 0xa8, 0x95, 0x32, 0x10, 0x2b, 0xb1, - 0x1a, 0xaf, 0x14, 0x24, 0x9c, 0x8f, 0xa9, 0x55, 0x69, 0x36, 0x23, 0x97, 0x30, 0x16, 0x23, 0x85, - 0xd4, 0xb8, 0x58, 0x0a, 0xf2, 0x8b, 0x4a, 0xc0, 0x5e, 0xe7, 0x74, 0x12, 0xfa, 0x74, 0x4f, 0x9e, - 0x0f, 0xea, 0x9f, 0xfc, 0xa2, 0x92, 0xf8, 0xcc, 0x14, 0xa5, 0x20, 0xb0, 0xbc, 0x50, 0x0c, 0x3c, - 0x90, 0x98, 0xc0, 0xce, 0xd7, 0x25, 0xe0, 0x7c, 0xa8, 0x1b, 0x88, 0x0b, 0x2c, 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, 0xc7, 0x1e, 0xd9, 0x15, 0xe8, 0x89, 0x4f, 0xbf, 0xa4, 0xb2, 0x20, - 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0xdd, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x65, 0x7a, 0x40, - 0x4f, 0xb2, 0x02, 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.OsmosisGenesisState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - 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 (m *OsmosisGenesisState) 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 *OsmosisGenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OsmosisGenesisState) 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] = 0x12 - if len(m.Port) > 0 { - i -= len(m.Port) - copy(dAtA[i:], m.Port) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Port))) - 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)) - l = m.OsmosisGenesisState.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *OsmosisGenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Port) - if l > 0 { - n += 1 + l + sovGenesis(uint64(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 - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OsmosisGenesisState", 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.OsmosisGenesisState.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 (m *OsmosisGenesisState) 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: OsmosisGenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OsmosisGenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Port = 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 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/qoracle/genesis/types/genesis_test.go b/x/qoracle/genesis/types/genesis_test.go deleted file mode 100644 index f838657e7..000000000 --- a/x/qoracle/genesis/types/genesis_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/x/qoracle/genesis/types" -) - -func TestGenesisState_Validate(t *testing.T) { - for _, tc := range []struct { - desc string - genState *types.GenesisState - valid bool - }{ - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - } { //for start - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } // for end -} // func end diff --git a/x/qoracle/keeper/denom_price.go b/x/qoracle/keeper/denom_price.go deleted file mode 100644 index bebce13ee..000000000 --- a/x/qoracle/keeper/denom_price.go +++ /dev/null @@ -1,69 +0,0 @@ -package keeper - -import ( - errorsmod "cosmossdk.io/errors" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -// NOTE - -// Denom price will be updated in the future in their respective memory store key. -// using either bandchain, chain link or USDC pool from osmosis. Code is kept for future use. - -// GetDenomPrice get the stable price for the denom -func (k Keeper) GetDenomPrice(ctx sdk.Context, denom string) (sdk.Dec, error) { - _, err := k.GetDenomPricesUpdatedAt(ctx) - if err != nil { - // Last update time not found. - return sdk.ZeroDec(), err - } - - memStore := ctx.KVStore(k.memKey) - priceBz := memStore.Get(types.GetDenomPriceKey(denom)) - if priceBz == nil { - return sdk.Dec{}, errorsmod.Wrapf(types.ErrDenomPriceNotFound, "denom: %s", denom) - } - - var price sdk.Dec - if err := price.Unmarshal(priceBz); err != nil { - return sdk.Dec{}, err - } - return price, nil -} - -// GetDenomPricesUpdatedAt get the last time denom prices were updated. -func (k Keeper) GetDenomPricesUpdatedAt(ctx sdk.Context) (time.Time, error) { - memStore := ctx.KVStore(k.memKey) - if !memStore.Has(types.KeyMemDenomPricesUpdatedAt) { - return time.Time{}, nil - } - - updatedAt, err := sdk.ParseTimeBytes(memStore.Get(types.KeyMemDenomPricesUpdatedAt)) - if err != nil { - return time.Time{}, errorsmod.Wrap(err, "failed to parse denom prices updated at") - } - return updatedAt, nil -} - -// GetRelativeDenomPrice get the relative price of token with denomIn in denomOut. -func (k Keeper) GetRelativeDenomPrice(ctx sdk.Context, denomIn, denomOut string) (sdk.Dec, error) { - denomInPrice, err := k.GetDenomPrice(ctx, denomIn) - if err != nil { - return sdk.ZeroDec(), err - } - denomOutPrice, err := k.GetDenomPrice(ctx, denomOut) - if err != nil { - return sdk.ZeroDec(), err - } - - if denomOutPrice.IsZero() || denomOutPrice.IsNil() || denomOutPrice.IsNegative() { - // In this case, division by denomOutPrice is risky - return sdk.ZeroDec(), errorsmod.Wrapf(types.ErrRelativeDenomPriceNotFound, - "denomInPrice: %s, denomOutPrice : %s", denomInPrice.String(), denomOutPrice.String()) - } - - return denomInPrice.Quo(denomOutPrice), nil -} diff --git a/x/qoracle/keeper/grpc_query.go b/x/qoracle/keeper/grpc_query.go deleted file mode 100644 index cc88fa900..000000000 --- a/x/qoracle/keeper/grpc_query.go +++ /dev/null @@ -1,124 +0,0 @@ -package keeper - -import ( - "context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -var _ types.QueryServer = Keeper{} - -func (q 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: q.GetParams(ctx)}, nil -} - -/* -func (q Keeper) DenomMappings(c context.Context, req *types.QueryDenomMappingsRequest) (*types.QueryDenomMappingsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - var mappings []types.DenomSymbolMapping - prefixStore := prefix.NewStore(ctx.KVStore(q.memKey), types.KeyDenomSymbolMappingPrefix) - pageRes, err := query.Paginate(prefixStore, req.Pagination, func(key []byte, value []byte) error { - var mapping types.DenomSymbolMapping - err := q.cdc.Unmarshal(value, &mapping) - if err != nil { - return err - } - - mappings = append(mappings, mapping) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryDenomMappingsResponse{ - Mappings: mappings, - Pagination: pageRes, - }, nil -} -*/ - -/* - func (q Keeper) DenomPrices(c context.Context, req *types.QueryDenomPricesRequest) (*types.QueryDenomPricesResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - var prices []sdk.DecCoin - prefixStore := prefix.NewStore(ctx.KVStore(q.memKey), types.KeyMemDenomPricePrefix) - pageRes, err := query.Paginate(prefixStore, req.Pagination, func(key []byte, value []byte) error { - var price sdk.Dec - err := price.Unmarshal(value) - if err != nil { - return err - } - - prices = append(prices, sdk.NewDecCoinFromDec(string(key), price)) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - updatedAt, err := q.GetDenomPricesUpdatedAt(ctx) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryDenomPricesResponse{ - Prices: prices, - UpdatedAt: updatedAt, - Pagination: pageRes, - }, nil - } -*/ - -func (q Keeper) Pools(c context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid nil request") - } - ctx := sdk.UnwrapSDKContext(c) - - var pools []types.Pool - prefixStore := prefix.NewStore(ctx.KVStore(q.storeKey), types.KeyMemPoolPrefix) - pageRes, err := query.FilteredPaginate(prefixStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { - var pool types.Pool - err := q.cdc.Unmarshal(value, &pool) - if err != nil { - return false, err - } - - if !IsDenomInPool(pool, req.Denom) { - return false, nil - } - - if accumulate { - pools = append(pools, pool) - } - return true, nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryPoolsResponse{ - Pools: pools, - Pagination: pageRes, - }, nil -} diff --git a/x/qoracle/keeper/grpc_query_test.go b/x/qoracle/keeper/grpc_query_test.go deleted file mode 100644 index 98b100b2b..000000000 --- a/x/qoracle/keeper/grpc_query_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -func TestParamsQuery(t *testing.T) { - setup := testutil.NewTestSetup(t) - ctx, k := setup.Ctx, setup.Keepers.QoracleKeeper - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - k.SetParams(ctx, params) - - response, err := k.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) -} diff --git a/x/qoracle/keeper/keeper.go b/x/qoracle/keeper/keeper.go deleted file mode 100644 index e84691f98..000000000 --- a/x/qoracle/keeper/keeper.go +++ /dev/null @@ -1,181 +0,0 @@ -package keeper - -import ( - "fmt" - - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - memKey storetypes.StoreKey - tkey storetypes.StoreKey - paramSpace paramtypes.Subspace - authority string // the address capable of adding or removing denom symbol mappings. Usually the gov module account - - poolOracles map[string]types.PoolOracle - sealed bool -} - -func NewKeeper( - cdc codec.BinaryCodec, - storeKey storetypes.StoreKey, - memKey storetypes.StoreKey, - tkey storetypes.StoreKey, - paramSpace paramtypes.Subspace, - authority string, -) Keeper { - // set KeyTable if it has not already been set - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) - } - - return Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - tkey: tkey, - paramSpace: paramSpace, - authority: authority, - // priceOracles: []types.PriceOracle{}, - poolOracles: map[string]types.PoolOracle{}, - } -} - -// RegisterPoolOracle registers a pool oracle to the keeper. -func (k *Keeper) RegisterPoolOracle(oracle types.PoolOracle) { - if k.sealed { - panic("cannot register a pool oracle to a sealed qoracle keeper") - } - - // TODO_IMPORTANT - - // k.poolOracles[oracle.Source()] = oracle -} - -// Seal seals the keeper to prevent registering further oracles. -// Seal may be called during app initialization. -func (k *Keeper) Seal() { - if k.sealed { - panic("cannot initialize and seal an already sealed qoracle keeper") - } - - k.sealed = true -} - -// IsSealed returns if the keeper is sealed. -func (k *Keeper) IsSealed() bool { - return k.sealed -} - -// InitMemStore will assure that the module store is a memory store (it will panic if it's not) -// and will initialize it. The function is safe to be called multiple times. -// InitMemStore must be called every time the app starts before the keeper is used (so -// `BeginBlock` or `InitChain` - whichever is first). We need access to the store so we -// can't initialize it in a constructor. -func (k Keeper) InitMemStore(ctx sdk.Context) { - memStore := ctx.KVStore(k.memKey) - memStoreType := memStore.GetStoreType() - - if memStoreType != storetypes.StoreTypeMemory { - panic(fmt.Sprintf("invalid memory store type; got %s, expected: %s", memStoreType, storetypes.StoreTypeMemory)) - } - - // create context with no block gas meter to ensure we do not consume gas during local initialization logic. - noGasCtx := ctx.WithBlockGasMeter(sdk.NewInfiniteGasMeter()) - - // check if memory store has not been initialized yet by checking if initialized flag is nil. - if !k.IsInitialized(noGasCtx) { - // initialize memory store here - k.UpdatePools(noGasCtx) - - // set the initialized flag so we don't rerun initialization logic - memStore := noGasCtx.KVStore(k.memKey) - memStore.Set(types.KeyMemInitialized, []byte{1}) - } -} - -// IsInitialized returns if the memory store has been initialized. -func (k Keeper) IsInitialized(ctx sdk.Context) bool { - memStore := ctx.KVStore(k.memKey) - return memStore.Has(types.KeyMemInitialized) -} - -// UpdateMemStore updates the memory store. it first checks if there's new updated data available -// for either the symbol prices or the pools. If there is new symbol prices available, it will -// update the symbol prices and then update the pools. If there is new pools available, it will -// only update the pools. oracle submodules can notify the qoracle keeper that new data is available -// by setting the corresponding update flag. -func (k Keeper) UpdateMemStore(ctx sdk.Context) { - switch { - - case k.IsPoolsUpdateAvailable(ctx): - // TODO: we should only update pools from the notifier source to help with gas consumption. - k.UpdatePools(ctx) - } -} - -// NotifyPoolsUpdate notifies the qoracle keeper that new pools are available. -func (k Keeper) NotifyPoolsUpdate(ctx sdk.Context) { - store := ctx.TransientStore(k.tkey) - store.Set(types.KeyPoolsUpdateFlag, []byte{}) -} - -// IsPoolsUpdateAvailable returns if there's new pools available. -func (k Keeper) IsPoolsUpdateAvailable(ctx sdk.Context) bool { - store := ctx.TransientStore(k.tkey) - return store.Has(types.KeyPoolsUpdateFlag) -} - -// UpdatePools fetches the latest pools from pool oracles if any available -// and stores them in memory store. -func (k Keeper) UpdatePools(ctx sdk.Context) { - k.Logger(ctx).Debug("UpdatePools...") - k.removeAllPools(ctx) - - // Check the length of pools sources - for _, oracle := range k.poolOracles { - pools, err := oracle.GetPools(ctx) - if err != nil { - k.Logger(ctx).Error("failed to fetch pools from pool oracle", - "oracle_source", oracle.Source(), - "error", err, - ) - continue - } - - memStore := ctx.KVStore(k.memKey) - poolStore := prefix.NewStore(memStore, types.KeyMemPoolPrefix) - osmosisPoolStore := prefix.NewStore(poolStore, types.KeyOsmosisPoolPrefix) - for _, pool := range pools { - osmosisPoolStore.Set([]byte(pool.Id), k.cdc.MustMarshal(&pool)) - } - } -} - -// Remove all the pools iterating through the KeyMemPoolPrefix itr. -func (k Keeper) removeAllPools(ctx sdk.Context) { - memStore := ctx.KVStore(k.memKey) - - iter := sdk.KVStorePrefixIterator(memStore, types.KeyMemPoolPrefix) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - k.Logger(ctx).Debug("Deleting pools ", - "Key", iter.Key(), - "Value", iter.Value(), - ) - memStore.Delete(iter.Key()) - } -} - -// Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) -} diff --git a/x/qoracle/keeper/msg_server.go b/x/qoracle/keeper/msg_server.go deleted file mode 100644 index 074ce3c28..000000000 --- a/x/qoracle/keeper/msg_server.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper - -import ( - "github.com/quasarlabs/quasarnode/x/qoracle/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{} diff --git a/x/qoracle/keeper/params.go b/x/qoracle/keeper/params.go deleted file mode 100644 index 59ed99a19..000000000 --- a/x/qoracle/keeper/params.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams() -} - -// SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) -} diff --git a/x/qoracle/keeper/params_test.go b/x/qoracle/keeper/params_test.go deleted file mode 100644 index be1f3f1b8..000000000 --- a/x/qoracle/keeper/params_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -func TestGetParams(t *testing.T) { - setup := testutil.NewTestSetup(t) - ctx, k := setup.Ctx, setup.Keepers.QoracleKeeper - params := types.DefaultParams() - - k.SetParams(ctx, params) - - require.EqualValues(t, params, k.GetParams(ctx)) -} diff --git a/x/qoracle/keeper/pools.go b/x/qoracle/keeper/pools.go deleted file mode 100644 index 786ee9417..000000000 --- a/x/qoracle/keeper/pools.go +++ /dev/null @@ -1,74 +0,0 @@ -package keeper - -import ( - "sort" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -// GetPoolsRankedByAPY returns a list of all pools with ordered by APY in descending order with an optional denom filter. -// If denom is empty the function will return all pools otherwise it only returns pools that have denom as their deposited asset. -func (k Keeper) GetPoolsRankedByAPY(ctx sdk.Context, denom string) []types.Pool { - memStore := ctx.KVStore(k.memKey) - poolStore := prefix.NewStore(memStore, types.KeyMemPoolPrefix) - osmosisPoolStore := prefix.NewStore(poolStore, types.KeyOsmosisPoolPrefix) - - iter := osmosisPoolStore.Iterator(nil, nil) - defer iter.Close() - var pools types.PoolsOrderedByAPY - for ; iter.Valid(); iter.Next() { - var pool types.Pool - k.cdc.MustUnmarshal(iter.Value(), &pool) - - if denom != "" && !IsDenomInPool(pool, denom) { - // Skip to next pool - continue - } - // If denom is empty or denom is in pool assets - pools = append(pools, pool) - } - - // Order by APY in descending order - sort.Stable(sort.Reverse(pools)) - return pools -} - -func IsDenomInPool(pool types.Pool, denom string) bool { - - if denom != "" { - for _, c := range pool.Assets { - if c.Denom == denom { - // If found ; return true - return true - } - } - /* - // Find exist in furture version - if found, _ := pool.Assets.Find(denom); found { - return false - } - - */ - } - - return false -} - -// GetPool returns a pool for the given id if exists. -func (k Keeper) GetPool(ctx sdk.Context, id string) (types.Pool, bool) { - memStore := ctx.KVStore(k.memKey) - poolStore := prefix.NewStore(memStore, types.KeyMemPoolPrefix) - osmosisPoolStore := prefix.NewStore(poolStore, types.KeyOsmosisPoolPrefix) - - key := []byte(id) - if !osmosisPoolStore.Has(key) { - return types.Pool{}, false - } - - var pool types.Pool - k.cdc.MustUnmarshal(memStore.Get(key), &pool) - return pool, true -} diff --git a/x/qoracle/module.go b/x/qoracle/module.go deleted file mode 100644 index 49358caa2..000000000 --- a/x/qoracle/module.go +++ /dev/null @@ -1,183 +0,0 @@ -package qoracle - -import ( - "context" - "encoding/json" - "fmt" - "time" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/qoracle/client/cli" - genesistypes "github.com/quasarlabs/quasarnode/x/qoracle/genesis/types" - "github.com/quasarlabs/quasarnode/x/qoracle/keeper" - qosmokeeper "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/keeper" - qosmotypes "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface for the qoracle module. -type AppModuleBasic struct { - cdc codec.BinaryCodec -} - -func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the qoracle module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} - -// RegisterInterfaces registers the module's interface types -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) - qosmotypes.RegisterInterfaces(reg) -} - -// DefaultGenesis returns the qoracle module's default genesis state. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(genesistypes.DefaultGenesis()) -} - -// ValidateGenesis performs genesis state validation for the qoracle module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var genState genesistypes.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() -} - -// RegisterRESTRoutes registers the qoracle module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) - if err != nil { - panic(err) - } - - err = qosmotypes.RegisterQueryHandlerClient(context.Background(), mux, qosmotypes.NewQueryClient(clientCtx)) - if err != nil { - panic(err) - } -} - -// GetTxCmd returns the capability module's root tx command. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns the qoracle module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface for the qoracle module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - osmosisKeeper qosmokeeper.Keeper -} - -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - osmosisKeeper qosmokeeper.Keeper, -) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - osmosisKeeper: osmosisKeeper, - } -} - -// RegisterInvariants implements the AppModule interface -func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { -} - -// NewHandler implements the AppModule interface -func (AppModule) NewHandler() sdk.Handler { - return nil -} - -// QuerierRoute implements the AppModule interface -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) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - qosmotypes.RegisterMsgServer(cfg.MsgServer(), qosmokeeper.NewMsgServerImpl(am.osmosisKeeper)) - qosmotypes.RegisterQueryServer(cfg.QueryServer(), am.osmosisKeeper) -} - -// InitGenesis performs the qoracle module's genesis initialization It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { - var genesisState genesistypes.GenesisState - cdc.MustUnmarshalJSON(gs, &genesisState) - - InitGenesis(ctx, am.keeper, am.osmosisKeeper, genesisState) - - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the qoracle module's exported genesis state as raw JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - gs := ExportGenesis(ctx, am.keeper, am.osmosisKeeper) - return cdc.MustMarshalJSON(gs) -} - -// ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } - -// BeginBlock executes all ABCI BeginBlock logic respective to the qoracle module. -// BeginBlocker calls InitMemStore to assert that the memory store is initialized. -// It's safe to run multiple times. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) - - am.keeper.InitMemStore(ctx) -} - -// EndBlock executes all ABCI EndBlock logic respective to the qoracle module. It -// returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) - - am.keeper.UpdateMemStore(ctx) - - return []abci.ValidatorUpdate{} -} diff --git a/x/qoracle/osmosis/client/cli/cli.go b/x/qoracle/osmosis/client/cli/cli.go deleted file mode 100644 index 06a6850ce..000000000 --- a/x/qoracle/osmosis/client/cli/cli.go +++ /dev/null @@ -1,25 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" -) - -// GetQueryCmd returns the query commands for the qoracle osmosis submodule -func GetQueryCmd() *cobra.Command { - queryCmd := &cobra.Command{ - Use: "osmosis", - Short: "qoracle osmosis query subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - } - - queryCmd.AddCommand( - GetCmdParams(), - GetCmdState(), - GetCmdChainParams(), - GetCmdIncentivizedPools(), - GetCmdPools(), - ) - - return queryCmd -} diff --git a/x/qoracle/osmosis/client/cli/query.go b/x/qoracle/osmosis/client/cli/query.go deleted file mode 100644 index ba23fcaab..000000000 --- a/x/qoracle/osmosis/client/cli/query.go +++ /dev/null @@ -1,155 +0,0 @@ -package cli - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" -) - -func GetCmdParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetCmdState() *cobra.Command { - cmd := &cobra.Command{ - Use: "state", - Short: "shows state of osmosis icq requests", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - req := &types.QueryStateRequest{} - - res, err := queryClient.State(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetCmdChainParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "chain-params", - Short: "shows the latest fetched osmosis chain params", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - req := &types.QueryChainParamsRequest{} - - res, err := queryClient.ChainParams(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetCmdIncentivizedPools() *cobra.Command { - cmd := &cobra.Command{ - Use: "Incentivized-pools", - Short: "shows the latest fetched osmosis incentivized pools list", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - req := &types.QueryIncentivizedPoolsRequest{} - - res, err := queryClient.IncentivizedPools(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetCmdPools() *cobra.Command { - cmd := &cobra.Command{ - Use: "pools", - Short: "shows the latest fetched osmosis pool details", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - req := &types.QueryPoolsRequest{} - - res, err := queryClient.Pools(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/qoracle/osmosis/client/cli/tx.go b/x/qoracle/osmosis/client/cli/tx.go deleted file mode 100644 index 367a26b4b..000000000 --- a/x/qoracle/osmosis/client/cli/tx.go +++ /dev/null @@ -1,22 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "osmosis", - Short: "qoracle osmosis tx subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - return cmd -} diff --git a/x/qoracle/osmosis/ibc_module.go b/x/qoracle/osmosis/ibc_module.go deleted file mode 100644 index 74aaf5685..000000000 --- a/x/qoracle/osmosis/ibc_module.go +++ /dev/null @@ -1,200 +0,0 @@ -package qoracle - -import ( - errorsmod "cosmossdk.io/errors" - "strings" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/keeper" - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" -) - -var _ porttypes.IBCModule = IBCModule{} - -// IBCModule implements the ICS26 interface for osmosis qoracle sub module given the keeper -type IBCModule struct { - keeper keeper.Keeper -} - -// NewIBCModule creates a new IBCModule given the keeper -func NewIBCModule(k keeper.Keeper) IBCModule { - return IBCModule{ - keeper: k, - } -} - -// OnChanOpenInit implements the IBCModule interface -func (im IBCModule) OnChanOpenInit( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID string, - channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - version string, -) (string, error) { - if !im.keeper.IsEnabled(ctx) { - return "", types.ErrDisabled - } - - if err := im.validateChannelParams(ctx, order, portID); err != nil { - return "", err - } - - if strings.TrimSpace(version) == "" { - version = icqtypes.Version - } - - if version != icqtypes.Version { - return "", errorsmod.Wrapf(channeltypes.ErrInvalidChannelVersion, "got %s, expected %s", version, icqtypes.Version) - } - - // Claim channel capability passed back by IBC module - if err := im.keeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { - return "", err - } - - return version, nil -} - -func (im IBCModule) validateChannelParams( - ctx sdk.Context, - order channeltypes.Order, - portID string, -) error { - if order != channeltypes.UNORDERED { - return errorsmod.Wrapf(channeltypes.ErrInvalidChannelOrdering, "expected %s channel, got %s ", channeltypes.UNORDERED, order) - } - - // Require port id to be the port id module is bound to - boundPort := im.keeper.GetPort(ctx) - if boundPort != portID { - return errorsmod.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) - } - - return nil -} - -// OnChanOpenTry implements the IBCModule interface -func (im IBCModule) OnChanOpenTry( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID, - channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - counterpartyVersion string, -) (string, error) { - if !im.keeper.IsEnabled(ctx) { - return "", types.ErrDisabled - } - - if err := im.validateChannelParams(ctx, order, portID); err != nil { - return "", err - } - - if counterpartyVersion != icqtypes.Version { - return "", errorsmod.Wrapf(channeltypes.ErrInvalidChannelVersion, "invalid counterparty version: %s, expected %s", counterpartyVersion, icqtypes.Version) - } - - // OpenTry must claim the channelCapability that IBC passes into the callback - if err := im.keeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { - return "", err - } - - return icqtypes.Version, nil -} - -// OnChanOpenAck implements the IBCModule interface -func (im IBCModule) OnChanOpenAck( - ctx sdk.Context, - portID, - channelID string, - counterpartyChannelID string, - counterpartyVersion string, -) error { - if counterpartyVersion != icqtypes.Version { - return errorsmod.Wrapf(channeltypes.ErrInvalidChannelVersion, "invalid counterparty version: %s, expected %s", counterpartyVersion, icqtypes.Version) - } - return nil -} - -// OnChanOpenConfirm implements the IBCModule interface -func (im IBCModule) OnChanOpenConfirm( - ctx sdk.Context, - portID, - channelID string, -) error { - if !im.keeper.IsEnabled(ctx) { - return types.ErrDisabled - } - - return nil -} - -// OnChanCloseInit implements the IBCModule interface -func (im IBCModule) OnChanCloseInit( - ctx sdk.Context, - portID, - channelID string, -) error { - return nil -} - -// OnChanCloseConfirm implements the IBCModule interface -func (im IBCModule) OnChanCloseConfirm( - ctx sdk.Context, - portID, - channelID string, -) error { - return nil -} - -// OnRecvPacket implements the IBCModule interface. -func (im IBCModule) OnRecvPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) ibcexported.Acknowledgement { - err := errorsmod.Wrapf(types.ErrInvalidChannelFlow, "cannot receive packet on qoracle module") - ack := channeltypes.NewErrorAcknowledgement(err) - keeper.EmitAcknowledgementEvent(ctx, packet, ack, err) - return ack -} - -// OnAcknowledgementPacket implements the IBCModule interface -func (im IBCModule) OnAcknowledgementPacket( - ctx sdk.Context, - packet channeltypes.Packet, - acknowledgement []byte, - relayer sdk.AccAddress, -) error { - var ack channeltypes.Acknowledgement - if err := types.ModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil { - return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, - "cannot unmarshal ibc packet acknowledgement: %v, relayer: %s", err, relayer.String()) - } - - return im.keeper.OnAcknowledgementPacket(ctx, packet, ack) -} - -// OnTimeoutPacket implements the IBCModule interface. -func (im IBCModule) OnTimeoutPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) error { - im.keeper.Logger(ctx).Error("osmosis param request state is timed out.", - "relayer address", relayer.String()) - return im.keeper.OnTimeoutPacket(ctx, packet) -} diff --git a/x/qoracle/osmosis/keeper/calculation.go b/x/qoracle/osmosis/keeper/calculation.go deleted file mode 100644 index e4d2fce82..000000000 --- a/x/qoracle/osmosis/keeper/calculation.go +++ /dev/null @@ -1,118 +0,0 @@ -package keeper - -import ( - errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - - epochtypes "github.com/quasarlabs/quasarnode/osmosis/epochs/types" - balancerpool "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer" - poolincentivestypes "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types" - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" -) - -const Year = 365 * 24 * time.Hour - -// apyCalculator caches all the pre calculations needed for calculating pool APYs in batch. -type apyCalculator struct { - distrInfo poolincentivestypes.DistrInfo - incentivizedPools []poolincentivestypes.IncentivizedPool - mintTokenPrice sdk.Dec - annualPoolIncentives sdk.Dec -} - -func (k Keeper) newAPYCalculator(ctx sdk.Context) (apyCalculator, error) { - distrInfo := k.GetDistrInfo(ctx) - epochProvisions := k.GetMintEpochProvisions(ctx) - - mintParams := k.GetMintParams(ctx) - poolIncentivesProportion := mintParams.DistributionProportions.PoolIncentives - mintTokenPrice, err := k.qoracleKeeper.GetDenomPrice(ctx, mintParams.MintDenom) - if err != nil { - return apyCalculator{}, errorsmod.Wrap(err, "could not fetch the price of mint denom") - } - mintEpoch, found := k.findOsmosisEpochByIdentifier(ctx, mintParams.EpochIdentifier) - if !found { - return apyCalculator{}, errorsmod.Wrap(types.ErrEpochNotFound, fmt.Sprintf("could not find osmosis mint, epoch identifier: %s", mintParams.EpochIdentifier)) - } - - // Number of mint epochs occurrence in a year - annualMintEpochs := Year.Nanoseconds() / mintEpoch.Duration.Nanoseconds() - annualProvisions := epochProvisions.MulInt64(annualMintEpochs) - // Annual provisions share to incentivize pools is equal to "annualProvisions * poolIncentivesProportion" - annualPoolIncentives := annualProvisions.Mul(poolIncentivesProportion) - - return apyCalculator{ - distrInfo: distrInfo, - incentivizedPools: k.GetIncentivizedPools(ctx), - mintTokenPrice: mintTokenPrice, - annualPoolIncentives: annualPoolIncentives, - }, nil -} - -// Calculate the pool APY given the pool itself and it's TVL. -func (apyc apyCalculator) Calculate(ctx sdk.Context, pool balancerpool.Pool, poolTVL sdk.Dec) (sdk.Dec, error) { - // Calculate the pool total weight from it's incentivized gauges - poolTotalWeight := sdk.ZeroInt() - for _, incentive := range apyc.incentivizedPools { - if incentive.PoolId == pool.Id { - gaugeWeight, found := findGaugeWeight(ctx, incentive.GaugeId, apyc.distrInfo) - if !found { - return sdk.ZeroDec(), errorsmod.Wrap(types.ErrGaugeWeightNotFound, fmt.Sprintf("gauge id: %d", incentive.GaugeId)) - } - poolTotalWeight = poolTotalWeight.Add(gaugeWeight) - } - } - - // Total annual provision share (including all gauges) of the requested pool in $ - // is equal to "annualPoolIncentives * poolTotalWeight / distrInfo.TotalWeight * mintTokenPrice" - poolAnnualProvisions := apyc.annualPoolIncentives.MulInt(poolTotalWeight).QuoInt(apyc.distrInfo.TotalWeight).Mul(apyc.mintTokenPrice) - // APY of the requested pool is equal to "(poolAnnualProvisions / poolTVL) * 100" - poolAPY := poolAnnualProvisions.Quo(poolTVL).Mul(sdk.NewDec(100)) - return poolAPY, nil -} - -func (k Keeper) CalculatePoolTVL(ctx sdk.Context, pool balancerpool.Pool) (sdk.Dec, error) { - tvl := sdk.ZeroDec() - - for _, asset := range pool.PoolAssets { - price, err := k.qoracleKeeper.GetDenomPrice(ctx, asset.Token.Denom) - if err != nil { - return sdk.ZeroDec(), err - } - - tvl = tvl.Add(sdk.NewDecFromInt(asset.Token.Amount).Mul(price)) - } - return tvl, nil -} - -// findOsmosisEpochByIdentifier iterates over all osmosis epochs and returns the epoch with given identifier if exists. -func (k Keeper) findOsmosisEpochByIdentifier(ctx sdk.Context, identifier string) (epochtypes.EpochInfo, bool) { - for _, epoch := range k.GetEpochsInfo(ctx) { - if epoch.Identifier == identifier { - return epoch, true - } - } - return epochtypes.EpochInfo{}, false -} - -// findGaugeWeight iterates over distrInfo.Records and returns the weight of record is it finds and record with given gaugeId. -func findGaugeWeight(ctx sdk.Context, gaugeId uint64, distrInfo poolincentivestypes.DistrInfo) (sdkmath.Int, bool) { - for _, record := range distrInfo.Records { - if record.GaugeId == gaugeId { - return record.Weight, true - } - } - return sdk.ZeroInt(), false -} - -func extractPoolAssets(pool balancerpool.Pool) sdk.Coins { - coins := make([]sdk.Coin, len(pool.PoolAssets)) - for i, asset := range pool.PoolAssets { - coins[i] = sdk.NewCoin(asset.Token.Denom, asset.Token.Amount) - } - return sdk.NewCoins(coins...) -} diff --git a/x/qoracle/osmosis/keeper/epoch.go b/x/qoracle/osmosis/keeper/epoch.go deleted file mode 100644 index 5e8ff8ec1..000000000 --- a/x/qoracle/osmosis/keeper/epoch.go +++ /dev/null @@ -1,13 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) { - switch epochIdentifier { - case k.GetEpochIdentifier(ctx): - k.TryUpdateIncentivizedPools(ctx) - k.TryUpdateChainParams(ctx) - } -} diff --git a/x/qoracle/osmosis/keeper/epoch_hooks.go b/x/qoracle/osmosis/keeper/epoch_hooks.go deleted file mode 100644 index 78b7c2ca9..000000000 --- a/x/qoracle/osmosis/keeper/epoch_hooks.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - epochstypes "github.com/quasarlabs/quasarnode/x/epochs/types" -) - -// Hooks wrapper struct for qoracle bandchain keeper. -type EpochHooks struct { - k Keeper -} - -var _ epochstypes.EpochHooks = EpochHooks{} - -// Return the wrapper struct. -func (k Keeper) EpochHooks() EpochHooks { - return EpochHooks{k} -} - -func (h EpochHooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) {} - -func (h EpochHooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) { - h.k.AfterEpochEnd(ctx, epochIdentifier, epochNumber) -} diff --git a/x/qoracle/osmosis/keeper/events.go b/x/qoracle/osmosis/keeper/events.go deleted file mode 100644 index 4cb6ef741..000000000 --- a/x/qoracle/osmosis/keeper/events.go +++ /dev/null @@ -1,58 +0,0 @@ -package keeper - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" -) - -// EmitOsmosisRequestEvent emits an event signalling a successful or failed icq request to fetch osmosis chain params and including the error -// details if there's any. -func EmitOsmosisRequestEvent( - ctx sdk.Context, - title string, - packet channeltypes.Packet, - err error, -) { - attributes := []sdk.Attribute{ - sdk.NewAttribute(sdk.AttributeKeyModule, types.SubModuleName), - sdk.NewAttribute(types.AttributeKeyPacketChannelId, packet.GetSourceChannel()), - sdk.NewAttribute(types.AttributeKeyPacketSequence, fmt.Sprintf("%d", packet.GetSequence())), - sdk.NewAttribute(types.AttributeKeyTitle, title), - } - if err != nil { - attributes = append(attributes, sdk.NewAttribute(types.AttributeKeyError, err.Error())) - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeOsmosisRequest, - attributes..., - ), - ) -} - -// EmitAcknowledgementEvent emits an event signalling a successful or failed acknowledgement and including the error -// details if any. -func EmitAcknowledgementEvent(ctx sdk.Context, packet channeltypes.Packet, ack channeltypes.Acknowledgement, err error) { - attributes := []sdk.Attribute{ - sdk.NewAttribute(sdk.AttributeKeyModule, types.SubModuleName), - sdk.NewAttribute(types.AttributeKeyPacketChannelId, packet.GetDestChannel()), - sdk.NewAttribute(types.AttributeKeyPacketSequence, fmt.Sprintf("%d", packet.GetSequence())), - sdk.NewAttribute(types.AttributeKeyAckSuccess, fmt.Sprintf("%t", ack.Success())), - } - - if err != nil { - attributes = append(attributes, sdk.NewAttribute(types.AttributeKeyError, err.Error())) - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypePacket, - attributes..., - ), - ) -} diff --git a/x/qoracle/osmosis/keeper/genesis.go b/x/qoracle/osmosis/keeper/genesis.go deleted file mode 100644 index 63a6e1ecb..000000000 --- a/x/qoracle/osmosis/keeper/genesis.go +++ /dev/null @@ -1,34 +0,0 @@ -package keeper - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - - genesistypes "github.com/quasarlabs/quasarnode/x/qoracle/genesis/types" -) - -// InitGenesis initializes the capability module's state from a provided genesis -// state. -func InitGenesis(ctx sdk.Context, k Keeper, genState genesistypes.OsmosisGenesisState) { - k.SetPort(ctx, genState.Port) - - // Only try to bind to port if it is not already bound, since we may already own - // port capability from capability InitGenesis - if !k.IsBound(ctx, genState.Port) { - err := k.BindPort(ctx, genState.Port) - if err != nil { - panic(fmt.Sprintf("could not claim port capability: %v", err)) - } - } - - k.SetParams(ctx, genState.Params) -} - -// ExportGenesis returns the capability module's exported genesis. -func ExportGenesis(ctx sdk.Context, k Keeper) genesistypes.OsmosisGenesisState { - return genesistypes.NewOsmosisGenesisState( - k.GetPort(ctx), - k.GetParams(ctx), - ) -} diff --git a/x/qoracle/osmosis/keeper/grpc_query.go b/x/qoracle/osmosis/keeper/grpc_query.go deleted file mode 100644 index 279fb5df6..000000000 --- a/x/qoracle/osmosis/keeper/grpc_query.go +++ /dev/null @@ -1,91 +0,0 @@ -package keeper - -import ( - "context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - - balancerpool "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer" - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" -) - -var _ types.QueryServer = Keeper{} - -// Params implements the Query/Params gRPC method -func (q Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - params := q.GetParams(ctx) - - return &types.QueryParamsResponse{ - Params: params, - }, nil -} - -func (q Keeper) State(c context.Context, _ *types.QueryStateRequest) (*types.QueryStateResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - - return &types.QueryStateResponse{ - ParamsRequestState: q.GetRequestState(ctx, types.KeyParamsRequestState), - IncentivizedPoolsState: q.GetRequestState(ctx, types.KeyIncentivizedPoolsRequestState), - PoolsState: q.GetRequestState(ctx, types.KeyPoolsRequestState), - }, nil -} - -func (q Keeper) ChainParams(goCtx context.Context, req *types.QueryChainParamsRequest) (*types.QueryChainParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - - return &types.QueryChainParamsResponse{ - EpochsInfo: q.GetEpochsInfo(ctx), - LockableDurations: q.GetLockableDurations(ctx), - MintParams: q.GetMintParams(ctx), - MintEpochProvisions: q.GetMintEpochProvisions(ctx), - DistrInfo: q.GetDistrInfo(ctx), - }, nil -} - -func (q Keeper) IncentivizedPools(goCtx context.Context, req *types.QueryIncentivizedPoolsRequest) (*types.QueryIncentivizedPoolsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - return &types.QueryIncentivizedPoolsResponse{ - IncentivizedPools: q.GetIncentivizedPools(ctx), - }, nil -} - -func (q Keeper) Pools(goCtx context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - var pools []balancerpool.Pool - store := prefix.NewStore(ctx.KVStore(q.storeKey), types.KeyPoolPrefix) - pageRes, err := query.Paginate(store, req.Pagination, func(key []byte, value []byte) error { - var pool balancerpool.Pool - if err := q.cdc.Unmarshal(value, &pool); err != nil { - return err - } - - pools = append(pools, pool) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryPoolsResponse{ - Pools: pools, - Pagination: pageRes, - }, nil -} diff --git a/x/qoracle/osmosis/keeper/keeper.go b/x/qoracle/osmosis/keeper/keeper.go deleted file mode 100644 index 38b8eb114..000000000 --- a/x/qoracle/osmosis/keeper/keeper.go +++ /dev/null @@ -1,107 +0,0 @@ -package keeper - -import ( - "fmt" - - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - qoracletypes "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - paramSpace paramtypes.Subspace - authority string // the address capable of issuing chain params update. Usually the gov module account - - clientKeeper qoracletypes.ClientKeeper - ics4Wrapper porttypes.ICS4Wrapper - channelKeeper qoracletypes.ChannelKeeper - portKeeper qoracletypes.PortKeeper - - scopedKeeper capabilitykeeper.ScopedKeeper - - qoracleKeeper types.QOracle -} - -func NewKeeper( - cdc codec.BinaryCodec, - storeKey storetypes.StoreKey, - paramSpace paramtypes.Subspace, - authority string, - clientKeeper qoracletypes.ClientKeeper, - ics4Wrapper porttypes.ICS4Wrapper, - channelKeeper qoracletypes.ChannelKeeper, - portKeeper qoracletypes.PortKeeper, - scopedKeeper capabilitykeeper.ScopedKeeper, - qoracleKeeper types.QOracle, -) Keeper { - // set KeyTable if it has not already been set - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) - } - - return Keeper{ - cdc: cdc, - storeKey: storeKey, - paramSpace: paramSpace, - authority: authority, - clientKeeper: clientKeeper, - ics4Wrapper: ics4Wrapper, - channelKeeper: channelKeeper, - portKeeper: portKeeper, - scopedKeeper: scopedKeeper, - qoracleKeeper: qoracleKeeper, - } -} - -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/qoracle/%s", types.SubModuleName)) -} - -// BindPort stores the provided portID and binds to it, returning the associated capability -func (k Keeper) BindPort(ctx sdk.Context, portID string) error { - cap := k.portKeeper.BindPort(ctx, portID) - return k.ClaimCapability(ctx, cap, host.PortPath(portID)) -} - -// IsBound checks if the module already bound to the desired port -func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { - _, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID)) - return ok -} - -// GetPort returns the portID for the module. Used in ExportGenesis -func (k Keeper) GetPort(ctx sdk.Context) string { - store := ctx.KVStore(k.storeKey) - return string(store.Get(types.PortKey)) -} - -// SetPort sets the portID for the module. Used in InitGenesis -func (k Keeper) SetPort(ctx sdk.Context, portID string) { - store := ctx.KVStore(k.storeKey) - store.Set(types.PortKey, []byte(portID)) -} - -// AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function -func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool { - return k.scopedKeeper.AuthenticateCapability(ctx, cap, name) -} - -// ClaimCapability wraps the scopedKeeper's ClaimCapability function -func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { - return k.scopedKeeper.ClaimCapability(ctx, cap, name) -} - -func (k Keeper) Source() string { - return types.OracleSource -} diff --git a/x/qoracle/osmosis/keeper/msg_server.go b/x/qoracle/osmosis/keeper/msg_server.go deleted file mode 100644 index 43205d1bd..000000000 --- a/x/qoracle/osmosis/keeper/msg_server.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper - -import ( - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/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{} diff --git a/x/qoracle/osmosis/keeper/osmosis.go b/x/qoracle/osmosis/keeper/osmosis.go deleted file mode 100644 index a3fb28ff6..000000000 --- a/x/qoracle/osmosis/keeper/osmosis.go +++ /dev/null @@ -1,208 +0,0 @@ -package keeper - -import ( - "fmt" - "time" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - epochtypes "github.com/quasarlabs/quasarnode/osmosis/epochs/types" - balancerpool "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer" - minttypes "github.com/quasarlabs/quasarnode/osmosis/mint/types" - poolincentivestypes "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types" - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - qoracletypes "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -func (k Keeper) SetEpochsInfo(ctx sdk.Context, epochs []epochtypes.EpochInfo) { - store := ctx.KVStore(k.storeKey) - - store.Set(types.KeyEpochsInfo, k.cdc.MustMarshal(&types.EpochsInfo{EpochsInfo: epochs})) -} - -// GetEpochsInfo returns the latest received epochs info from osmosis -func (k Keeper) GetEpochsInfo(ctx sdk.Context) []epochtypes.EpochInfo { - store := ctx.KVStore(k.storeKey) - - var epochsInfo types.EpochsInfo - k.cdc.MustUnmarshal(store.Get(types.KeyEpochsInfo), &epochsInfo) - return epochsInfo.EpochsInfo -} - -func (k Keeper) SetPool(ctx sdk.Context, pool balancerpool.Pool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPoolPrefix) - - key := sdk.Uint64ToBigEndian(pool.Id) - store.Set(key, k.cdc.MustMarshal(&pool)) -} - -func (k Keeper) SetPoolsUpdatedAt(ctx sdk.Context, updatedAt time.Time) { - store := ctx.KVStore(k.storeKey) - - store.Set(types.KeyPoolsUpdatedAt, sdk.FormatTimeBytes(updatedAt)) -} - -// GetPools implements qoracletypes.PoolOracle -func (k Keeper) GetPools(ctx sdk.Context) ([]qoracletypes.Pool, error) { - apyc, err := k.newAPYCalculator(ctx) - if err != nil { - return nil, fmt.Errorf("could not create a new apyCalculator: %w", err) - } - - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPoolPrefix) - iter := store.Iterator(nil, nil) - defer iter.Close() - var pools []qoracletypes.Pool - for ; iter.Valid(); iter.Next() { - var pool balancerpool.Pool - k.cdc.MustUnmarshal(iter.Value(), &pool) - - tvl, err := k.CalculatePoolTVL(ctx, pool) - if err != nil { - k.Logger(ctx).Error("failed to calculate tvl for pool", - "pool", pool, - "error", err) - continue - } - apy, err := apyc.Calculate(ctx, pool, tvl) - if err != nil { - k.Logger(ctx).Error("failed to calculate apy for pool", - "pool", pool, - "error", err) - continue - } - - raw, err := codectypes.NewAnyWithValue(&pool) - if err != nil { - panic(err) // There's something wrong with our proto definitions - } - - pools = append(pools, qoracletypes.Pool{ - Id: fmt.Sprintf("%d", pool.Id), - Assets: extractPoolAssets(pool), - TVL: tvl, - APY: apy, - Raw: raw, - UpdatedAt: k.GetPoolsUpdatedAt(ctx), - }) - } - - return pools, nil -} - -// GetPoolsUpdatedAt returns the block time of the last time the pools were updated -func (k Keeper) GetPoolsUpdatedAt(ctx sdk.Context) time.Time { - store := ctx.KVStore(k.storeKey) - - updatedAt, err := sdk.ParseTimeBytes(store.Get(types.KeyPoolsUpdatedAt)) - if err != nil { - return ctx.BlockTime() - } - return updatedAt -} - -// GetPool returns the pool with the given id if exists -func (k Keeper) GetPool(ctx sdk.Context, id uint64) (balancerpool.Pool, bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPoolPrefix) - - key := sdk.Uint64ToBigEndian(id) - bz := store.Get(key) - if bz == nil { - return balancerpool.Pool{}, false - } - - var pool balancerpool.Pool - k.cdc.MustUnmarshal(bz, &pool) - return pool, true -} - -func (k Keeper) removeAllPools(ctx sdk.Context) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPoolPrefix) - - iterator := store.Iterator(nil, nil) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - store.Delete(iterator.Key()) - } -} - -func (k Keeper) SetLockableDurations(ctx sdk.Context, lockableDurations poolincentivestypes.QueryLockableDurationsResponse) { - store := ctx.KVStore(k.storeKey) - store.Set(types.KeyLockableDurations, k.cdc.MustMarshal(&lockableDurations)) -} - -// GetLockableDurations returns the latest received lockable durations from osmosis -func (k Keeper) GetLockableDurations(ctx sdk.Context) []time.Duration { - store := ctx.KVStore(k.storeKey) - var lockableDurations poolincentivestypes.QueryLockableDurationsResponse - k.cdc.MustUnmarshal(store.Get(types.KeyLockableDurations), &lockableDurations) - return lockableDurations.LockableDurations -} - -func (k Keeper) SetMintParams(ctx sdk.Context, mintParams minttypes.Params) { - store := ctx.KVStore(k.storeKey) - store.Set(types.KeyMintParams, k.cdc.MustMarshal(&mintParams)) -} - -// GetMintParams returns the latest received mint params from osmosis -func (k Keeper) GetMintParams(ctx sdk.Context) minttypes.Params { - store := ctx.KVStore(k.storeKey) - var mintParams minttypes.Params - k.cdc.MustUnmarshal(store.Get(types.KeyMintParams), &mintParams) - return mintParams -} - -func (k Keeper) SetMintEpochProvisions(ctx sdk.Context, epochProvisions sdk.Dec) { - store := ctx.KVStore(k.storeKey) - - bz, err := epochProvisions.Marshal() - if err != nil { - panic(err) - } - store.Set(types.KeyMintEpochProvisions, bz) -} - -// GetMintEpochProvisions returns the latest received epoch provisions from osmosis -func (k Keeper) GetMintEpochProvisions(ctx sdk.Context) sdk.Dec { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.KeyMintEpochProvisions) - - var epochProvisions sdk.Dec - err := epochProvisions.Unmarshal(bz) - if err != nil { - panic(err) - } - return epochProvisions -} - -func (k Keeper) SetIncentivizedPools(ctx sdk.Context, pools []poolincentivestypes.IncentivizedPool) { - store := ctx.KVStore(k.storeKey) - - store.Set(types.KeyIncentivizedPools, k.cdc.MustMarshal(&types.IncentivizedPools{IncentivizedPools: pools})) -} - -func (k Keeper) GetIncentivizedPools(ctx sdk.Context) []poolincentivestypes.IncentivizedPool { - store := ctx.KVStore(k.storeKey) - - var pools types.IncentivizedPools - k.cdc.MustUnmarshal(store.Get(types.KeyIncentivizedPools), &pools) - return pools.IncentivizedPools -} - -func (k Keeper) SetDistrInfo(ctx sdk.Context, distrInfo poolincentivestypes.DistrInfo) { - store := ctx.KVStore(k.storeKey) - - store.Set(types.KeyDistrInfo, k.cdc.MustMarshal(&distrInfo)) -} - -// GetDistrInfo returns the latest received distr info from osmosis -func (k Keeper) GetDistrInfo(ctx sdk.Context) poolincentivestypes.DistrInfo { - store := ctx.KVStore(k.storeKey) - - var distrInfo poolincentivestypes.DistrInfo - k.cdc.MustUnmarshal(store.Get(types.KeyDistrInfo), &distrInfo) - return distrInfo -} diff --git a/x/qoracle/osmosis/keeper/params.go b/x/qoracle/osmosis/keeper/params.go deleted file mode 100644 index 628d18bdd..000000000 --- a/x/qoracle/osmosis/keeper/params.go +++ /dev/null @@ -1,54 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" -) - -// GetParams returns the total set of module parameters. -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams( - k.IsEnabled(ctx), - k.GetEpochIdentifier(ctx), - k.GetAuthorizedChannel(ctx), - k.GetPacketTimeoutHeight(ctx), - k.GetPacketTimeoutTimestamp(ctx), - ) -} - -// SetParams sets the total set of module parameters. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) -} - -// IsEnabled retrieves the enabled boolean from the paramstore -func (k Keeper) IsEnabled(ctx sdk.Context) (res bool) { - k.paramSpace.Get(ctx, types.KeyEnabled, &res) - return -} - -// GetEpochIdentifier retrieves the epoch identifier from the paramstore -func (k Keeper) GetEpochIdentifier(ctx sdk.Context) (res string) { - k.paramSpace.Get(ctx, types.KeyEpochIdentifier, &res) - return -} - -// GetAuthorizedChannel retrieves the authorized channel from the paramstore -func (k Keeper) GetAuthorizedChannel(ctx sdk.Context) (res string) { - k.paramSpace.Get(ctx, types.KeyAuthorizedChannel, &res) - return -} - -// GetPacketTimeoutHeight retrieves the timeout height from the paramstore -func (k Keeper) GetPacketTimeoutHeight(ctx sdk.Context) (res clienttypes.Height) { - k.paramSpace.Get(ctx, types.KeyPacketTimeoutHeight, &res) - return -} - -// GetPacketTimeoutTimestamp retrieves the timeout timestamp from the paramstore -func (k Keeper) GetPacketTimeoutTimestamp(ctx sdk.Context) (res uint64) { - k.paramSpace.Get(ctx, types.KeyPacketTimeoutTimestamp, &res) - return -} diff --git a/x/qoracle/osmosis/keeper/relay.go b/x/qoracle/osmosis/keeper/relay.go deleted file mode 100644 index d702977ce..000000000 --- a/x/qoracle/osmosis/keeper/relay.go +++ /dev/null @@ -1,426 +0,0 @@ -package keeper - -import ( - errorsmod "cosmossdk.io/errors" - abcitypes "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - - epochtypes "github.com/quasarlabs/quasarnode/osmosis/epochs/types" - balancerpool "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer" - gammtypes "github.com/quasarlabs/quasarnode/osmosis/gamm/types" - minttypes "github.com/quasarlabs/quasarnode/osmosis/mint/types" - poolincentivestypes "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types" - "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" - "github.com/quasarlabs/quasarnode/x/qoracle/utils" -) - -// Param request - -func (k Keeper) TryUpdateChainParams(ctx sdk.Context) { - - // Do not start a new procedure if module is disabled - if !k.IsEnabled(ctx) { - return - } - - state := k.GetRequestState(ctx, types.KeyParamsRequestState) - if state.Pending() { - k.Logger(ctx).Info("tried to update osmosis chain params but another request is pending") - return - } - - seq, err := k.sendParamsRequest(ctx) - if err != nil { - k.Logger(ctx).Error("error in sending param request", - "seq", seq, - "error", err) - } -} - -func (k Keeper) sendParamsRequest(ctx sdk.Context) (uint64, error) { - packetData := types.NewOsmosisParamsICQPacketData() - packet, err := utils.SendPacket( - ctx, - k.clientKeeper, - k.ics4Wrapper, - k.channelKeeper, - k.scopedKeeper, - k.GetPort(ctx), - k.GetAuthorizedChannel(ctx), - packetData.GetBytes(), - k.GetPacketTimeoutHeight(ctx), - k.GetPacketTimeoutTimestamp(ctx), - ) - EmitOsmosisRequestEvent(ctx, "chain_params", packet, err) - if err != nil { - return 0, err - } - - state := types.NewOsmosisRequestState(ctx, packet.GetSequence()) - k.setRequestState(ctx, types.KeyParamsRequestState, state) - - return packet.GetSequence(), nil -} - -func (k Keeper) UpdateRequestState( - ctx sdk.Context, - key []byte, - fn func(state *types.OsmosisRequestState) error, -) error { - state := k.GetRequestState(ctx, key) - - if err := fn(&state); err != nil { - return err - } - state.UpdatedAtHeight = ctx.BlockHeight() - - k.setRequestState(ctx, key, state) - return nil -} - -func (k Keeper) setRequestState(ctx sdk.Context, key []byte, state types.OsmosisRequestState) { - store := ctx.KVStore(k.storeKey) - store.Set(key, k.cdc.MustMarshal(&state)) -} - -// GetRequestState returns the state of the osmosis request given its key -func (k Keeper) GetRequestState(ctx sdk.Context, key []byte) types.OsmosisRequestState { - store := ctx.KVStore(k.storeKey) - var state types.OsmosisRequestState - k.cdc.MustUnmarshal(store.Get(key), &state) - return state -} - -func (k Keeper) TryUpdateIncentivizedPools(ctx sdk.Context) { - // Do not start a new procedure if module is disabled - if !k.IsEnabled(ctx) { - k.Logger(ctx).Info("module is disabled, skipping IncentivizedPools update") - return - } - - // Do not start a new procedure if there's another one pending - state := k.GetRequestState(ctx, types.KeyIncentivizedPoolsRequestState) - if state.Pending() { - k.Logger(ctx).Info("tried to update IncentivizedPools but another request is pending") - return - } - - _, err := k.sendIncentivizedPoolsRequest(ctx) - if err != nil { - k.Logger(ctx).Error("could not send IncentivizedPools request to osmosis", "error", err) - return - } -} - -func (k Keeper) sendIncentivizedPoolsRequest(ctx sdk.Context) (uint64, error) { - packetData := types.NewOsmosisIncentivizedPoolsICQPacketData() - packet, err := utils.SendPacket( - ctx, - k.clientKeeper, - k.ics4Wrapper, - k.channelKeeper, - k.scopedKeeper, - k.GetPort(ctx), - k.GetAuthorizedChannel(ctx), - packetData.GetBytes(), - k.GetPacketTimeoutHeight(ctx), - k.GetPacketTimeoutTimestamp(ctx), - ) - EmitOsmosisRequestEvent(ctx, "incentivized_pools", packet, err) - if err != nil { - return 0, err - } - - state := types.NewOsmosisRequestState(ctx, packet.GetSequence()) - k.setRequestState(ctx, types.KeyIncentivizedPoolsRequestState, state) - - return packet.GetSequence(), nil -} - -func (k Keeper) TryUpdatePools(ctx sdk.Context) { - // Do not start a new procedure if module is disabled - if !k.IsEnabled(ctx) { - k.Logger(ctx).Info("module is disabled, skipping Pools update") - return - } - - // Do not start a new procedure if there's another one pending - state := k.GetRequestState(ctx, types.KeyPoolsRequestState) - if state.Pending() { - k.Logger(ctx).Info("tried to update Pools but another request is pending") - return - } - - incentivizedPools := k.GetIncentivizedPools(ctx) - if len(incentivizedPools) == 0 { - k.Logger(ctx).Info("empty IncentivizedPools list, skipping Pools update") - // Remove all the pools in store, because we have to reflect exactly what we receive from osmosis - k.removeAllPools(ctx) - return - } - - poolIds := types.UniquePoolIdsFromIncentivizedPools(incentivizedPools) - _, err := k.sendPoolsRequest(ctx, poolIds) - if err != nil { - k.Logger(ctx).Error("could not send Pools request to osmosis", "error", err) - return - } -} - -func (k Keeper) sendPoolsRequest(ctx sdk.Context, poolIds []uint64) (uint64, error) { - packetData := types.NewOsmosisPoolsICQPacketData(poolIds) - packet, err := utils.SendPacket( - ctx, - k.clientKeeper, - k.ics4Wrapper, - k.channelKeeper, - k.scopedKeeper, - k.GetPort(ctx), - k.GetAuthorizedChannel(ctx), - packetData.GetBytes(), - k.GetPacketTimeoutHeight(ctx), - k.GetPacketTimeoutTimestamp(ctx), - ) - EmitOsmosisRequestEvent(ctx, "pools", packet, err) - if err != nil { - return 0, err - } - - state := types.NewOsmosisRequestState(ctx, packet.GetSequence()) - k.setRequestState(ctx, types.KeyPoolsRequestState, state) - - return packet.GetSequence(), nil -} - -func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error { - paramsState := k.GetRequestState(ctx, types.KeyParamsRequestState) - incentivizedPoolsState := k.GetRequestState(ctx, types.KeyIncentivizedPoolsRequestState) - poolsState := k.GetRequestState(ctx, types.KeyPoolsRequestState) - - if !ack.Success() { - // Update the state of osmosis params request if it matches the sequence of packet - switch packet.GetSequence() { - case paramsState.GetPacketSequence(): - err := k.UpdateRequestState(ctx, types.KeyParamsRequestState, func(state *types.OsmosisRequestState) error { - state.Fail() - return nil - }) - if err != nil { - return err - } - case incentivizedPoolsState.GetPacketSequence(): - err := k.UpdateRequestState(ctx, types.KeyIncentivizedPoolsRequestState, func(state *types.OsmosisRequestState) error { - state.Fail() - return nil - }) - if err != nil { - return err - } - case poolsState.GetPacketSequence(): - err := k.UpdateRequestState(ctx, types.KeyPoolsRequestState, func(state *types.OsmosisRequestState) error { - state.Fail() - return nil - }) - if err != nil { - return err - } - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeOsmosisPacketAcknowledgement, - sdk.NewAttribute(types.AttributeKeyError, ack.GetError()), - ), - ) - return nil - } - - var ackData icqtypes.InterchainQueryPacketAck - if err := types.ModuleCdc.UnmarshalJSON(ack.GetResult(), &ackData); err != nil { - return errorsmod.Wrapf(err, "could not unmarshal icq packet acknowledgement data") - } - resps, err := icqtypes.DeserializeCosmosResponse(ackData.Data) - if err != nil { - return errorsmod.Wrapf(err, "could not unmarshal icq acknowledgement data to cosmos response") - } - - var packetData icqtypes.InterchainQueryPacketData - if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &packetData); err != nil { - return errorsmod.Wrapf(err, "could not unmarshal icq packet data") - } - reqs, err := icqtypes.DeserializeCosmosQuery(packetData.Data) - if err != nil { - return errorsmod.Wrapf(err, "could not unmarshal icq packet data to cosmos query") - } - - cacheCtx, writeCache := ctx.CacheContext() - - for i, req := range reqs { - if err := k.handleOsmosisICQResponse(cacheCtx, req, resps[i]); err != nil { - return errorsmod.Wrapf(err, "could not handle icq response of request %d", i) - } - } - - // Update the state of osmosis params request if it matches the sequence of packet - switch packet.Sequence { - case paramsState.PacketSequence: - err := k.UpdateRequestState(cacheCtx, types.KeyParamsRequestState, func(state *types.OsmosisRequestState) error { - state.Success() - return nil - }) - if err != nil { - return err - } - case incentivizedPoolsState.PacketSequence: - err := k.UpdateRequestState(cacheCtx, types.KeyIncentivizedPoolsRequestState, func(state *types.OsmosisRequestState) error { - state.Success() - return nil - }) - if err != nil { - return err - } - - // Sends a request to update pools info - // TODO: Move this to EndBlock handler as it consumes gas from relayer - k.TryUpdatePools(cacheCtx) - case poolsState.PacketSequence: - k.SetPoolsUpdatedAt(cacheCtx, cacheCtx.BlockTime()) - - err := k.UpdateRequestState(cacheCtx, types.KeyPoolsRequestState, func(state *types.OsmosisRequestState) error { - state.Success() - return nil - }) - if err != nil { - return err - } - - k.qoracleKeeper.NotifyPoolsUpdate(ctx) - } - - // NOTE: The context returned by CacheContext() creates a new EventManager, so events must be correctly propagated back to the current context - ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) - writeCache() - return nil -} - -func (k Keeper) handleOsmosisICQResponse(ctx sdk.Context, req abcitypes.RequestQuery, resp abcitypes.ResponseQuery) error { - if resp.IsErr() { - return errorsmod.Wrapf(types.ErrFailedICQResponse, "icq response failed with code %d", resp.GetCode()) - } - - switch req.Path { - case types.OsmosisQueryEpochsInfoPath: - return k.handleOsmosisEpochsInfoResponse(ctx, req, resp) - case types.OsmosisQueryPoolPath: - return k.handleOsmosisPoolResponse(ctx, req, resp) - case types.OsmosisQueryLockableDurationsPath: - return k.handleOsmosisLockableDurationsResponse(ctx, req, resp) - case types.OsmosisQueryMintParamsPath: - return k.handleOsmosisMintParamsResponse(ctx, req, resp) - case types.OsmosisQueryMintEpochProvisionsPath: - return k.handleOsmosisMintEpochProvisionsResponse(ctx, req, resp) - case types.OsmosisQueryIncentivizedPoolsPath: - return k.handleOsmosisIncentivizedPoolsResponse(ctx, req, resp) - case types.OsmosisQueryDistrInfoPath: - return k.handleOsmosisDistrInfoResponse(ctx, req, resp) - default: - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "icq response handler for path %s not found", req.Path) - } -} - -func (k Keeper) handleOsmosisEpochsInfoResponse(ctx sdk.Context, req abcitypes.RequestQuery, resp abcitypes.ResponseQuery) error { - var qresp epochtypes.QueryEpochsInfoResponse - k.cdc.MustUnmarshal(resp.GetValue(), &qresp) - - k.SetEpochsInfo(ctx, qresp.Epochs) - return nil -} - -func (k Keeper) handleOsmosisPoolResponse(ctx sdk.Context, req abcitypes.RequestQuery, resp abcitypes.ResponseQuery) error { - var qresp gammtypes.QueryPoolResponse - k.cdc.MustUnmarshal(resp.GetValue(), &qresp) - - var pool balancerpool.Pool - err := pool.Unmarshal(qresp.GetPool().GetValue()) - if err != nil { - return errorsmod.Wrapf(err, "could not unmarshal pool") - } - - k.SetPool(ctx, pool) - return nil -} - -func (k Keeper) handleOsmosisLockableDurationsResponse(ctx sdk.Context, req abcitypes.RequestQuery, resp abcitypes.ResponseQuery) error { - var qresp poolincentivestypes.QueryLockableDurationsResponse - k.cdc.MustUnmarshal(resp.GetValue(), &qresp) - - k.SetLockableDurations(ctx, qresp) - return nil -} - -func (k Keeper) handleOsmosisMintParamsResponse(ctx sdk.Context, req abcitypes.RequestQuery, resp abcitypes.ResponseQuery) error { - var qresp minttypes.QueryParamsResponse - k.cdc.MustUnmarshal(resp.GetValue(), &qresp) - - k.SetMintParams(ctx, qresp.Params) - return nil -} - -func (k Keeper) handleOsmosisMintEpochProvisionsResponse(ctx sdk.Context, req abcitypes.RequestQuery, resp abcitypes.ResponseQuery) error { - var qresp minttypes.QueryEpochProvisionsResponse - k.cdc.MustUnmarshal(resp.GetValue(), &qresp) - - k.SetMintEpochProvisions(ctx, qresp.EpochProvisions) - return nil -} - -func (k Keeper) handleOsmosisIncentivizedPoolsResponse(ctx sdk.Context, req abcitypes.RequestQuery, resp abcitypes.ResponseQuery) error { - var qresp poolincentivestypes.QueryIncentivizedPoolsResponse - k.cdc.MustUnmarshal(resp.GetValue(), &qresp) - - k.SetIncentivizedPools(ctx, qresp.IncentivizedPools) - return nil -} - -func (k Keeper) handleOsmosisDistrInfoResponse(ctx sdk.Context, req abcitypes.RequestQuery, resp abcitypes.ResponseQuery) error { - var qresp poolincentivestypes.QueryDistrInfoResponse - k.cdc.MustUnmarshal(resp.GetValue(), &qresp) - - k.SetDistrInfo(ctx, qresp.DistrInfo) - return nil -} - -func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) error { - - paramsState := k.GetRequestState(ctx, types.KeyParamsRequestState) - if paramsState.Pending() && paramsState.PacketSequence == packet.GetSequence() { - k.Logger(ctx).Error("osmosis param request state is timed out.", - "packet", packet.String()) - paramsState.Fail() - return errorsmod.Wrapf(types.ErrOsmosisICQTimedOut, "osmosis req packet timedout. packet %s", packet.String()) - } - - incentivizedPoolsState := k.GetRequestState(ctx, types.KeyIncentivizedPoolsRequestState) - if incentivizedPoolsState.Pending() && incentivizedPoolsState.PacketSequence == packet.GetSequence() { - k.Logger(ctx).Error("osmosis incentivized pools state request is timed out.", - "packet", packet.String()) - incentivizedPoolsState.Fail() - return errorsmod.Wrapf(types.ErrOsmosisICQTimedOut, "osmosis req packet timedout. packet %s", packet.String()) - - } - - poolsState := k.GetRequestState(ctx, types.KeyPoolsRequestState) - if poolsState.Pending() && poolsState.PacketSequence == packet.GetSequence() { - k.Logger(ctx).Error("osmosis pool request is timed out.", - "packet", packet.String()) - poolsState.Fail() - return errorsmod.Wrapf(types.ErrOsmosisICQTimedOut, "osmosis req packet timedout. packet %s", packet.String()) - } - - k.Logger(ctx).Error("Unknown timeout for the icq channel.", "packet", packet.String()) - return errorsmod.Wrapf(types.ErrOsmosisICQTimedOut, "Unknown osmosis req packet timed out. packet %s", packet.String()) - -} diff --git a/x/qoracle/osmosis/types/codec.go b/x/qoracle/osmosis/types/codec.go deleted file mode 100644 index 7fe32ef42..000000000 --- a/x/qoracle/osmosis/types/codec.go +++ /dev/null @@ -1,20 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/gogoproto/proto" - balancerpool "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer" -) - -func RegisterCodec(cdc *codec.LegacyAmino) { -} - -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - registry.RegisterImplementations((*proto.Message)(nil), &balancerpool.Pool{}) -} - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) diff --git a/x/qoracle/osmosis/types/errors.go b/x/qoracle/osmosis/types/errors.go deleted file mode 100644 index abf03a1c5..000000000 --- a/x/qoracle/osmosis/types/errors.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" -) - -// IBC transfer sentinel errors -var ( - ErrDisabled = errorsmod.Register(SubModuleName, 2, "osmosis oracle module is disabled") - ErrInvalidChannelFlow = errorsmod.Register(SubModuleName, 3, "invalid message sent to channel end") - ErrFailedICQResponse = errorsmod.Register(SubModuleName, 4, "failed ICQ response") - ErrEpochNotFound = errorsmod.Register(SubModuleName, 5, "epoch not found") - ErrGaugeWeightNotFound = errorsmod.Register(SubModuleName, 6, "gauge weight not found") - ErrOsmosisICQTimedOut = errorsmod.Register(SubModuleName, 7, "osmosis icq request timeout") -) diff --git a/x/qoracle/osmosis/types/events.go b/x/qoracle/osmosis/types/events.go deleted file mode 100644 index f61a28a70..000000000 --- a/x/qoracle/osmosis/types/events.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -const ( - // EventTypePacket is the general event for IBC layer before getting into icq processing - EventTypePacket = "packet" - // EventTypeOsmosisRequest is the type for the osmosis ICQ request events - EventTypeOsmosisRequest = "osmosis_request" - // EventTypeOsmosisPacketAcknowledgement is the type for the event osmosis ICQ acknowledgement - EventTypeOsmosisPacketAcknowledgement = "osmosis_packet_acknowledgement" -) - -const ( - // AttributeKeyPacketChannelId is the attribute for the packet channel id - AttributeKeyPacketChannelId = "packet_channel_id" - // AttributePacketSequence is the attribute for the packet sequence - AttributeKeyPacketSequence = "packet_sequence" - // AttributeKeyTitle is the attribute for icq request titles - AttributeKeyTitle = "title" - // AttributeKeyAckSuccess is the attribute which indicates whether IBC ack is successful - AttributeKeyAckSuccess = "ack_success" - // AttributeError is the attribute key for the error - AttributeKeyError = "error" -) diff --git a/x/qoracle/osmosis/types/expected_keepers.go b/x/qoracle/osmosis/types/expected_keepers.go deleted file mode 100644 index 6508c9492..000000000 --- a/x/qoracle/osmosis/types/expected_keepers.go +++ /dev/null @@ -1,9 +0,0 @@ -package types - -import sdk "github.com/cosmos/cosmos-sdk/types" - -// QOracle is an interface of qoracle keeper. -type QOracle interface { - NotifyPoolsUpdate(ctx sdk.Context) - GetDenomPrice(ctx sdk.Context, denom string) (sdk.Dec, error) -} diff --git a/x/qoracle/osmosis/types/keys.go b/x/qoracle/osmosis/types/keys.go deleted file mode 100644 index 5da0ceb45..000000000 --- a/x/qoracle/osmosis/types/keys.go +++ /dev/null @@ -1,48 +0,0 @@ -package types - -const ( - // SubModuleName defines the sub module name - SubModuleName = "qosmosisoracle" - - // StoreKey defines the primary module store key - StoreKey = SubModuleName - - // RouterKey is the message route for slashing - RouterKey = SubModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = SubModuleName - - // PortID is the default port id that qoracle module binds to - PortID = SubModuleName - - // OracleSource defines the source of oracle data - OracleSource = "osmosis" -) - -var ( - // PortKey defines the key to store the port ID in store - PortKey = []byte{0x01} - // KeyParamsRequestState defines the key to store state of chain params request - KeyParamsRequestState = []byte{0x02} - // KeyIncentivizedPoolsRequestState defines the key to store state of osmosis incentivized pools request - KeyIncentivizedPoolsRequestState = []byte{0x03} - // KeyPoolsRequestState defines the key to store state of osmosis pools request - KeyPoolsRequestState = []byte{0x04} - // KeyEpochsInfo defines the key to store osmosis epochs info in store - KeyEpochsInfo = []byte{0x05} - // KeyPoolPrefix defines the prefix key to store osmosis pools in store - KeyPoolPrefix = []byte{0x06} - // KeyPoolsUpdatedAt defines the key to store osmosis pools updated at in store - KeyPoolsUpdatedAt = []byte{0x07} - // KeyLockableDurations defines the key to store lockable durations in store - KeyLockableDurations = []byte{0x08} - // KeyMintParams defines the key to store mint params in store - KeyMintParams = []byte{0x09} - // KeyMintEpochProvisions defines the key to store mint epoch provisions in store - KeyMintEpochProvisions = []byte{0x0A} - // KeyIncentivizedPools defines the key to store incentivized pools in store - KeyIncentivizedPools = []byte{0x0B} - // KeyDistrInfo defines the key to store distribution info in store - KeyDistrInfo = []byte{0x0C} -) diff --git a/x/qoracle/osmosis/types/msgs.go b/x/qoracle/osmosis/types/msgs.go deleted file mode 100644 index ab1254f4c..000000000 --- a/x/qoracle/osmosis/types/msgs.go +++ /dev/null @@ -1 +0,0 @@ -package types diff --git a/x/qoracle/osmosis/types/msgs_test.go b/x/qoracle/osmosis/types/msgs_test.go deleted file mode 100644 index ab1254f4c..000000000 --- a/x/qoracle/osmosis/types/msgs_test.go +++ /dev/null @@ -1 +0,0 @@ -package types diff --git a/x/qoracle/osmosis/types/osmosis.go b/x/qoracle/osmosis/types/osmosis.go deleted file mode 100644 index 633639d42..000000000 --- a/x/qoracle/osmosis/types/osmosis.go +++ /dev/null @@ -1,125 +0,0 @@ -package types - -import ( - abcitypes "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" - icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" - - epochtypes "github.com/quasarlabs/quasarnode/osmosis/epochs/types" - gammtypes "github.com/quasarlabs/quasarnode/osmosis/gamm/types" - minttypes "github.com/quasarlabs/quasarnode/osmosis/mint/types" - poolincentivestypes "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types" -) - -const ( - OsmosisQueryEpochsInfoPath = "/osmosis.epochs.v1beta1.Query/EpochInfos" - OsmosisQueryPoolPath = "/osmosis.gamm.v1beta1.Query/Pool" - OsmosisQueryLockableDurationsPath = "/osmosis.poolincentives.v1beta1.Query/LockableDurations" - OsmosisQueryMintParamsPath = "/osmosis.mint.v1beta1.Query/Params" - OsmosisQueryMintEpochProvisionsPath = "/osmosis.mint.v1beta1.Query/EpochProvisions" - OsmosisQueryIncentivizedPoolsPath = "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools" - OsmosisQueryDistrInfoPath = "/osmosis.poolincentives.v1beta1.Query/DistrInfo" -) - -func NewOsmosisParamsICQPacketData() icqtypes.InterchainQueryPacketData { - data, err := icqtypes.SerializeCosmosQuery([]abcitypes.RequestQuery{ - { - Path: OsmosisQueryEpochsInfoPath, - Data: ModuleCdc.MustMarshal(&epochtypes.QueryEpochsInfoRequest{}), - }, - { - Path: OsmosisQueryLockableDurationsPath, - Data: ModuleCdc.MustMarshal(&poolincentivestypes.QueryLockableDurationsRequest{}), - }, - { - Path: OsmosisQueryMintParamsPath, - Data: ModuleCdc.MustMarshal(&minttypes.QueryParamsRequest{}), - }, - { - Path: OsmosisQueryMintEpochProvisionsPath, - Data: ModuleCdc.MustMarshal(&minttypes.QueryEpochProvisionsRequest{}), - }, - { - Path: OsmosisQueryDistrInfoPath, - Data: ModuleCdc.MustMarshal(&poolincentivestypes.QueryDistrInfoRequest{}), - }, - }) - if err != nil { - panic(err) - } - - return icqtypes.InterchainQueryPacketData{Data: data} -} - -func NewOsmosisIncentivizedPoolsICQPacketData() icqtypes.InterchainQueryPacketData { - data, err := icqtypes.SerializeCosmosQuery([]abcitypes.RequestQuery{ - { - Path: OsmosisQueryIncentivizedPoolsPath, - Data: ModuleCdc.MustMarshal(&poolincentivestypes.QueryIncentivizedPoolsRequest{}), - }, - }) - if err != nil { - panic(err) - } - - return icqtypes.InterchainQueryPacketData{Data: data} -} - -func NewOsmosisPoolsICQPacketData(poolIds []uint64) icqtypes.InterchainQueryPacketData { - reqs := make([]abcitypes.RequestQuery, len(poolIds)) - for i, poolId := range poolIds { - reqs[i] = abcitypes.RequestQuery{ - Path: OsmosisQueryPoolPath, - Data: ModuleCdc.MustMarshal(&gammtypes.QueryPoolRequest{ - PoolId: poolId, - }), - } - } - - data, err := icqtypes.SerializeCosmosQuery(reqs) - if err != nil { - panic(err) - } - return icqtypes.InterchainQueryPacketData{Data: data} -} - -// UniquePoolIdsFromIncentivizedPools returns the unique pool ids from an array of incentivized pools. -func UniquePoolIdsFromIncentivizedPools(incentivizedPools []poolincentivestypes.IncentivizedPool) []uint64 { - poolIds := make([]uint64, 0, len(incentivizedPools)) - for _, pool := range incentivizedPools { - skip := false - for _, id := range poolIds { - if id == pool.PoolId { - skip = true - break - } - } - if skip { - continue - } - - poolIds = append(poolIds, pool.PoolId) - } - return poolIds -} - -func NewOsmosisRequestState(ctx sdk.Context, seq uint64) OsmosisRequestState { - return OsmosisRequestState{ - PacketSequence: seq, - Acknowledged: false, - Failed: false, - UpdatedAtHeight: ctx.BlockHeight(), - } -} - -func (state OsmosisRequestState) Pending() bool { - return state.PacketSequence > 0 && !state.Acknowledged && !state.Failed -} - -func (state *OsmosisRequestState) Success() { - state.Acknowledged = true -} - -func (state *OsmosisRequestState) Fail() { - state.Failed = true -} diff --git a/x/qoracle/osmosis/types/osmosis.pb.go b/x/qoracle/osmosis/types/osmosis.pb.go deleted file mode 100644 index 4d406090c..000000000 --- a/x/qoracle/osmosis/types/osmosis.pb.go +++ /dev/null @@ -1,798 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/osmosis/osmosis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/quasarlabs/quasarnode/osmosis/epochs/types" - types "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types" - 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 - -type OsmosisRequestState struct { - PacketSequence uint64 `protobuf:"varint,1,opt,name=packet_sequence,json=packetSequence,proto3" json:"packet_sequence,omitempty"` - Acknowledged bool `protobuf:"varint,2,opt,name=acknowledged,proto3" json:"acknowledged,omitempty"` - Failed bool `protobuf:"varint,3,opt,name=failed,proto3" json:"failed,omitempty"` - UpdatedAtHeight int64 `protobuf:"varint,4,opt,name=updated_at_height,json=updatedAtHeight,proto3" json:"updated_at_height,omitempty"` -} - -func (m *OsmosisRequestState) Reset() { *m = OsmosisRequestState{} } -func (m *OsmosisRequestState) String() string { return proto.CompactTextString(m) } -func (*OsmosisRequestState) ProtoMessage() {} -func (*OsmosisRequestState) Descriptor() ([]byte, []int) { - return fileDescriptor_f722bf98fd1371cc, []int{0} -} -func (m *OsmosisRequestState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *OsmosisRequestState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OsmosisRequestState.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 *OsmosisRequestState) XXX_Merge(src proto.Message) { - xxx_messageInfo_OsmosisRequestState.Merge(m, src) -} -func (m *OsmosisRequestState) XXX_Size() int { - return m.Size() -} -func (m *OsmosisRequestState) XXX_DiscardUnknown() { - xxx_messageInfo_OsmosisRequestState.DiscardUnknown(m) -} - -var xxx_messageInfo_OsmosisRequestState proto.InternalMessageInfo - -func (m *OsmosisRequestState) GetPacketSequence() uint64 { - if m != nil { - return m.PacketSequence - } - return 0 -} - -func (m *OsmosisRequestState) GetAcknowledged() bool { - if m != nil { - return m.Acknowledged - } - return false -} - -func (m *OsmosisRequestState) GetFailed() bool { - if m != nil { - return m.Failed - } - return false -} - -func (m *OsmosisRequestState) GetUpdatedAtHeight() int64 { - if m != nil { - return m.UpdatedAtHeight - } - return 0 -} - -type IncentivizedPools struct { - IncentivizedPools []types.IncentivizedPool `protobuf:"bytes,1,rep,name=incentivized_pools,json=incentivizedPools,proto3" json:"incentivized_pools"` -} - -func (m *IncentivizedPools) Reset() { *m = IncentivizedPools{} } -func (m *IncentivizedPools) String() string { return proto.CompactTextString(m) } -func (*IncentivizedPools) ProtoMessage() {} -func (*IncentivizedPools) Descriptor() ([]byte, []int) { - return fileDescriptor_f722bf98fd1371cc, []int{1} -} -func (m *IncentivizedPools) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IncentivizedPools) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IncentivizedPools.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 *IncentivizedPools) XXX_Merge(src proto.Message) { - xxx_messageInfo_IncentivizedPools.Merge(m, src) -} -func (m *IncentivizedPools) XXX_Size() int { - return m.Size() -} -func (m *IncentivizedPools) XXX_DiscardUnknown() { - xxx_messageInfo_IncentivizedPools.DiscardUnknown(m) -} - -var xxx_messageInfo_IncentivizedPools proto.InternalMessageInfo - -func (m *IncentivizedPools) GetIncentivizedPools() []types.IncentivizedPool { - if m != nil { - return m.IncentivizedPools - } - return nil -} - -type EpochsInfo struct { - EpochsInfo []types1.EpochInfo `protobuf:"bytes,1,rep,name=epochs_info,json=epochsInfo,proto3" json:"epochs_info"` -} - -func (m *EpochsInfo) Reset() { *m = EpochsInfo{} } -func (m *EpochsInfo) String() string { return proto.CompactTextString(m) } -func (*EpochsInfo) ProtoMessage() {} -func (*EpochsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_f722bf98fd1371cc, []int{2} -} -func (m *EpochsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EpochsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EpochsInfo.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 *EpochsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_EpochsInfo.Merge(m, src) -} -func (m *EpochsInfo) XXX_Size() int { - return m.Size() -} -func (m *EpochsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_EpochsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_EpochsInfo proto.InternalMessageInfo - -func (m *EpochsInfo) GetEpochsInfo() []types1.EpochInfo { - if m != nil { - return m.EpochsInfo - } - return nil -} - -func init() { - proto.RegisterType((*OsmosisRequestState)(nil), "quasarlabs.quasarnode.qoracle.osmosis.OsmosisRequestState") - proto.RegisterType((*IncentivizedPools)(nil), "quasarlabs.quasarnode.qoracle.osmosis.IncentivizedPools") - proto.RegisterType((*EpochsInfo)(nil), "quasarlabs.quasarnode.qoracle.osmosis.EpochsInfo") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/osmosis/osmosis.proto", fileDescriptor_f722bf98fd1371cc) -} - -var fileDescriptor_f722bf98fd1371cc = []byte{ - // 407 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xcf, 0x6e, 0x94, 0x40, - 0x18, 0x67, 0xdc, 0x4d, 0x63, 0xa6, 0xc6, 0x66, 0x47, 0x63, 0x48, 0x0f, 0x88, 0x44, 0x23, 0xe9, - 0x61, 0xb0, 0xf6, 0xe2, 0xd5, 0x26, 0x26, 0xed, 0x49, 0x43, 0x13, 0x0f, 0x5e, 0xc8, 0x00, 0xdf, - 0xc2, 0xa4, 0x74, 0x3e, 0x60, 0x86, 0x6a, 0xfb, 0x14, 0x3e, 0x85, 0xcf, 0xd2, 0x63, 0x8f, 0x9e, - 0x8c, 0xd9, 0x7d, 0x11, 0x03, 0xcc, 0xb2, 0xb6, 0x7a, 0x62, 0xf8, 0x7d, 0xbf, 0x3f, 0xf0, 0x9b, - 0x8f, 0x1e, 0x35, 0x9d, 0xd0, 0xa2, 0xad, 0x44, 0xaa, 0xa3, 0xf1, 0xa8, 0x30, 0x87, 0xa8, 0xc1, - 0x56, 0x64, 0x15, 0x44, 0xa8, 0x2f, 0x50, 0x4b, 0xbd, 0x79, 0xf2, 0xba, 0x45, 0x83, 0xec, 0xd5, - 0x56, 0xc4, 0xb7, 0x22, 0x6e, 0x45, 0xdc, 0x92, 0xf7, 0x9f, 0x16, 0x58, 0xe0, 0xa0, 0x88, 0xfa, - 0xd3, 0x28, 0xde, 0x3f, 0xd8, 0x78, 0xd6, 0x88, 0x95, 0x54, 0x19, 0x28, 0x23, 0x2f, 0x41, 0x47, - 0x97, 0x87, 0x29, 0x18, 0x71, 0x18, 0x35, 0x1d, 0xb4, 0x57, 0x96, 0xfb, 0x72, 0xc3, 0x85, 0x1a, - 0xb3, 0x72, 0xcb, 0x29, 0x40, 0xc1, 0xf4, 0x39, 0xc1, 0x0f, 0x42, 0x9f, 0x7c, 0x1c, 0x89, 0x31, - 0x34, 0x1d, 0x68, 0x73, 0x66, 0x84, 0x01, 0xf6, 0x9a, 0xee, 0xd5, 0x22, 0x3b, 0x07, 0x93, 0xe8, - 0x1e, 0x56, 0x19, 0xb8, 0xc4, 0x27, 0xe1, 0x3c, 0x7e, 0x3c, 0xc2, 0x67, 0x16, 0x65, 0x01, 0x7d, - 0x24, 0xb2, 0x73, 0x85, 0x5f, 0x2b, 0xc8, 0x0b, 0xc8, 0xdd, 0x07, 0x3e, 0x09, 0x1f, 0xc6, 0x77, - 0x30, 0xf6, 0x8c, 0xee, 0x2c, 0x85, 0xac, 0x20, 0x77, 0x67, 0xc3, 0xd4, 0xbe, 0xb1, 0x03, 0xba, - 0xe8, 0xea, 0x5c, 0x18, 0xc8, 0x13, 0x61, 0x92, 0x12, 0x64, 0x51, 0x1a, 0x77, 0xee, 0x93, 0x70, - 0x16, 0xef, 0xd9, 0xc1, 0x7b, 0x73, 0x32, 0xc0, 0xc1, 0x35, 0x5d, 0x9c, 0xda, 0x1f, 0x96, 0xd7, - 0x90, 0x7f, 0x42, 0xac, 0x34, 0x03, 0xca, 0xe4, 0x5f, 0x60, 0xd2, 0xd7, 0xa2, 0x5d, 0xe2, 0xcf, - 0xc2, 0xdd, 0xb7, 0x6f, 0xf8, 0x54, 0xfc, 0x9d, 0xb2, 0xb8, 0x2d, 0x82, 0xdf, 0xb7, 0x3b, 0x9e, - 0xdf, 0xfc, 0x7a, 0xee, 0xc4, 0x0b, 0x79, 0x3f, 0x26, 0xf8, 0x4c, 0xe9, 0x87, 0xa1, 0xc4, 0x53, - 0xb5, 0x44, 0x76, 0x42, 0x77, 0xc7, 0x4a, 0x13, 0xa9, 0x96, 0x68, 0xd3, 0x5e, 0x4c, 0x69, 0xe3, - 0x6c, 0x4a, 0x19, 0x84, 0xbd, 0xce, 0xda, 0x53, 0x98, 0x9c, 0x8e, 0xe3, 0x9b, 0x95, 0x47, 0x6e, - 0x57, 0x1e, 0xf9, 0xbd, 0xf2, 0xc8, 0xf7, 0xb5, 0xe7, 0xdc, 0xae, 0x3d, 0xe7, 0xe7, 0xda, 0x73, - 0xbe, 0xbc, 0x2b, 0xa4, 0x29, 0xbb, 0x94, 0x67, 0x78, 0x11, 0xfd, 0x7f, 0xcb, 0xbe, 0xfd, 0xb3, - 0x67, 0xe6, 0xaa, 0x06, 0x9d, 0xee, 0x0c, 0xf7, 0x7a, 0xf4, 0x27, 0x00, 0x00, 0xff, 0xff, 0xfa, - 0x83, 0x74, 0x30, 0x9d, 0x02, 0x00, 0x00, -} - -func (m *OsmosisRequestState) 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 *OsmosisRequestState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OsmosisRequestState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.UpdatedAtHeight != 0 { - i = encodeVarintOsmosis(dAtA, i, uint64(m.UpdatedAtHeight)) - i-- - dAtA[i] = 0x20 - } - if m.Failed { - i-- - if m.Failed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.Acknowledged { - i-- - if m.Acknowledged { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.PacketSequence != 0 { - i = encodeVarintOsmosis(dAtA, i, uint64(m.PacketSequence)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *IncentivizedPools) 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 *IncentivizedPools) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IncentivizedPools) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.IncentivizedPools) > 0 { - for iNdEx := len(m.IncentivizedPools) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.IncentivizedPools[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOsmosis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *EpochsInfo) 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 *EpochsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EpochsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.EpochsInfo) > 0 { - for iNdEx := len(m.EpochsInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EpochsInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOsmosis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintOsmosis(dAtA []byte, offset int, v uint64) int { - offset -= sovOsmosis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *OsmosisRequestState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PacketSequence != 0 { - n += 1 + sovOsmosis(uint64(m.PacketSequence)) - } - if m.Acknowledged { - n += 2 - } - if m.Failed { - n += 2 - } - if m.UpdatedAtHeight != 0 { - n += 1 + sovOsmosis(uint64(m.UpdatedAtHeight)) - } - return n -} - -func (m *IncentivizedPools) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.IncentivizedPools) > 0 { - for _, e := range m.IncentivizedPools { - l = e.Size() - n += 1 + l + sovOsmosis(uint64(l)) - } - } - return n -} - -func (m *EpochsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.EpochsInfo) > 0 { - for _, e := range m.EpochsInfo { - l = e.Size() - n += 1 + l + sovOsmosis(uint64(l)) - } - } - return n -} - -func sovOsmosis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozOsmosis(x uint64) (n int) { - return sovOsmosis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *OsmosisRequestState) 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 ErrIntOverflowOsmosis - } - 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: OsmosisRequestState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OsmosisRequestState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketSequence", wireType) - } - m.PacketSequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOsmosis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PacketSequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Acknowledged", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOsmosis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Acknowledged = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOsmosis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Failed = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAtHeight", wireType) - } - m.UpdatedAtHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOsmosis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UpdatedAtHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipOsmosis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthOsmosis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IncentivizedPools) 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 ErrIntOverflowOsmosis - } - 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: IncentivizedPools: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IncentivizedPools: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IncentivizedPools", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOsmosis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthOsmosis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthOsmosis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IncentivizedPools = append(m.IncentivizedPools, types.IncentivizedPool{}) - if err := m.IncentivizedPools[len(m.IncentivizedPools)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOsmosis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthOsmosis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EpochsInfo) 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 ErrIntOverflowOsmosis - } - 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: EpochsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EpochsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochsInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOsmosis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthOsmosis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthOsmosis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EpochsInfo = append(m.EpochsInfo, types1.EpochInfo{}) - if err := m.EpochsInfo[len(m.EpochsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOsmosis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthOsmosis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipOsmosis(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, ErrIntOverflowOsmosis - } - 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, ErrIntOverflowOsmosis - } - 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, ErrIntOverflowOsmosis - } - 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, ErrInvalidLengthOsmosis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupOsmosis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthOsmosis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthOsmosis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowOsmosis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupOsmosis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/qoracle/osmosis/types/osmosis_test.go b/x/qoracle/osmosis/types/osmosis_test.go deleted file mode 100644 index b728d0561..000000000 --- a/x/qoracle/osmosis/types/osmosis_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package types - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" - - poolincentivestypes "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types" -) - -func TestUniquePoolIdsFromIncentivizedPools(t *testing.T) { - incentivizedPools := []poolincentivestypes.IncentivizedPool{ - { - PoolId: 1, - GaugeId: 1, - LockableDuration: time.Hour, - }, - { - PoolId: 1, - GaugeId: 2, - LockableDuration: time.Hour * 24, - }, - { - PoolId: 3, - GaugeId: 4, - LockableDuration: time.Minute, - }, - { - PoolId: 3, - GaugeId: 3, - LockableDuration: time.Minute * 5, - }, - { - PoolId: 4, - GaugeId: 7, - LockableDuration: time.Hour * 24 * 7, - }, - } - poolIds := UniquePoolIdsFromIncentivizedPools(incentivizedPools) - assert.Equal(t, poolIds, []uint64{1, 3, 4}) -} diff --git a/x/qoracle/osmosis/types/params.go b/x/qoracle/osmosis/types/params.go deleted file mode 100644 index 086998341..000000000 --- a/x/qoracle/osmosis/types/params.go +++ /dev/null @@ -1,146 +0,0 @@ -package types - -import ( - "errors" - "fmt" - "gopkg.in/yaml.v2" - "time" - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - - epochtypes "github.com/quasarlabs/quasarnode/x/epochs/types" -) - -const ( - // DefaultEnabled determines that the module is enabled by default - DefaultEnabled = true - // DefaultEpochIdentifier is set to minute - DefaultEpochIdentifier = "minute" - // DefaultAuthorizedChannel is empty string which means no authorized channel - DefaultAuthorizedChannel = "" - // DefaultPacketTimeoutHeight is 0-0 which means no timeout based on height - DefaultPacketTimeoutHeight = "0-0" - // DefaultPacketTimeoutTimestamp is 3 mins - DefaultPacketTimeoutTimestamp = uint64(time.Minute * 3) -) - -var ( - // KeyEnabled is store's key for Enabled - KeyEnabled = []byte("Enabled") - // KeyEpochIdentifier is the store's key for EpochIdentifier - KeyEpochIdentifier = []byte("EpochIdentifier") - // KeyAuthorizedChannel is store's key for AuthorizedChannel - KeyAuthorizedChannel = []byte("AuthorizedChannel") - // KeyPacketTimeoutHeight is store's key for PacketTimeoutHeight - KeyPacketTimeoutHeight = []byte("PacketTimeoutHeight") - // KeyPacketTimeoutTimestamp is store's key for PacketTimeoutTimestamp - KeyPacketTimeoutTimestamp = []byte("PacketTimeoutTimestamp") -) - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// NewParams creates a new Params instance -func NewParams( - enabled bool, - epochIdentifier string, - authorizedChan string, - timeoutHeight clienttypes.Height, - TimeoutTimestamp uint64, -) Params { - return Params{ - Enabled: enabled, - EpochIdentifier: epochIdentifier, - AuthorizedChannel: authorizedChan, - PacketTimeoutHeight: timeoutHeight, - PacketTimeoutTimestamp: TimeoutTimestamp, - } -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return NewParams( - DefaultEnabled, - DefaultEpochIdentifier, - DefaultAuthorizedChannel, - clienttypes.MustParseHeight(DefaultPacketTimeoutHeight), - DefaultPacketTimeoutTimestamp, - ) -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyEnabled, &p.Enabled, validateEnabled), - paramtypes.NewParamSetPair(KeyEpochIdentifier, &p.EpochIdentifier, epochtypes.ValidateEpochIdentifierInterface), - paramtypes.NewParamSetPair(KeyAuthorizedChannel, &p.AuthorizedChannel, validateAuthorizedChannel), - paramtypes.NewParamSetPair(KeyPacketTimeoutHeight, &p.PacketTimeoutHeight, validateClientHeight), - paramtypes.NewParamSetPair(KeyPacketTimeoutTimestamp, &p.PacketTimeoutTimestamp, validateDuration), - } -} - -// Validate validates the set of params -func (p Params) Validate() error { - err := validateAuthorizedChannel(p.AuthorizedChannel) - if err != nil { - return err - } - - if p.PacketTimeoutHeight.IsZero() && p.PacketTimeoutTimestamp == 0 { - return errors.New("packet timeout height and packet timeout timestamp cannot both be 0") - } - - return nil -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} - -func validateEnabled(i interface{}) error { - _, ok := i.(bool) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - return nil -} - -func validateAuthorizedChannel(i interface{}) error { - channelID, ok := i.(string) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if channelID != "" { - if err := host.ChannelIdentifierValidator(channelID); err != nil { - return fmt.Errorf("invalid authorized channel: %w", err) - } - } - - return nil -} - -func validateClientHeight(i interface{}) error { - _, ok := i.(clienttypes.Height) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - return nil -} - -func validateDuration(i interface{}) error { - _, ok := i.(uint64) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - return nil -} diff --git a/x/qoracle/osmosis/types/params.pb.go b/x/qoracle/osmosis/types/params.pb.go deleted file mode 100644 index 3aab1d0bc..000000000 --- a/x/qoracle/osmosis/types/params.pb.go +++ /dev/null @@ -1,517 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/osmosis/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - 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 - -type Params struct { - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty" yaml:"enabled"` - EpochIdentifier string `protobuf:"bytes,2,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty" yaml:"epoch_identifier"` - AuthorizedChannel string `protobuf:"bytes,3,opt,name=authorized_channel,json=authorizedChannel,proto3" json:"authorized_channel,omitempty" yaml:"authorized_channel"` - PacketTimeoutHeight types.Height `protobuf:"bytes,4,opt,name=packet_timeout_height,json=packetTimeoutHeight,proto3" json:"packet_timeout_height" yaml:"packet_timeout_height"` - PacketTimeoutTimestamp uint64 `protobuf:"varint,5,opt,name=packet_timeout_timestamp,json=packetTimeoutTimestamp,proto3" json:"packet_timeout_timestamp,omitempty" yaml:"packet_timeout_timestamp"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_c288508491767e26, []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) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *Params) GetEpochIdentifier() string { - if m != nil { - return m.EpochIdentifier - } - return "" -} - -func (m *Params) GetAuthorizedChannel() string { - if m != nil { - return m.AuthorizedChannel - } - return "" -} - -func (m *Params) GetPacketTimeoutHeight() types.Height { - if m != nil { - return m.PacketTimeoutHeight - } - return types.Height{} -} - -func (m *Params) GetPacketTimeoutTimestamp() uint64 { - if m != nil { - return m.PacketTimeoutTimestamp - } - return 0 -} - -func init() { - proto.RegisterType((*Params)(nil), "quasarlabs.quasarnode.qoracle.osmosis.Params") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/osmosis/params.proto", fileDescriptor_c288508491767e26) -} - -var fileDescriptor_c288508491767e26 = []byte{ - // 448 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0x6d, 0x1a, 0x0a, 0x18, 0x89, 0x1f, 0xf3, 0xe7, 0x06, 0xf0, 0x44, 0x06, 0xa4, 0x2c, - 0xd0, 0x8c, 0x52, 0x36, 0xa8, 0x4b, 0x23, 0x21, 0x90, 0x58, 0x20, 0xab, 0x2b, 0x24, 0x14, 0xcd, - 0x4c, 0x6e, 0xed, 0x11, 0xb6, 0xc7, 0xf5, 0x8c, 0x23, 0xc2, 0x53, 0xb0, 0x64, 0xc9, 0x8e, 0x57, - 0xe9, 0xb2, 0x4b, 0x56, 0x16, 0x4a, 0xde, 0xc0, 0x4f, 0x80, 0xe2, 0x99, 0x36, 0x6a, 0x9b, 0x95, - 0xaf, 0xcf, 0x39, 0xdf, 0xb1, 0x75, 0x75, 0xbd, 0xfd, 0xe3, 0x86, 0x2a, 0x5a, 0xe7, 0x94, 0x29, - 0x62, 0xc6, 0x52, 0xce, 0x80, 0x1c, 0xcb, 0x9a, 0xf2, 0x1c, 0x88, 0x54, 0x85, 0x54, 0x42, 0x91, - 0x8a, 0xd6, 0xb4, 0x50, 0xb8, 0xaa, 0xa5, 0x96, 0xfe, 0xab, 0x0d, 0x83, 0x37, 0x0c, 0xb6, 0x0c, - 0xb6, 0xcc, 0xf0, 0x61, 0x2a, 0x53, 0xd9, 0x13, 0x64, 0x3d, 0x19, 0x78, 0xb8, 0x97, 0x4a, 0x99, - 0xe6, 0x40, 0xfa, 0x37, 0xd6, 0x1c, 0x11, 0x5a, 0x2e, 0xac, 0x15, 0xf2, 0x1e, 0x25, 0x8c, 0x2a, - 0x20, 0xf3, 0x09, 0x03, 0x4d, 0x27, 0x84, 0x4b, 0x51, 0x5a, 0x1f, 0x09, 0xc6, 0x09, 0x97, 0x35, - 0x10, 0x9e, 0x0b, 0x28, 0x35, 0x99, 0x4f, 0xec, 0x64, 0x02, 0xd1, 0x9f, 0x1d, 0x6f, 0xf7, 0x73, - 0xff, 0xa7, 0xfe, 0x6b, 0xef, 0x06, 0x94, 0x94, 0xe5, 0x30, 0x0b, 0xdc, 0x91, 0x3b, 0xbe, 0x19, - 0xfb, 0x5d, 0x8b, 0xee, 0x2c, 0x68, 0x91, 0x1f, 0x44, 0xd6, 0x88, 0x92, 0xb3, 0x88, 0xff, 0xde, - 0xbb, 0x07, 0x95, 0xe4, 0xd9, 0x54, 0xcc, 0xa0, 0xd4, 0xe2, 0x48, 0x40, 0x1d, 0x5c, 0x1b, 0xb9, - 0xe3, 0x5b, 0xf1, 0xd3, 0xae, 0x45, 0x4f, 0x2c, 0x76, 0x29, 0x11, 0x25, 0x77, 0x7b, 0xe9, 0xe3, - 0xb9, 0xe2, 0x7f, 0xf2, 0x7c, 0xda, 0xe8, 0x4c, 0xd6, 0xe2, 0x07, 0xcc, 0xa6, 0x3c, 0xa3, 0x65, - 0x09, 0x79, 0xb0, 0xd3, 0x37, 0x3d, 0xef, 0x5a, 0xb4, 0x67, 0x9a, 0xae, 0x66, 0xa2, 0xe4, 0xfe, - 0x46, 0x7c, 0x67, 0x34, 0x5f, 0x7b, 0x8f, 0x2a, 0xca, 0xbf, 0x81, 0x9e, 0x6a, 0x51, 0x80, 0x6c, - 0xf4, 0x34, 0x03, 0x91, 0x66, 0x3a, 0x18, 0x8c, 0xdc, 0xf1, 0xed, 0xfd, 0x21, 0x16, 0x8c, 0xe3, - 0xf5, 0x3e, 0xb0, 0xdd, 0xc2, 0x7c, 0x82, 0x3f, 0xf4, 0x89, 0xf8, 0xe5, 0x49, 0x8b, 0x9c, 0xae, - 0x45, 0xcf, 0xcc, 0x07, 0xb7, 0xd6, 0x44, 0xc9, 0x03, 0xa3, 0x1f, 0x1a, 0xd9, 0xa0, 0xfe, 0x57, - 0x2f, 0xb8, 0x14, 0x5f, 0x3f, 0x95, 0xa6, 0x45, 0x15, 0x5c, 0x1f, 0xb9, 0xe3, 0x41, 0xfc, 0xa2, - 0x6b, 0x11, 0xda, 0x5a, 0x7c, 0x9e, 0x8c, 0x92, 0xc7, 0x17, 0xba, 0x0f, 0xcf, 0x8c, 0x83, 0xc1, - 0xaf, 0xdf, 0xc8, 0x89, 0x93, 0x93, 0x65, 0xe8, 0x9e, 0x2e, 0x43, 0xf7, 0xdf, 0x32, 0x74, 0x7f, - 0xae, 0x42, 0xe7, 0x74, 0x15, 0x3a, 0x7f, 0x57, 0xa1, 0xf3, 0xe5, 0x6d, 0x2a, 0x74, 0xd6, 0x30, - 0xcc, 0x65, 0x41, 0xb6, 0xdf, 0xe6, 0xf7, 0x2b, 0xd7, 0xa9, 0x17, 0x15, 0x28, 0xb6, 0xdb, 0x1f, - 0xc1, 0x9b, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x88, 0x5f, 0xae, 0xfc, 0xd3, 0x02, 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 m.PacketTimeoutTimestamp != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.PacketTimeoutTimestamp)) - i-- - dAtA[i] = 0x28 - } - { - size, err := m.PacketTimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.AuthorizedChannel) > 0 { - i -= len(m.AuthorizedChannel) - copy(dAtA[i:], m.AuthorizedChannel) - i = encodeVarintParams(dAtA, i, uint64(len(m.AuthorizedChannel))) - i-- - dAtA[i] = 0x1a - } - if len(m.EpochIdentifier) > 0 { - i -= len(m.EpochIdentifier) - copy(dAtA[i:], m.EpochIdentifier) - i = encodeVarintParams(dAtA, i, uint64(len(m.EpochIdentifier))) - i-- - dAtA[i] = 0x12 - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - 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 - if m.Enabled { - n += 2 - } - l = len(m.EpochIdentifier) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - l = len(m.AuthorizedChannel) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - l = m.PacketTimeoutHeight.Size() - n += 1 + l + sovParams(uint64(l)) - if m.PacketTimeoutTimestamp != 0 { - n += 1 + sovParams(uint64(m.PacketTimeoutTimestamp)) - } - 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochIdentifier", 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.EpochIdentifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthorizedChannel", 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.AuthorizedChannel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketTimeoutHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PacketTimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketTimeoutTimestamp", wireType) - } - m.PacketTimeoutTimestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PacketTimeoutTimestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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/qoracle/osmosis/types/query.pb.go b/x/qoracle/osmosis/types/query.pb.go deleted file mode 100644 index 4e41f2d1a..000000000 --- a/x/qoracle/osmosis/types/query.pb.go +++ /dev/null @@ -1,2419 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/osmosis/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/quasarlabs/quasarnode/osmosis/epochs/types" - balancer "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer" - types1 "github.com/quasarlabs/quasarnode/osmosis/mint/types" - types2 "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// QueryParamsRequest is 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_07a6a96a3a6d0d27, []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 - -// QueryParamsResponse is 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"` -} - -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_07a6a96a3a6d0d27, []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{} -} - -type QueryStateRequest struct { -} - -func (m *QueryStateRequest) Reset() { *m = QueryStateRequest{} } -func (m *QueryStateRequest) String() string { return proto.CompactTextString(m) } -func (*QueryStateRequest) ProtoMessage() {} -func (*QueryStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_07a6a96a3a6d0d27, []int{2} -} -func (m *QueryStateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryStateRequest.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 *QueryStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryStateRequest.Merge(m, src) -} -func (m *QueryStateRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryStateRequest proto.InternalMessageInfo - -type QueryStateResponse struct { - ParamsRequestState OsmosisRequestState `protobuf:"bytes,2,opt,name=params_request_state,json=paramsRequestState,proto3" json:"params_request_state"` - IncentivizedPoolsState OsmosisRequestState `protobuf:"bytes,3,opt,name=incentivized_pools_state,json=incentivizedPoolsState,proto3" json:"incentivized_pools_state"` - PoolsState OsmosisRequestState `protobuf:"bytes,4,opt,name=pools_state,json=poolsState,proto3" json:"pools_state"` -} - -func (m *QueryStateResponse) Reset() { *m = QueryStateResponse{} } -func (m *QueryStateResponse) String() string { return proto.CompactTextString(m) } -func (*QueryStateResponse) ProtoMessage() {} -func (*QueryStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_07a6a96a3a6d0d27, []int{3} -} -func (m *QueryStateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryStateResponse.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 *QueryStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryStateResponse.Merge(m, src) -} -func (m *QueryStateResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryStateResponse proto.InternalMessageInfo - -func (m *QueryStateResponse) GetParamsRequestState() OsmosisRequestState { - if m != nil { - return m.ParamsRequestState - } - return OsmosisRequestState{} -} - -func (m *QueryStateResponse) GetIncentivizedPoolsState() OsmosisRequestState { - if m != nil { - return m.IncentivizedPoolsState - } - return OsmosisRequestState{} -} - -func (m *QueryStateResponse) GetPoolsState() OsmosisRequestState { - if m != nil { - return m.PoolsState - } - return OsmosisRequestState{} -} - -type QueryChainParamsRequest struct { -} - -func (m *QueryChainParamsRequest) Reset() { *m = QueryChainParamsRequest{} } -func (m *QueryChainParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryChainParamsRequest) ProtoMessage() {} -func (*QueryChainParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_07a6a96a3a6d0d27, []int{4} -} -func (m *QueryChainParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChainParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChainParamsRequest.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 *QueryChainParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChainParamsRequest.Merge(m, src) -} -func (m *QueryChainParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryChainParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChainParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChainParamsRequest proto.InternalMessageInfo - -type QueryChainParamsResponse struct { - EpochsInfo []types.EpochInfo `protobuf:"bytes,1,rep,name=epochs_info,json=epochsInfo,proto3" json:"epochs_info"` - LockableDurations []time.Duration `protobuf:"varint,2,rep,packed,name=lockable_durations,json=lockableDurations,proto3,casttype=time.Duration" json:"lockable_durations,omitempty"` - MintParams types1.Params `protobuf:"bytes,3,opt,name=mint_params,json=mintParams,proto3" json:"mint_params"` - MintEpochProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=mint_epoch_provisions,json=mintEpochProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"mint_epoch_provisions"` - DistrInfo types2.DistrInfo `protobuf:"bytes,5,opt,name=distr_info,json=distrInfo,proto3" json:"distr_info"` -} - -func (m *QueryChainParamsResponse) Reset() { *m = QueryChainParamsResponse{} } -func (m *QueryChainParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryChainParamsResponse) ProtoMessage() {} -func (*QueryChainParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_07a6a96a3a6d0d27, []int{5} -} -func (m *QueryChainParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChainParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChainParamsResponse.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 *QueryChainParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChainParamsResponse.Merge(m, src) -} -func (m *QueryChainParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryChainParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChainParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChainParamsResponse proto.InternalMessageInfo - -func (m *QueryChainParamsResponse) GetEpochsInfo() []types.EpochInfo { - if m != nil { - return m.EpochsInfo - } - return nil -} - -func (m *QueryChainParamsResponse) GetLockableDurations() []time.Duration { - if m != nil { - return m.LockableDurations - } - return nil -} - -func (m *QueryChainParamsResponse) GetMintParams() types1.Params { - if m != nil { - return m.MintParams - } - return types1.Params{} -} - -func (m *QueryChainParamsResponse) GetDistrInfo() types2.DistrInfo { - if m != nil { - return m.DistrInfo - } - return types2.DistrInfo{} -} - -type QueryIncentivizedPoolsRequest struct { -} - -func (m *QueryIncentivizedPoolsRequest) Reset() { *m = QueryIncentivizedPoolsRequest{} } -func (m *QueryIncentivizedPoolsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryIncentivizedPoolsRequest) ProtoMessage() {} -func (*QueryIncentivizedPoolsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_07a6a96a3a6d0d27, []int{6} -} -func (m *QueryIncentivizedPoolsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryIncentivizedPoolsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryIncentivizedPoolsRequest.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 *QueryIncentivizedPoolsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIncentivizedPoolsRequest.Merge(m, src) -} -func (m *QueryIncentivizedPoolsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryIncentivizedPoolsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIncentivizedPoolsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryIncentivizedPoolsRequest proto.InternalMessageInfo - -type QueryIncentivizedPoolsResponse struct { - IncentivizedPools []types2.IncentivizedPool `protobuf:"bytes,1,rep,name=incentivized_pools,json=incentivizedPools,proto3" json:"incentivized_pools"` -} - -func (m *QueryIncentivizedPoolsResponse) Reset() { *m = QueryIncentivizedPoolsResponse{} } -func (m *QueryIncentivizedPoolsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryIncentivizedPoolsResponse) ProtoMessage() {} -func (*QueryIncentivizedPoolsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_07a6a96a3a6d0d27, []int{7} -} -func (m *QueryIncentivizedPoolsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryIncentivizedPoolsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryIncentivizedPoolsResponse.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 *QueryIncentivizedPoolsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIncentivizedPoolsResponse.Merge(m, src) -} -func (m *QueryIncentivizedPoolsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryIncentivizedPoolsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIncentivizedPoolsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryIncentivizedPoolsResponse proto.InternalMessageInfo - -func (m *QueryIncentivizedPoolsResponse) GetIncentivizedPools() []types2.IncentivizedPool { - if m != nil { - return m.IncentivizedPools - } - return nil -} - -type QueryPoolsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryPoolsRequest) Reset() { *m = QueryPoolsRequest{} } -func (m *QueryPoolsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryPoolsRequest) ProtoMessage() {} -func (*QueryPoolsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_07a6a96a3a6d0d27, []int{8} -} -func (m *QueryPoolsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolsRequest.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 *QueryPoolsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolsRequest.Merge(m, src) -} -func (m *QueryPoolsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolsRequest proto.InternalMessageInfo - -func (m *QueryPoolsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryPoolsResponse struct { - Pools []balancer.Pool `protobuf:"bytes,1,rep,name=pools,proto3" json:"pools"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryPoolsResponse) Reset() { *m = QueryPoolsResponse{} } -func (m *QueryPoolsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryPoolsResponse) ProtoMessage() {} -func (*QueryPoolsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_07a6a96a3a6d0d27, []int{9} -} -func (m *QueryPoolsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolsResponse.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 *QueryPoolsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolsResponse.Merge(m, src) -} -func (m *QueryPoolsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolsResponse proto.InternalMessageInfo - -func (m *QueryPoolsResponse) GetPools() []balancer.Pool { - if m != nil { - return m.Pools - } - return nil -} - -func (m *QueryPoolsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryParamsResponse") - proto.RegisterType((*QueryStateRequest)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryStateRequest") - proto.RegisterType((*QueryStateResponse)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryStateResponse") - proto.RegisterType((*QueryChainParamsRequest)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryChainParamsRequest") - proto.RegisterType((*QueryChainParamsResponse)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryChainParamsResponse") - proto.RegisterType((*QueryIncentivizedPoolsRequest)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryIncentivizedPoolsRequest") - proto.RegisterType((*QueryIncentivizedPoolsResponse)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryIncentivizedPoolsResponse") - proto.RegisterType((*QueryPoolsRequest)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryPoolsRequest") - proto.RegisterType((*QueryPoolsResponse)(nil), "quasarlabs.quasarnode.qoracle.osmosis.QueryPoolsResponse") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/osmosis/query.proto", fileDescriptor_07a6a96a3a6d0d27) -} - -var fileDescriptor_07a6a96a3a6d0d27 = []byte{ - // 936 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0xaf, 0x9b, 0x6d, 0x11, 0x13, 0x38, 0x64, 0x5a, 0x20, 0x58, 0x8b, 0x53, 0x2c, 0xd8, 0x2d, - 0x88, 0x8e, 0x69, 0xcb, 0xa2, 0xcd, 0xae, 0xc4, 0x9f, 0x6c, 0x16, 0x58, 0x21, 0x41, 0x09, 0x37, - 0x38, 0x44, 0x63, 0x67, 0xea, 0x5a, 0x6b, 0x7b, 0x5c, 0x8f, 0x53, 0xb1, 0x7b, 0xe4, 0xc2, 0x15, - 0x09, 0x71, 0xe6, 0x3b, 0x70, 0xe0, 0x33, 0xac, 0xc4, 0x65, 0x25, 0x2e, 0x88, 0x43, 0x84, 0x1a, - 0x24, 0xbe, 0x03, 0x27, 0x34, 0x33, 0xcf, 0x7f, 0xb2, 0x66, 0x55, 0x27, 0xf4, 0xe4, 0x78, 0xde, - 0xfb, 0xbd, 0xf7, 0x7b, 0x7f, 0xe6, 0xe7, 0xa0, 0xfd, 0xd3, 0x29, 0x15, 0x34, 0x0d, 0xa9, 0x2b, - 0x1c, 0xfd, 0x33, 0xe6, 0x13, 0xe6, 0x9c, 0xf2, 0x94, 0x7a, 0x21, 0x73, 0xb8, 0x88, 0xb8, 0x08, - 0xa4, 0x89, 0xa5, 0x0f, 0x48, 0x92, 0xf2, 0x8c, 0xe3, 0xd7, 0x4b, 0x08, 0x29, 0x21, 0x04, 0x20, - 0x04, 0x20, 0xe6, 0xb6, 0xcf, 0x7d, 0xae, 0x10, 0x8e, 0xfc, 0xa5, 0xc1, 0x66, 0xcf, 0xe7, 0xdc, - 0x0f, 0x99, 0xa3, 0xde, 0xdc, 0xe9, 0xb1, 0x93, 0x05, 0x11, 0x13, 0x19, 0x8d, 0x12, 0x70, 0xb8, - 0x0a, 0x0e, 0x34, 0x09, 0x1c, 0x1a, 0xc7, 0x3c, 0xa3, 0x59, 0xc0, 0x63, 0x01, 0x56, 0xcb, 0x53, - 0xe1, 0x1d, 0x97, 0x0a, 0xe6, 0x9c, 0xed, 0xbb, 0x2c, 0xa3, 0xfb, 0x8e, 0xc7, 0x83, 0x18, 0xec, - 0x6f, 0x56, 0xed, 0x8a, 0x74, 0xe1, 0x95, 0x50, 0x3f, 0x88, 0x55, 0x30, 0xf0, 0x3d, 0x68, 0x56, - 0x7a, 0x42, 0x53, 0x1a, 0xe5, 0xf9, 0x0f, 0x9b, 0x61, 0xe0, 0x09, 0xa0, 0xd7, 0xf2, 0x63, 0x96, - 0x70, 0xef, 0x44, 0x14, 0x8c, 0x7c, 0x16, 0xb3, 0xd2, 0xab, 0x97, 0x7b, 0x45, 0x41, 0x9c, 0x15, - 0x3e, 0xf2, 0x05, 0x1c, 0x4a, 0x46, 0x9c, 0x87, 0x41, 0xec, 0xb1, 0x38, 0x0b, 0xce, 0x58, 0x19, - 0xae, 0x3c, 0xca, 0x9b, 0x71, 0x01, 0xa0, 0x32, 0x54, 0xf3, 0x7a, 0xee, 0xeb, 0xd3, 0x28, 0x2a, - 0x3c, 0x5c, 0x1a, 0xd2, 0xd8, 0x63, 0xe9, 0x11, 0xe7, 0xa1, 0x76, 0xb4, 0xb7, 0x11, 0xfe, 0x42, - 0xe2, 0x8e, 0x54, 0x5b, 0x46, 0xec, 0x74, 0xca, 0x44, 0x66, 0xbb, 0x68, 0x6b, 0xe1, 0x54, 0x24, - 0x3c, 0x16, 0x0c, 0x7f, 0x8a, 0x36, 0x75, 0xfb, 0xba, 0xc6, 0x8e, 0xb1, 0xdb, 0x3e, 0xd8, 0x23, - 0x8d, 0x76, 0x87, 0xe8, 0x30, 0x83, 0x2b, 0x8f, 0x66, 0xbd, 0xb5, 0x11, 0x84, 0xb0, 0xb7, 0x50, - 0x47, 0xe5, 0xf8, 0x32, 0xa3, 0x19, 0xcb, 0x13, 0xff, 0xbd, 0x0e, 0x7c, 0xe0, 0x14, 0x12, 0xa7, - 0x68, 0x5b, 0xa3, 0xc6, 0xa9, 0x76, 0x1c, 0x0b, 0x69, 0xef, 0xae, 0x2b, 0x1a, 0xb7, 0x1a, 0xd2, - 0xf8, 0x5c, 0x3f, 0x21, 0x97, 0xca, 0x00, 0x9c, 0x70, 0x52, 0x2d, 0x5f, 0x59, 0xf0, 0x43, 0xd4, - 0xcd, 0x9b, 0x1c, 0x3c, 0x64, 0x93, 0xb1, 0xec, 0xba, 0x80, 0xbc, 0xad, 0x4b, 0xca, 0xfb, 0x62, - 0x35, 0x83, 0x9c, 0x8a, 0xd0, 0xb9, 0x29, 0x6a, 0x57, 0xd3, 0x5d, 0xb9, 0xa4, 0x74, 0x28, 0x29, - 0x52, 0xd8, 0x2f, 0xa3, 0x97, 0x54, 0xa3, 0xef, 0x9c, 0xd0, 0x20, 0x5e, 0x9c, 0xfe, 0x4f, 0x2d, - 0xd4, 0xad, 0xdb, 0x60, 0x14, 0x9f, 0xa0, 0xb6, 0xde, 0xfb, 0x71, 0x10, 0x1f, 0xf3, 0xae, 0xb1, - 0xd3, 0xda, 0x6d, 0x1f, 0xbc, 0x5a, 0x24, 0xd7, 0x36, 0x02, 0x1b, 0x47, 0xee, 0xca, 0xd7, 0x7b, - 0xf1, 0x31, 0xcf, 0x19, 0x68, 0xbb, 0x3c, 0xc1, 0x1f, 0x20, 0x1c, 0x72, 0xef, 0x3e, 0x75, 0x43, - 0x36, 0x9e, 0x4c, 0x53, 0x2d, 0x0c, 0xdd, 0xf5, 0x9d, 0xd6, 0x6e, 0x6b, 0xd0, 0xf9, 0x67, 0xd6, - 0x7b, 0x5e, 0x6a, 0x09, 0x19, 0x82, 0x65, 0xd4, 0xc9, 0x9d, 0xf3, 0x13, 0x81, 0xef, 0xa0, 0xb6, - 0xbc, 0x50, 0x63, 0x58, 0x4a, 0x3d, 0x95, 0xab, 0x05, 0x17, 0x75, 0xd9, 0x72, 0x26, 0x0b, 0x3b, - 0x88, 0xa4, 0x49, 0x9f, 0x60, 0x17, 0xbd, 0xa0, 0x82, 0x28, 0x66, 0xe3, 0x24, 0xe5, 0x67, 0x81, - 0x50, 0x4c, 0x64, 0xd7, 0x9f, 0x1b, 0x10, 0x09, 0xf8, 0x63, 0xd6, 0xbb, 0xe6, 0x07, 0xd9, 0xc9, - 0xd4, 0x25, 0x1e, 0x8f, 0x1c, 0x50, 0x25, 0xfd, 0xd8, 0x13, 0x93, 0xfb, 0x4e, 0xf6, 0x20, 0x61, - 0x82, 0x0c, 0x99, 0x37, 0xda, 0x92, 0xc1, 0x54, 0xd9, 0x47, 0x45, 0x28, 0xfc, 0x19, 0x42, 0x93, - 0x40, 0x64, 0xa9, 0xee, 0xd9, 0x86, 0xe2, 0xf9, 0x46, 0xc1, 0x73, 0xf1, 0x3e, 0x17, 0x8c, 0x87, - 0x12, 0x51, 0xe9, 0xdd, 0xb3, 0x93, 0xfc, 0xc0, 0xee, 0xa1, 0x57, 0xd4, 0x80, 0xee, 0x3d, 0xb9, - 0x3e, 0xf9, 0x08, 0xbf, 0x33, 0x90, 0xf5, 0x34, 0x0f, 0x18, 0x24, 0x43, 0xb8, 0xbe, 0xdf, 0x30, - 0xcf, 0xb7, 0x2f, 0xe2, 0xf6, 0x64, 0x58, 0xa0, 0xd8, 0xa9, 0xed, 0xb3, 0xfd, 0x35, 0x5c, 0xf3, - 0x2a, 0x3d, 0xfc, 0x11, 0x42, 0xa5, 0x7e, 0x83, 0x98, 0x5c, 0x23, 0xba, 0x9f, 0x44, 0x8a, 0x3d, - 0xd1, 0x62, 0x56, 0x0e, 0xcf, 0xcf, 0x25, 0x62, 0x54, 0x41, 0xda, 0x3f, 0x1a, 0xb9, 0x7c, 0x2d, - 0x94, 0xf6, 0x2e, 0xda, 0xa8, 0x56, 0x63, 0x16, 0xd5, 0x48, 0x35, 0x2c, 0x83, 0x96, 0xbc, 0xb5, - 0x3b, 0xfe, 0x78, 0x81, 0x96, 0x16, 0x97, 0xeb, 0x17, 0xd2, 0xd2, 0x49, 0xab, 0xbc, 0x0e, 0x66, - 0xcf, 0xa0, 0x0d, 0xc5, 0x0b, 0xff, 0x62, 0xa0, 0x4d, 0x58, 0xb4, 0x7e, 0xc3, 0xfb, 0x5b, 0xd7, - 0x63, 0xf3, 0xd6, 0x2a, 0x50, 0xcd, 0xcb, 0xbe, 0xf1, 0xed, 0x6f, 0x7f, 0xfd, 0xb0, 0xee, 0xe0, - 0x3d, 0x67, 0x99, 0x0f, 0x24, 0xfe, 0xd9, 0x40, 0x1b, 0x5a, 0x8c, 0x6e, 0x2e, 0x93, 0xbc, 0xaa, - 0xe6, 0x66, 0x7f, 0x05, 0x24, 0xb0, 0x7e, 0x47, 0xb1, 0x26, 0xf8, 0xad, 0x86, 0xac, 0x95, 0x50, - 0xe2, 0x5f, 0x0d, 0xd4, 0xae, 0x88, 0x16, 0x7e, 0x6f, 0x19, 0x02, 0x75, 0x25, 0x34, 0xdf, 0x5f, - 0x19, 0x0f, 0x65, 0xdc, 0x56, 0x65, 0xdc, 0xc0, 0x87, 0x0d, 0xcb, 0xf0, 0x64, 0x0c, 0xd0, 0x33, - 0x3c, 0x37, 0x50, 0xa7, 0x76, 0x7f, 0xf1, 0x70, 0x19, 0x4e, 0x4f, 0x13, 0x08, 0xf3, 0xee, 0xff, - 0x8c, 0x02, 0xf5, 0x7d, 0xa8, 0xea, 0xbb, 0x8d, 0xfb, 0x0d, 0xeb, 0xab, 0x2b, 0x8e, 0x5a, 0x34, - 0x5d, 0xd9, 0x52, 0x8b, 0xb6, 0x50, 0x4d, 0x7f, 0x05, 0xe4, 0x8a, 0x8b, 0xa6, 0x48, 0x0f, 0x46, - 0x8f, 0xce, 0x2d, 0xe3, 0xf1, 0xb9, 0x65, 0xfc, 0x79, 0x6e, 0x19, 0xdf, 0xcf, 0xad, 0xb5, 0xc7, - 0x73, 0x6b, 0xed, 0xf7, 0xb9, 0xb5, 0xf6, 0xd5, 0xcd, 0xca, 0x77, 0xe2, 0xbf, 0x23, 0x7e, 0x53, - 0x8b, 0xa9, 0xbe, 0x1e, 0xee, 0xa6, 0xfa, 0x47, 0x76, 0xf8, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x37, 0x39, 0x4b, 0x25, 0xc4, 0x0b, 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 the state of oracle requests. - State(ctx context.Context, in *QueryStateRequest, opts ...grpc.CallOption) (*QueryStateResponse, error) - // Queries latest fetched params from osmosis chain. - ChainParams(ctx context.Context, in *QueryChainParamsRequest, opts ...grpc.CallOption) (*QueryChainParamsResponse, error) - // Queries latest fetched list of incentivized pools from osmosis. - IncentivizedPools(ctx context.Context, in *QueryIncentivizedPoolsRequest, opts ...grpc.CallOption) (*QueryIncentivizedPoolsResponse, error) - // Queries latest fetched list of pool details from osmosis. - Pools(ctx context.Context, in *QueryPoolsRequest, opts ...grpc.CallOption) (*QueryPoolsResponse, 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, "/quasarlabs.quasarnode.qoracle.osmosis.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) State(ctx context.Context, in *QueryStateRequest, opts ...grpc.CallOption) (*QueryStateResponse, error) { - out := new(QueryStateResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qoracle.osmosis.Query/State", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ChainParams(ctx context.Context, in *QueryChainParamsRequest, opts ...grpc.CallOption) (*QueryChainParamsResponse, error) { - out := new(QueryChainParamsResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qoracle.osmosis.Query/ChainParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) IncentivizedPools(ctx context.Context, in *QueryIncentivizedPoolsRequest, opts ...grpc.CallOption) (*QueryIncentivizedPoolsResponse, error) { - out := new(QueryIncentivizedPoolsResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qoracle.osmosis.Query/IncentivizedPools", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Pools(ctx context.Context, in *QueryPoolsRequest, opts ...grpc.CallOption) (*QueryPoolsResponse, error) { - out := new(QueryPoolsResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qoracle.osmosis.Query/Pools", in, out, opts...) - if err != nil { - return nil, err - } - 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 the state of oracle requests. - State(context.Context, *QueryStateRequest) (*QueryStateResponse, error) - // Queries latest fetched params from osmosis chain. - ChainParams(context.Context, *QueryChainParamsRequest) (*QueryChainParamsResponse, error) - // Queries latest fetched list of incentivized pools from osmosis. - IncentivizedPools(context.Context, *QueryIncentivizedPoolsRequest) (*QueryIncentivizedPoolsResponse, error) - // Queries latest fetched list of pool details from osmosis. - Pools(context.Context, *QueryPoolsRequest) (*QueryPoolsResponse, 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 (*UnimplementedQueryServer) State(ctx context.Context, req *QueryStateRequest) (*QueryStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method State not implemented") -} -func (*UnimplementedQueryServer) ChainParams(ctx context.Context, req *QueryChainParamsRequest) (*QueryChainParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChainParams not implemented") -} -func (*UnimplementedQueryServer) IncentivizedPools(ctx context.Context, req *QueryIncentivizedPoolsRequest) (*QueryIncentivizedPoolsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IncentivizedPools not implemented") -} -func (*UnimplementedQueryServer) Pools(ctx context.Context, req *QueryPoolsRequest) (*QueryPoolsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Pools 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: "/quasarlabs.quasarnode.qoracle.osmosis.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 _Query_State_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).State(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qoracle.osmosis.Query/State", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).State(ctx, req.(*QueryStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ChainParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryChainParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ChainParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qoracle.osmosis.Query/ChainParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ChainParams(ctx, req.(*QueryChainParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_IncentivizedPools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryIncentivizedPoolsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).IncentivizedPools(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qoracle.osmosis.Query/IncentivizedPools", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).IncentivizedPools(ctx, req.(*QueryIncentivizedPoolsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Pools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPoolsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Pools(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qoracle.osmosis.Query/Pools", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Pools(ctx, req.(*QueryPoolsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.qoracle.osmosis.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "State", - Handler: _Query_State_Handler, - }, - { - MethodName: "ChainParams", - Handler: _Query_ChainParams_Handler, - }, - { - MethodName: "IncentivizedPools", - Handler: _Query_IncentivizedPools_Handler, - }, - { - MethodName: "Pools", - Handler: _Query_Pools_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/qoracle/osmosis/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 (m *QueryStateRequest) 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 *QueryStateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryStateResponse) 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 *QueryStateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PoolsState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.IncentivizedPoolsState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.ParamsRequestState.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 *QueryChainParamsRequest) 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 *QueryChainParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChainParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryChainParamsResponse) 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 *QueryChainParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChainParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.DistrInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.MintEpochProvisions.Size() - i -= size - if _, err := m.MintEpochProvisions.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.MintParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.LockableDurations) > 0 { - dAtA8 := make([]byte, len(m.LockableDurations)*10) - var j7 int - for _, num1 := range m.LockableDurations { - num := uint64(num1) - for num >= 1<<7 { - dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j7++ - } - dAtA8[j7] = uint8(num) - j7++ - } - i -= j7 - copy(dAtA[i:], dAtA8[:j7]) - i = encodeVarintQuery(dAtA, i, uint64(j7)) - i-- - dAtA[i] = 0x12 - } - if len(m.EpochsInfo) > 0 { - for iNdEx := len(m.EpochsInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EpochsInfo[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 *QueryIncentivizedPoolsRequest) 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 *QueryIncentivizedPoolsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryIncentivizedPoolsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryIncentivizedPoolsResponse) 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 *QueryIncentivizedPoolsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryIncentivizedPoolsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.IncentivizedPools) > 0 { - for iNdEx := len(m.IncentivizedPools) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.IncentivizedPools[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 *QueryPoolsRequest) 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 *QueryPoolsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPoolsRequest) 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 - } - return len(dAtA) - i, nil -} - -func (m *QueryPoolsResponse) 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 *QueryPoolsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPoolsResponse) 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 len(m.Pools) > 0 { - for iNdEx := len(m.Pools) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pools[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 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 (m *QueryStateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryStateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ParamsRequestState.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.IncentivizedPoolsState.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.PoolsState.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryChainParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryChainParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.EpochsInfo) > 0 { - for _, e := range m.EpochsInfo { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.LockableDurations) > 0 { - l = 0 - for _, e := range m.LockableDurations { - l += sovQuery(uint64(e)) - } - n += 1 + sovQuery(uint64(l)) + l - } - l = m.MintParams.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.MintEpochProvisions.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.DistrInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryIncentivizedPoolsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryIncentivizedPoolsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.IncentivizedPools) > 0 { - for _, e := range m.IncentivizedPools { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryPoolsRequest) 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 *QueryPoolsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Pools) > 0 { - for _, e := range m.Pools { - 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 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 *QueryStateRequest) 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: QueryStateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryStateRequest: 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 *QueryStateResponse) 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: QueryStateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamsRequestState", 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.ParamsRequestState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IncentivizedPoolsState", 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.IncentivizedPoolsState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolsState", 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.PoolsState.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 *QueryChainParamsRequest) 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: QueryChainParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChainParamsRequest: 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 *QueryChainParamsResponse) 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: QueryChainParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChainParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochsInfo", 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.EpochsInfo = append(m.EpochsInfo, types.EpochInfo{}) - if err := m.EpochsInfo[len(m.EpochsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType == 0 { - var v time.Duration - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= time.Duration(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LockableDurations = append(m.LockableDurations, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.LockableDurations) == 0 { - m.LockableDurations = make([]time.Duration, 0, elementCount) - } - for iNdEx < postIndex { - var v time.Duration - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= time.Duration(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LockableDurations = append(m.LockableDurations, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field LockableDurations", wireType) - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MintParams", 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.MintParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MintEpochProvisions", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MintEpochProvisions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistrInfo", 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.DistrInfo.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 *QueryIncentivizedPoolsRequest) 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: QueryIncentivizedPoolsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIncentivizedPoolsRequest: 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 *QueryIncentivizedPoolsResponse) 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: QueryIncentivizedPoolsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIncentivizedPoolsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IncentivizedPools", 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.IncentivizedPools = append(m.IncentivizedPools, types2.IncentivizedPool{}) - if err := m.IncentivizedPools[len(m.IncentivizedPools)-1].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 *QueryPoolsRequest) 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: QueryPoolsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolsRequest: 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 *QueryPoolsResponse) 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: QueryPoolsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pools", 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.Pools = append(m.Pools, balancer.Pool{}) - if err := m.Pools[len(m.Pools)-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 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/qoracle/osmosis/types/query.pb.gw.go b/x/qoracle/osmosis/types/query.pb.gw.go deleted file mode 100644 index 536a250fb..000000000 --- a/x/qoracle/osmosis/types/query.pb.gw.go +++ /dev/null @@ -1,431 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/osmosis/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 - -} - -func request_Query_State_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryStateRequest - var metadata runtime.ServerMetadata - - msg, err := client.State(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_State_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryStateRequest - var metadata runtime.ServerMetadata - - msg, err := server.State(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ChainParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChainParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.ChainParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ChainParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChainParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.ChainParams(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_IncentivizedPools_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryIncentivizedPoolsRequest - var metadata runtime.ServerMetadata - - msg, err := client.IncentivizedPools(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_IncentivizedPools_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryIncentivizedPoolsRequest - var metadata runtime.ServerMetadata - - msg, err := server.IncentivizedPools(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Pools_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Pools_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolsRequest - 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_Pools_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Pools(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Pools_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolsRequest - 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_Pools_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Pools(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()...) - - }) - - mux.Handle("GET", pattern_Query_State_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_State_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_State_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ChainParams_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_ChainParams_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_ChainParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_IncentivizedPools_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_IncentivizedPools_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_IncentivizedPools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Pools_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_Pools_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_Pools_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()...) - - }) - - mux.Handle("GET", pattern_Query_State_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_State_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_State_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ChainParams_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_ChainParams_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_ChainParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_IncentivizedPools_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_IncentivizedPools_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_IncentivizedPools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Pools_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_Pools_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_Pools_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, 2, 4}, []string{"quasarlabs", "quasarnode", "qoracle", "osmosis", "params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_State_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"quasarlabs", "quasarnode", "qoracle", "osmosis", "state"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_ChainParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"quasarlabs", "quasarnode", "qoracle", "osmosis", "chain_params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_IncentivizedPools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"quasarlabs", "quasarnode", "qoracle", "osmosis", "incentivized_pools"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Pools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"quasarlabs", "quasarnode", "qoracle", "osmosis", "pools"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_State_0 = runtime.ForwardResponseMessage - - forward_Query_ChainParams_0 = runtime.ForwardResponseMessage - - forward_Query_IncentivizedPools_0 = runtime.ForwardResponseMessage - - forward_Query_Pools_0 = runtime.ForwardResponseMessage -) diff --git a/x/qoracle/osmosis/types/tx.pb.go b/x/qoracle/osmosis/types/tx.pb.go deleted file mode 100644 index 03a2eab57..000000000 --- a/x/qoracle/osmosis/types/tx.pb.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/osmosis/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - math "math" -) - -// 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 - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/osmosis/tx.proto", fileDescriptor_e1a147c99310a5c3) -} - -var fileDescriptor_e1a147c99310a5c3 = []byte{ - // 143 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2b, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x0b, 0xf3, - 0x8b, 0x12, 0x93, 0x73, 0x52, 0xf5, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0x33, 0x8b, 0xf5, 0x4b, 0x2a, - 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x54, 0x11, 0xea, 0xf5, 0x10, 0xea, 0xf5, 0xa0, 0xea, - 0xf5, 0xa0, 0xea, 0x8d, 0x58, 0xb9, 0x98, 0x7d, 0x8b, 0xd3, 0x9d, 0x82, 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, 0xca, 0x22, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, - 0x3f, 0x57, 0x1f, 0xbb, 0x13, 0x2a, 0x30, 0x1d, 0x51, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, - 0x88, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x17, 0xaa, 0x78, 0xba, 0x00, 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 { -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.qoracle.osmosis.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/qoracle/osmosis/tx.proto", -} diff --git a/x/qoracle/types/codec.go b/x/qoracle/types/codec.go deleted file mode 100644 index 334725850..000000000 --- a/x/qoracle/types/codec.go +++ /dev/null @@ -1,17 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" -) - -func RegisterCodec(cdc *codec.LegacyAmino) { -} - -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { -} - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) diff --git a/x/qoracle/types/denom_symbol_mapping.go b/x/qoracle/types/denom_symbol_mapping.go deleted file mode 100644 index 8dd2aefa7..000000000 --- a/x/qoracle/types/denom_symbol_mapping.go +++ /dev/null @@ -1,20 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (mapping DenomSymbolMapping) Validate() error { - if err := sdk.ValidateDenom(mapping.Denom); err != nil { - return errorsmod.Wrap(err, "mapping denom") - } - if err := sdk.ValidateDenom(mapping.OracleSymbol); err != nil { - return errorsmod.Wrap(err, "mapping oracle symbol") - } - if mapping.Multiplier.IsNegative() { - return errorsmod.Wrapf(ErrNegativeDenomPriceMultiplier, "multiplier of mapping can't be negative") - } - return nil -} diff --git a/x/qoracle/types/denom_symbol_mapping.pb.go b/x/qoracle/types/denom_symbol_mapping.pb.go deleted file mode 100644 index fa98f0a96..000000000 --- a/x/qoracle/types/denom_symbol_mapping.pb.go +++ /dev/null @@ -1,422 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: qoracle/denom_symbol_mapping.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/gogo/protobuf/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 - -type DenomSymbolMapping struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - OracleSymbol string `protobuf:"bytes,2,opt,name=oracle_symbol,json=oracleSymbol,proto3" json:"oracle_symbol,omitempty"` - Multiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=multiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"multiplier"` -} - -func (m *DenomSymbolMapping) Reset() { *m = DenomSymbolMapping{} } -func (m *DenomSymbolMapping) String() string { return proto.CompactTextString(m) } -func (*DenomSymbolMapping) ProtoMessage() {} -func (*DenomSymbolMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_413dd116fd87f58b, []int{0} -} -func (m *DenomSymbolMapping) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DenomSymbolMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DenomSymbolMapping.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 *DenomSymbolMapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_DenomSymbolMapping.Merge(m, src) -} -func (m *DenomSymbolMapping) XXX_Size() int { - return m.Size() -} -func (m *DenomSymbolMapping) XXX_DiscardUnknown() { - xxx_messageInfo_DenomSymbolMapping.DiscardUnknown(m) -} - -var xxx_messageInfo_DenomSymbolMapping proto.InternalMessageInfo - -func (m *DenomSymbolMapping) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *DenomSymbolMapping) GetOracleSymbol() string { - if m != nil { - return m.OracleSymbol - } - return "" -} - -func init() { - proto.RegisterType((*DenomSymbolMapping)(nil), "quasarlabs.quasarnode.qoracle.DenomSymbolMapping") -} - -func init() { - proto.RegisterFile("qoracle/denom_symbol_mapping.proto", fileDescriptor_413dd116fd87f58b) -} - -var fileDescriptor_413dd116fd87f58b = []byte{ - // 256 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0xcc, 0x2f, 0x4a, - 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x49, 0xcd, 0xcb, 0xcf, 0x8d, 0x2f, 0xae, 0xcc, 0x4d, 0xca, 0xcf, - 0x89, 0xcf, 0x4d, 0x2c, 0x28, 0xc8, 0xcc, 0x4b, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, - 0x2d, 0x2c, 0x4d, 0x2c, 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x83, 0x30, 0xf3, 0xf2, 0x53, - 0x52, 0xf5, 0xa0, 0x3a, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x2a, 0xf5, 0x41, 0x2c, 0x88, - 0x26, 0xa5, 0xf9, 0x8c, 0x5c, 0x42, 0x2e, 0x20, 0x33, 0x83, 0xc1, 0x46, 0xfa, 0x42, 0x4c, 0x14, - 0x12, 0xe1, 0x62, 0x05, 0xdb, 0x24, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe1, 0x08, 0x29, - 0x73, 0xf1, 0x42, 0x0c, 0x83, 0x3a, 0x40, 0x82, 0x09, 0x2c, 0xcb, 0x03, 0x11, 0x84, 0x98, 0x20, - 0xe4, 0xc7, 0xc5, 0x95, 0x5b, 0x9a, 0x53, 0x92, 0x59, 0x90, 0x93, 0x99, 0x5a, 0x24, 0xc1, 0x0c, - 0x52, 0xe1, 0xa4, 0x77, 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, 0xf2, 0x6a, 0xe9, 0x99, 0x25, 0x19, - 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0x50, 0x4a, 0xb7, - 0x38, 0x25, 0x5b, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x58, 0xcf, 0x25, 0x35, 0x39, 0x08, 0xc9, 0x04, - 0x27, 0xaf, 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, 0x40, 0x32, 0x0d, - 0xe1, 0x77, 0x7d, 0x84, 0xdf, 0xf5, 0x2b, 0xf4, 0x61, 0xe1, 0x06, 0x36, 0x3b, 0x89, 0x0d, 0xec, - 0x69, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x72, 0x54, 0x48, 0x4f, 0x01, 0x00, 0x00, -} - -func (m *DenomSymbolMapping) 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 *DenomSymbolMapping) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DenomSymbolMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Multiplier.Size() - i -= size - if _, err := m.Multiplier.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDenomSymbolMapping(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.OracleSymbol) > 0 { - i -= len(m.OracleSymbol) - copy(dAtA[i:], m.OracleSymbol) - i = encodeVarintDenomSymbolMapping(dAtA, i, uint64(len(m.OracleSymbol))) - i-- - dAtA[i] = 0x12 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintDenomSymbolMapping(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDenomSymbolMapping(dAtA []byte, offset int, v uint64) int { - offset -= sovDenomSymbolMapping(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DenomSymbolMapping) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovDenomSymbolMapping(uint64(l)) - } - l = len(m.OracleSymbol) - if l > 0 { - n += 1 + l + sovDenomSymbolMapping(uint64(l)) - } - l = m.Multiplier.Size() - n += 1 + l + sovDenomSymbolMapping(uint64(l)) - return n -} - -func sovDenomSymbolMapping(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDenomSymbolMapping(x uint64) (n int) { - return sovDenomSymbolMapping(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *DenomSymbolMapping) 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 ErrIntOverflowDenomSymbolMapping - } - 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: DenomSymbolMapping: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DenomSymbolMapping: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDenomSymbolMapping - } - 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 ErrInvalidLengthDenomSymbolMapping - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDenomSymbolMapping - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OracleSymbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDenomSymbolMapping - } - 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 ErrInvalidLengthDenomSymbolMapping - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDenomSymbolMapping - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OracleSymbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Multiplier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDenomSymbolMapping - } - 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 ErrInvalidLengthDenomSymbolMapping - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDenomSymbolMapping - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Multiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDenomSymbolMapping(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDenomSymbolMapping - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDenomSymbolMapping(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, ErrIntOverflowDenomSymbolMapping - } - 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, ErrIntOverflowDenomSymbolMapping - } - 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, ErrIntOverflowDenomSymbolMapping - } - 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, ErrInvalidLengthDenomSymbolMapping - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDenomSymbolMapping - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDenomSymbolMapping - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDenomSymbolMapping = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDenomSymbolMapping = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDenomSymbolMapping = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/qoracle/types/errors.go b/x/qoracle/types/errors.go deleted file mode 100644 index 2dfd35ee4..000000000 --- a/x/qoracle/types/errors.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" -) - -// DONTCOVER - -// x/qoracle module sentinel errors -var ( - ErrNegativeDenomPriceMultiplier = errorsmod.Register(ModuleName, 2, "negative denom price multiplier") - ErrPriceListOutdated = errorsmod.Register(ModuleName, 3, "price list is outdated") - ErrDenomPriceNotFound = errorsmod.Register(ModuleName, 4, "symbol price not found") - ErrRelativeDenomPriceNotFound = errorsmod.Register(ModuleName, 5, "relative symbol price not found") -) diff --git a/x/qoracle/types/expected_keepers.go b/x/qoracle/types/expected_keepers.go deleted file mode 100644 index a8f42acb3..000000000 --- a/x/qoracle/types/expected_keepers.go +++ /dev/null @@ -1,42 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" -) - -// ChannelKeeper defines the expected IBC channel keeper -type ChannelKeeper interface { - GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool) - GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) - GetConnection(ctx sdk.Context, connectionID string) (ibcexported.ConnectionI, error) - GetChannelClientState(ctx sdk.Context, portID, channelID string) (string, ibcexported.ClientState, error) - GetChannelConnection(ctx sdk.Context, portID, channelID string) (string, ibcexported.ConnectionI, error) -} - -// PortKeeper defines the expected IBC port keeper -type PortKeeper interface { - BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability - IsBound(ctx sdk.Context, portID string) bool -} - -// ClientKeeper defines the expected IBC client keeper -type ClientKeeper interface { - GetClientConsensusState(ctx sdk.Context, clientID string, height ibcexported.Height) (ibcexported.ConsensusState, bool) -} - -// PoolOracle defines an interface for pool oracle submodules that will -// fetch pools from chains like osmosis and etc and deliver them to qoracle -// with calculated TVL and APY. -type PoolOracle interface { - Oracle - GetPools(ctx sdk.Context) ([]Pool, error) -} - -// Oracle defines an interface for oracle submodules. -type Oracle interface { - // Source returns the name of the oracle source. Note that the name must be unique. - Source() string -} diff --git a/x/qoracle/types/keys.go b/x/qoracle/types/keys.go deleted file mode 100644 index 055592f1d..000000000 --- a/x/qoracle/types/keys.go +++ /dev/null @@ -1,50 +0,0 @@ -package types - -const ( - // ModuleName defines the module name - ModuleName = "qoracle" - - // StoreKey defines the primary module store key - StoreKey = ModuleName - - // RouterKey is the message route for slashing - RouterKey = ModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - - // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_qoracle" - - // TransientStoreKey defines the transient store key - TStoreKey = "transient_qoracle" -) - -var ( - // KeyMemInitialized defines the key that stores the initialized flag in the memory store - KeyMemInitialized = []byte{0x01} - // KeyMemDenomPricePrefix defines the prefix for the denom price key in the memory store - KeyMemDenomPricePrefix = []byte{0x02} - // KeyMemDenomPricesUpdatedAt defines the key that stores the denom prices updated at in the memory store - KeyMemDenomPricesUpdatedAt = []byte{0x03} - // KeySymbolPriceListUpdateFlag defines the key that stores the symbol price list update flag in the memory store - KeySymbolPriceListUpdateFlag = []byte{0x04} - // KeyPoolsUpdateFlag defines the key that stores the pools update flag in the memory store - KeyPoolsUpdateFlag = []byte{0x05} - // KeyMemPoolPrefix defines the prefix for the pool key in the memory store - KeyMemPoolPrefix = []byte{0x06} - // KeyDenomSymbolMappingPrefix defines the prefix for the denom symbol mapping key in store - KeyDenomSymbolMappingPrefix = []byte{0x07} - // KeyOsmosisPoolPrefix defines the prefix osmosis pools stored in the memory store - KeyOsmosisPoolPrefix = []byte{0x08} -) - -// GetDenomPriceKey returns the key for the denom price in the memory store. -func GetDenomPriceKey(denom string) []byte { - return append(KeyMemDenomPricePrefix, []byte(denom)...) -} - -// GetDenomSymbolMappingKey returns the key for the denom symbol mapping in store. -func GetDenomSymbolMappingKey(denom string) []byte { - return append(KeyDenomSymbolMappingPrefix, []byte(denom)...) -} diff --git a/x/qoracle/types/msgs.go b/x/qoracle/types/msgs.go deleted file mode 100644 index ab1254f4c..000000000 --- a/x/qoracle/types/msgs.go +++ /dev/null @@ -1 +0,0 @@ -package types diff --git a/x/qoracle/types/params.go b/x/qoracle/types/params.go deleted file mode 100644 index e82238707..000000000 --- a/x/qoracle/types/params.go +++ /dev/null @@ -1,52 +0,0 @@ -package types - -import ( - "gopkg.in/yaml.v2" - "time" - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -var _ paramtypes.ParamSet = (*Params)(nil) - -var ( - // DefaultDenomPricesExpDuration is the default duration in which denom prices are valid - DefaultDenomPricesExpDuration = uint64(time.Minute * 6) - DefaultDenomSymbolMapping = []DenomSymbolMapping{} -) - -var ( - // KeyDenomPricesExpDuration is store's key for DenomPricesExpDuration - KeyDenomPricesExpDuration = []byte("DenomPricesExpDuration") - KeyDenomSymbolMapping = []byte("DenomSymbolMapping") -) - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -func NewParams() Params { - return Params{} -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return NewParams() -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{} -} - -// Validate validates the set of params -func (p Params) Validate() error { - return nil -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} diff --git a/x/qoracle/types/params.pb.go b/x/qoracle/types/params.pb.go deleted file mode 100644 index cf6ed6a8a..000000000 --- a/x/qoracle/types/params.pb.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/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 module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_c2f68d24f0fe4483, []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 init() { - proto.RegisterType((*Params)(nil), "quasarlabs.quasarnode.qoracle.Params") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/params.proto", fileDescriptor_c2f68d24f0fe4483) -} - -var fileDescriptor_c2f68d24f0fe4483 = []byte{ - // 156 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2a, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x0b, 0xf3, - 0x8b, 0x12, 0x93, 0x73, 0x52, 0xf5, 0x0b, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, - 0x4b, 0xf2, 0x85, 0x64, 0x11, 0x6a, 0xf5, 0x10, 0x6a, 0xf5, 0xa0, 0x6a, 0xa5, 0x44, 0xd2, 0xf3, - 0xd3, 0xf3, 0xc1, 0x2a, 0xf5, 0x41, 0x2c, 0x88, 0x26, 0x25, 0x3e, 0x2e, 0xb6, 0x00, 0xb0, 0x21, - 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x38, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x76, - 0x57, 0x55, 0xc0, 0xdd, 0x55, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xc2, 0x18, 0x10, - 0x00, 0x00, 0xff, 0xff, 0x5a, 0xd9, 0x45, 0x35, 0xc5, 0x00, 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 - 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 - 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 { - 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/qoracle/types/pool.pb.go b/x/qoracle/types/pool.pb.go deleted file mode 100644 index 48436bb84..000000000 --- a/x/qoracle/types/pool.pb.go +++ /dev/null @@ -1,611 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/pool.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types1 "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/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "github.com/quasarlabs/quasarnode/osmosis/gamm/pool-models/balancer" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// Pool defines the generalized structure of a liquidity pool coming from any source chain to qoracle. -type Pool struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Assets github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=assets,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"assets" yaml:"token"` - TVL github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=tvl,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"tvl"` - APY github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=apy,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"apy"` - Raw *types1.Any `protobuf:"bytes,5,opt,name=raw,proto3" json:"raw,omitempty"` - UpdatedAt time.Time `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at"` -} - -func (m *Pool) Reset() { *m = Pool{} } -func (m *Pool) String() string { return proto.CompactTextString(m) } -func (*Pool) ProtoMessage() {} -func (*Pool) Descriptor() ([]byte, []int) { - return fileDescriptor_f3ef46224b688e94, []int{0} -} -func (m *Pool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pool.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 *Pool) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pool.Merge(m, src) -} -func (m *Pool) XXX_Size() int { - return m.Size() -} -func (m *Pool) XXX_DiscardUnknown() { - xxx_messageInfo_Pool.DiscardUnknown(m) -} - -var xxx_messageInfo_Pool proto.InternalMessageInfo - -func (m *Pool) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Pool) GetAssets() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Assets - } - return nil -} - -func (m *Pool) GetRaw() *types1.Any { - if m != nil { - return m.Raw - } - return nil -} - -func (m *Pool) GetUpdatedAt() time.Time { - if m != nil { - return m.UpdatedAt - } - return time.Time{} -} - -func init() { - proto.RegisterType((*Pool)(nil), "quasarlabs.quasarnode.qoracle.Pool") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/pool.proto", fileDescriptor_f3ef46224b688e94) -} - -var fileDescriptor_f3ef46224b688e94 = []byte{ - // 458 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x6e, 0xd4, 0x40, - 0x10, 0x86, 0x6f, 0xcf, 0xe1, 0x44, 0x36, 0x11, 0x85, 0x95, 0xc2, 0x77, 0x52, 0xec, 0xd3, 0x15, - 0xe0, 0x26, 0xbb, 0x24, 0x88, 0x86, 0x8a, 0x73, 0x40, 0x48, 0x88, 0x22, 0xb2, 0x22, 0x24, 0x68, - 0xa2, 0xb1, 0xbd, 0x18, 0x2b, 0xb6, 0xc7, 0xf1, 0xee, 0x05, 0xfc, 0x16, 0x79, 0x0d, 0xa8, 0x79, - 0x88, 0x88, 0x2a, 0x25, 0xa2, 0xb8, 0xa0, 0xbb, 0x37, 0xe0, 0x09, 0xd0, 0xda, 0x9b, 0x3b, 0x04, - 0x14, 0x28, 0x95, 0x77, 0x76, 0xfe, 0xf9, 0xc6, 0xf3, 0xcf, 0x52, 0xff, 0x6c, 0x06, 0x12, 0xea, - 0x1c, 0x22, 0xc9, 0xbb, 0x63, 0x89, 0x89, 0xe0, 0x67, 0x58, 0x43, 0x9c, 0x0b, 0x5e, 0x21, 0xe6, - 0xac, 0xaa, 0x51, 0xa1, 0xbd, 0xbb, 0x56, 0xb2, 0xb5, 0x92, 0x19, 0xe5, 0x68, 0x18, 0xa3, 0x2c, - 0x50, 0x9e, 0xb4, 0x62, 0xde, 0x05, 0x5d, 0xe5, 0x68, 0x27, 0xc5, 0x14, 0xbb, 0x7b, 0x7d, 0x32, - 0xb7, 0xc3, 0x14, 0x31, 0xd5, 0x2d, 0x74, 0x14, 0xcd, 0xde, 0x71, 0x28, 0x1b, 0x93, 0xf2, 0xfe, - 0x4c, 0xa9, 0xac, 0x10, 0x52, 0x41, 0x51, 0x19, 0x81, 0xdb, 0xf1, 0x79, 0x04, 0x52, 0xf0, 0xf3, - 0xfd, 0x48, 0x28, 0xd8, 0xe7, 0x31, 0x66, 0xa5, 0xc9, 0x3f, 0x68, 0xd3, 0x99, 0xe4, 0x29, 0x14, - 0xc5, 0x4a, 0x10, 0x41, 0x0e, 0x65, 0x2c, 0xea, 0xa3, 0xd5, 0x50, 0x93, 0x4f, 0x16, 0xdd, 0xd0, - 0xa1, 0x7d, 0x8f, 0xf6, 0xb3, 0xc4, 0x21, 0x63, 0xe2, 0x6f, 0x86, 0xfd, 0x2c, 0xb1, 0x25, 0x1d, - 0x80, 0x94, 0x42, 0x49, 0xa7, 0x3f, 0xb6, 0xfc, 0xad, 0x83, 0x21, 0x33, 0x23, 0xe9, 0x96, 0xcc, - 0x10, 0xd9, 0x21, 0x66, 0x65, 0xf0, 0xf4, 0x72, 0xee, 0xf5, 0x7e, 0xce, 0xbd, 0xed, 0x06, 0x8a, - 0xfc, 0xc9, 0x44, 0xe1, 0xa9, 0x28, 0x27, 0x9f, 0xaf, 0x3d, 0x3f, 0xcd, 0xd4, 0xfb, 0x59, 0xc4, - 0x62, 0x2c, 0x8c, 0x1f, 0xe6, 0xb3, 0x27, 0x93, 0x53, 0xae, 0x9a, 0x4a, 0xc8, 0x16, 0x20, 0x43, - 0xd3, 0xca, 0x7e, 0x41, 0x2d, 0x75, 0x9e, 0x3b, 0xd6, 0x98, 0xf8, 0xdb, 0xc1, 0x63, 0x8d, 0xfd, - 0x3e, 0xf7, 0xee, 0xff, 0x07, 0xe6, 0x99, 0x88, 0x17, 0x73, 0xcf, 0x3a, 0x7e, 0xfd, 0x2a, 0xd4, - 0x04, 0x0d, 0x82, 0xaa, 0x71, 0x36, 0x6e, 0x0b, 0x9a, 0x1e, 0xbd, 0x09, 0x35, 0xc1, 0x7e, 0x4e, - 0xad, 0x1a, 0x3e, 0x38, 0x77, 0xc6, 0xc4, 0xdf, 0x3a, 0xd8, 0x61, 0xdd, 0x5e, 0xd8, 0xcd, 0x5e, - 0xd8, 0xb4, 0x6c, 0x82, 0xdd, 0xaf, 0x5f, 0xf6, 0x86, 0xc6, 0x6f, 0xa6, 0xfd, 0x5e, 0xb9, 0xa3, - 0x8d, 0x0d, 0x75, 0xbd, 0x7d, 0x48, 0xe9, 0xac, 0x4a, 0x40, 0x89, 0xe4, 0x04, 0x94, 0x33, 0x68, - 0x69, 0xa3, 0xbf, 0x68, 0xc7, 0x37, 0x5b, 0x0e, 0xee, 0xea, 0x5f, 0xbe, 0xb8, 0xf6, 0x48, 0xb8, - 0x69, 0xea, 0xa6, 0x2a, 0x78, 0x79, 0xb9, 0x70, 0xc9, 0xd5, 0xc2, 0x25, 0x3f, 0x16, 0x2e, 0xb9, - 0x58, 0xba, 0xbd, 0xab, 0xa5, 0xdb, 0xfb, 0xb6, 0x74, 0x7b, 0x6f, 0x1f, 0xfe, 0x36, 0xd9, 0xbf, - 0xdf, 0xf3, 0xc7, 0xd5, 0x8b, 0x6e, 0xe7, 0x8c, 0x06, 0x6d, 0xd3, 0x47, 0xbf, 0x02, 0x00, 0x00, - 0xff, 0xff, 0xcf, 0x34, 0x83, 0x36, 0xff, 0x02, 0x00, 0x00, -} - -func (m *Pool) 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 *Pool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.UpdatedAt):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintPool(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x32 - if m.Raw != nil { - { - size, err := m.Raw.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - { - size := m.APY.Size() - i -= size - if _, err := m.APY.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.TVL.Size() - i -= size - if _, err := m.TVL.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Assets) > 0 { - for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPool(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintPool(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintPool(dAtA []byte, offset int, v uint64) int { - offset -= sovPool(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Pool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovPool(uint64(l)) - } - if len(m.Assets) > 0 { - for _, e := range m.Assets { - l = e.Size() - n += 1 + l + sovPool(uint64(l)) - } - } - l = m.TVL.Size() - n += 1 + l + sovPool(uint64(l)) - l = m.APY.Size() - n += 1 + l + sovPool(uint64(l)) - if m.Raw != nil { - l = m.Raw.Size() - n += 1 + l + sovPool(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.UpdatedAt) - n += 1 + l + sovPool(uint64(l)) - return n -} - -func sovPool(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPool(x uint64) (n int) { - return sovPool(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Pool) 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 ErrIntOverflowPool - } - 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: Pool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPool - } - 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 ErrInvalidLengthPool - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Assets = append(m.Assets, types.Coin{}) - if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TVL", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthPool - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TVL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APY", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthPool - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.APY.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Raw == nil { - m.Raw = &types1.Any{} - } - if err := m.Raw.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPool - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPool - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPool - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPool(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPool - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPool(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, ErrIntOverflowPool - } - 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, ErrIntOverflowPool - } - 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, ErrIntOverflowPool - } - 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, ErrInvalidLengthPool - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPool - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPool - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPool = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPool = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPool = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/qoracle/types/pools.go b/x/qoracle/types/pools.go deleted file mode 100644 index 835027724..000000000 --- a/x/qoracle/types/pools.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -type PoolsOrderedByAPY []Pool - -func (ops PoolsOrderedByAPY) Len() int { - return len(ops) -} - -func (ops PoolsOrderedByAPY) Less(i, j int) bool { - return ops[i].APY.LT(ops[j].APY) -} - -func (ops PoolsOrderedByAPY) Swap(i, j int) { - ops[i], ops[j] = ops[j], ops[i] -} diff --git a/x/qoracle/types/price_list.pb.go b/x/qoracle/types/price_list.pb.go deleted file mode 100644 index 27657007a..000000000 --- a/x/qoracle/types/price_list.pb.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/price_list.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/protobuf/types/known/timestamppb" - math "math" -) - -// 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 - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/price_list.proto", fileDescriptor_2615543e505d954a) -} - -var fileDescriptor_2615543e505d954a = []byte{ - // 197 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xcf, 0x31, 0x8e, 0xc2, 0x30, - 0x10, 0x05, 0xd0, 0xa4, 0xd9, 0x62, 0xcb, 0xd5, 0x56, 0x91, 0xd6, 0x7b, 0x03, 0xcf, 0x46, 0x7b, - 0x03, 0x4a, 0x8e, 0x40, 0x83, 0x6c, 0x63, 0x8c, 0xa5, 0x38, 0xe3, 0x78, 0x26, 0x08, 0x6e, 0xc1, - 0xb1, 0x28, 0x53, 0x52, 0xa2, 0xe4, 0x22, 0x88, 0x24, 0x22, 0x0d, 0xdd, 0x97, 0xe6, 0xcd, 0x97, - 0xfe, 0xa7, 0x6c, 0x5a, 0x45, 0x2a, 0x55, 0x4a, 0x13, 0x4c, 0xb1, 0xc6, 0x9d, 0x85, 0x06, 0x93, - 0x32, 0x95, 0x85, 0x98, 0xbc, 0xb1, 0xdb, 0xca, 0x13, 0xcb, 0x98, 0x90, 0xf1, 0xeb, 0x67, 0xf1, - 0x72, 0xf1, 0x72, 0xf6, 0xc5, 0xb7, 0x43, 0x87, 0xa3, 0x84, 0x67, 0x9a, 0x9e, 0x8a, 0x5f, 0x87, - 0xe8, 0xc6, 0x36, 0x64, 0xd4, 0xed, 0x1e, 0xd8, 0x07, 0x4b, 0xac, 0x42, 0x9c, 0x81, 0x30, 0x48, - 0x01, 0x09, 0xb4, 0x22, 0x0b, 0xc7, 0x52, 0x5b, 0x56, 0x25, 0x18, 0xf4, 0xf5, 0x74, 0x5f, 0xad, - 0xaf, 0xbd, 0xc8, 0xbb, 0x5e, 0xe4, 0xf7, 0x5e, 0xe4, 0x97, 0x41, 0x64, 0xdd, 0x20, 0xb2, 0xdb, - 0x20, 0xb2, 0xcd, 0x9f, 0xf3, 0x7c, 0x68, 0xb5, 0x34, 0x18, 0xe0, 0xfd, 0x94, 0xd3, 0x6b, 0x0c, - 0x9f, 0xa3, 0x25, 0xfd, 0x31, 0x56, 0xfe, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x75, 0x31, - 0xa3, 0xfa, 0x00, 0x00, 0x00, -} diff --git a/x/qoracle/types/query.pb.go b/x/qoracle/types/query.pb.go deleted file mode 100644 index 0771d38c4..000000000 --- a/x/qoracle/types/query.pb.go +++ /dev/null @@ -1,1066 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - 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" - _ "google.golang.org/protobuf/types/known/timestamppb" - 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 - -// QueryParamsRequest is 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_8ebafe5cadd4b223, []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 - -// QueryParamsResponse is 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"` -} - -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_8ebafe5cadd4b223, []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{} -} - -// QueryPoolsRequest is request type for the Query/Pools RPC method. -type QueryPoolsRequest struct { - // denom filters the pools by their denom. If empty, pools with any denom returned. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryPoolsRequest) Reset() { *m = QueryPoolsRequest{} } -func (m *QueryPoolsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryPoolsRequest) ProtoMessage() {} -func (*QueryPoolsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8ebafe5cadd4b223, []int{2} -} -func (m *QueryPoolsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolsRequest.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 *QueryPoolsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolsRequest.Merge(m, src) -} -func (m *QueryPoolsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolsRequest proto.InternalMessageInfo - -func (m *QueryPoolsRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *QueryPoolsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryPoolsResponse is response type for the Query/Pools RPC method. -type QueryPoolsResponse struct { - Pools []Pool `protobuf:"bytes,1,rep,name=pools,proto3" json:"pools"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryPoolsResponse) Reset() { *m = QueryPoolsResponse{} } -func (m *QueryPoolsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryPoolsResponse) ProtoMessage() {} -func (*QueryPoolsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8ebafe5cadd4b223, []int{3} -} -func (m *QueryPoolsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPoolsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPoolsResponse.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 *QueryPoolsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPoolsResponse.Merge(m, src) -} -func (m *QueryPoolsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryPoolsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPoolsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPoolsResponse proto.InternalMessageInfo - -func (m *QueryPoolsResponse) GetPools() []Pool { - if m != nil { - return m.Pools - } - return nil -} - -func (m *QueryPoolsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "quasarlabs.quasarnode.qoracle.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "quasarlabs.quasarnode.qoracle.QueryParamsResponse") - proto.RegisterType((*QueryPoolsRequest)(nil), "quasarlabs.quasarnode.qoracle.QueryPoolsRequest") - proto.RegisterType((*QueryPoolsResponse)(nil), "quasarlabs.quasarnode.qoracle.QueryPoolsResponse") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/query.proto", fileDescriptor_8ebafe5cadd4b223) -} - -var fileDescriptor_8ebafe5cadd4b223 = []byte{ - // 465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x6e, 0xd4, 0x30, - 0x10, 0x5d, 0x2f, 0xec, 0x4a, 0xb8, 0x27, 0xcc, 0x1e, 0xaa, 0x15, 0xa4, 0x28, 0xd0, 0x76, 0x41, - 0x60, 0x37, 0xe1, 0x03, 0x90, 0x8a, 0x04, 0x12, 0xa7, 0x92, 0x63, 0x6f, 0x4e, 0x6a, 0x42, 0xa4, - 0xc4, 0x93, 0xc4, 0x0e, 0xa2, 0x57, 0xbe, 0x00, 0x89, 0x1b, 0x87, 0xfe, 0x0d, 0x52, 0x8f, 0x95, - 0xb8, 0x70, 0x42, 0x68, 0x97, 0x0f, 0x41, 0xb1, 0x9d, 0x6e, 0x10, 0xd0, 0x74, 0x6f, 0x76, 0xe6, - 0xbd, 0x79, 0x6f, 0xde, 0x38, 0xf8, 0x51, 0xd5, 0x70, 0xc5, 0xeb, 0x9c, 0xc7, 0x8a, 0xd9, 0xa3, - 0x84, 0x13, 0xc1, 0x2a, 0xa8, 0x79, 0x92, 0x0b, 0x56, 0x35, 0xa2, 0x3e, 0xa5, 0x65, 0x0d, 0x1a, - 0xc8, 0xbd, 0x35, 0x94, 0xae, 0xa1, 0xd4, 0x41, 0xe7, 0xb3, 0x14, 0x52, 0x30, 0x48, 0xd6, 0x9e, - 0x2c, 0x69, 0x7e, 0x37, 0x05, 0x48, 0x73, 0xc1, 0x78, 0x99, 0x31, 0x2e, 0x25, 0x68, 0xae, 0x33, - 0x90, 0xca, 0x55, 0x77, 0x5c, 0xd5, 0xdc, 0xe2, 0xe6, 0x2d, 0xd3, 0x59, 0x21, 0x94, 0xe6, 0x45, - 0xe9, 0x00, 0x5e, 0x02, 0xaa, 0x00, 0xc5, 0x62, 0xae, 0x04, 0x7b, 0x1f, 0xc4, 0x42, 0xf3, 0x80, - 0x25, 0x90, 0x49, 0x57, 0x7f, 0xdc, 0xaf, 0x1b, 0xb3, 0x97, 0xa8, 0x92, 0xa7, 0x99, 0x34, 0x6a, - 0x1d, 0xf6, 0xea, 0x51, 0x4b, 0x5e, 0xf3, 0xa2, 0x33, 0xb6, 0x18, 0xc0, 0x02, 0xe4, 0x16, 0xe9, - 0xcf, 0x30, 0x79, 0xd3, 0xea, 0x1e, 0x19, 0x7a, 0x24, 0xaa, 0x46, 0x28, 0xed, 0x1f, 0xe3, 0x3b, - 0x7f, 0x7c, 0x55, 0x25, 0x48, 0x25, 0xc8, 0x0b, 0x3c, 0xb5, 0x32, 0xdb, 0xe8, 0x3e, 0x5a, 0x6c, - 0x85, 0xbb, 0xf4, 0xca, 0x4c, 0xa9, 0xa5, 0x1f, 0xde, 0x3c, 0xff, 0xb1, 0x33, 0x8a, 0x1c, 0xd5, - 0xaf, 0xf0, 0x6d, 0xdb, 0x1b, 0x20, 0xef, 0x04, 0xc9, 0x0c, 0x4f, 0x4e, 0x84, 0x84, 0xc2, 0x34, - 0xbe, 0x15, 0xd9, 0x0b, 0x79, 0x89, 0xf1, 0x3a, 0x86, 0xed, 0xb1, 0xd1, 0xdc, 0xa3, 0x36, 0x33, - 0xda, 0x66, 0x46, 0xed, 0x82, 0x5d, 0x66, 0xf4, 0x88, 0xa7, 0xc2, 0x75, 0x8c, 0x7a, 0x4c, 0xff, - 0x0c, 0x75, 0x53, 0x5a, 0x4d, 0x37, 0xce, 0x73, 0x3c, 0x69, 0x93, 0x68, 0xa7, 0xb9, 0xb1, 0xd8, - 0x0a, 0x1f, 0x0c, 0x4d, 0x03, 0x90, 0xbb, 0x59, 0x2c, 0x8f, 0xbc, 0xfa, 0x87, 0xbf, 0xfd, 0x41, - 0x7f, 0x56, 0xbd, 0x6f, 0x30, 0xfc, 0x3a, 0xc6, 0x13, 0x63, 0x90, 0x9c, 0x21, 0x3c, 0xb5, 0xb1, - 0x91, 0x60, 0xc0, 0xcf, 0xdf, 0x7b, 0x9b, 0x87, 0x9b, 0x50, 0xac, 0x0f, 0xff, 0xe9, 0xc7, 0x6f, - 0xbf, 0x3e, 0x8f, 0xf7, 0xc9, 0x2e, 0xbb, 0xce, 0x03, 0x23, 0x5f, 0x10, 0x9e, 0x98, 0x18, 0xc9, - 0xc1, 0xb5, 0xc4, 0x7a, 0x5b, 0x9e, 0x07, 0x1b, 0x30, 0x9c, 0xbb, 0x27, 0xc6, 0xdd, 0x1e, 0x79, - 0xc8, 0x86, 0x9f, 0xb4, 0x3a, 0x7c, 0x7d, 0xbe, 0xf4, 0xd0, 0xc5, 0xd2, 0x43, 0x3f, 0x97, 0x1e, - 0xfa, 0xb4, 0xf2, 0x46, 0x17, 0x2b, 0x6f, 0xf4, 0x7d, 0xe5, 0x8d, 0x8e, 0x0f, 0xd2, 0x4c, 0xbf, - 0x6b, 0x62, 0x9a, 0x40, 0xf1, 0x9f, 0x4e, 0x1f, 0x2e, 0x7b, 0xe9, 0xd3, 0x52, 0xa8, 0x78, 0x6a, - 0x7e, 0x90, 0x67, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xce, 0xa2, 0x85, 0x15, 0x63, 0x04, 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 queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Pools queries the pools collected from pool oracles. - Pools(ctx context.Context, in *QueryPoolsRequest, opts ...grpc.CallOption) (*QueryPoolsResponse, 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, "/quasarlabs.quasarnode.qoracle.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Pools(ctx context.Context, in *QueryPoolsRequest, opts ...grpc.CallOption) (*QueryPoolsResponse, error) { - out := new(QueryPoolsResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qoracle.Query/Pools", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Params queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Pools queries the pools collected from pool oracles. - Pools(context.Context, *QueryPoolsRequest) (*QueryPoolsResponse, 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 (*UnimplementedQueryServer) Pools(ctx context.Context, req *QueryPoolsRequest) (*QueryPoolsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Pools 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: "/quasarlabs.quasarnode.qoracle.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 _Query_Pools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPoolsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Pools(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qoracle.Query/Pools", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Pools(ctx, req.(*QueryPoolsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.qoracle.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Pools", - Handler: _Query_Pools_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/qoracle/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 (m *QueryPoolsRequest) 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 *QueryPoolsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPoolsRequest) 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 len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryPoolsResponse) 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 *QueryPoolsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPoolsResponse) 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 len(m.Pools) > 0 { - for iNdEx := len(m.Pools) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pools[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 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 (m *QueryPoolsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - 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 *QueryPoolsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Pools) > 0 { - for _, e := range m.Pools { - 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 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 *QueryPoolsRequest) 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: QueryPoolsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = 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 - 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 *QueryPoolsResponse) 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: QueryPoolsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pools", 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.Pools = append(m.Pools, Pool{}) - if err := m.Pools[len(m.Pools)-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 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/qoracle/types/query.pb.gw.go b/x/qoracle/types/query.pb.gw.go deleted file mode 100644 index 7a4b03137..000000000 --- a/x/qoracle/types/query.pb.gw.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/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 - -} - -var ( - filter_Query_Pools_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Pools_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolsRequest - 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_Pools_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Pools(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Pools_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPoolsRequest - 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_Pools_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Pools(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()...) - - }) - - mux.Handle("GET", pattern_Query_Pools_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_Pools_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_Pools_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()...) - - }) - - mux.Handle("GET", pattern_Query_Pools_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_Pools_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_Pools_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{"quasarlabs", "quasarnode", "qoracle", "params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Pools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"quasarlabs", "quasarnode", "qoracle", "pools"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Pools_0 = runtime.ForwardResponseMessage -) diff --git a/x/qoracle/types/tx.pb.go b/x/qoracle/types/tx.pb.go deleted file mode 100644 index 6515fbe0f..000000000 --- a/x/qoracle/types/tx.pb.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qoracle/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - math "math" -) - -// 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 - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qoracle/tx.proto", fileDescriptor_10ff392d34e976a4) -} - -var fileDescriptor_10ff392d34e976a4 = []byte{ - // 145 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2b, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x0b, 0xf3, - 0x8b, 0x12, 0x93, 0x73, 0x52, 0xf5, 0x4b, 0x2a, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x64, - 0x11, 0xea, 0xf4, 0x10, 0xea, 0xf4, 0xa0, 0xea, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x2a, - 0xf5, 0x41, 0x2c, 0x88, 0x26, 0x23, 0x56, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0x27, 0xaf, 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, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, - 0x4b, 0xce, 0xcf, 0xd5, 0xc7, 0xee, 0x90, 0x0a, 0x84, 0x53, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, - 0xc0, 0x26, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x36, 0x8b, 0xe3, 0xc6, 0xb8, 0x00, 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 { -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.qoracle.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/qoracle/tx.proto", -} diff --git a/x/qoracle/utils/send_packet.go b/x/qoracle/utils/send_packet.go deleted file mode 100644 index e6558c1f8..000000000 --- a/x/qoracle/utils/send_packet.go +++ /dev/null @@ -1,124 +0,0 @@ -package utils - -import ( - errorsmod "cosmossdk.io/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - - "github.com/quasarlabs/quasarnode/x/qoracle/types" -) - -func SendPacket( - ctx sdk.Context, - clientKeeper types.ClientKeeper, - ics4Wrapper porttypes.ICS4Wrapper, - channelKeeper types.ChannelKeeper, - scopedKeeper capabilitykeeper.ScopedKeeper, - sourcePort string, - sourceChannel string, - data []byte, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, -) (channeltypes.Packet, error) { - sourceChannelEnd, found := channelKeeper.GetChannel(ctx, sourcePort, sourceChannel) - if !found { - return channeltypes.Packet{}, errorsmod.Wrapf( - sdkerrors.ErrUnknownRequest, - "unknown port %s channel %s", - sourcePort, - sourceChannel, - ) - } - destinationPort := sourceChannelEnd.GetCounterparty().GetPortID() - destinationChannel := sourceChannelEnd.GetCounterparty().GetChannelID() - - // get the next sequence - sequence, found := channelKeeper.GetNextSequenceSend(ctx, sourcePort, sourceChannel) - if !found { - return channeltypes.Packet{}, errorsmod.Wrapf(channeltypes.ErrSequenceSendNotFound, "failed to retrieve next sequence send for channel %s on port %s", sourceChannel, sourcePort) - } - - chanCap, ok := scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(sourcePort, sourceChannel)) - if !ok { - return channeltypes.Packet{}, errorsmod.Wrap(channeltypes.ErrChannelCapabilityNotFound, - "module does not own channel capability") - } - - timeoutHeight, timeoutTimestamp, err := convertRelativeToAbsoluteTimeout( - ctx, - clientKeeper, - channelKeeper, - sourcePort, - sourceChannel, - timeoutHeight, - timeoutTimestamp, - ) - if err != nil { - return channeltypes.Packet{}, err - } - - packet := channeltypes.NewPacket( - data, - sequence, - sourcePort, - sourceChannel, - destinationPort, - destinationChannel, - timeoutHeight, - timeoutTimestamp, - ) - _, err = ics4Wrapper.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) - return packet, err -} - -func convertRelativeToAbsoluteTimeout( - ctx sdk.Context, - clientKeeper types.ClientKeeper, - channelKeeper types.ChannelKeeper, - port string, - channel string, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, -) ( - absTimeoutHeight clienttypes.Height, - absTimeoutTimestamp uint64, - err error, -) { - clientId, clientState, err := channelKeeper.GetChannelClientState(ctx, port, channel) - if err != nil { - return clienttypes.ZeroHeight(), 0, err - } - - clientHeight, ok := clientState.GetLatestHeight().(clienttypes.Height) - if !ok { - return clienttypes.ZeroHeight(), 0, errorsmod.Wrapf(sdkerrors.ErrInvalidHeight, "invalid height type. expected type: %T, got: %T", - clienttypes.Height{}, clientHeight) - } - - if !timeoutHeight.IsZero() { - absTimeoutHeight = clientHeight - absTimeoutHeight.RevisionNumber += timeoutHeight.RevisionNumber - absTimeoutHeight.RevisionHeight += timeoutHeight.RevisionHeight - } - - consensusState, _ := clientKeeper.GetClientConsensusState(ctx, clientId, clientHeight) - if timeoutTimestamp != 0 { - // use local clock time as reference time if it is later than the - // consensus state timestamp of the counter party chain, otherwise - // still use consensus state timestamp as reference - now := uint64(ctx.BlockTime().UnixNano()) - consensusStateTimestamp := consensusState.GetTimestamp() - if now > consensusStateTimestamp { - absTimeoutTimestamp = now + timeoutTimestamp - } else { - absTimeoutTimestamp = consensusStateTimestamp + timeoutTimestamp - } - } - return absTimeoutHeight, absTimeoutTimestamp, nil -} diff --git a/x/qtransfer/README.md b/x/qtransfer/README.md deleted file mode 100644 index 8efef3331..000000000 --- a/x/qtransfer/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# QTransfer - -## Wasm Hooks - -*Most of the parts of Wasm Hooks implementation has been copied from [osmosis](github.com/osmosis-labs/osmosis/blob/main/x/ibc-hooks)* - -The wasm hook is an IBC middleware which is used to allow ICS-20 token transfers to initiate contract calls. -This allows cross-chain contract calls, that involve token movement. -This is useful for a variety of usecases. -One of primary importance is cross-chain swaps, which is an extremely powerful primitive. - -The mechanism enabling this is a `memo` field on every ICS20 transfer packet as of [IBC v3.4.0](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b). -Wasm hooks is an IBC middleware that parses an ICS20 transfer, and if the `memo` field is of a particular form, executes a wasm contract call. We now detail the `memo` format for `wasm` contract calls, and the execution guarantees provided. - -### Cosmwasm Contract Execution Format - -Before we dive into the IBC metadata format, we show the cosmwasm execute message format, so the reader has a sense of what are the fields we need to be setting in. -The cosmwasm `MsgExecuteContract` is defined [here](https://github.com/CosmWasm/wasmd/blob/4fe2fbc8f322efdaf187e2e5c99ce32fd1df06f0/x/wasm/types/tx.pb.go#L340-L349 -) as the following type: - -```go -type MsgExecuteContract struct { - // Sender is the that actor that signed the messages - Sender string - // Contract is the address of the smart contract - Contract string - // Msg json encoded message to be passed to the contract - Msg RawContractMessage - // Funds coins that are transferred to the contract on execution - Funds sdk.Coins -} -``` - -So we detail where we want to get each of these fields from: - -* Sender: We cannot trust the sender of an IBC packet, the counterparty chain has full ability to lie about it. -We cannot risk this sender being confused for a particular user or module address on Quasar. -So we hardcode the sender to be a particular module account made in IBC. -* Contract: This field should be directly obtained from the ICS-20 packet metadata -* Msg: This field should be directly obtained from the ICS-20 packet metadata. -* Funds: This field is set to the amount of funds being sent over in the ICS 20 packet. One detail is that the denom in the packet is the counterparty chains representation of the denom, so we have to translate it to Quasar' representation. - -So our constructed cosmwasm message that we execute will look like: - -```go -msg := MsgExecuteContract{ - // Sender is the that actor that signed the messages - Sender: "quasar1-hardcoded-moduleAccount", - // Contract is the address of the smart contract - Contract: packet.data.memo["wasm"]["ContractAddress"], - // Msg json encoded message to be passed to the contract - Msg: packet.data.memo["wasm"]["Msg"], - // Funds coins that are transferred to the contract on execution - Funds: sdk.NewCoin{Denom: ibc.ConvertSenderDenomToLocalDenom(packet.data.Denom), Amount: packet.data.Amount} -``` - -### ICS20 packet structure - -So given the details above, we propogate the implied ICS20 packet data structure. -ICS20 is JSON native, so we use JSON for the memo format. - -```json -{ - //... other ibc fields that we don't care about - "data":{ - "denom": "denom on counterparty chain (e.g. uatom)", - "amount": "1000", - "sender": "...", // ignored - "receiver": "contract addr or blank", - "memo": { - "wasm": { - "contract": "quasar1contractAddr", - "msg": { - "raw_message_fields": "raw_message_data", - } - } - } - } -} -``` - -An ICS20 packet is formatted correctly for wasmhooks iff the following all hold: - -* `memo` is not blank -* `memo` is valid JSON -* `memo` has at least one key, with value `"wasm"` -* `memo["wasm"]` has exactly two entries, `"contract"` and `"msg"` -* `memo["wasm"]["msg"]` is a valid JSON object -* `receiver == "" || receiver == memo["wasm"]["contract"]` - -We consider an ICS20 packet as directed towards wasmhooks iff all of the following hold: - -* `memo` is not blank -* `memo` is valid JSON -* `memo` has at least one key, with name `"wasm"` - -If an ICS20 packet is not directed towards wasmhooks, wasmhooks doesn't do anything. -If an ICS20 packet is directed towards wasmhooks, and is formated incorrectly, then wasmhooks returns an error. - -### Execution flow - -Pre wasm hooks: - -* Ensure the incoming IBC packet is cryptographically valid -* Ensure the incoming IBC packet is not timed out. - -In Wasm hooks, pre packet execution: - -* Ensure the packet is correctly formatted (as defined above) -* Edit the receiver to be the hardcoded IBC module account - -In wasm hooks, post packet execution: - -* Construct wasm message as defined before -* Execute wasm message -* if wasm message has error, return ErrAck -* otherwise continue through middleware - -### Testing strategy diff --git a/x/qtransfer/bytecode/counter.wasm b/x/qtransfer/bytecode/counter.wasm deleted file mode 100644 index 55f18df6d..000000000 Binary files a/x/qtransfer/bytecode/counter.wasm and /dev/null differ diff --git a/x/qtransfer/bytecode/echo.wasm b/x/qtransfer/bytecode/echo.wasm deleted file mode 100644 index 4feb4554e..000000000 Binary files a/x/qtransfer/bytecode/echo.wasm and /dev/null differ diff --git a/x/qtransfer/client/cli/cli.go b/x/qtransfer/client/cli/cli.go deleted file mode 100644 index 9f81e7c25..000000000 --- a/x/qtransfer/client/cli/cli.go +++ /dev/null @@ -1,21 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" -) - -// GetQueryCmd returns the query commands for IBC connections -func GetQueryCmd() *cobra.Command { - queryCmd := &cobra.Command{ - Use: "qtransfer", - Short: "Quasar specific IBC fungible token transfer query subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - } - - queryCmd.AddCommand( - GetCmdParams(), - ) - - return queryCmd -} diff --git a/x/qtransfer/client/cli/query.go b/x/qtransfer/client/cli/query.go deleted file mode 100644 index 48ab251db..000000000 --- a/x/qtransfer/client/cli/query.go +++ /dev/null @@ -1,41 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/version" - "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -// GetCmdParams returns the command handler for qtransfer parameter querying. -func GetCmdParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the current qtransfer parameters", - Long: "Query the current qtransfer parameters", - Args: cobra.NoArgs, - Example: fmt.Sprintf("%s query qtransfer params", version.AppName), - 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.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/qtransfer/genesis.go b/x/qtransfer/genesis.go deleted file mode 100644 index 9b88f7614..000000000 --- a/x/qtransfer/genesis.go +++ /dev/null @@ -1,28 +0,0 @@ -package qtransfer - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/qtransfer/keeper" - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -// InitGenesis initializes the qtransfer state and creates the intermediate account for wasm hooks. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, state types.GenesisState) { - err := k.CreateIntermediateAccountAccount(ctx) - if err != nil { - k.Logger(ctx).Error("InitGenesis failed during CreateIntermediateAccountAccount", - "error", err) - panic(err) - } - - k.SetParams(ctx, state.Params) -} - -// ExportGenesis returns the capability module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - gs := types.DefaultGenesisState() - gs.Params = k.GetParams(ctx) - - return gs -} diff --git a/x/qtransfer/genesis_test.go b/x/qtransfer/genesis_test.go deleted file mode 100644 index ed9a5d50b..000000000 --- a/x/qtransfer/genesis_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package qtransfer_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/qtransfer" - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -func TestGenesis(t *testing.T) { - genesisState := types.GenesisState{ - Params: types.DefaultParams(), - } - - setup := testutil.NewTestSetup(t) - ctx, keeper := setup.Ctx, setup.Keepers.QTransfer - qtransfer.InitGenesis(ctx, keeper, genesisState) - setParams := keeper.GetParams(ctx) - require.Equal(t, genesisState.Params, setParams) - got := qtransfer.ExportGenesis(ctx, keeper) - - require.NotNil(t, got) - require.Equal(t, genesisState.Params, got.Params) -} diff --git a/x/qtransfer/hooks.go b/x/qtransfer/hooks.go deleted file mode 100644 index e25f43d23..000000000 --- a/x/qtransfer/hooks.go +++ /dev/null @@ -1,155 +0,0 @@ -package qtransfer - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" -) - -type Hooks interface{} - -type OnChanOpenInitOverrideHooks interface { - OnChanOpenInitOverride(im IBCMiddleware, ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string) (string, error) -} -type OnChanOpenInitBeforeHooks interface { - OnChanOpenInitBeforeHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string) -} -type OnChanOpenInitAfterHooks interface { - OnChanOpenInitAfterHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string, err error) -} - -// OnChanOpenTry Hooks -type OnChanOpenTryOverrideHooks interface { - OnChanOpenTryOverride(im IBCMiddleware, ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion string) (string, error) -} -type OnChanOpenTryBeforeHooks interface { - OnChanOpenTryBeforeHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion string) -} -type OnChanOpenTryAfterHooks interface { - OnChanOpenTryAfterHook(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion string, version string, err error) -} - -// OnChanOpenAck Hooks -type OnChanOpenAckOverrideHooks interface { - OnChanOpenAckOverride(im IBCMiddleware, ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string) error -} -type OnChanOpenAckBeforeHooks interface { - OnChanOpenAckBeforeHook(ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string) -} -type OnChanOpenAckAfterHooks interface { - OnChanOpenAckAfterHook(ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string, err error) -} - -// OnChanOpenConfirm Hooks -type OnChanOpenConfirmOverrideHooks interface { - OnChanOpenConfirmOverride(im IBCMiddleware, ctx sdk.Context, portID, channelID string) error -} -type OnChanOpenConfirmBeforeHooks interface { - OnChanOpenConfirmBeforeHook(ctx sdk.Context, portID, channelID string) -} -type OnChanOpenConfirmAfterHooks interface { - OnChanOpenConfirmAfterHook(ctx sdk.Context, portID, channelID string, err error) -} - -// OnChanCloseInit Hooks -type OnChanCloseInitOverrideHooks interface { - OnChanCloseInitOverride(im IBCMiddleware, ctx sdk.Context, portID, channelID string) error -} -type OnChanCloseInitBeforeHooks interface { - OnChanCloseInitBeforeHook(ctx sdk.Context, portID, channelID string) -} -type OnChanCloseInitAfterHooks interface { - OnChanCloseInitAfterHook(ctx sdk.Context, portID, channelID string, err error) -} - -// OnChanCloseConfirm Hooks -type OnChanCloseConfirmOverrideHooks interface { - OnChanCloseConfirmOverride(im IBCMiddleware, ctx sdk.Context, portID, channelID string) error -} -type OnChanCloseConfirmBeforeHooks interface { - OnChanCloseConfirmBeforeHook(ctx sdk.Context, portID, channelID string) -} -type OnChanCloseConfirmAfterHooks interface { - OnChanCloseConfirmAfterHook(ctx sdk.Context, portID, channelID string, err error) -} - -// OnRecvPacket Hooks -type OnRecvPacketOverrideHooks interface { - OnRecvPacketOverride(im IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) ibcexported.Acknowledgement -} -type OnRecvPacketBeforeHooks interface { - OnRecvPacketBeforeHook(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) -} -type OnRecvPacketAfterHooks interface { - OnRecvPacketAfterHook(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ack ibcexported.Acknowledgement) -} - -// OnAcknowledgementPacket Hooks -type OnAcknowledgementPacketOverrideHooks interface { - OnAcknowledgementPacketOverride(im IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress) error -} -type OnAcknowledgementPacketBeforeHooks interface { - OnAcknowledgementPacketBeforeHook(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress) -} -type OnAcknowledgementPacketAfterHooks interface { - OnAcknowledgementPacketAfterHook(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress, err error) -} - -// OnTimeoutPacket Hooks -type OnTimeoutPacketOverrideHooks interface { - OnTimeoutPacketOverride(im IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) error -} -type OnTimeoutPacketBeforeHooks interface { - OnTimeoutPacketBeforeHook(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) -} -type OnTimeoutPacketAfterHooks interface { - OnTimeoutPacketAfterHook(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, err error) -} - -// SDK 47 changes. -// SendPacket Hooks -type SendPacketOverrideHooks interface { - SendPacketOverride(i ICS4Middleware, ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte) (uint64, error) -} -type SendPacketBeforeHooks interface { - SendPacketBeforeHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte) -} -type SendPacketAfterHooks interface { - SendPacketAfterHook(cctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte, err error) -} - -/* -// SendPacket Hooks -type SendPacketOverrideHooks interface { - SendPacketOverride(i ICS4Middleware, ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI) error -} -type SendPacketBeforeHooks interface { - SendPacketBeforeHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI) -} -type SendPacketAfterHooks interface { - SendPacketAfterHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, err error) -} -*/ -// WriteAcknowledgement Hooks -type WriteAcknowledgementOverrideHooks interface { - WriteAcknowledgementOverride(i ICS4Middleware, ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, ack ibcexported.Acknowledgement) error -} -type WriteAcknowledgementBeforeHooks interface { - WriteAcknowledgementBeforeHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, ack ibcexported.Acknowledgement) -} -type WriteAcknowledgementAfterHooks interface { - WriteAcknowledgementAfterHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, ack ibcexported.Acknowledgement, err error) -} - -// GetAppVersion Hooks -type GetAppVersionOverrideHooks interface { - GetAppVersionOverride(i ICS4Middleware, ctx sdk.Context, portID, channelID string) (string, bool) -} -type GetAppVersionBeforeHooks interface { - GetAppVersionBeforeHook(ctx sdk.Context, portID, channelID string) -} -type GetAppVersionAfterHooks interface { - GetAppVersionAfterHook(ctx sdk.Context, portID, channelID string, result string, success bool) -} diff --git a/x/qtransfer/ibc_middleware_test.go b/x/qtransfer/ibc_middleware_test.go deleted file mode 100644 index eb07a414d..000000000 --- a/x/qtransfer/ibc_middleware_test.go +++ /dev/null @@ -1,363 +0,0 @@ -package qtransfer_test - -import ( - "encoding/json" - "fmt" - "testing" - - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/stretchr/testify/suite" - - "github.com/quasarlabs/quasarnode/x/qtransfer" - qtransfertestutils "github.com/quasarlabs/quasarnode/x/qtransfer/testutils" - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -type HooksTestSuite struct { - suite.Suite - - coordinator *ibctesting.Coordinator - chainA *qtransfertestutils.TestChain - chainB *qtransfertestutils.TestChain - - path *ibctesting.Path -} - -func (suite *HooksTestSuite) SetupTest() { - ibctesting.DefaultTestingAppInit = qtransfertestutils.SetupTestingApp - - suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) - suite.chainA = &qtransfertestutils.TestChain{ - TestChain: suite.coordinator.GetChain(ibctesting.GetChainID(1)), - } - suite.chainB = &qtransfertestutils.TestChain{ - TestChain: suite.coordinator.GetChain(ibctesting.GetChainID(2)), - } - suite.path = NewTransferPath(suite.chainA.TestChain, suite.chainB.TestChain) - suite.coordinator.Setup(suite.path) -} - -func TestIBCHooksTestSuite(t *testing.T) { - suite.Run(t, new(HooksTestSuite)) -} - -func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { - path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = ibctesting.TransferPort - path.EndpointB.ChannelConfig.PortID = ibctesting.TransferPort - path.EndpointA.ChannelConfig.Version = transfertypes.Version - path.EndpointB.ChannelConfig.Version = transfertypes.Version - - return path -} - -func (suite *HooksTestSuite) TestOnRecvPacketHooks() { - var ( - trace transfertypes.DenomTrace - amount sdkmath.Int - receiver string - status qtransfertestutils.Status - ) - - testCases := []struct { - msg string - malleate func(*qtransfertestutils.Status) - expPass bool - }{ - {"override", func(status *qtransfertestutils.Status) { - suite.chainB.GetQuasarApp().TransferStack. - ICS4Middleware.Hooks = qtransfertestutils.TestRecvOverrideHooks{Status: status} - }, true}, - {"before and after", func(status *qtransfertestutils.Status) { - suite.chainB.GetQuasarApp().TransferStack. - ICS4Middleware.Hooks = qtransfertestutils.TestRecvBeforeAfterHooks{Status: status} - }, true}, - } - - for _, tc := range testCases { - tc := tc - suite.Run(tc.msg, func() { - suite.SetupTest() // reset - - path := NewTransferPath(suite.chainA.TestChain, suite.chainB.TestChain) - suite.coordinator.Setup(path) - receiver = suite.chainB.SenderAccount.GetAddress().String() // must be explicitly changed in malleate - status = qtransfertestutils.Status{} - - amount = sdk.NewInt(100) // must be explicitly changed in malleate - seq := uint64(1) - - trace = transfertypes.ParseDenomTrace(sdk.DefaultBondDenom) - - // send coin from chainA to chainB - transferMsg := transfertypes.NewMsgTransfer( - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - sdk.NewCoin(trace.IBCDenom(), amount), - suite.chainA.SenderAccount.GetAddress().String(), - receiver, - clienttypes.NewHeight(1, 110), - 0, - "", - ) - _, err := suite.chainA.SendMsgs(transferMsg) - suite.Require().NoError(err) // message committed - - tc.malleate(&status) - - data := transfertypes.NewFungibleTokenPacketData( - trace.GetFullDenomPath(), - amount.String(), - suite.chainA.SenderAccount.GetAddress().String(), - receiver, - "", - ) - packet := channeltypes.NewPacket(data.GetBytes(), seq, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, clienttypes.NewHeight(1, 100), 0) - - ack := suite.chainB.GetQuasarApp().TransferStack. - OnRecvPacket(suite.chainB.GetContext(), packet, suite.chainA.SenderAccount.GetAddress()) - - if tc.expPass { - suite.Require().True(ack.Success()) - } else { - suite.Require().False(ack.Success()) - } - - if _, ok := suite.chainB.GetQuasarApp().TransferStack. - ICS4Middleware.Hooks.(qtransfertestutils.TestRecvOverrideHooks); ok { - suite.Require().True(status.OverrideRan) - suite.Require().False(status.BeforeRan) - suite.Require().False(status.AfterRan) - } - - if _, ok := suite.chainB.GetQuasarApp().TransferStack. - ICS4Middleware.Hooks.(qtransfertestutils.TestRecvBeforeAfterHooks); ok { - suite.Require().False(status.OverrideRan) - suite.Require().True(status.BeforeRan) - suite.Require().True(status.AfterRan) - } - }) - } -} - -func (suite *HooksTestSuite) makeMockPacket(receiver, memo string, prevSequence uint64, height clienttypes.Height) channeltypes.Packet { - packetData := transfertypes.FungibleTokenPacketData{ - Denom: sdk.DefaultBondDenom, - Amount: "1", - Sender: suite.chainB.SenderAccount.GetAddress().String(), - Receiver: receiver, - Memo: memo, - } - - return channeltypes.NewPacket( - packetData.GetBytes(), - prevSequence+1, - suite.path.EndpointB.ChannelConfig.PortID, - suite.path.EndpointB.ChannelID, - suite.path.EndpointA.ChannelConfig.PortID, - suite.path.EndpointA.ChannelID, - height, - 0, - ) -} - -func (suite *HooksTestSuite) receivePacket(receiver, memo string, height clienttypes.Height) []byte { - return suite.receivePacketWithSequence(receiver, memo, 0, height) -} - -func (suite *HooksTestSuite) receivePacketWithSequence(receiver, memo string, prevSequence uint64, height clienttypes.Height) []byte { - channelCap := suite.chainB.GetChannelCapability( - suite.path.EndpointB.ChannelConfig.PortID, - suite.path.EndpointB.ChannelID) - - packet := suite.makeMockPacket(receiver, memo, prevSequence, height) - - _, err := suite.chainB.GetQuasarApp().HooksICS4Wrapper.SendPacket( - suite.chainB.GetContext(), - channelCap, - suite.path.EndpointB.ChannelConfig.PortID, - suite.path.EndpointB.ChannelID, - height, - 0, - packet.Data, - ) - suite.Require().NoError(err, "IBC send failed. Expected success. %s", err) - - // Update both clients - err = suite.path.EndpointB.UpdateClient() - suite.Require().NoError(err) - err = suite.path.EndpointA.UpdateClient() - suite.Require().NoError(err) - - // recv in chain a - res, err := suite.path.EndpointA.RecvPacketWithResult(packet) - suite.Require().NoError(err) - - // get the ack from the chain a's response - ack, err := ibctesting.ParseAckFromEvents(res.GetEvents()) - suite.Require().NoError(err) - - // manually send the acknowledgement to chain b - err = suite.path.EndpointA.AcknowledgePacket(packet, ack) - suite.Require().NoError(err) - return ack -} - -func (suite *HooksTestSuite) TestRecvTransferWithMetadata() { - // Setup contract - suite.SetupTest() - suite.chainA.StoreContractCode(&suite.Suite, "./bytecode/echo.wasm") - addr := suite.chainA.InstantiateContract(&suite.Suite, "{}") - - ackBytes := suite.receivePacket(addr.String(), fmt.Sprintf(`{"wasm": {"contract": "%s", "msg": {"echo": {"msg": "test"} } } }`, addr), clienttypes.NewHeight(1, 25)) - - var ack map[string]string // This can't be unmarshalled to Acknowledgement because it's fetched from the events - err := json.Unmarshal(ackBytes, &ack) - suite.Require().NoError(err) - suite.Require().NotContains(ack, "error") - suite.Require().Equal(ack["result"], "eyJjb250cmFjdF9yZXN1bHQiOiJkR2hwY3lCemFHOTFiR1FnWldOb2J3PT0iLCJpYmNfYWNrIjoiZXlKeVpYTjFiSFFpT2lKQlVUMDlJbjA9In0=") -} - -// After successfully executing a wasm call, the contract should have the funds sent via IBC -func (suite *HooksTestSuite) TestFundsAreTransferredToTheContract() { - // Setup contract - suite.chainA.StoreContractCode(&suite.Suite, "./bytecode/echo.wasm") - addr := suite.chainA.InstantiateContract(&suite.Suite, "{}") - - // Check that the contract has no funds - localDenom := qtransfer.MustExtractDenomFromPacketOnRecv(suite.makeMockPacket("", "", 0, clienttypes.NewHeight(0, 100))) - balance := suite.chainA.GetQuasarApp().BankKeeper.GetBalance(suite.chainA.GetContext(), addr, localDenom) - suite.Require().Equal(sdk.NewInt(0), balance.Amount) - - // Execute the contract via IBC - ackBytes := suite.receivePacket(addr.String(), fmt.Sprintf(`{"wasm": {"contract": "%s", "msg": {"echo": {"msg": "test"} } } }`, addr), clienttypes.NewHeight(1, 25)) - - var ack map[string]string // This can't be unmarshalled to Acknowledgement because it's fetched from the events - err := json.Unmarshal(ackBytes, &ack) - suite.Require().NoError(err) - suite.Require().NotContains(ack, "error") - suite.Require().Equal(ack["result"], "eyJjb250cmFjdF9yZXN1bHQiOiJkR2hwY3lCemFHOTFiR1FnWldOb2J3PT0iLCJpYmNfYWNrIjoiZXlKeVpYTjFiSFFpT2lKQlVUMDlJbjA9In0=") - - // Check that the token has now been transferred to the contract - balance = suite.chainA.GetQuasarApp().BankKeeper.GetBalance(suite.chainA.GetContext(), addr, localDenom) - suite.Require().Equal(sdk.NewInt(1), balance.Amount) -} - -// If the wasm call wails, the contract acknowledgement should be an error and the funds returned -func (suite *HooksTestSuite) TestFundsAreReturnedOnFailedContractExec() { - // Setup contract - suite.chainA.StoreContractCode(&suite.Suite, "./bytecode/echo.wasm") - addr := suite.chainA.InstantiateContract(&suite.Suite, "{}") - - // Check that the contract has no funds - localDenom := qtransfer.MustExtractDenomFromPacketOnRecv(suite.makeMockPacket("", "", 0, clienttypes.NewHeight(0, 100))) - balance := suite.chainA.GetQuasarApp().BankKeeper.GetBalance(suite.chainA.GetContext(), addr, localDenom) - suite.Require().Equal(sdk.NewInt(0), balance.Amount) - - // Execute the contract via IBC with a message that the contract will reject - ackBytes := suite.receivePacket(addr.String(), fmt.Sprintf(`{"wasm": {"contract": "%s", "msg": {"not_echo": {"msg": "test"} } } }`, addr), clienttypes.NewHeight(1, 25)) - - var ack map[string]string // This can't be unmarshalled to Acknowledgement because it's fetched from the events - err := json.Unmarshal(ackBytes, &ack) - suite.Require().NoError(err) - suite.Require().Contains(ack, "error") - - // Check that the token has now been transferred to the contract - balance = suite.chainA.GetQuasarApp().BankKeeper.GetBalance(suite.chainA.GetContext(), addr, localDenom) - fmt.Println(balance) - suite.Require().Equal(sdk.NewInt(0), balance.Amount) -} - -func (suite *HooksTestSuite) TestPacketsThatShouldBeSkipped() { - var sequence uint64 - receiver := suite.chainB.SenderAccount.GetAddress().String() - - testCases := []struct { - memo string - expPassthrough bool - }{ - {"", true}, - {"{01]", true}, // bad json - {"{}", true}, - {`{"something": ""}`, true}, - {`{"wasm": "test"}`, false}, - {`{"wasm": []`, true}, // invalid top level JSON - {`{"wasm": {}`, true}, // invalid top level JSON - {`{"wasm": []}`, false}, - {`{"wasm": {}}`, false}, - {`{"wasm": {"contract": "something"}}`, false}, - {`{"wasm": {"contract": "quasar1clpqr4nrk4khgkxj78fcwwh6dl3uw4epasmvnj"}}`, false}, - {`{"wasm": {"msg": "something"}}`, false}, - // invalid receiver - {`{"wasm": {"contract": "quasar1clpqr4nrk4khgkxj78fcwwh6dl3uw4epasmvnj", "msg": {}}}`, false}, - // msg not an object - {fmt.Sprintf(`{"wasm": {"contract": "%s", "msg": 1}}`, receiver), false}, - } - - for _, tc := range testCases { - ackBytes := suite.receivePacketWithSequence(receiver, tc.memo, sequence, clienttypes.NewHeight(1, 100)) - ackStr := string(ackBytes) - - var ack map[string]string // This can't be unmarshalled to Acknowledgement because it's fetched from the events - err := json.Unmarshal(ackBytes, &ack) - suite.Require().NoError(err) - if tc.expPassthrough { - suite.Require().Equal("AQ==", ack["result"], tc.memo) - } else { - suite.Require().Contains(ackStr, "error", tc.memo) - } - sequence += 1 - } -} - -// After successfully executing a wasm call, the contract should have the funds sent via IBC -func (suite *HooksTestSuite) TestFundTracking() { - // Setup contract - suite.chainA.StoreContractCode(&suite.Suite, "./bytecode/counter.wasm") - addr := suite.chainA.InstantiateContract(&suite.Suite, `{"count": 0}`) - - // Check that the contract has no funds - localDenom := qtransfer.MustExtractDenomFromPacketOnRecv(suite.makeMockPacket("", "", 0, clienttypes.NewHeight(0, 100))) - balance := suite.chainA.GetQuasarApp().BankKeeper.GetBalance(suite.chainA.GetContext(), addr, localDenom) - suite.Require().Equal(sdk.NewInt(0), balance.Amount) - - // Execute the contract via IBC - suite.receivePacket( - addr.String(), - fmt.Sprintf(`{"wasm": {"contract": "%s", "msg": {"increment": {} } } }`, addr), - clienttypes.NewHeight(1, 100), - ) - - state := suite.chainA.QueryContract( - &suite.Suite, addr, - []byte(fmt.Sprintf(`{"get_count": {"addr": "%s"}}`, types.IntermediateAccountAddress.String()))) - suite.Require().Equal(`{"count":0}`, state) - - state = suite.chainA.QueryContract( - &suite.Suite, addr, - []byte(fmt.Sprintf(`{"get_total_funds": {"addr": "%s"}}`, types.IntermediateAccountAddress))) - suite.Require().Equal(`{"total_funds":[]}`, state) - - suite.receivePacketWithSequence( - addr.String(), - fmt.Sprintf(`{"wasm": {"contract": "%s", "msg": {"increment": {} } } }`, addr), 1, clienttypes.NewHeight(1, 25)) - - state = suite.chainA.QueryContract( - &suite.Suite, addr, - []byte(fmt.Sprintf(`{"get_count": {"addr": "%s"}}`, types.IntermediateAccountAddress))) - suite.Require().Equal(`{"count":1}`, state) - - state = suite.chainA.QueryContract( - &suite.Suite, addr, - []byte(fmt.Sprintf(`{"get_total_funds": {"addr": "%s"}}`, types.IntermediateAccountAddress))) - suite.Require().Equal(`{"total_funds":[{"denom":"ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878","amount":"1"}]}`, state) - - // Check that the token has now been transferred to the contract - balance = suite.chainA.GetQuasarApp().BankKeeper.GetBalance(suite.chainA.GetContext(), addr, localDenom) - suite.Require().Equal(sdk.NewInt(2), balance.Amount) -} diff --git a/x/qtransfer/ibc_module.go b/x/qtransfer/ibc_module.go deleted file mode 100644 index 3529d52c8..000000000 --- a/x/qtransfer/ibc_module.go +++ /dev/null @@ -1,259 +0,0 @@ -package qtransfer - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" -) - -var _ porttypes.Middleware = &IBCMiddleware{} - -type IBCMiddleware struct { - App porttypes.IBCModule - ICS4Middleware *ICS4Middleware -} - -func NewIBCMiddleware(app porttypes.IBCModule, ics4 *ICS4Middleware) IBCMiddleware { - return IBCMiddleware{ - App: app, - ICS4Middleware: ics4, - } -} - -// OnChanOpenInit implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanOpenInit( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID string, - channelID string, - channelCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - version string, -) (string, error) { - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenInitOverrideHooks); ok { - return hook.OnChanOpenInitOverride(im, ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) - } - - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenInitBeforeHooks); ok { - hook.OnChanOpenInitBeforeHook(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) - } - - ver, err := im.App.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) - - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenInitAfterHooks); ok { - hook.OnChanOpenInitAfterHook(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version, err) - } - return ver, err -} - -// OnChanOpenTry implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanOpenTry( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID, - channelID string, - channelCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - counterpartyVersion string, -) (string, error) { - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenTryOverrideHooks); ok { - return hook.OnChanOpenTryOverride(im, ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) - } - - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenTryBeforeHooks); ok { - hook.OnChanOpenTryBeforeHook(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) - } - - version, err := im.App.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) - - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenTryAfterHooks); ok { - hook.OnChanOpenTryAfterHook(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion, version, err) - } - return version, err -} - -// OnChanOpenAck implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanOpenAck( - ctx sdk.Context, - portID, - channelID string, - counterpartyChannelID string, - counterpartyVersion string, -) error { - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenAckOverrideHooks); ok { - return hook.OnChanOpenAckOverride(im, ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) - } - - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenAckBeforeHooks); ok { - hook.OnChanOpenAckBeforeHook(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) - } - err := im.App.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenAckAfterHooks); ok { - hook.OnChanOpenAckAfterHook(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion, err) - } - - return err -} - -// OnChanOpenConfirm implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanOpenConfirm( - ctx sdk.Context, - portID, - channelID string, -) error { - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenConfirmOverrideHooks); ok { - return hook.OnChanOpenConfirmOverride(im, ctx, portID, channelID) - } - - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenConfirmBeforeHooks); ok { - hook.OnChanOpenConfirmBeforeHook(ctx, portID, channelID) - } - err := im.App.OnChanOpenConfirm(ctx, portID, channelID) - if hook, ok := im.ICS4Middleware.Hooks.(OnChanOpenConfirmAfterHooks); ok { - hook.OnChanOpenConfirmAfterHook(ctx, portID, channelID, err) - } - return err -} - -// OnChanCloseInit implements the IBCMiddleware interface -func (im IBCMiddleware) 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 - if hook, ok := im.ICS4Middleware.Hooks.(OnChanCloseInitOverrideHooks); ok { - return hook.OnChanCloseInitOverride(im, ctx, portID, channelID) - } - - if hook, ok := im.ICS4Middleware.Hooks.(OnChanCloseInitBeforeHooks); ok { - hook.OnChanCloseInitBeforeHook(ctx, portID, channelID) - } - err := im.App.OnChanCloseInit(ctx, portID, channelID) - if hook, ok := im.ICS4Middleware.Hooks.(OnChanCloseInitAfterHooks); ok { - hook.OnChanCloseInitAfterHook(ctx, portID, channelID, err) - } - - return err -} - -// OnChanCloseConfirm implements the IBCMiddleware interface -func (im IBCMiddleware) 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 - if hook, ok := im.ICS4Middleware.Hooks.(OnChanCloseConfirmOverrideHooks); ok { - return hook.OnChanCloseConfirmOverride(im, ctx, portID, channelID) - } - - if hook, ok := im.ICS4Middleware.Hooks.(OnChanCloseConfirmBeforeHooks); ok { - hook.OnChanCloseConfirmBeforeHook(ctx, portID, channelID) - } - err := im.App.OnChanCloseConfirm(ctx, portID, channelID) - if hook, ok := im.ICS4Middleware.Hooks.(OnChanCloseConfirmAfterHooks); ok { - hook.OnChanCloseConfirmAfterHook(ctx, portID, channelID, err) - } - - return err -} - -// OnRecvPacket implements the IBCMiddleware interface -func (im IBCMiddleware) OnRecvPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) ibcexported.Acknowledgement { - if hook, ok := im.ICS4Middleware.Hooks.(OnRecvPacketOverrideHooks); ok { - return hook.OnRecvPacketOverride(im, ctx, packet, relayer) - } - - if hook, ok := im.ICS4Middleware.Hooks.(OnRecvPacketBeforeHooks); ok { - hook.OnRecvPacketBeforeHook(ctx, packet, relayer) - } - - ack := im.App.OnRecvPacket(ctx, packet, relayer) - - if hook, ok := im.ICS4Middleware.Hooks.(OnRecvPacketAfterHooks); ok { - hook.OnRecvPacketAfterHook(ctx, packet, relayer, ack) - } - - return ack -} - -// OnAcknowledgementPacket implements the IBCMiddleware interface -func (im IBCMiddleware) OnAcknowledgementPacket( - ctx sdk.Context, - packet channeltypes.Packet, - acknowledgement []byte, - relayer sdk.AccAddress, -) error { - if hook, ok := im.ICS4Middleware.Hooks.(OnAcknowledgementPacketOverrideHooks); ok { - return hook.OnAcknowledgementPacketOverride(im, ctx, packet, acknowledgement, relayer) - } - if hook, ok := im.ICS4Middleware.Hooks.(OnAcknowledgementPacketBeforeHooks); ok { - hook.OnAcknowledgementPacketBeforeHook(ctx, packet, acknowledgement, relayer) - } - - err := im.App.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) - - if hook, ok := im.ICS4Middleware.Hooks.(OnAcknowledgementPacketAfterHooks); ok { - hook.OnAcknowledgementPacketAfterHook(ctx, packet, acknowledgement, relayer, err) - } - - return err -} - -// OnTimeoutPacket implements the IBCMiddleware interface -func (im IBCMiddleware) OnTimeoutPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) error { - if hook, ok := im.ICS4Middleware.Hooks.(OnTimeoutPacketOverrideHooks); ok { - return hook.OnTimeoutPacketOverride(im, ctx, packet, relayer) - } - - if hook, ok := im.ICS4Middleware.Hooks.(OnTimeoutPacketBeforeHooks); ok { - hook.OnTimeoutPacketBeforeHook(ctx, packet, relayer) - } - err := im.App.OnTimeoutPacket(ctx, packet, relayer) - if hook, ok := im.ICS4Middleware.Hooks.(OnTimeoutPacketAfterHooks); ok { - hook.OnTimeoutPacketAfterHook(ctx, packet, relayer, err) - } - - return err -} - -// SendPacket implements the ICS4 Wrapper interface -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.ICS4Middleware.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.ICS4Middleware.WriteAcknowledgement(ctx, chanCap, packet, ack) -} - -func (im IBCMiddleware) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { - return im.ICS4Middleware.GetAppVersion(ctx, portID, channelID) -} diff --git a/x/qtransfer/ics4_middleware.go b/x/qtransfer/ics4_middleware.go deleted file mode 100644 index 4336c32e6..000000000 --- a/x/qtransfer/ics4_middleware.go +++ /dev/null @@ -1,121 +0,0 @@ -package qtransfer - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" -) - -var _ porttypes.ICS4Wrapper = &ICS4Middleware{} - -type ICS4Middleware struct { - channel porttypes.ICS4Wrapper - - // Hooks - Hooks Hooks -} - -func NewICS4Middleware(channel porttypes.ICS4Wrapper, hooks Hooks) ICS4Middleware { - return ICS4Middleware{ - channel: channel, - Hooks: hooks, - } -} - -// For SDK47, ibc-go v7 -func (i ICS4Middleware) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - sourcePort string, sourceChannel string, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, - data []byte, -) (sequence uint64, err error) { - if hook, ok := i.Hooks.(SendPacketOverrideHooks); ok { - return hook.SendPacketOverride(i, ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) - } - - if hook, ok := i.Hooks.(SendPacketBeforeHooks); ok { - hook.SendPacketBeforeHook(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) - } - - seq, err := i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) - - if hook, ok := i.Hooks.(SendPacketAfterHooks); ok { - hook.SendPacketAfterHook(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data, err) - } - - return seq, err -} - -/* -// TODO - SDK47 -// SendPacket implements the ICS4 Wrapper interface -func (i ICS4Middleware) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - sourcePort string, - sourceChannel string, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, - data []byte, -) (sequence uint64, err error) { - // TODO - SDK47 FIX - return 0, nil - // return im.ICS4Middleware.SendPacket(ctx, chanCap, packet) -} -*/ - -/* -func (i ICS4Middleware) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error { - if hook, ok := i.Hooks.(SendPacketOverrideHooks); ok { - return hook.SendPacketOverride(i, ctx, channelCap, packet) - } - - if hook, ok := i.Hooks.(SendPacketBeforeHooks); ok { - hook.SendPacketBeforeHook(ctx, channelCap, packet) - } - - err := i.channel.SendPacket(ctx, channelCap, packet) - - if hook, ok := i.Hooks.(SendPacketAfterHooks); ok { - hook.SendPacketAfterHook(ctx, channelCap, packet, err) - } - - return err -} -*/ - -func (i ICS4Middleware) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, ack ibcexported.Acknowledgement) error { - if hook, ok := i.Hooks.(WriteAcknowledgementOverrideHooks); ok { - return hook.WriteAcknowledgementOverride(i, ctx, chanCap, packet, ack) - } - - if hook, ok := i.Hooks.(WriteAcknowledgementBeforeHooks); ok { - hook.WriteAcknowledgementBeforeHook(ctx, chanCap, packet, ack) - } - err := i.channel.WriteAcknowledgement(ctx, chanCap, packet, ack) - if hook, ok := i.Hooks.(WriteAcknowledgementAfterHooks); ok { - hook.WriteAcknowledgementAfterHook(ctx, chanCap, packet, ack, err) - } - - return err -} - -func (i ICS4Middleware) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { - if hook, ok := i.Hooks.(GetAppVersionOverrideHooks); ok { - return hook.GetAppVersionOverride(i, ctx, portID, channelID) - } - - if hook, ok := i.Hooks.(GetAppVersionBeforeHooks); ok { - hook.GetAppVersionBeforeHook(ctx, portID, channelID) - } - version, err := (i.channel).GetAppVersion(ctx, portID, channelID) - if hook, ok := i.Hooks.(GetAppVersionAfterHooks); ok { - hook.GetAppVersionAfterHook(ctx, portID, channelID, version, err) - } - - return version, err -} diff --git a/x/qtransfer/keeper/grpc_query.go b/x/qtransfer/keeper/grpc_query.go deleted file mode 100644 index d2c0aa994..000000000 --- a/x/qtransfer/keeper/grpc_query.go +++ /dev/null @@ -1,20 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -var _ types.QueryServer = Keeper{} - -func (q Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - params := q.GetParams(ctx) - - return &types.QueryParamsResponse{ - Params: params, - }, nil -} diff --git a/x/qtransfer/keeper/keeper.go b/x/qtransfer/keeper/keeper.go deleted file mode 100644 index 358ab8a4f..000000000 --- a/x/qtransfer/keeper/keeper.go +++ /dev/null @@ -1,113 +0,0 @@ -package keeper - -import ( - "errors" - "fmt" - "reflect" - - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - paramSpace paramtypes.Subspace - - accountKeeper types.AccountKeeper -} - -func NewKeeper( - cdc codec.BinaryCodec, - storeKey storetypes.StoreKey, - paramSpace paramtypes.Subspace, - accountKeeper types.AccountKeeper, -) Keeper { - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) - } - - return Keeper{ - cdc: cdc, - storeKey: storeKey, - paramSpace: paramSpace, - accountKeeper: accountKeeper, - } -} - -// CreateIntermediateAccountAccount creates an intermediate account to hold hijacked funds from transfer packets. -// It overrides an account if it exists at that address, with a non-zero sequence number & pubkey -// Note that this function should only be called once in genesis initialization. -func (k Keeper) CreateIntermediateAccountAccount(ctx sdk.Context) error { - err := canCreateModuleAccountAtAddr(ctx, k.accountKeeper, types.IntermediateAccountAddress) - if err != nil { - return err - } - - acc := k.accountKeeper.NewAccount( - ctx, - authtypes.NewModuleAccount( - authtypes.NewBaseAccountWithAddress(types.IntermediateAccountAddress), - types.IntermediateAccountAddress.String(), - ), - ) - k.accountKeeper.SetAccount(ctx, acc) - logger := k.Logger(ctx) - logger.Info("qTransfer CreateIntermediateAccountAccount", "account", acc.String()) - return nil -} - -// canCreateModuleAccountAtAddr tells us if we can safely make a module account at -// a given address. By collision resistance of the address (given API safe construction), -// the only way for an account to be already be at this address is if its claimed by the same -// pre-image from the correct module, -// or some SDK command breaks assumptions and creates an account at designated address. -// This function checks if there is an account at that address, and runs some safety checks -// to be extra-sure its not a user account (e.g. non-zero sequence, pubkey, of fore-seen account types). -// If there is no account, or if we believe its not a user-spendable account, we allow module account -// creation at the address. -// else, we do not. -// -// TODO: This is generally from an SDK design flaw -// code based off wasmd code: https://github.com/CosmWasm/wasmd/pull/996 -// Its _mandatory_ that the caller do the API safe construction to generate a module account addr, -// namely, address.Module(ModuleName, {key}) -func canCreateModuleAccountAtAddr(ctx sdk.Context, ak types.AccountKeeper, addr sdk.AccAddress) error { - existingAcct := ak.GetAccount(ctx, addr) - if existingAcct == nil { - return nil - } - if existingAcct.GetSequence() != 0 || existingAcct.GetPubKey() != nil { - return fmt.Errorf("cannot create module account %s, "+ - "due to an account at that address already existing & having sent txs", addr) - } - var overrideAccountTypes = map[reflect.Type]struct{}{ - reflect.TypeOf(&authtypes.BaseAccount{}): {}, - reflect.TypeOf(&vestingtypes.DelayedVestingAccount{}): {}, - reflect.TypeOf(&vestingtypes.ContinuousVestingAccount{}): {}, - reflect.TypeOf(&vestingtypes.BaseVestingAccount{}): {}, - reflect.TypeOf(&vestingtypes.PeriodicVestingAccount{}): {}, - reflect.TypeOf(&vestingtypes.PermanentLockedAccount{}): {}, - } - if _, clear := overrideAccountTypes[reflect.TypeOf(existingAcct)]; clear { - return nil - } - return errors.New("cannot create module account %s, " + - "due to an account at that address already existing & not being an overrideable type") -} - -// Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) -} - -func (k Keeper) GetQTransferAcc() sdk.AccAddress { - return k.accountKeeper.GetModuleAddress(types.ModuleName) -} diff --git a/x/qtransfer/keeper/params.go b/x/qtransfer/keeper/params.go deleted file mode 100644 index 43a66994f..000000000 --- a/x/qtransfer/keeper/params.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams( - k.WasmHooksEnabled(ctx), - ) -} - -// SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) -} - -// WasmHooksEnabled returns whether wasm hooks are enabled -func (k Keeper) WasmHooksEnabled(ctx sdk.Context) (res bool) { - k.paramSpace.Get(ctx, types.KeyWasmHooksEnabled, &res) - return -} diff --git a/x/qtransfer/keeper/params_test.go b/x/qtransfer/keeper/params_test.go deleted file mode 100644 index ff51d82de..000000000 --- a/x/qtransfer/keeper/params_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -func TestGetParams(t *testing.T) { - setup := testutil.NewTestSetup(t) - ctx, k := setup.Ctx, setup.Keepers.QTransfer - params := types.DefaultParams() - - k.SetParams(ctx, params) - - require.EqualValues(t, params, k.GetParams(ctx)) -} diff --git a/x/qtransfer/module.go b/x/qtransfer/module.go deleted file mode 100644 index d9e7a30a0..000000000 --- a/x/qtransfer/module.go +++ /dev/null @@ -1,157 +0,0 @@ -package qtransfer - -import ( - "context" - "encoding/json" - "fmt" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" - "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/module" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/qtransfer/client/cli" - "github.com/quasarlabs/quasarnode/x/qtransfer/keeper" - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} -) - -// AppModuleBasic defines the basic application module used by the qtransfer module. -type AppModuleBasic struct{} - -var _ module.AppModuleBasic = AppModuleBasic{} - -// Name returns the qtransfer module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -// RegisterLegacyAminoCodec registers the qtransfer module's types on the given LegacyAmino codec. -func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} - -// RegisterInterfaces registers the module's interface types. -func (b AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry) {} - -// DefaultGenesis returns default genesis state as raw bytes for the -// module. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesisState()) -} - -// ValidateGenesis performs genesis state validation for the qtransfer module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var gs types.GenesisState - if err := cdc.UnmarshalJSON(bz, &gs); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - - return gs.Validate() -} - -// RegisterRESTRoutes registers the capability module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the qtransfer module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) - if err != nil { - panic(err) - } -} - -// GetTxCmd returns no root tx command for the qtransfer module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - -// GetQueryCmd returns the root query command for the qtransfer module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -// ___________________________________________________________________________ - -// AppModule implements an application module for the qtransfer module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper -} - -// NewAppModule creates a new AppModule object. -func NewAppModule(k keeper.Keeper) AppModule { - return AppModule{ - AppModuleBasic: AppModuleBasic{}, - keeper: k, - } -} - -// Name returns the qtransfer module's name. -func (AppModule) Name() string { - return types.ModuleName -} - -// RegisterInvariants registers the qtransfer module invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -/* -// Route returns the message routing key for the qtransfer module. -func (AppModule) Route() sdk.Route { return sdk.Route{} } -*/ - -// QuerierRoute returns the module's querier route name. -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -/* -// LegacyQuerierHandler returns the x/qtransfer module's sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(sdk.Context, []string, abci.RequestQuery) ([]byte, error) { - return nil, fmt.Errorf("legacy querier not supported for the x/%s module", types.ModuleName) - } -} -*/ - -// 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) -} - -// InitGenesis performs genesis initialization for the ibc-hooks module. It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState - cdc.MustUnmarshalJSON(data, &genesisState) - InitGenesis(ctx, am.keeper, genesisState) - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the exported genesis state as raw bytes for the qtransfer -// module. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - gs := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(gs) -} - -// BeginBlock returns the begin blocker for the qtransfer module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { -} - -// EndBlock returns the end blocker for the qtransfer module. It returns no validator -// updates. -func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} - -// ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } diff --git a/x/qtransfer/testutils/Cargo.lock b/x/qtransfer/testutils/Cargo.lock deleted file mode 100644 index 6bd7576e0..000000000 --- a/x/qtransfer/testutils/Cargo.lock +++ /dev/null @@ -1,841 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "anyhow" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" - -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64ct" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "const-oid" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec318a675afcb6a1ea1d4340e2d377e56e47c266f28043ceccbf4412ddfdd3b" - -[[package]] -name = "cosmwasm-crypto" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecd74d3a0041114110d1260f77fcb644c5d2403549b37096c44f0e643a5177" -dependencies = [ - "digest 0.10.6", - "ed25519-zebra", - "k256", - "rand_core 0.6.4", - "thiserror", -] - -[[package]] -name = "cosmwasm-derive" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5abeeb891e6d0098402e4d3d042f90451db52651d2fe14b170e69a1dd3e4115" -dependencies = [ - "syn", -] - -[[package]] -name = "cosmwasm-schema" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9118e36843df6648fd0a626c46438f87038f296ec750cef3832cafc483c483f9" -dependencies = [ - "cosmwasm-schema-derive", - "schemars", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cosmwasm-schema-derive" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78d6fc9854ac14e46cb69b0f396547893f93d2847aef975950ebbe73342324f3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "cosmwasm-std" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5034c772c1369b160731aa00bb81f93733ab2884928edd8d588733d607ac5af4" -dependencies = [ - "base64", - "cosmwasm-crypto", - "cosmwasm-derive", - "derivative", - "forward_ref", - "hex", - "schemars", - "serde", - "serde-json-wasm", - "sha2 0.10.6", - "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b4c99c6479e554ef1516950f1fa3d88bd7d0a8fc2367321c07ca0a33997dfc" -dependencies = [ - "cosmwasm-std", - "serde", -] - -[[package]] -name = "counter" -version = "0.1.0" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-storage", - "cw-multi-test", - "cw-storage-plus 0.16.0", - "cw2 0.16.0", - "schemars", - "serde", - "thiserror", -] - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "cw-multi-test" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2eb84554bbfa6b66736abcd6a9bfdf237ee0ecb83910f746dff7f799093c80a" -dependencies = [ - "anyhow", - "cosmwasm-std", - "cw-storage-plus 1.0.1", - "cw-utils", - "derivative", - "itertools", - "k256", - "prost", - "schemars", - "serde", - "thiserror", -] - -[[package]] -name = "cw-storage-plus" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b6f91c0b94481a3e9ef1ceb183c37d00764f8751e39b45fc09f4d9b970d469" -dependencies = [ - "cosmwasm-std", - "schemars", - "serde", -] - -[[package]] -name = "cw-storage-plus" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053a5083c258acd68386734f428a5a171b29f7d733151ae83090c6fcc9417ffa" -dependencies = [ - "cosmwasm-std", - "schemars", - "serde", -] - -[[package]] -name = "cw-utils" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c80e93d1deccb8588db03945016a292c3c631e6325d349ebb35d2db6f4f946f7" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw2 1.0.1", - "schemars", - "semver", - "serde", - "thiserror", -] - -[[package]] -name = "cw2" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91398113b806f4d2a8d5f8d05684704a20ffd5968bf87e3473e1973710b884ad" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus 0.16.0", - "schemars", - "serde", -] - -[[package]] -name = "cw2" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb70cee2cf0b4a8ff7253e6bc6647107905e8eb37208f87d54f67810faa62f8" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus 1.0.1", - "schemars", - "serde", -] - -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer 0.10.3", - "crypto-common", - "subtle", -] - -[[package]] -name = "dyn-clone" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60" - -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der", - "elliptic-curve", - "rfc6979", - "signature", -] - -[[package]] -name = "echo" -version = "0.1.0" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-storage", - "cw-multi-test", - "cw-storage-plus 0.16.0", - "schemars", - "serde", - "thiserror", -] - -[[package]] -name = "ed25519-zebra" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" -dependencies = [ - "curve25519-dalek", - "hashbrown", - "hex", - "rand_core 0.6.4", - "serde", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct", - "crypto-bigint", - "der", - "digest 0.10.6", - "ff", - "generic-array", - "group", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "forward_ref" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.6", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" - -[[package]] -name = "k256" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.6", -] - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "once_cell" -version = "1.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "proc-macro2" -version = "1.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "quote" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", -] - -[[package]] -name = "ryu" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" - -[[package]] -name = "schemars" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5fb6c61f29e723026dc8e923d94c694313212abbecbbe5f55a7748eec5b307" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn", -] - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "semver" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" - -[[package]] -name = "serde" -version = "1.0.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-json-wasm" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15bee9b04dd165c3f4e142628982ddde884c2022a89e8ddf99c4829bf2c3a58" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_derive_internals" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.6", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.6", - "rand_core 0.6.4", -] - -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "zeroize" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" diff --git a/x/qtransfer/testutils/Cargo.toml b/x/qtransfer/testutils/Cargo.toml deleted file mode 100644 index 9e4bf04d4..000000000 --- a/x/qtransfer/testutils/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[workspace] - -members = [ - 'contracts/*', -] - -[profile.release] -codegen-units = 1 -debug = false -debug-assertions = false -incremental = false -lto = true -opt-level = 3 -overflow-checks = true -panic = 'abort' -rpath = false diff --git a/x/qtransfer/testutils/chain.go b/x/qtransfer/testutils/chain.go deleted file mode 100644 index 5dc78cda4..000000000 --- a/x/qtransfer/testutils/chain.go +++ /dev/null @@ -1,41 +0,0 @@ -package testutils - -import ( - "encoding/json" - - dbm "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/testutil/sims" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - - "github.com/quasarlabs/quasarnode/app" -) - -type TestChain struct { - *ibctesting.TestChain -} - -func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { - db := dbm.NewMemDB() - encCdc := app.MakeEncodingConfig() - quasarApp := app.New( - log.NewNopLogger(), - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 5, - encCdc, - sims.EmptyAppOptions{}, - app.EmptyWasmOpts, - ) - - return quasarApp, app.NewDefaultGenesisState(encCdc.Marshaler) -} - -// GetQuasarApp returns the current chain's app as an QuasarApp -func (chain *TestChain) GetQuasarApp() *app.QuasarApp { - v, _ := chain.App.(*app.QuasarApp) - return v -} diff --git a/x/qtransfer/testutils/contracts/counter/Cargo.toml b/x/qtransfer/testutils/contracts/counter/Cargo.toml deleted file mode 100644 index 9161f3414..000000000 --- a/x/qtransfer/testutils/contracts/counter/Cargo.toml +++ /dev/null @@ -1,43 +0,0 @@ -[package] -name = "counter" -description = "Cosmwasm counter dapp, with permissions for testing Quasar wasmhooks" -version = "0.1.0" -authors = ["osmosis contributors"] -edition = "2021" - -exclude = [ - # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. - "contract.wasm", - "hash.txt", -] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -crate-type = ["cdylib", "rlib"] - -[features] -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces"] -# use library feature to disable all instantiate/execute/query exports -library = [] - -[package.metadata.scripts] -optimize = """docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.6 -""" - -[dependencies] -cosmwasm-schema = "1.1.3" -cosmwasm-std = "1.1.3" -cosmwasm-storage = "1.1.3" -cw-storage-plus = "0.16.0" -cw2 = "0.16.0" -schemars = "0.8.10" -serde = { version = "1.0.145", default-features = false, features = ["derive"] } -thiserror = { version = "1.0.31" } - -[dev-dependencies] -cw-multi-test = "0.16.0" diff --git a/x/qtransfer/testutils/contracts/counter/README.md b/x/qtransfer/testutils/contracts/counter/README.md deleted file mode 100644 index d13630eb5..000000000 --- a/x/qtransfer/testutils/contracts/counter/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Counter - -This contract is a modification of the standard cosmwasm `counter` contract. -Namely it tracks a counter, _by sender_. -This is done to let us be able to test wasmhooks in Quasar better. - -This contract tracks any funds sent to it by adding it to the state under the `sender` key. - -This way we can verify that, independently of the sender, the funds will end up under the -`WasmHooksModuleAccount` address when the contract is executed via an IBC send that goes -through the wasmhooks module. diff --git a/x/qtransfer/testutils/contracts/counter/src/contract.rs b/x/qtransfer/testutils/contracts/counter/src/contract.rs deleted file mode 100644 index d9aa25971..000000000 --- a/x/qtransfer/testutils/contracts/counter/src/contract.rs +++ /dev/null @@ -1,287 +0,0 @@ -use std::collections::HashMap; - -#[cfg(not(feature = "library"))] -use cosmwasm_std::entry_point; -use cosmwasm_std::{ - to_binary, Binary, Coin, Deps, DepsMut, Env, MessageInfo, Response, StdResult, Uint128, -}; -use cw2::set_contract_version; - -use crate::error::ContractError; -use crate::msg::*; -use crate::state::{Counter, COUNTERS}; - -// version info for migration info -const CONTRACT_NAME: &str = "quasar:permissioned_counter"; -const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); - -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn instantiate( - deps: DepsMut, - _env: Env, - info: MessageInfo, - msg: InstantiateMsg, -) -> Result { - set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; - let initial_counter = Counter { - count: msg.count, - total_funds: vec![], - owner: info.sender.clone(), - }; - COUNTERS.save(deps.storage, info.sender.clone(), &initial_counter)?; - - Ok(Response::new() - .add_attribute("method", "instantiate") - .add_attribute("owner", info.sender) - .add_attribute("count", msg.count.to_string())) -} - -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn execute( - deps: DepsMut, - _env: Env, - info: MessageInfo, - msg: ExecuteMsg, -) -> Result { - match msg { - ExecuteMsg::Increment {} => execute::increment(deps, info), - ExecuteMsg::Reset { count } => execute::reset(deps, info, count), - } -} - -pub mod execute { - use super::*; - - pub fn increment(deps: DepsMut, info: MessageInfo) -> Result { - COUNTERS.update( - deps.storage, - info.sender.clone(), - |state| -> Result<_, ContractError> { - match state { - None => Ok(Counter { - count: 0, - total_funds: vec![], - owner: info.sender.clone(), - }), - Some(counter) => Ok(Counter { - count: counter.count + 1, - total_funds: naive_add_coins(&info.funds, &counter.total_funds), - owner: info.sender.clone(), - }), - } - }, - )?; - - Ok(Response::new().add_attribute("action", "increment")) - } - - pub fn reset(deps: DepsMut, info: MessageInfo, count: i32) -> Result { - COUNTERS.update( - deps.storage, - info.sender.clone(), - |state| -> Result<_, ContractError> { - match state { - None => Err(ContractError::Unauthorized {}), - Some(state) if state.owner != info.sender.clone() => { - Err(ContractError::Unauthorized {}) - } - _ => Ok(Counter { - count, - total_funds: vec![], - owner: info.sender.clone(), - }), - } - }, - )?; - Ok(Response::new().add_attribute("action", "reset")) - } -} - -pub fn naive_add_coins(lhs: &Vec, rhs: &Vec) -> Vec { - // This is a naive, inneficient implementation of Vec addition. - // This shouldn't be used in production but serves our purpose for this - // testing contract - let mut coins: HashMap = HashMap::new(); - for coin in lhs { - coins.insert(coin.denom.clone(), coin.amount); - } - - - for coin in rhs { - coins - .entry(coin.denom.clone()) - .and_modify(|e| *e += coin.amount) - .or_insert(coin.amount); - } - coins.iter().map(|(d, &a)| Coin::new(a.into(), d)).collect() -} - -#[test] -fn coin_addition() { - let c1 = vec![Coin::new(1, "a"), Coin::new(2, "b")]; - let c2 = vec![Coin::new(7, "a"), Coin::new(2, "c")]; - - let mut sum = naive_add_coins(&c1, &c1); - sum.sort_by(|a, b| a.denom.cmp(&b.denom)); - assert_eq!(sum, vec![Coin::new(2, "a"), Coin::new(4, "b")]); - - let mut sum = naive_add_coins(&c1, &c2); - sum.sort_by(|a, b| a.denom.cmp(&b.denom)); - assert_eq!( - sum, - vec![Coin::new(8, "a"), Coin::new(2, "b"), Coin::new(2, "c"),] - ); - - let mut sum = naive_add_coins(&c2, &c2); - sum.sort_by(|a, b| a.denom.cmp(&b.denom)); - assert_eq!(sum, vec![Coin::new(14, "a"), Coin::new(4, "c"),]); - - let mut sum = naive_add_coins(&c2, &c1); - sum.sort_by(|a, b| a.denom.cmp(&b.denom)); - assert_eq!( - sum, - vec![Coin::new(8, "a"), Coin::new(2, "b"), Coin::new(2, "c"),] - ); - - let mut sum = naive_add_coins(&vec![], &c2); - sum.sort_by(|a, b| a.denom.cmp(&b.denom)); - assert_eq!(sum, c2); - - let mut sum = naive_add_coins(&c2, &vec![]); - sum.sort_by(|a, b| a.denom.cmp(&b.denom)); - assert_eq!(sum, c2); -} - -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { - match msg { - QueryMsg::GetCount { addr } => to_binary(&query::count(deps, addr)?), - QueryMsg::GetTotalFunds { addr } => to_binary(&query::total_funds(deps, addr)?), - } -} - -pub mod query { - use cosmwasm_std::Addr; - - use super::*; - - pub fn count(deps: Deps, addr: Addr) -> StdResult { - let state = COUNTERS.load(deps.storage, addr)?; - Ok(GetCountResponse { count: state.count }) - } - - pub fn total_funds(deps: Deps, addr: Addr) -> StdResult { - let state = COUNTERS.load(deps.storage, addr)?; - Ok(GetTotalFundsResponse { - total_funds: state.total_funds, - }) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; - use cosmwasm_std::Addr; - use cosmwasm_std::{coins, from_binary}; - - #[test] - fn proper_initialization() { - let mut deps = mock_dependencies(); - - let msg = InstantiateMsg { count: 17 }; - let info = mock_info("creator", &coins(1000, "earth")); - - // we can just call .unwrap() to assert this was a success - let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - assert_eq!(0, res.messages.len()); - - // it worked, let's query the state - let res = query( - deps.as_ref(), - mock_env(), - QueryMsg::GetCount { - addr: Addr::unchecked("creator"), - }, - ) - .unwrap(); - let value: GetCountResponse = from_binary(&res).unwrap(); - assert_eq!(17, value.count); - } - - #[test] - fn increment() { - let mut deps = mock_dependencies(); - - let msg = InstantiateMsg { count: 17 }; - let info = mock_info("creator", &coins(2, "token")); - let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - - let msg = InstantiateMsg { count: 17 }; - let info = mock_info("someone-else", &coins(2, "token")); - let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - - let info = mock_info("creator", &coins(2, "token")); - let msg = ExecuteMsg::Increment {}; - let _res = execute(deps.as_mut(), mock_env(), info, msg).unwrap(); - - // should increase counter by 1 - let res = query( - deps.as_ref(), - mock_env(), - QueryMsg::GetCount { - addr: Addr::unchecked("creator"), - }, - ) - .unwrap(); - let value: GetCountResponse = from_binary(&res).unwrap(); - assert_eq!(18, value.count); - - // Counter for someone else is not incremented - let res = query( - deps.as_ref(), - mock_env(), - QueryMsg::GetCount { - addr: Addr::unchecked("someone-else"), - }, - ) - .unwrap(); - let value: GetCountResponse = from_binary(&res).unwrap(); - assert_eq!(17, value.count); - } - - #[test] - fn reset() { - let mut deps = mock_dependencies(); - - let msg = InstantiateMsg { count: 17 }; - let info = mock_info("creator", &coins(2, "token")); - let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - - // beneficiary can release it - let unauth_info = mock_info("anyone", &coins(2, "token")); - let msg = ExecuteMsg::Reset { count: 5 }; - let res = execute(deps.as_mut(), mock_env(), unauth_info, msg); - match res { - Err(ContractError::Unauthorized {}) => {} - _ => panic!("Must return unauthorized error"), - } - - // only the original creator can reset the counter - let auth_info = mock_info("creator", &coins(2, "token")); - let msg = ExecuteMsg::Reset { count: 5 }; - let _res = execute(deps.as_mut(), mock_env(), auth_info, msg).unwrap(); - - // should now be 5 - let res = query( - deps.as_ref(), - mock_env(), - QueryMsg::GetCount { - addr: Addr::unchecked("creator"), - }, - ) - .unwrap(); - let value: GetCountResponse = from_binary(&res).unwrap(); - assert_eq!(5, value.count); - } -} diff --git a/x/qtransfer/testutils/contracts/counter/src/error.rs b/x/qtransfer/testutils/contracts/counter/src/error.rs deleted file mode 100644 index 3caf0c5c5..000000000 --- a/x/qtransfer/testutils/contracts/counter/src/error.rs +++ /dev/null @@ -1,16 +0,0 @@ -use cosmwasm_std::StdError; -use thiserror::Error; - -#[derive(Error, Debug)] -pub enum ContractError { - #[error("{0}")] - Std(#[from] StdError), - - #[error("Unauthorized")] - Unauthorized {}, - - #[error("Custom Error val: {val:?}")] - CustomError { val: String }, - // Add any other custom errors you like here. - // Look at https://docs.rs/thiserror/1.0.21/thiserror/ for details. -} diff --git a/x/qtransfer/testutils/contracts/counter/src/helpers.rs b/x/qtransfer/testutils/contracts/counter/src/helpers.rs deleted file mode 100644 index c943c1365..000000000 --- a/x/qtransfer/testutils/contracts/counter/src/helpers.rs +++ /dev/null @@ -1,48 +0,0 @@ -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; - -use cosmwasm_std::{ - to_binary, Addr, Coin, CosmosMsg, CustomQuery, Querier, QuerierWrapper, StdResult, WasmMsg, - WasmQuery, -}; - -use crate::msg::{ExecuteMsg, GetCountResponse, QueryMsg}; - -/// CwTemplateContract is a wrapper around Addr that provides a lot of helpers -/// for working with this. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -pub struct CwTemplateContract(pub Addr); - -impl CwTemplateContract { - pub fn addr(&self) -> Addr { - self.0.clone() - } - - pub fn call>(&self, msg: T) -> StdResult { - let msg = to_binary(&msg.into())?; - Ok(WasmMsg::Execute { - contract_addr: self.addr().into(), - msg, - funds: vec![], - } - .into()) - } - - /// Get Count - pub fn count(&self, querier: &Q, addr: Addr) -> StdResult - where - Q: Querier, - T: Into, - CQ: CustomQuery, - { - let msg = QueryMsg::GetCount { addr }; - let query = WasmQuery::Smart { - contract_addr: self.addr().into(), - msg: to_binary(&msg)?, - } - .into(); - let res: GetCountResponse = QuerierWrapper::::new(querier).query(&query)?; - Ok(res) - } -} - diff --git a/x/qtransfer/testutils/contracts/counter/src/integration_tests.rs b/x/qtransfer/testutils/contracts/counter/src/integration_tests.rs deleted file mode 100644 index 4c5078465..000000000 --- a/x/qtransfer/testutils/contracts/counter/src/integration_tests.rs +++ /dev/null @@ -1,71 +0,0 @@ -#[cfg(test)] -mod tests { - use crate::helpers::CwTemplateContract; - use crate::msg::InstantiateMsg; - use cosmwasm_std::{Addr, Coin, Empty, Uint128}; - use cw_multi_test::{App, AppBuilder, Contract, ContractWrapper, Executor}; - - pub fn contract_template() -> Box> { - let contract = ContractWrapper::new( - crate::contract::execute, - crate::contract::instantiate, - crate::contract::query, - ); - Box::new(contract) - } - - const USER: &str = "USER"; - const ADMIN: &str = "ADMIN"; - const NATIVE_DENOM: &str = "denom"; - - fn mock_app() -> App { - AppBuilder::new().build(|router, _, storage| { - router - .bank - .init_balance( - storage, - &Addr::unchecked(USER), - vec![Coin { - denom: NATIVE_DENOM.to_string(), - amount: Uint128::new(1), - }], - ) - .unwrap(); - }) - } - - fn proper_instantiate() -> (App, CwTemplateContract) { - let mut app = mock_app(); - let cw_template_id = app.store_code(contract_template()); - - let msg = InstantiateMsg { count: 1i32 }; - let cw_template_contract_addr = app - .instantiate_contract( - cw_template_id, - Addr::unchecked(ADMIN), - &msg, - &[], - "test", - None, - ) - .unwrap(); - - let cw_template_contract = CwTemplateContract(cw_template_contract_addr); - - (app, cw_template_contract) - } - - mod count { - use super::*; - use crate::msg::ExecuteMsg; - - #[test] - fn count() { - let (mut app, cw_template_contract) = proper_instantiate(); - - let msg = ExecuteMsg::Increment {}; - let cosmos_msg = cw_template_contract.call(msg).unwrap(); - app.execute(Addr::unchecked(USER), cosmos_msg).unwrap(); - } - } -} diff --git a/x/qtransfer/testutils/contracts/counter/src/lib.rs b/x/qtransfer/testutils/contracts/counter/src/lib.rs deleted file mode 100644 index ffd1f6ac4..000000000 --- a/x/qtransfer/testutils/contracts/counter/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![allow(unused_imports)] -pub mod contract; -mod error; -pub mod helpers; -pub mod integration_tests; -pub mod msg; -pub mod state; - -pub use crate::error::ContractError; diff --git a/x/qtransfer/testutils/contracts/counter/src/msg.rs b/x/qtransfer/testutils/contracts/counter/src/msg.rs deleted file mode 100644 index 6c29fdf25..000000000 --- a/x/qtransfer/testutils/contracts/counter/src/msg.rs +++ /dev/null @@ -1,34 +0,0 @@ -use cosmwasm_schema::{cw_serde, QueryResponses}; -use cosmwasm_std::{Addr, Coin}; - -#[cw_serde] -pub struct InstantiateMsg { - pub count: i32, -} - -#[cw_serde] -pub enum ExecuteMsg { - Increment {}, - Reset { count: i32 }, -} - -#[cw_serde] -#[derive(QueryResponses)] -pub enum QueryMsg { - // GetCount returns the current count as a json-encoded number - #[returns(GetCountResponse)] - GetCount { addr: Addr }, - #[returns(GetTotalFundsResponse)] - GetTotalFunds { addr: Addr }, -} - -// We define a custom struct for each query response -#[cw_serde] -pub struct GetCountResponse { - pub count: i32, -} - -#[cw_serde] -pub struct GetTotalFundsResponse { - pub total_funds: Vec, -} diff --git a/x/qtransfer/testutils/contracts/counter/src/state.rs b/x/qtransfer/testutils/contracts/counter/src/state.rs deleted file mode 100644 index 4b8002fc4..000000000 --- a/x/qtransfer/testutils/contracts/counter/src/state.rs +++ /dev/null @@ -1,14 +0,0 @@ -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; - -use cosmwasm_std::{Addr, Coin}; -use cw_storage_plus::{Item, Map}; - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -pub struct Counter { - pub count: i32, - pub total_funds: Vec, - pub owner: Addr, -} - -pub const COUNTERS: Map = Map::new("state"); diff --git a/x/qtransfer/testutils/contracts/echo/Cargo.toml b/x/qtransfer/testutils/contracts/echo/Cargo.toml deleted file mode 100644 index 6980ce8cb..000000000 --- a/x/qtransfer/testutils/contracts/echo/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "echo" -description = "Cosmwasm contract that always returns the same response" -version = "0.1.0" -authors = ["osmosis contributors"] -edition = "2021" - -exclude = [ - # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. - "contract.wasm", - "hash.txt", -] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -crate-type = ["cdylib", "rlib"] - -[features] -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces"] -# use library feature to disable all instantiate/execute/query exports -library = [] - -[package.metadata.scripts] -optimize = """docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.6 -""" - -[dependencies] -cosmwasm-schema = "1.1.3" -cosmwasm-std = "1.1.3" -cosmwasm-storage = "1.1.3" -cw-storage-plus = "0.16.0" -schemars = "0.8.10" -serde = { version = "1.0.145", default-features = false, features = ["derive"] } -thiserror = { version = "1.0.31" } - -[dev-dependencies] -cw-multi-test = "0.16.0" diff --git a/x/qtransfer/testutils/contracts/echo/src/lib.rs b/x/qtransfer/testutils/contracts/echo/src/lib.rs deleted file mode 100644 index ab1d16a3a..000000000 --- a/x/qtransfer/testutils/contracts/echo/src/lib.rs +++ /dev/null @@ -1,42 +0,0 @@ -#[cfg(not(feature = "library"))] -use cosmwasm_std::entry_point; -use cosmwasm_std::{DepsMut, Env, MessageInfo, Response, StdError}; -use cosmwasm_schema::{cw_serde}; - -// Messages -#[cw_serde] -pub struct InstantiateMsg {} - -#[cw_serde] -pub enum ExecuteMsg { - Echo { msg: String }, -} - -// Instantiate -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn instantiate( - _deps: DepsMut, - _env: Env, - _info: MessageInfo, - _msg: InstantiateMsg, -) -> Result { - Ok(Response::new()) -} - -// Execute -fn simple_response(msg: String) -> Response { - Response::new() - .add_attribute("echo", msg) - .set_data(b"this should echo") -} -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn execute( - _deps: DepsMut, - _env: Env, - _info: MessageInfo, - msg: ExecuteMsg, -) -> Result { - match msg { - ExecuteMsg::Echo { msg } => Ok(simple_response(msg)), - } -} diff --git a/x/qtransfer/testutils/testing_hooks.go b/x/qtransfer/testutils/testing_hooks.go deleted file mode 100644 index d7847492a..000000000 --- a/x/qtransfer/testutils/testing_hooks.go +++ /dev/null @@ -1,39 +0,0 @@ -package testutils - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - - "github.com/quasarlabs/quasarnode/x/qtransfer" -) - -var ( - _ qtransfer.Hooks = TestRecvOverrideHooks{} - _ qtransfer.Hooks = TestRecvBeforeAfterHooks{} -) - -type Status struct { - OverrideRan bool - BeforeRan bool - AfterRan bool -} - -// Recv -type TestRecvOverrideHooks struct{ Status *Status } - -func (t TestRecvOverrideHooks) OnRecvPacketOverride(im qtransfer.IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) ibcexported.Acknowledgement { - t.Status.OverrideRan = true - ack := im.App.OnRecvPacket(ctx, packet, relayer) - return ack -} - -type TestRecvBeforeAfterHooks struct{ Status *Status } - -func (t TestRecvBeforeAfterHooks) OnRecvPacketBeforeHook(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) { - t.Status.BeforeRan = true -} - -func (t TestRecvBeforeAfterHooks) OnRecvPacketAfterHook(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ack ibcexported.Acknowledgement) { - t.Status.AfterRan = true -} diff --git a/x/qtransfer/testutils/wasm.go b/x/qtransfer/testutils/wasm.go deleted file mode 100644 index d20c325e4..000000000 --- a/x/qtransfer/testutils/wasm.go +++ /dev/null @@ -1,75 +0,0 @@ -package testutils - -import ( - "fmt" - "os" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - "github.com/stretchr/testify/suite" -) - -func (chain *TestChain) StoreContractCode(suite *suite.Suite, path string) { - quasarApp := chain.GetQuasarApp() - wasmCode, err := os.ReadFile(path) - suite.Require().NoError(err) - - addr := quasarApp.AccountKeeper.GetModuleAddress(govtypes.ModuleName) - msg := &wasmtypes.MsgStoreCode{ - Sender: addr.String(), - WASMByteCode: wasmCode, - InstantiatePermission: &wasmtypes.AccessConfig{ - Permission: 3, - }, - } - handler := quasarApp.GovKeeper.Router().Handler(msg) - - defer func() { - if r := recover(); r != nil { - err = fmt.Errorf("handling x/gov proposal msg [%s] PANICKED: %v", msg, r) - } - }() - _, err = handler(chain.GetContext(), msg) - - suite.Require().NoError(err) -} - -func (chain *TestChain) InstantiateRLContract(suite *suite.Suite, quotas string) sdk.AccAddress { - quasarApp := chain.GetQuasarApp() - transferModule := quasarApp.AccountKeeper.GetModuleAddress(transfertypes.ModuleName) - govModule := quasarApp.AccountKeeper.GetModuleAddress(govtypes.ModuleName) - - initMsgBz := []byte(fmt.Sprintf(`{ - "gov_module": "%s", - "ibc_module":"%s", - "paths": [%s] - }`, - govModule, transferModule, quotas)) - - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(quasarApp.WasmKeeper) - codeID := uint64(1) - creator := quasarApp.AccountKeeper.GetModuleAddress(govtypes.ModuleName) - addr, _, err := contractKeeper.Instantiate(chain.GetContext(), codeID, creator, creator, initMsgBz, "rate limiting contract", nil) - suite.Require().NoError(err) - return addr -} - -func (chain *TestChain) InstantiateContract(suite *suite.Suite, msg string) sdk.AccAddress { - quasarApp := chain.GetQuasarApp() - contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(quasarApp.WasmKeeper) - codeID := uint64(1) - creator := quasarApp.AccountKeeper.GetModuleAddress(govtypes.ModuleName) - addr, _, err := contractKeeper.Instantiate(chain.GetContext(), codeID, creator, creator, []byte(msg), "contract", nil) - suite.Require().NoError(err) - return addr -} - -func (chain *TestChain) QueryContract(suite *suite.Suite, contract sdk.AccAddress, key []byte) string { - quasarApp := chain.GetQuasarApp() - state, err := quasarApp.WasmKeeper.QuerySmart(chain.GetContext(), contract, key) - suite.Require().NoError(err) - return string(state) -} diff --git a/x/qtransfer/types/codec.go b/x/qtransfer/types/codec.go deleted file mode 100644 index b2175ba1b..000000000 --- a/x/qtransfer/types/codec.go +++ /dev/null @@ -1,11 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" -) - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) diff --git a/x/qtransfer/types/errors.go b/x/qtransfer/types/errors.go deleted file mode 100644 index fc42bd1ee..000000000 --- a/x/qtransfer/types/errors.go +++ /dev/null @@ -1,10 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" -) - -var ( - ErrInvalidMetadataFormat = errorsmod.New(ModuleName, 2, "invalid metadata format") - ErrBadExecutionMsg = "cannot execute contract: %v" -) diff --git a/x/qtransfer/types/expected_keepers.go b/x/qtransfer/types/expected_keepers.go deleted file mode 100644 index 94478af96..000000000 --- a/x/qtransfer/types/expected_keepers.go +++ /dev/null @@ -1,14 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -type AccountKeeper interface { - NewAccount(sdk.Context, authtypes.AccountI) authtypes.AccountI - - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI - SetAccount(ctx sdk.Context, acc authtypes.AccountI) - GetModuleAddress(moduleName string) sdk.AccAddress -} diff --git a/x/qtransfer/types/genesis.go b/x/qtransfer/types/genesis.go deleted file mode 100644 index 3227265d5..000000000 --- a/x/qtransfer/types/genesis.go +++ /dev/null @@ -1,21 +0,0 @@ -package types - -// NewGenesisState creates a new qtransfer GenesisState instance. -func NewGenesisState(params Params) *GenesisState { - return &GenesisState{ - Params: params, - } -} - -// DefaultGenesisState returns the default GenesisState with wasm hooks enabled. -func DefaultGenesisState() *GenesisState { - return &GenesisState{ - Params: DefaultParams(), - } -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - return gs.Params.Validate() -} diff --git a/x/qtransfer/types/genesis.pb.go b/x/qtransfer/types/genesis.pb.go deleted file mode 100644 index 06cbd4805..000000000 --- a/x/qtransfer/types/genesis.pb.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qtransfer/genesis.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 - -// GenesisState defines the qtransfer module's genesis state. -type GenesisState struct { - 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_e48da0e7cf6fa302, []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), "quasarlabs.quasarnode.qtransfer.GenesisState") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qtransfer/genesis.proto", fileDescriptor_e48da0e7cf6fa302) -} - -var fileDescriptor_e48da0e7cf6fa302 = []byte{ - // 200 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2d, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x0b, 0x4b, - 0x8a, 0x12, 0xf3, 0x8a, 0xd3, 0x52, 0x8b, 0xf4, 0xd3, 0x53, 0xf3, 0x52, 0x8b, 0x33, 0x8b, 0xf5, - 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xe4, 0x11, 0xca, 0xf5, 0x10, 0xca, 0xf5, 0xe0, 0xca, 0xa5, - 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x6a, 0xf5, 0x41, 0x2c, 0x88, 0x36, 0x29, 0x1d, 0x42, 0xb6, - 0x14, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x2d, 0x51, 0x0a, 0xe5, 0xe2, 0x71, 0x87, 0xd8, 0x1a, 0x5c, - 0x92, 0x58, 0x92, 0x2a, 0xe4, 0xca, 0xc5, 0x06, 0x91, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, - 0x52, 0xd7, 0x23, 0xe0, 0x0a, 0xbd, 0x00, 0xb0, 0x72, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, - 0xa0, 0x9a, 0x9d, 0x7c, 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, 0xca, 0x28, - 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xbb, 0x4b, 0x2b, 0x90, 0xdc, - 0x5a, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xab, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, - 0x9f, 0x6a, 0x80, 0xff, 0x41, 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/qtransfer/types/keys.go b/x/qtransfer/types/keys.go deleted file mode 100644 index a7743a9e4..000000000 --- a/x/qtransfer/types/keys.go +++ /dev/null @@ -1,22 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" -) - -const ( - // ModuleName is the name of the module - ModuleName = "qtransfer" - - // StoreKey is string representation of the store key for qtransfer - StoreKey = ModuleName - - // QuerierRoute is the querier route for the qtransfer module - QuerierRoute = ModuleName -) - -var ( - // IntermediateAccountAddress is the address of the intermediate account - IntermediateAccountAddress sdk.AccAddress = address.Module(ModuleName, []byte("wasm-hooks intermediate account")) -) diff --git a/x/qtransfer/types/params.go b/x/qtransfer/types/params.go deleted file mode 100644 index 64a392950..000000000 --- a/x/qtransfer/types/params.go +++ /dev/null @@ -1,70 +0,0 @@ -package types - -import ( - "fmt" - "gopkg.in/yaml.v2" - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -var _ paramtypes.ParamSet = (*Params)(nil) - -var ( - // DefaultWasmHooksEnabled is the default value for WasmHooksEnabled - DefaultWasmHooksEnabled = true -) - -var ( - // KeyWasmHooksEnabled is parameter store key for WasmHooksEnabled - KeyWasmHooksEnabled = []byte("WasmHooksEnabled") -) - -// ParamKeyTable for qtransfer module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// NewParams creates a new Params instance -func NewParams(wasmHooksEnabled bool) Params { - return Params{ - WasmHooksEnabled: wasmHooksEnabled, - } -} - -// DefaultParams defines the parameters for this module -func DefaultParams() Params { - return Params{ - WasmHooksEnabled: DefaultWasmHooksEnabled, - } -} - -// ParamSetPairs implements the ParamSet interface and returns all the key/value pairs -// qtransfer module's parameters. -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyWasmHooksEnabled, &p.WasmHooksEnabled, validateEnabled), - } -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} - -// Validate validates the set of params -func (p Params) Validate() error { - if err := validateEnabled(p.WasmHooksEnabled); err != nil { - return err - } - return nil -} - -// validateEnabled is used to validate the enabled param type. -func validateEnabled(i interface{}) error { - _, ok := i.(bool) - if !ok { - return fmt.Errorf("invalid qtransfer enabled parameter type: %T", i) - } - return nil -} diff --git a/x/qtransfer/types/params.pb.go b/x/qtransfer/types/params.pb.go deleted file mode 100644 index 9039d096c..000000000 --- a/x/qtransfer/types/params.pb.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qtransfer/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 module. -type Params struct { - WasmHooksEnabled bool `protobuf:"varint,1,opt,name=wasm_hooks_enabled,json=wasmHooksEnabled,proto3" json:"wasm_hooks_enabled,omitempty" yaml:"wasm_hooks_enabled"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_7b3bb33d24a61422, []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) GetWasmHooksEnabled() bool { - if m != nil { - return m.WasmHooksEnabled - } - return false -} - -func init() { - proto.RegisterType((*Params)(nil), "quasarlabs.quasarnode.qtransfer.Params") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qtransfer/params.proto", fileDescriptor_7b3bb33d24a61422) -} - -var fileDescriptor_7b3bb33d24a61422 = []byte{ - // 212 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x29, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x0b, 0x4b, - 0x8a, 0x12, 0xf3, 0x8a, 0xd3, 0x52, 0x8b, 0xf4, 0x0b, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0xf5, 0x0a, - 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xe4, 0x11, 0xaa, 0xf5, 0x10, 0xaa, 0xf5, 0xe0, 0xaa, 0xa5, 0x44, - 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x6a, 0xf5, 0x41, 0x2c, 0x88, 0x36, 0xa5, 0x68, 0x2e, 0xb6, 0x00, - 0xb0, 0x31, 0x42, 0xde, 0x5c, 0x42, 0xe5, 0x89, 0xc5, 0xb9, 0xf1, 0x19, 0xf9, 0xf9, 0xd9, 0xc5, - 0xf1, 0xa9, 0x79, 0x89, 0x49, 0x39, 0xa9, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x1c, 0x4e, 0xb2, - 0x9f, 0xee, 0xc9, 0x4b, 0x56, 0x26, 0xe6, 0xe6, 0x58, 0x29, 0x61, 0xaa, 0x51, 0x0a, 0x12, 0x00, - 0x09, 0x7a, 0x80, 0xc4, 0x5c, 0x21, 0x42, 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x38, 0xf9, 0x9c, - 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, - 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x76, 0x6f, 0x56, 0x20, 0x79, 0xb4, 0xa4, 0xb2, 0x20, 0xb5, - 0x38, 0x89, 0x0d, 0xec, 0x62, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x0f, 0xf7, 0x40, - 0x18, 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 m.WasmHooksEnabled { - i-- - if m.WasmHooksEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - 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 - if m.WasmHooksEnabled { - n += 2 - } - 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WasmHooksEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.WasmHooksEnabled = bool(v != 0) - 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/qtransfer/types/query.pb.go b/x/qtransfer/types/query.pb.go deleted file mode 100644 index fdc57f839..000000000 --- a/x/qtransfer/types/query.pb.go +++ /dev/null @@ -1,542 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qtransfer/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - _ "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 - -// QueryParamsRequest is 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_8aa6b037e8bfa021, []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 - -// QueryParamsResponse is 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"` -} - -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_8aa6b037e8bfa021, []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), "quasarlabs.quasarnode.qtransfer.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "quasarlabs.quasarnode.qtransfer.QueryParamsResponse") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qtransfer/query.proto", fileDescriptor_8aa6b037e8bfa021) -} - -var fileDescriptor_8aa6b037e8bfa021 = []byte{ - // 322 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0xcf, 0x4a, 0x3b, 0x31, - 0x10, 0xc7, 0x37, 0x3f, 0x7e, 0xf6, 0xb0, 0xde, 0xd6, 0x1e, 0xa4, 0x48, 0x2a, 0xbd, 0xd4, 0x7f, - 0x24, 0xb4, 0xf5, 0x09, 0x0a, 0xde, 0x3c, 0x68, 0x8f, 0xe2, 0x65, 0xb6, 0xc6, 0xb8, 0xd0, 0x66, - 0xb2, 0x49, 0x56, 0xec, 0xd5, 0x27, 0x10, 0x7c, 0x05, 0xcf, 0x3e, 0x47, 0x8f, 0x05, 0x2f, 0x9e, - 0x44, 0x5a, 0x1f, 0x44, 0x9a, 0x2c, 0x6d, 0x45, 0xa4, 0x7a, 0x0b, 0x33, 0x9f, 0xef, 0x27, 0x33, - 0x13, 0x1f, 0xe6, 0x05, 0x58, 0x30, 0x03, 0x48, 0x2d, 0x0f, 0x4f, 0x85, 0x57, 0x82, 0xe7, 0xce, - 0x80, 0xb2, 0xd7, 0xc2, 0xf0, 0xbc, 0x10, 0x66, 0xc4, 0xb4, 0x41, 0x87, 0x49, 0x7d, 0x09, 0xb3, - 0x25, 0xcc, 0x16, 0x70, 0xad, 0x2a, 0x51, 0xa2, 0x67, 0xf9, 0xfc, 0x15, 0x62, 0xb5, 0x1d, 0x89, - 0x28, 0x07, 0x82, 0x83, 0xce, 0x38, 0x28, 0x85, 0x0e, 0x5c, 0x86, 0xca, 0x96, 0x5d, 0xda, 0x47, - 0x3b, 0x44, 0xcb, 0x53, 0xb0, 0x82, 0xdf, 0xb6, 0x52, 0xe1, 0xa0, 0xc5, 0xfb, 0x98, 0xa9, 0xb2, - 0x7f, 0xb0, 0xda, 0xf7, 0xd3, 0x2c, 0x28, 0x0d, 0x32, 0x53, 0x5e, 0x56, 0xb2, 0x47, 0xeb, 0xb6, - 0xd1, 0x60, 0x60, 0x58, 0xfe, 0xdc, 0xa8, 0xc6, 0xc9, 0xf9, 0xdc, 0x77, 0xe6, 0x8b, 0x3d, 0x91, - 0x17, 0xc2, 0xba, 0xc6, 0x65, 0xbc, 0xf5, 0xa5, 0x6a, 0x35, 0x2a, 0x2b, 0x92, 0x93, 0xb8, 0x12, - 0xc2, 0xdb, 0x64, 0x97, 0xec, 0x6d, 0xb6, 0x9b, 0x6c, 0xcd, 0x31, 0x58, 0x10, 0x74, 0xff, 0x8f, - 0xdf, 0xea, 0x51, 0xaf, 0x0c, 0xb7, 0x9f, 0x49, 0xbc, 0xe1, 0xf5, 0xc9, 0x13, 0x89, 0x2b, 0x01, - 0x49, 0x3a, 0x6b, 0x5d, 0xdf, 0xe7, 0xac, 0x1d, 0xff, 0x2d, 0x14, 0xd6, 0x68, 0xf0, 0xfb, 0x97, - 0x8f, 0xc7, 0x7f, 0xfb, 0x49, 0x93, 0xff, 0xee, 0x54, 0xdd, 0xd3, 0xf1, 0x94, 0x92, 0xc9, 0x94, - 0x92, 0xf7, 0x29, 0x25, 0x0f, 0x33, 0x1a, 0x4d, 0x66, 0x34, 0x7a, 0x9d, 0xd1, 0xe8, 0xa2, 0x2d, - 0x33, 0x77, 0x53, 0xa4, 0xac, 0x8f, 0xc3, 0x1f, 0x64, 0x77, 0x2b, 0x3a, 0x37, 0xd2, 0xc2, 0xa6, - 0x15, 0x7f, 0xf9, 0xce, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x69, 0x0a, 0xba, 0x73, 0x77, 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 { - // Parameters queries the parameters of the module. - 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, "/quasarlabs.quasarnode.qtransfer.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 { - // Parameters queries the parameters of the module. - 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: "/quasarlabs.quasarnode.qtransfer.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: "quasarlabs.quasarnode.qtransfer.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/qtransfer/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/qtransfer/types/query.pb.gw.go b/x/qtransfer/types/query.pb.gw.go deleted file mode 100644 index 4d6a3b921..000000000 --- a/x/qtransfer/types/query.pb.gw.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: quasarlabs/quasarnode/qtransfer/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{"quasarlabs", "quasarnode", "qtransfer", "params"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage -) diff --git a/x/qtransfer/wasm_hooks.go b/x/qtransfer/wasm_hooks.go deleted file mode 100644 index bb24b957c..000000000 --- a/x/qtransfer/wasm_hooks.go +++ /dev/null @@ -1,386 +0,0 @@ -package qtransfer - -import ( - errorsmod "cosmossdk.io/errors" - "encoding/json" - "errors" - "fmt" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - - "github.com/quasarlabs/quasarnode/x/qtransfer/keeper" - "github.com/quasarlabs/quasarnode/x/qtransfer/types" -) - -type ContractAck struct { - ContractResult []byte `json:"contract_result"` - IbcAck []byte `json:"ibc_ack"` -} - -type WasmHooks struct { - keeper keeper.Keeper // ibc hook keeper - wasmKeeper wasmkeeper.Keeper // contract keeper -} - -func NewWasmHooks(k keeper.Keeper, wasmKeeper wasmkeeper.Keeper) WasmHooks { - return WasmHooks{ - keeper: k, - wasmKeeper: wasmKeeper, - } -} - -func (h WasmHooks) OnRecvPacketOverride(im IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) ibcexported.Acknowledgement { - if !h.keeper.WasmHooksEnabled(ctx) { - // Wasm hooks are disabled - return im.App.OnRecvPacket(ctx, packet, relayer) - } - - isIcs20, data := isIcs20Packet(packet) - if !isIcs20 { - return im.App.OnRecvPacket(ctx, packet, relayer) - } - - // Validate the memo - isWasmRouted, contractAddr, msgBytes, err := validateAndParseTransferMemo(data.GetMemo(), data.Receiver) - if !isWasmRouted { - return im.App.OnRecvPacket(ctx, packet, relayer) - } - if err != nil { - return channeltypes.NewErrorAcknowledgement(err) - } - if msgBytes == nil || contractAddr == nil { // This should never happen - return channeltypes.NewErrorAcknowledgement(errors.New("error in wasmhook message validation")) - } - - // The funds sent on this packet need to be transferred to the wasm hooks module address/ - // For this, we override the ICS20 packet's Receiver (essentially hijacking the funds for the module) - // and execute the underlying OnRecvPacket() call (which should eventually land on the transfer app's - // relay.go and send the funds to the module. - // - // If that succeeds, we make the contract call - data.Receiver = types.IntermediateAccountAddress.String() - bz, err := json.Marshal(data) - if err != nil { - return channeltypes.NewErrorAcknowledgement(fmt.Errorf("cannot marshal the ICS20 packet: %w", err)) - } - packet.Data = bz - - // Execute the receive - ack := im.App.OnRecvPacket(ctx, packet, relayer) - if !ack.Success() { - return ack - } - - amount, ok := sdk.NewIntFromString(data.GetAmount()) - if !ok { - // This should never happen, as it should've been caught in the underlying call to OnRecvPacket, - // but returning here for completeness - return channeltypes.NewErrorAcknowledgement(fmt.Errorf("invalid packet data: Amount is not an int")) - } - - // The packet's denom is the denom in the sender chain. This needs to be converted to the local denom. - denom := MustExtractDenomFromPacketOnRecv(packet) - funds := sdk.NewCoins(sdk.NewCoin(denom, amount)) - - execMsg := wasmtypes.MsgExecuteContract{ - Sender: types.IntermediateAccountAddress.String(), - Contract: contractAddr.String(), - Msg: msgBytes, - Funds: funds, - } - response, err := h.execWasmMsg(ctx, &execMsg) - if err != nil { - return channeltypes.NewErrorAcknowledgement(err) - } - - fullAck := ContractAck{ContractResult: response.Data, IbcAck: ack.Acknowledgement()} - bz, err = json.Marshal(fullAck) - if err != nil { - return channeltypes.NewErrorAcknowledgement(errorsmod.Wrap(err, "cannot marshal the contract acknowledgement")) - } - - return channeltypes.NewResultAcknowledgement(bz) -} - -// MustExtractDenomFromPacketOnRecv takes a packet with a valid ICS20 token data in the Data field and returns the -// denom as represented in the local chain. -// If the data cannot be unmarshalled this function will panic -func MustExtractDenomFromPacketOnRecv(packet ibcexported.PacketI) string { - var data transfertypes.FungibleTokenPacketData - if err := json.Unmarshal(packet.GetData(), &data); err != nil { - panic("unable to unmarshal ICS20 packet data") - } - - var denom string - if transfertypes.ReceiverChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), data.Denom) { - // remove prefix added by sender chain - voucherPrefix := transfertypes.GetDenomPrefix(packet.GetSourcePort(), packet.GetSourceChannel()) - - unprefixedDenom := data.Denom[len(voucherPrefix):] - - // coin denomination used in sending from the escrow address - denom = unprefixedDenom - - // The denomination used to send the coins is either the native denom or the hash of the path - // if the denomination is not native. - denomTrace := transfertypes.ParseDenomTrace(unprefixedDenom) - if denomTrace.Path != "" { - denom = denomTrace.IBCDenom() - } - } else { - prefixedDenom := transfertypes.GetDenomPrefix(packet.GetDestPort(), packet.GetDestChannel()) + data.Denom - denom = transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() - } - return denom -} - -// TODO - SDK47 (address this) -func (h WasmHooks) execWasmMsg(ctx sdk.Context, execMsg *wasmtypes.MsgExecuteContract) (*wasmtypes.MsgExecuteContractResponse, error) { - if err := execMsg.ValidateBasic(); err != nil { - return nil, fmt.Errorf(types.ErrBadExecutionMsg, err.Error()) - } - wasmMsgServer := wasmkeeper.NewMsgServerImpl(&h.wasmKeeper) // SDK 47 to be tested. - return wasmMsgServer.ExecuteContract(sdk.WrapSDKContext(ctx), execMsg) -} - -func isIcs20Packet(packet channeltypes.Packet) (isIcs20 bool, ics20data transfertypes.FungibleTokenPacketData) { - var data transfertypes.FungibleTokenPacketData - if err := json.Unmarshal(packet.GetData(), &data); err != nil { - return false, data - } - return true, data -} - -func isMemoWasmRouted(memo string) (isWasmRouted bool, metadata map[string]interface{}) { - metadata = make(map[string]interface{}) - - // If there is no memo, the packet was either sent with an earlier version of IBC, or the memo was - // intentionally left blank. Nothing to do here. Ignore the packet and pass it down the stack. - if len(memo) == 0 { - return false, metadata - } - - // the metadata must be a valid JSON object - err := json.Unmarshal([]byte(memo), &metadata) - if err != nil { - return false, metadata - } - - // If the key "wasm" doesn't exist, there's nothing to do on this hook. Continue by passing the packet - // down the stack - _, ok := metadata["wasm"] - if !ok { - return false, metadata - } - - return true, metadata -} - -func validateAndParseTransferMemo(memo string, receiver string) (isWasmRouted bool, contractAddr sdk.AccAddress, msgBytes []byte, err error) { - isWasmRouted, metadata := isMemoWasmRouted(memo) - if !isWasmRouted { - return isWasmRouted, sdk.AccAddress{}, nil, nil - } - - wasmRaw := metadata["wasm"] - - // Make sure the wasm key is a map. If it isn't, ignore this packet - wasm, ok := wasmRaw.(map[string]interface{}) - if !ok { - return isWasmRouted, sdk.AccAddress{}, nil, - errorsmod.Wrap(types.ErrInvalidMetadataFormat, "wasm metadata is not a JSON map object") - } - - // Get the contract - contract, ok := wasm["contract"].(string) - if !ok { - // The tokens will be returned - return isWasmRouted, sdk.AccAddress{}, nil, - errorsmod.Wrapf(types.ErrInvalidMetadataFormat, `could not find key wasm["contract"]`) - } - - contractAddr, err = sdk.AccAddressFromBech32(contract) - if err != nil { - return isWasmRouted, sdk.AccAddress{}, nil, - errorsmod.Wrap(types.ErrInvalidMetadataFormat, `wasm["contract"] is not a valid bech32 address`) - } - - // The contract and the receiver should be the same for the packet to be valid - if contract != receiver { - return isWasmRouted, sdk.AccAddress{}, nil, - errorsmod.Wrap(types.ErrInvalidMetadataFormat, `wasm["contract"] should be the same as the receiver of the packet`) - } - - // Ensure the message key is provided - if wasm["msg"] == nil { - return isWasmRouted, sdk.AccAddress{}, nil, - errorsmod.Wrap(types.ErrInvalidMetadataFormat, `could not find key wasm["msg"]`) - } - - // Make sure the msg key is a map. If it isn't, return an error - _, ok = wasm["msg"].(map[string]interface{}) - if !ok { - return isWasmRouted, sdk.AccAddress{}, nil, - errorsmod.Wrap(types.ErrInvalidMetadataFormat, `wasm["msg"] is not a map object`) - } - - // Get the message string by serializing the map - msgBytes, err = json.Marshal(wasm["msg"]) - if err != nil { - // The tokens will be returned - return isWasmRouted, sdk.AccAddress{}, nil, - errorsmod.Wrapf(types.ErrInvalidMetadataFormat, `could not marshal wasm["msg"] field back to json: %s`, err) - } - - return isWasmRouted, contractAddr, msgBytes, nil -} - -func (h WasmHooks) OnAcknowledgementPacketOverride(im IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress) error { - err := im.App.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) - if err != nil { - return err - } - - transferPacket, err := unmarshalTransferPacket(packet) - if err != nil { - return err - } - ack, err := unmarshalAcknowledgement(acknowledgement) - if err != nil { - return err - } - - contractAddr, err := sdk.AccAddressFromBech32(transferPacket.GetSender()) - if err != nil { - return errorsmod.Wrap(err, "failed to decode transfer packet sender address") - } - contractInfo := h.wasmKeeper.GetContractInfo(ctx, contractAddr) - - if contractInfo == nil { - h.keeper.Logger(ctx).Info("ContractInfo not found for ", - "address", contractAddr) - return nil - } - - if contractInfo.IBCPortID == "" { - h.keeper.Logger(ctx).Info("Contract does not support ibc ", - "address", contractAddr, - "contractInfo", contractInfo.String()) - return nil - } - - if !ack.Success() { - h.keeper.Logger(ctx).Debug( - "passing an error acknowledgment to contract", - "contract_address", contractAddr, - "error", ack.GetError(), - ) - } - err = h.wasmKeeper.OnAckPacket(ctx, contractAddr, wasmvmtypes.IBCPacketAckMsg{ - Acknowledgement: wasmvmtypes.IBCAcknowledgement{Data: acknowledgement}, - OriginalPacket: newWasmIBCPacket(packet), - Relayer: relayer.String(), - }) - - if err != nil { - h.keeper.Logger(ctx).Error( - "contract returned error for acknowledgment", - "contract_address", contractAddr, - "error", err, - ) - return errorsmod.Wrap(err, "contract returned error for acknowledgment") - } - - return nil -} - -func unmarshalTransferPacket(packet channeltypes.Packet) (transfertypes.FungibleTokenPacketData, error) { - var transferPacket transfertypes.FungibleTokenPacketData - err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &transferPacket) - if err != nil { - return transferPacket, errorsmod.Wrap(err, "cannot unmarshal ICS-20 transfer packet data") - } - - return transferPacket, nil -} - -func unmarshalAcknowledgement(acknowledgement []byte) (channeltypes.Acknowledgement, error) { - var ack channeltypes.Acknowledgement - err := types.ModuleCdc.UnmarshalJSON(acknowledgement, &ack) - if err != nil { - return ack, errorsmod.Wrap(err, "cannot unmarshal ICS-20 transfer packet acknowledgement") - } - return ack, nil -} - -func newWasmIBCPacket(packet channeltypes.Packet) wasmvmtypes.IBCPacket { - timeout := wasmvmtypes.IBCTimeout{ - Timestamp: packet.TimeoutTimestamp, - } - if !packet.TimeoutHeight.IsZero() { - timeout.Block = &wasmvmtypes.IBCTimeoutBlock{ - Height: packet.TimeoutHeight.RevisionHeight, - Revision: packet.TimeoutHeight.RevisionNumber, - } - } - - return wasmvmtypes.IBCPacket{ - Data: packet.Data, - Src: wasmvmtypes.IBCEndpoint{ChannelID: packet.SourceChannel, PortID: packet.SourcePort}, - Dest: wasmvmtypes.IBCEndpoint{ChannelID: packet.DestinationChannel, PortID: packet.DestinationPort}, - Sequence: packet.Sequence, - Timeout: timeout, - } -} - -func (h WasmHooks) OnTimeoutPacketOverride(im IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) error { - err := im.App.OnTimeoutPacket(ctx, packet, relayer) - if err != nil { - return err - } - - transferPacket, err := unmarshalTransferPacket(packet) - if err != nil { - return err - } - - contractAddr, err := sdk.AccAddressFromBech32(transferPacket.GetSender()) - if err != nil { - return errorsmod.Wrap(err, "failed to decode transfer packet sender address") - } - contractInfo := h.wasmKeeper.GetContractInfo(ctx, contractAddr) - // Skip if there's no contract with this address (it's a regular address) or the contract doesn't support IBC - if contractInfo == nil { - h.keeper.Logger(ctx).Info("ContractInfo not found for ", - "address", contractAddr) - return nil - } - - if contractInfo.IBCPortID == "" { - h.keeper.Logger(ctx).Info("Contract does not support ibc ", - "address", contractAddr, - "contractInfo", contractInfo.String()) - return nil - } - - err = h.wasmKeeper.OnTimeoutPacket(ctx, contractAddr, wasmvmtypes.IBCPacketTimeoutMsg{ - Packet: newWasmIBCPacket(packet), - Relayer: relayer.String(), - }) - if err != nil { - h.keeper.Logger(ctx).Error( - "contract returned error for timeout", - "contract_address", contractAddr, - "error", err, - ) - return errorsmod.Wrap(err, "contract returned error for timeout") - } - - return nil -} diff --git a/x/qvesting/README.md b/x/qvesting/README.md deleted file mode 100644 index 52bf81c81..000000000 --- a/x/qvesting/README.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: "QVesting" -excerpt: "" ---- - -# The QVesting Module - -The `x/qvesting` module provides a way for managing vesting schedules in the Quasar foundation to -use `create-vesting-account` message for investors who had invested but failed to provide address at the time of -genesis. - -The `x/qvesting` module is a custom implementation built on top of the built-in `x/auth/vesting` module to address the -limitations. This custom module extends the functionality of the `x/auth/vesting` module to -provide better flexibility and support for defining the start time for vesting schedules as well as implementing queries for spendable balances and iterate existing vesting accounts. - -## Keeper functions - -- `CreateVestingAccount()` -- `AddVestingAccount()` -- `IterateVestingAccounts()` - -## State - -Misc - -- `GenesisState` - -## Queries - -- `QueryParams` -- `QuerySpendableBalances` -- `QueryVestingAccounts` - -## Events - -`qvesting` module emits the following events: - -Type: Attribute Key → Attribute Value --------------------------------------------------- - -create_vesting_account: -- module → qvesting -- amount → {denomAmount} -- start_time → {unixTimestamp} -- end_time → {unixTimestamp} -- acc → {accAddress} \ No newline at end of file diff --git a/x/qvesting/client/cli/query.go b/x/qvesting/client/cli/query.go deleted file mode 100644 index b8d9327b0..000000000 --- a/x/qvesting/client/cli/query.go +++ /dev/null @@ -1,164 +0,0 @@ -package cli - -import ( - "context" - "fmt" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd() *cobra.Command { - // Group qvesting 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( - CmdQueryParams(), - CmdQuerySpendableBalances(), - CmdQueryVestingAccounts(), - CmdQueryVestingLockedSupply(), - ) - - return cmd -} - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdQuerySpendableBalances() *cobra.Command { - cmd := &cobra.Command{ - Use: "spendable-balances [address]", - Short: "shows the spendable balances in a paginated response for a given vesting account", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqAddress := args[0] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - ctx := cmd.Context() - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QuerySpendableBalancesRequest{ - Address: reqAddress, - Pagination: pageReq, - } - - res, err := queryClient.SpendableBalances(ctx, params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "spendable-balances") - - return cmd -} - -func CmdQueryVestingAccounts() *cobra.Command { - cmd := &cobra.Command{ - Use: "accounts", - Short: "shows the existing vesting accounts in a paginated response", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - ctx := cmd.Context() - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryVestingAccountsRequest{ - Pagination: pageReq, - } - - res, err := queryClient.VestingAccounts(ctx, params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "vesting-accounts") - - return cmd -} - -func CmdQueryVestingLockedSupply() *cobra.Command { - cmd := &cobra.Command{ - Use: "locked-supply [denom]", - Short: "shows the total locked-supply in vesting accounts for a given denom", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqDenom := args[0] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - ctx := cmd.Context() - - res, err := queryClient.VestingLockedSupply(ctx, &types.QueryVestingLockedSupplyRequest{Denom: reqDenom}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/qvesting/client/cli/tx.go b/x/qvesting/client/cli/tx.go deleted file mode 100644 index 4bfe8630d..000000000 --- a/x/qvesting/client/cli/tx.go +++ /dev/null @@ -1,84 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cast" - "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(CmdCreateVestingAccount()) - - return cmd -} - -func CmdCreateVestingAccount() *cobra.Command { - cmd := &cobra.Command{ - Use: "create-vesting-account [to-address] [amount] [start-time] [end-time]", - Short: "Create a new vesting account funded with an allocation of tokens.", - Long: `Create a new vesting account funded with an allocation of tokens. -The account can be a continuous vesting account. The start_time and end_time must be -provided as a UNIX epoch timestamp.`, - Args: cobra.ExactArgs(4), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argToAddress, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } - - argAmount, err := sdk.ParseCoinsNormalized(args[1]) - if err != nil { - return err - } - - argStartTime, err := cast.ToInt64E(args[2]) - if err != nil { - return err - } - - argEndTime, err := cast.ToInt64E(args[3]) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgCreateVestingAccount( - clientCtx.GetFromAddress().String(), - argToAddress, - argAmount, - argStartTime, - argEndTime, - ) - - if err := msg.ValidateBasic(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/qvesting/genesis.go b/x/qvesting/genesis.go deleted file mode 100644 index fa2d14666..000000000 --- a/x/qvesting/genesis.go +++ /dev/null @@ -1,22 +0,0 @@ -package qvesting - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/qvesting/keeper" - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -// InitGenesis initializes the capability module's state from a provided genesis -// state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - k.SetParams(ctx, genState.Params) -} - -// ExportGenesis returns the capability module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) - - return genesis -} diff --git a/x/qvesting/handler.go b/x/qvesting/handler.go deleted file mode 100644 index 3f54fabe7..000000000 --- a/x/qvesting/handler.go +++ /dev/null @@ -1,30 +0,0 @@ -package qvesting - -import ( - errorsmod "cosmossdk.io/errors" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/quasarlabs/quasarnode/x/qvesting/keeper" - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgCreateVestingAccount: - res, err := msgServer.CreateVestingAccount(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/qvesting/keeper/grpc_query.go b/x/qvesting/keeper/grpc_query.go deleted file mode 100644 index b69727745..000000000 --- a/x/qvesting/keeper/grpc_query.go +++ /dev/null @@ -1,139 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store/mem" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" - - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -var _ types.QueryServer = Keeper{} - -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 -} - -// SpendableBalances implements a gRPC query handler for retrieving an account's -// spendable balances. -func (k Keeper) SpendableBalances(ctx context.Context, req *types.QuerySpendableBalancesRequest) (*types.QuerySpendableBalancesResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - addr, err := sdk.AccAddressFromBech32(req.Address) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid address: %s", err.Error()) - } - - sdkCtx := sdk.UnwrapSDKContext(ctx) - - spendable := k.bankKeeper.SpendableCoins(sdkCtx, addr) - - memStore := mem.NewStore() - for i, coin := range spendable { - memStore.Set(sdk.Uint64ToBigEndian(uint64(i)), k.cdc.MustMarshal(&coin)) - } - - var paginatedSpendable sdk.Coins - pageRes, err := query.Paginate(memStore, req.Pagination, func(key []byte, value []byte) error { - var coin sdk.Coin - k.cdc.MustUnmarshal(value, &coin) - paginatedSpendable = append(paginatedSpendable, coin) - return nil - }) - - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err) - } - - return &types.QuerySpendableBalancesResponse{ - Balances: paginatedSpendable, - Pagination: pageRes, - }, nil -} - -func (k Keeper) VestingAccounts(c context.Context, req *types.QueryVestingAccountsRequest) (*types.QueryVestingAccountsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(c) - store := ctx.KVStore(k.storeKey) - accountsStore := prefix.NewStore(store, types.VestingAccountStoreKeyPrefix) - - var accounts []*codectypes.Any - pageRes, err := query.Paginate(accountsStore, req.Pagination, func(key, value []byte) error { - addr := sdk.AccAddress(key) - acct := k.accountKeeper.GetAccount(ctx, addr) - vestingAcct, ok := acct.(exported.VestingAccount) - if !ok { - return fmt.Errorf("account is not vesting account: %s", addr.String()) - } - - any, err := codectypes.NewAnyWithValue(vestingAcct) - if err != nil { - return err - } - accounts = append(accounts, any) - return nil - }) - - if err != nil { - return nil, status.Errorf(codes.Internal, "paginate: %v", err) - } - - return &types.QueryVestingAccountsResponse{Accounts: accounts, Pagination: pageRes}, err - -} - -// VestingLockedSupply returns the total amount of locked supply for a given denomination across all vesting accounts. -// The locked supply of a vesting account is the total balance of the account minus the spendable balance. -// The function iterates over all the vesting accounts, and for each account, it retrieves the balance for the requested denomination -// and subtracts the spendable amount. The result is added to the total locked supply. -func (k Keeper) VestingLockedSupply(ctx context.Context, req *types.QueryVestingLockedSupplyRequest) (*types.QueryVestingLockedSupplyResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - sdkCtx := sdk.UnwrapSDKContext(ctx) - resAmount := sdk.NewInt(0) - - // iterate vesting accounts passing a callback function to invoke - err := k.iterateVestingAccounts(sdkCtx, func(addr sdk.AccAddress) error { - // get the total vesting account balance for requested denom - accBalance := k.bankKeeper.GetBalance(sdkCtx, addr, req.Denom) - - // get the total vesting account spendable balances - spendableCoins := k.bankKeeper.SpendableCoins(sdkCtx, addr) - // iterate spendable balances looking for requested denom to subtract from total accBalance.Amount - for _, coin := range spendableCoins { - // if denom exists and amount is greater than 0 subtract it - if coin.Denom == req.Denom && coin.Amount.GT(sdk.NewInt(0)) { - accBalance.Amount = accBalance.Amount.Sub(coin.Amount) - } - } - - resAmount = resAmount.Add(accBalance.Amount) - return nil - }) - // Handle error from iteration of vesting accounts - if err != nil { - return nil, err - } - - return &types.QueryVestingLockedSupplyResponse{Amount: sdk.Coin{Denom: req.Denom, Amount: resAmount}}, nil -} diff --git a/x/qvesting/keeper/grpc_query_test.go b/x/qvesting/keeper/grpc_query_test.go deleted file mode 100644 index 395a1f342..000000000 --- a/x/qvesting/keeper/grpc_query_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - testkeeper "github.com/quasarlabs/quasarnode/testutil/keeper" - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -func TestParamsQuery(t *testing.T) { - keeper, ctx := testkeeper.QVestingKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - keeper.SetParams(ctx, params) - - response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) -} diff --git a/x/qvesting/keeper/keeper.go b/x/qvesting/keeper/keeper.go deleted file mode 100644 index 4ea89603b..000000000 --- a/x/qvesting/keeper/keeper.go +++ /dev/null @@ -1,94 +0,0 @@ -package keeper - -import ( - "fmt" - "google.golang.org/grpc/grpclog" - - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -type ( - Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - memKey storetypes.StoreKey - paramstore paramtypes.Subspace - - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper - } -) - -func NewKeeper( - cdc codec.BinaryCodec, - storeKey, - memKey storetypes.StoreKey, - ps paramtypes.Subspace, - - accountKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, -) *Keeper { - // set KeyTable if it has not already been set - if !ps.HasKeyTable() { - ps = ps.WithKeyTable(types.ParamKeyTable()) - } - - return &Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, - - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - } -} - -func (k Keeper) AddVestingAccount(ctx sdk.Context, addr sdk.AccAddress) { - store := ctx.KVStore(k.storeKey) - store.Set(types.VestingAccountStoreKey(addr), []byte{}) -} - -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) -} - -// iterateVestingAccounts iterates over all vesting accounts and invokes a callback function on each of them. -func (k Keeper) iterateVestingAccounts(sdkCtx sdk.Context, callback func(addr sdk.AccAddress) error) error { - store := sdkCtx.KVStore(k.storeKey) - accountsStore := prefix.NewStore(store, types.VestingAccountStoreKeyPrefix) - iterator := accountsStore.Iterator(nil, nil) - - // empty allocated resources after execution - defer func(iterator storetypes.Iterator) { - err := iterator.Close() - if err != nil { - grpclog.Infof("Failed to close iterator for %s", err) - } - }(iterator) - - for ; iterator.Valid(); iterator.Next() { - key := iterator.Key() - addr := sdk.AccAddress(key) - acct := k.accountKeeper.GetAccount(sdkCtx, addr) - _, ok := acct.(exported.VestingAccount) - if !ok { - return fmt.Errorf("account is not vesting account: %s", addr.String()) - } - - // invoke the callback function for the iterated vesting account - if err := callback(addr); err != nil { - return err - } - } - - return nil -} diff --git a/x/qvesting/keeper/msg_server.go b/x/qvesting/keeper/msg_server.go deleted file mode 100644 index 343598585..000000000 --- a/x/qvesting/keeper/msg_server.go +++ /dev/null @@ -1,106 +0,0 @@ -package keeper - -import ( - "context" - errorsmod "cosmossdk.io/errors" - "strconv" - - "github.com/armon/go-metrics" - "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - - "github.com/quasarlabs/quasarnode/x/qvesting/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{} - -func (k msgServer) CreateVestingAccount(goCtx context.Context, msg *types.MsgCreateVestingAccount) (*types.MsgCreateVestingAccountResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - ak := k.accountKeeper - bk := k.bankKeeper - - // Validate msg.StartTime against the current block time to be higher - blockTime := ctx.BlockTime().Unix() - if msg.StartTime <= blockTime { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "start or end time must be higher than the current block time") - } - - if err := bk.IsSendEnabledCoins(ctx, msg.Amount...); err != nil { - return nil, err - } - - from, err := sdk.AccAddressFromBech32(msg.FromAddress) - if err != nil { - return nil, err - } - to, err := sdk.AccAddressFromBech32(msg.ToAddress) - if err != nil { - return nil, err - } - - if bk.BlockedAddr(to) { - return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) - } - - if acc := ak.GetAccount(ctx, to); acc != nil { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) - } - - baseAccount := ak.NewAccountWithAddress(ctx, to) - if _, ok := baseAccount.(*authtypes.BaseAccount); !ok { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid account type; expected: BaseAccount, got: %T", baseAccount) - } - - baseVestingAccount := vestingtypes.NewBaseVestingAccount(baseAccount.(*authtypes.BaseAccount), msg.Amount.Sort(), msg.EndTime) - - acc := vestingtypes.NewContinuousVestingAccountRaw(baseVestingAccount, msg.StartTime) - - ak.SetAccount(ctx, acc) - k.AddVestingAccount(ctx, acc.GetAddress()) - - defer func() { - telemetry.IncrCounter(1, "new", "account") - - for _, a := range msg.Amount { - if a.Amount.IsInt64() { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "create_vesting_account"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - } - }() - - err = bk.SendCoins(ctx, from, to, msg.Amount) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()), - sdk.NewAttribute(types.AttributeKeyStartTime, strconv.FormatInt(msg.StartTime, 10)), - sdk.NewAttribute(types.AttributeKeyEndTime, strconv.FormatInt(msg.EndTime, 10)), - sdk.NewAttribute(types.AttributeKeyFromAccount, msg.FromAddress), - sdk.NewAttribute(types.AttributeKeyToAccount, msg.ToAddress), - ), - ) - - return &types.MsgCreateVestingAccountResponse{}, nil -} diff --git a/x/qvesting/keeper/params.go b/x/qvesting/keeper/params.go deleted file mode 100644 index f90aa7a29..000000000 --- a/x/qvesting/keeper/params.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams() -} - -// SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramstore.SetParamSet(ctx, ¶ms) -} diff --git a/x/qvesting/keeper/params_test.go b/x/qvesting/keeper/params_test.go deleted file mode 100644 index 45f92f44e..000000000 --- a/x/qvesting/keeper/params_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - testkeeper "github.com/quasarlabs/quasarnode/testutil/keeper" - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -func TestGetParams(t *testing.T) { - k, ctx := testkeeper.QVestingKeeper(t) - params := types.DefaultParams() - - k.SetParams(ctx, params) - - require.EqualValues(t, params, k.GetParams(ctx)) -} diff --git a/x/qvesting/module.go b/x/qvesting/module.go deleted file mode 100644 index 20856c4d4..000000000 --- a/x/qvesting/module.go +++ /dev/null @@ -1,183 +0,0 @@ -package qvesting - -import ( - "context" - "encoding/json" - "fmt" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" - "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/module" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/qvesting/client/cli" - "github.com/quasarlabs/quasarnode/x/qvesting/keeper" - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface for the capability module. -type AppModuleBasic struct { - cdc codec.BinaryCodec -} - -func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the capability module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -// RegisterInterfaces registers the module's interface types -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) -} - -// DefaultGenesis returns the capability module's default genesis state. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) -} - -// ValidateGenesis performs genesis state validation for the capability module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config 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() -} - -// RegisterRESTRoutes registers the capability module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { - // rest.RegisterHandlers(clientCtx, rtr) -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) - if err != nil { - return - } -} - -// GetTxCmd returns the capability module's root tx command. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns the capability module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface for the capability module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper -} - -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - accountKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, -) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - } -} - -// Name returns the capability module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - -/* -// Route returns the capability module's message routing key. -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) -} - -*/ - -// QuerierRoute returns the capability module's query routing key. -func (AppModule) QuerierRoute() string { return types.QuerierRoute } - -/* -// LegacyQuerierHandler returns the capability module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return nil -} -*/ - -// 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) -} - -// RegisterInvariants registers the capability module's invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// InitGenesis performs the capability module's genesis initialization It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { - var genState types.GenesisState - // Initialize global index to index in genesis state - cdc.MustUnmarshalJSON(gs, &genState) - - InitGenesis(ctx, am.keeper, genState) - - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - genState := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(genState) -} - -// ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } - -// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} - -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} diff --git a/x/qvesting/types/codec.go b/x/qvesting/types/codec.go deleted file mode 100644 index 20fd4cf1a..000000000 --- a/x/qvesting/types/codec.go +++ /dev/null @@ -1,25 +0,0 @@ -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(&MsgCreateVestingAccount{}, "qvesting/CreateVestingAccount", nil) -} - -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgCreateVestingAccount{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) diff --git a/x/qvesting/types/constants.go b/x/qvesting/types/constants.go deleted file mode 100644 index 96a802992..000000000 --- a/x/qvesting/types/constants.go +++ /dev/null @@ -1,14 +0,0 @@ -package types - -const ( - AttributeKeyFromAccount = "from_acc" - AttributeKeyToAccount = "to_acc" - AttributeKeyStartTime = "start_time" - AttributeKeyEndTime = "end_time" - - // AttributeValueCategory is an alias for the message event value. - AttributeValueCategory = ModuleName - - // AttributeValueAction is an alias for the message event value. - AttributeValueAction = TypeMsgCreateVestingAccount -) diff --git a/x/qvesting/types/expected_keepers.go b/x/qvesting/types/expected_keepers.go deleted file mode 100644 index 96185efb8..000000000 --- a/x/qvesting/types/expected_keepers.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -// AccountKeeper defines the expected account keeper used for simulations (noalias) -type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - SetAccount(ctx sdk.Context, acc types.AccountI) -} - -// BankKeeper defines the expected interface needed to retrieve account balances. -type BankKeeper interface { - // Keeper - IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error - BlockedAddr(addr sdk.AccAddress) bool - // View - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins -} diff --git a/x/qvesting/types/genesis.go b/x/qvesting/types/genesis.go deleted file mode 100644 index 2fb67af14..000000000 --- a/x/qvesting/types/genesis.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -// DefaultGenesis returns the default Capability genesis state -func DefaultGenesis() *GenesisState { - return &GenesisState{ - Params: DefaultParams(), - } -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - - return gs.Params.Validate() -} diff --git a/x/qvesting/types/genesis.pb.go b/x/qvesting/types/genesis.pb.go deleted file mode 100644 index 22219b06b..000000000 --- a/x/qvesting/types/genesis.pb.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qvesting/genesis.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 - -// GenesisState defines the qvesting module's genesis state. -type GenesisState struct { - 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_3059f548133fd2a3, []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), "quasarlabs.quasarnode.qvesting.GenesisState") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qvesting/genesis.proto", fileDescriptor_3059f548133fd2a3) -} - -var fileDescriptor_3059f548133fd2a3 = []byte{ - // 199 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x29, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x0b, 0xcb, - 0x52, 0x8b, 0x4b, 0x32, 0xf3, 0xd2, 0xf5, 0xd3, 0x53, 0xf3, 0x52, 0x8b, 0x33, 0x8b, 0xf5, 0x0a, - 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xe4, 0x10, 0xaa, 0xf5, 0x10, 0xaa, 0xf5, 0x60, 0xaa, 0xa5, 0x44, - 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4a, 0xf5, 0x41, 0x2c, 0x88, 0x2e, 0x29, 0x6d, 0x02, 0x76, 0x14, - 0x24, 0x16, 0x25, 0xe6, 0x42, 0xad, 0x50, 0x0a, 0xe1, 0xe2, 0x71, 0x87, 0xd8, 0x19, 0x5c, 0x92, - 0x58, 0x92, 0x2a, 0xe4, 0xc2, 0xc5, 0x06, 0x91, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x52, - 0xd3, 0xc3, 0xef, 0x06, 0xbd, 0x00, 0xb0, 0x6a, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, - 0x7a, 0x9d, 0xbc, 0x4f, 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, 0x30, 0x3d, - 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xbb, 0x3b, 0x2b, 0x10, 0x2e, 0x2d, - 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xbb, 0xd4, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe6, - 0x7f, 0xbc, 0x5f, 0x3c, 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/qvesting/types/genesis_test.go b/x/qvesting/types/genesis_test.go deleted file mode 100644 index 775992581..000000000 --- a/x/qvesting/types/genesis_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/x/qvesting/types" -) - -func TestGenesisState_Validate(t *testing.T) { - for _, tc := range []struct { - desc string - genState *types.GenesisState - valid bool - }{ - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - { - desc: "valid genesis state", - genState: &types.GenesisState{}, - valid: true, - }, - } { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} diff --git a/x/qvesting/types/keys.go b/x/qvesting/types/keys.go deleted file mode 100644 index cb32b305c..000000000 --- a/x/qvesting/types/keys.go +++ /dev/null @@ -1,31 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - // ModuleName defines the module name - ModuleName = "qvesting" - - // StoreKey defines the primary module store key - StoreKey = ModuleName - - // RouterKey is the message route for slashing - RouterKey = ModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - - // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_qvesting" -) - -var ( - VestingAccountStoreKeyPrefix = []byte{0x01} -) - -// VestingAccountStoreKey turn an address to key used to record it in the vesting store -func VestingAccountStoreKey(addr sdk.AccAddress) []byte { - return append(VestingAccountStoreKeyPrefix, addr.Bytes()...) -} diff --git a/x/qvesting/types/msgs.go b/x/qvesting/types/msgs.go deleted file mode 100644 index c00364c98..000000000 --- a/x/qvesting/types/msgs.go +++ /dev/null @@ -1,74 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgCreateVestingAccount = "create_vesting_account" - -var _ sdk.Msg = &MsgCreateVestingAccount{} - -func NewMsgCreateVestingAccount(fromAddress string, toAddress sdk.AccAddress, amount sdk.Coins, startTime int64, endTime int64) *MsgCreateVestingAccount { - return &MsgCreateVestingAccount{ - FromAddress: fromAddress, - ToAddress: toAddress.String(), - Amount: amount, - StartTime: startTime, - EndTime: endTime, - } -} - -func (msg *MsgCreateVestingAccount) Route() string { - return RouterKey -} - -func (msg *MsgCreateVestingAccount) Type() string { - return TypeMsgCreateVestingAccount -} - -func (msg *MsgCreateVestingAccount) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.FromAddress) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgCreateVestingAccount) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgCreateVestingAccount) ValidateBasic() error { - from, err := sdk.AccAddressFromBech32(msg.FromAddress) - if err != nil { - return err - } - to, err := sdk.AccAddressFromBech32(msg.ToAddress) - if err != nil { - return err - } - if err := sdk.VerifyAddressFormat(from); err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address: %s", err) - } - - if err := sdk.VerifyAddressFormat(to); err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address: %s", err) - } - - if !msg.Amount.IsValid() { - return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) - } - - if !msg.Amount.IsAllPositive() { - return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) - } - - if msg.StartTime > msg.EndTime { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid start time higher than end time") - } - - return nil -} diff --git a/x/qvesting/types/msgs_test.go b/x/qvesting/types/msgs_test.go deleted file mode 100644 index e735553f3..000000000 --- a/x/qvesting/types/msgs_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - "fmt" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil/sample" -) - -func TestMsgCreateVestingAccount_ValidateBasic(t *testing.T) { - tests := []struct { - name string - msg MsgCreateVestingAccount - err error - }{ - { - name: "invalid address", - msg: MsgCreateVestingAccount{ - FromAddress: "invalid_address", - }, - err: fmt.Errorf("decoding bech32 failed: invalid separator index -1"), - }, - { - name: "valid coin", - msg: MsgCreateVestingAccount{ - FromAddress: sample.AccAddress().String(), - ToAddress: sample.AccAddress().String(), - Amount: sdk.NewCoins(), - StartTime: 100000, - EndTime: 110000, - }, - err: errorsmod.Wrap(sdkerrors.ErrInvalidCoins, sdk.NewCoins().String()), - }, - { - name: "invalid time", - msg: MsgCreateVestingAccount{ - FromAddress: sample.AccAddress().String(), - ToAddress: sample.AccAddress().String(), - Amount: sdk.NewCoins(sdk.NewInt64Coin("uqsr", 100000)), - StartTime: 110000, - EndTime: 100000, - }, - err: errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid start time higher than end time"), - }, - { - name: "all valid", - msg: MsgCreateVestingAccount{ - FromAddress: sample.AccAddress().String(), - ToAddress: sample.AccAddress().String(), - Amount: sdk.NewCoins(sdk.NewInt64Coin("uqsr", 100000)), - StartTime: 100000, - EndTime: 110000, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.msg.ValidateBasic() - if tt.err != nil { - require.Equal(t, err.Error(), tt.err.Error()) - return - } - require.NoError(t, err) - }) - } -} diff --git a/x/qvesting/types/params.go b/x/qvesting/types/params.go deleted file mode 100644 index cc90a6d87..000000000 --- a/x/qvesting/types/params.go +++ /dev/null @@ -1,40 +0,0 @@ -package types - -import ( - "gopkg.in/yaml.v2" - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -var _ paramtypes.ParamSet = (*Params)(nil) - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// NewParams creates a new Params instance -func NewParams() Params { - return Params{} -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return NewParams() -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{} -} - -// Validate validates the set of params -func (p Params) Validate() error { - return nil -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} diff --git a/x/qvesting/types/params.pb.go b/x/qvesting/types/params.pb.go deleted file mode 100644 index 933d7e4c4..000000000 --- a/x/qvesting/types/params.pb.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qvesting/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 module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_07336d9a19bda4aa, []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 init() { - proto.RegisterType((*Params)(nil), "quasarlabs.quasarnode.qvesting.Params") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qvesting/params.proto", fileDescriptor_07336d9a19bda4aa) -} - -var fileDescriptor_07336d9a19bda4aa = []byte{ - // 157 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2e, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x0b, 0xcb, - 0x52, 0x8b, 0x4b, 0x32, 0xf3, 0xd2, 0xf5, 0x0b, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0xf5, 0x0a, 0x8a, - 0xf2, 0x4b, 0xf2, 0x85, 0xe4, 0x10, 0x8a, 0xf5, 0x10, 0x8a, 0xf5, 0x60, 0x8a, 0xa5, 0x44, 0xd2, - 0xf3, 0xd3, 0xf3, 0xc1, 0x4a, 0xf5, 0x41, 0x2c, 0x88, 0x2e, 0x25, 0x3e, 0x2e, 0xb6, 0x00, 0xb0, - 0x29, 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x38, 0x79, 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, 0x61, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, - 0x76, 0x77, 0x55, 0x20, 0x5c, 0x56, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xc3, 0x18, - 0x10, 0x00, 0x00, 0xff, 0xff, 0x23, 0x7c, 0xd6, 0x40, 0xc8, 0x00, 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 - 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 - 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 { - 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/qvesting/types/query.pb.go b/x/qvesting/types/query.pb.go deleted file mode 100644 index 52b655ced..000000000 --- a/x/qvesting/types/query.pb.go +++ /dev/null @@ -1,1921 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qvesting/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types1 "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" - query "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 - -// QueryParamsRequest is 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_2fc46f42d8eecfff, []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 - -// QueryParamsResponse is 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"` -} - -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_2fc46f42d8eecfff, []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{} -} - -// QuerySpendableBalancesRequest defines the gRPC request structure for querying -// an account's spendable balances. -type QuerySpendableBalancesRequest struct { - // address is the address to query spendable balances for. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QuerySpendableBalancesRequest) Reset() { *m = QuerySpendableBalancesRequest{} } -func (m *QuerySpendableBalancesRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySpendableBalancesRequest) ProtoMessage() {} -func (*QuerySpendableBalancesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fc46f42d8eecfff, []int{2} -} -func (m *QuerySpendableBalancesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpendableBalancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpendableBalancesRequest.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 *QuerySpendableBalancesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpendableBalancesRequest.Merge(m, src) -} -func (m *QuerySpendableBalancesRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySpendableBalancesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpendableBalancesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpendableBalancesRequest proto.InternalMessageInfo - -// QuerySpendableBalancesResponse defines the gRPC response structure for querying -// an account's spendable balances. -type QuerySpendableBalancesResponse struct { - // balances is the spendable balances of all the coins. - Balances github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=balances,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balances"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QuerySpendableBalancesResponse) Reset() { *m = QuerySpendableBalancesResponse{} } -func (m *QuerySpendableBalancesResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySpendableBalancesResponse) ProtoMessage() {} -func (*QuerySpendableBalancesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fc46f42d8eecfff, []int{3} -} -func (m *QuerySpendableBalancesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpendableBalancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpendableBalancesResponse.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 *QuerySpendableBalancesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpendableBalancesResponse.Merge(m, src) -} -func (m *QuerySpendableBalancesResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySpendableBalancesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpendableBalancesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpendableBalancesResponse proto.InternalMessageInfo - -func (m *QuerySpendableBalancesResponse) GetBalances() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Balances - } - return nil -} - -func (m *QuerySpendableBalancesResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVestingAccountsRequest is the request type for the Query/Accounts RPC method. -type QueryVestingAccountsRequest struct { - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryVestingAccountsRequest) Reset() { *m = QueryVestingAccountsRequest{} } -func (m *QueryVestingAccountsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryVestingAccountsRequest) ProtoMessage() {} -func (*QueryVestingAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fc46f42d8eecfff, []int{4} -} -func (m *QueryVestingAccountsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVestingAccountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVestingAccountsRequest.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 *QueryVestingAccountsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVestingAccountsRequest.Merge(m, src) -} -func (m *QueryVestingAccountsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryVestingAccountsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVestingAccountsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVestingAccountsRequest proto.InternalMessageInfo - -func (m *QueryVestingAccountsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVestingAccountsResponse is the response type for the Query/Accounts RPC method. -type QueryVestingAccountsResponse struct { - // accounts are the existing vesting accounts - // repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "VestingAccount"]; - Accounts []*types1.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryVestingAccountsResponse) Reset() { *m = QueryVestingAccountsResponse{} } -func (m *QueryVestingAccountsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryVestingAccountsResponse) ProtoMessage() {} -func (*QueryVestingAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fc46f42d8eecfff, []int{5} -} -func (m *QueryVestingAccountsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVestingAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVestingAccountsResponse.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 *QueryVestingAccountsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVestingAccountsResponse.Merge(m, src) -} -func (m *QueryVestingAccountsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryVestingAccountsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVestingAccountsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVestingAccountsResponse proto.InternalMessageInfo - -func (m *QueryVestingAccountsResponse) GetAccounts() []*types1.Any { - if m != nil { - return m.Accounts - } - return nil -} - -func (m *QueryVestingAccountsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVestingLockedSupplyRequest is the request type for the Query/VestingLockedSupply RPC method. -type QueryVestingLockedSupplyRequest struct { - // denom is the coin denom to query locked supply for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *QueryVestingLockedSupplyRequest) Reset() { *m = QueryVestingLockedSupplyRequest{} } -func (m *QueryVestingLockedSupplyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryVestingLockedSupplyRequest) ProtoMessage() {} -func (*QueryVestingLockedSupplyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fc46f42d8eecfff, []int{6} -} -func (m *QueryVestingLockedSupplyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVestingLockedSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVestingLockedSupplyRequest.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 *QueryVestingLockedSupplyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVestingLockedSupplyRequest.Merge(m, src) -} -func (m *QueryVestingLockedSupplyRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryVestingLockedSupplyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVestingLockedSupplyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVestingLockedSupplyRequest proto.InternalMessageInfo - -func (m *QueryVestingLockedSupplyRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -// QueryVestingAccountsResponse is the response type for the Query/VestingLockedSupply RPC method. -type QueryVestingLockedSupplyResponse struct { - // amount is the supply of the coin. - Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` -} - -func (m *QueryVestingLockedSupplyResponse) Reset() { *m = QueryVestingLockedSupplyResponse{} } -func (m *QueryVestingLockedSupplyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryVestingLockedSupplyResponse) ProtoMessage() {} -func (*QueryVestingLockedSupplyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fc46f42d8eecfff, []int{7} -} -func (m *QueryVestingLockedSupplyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVestingLockedSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVestingLockedSupplyResponse.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 *QueryVestingLockedSupplyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVestingLockedSupplyResponse.Merge(m, src) -} -func (m *QueryVestingLockedSupplyResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryVestingLockedSupplyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVestingLockedSupplyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVestingLockedSupplyResponse proto.InternalMessageInfo - -func (m *QueryVestingLockedSupplyResponse) GetAmount() types.Coin { - if m != nil { - return m.Amount - } - return types.Coin{} -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "quasarlabs.quasarnode.qvesting.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "quasarlabs.quasarnode.qvesting.QueryParamsResponse") - proto.RegisterType((*QuerySpendableBalancesRequest)(nil), "quasarlabs.quasarnode.qvesting.QuerySpendableBalancesRequest") - proto.RegisterType((*QuerySpendableBalancesResponse)(nil), "quasarlabs.quasarnode.qvesting.QuerySpendableBalancesResponse") - proto.RegisterType((*QueryVestingAccountsRequest)(nil), "quasarlabs.quasarnode.qvesting.QueryVestingAccountsRequest") - proto.RegisterType((*QueryVestingAccountsResponse)(nil), "quasarlabs.quasarnode.qvesting.QueryVestingAccountsResponse") - proto.RegisterType((*QueryVestingLockedSupplyRequest)(nil), "quasarlabs.quasarnode.qvesting.QueryVestingLockedSupplyRequest") - proto.RegisterType((*QueryVestingLockedSupplyResponse)(nil), "quasarlabs.quasarnode.qvesting.QueryVestingLockedSupplyResponse") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qvesting/query.proto", fileDescriptor_2fc46f42d8eecfff) -} - -var fileDescriptor_2fc46f42d8eecfff = []byte{ - // 725 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x4f, 0x13, 0x4f, - 0x14, 0xef, 0xf0, 0xfd, 0x52, 0x71, 0x38, 0x18, 0x87, 0x1e, 0x4a, 0xc5, 0x6d, 0xb3, 0x07, 0x6c, - 0x30, 0xec, 0x40, 0x89, 0x21, 0x51, 0x40, 0xa9, 0x44, 0x63, 0xf4, 0x80, 0x4b, 0xe2, 0x41, 0x0e, - 0x64, 0x76, 0x77, 0x5c, 0x36, 0xb4, 0x33, 0xdb, 0xce, 0x2e, 0xb1, 0x21, 0x5c, 0x3c, 0x99, 0x78, - 0x31, 0xf1, 0x1f, 0x80, 0xab, 0x67, 0x6f, 0x26, 0x9e, 0x89, 0x27, 0xa2, 0x07, 0x39, 0xa9, 0x01, - 0x0f, 0xfe, 0x19, 0xa6, 0x33, 0xb3, 0x6d, 0x91, 0x42, 0xa1, 0xf1, 0xd4, 0xce, 0xee, 0x7b, 0xef, - 0xf3, 0x63, 0xdf, 0x67, 0xe0, 0x44, 0x2d, 0x26, 0x82, 0xd4, 0x2b, 0xc4, 0x11, 0x58, 0xfd, 0x65, - 0xdc, 0xa3, 0xb8, 0xb6, 0x49, 0x45, 0x14, 0x30, 0x1f, 0xd7, 0x62, 0x5a, 0x6f, 0x58, 0x61, 0x9d, - 0x47, 0x1c, 0x19, 0xed, 0x5a, 0xab, 0x5d, 0x6b, 0x25, 0xb5, 0xb9, 0x8c, 0xcf, 0x7d, 0x2e, 0x4b, - 0x71, 0xf3, 0x9f, 0xea, 0xca, 0x8d, 0xf9, 0x9c, 0xfb, 0x15, 0x8a, 0x49, 0x18, 0x60, 0xc2, 0x18, - 0x8f, 0x48, 0x14, 0x70, 0x26, 0xf4, 0xdb, 0x09, 0x97, 0x8b, 0x2a, 0x17, 0xd8, 0x21, 0x82, 0x2a, - 0x30, 0xbc, 0x39, 0xed, 0xd0, 0x88, 0x4c, 0xe3, 0x90, 0xf8, 0x01, 0x93, 0xc5, 0xba, 0xf6, 0x66, - 0x0f, 0xae, 0x21, 0xa9, 0x93, 0x6a, 0x32, 0x78, 0x54, 0xc3, 0xca, 0x93, 0x13, 0xbf, 0xc0, 0x84, - 0x69, 0x1d, 0x39, 0xa3, 0x13, 0x33, 0x41, 0x73, 0x79, 0x90, 0xe0, 0x8c, 0xaa, 0xf7, 0x6b, 0x4a, - 0x8a, 0x3a, 0xa8, 0x57, 0x66, 0x06, 0xa2, 0xa7, 0x4d, 0x92, 0xcb, 0x12, 0xca, 0xa6, 0xb5, 0x98, - 0x8a, 0xc8, 0x5c, 0x85, 0x23, 0xc7, 0x9e, 0x8a, 0x90, 0x33, 0x41, 0xd1, 0x12, 0x4c, 0x2b, 0x4a, - 0x59, 0x50, 0x00, 0xc5, 0xe1, 0xd2, 0xb8, 0x75, 0xb6, 0x81, 0x96, 0xea, 0x2f, 0xff, 0xbf, 0xf7, - 0x3d, 0x9f, 0xb2, 0x75, 0xaf, 0xf9, 0x06, 0xc0, 0xeb, 0x72, 0xfa, 0x4a, 0x48, 0x99, 0x47, 0x9c, - 0x0a, 0x2d, 0x93, 0x0a, 0x61, 0x2e, 0x4d, 0xe0, 0x51, 0x16, 0x5e, 0x22, 0x9e, 0x57, 0xa7, 0x42, - 0x01, 0x5d, 0xb6, 0x93, 0x23, 0x7a, 0x00, 0x61, 0xdb, 0xc5, 0xec, 0x80, 0x66, 0xa1, 0x15, 0x35, - 0xe5, 0x5b, 0xea, 0xfb, 0x6a, 0x13, 0xac, 0x65, 0xe2, 0x53, 0x3d, 0xd5, 0xee, 0xe8, 0xbc, 0x3d, - 0xf4, 0x7a, 0x27, 0x9f, 0xfa, 0xbd, 0x93, 0x4f, 0x99, 0x5f, 0x00, 0x34, 0x4e, 0x63, 0xa3, 0x65, - 0xfb, 0x70, 0xc8, 0xd1, 0xcf, 0xb2, 0xa0, 0xf0, 0x5f, 0x71, 0xb8, 0x34, 0x7a, 0x0c, 0x32, 0x01, - 0xbb, 0xcf, 0x03, 0x56, 0x9e, 0x6a, 0x6a, 0x7d, 0xff, 0x23, 0x5f, 0xf4, 0x83, 0x68, 0x3d, 0x76, - 0x2c, 0x97, 0x57, 0xb5, 0xe3, 0xfa, 0x67, 0x52, 0x78, 0x1b, 0x38, 0x6a, 0x84, 0x54, 0xc8, 0x06, - 0x61, 0xb7, 0x86, 0xa3, 0x87, 0x5d, 0xd4, 0xdd, 0xe8, 0xa9, 0x4e, 0xb1, 0xec, 0x94, 0x67, 0x52, - 0x78, 0x4d, 0x6a, 0x7a, 0xa6, 0xbe, 0xc3, 0xa2, 0xeb, 0xf2, 0x98, 0x45, 0x2d, 0x7f, 0x8f, 0xbb, - 0x08, 0xfa, 0x75, 0xd1, 0xfc, 0x08, 0xe0, 0x58, 0x77, 0x1c, 0xed, 0x9c, 0x0d, 0x87, 0x88, 0x7e, - 0xa6, 0x9d, 0xcb, 0x58, 0x6a, 0x8d, 0xad, 0x64, 0x8d, 0xad, 0x45, 0xd6, 0x28, 0x17, 0x3e, 0x7f, - 0x98, 0x1c, 0xd3, 0xf8, 0x24, 0x8e, 0xd6, 0x5b, 0xc8, 0x7a, 0xe2, 0x23, 0xbb, 0x35, 0xe7, 0xdf, - 0x99, 0x34, 0x0b, 0xf3, 0x9d, 0xe4, 0x9f, 0x70, 0x77, 0x83, 0x7a, 0x2b, 0x71, 0x18, 0x56, 0x1a, - 0x89, 0x51, 0x19, 0x38, 0xe8, 0x51, 0xc6, 0xab, 0x7a, 0x0d, 0xd5, 0xc1, 0x5c, 0x85, 0x85, 0xd3, - 0x1b, 0xb5, 0xf2, 0x59, 0x98, 0x26, 0xd5, 0x26, 0x61, 0x6d, 0xef, 0x19, 0x1b, 0xa3, 0xd3, 0xa1, - 0xca, 0x4b, 0xbb, 0x69, 0x38, 0x28, 0xa7, 0xa3, 0x5d, 0x00, 0xd3, 0x2a, 0x40, 0xa8, 0xd4, 0x2b, - 0x68, 0x27, 0x33, 0x9c, 0x9b, 0xb9, 0x50, 0x8f, 0xa2, 0x6d, 0x5a, 0xaf, 0xbe, 0xfe, 0x7a, 0x37, - 0x50, 0x44, 0xe3, 0xf8, 0x5c, 0x57, 0x13, 0x3a, 0x00, 0xf0, 0xea, 0x89, 0xe0, 0xa0, 0xf9, 0x73, - 0x41, 0x9f, 0x16, 0xff, 0xdc, 0x42, 0xbf, 0xed, 0x5a, 0xc4, 0x92, 0x14, 0xb1, 0x80, 0xe6, 0x7a, - 0x89, 0x10, 0xc9, 0x88, 0xb5, 0x24, 0x82, 0x78, 0x4b, 0xdf, 0x34, 0xdb, 0xe8, 0x13, 0x80, 0x57, - 0xfe, 0xda, 0x6b, 0x74, 0xe7, 0x5c, 0xcc, 0xba, 0xa7, 0x2e, 0x37, 0xd7, 0x5f, 0xb3, 0x16, 0x35, - 0x25, 0x45, 0x4d, 0xa0, 0x62, 0x2f, 0x51, 0xad, 0xa0, 0x7c, 0x03, 0x70, 0xa4, 0xcb, 0x8a, 0xa2, - 0xbb, 0x17, 0xe1, 0xd1, 0x25, 0x15, 0xb9, 0x7b, 0xfd, 0x0f, 0xd0, 0x62, 0xe6, 0xa5, 0x98, 0x59, - 0x74, 0xab, 0x97, 0x98, 0x8a, 0xec, 0x5e, 0x13, 0xb2, 0x1d, 0x6f, 0xc9, 0xfc, 0x6d, 0x97, 0x1f, - 0xef, 0x1d, 0x1a, 0x60, 0xff, 0xd0, 0x00, 0x3f, 0x0f, 0x0d, 0xf0, 0xf6, 0xc8, 0x48, 0xed, 0x1f, - 0x19, 0xa9, 0x83, 0x23, 0x23, 0xf5, 0x7c, 0xba, 0xe3, 0xd6, 0xed, 0x3e, 0xfa, 0x65, 0x7b, 0xb8, - 0xbc, 0x84, 0x9d, 0xb4, 0xbc, 0x89, 0x66, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x29, 0xa4, - 0xd2, 0x39, 0x08, 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) - // SpendableBalances queries the spenable balance of all coins for a single account. - SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) - // VestingAccounts returns all the existing vesting accounts - VestingAccounts(ctx context.Context, in *QueryVestingAccountsRequest, opts ...grpc.CallOption) (*QueryVestingAccountsResponse, error) - // VestingAccounts returns all the existing vesting accounts - VestingLockedSupply(ctx context.Context, in *QueryVestingLockedSupplyRequest, opts ...grpc.CallOption) (*QueryVestingLockedSupplyResponse, 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, "/quasarlabs.quasarnode.qvesting.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) { - out := new(QuerySpendableBalancesResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qvesting.Query/SpendableBalances", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) VestingAccounts(ctx context.Context, in *QueryVestingAccountsRequest, opts ...grpc.CallOption) (*QueryVestingAccountsResponse, error) { - out := new(QueryVestingAccountsResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qvesting.Query/VestingAccounts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) VestingLockedSupply(ctx context.Context, in *QueryVestingLockedSupplyRequest, opts ...grpc.CallOption) (*QueryVestingLockedSupplyResponse, error) { - out := new(QueryVestingLockedSupplyResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qvesting.Query/VestingLockedSupply", in, out, opts...) - if err != nil { - return nil, err - } - 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) - // SpendableBalances queries the spenable balance of all coins for a single account. - SpendableBalances(context.Context, *QuerySpendableBalancesRequest) (*QuerySpendableBalancesResponse, error) - // VestingAccounts returns all the existing vesting accounts - VestingAccounts(context.Context, *QueryVestingAccountsRequest) (*QueryVestingAccountsResponse, error) - // VestingAccounts returns all the existing vesting accounts - VestingLockedSupply(context.Context, *QueryVestingLockedSupplyRequest) (*QueryVestingLockedSupplyResponse, 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 (*UnimplementedQueryServer) SpendableBalances(ctx context.Context, req *QuerySpendableBalancesRequest) (*QuerySpendableBalancesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SpendableBalances not implemented") -} -func (*UnimplementedQueryServer) VestingAccounts(ctx context.Context, req *QueryVestingAccountsRequest) (*QueryVestingAccountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VestingAccounts not implemented") -} -func (*UnimplementedQueryServer) VestingLockedSupply(ctx context.Context, req *QueryVestingLockedSupplyRequest) (*QueryVestingLockedSupplyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VestingLockedSupply 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: "/quasarlabs.quasarnode.qvesting.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 _Query_SpendableBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySpendableBalancesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SpendableBalances(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qvesting.Query/SpendableBalances", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SpendableBalances(ctx, req.(*QuerySpendableBalancesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_VestingAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVestingAccountsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).VestingAccounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qvesting.Query/VestingAccounts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).VestingAccounts(ctx, req.(*QueryVestingAccountsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_VestingLockedSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVestingLockedSupplyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).VestingLockedSupply(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qvesting.Query/VestingLockedSupply", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).VestingLockedSupply(ctx, req.(*QueryVestingLockedSupplyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.qvesting.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "SpendableBalances", - Handler: _Query_SpendableBalances_Handler, - }, - { - MethodName: "VestingAccounts", - Handler: _Query_VestingAccounts_Handler, - }, - { - MethodName: "VestingLockedSupply", - Handler: _Query_VestingLockedSupply_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/qvesting/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 (m *QuerySpendableBalancesRequest) 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 *QuerySpendableBalancesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpendableBalancesRequest) 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 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 *QuerySpendableBalancesResponse) 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 *QuerySpendableBalancesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpendableBalancesResponse) 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 len(m.Balances) > 0 { - for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Balances[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 *QueryVestingAccountsRequest) 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 *QueryVestingAccountsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVestingAccountsRequest) 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 - } - return len(dAtA) - i, nil -} - -func (m *QueryVestingAccountsResponse) 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 *QueryVestingAccountsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVestingAccountsResponse) 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 len(m.Accounts) > 0 { - for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Accounts[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 *QueryVestingLockedSupplyRequest) 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 *QueryVestingLockedSupplyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVestingLockedSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryVestingLockedSupplyResponse) 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 *QueryVestingLockedSupplyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVestingLockedSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Amount.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 (m *QuerySpendableBalancesRequest) 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 *QuerySpendableBalancesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Balances) > 0 { - for _, e := range m.Balances { - 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 *QueryVestingAccountsRequest) 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 *QueryVestingAccountsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Accounts) > 0 { - for _, e := range m.Accounts { - 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 *QueryVestingLockedSupplyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryVestingLockedSupplyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Amount.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 *QuerySpendableBalancesRequest) 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: QuerySpendableBalancesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpendableBalancesRequest: 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 - 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 *QuerySpendableBalancesResponse) 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: QuerySpendableBalancesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpendableBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Balances", 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.Balances = append(m.Balances, types.Coin{}) - if err := m.Balances[len(m.Balances)-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 *QueryVestingAccountsRequest) 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: QueryVestingAccountsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVestingAccountsRequest: 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 *QueryVestingAccountsResponse) 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: QueryVestingAccountsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVestingAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accounts", 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.Accounts = append(m.Accounts, &types1.Any{}) - if err := m.Accounts[len(m.Accounts)-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 *QueryVestingLockedSupplyRequest) 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: QueryVestingLockedSupplyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVestingLockedSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = 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 *QueryVestingLockedSupplyResponse) 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: QueryVestingLockedSupplyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVestingLockedSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount.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/qvesting/types/query.pb.gw.go b/x/qvesting/types/query.pb.gw.go deleted file mode 100644 index dadb37727..000000000 --- a/x/qvesting/types/query.pb.gw.go +++ /dev/null @@ -1,456 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: quasarlabs/quasarnode/qvesting/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 - -} - -var ( - filter_Query_SpendableBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_SpendableBalances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpendableBalancesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", 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_SpendableBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SpendableBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SpendableBalances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpendableBalancesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", 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_SpendableBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SpendableBalances(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_VestingAccounts_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_VestingAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVestingAccountsRequest - 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_VestingAccounts_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.VestingAccounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_VestingAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVestingAccountsRequest - 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_VestingAccounts_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.VestingAccounts(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_VestingLockedSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVestingLockedSupplyRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - msg, err := client.VestingLockedSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_VestingLockedSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVestingLockedSupplyRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - msg, err := server.VestingLockedSupply(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()...) - - }) - - mux.Handle("GET", pattern_Query_SpendableBalances_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_SpendableBalances_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_SpendableBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_VestingAccounts_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_VestingAccounts_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_VestingAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_VestingLockedSupply_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_VestingLockedSupply_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_VestingLockedSupply_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()...) - - }) - - mux.Handle("GET", pattern_Query_SpendableBalances_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_SpendableBalances_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_SpendableBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_VestingAccounts_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_VestingAccounts_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_VestingAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_VestingLockedSupply_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_VestingLockedSupply_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_VestingLockedSupply_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{"quasarlabs", "quasarnode", "qvesting", "params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_SpendableBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"quasarlabs", "quasarnode", "qvesting", "spendable_balances", "address"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_VestingAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"quasarlabs", "quasarnode", "qvesting", "accounts"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_VestingLockedSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"quasarlabs", "quasarnode", "qvesting", "locked_supply", "denom"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_SpendableBalances_0 = runtime.ForwardResponseMessage - - forward_Query_VestingAccounts_0 = runtime.ForwardResponseMessage - - forward_Query_VestingLockedSupply_0 = runtime.ForwardResponseMessage -) diff --git a/x/qvesting/types/tx.pb.go b/x/qvesting/types/tx.pb.go deleted file mode 100644 index c35f164ff..000000000 --- a/x/qvesting/types/tx.pb.go +++ /dev/null @@ -1,762 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/qvesting/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - 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 - -type MsgCreateVestingAccount struct { - FromAddress string `protobuf:"bytes,1,opt,name=fromAddress,proto3" json:"fromAddress,omitempty"` - ToAddress string `protobuf:"bytes,2,opt,name=toAddress,proto3" json:"toAddress,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` - StartTime int64 `protobuf:"varint,4,opt,name=startTime,proto3" json:"startTime,omitempty"` - EndTime int64 `protobuf:"varint,5,opt,name=endTime,proto3" json:"endTime,omitempty"` -} - -func (m *MsgCreateVestingAccount) Reset() { *m = MsgCreateVestingAccount{} } -func (m *MsgCreateVestingAccount) String() string { return proto.CompactTextString(m) } -func (*MsgCreateVestingAccount) ProtoMessage() {} -func (*MsgCreateVestingAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_425421d185001633, []int{0} -} -func (m *MsgCreateVestingAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateVestingAccount.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 *MsgCreateVestingAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateVestingAccount.Merge(m, src) -} -func (m *MsgCreateVestingAccount) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateVestingAccount) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateVestingAccount.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateVestingAccount proto.InternalMessageInfo - -func (m *MsgCreateVestingAccount) GetFromAddress() string { - if m != nil { - return m.FromAddress - } - return "" -} - -func (m *MsgCreateVestingAccount) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *MsgCreateVestingAccount) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Amount - } - return nil -} - -func (m *MsgCreateVestingAccount) GetStartTime() int64 { - if m != nil { - return m.StartTime - } - return 0 -} - -func (m *MsgCreateVestingAccount) GetEndTime() int64 { - if m != nil { - return m.EndTime - } - return 0 -} - -type MsgCreateVestingAccountResponse struct { -} - -func (m *MsgCreateVestingAccountResponse) Reset() { *m = MsgCreateVestingAccountResponse{} } -func (m *MsgCreateVestingAccountResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateVestingAccountResponse) ProtoMessage() {} -func (*MsgCreateVestingAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_425421d185001633, []int{1} -} -func (m *MsgCreateVestingAccountResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateVestingAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateVestingAccountResponse.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 *MsgCreateVestingAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateVestingAccountResponse.Merge(m, src) -} -func (m *MsgCreateVestingAccountResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateVestingAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateVestingAccountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateVestingAccountResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgCreateVestingAccount)(nil), "quasarlabs.quasarnode.qvesting.MsgCreateVestingAccount") - proto.RegisterType((*MsgCreateVestingAccountResponse)(nil), "quasarlabs.quasarnode.qvesting.MsgCreateVestingAccountResponse") -} - -func init() { - proto.RegisterFile("quasarlabs/quasarnode/qvesting/tx.proto", fileDescriptor_425421d185001633) -} - -var fileDescriptor_425421d185001633 = []byte{ - // 371 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0xb1, 0x6e, 0xe2, 0x40, - 0x10, 0xf5, 0x9e, 0x39, 0x4e, 0x2c, 0x9d, 0x85, 0x74, 0x3e, 0x74, 0x5a, 0xfb, 0x68, 0xce, 0xcd, - 0xed, 0x1e, 0xa4, 0x88, 0x94, 0x26, 0x02, 0xca, 0x88, 0xc6, 0x8a, 0x52, 0xa4, 0x5b, 0xdb, 0x1b, - 0xc7, 0x4a, 0xec, 0x05, 0xcf, 0x82, 0xc8, 0x5f, 0x50, 0xa6, 0x4c, 0x9d, 0x2f, 0xa1, 0xa4, 0x4c, - 0x95, 0x44, 0xd0, 0xe4, 0x23, 0x52, 0x44, 0xb6, 0xb1, 0x4c, 0x01, 0x29, 0x52, 0xed, 0xec, 0x7b, - 0x33, 0xb3, 0x6f, 0x66, 0x1f, 0xfe, 0x3b, 0x99, 0x72, 0xe0, 0xe9, 0x2d, 0xf7, 0x80, 0x15, 0x61, - 0x22, 0x03, 0xc1, 0x26, 0x33, 0x01, 0x2a, 0x4a, 0x42, 0xa6, 0xe6, 0x74, 0x9c, 0x4a, 0x25, 0x0d, - 0x52, 0x25, 0xd2, 0x2a, 0x91, 0x96, 0x89, 0x6d, 0xe2, 0x4b, 0x88, 0x25, 0x30, 0x8f, 0x83, 0x60, - 0xb3, 0xae, 0x27, 0x14, 0xef, 0x32, 0x5f, 0x46, 0x49, 0x51, 0xdf, 0x6e, 0x85, 0x32, 0x94, 0x79, - 0xc8, 0xb2, 0xa8, 0x40, 0x3b, 0xef, 0x08, 0xff, 0x1c, 0x41, 0x38, 0x4c, 0x05, 0x57, 0xe2, 0xa2, - 0x68, 0xd5, 0xf7, 0x7d, 0x39, 0x4d, 0x94, 0x61, 0xe3, 0xe6, 0x55, 0x2a, 0xe3, 0x7e, 0x10, 0xa4, - 0x02, 0xc0, 0x44, 0x36, 0x72, 0x1a, 0xee, 0x2e, 0x64, 0xfc, 0xc6, 0x0d, 0x25, 0x4b, 0xfe, 0x5b, - 0xce, 0x57, 0x80, 0xe1, 0xe3, 0x3a, 0x8f, 0xb3, 0x4e, 0xa6, 0x6e, 0xeb, 0x4e, 0xb3, 0xf7, 0x8b, - 0x16, 0x12, 0x69, 0x26, 0x91, 0x6e, 0x25, 0xd2, 0xa1, 0x8c, 0x92, 0xc1, 0xff, 0xe5, 0xb3, 0xa5, - 0x3d, 0xbe, 0x58, 0x4e, 0x18, 0xa9, 0xeb, 0xa9, 0x47, 0x7d, 0x19, 0xb3, 0xed, 0x3c, 0xc5, 0xf1, - 0x0f, 0x82, 0x1b, 0xa6, 0xee, 0xc6, 0x02, 0xf2, 0x02, 0x70, 0xb7, 0xad, 0x33, 0x09, 0xa0, 0x78, - 0xaa, 0xce, 0xa3, 0x58, 0x98, 0x35, 0x1b, 0x39, 0xba, 0x5b, 0x01, 0x86, 0x89, 0x7f, 0x88, 0x24, - 0xc8, 0xb9, 0xef, 0x39, 0x57, 0x5e, 0x4f, 0x6a, 0x6f, 0x0f, 0x16, 0xea, 0xfc, 0xc1, 0xd6, 0x81, - 0xe9, 0x5d, 0x01, 0x63, 0x99, 0x80, 0xe8, 0xdd, 0x23, 0xac, 0x8f, 0x20, 0x34, 0x16, 0x08, 0xb7, - 0xf6, 0xae, 0xe9, 0x98, 0x7e, 0xfe, 0x33, 0xf4, 0xc0, 0x0b, 0xed, 0xd3, 0x2f, 0x16, 0x96, 0xd2, - 0x06, 0x67, 0xcb, 0x35, 0x41, 0xab, 0x35, 0x41, 0xaf, 0x6b, 0x82, 0x16, 0x1b, 0xa2, 0xad, 0x36, - 0x44, 0x7b, 0xda, 0x10, 0xed, 0xb2, 0xbb, 0xb3, 0xc7, 0xfd, 0x06, 0x9b, 0xef, 0x58, 0x2c, 0x5b, - 0xab, 0x57, 0xcf, 0x0d, 0x71, 0xf4, 0x11, 0x00, 0x00, 0xff, 0xff, 0x46, 0x78, 0x8f, 0x41, 0x91, - 0x02, 0x00, 0x00, -} - -func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgCreateVestingAccount) - if !ok { - that2, ok := that.(MsgCreateVestingAccount) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.FromAddress != that1.FromAddress { - return false - } - if this.ToAddress != that1.ToAddress { - return false - } - if len(this.Amount) != len(that1.Amount) { - return false - } - for i := range this.Amount { - if !this.Amount[i].Equal(&that1.Amount[i]) { - return false - } - } - if this.StartTime != that1.StartTime { - return false - } - if this.EndTime != that1.EndTime { - return false - } - return true -} - -// 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 { - CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) { - out := new(MsgCreateVestingAccountResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.qvesting.Msg/CreateVestingAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - CreateVestingAccount(context.Context, *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) CreateVestingAccount(ctx context.Context, req *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateVestingAccount not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_CreateVestingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateVestingAccount) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateVestingAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/quasarlabs.quasarnode.qvesting.Msg/CreateVestingAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateVestingAccount(ctx, req.(*MsgCreateVestingAccount)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.qvesting.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateVestingAccount", - Handler: _Msg_CreateVestingAccount_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/qvesting/tx.proto", -} - -func (m *MsgCreateVestingAccount) 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 *MsgCreateVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.EndTime != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.EndTime)) - i-- - dAtA[i] = 0x28 - } - if m.StartTime != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.StartTime)) - i-- - dAtA[i] = 0x20 - } - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.FromAddress) > 0 { - i -= len(m.FromAddress) - copy(dAtA[i:], m.FromAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.FromAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreateVestingAccountResponse) 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 *MsgCreateVestingAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateVestingAccountResponse) 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 *MsgCreateVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - if m.StartTime != 0 { - n += 1 + sovTx(uint64(m.StartTime)) - } - if m.EndTime != 0 { - n += 1 + sovTx(uint64(m.EndTime)) - } - return n -} - -func (m *MsgCreateVestingAccountResponse) 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 *MsgCreateVestingAccount) 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: MsgCreateVestingAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", 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.FromAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-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 StartTime", wireType) - } - m.StartTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - m.EndTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndTime |= int64(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 *MsgCreateVestingAccountResponse) 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: MsgCreateVestingAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateVestingAccountResponse: 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/qvesting/types/types.go b/x/qvesting/types/types.go deleted file mode 100644 index ab1254f4c..000000000 --- a/x/qvesting/types/types.go +++ /dev/null @@ -1 +0,0 @@ -package types diff --git a/x/tokenfactory/README.md b/x/tokenfactory/README.md index 51cc57f17..fcc914650 100644 --- a/x/tokenfactory/README.md +++ b/x/tokenfactory/README.md @@ -163,8 +163,8 @@ To create a new token, use the create-denom command from the tokenfactory module To create a new token we can use the create-denom command. ```sh -quasarnoded tx tokenfactory create-denom ufoo --keyring-backend=test --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 -quasarnoded q tokenfactory denom-authority-metadata factory/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec/ufoo --node tcp://localhost:26659 +quasard tx tokenfactory create-denom ufoo --keyring-backend=test --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 +quasard q tokenfactory denom-authority-metadata factory/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec/ufoo --node tcp://localhost:26659 ``` @@ -172,16 +172,16 @@ quasarnoded q tokenfactory denom-authority-metadata factory/quasar1sqlsc5024ssz Once a new token is created, it can be minted using the mint command in the tokenfactory module. Note that the complete tokenfactory address, in the format of factory/{creator address}/{subdenom}, must be used to mint the token. ```sh -quasarnoded tx tokenfactory mint 100000000000factory/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec/ufoo --keyring-backend=test --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 +quasard tx tokenfactory mint 100000000000factory/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec/ufoo --keyring-backend=test --from alice --keyring-backend test --home ~/.quasarnode --chain-id quasar --node tcp://localhost:26659 ``` ## Checking Token metadata To view a token's metadata, use the denom-metadata command in the bank module. The following example queries the metadata for the token factory/osmo1c584m4lq25h83yp6ag8hh4htjr92d954vklzja/ufoo: ```sh -quasarnoded query bank denom-metadata --denom factory/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec/ufoo -quasarnoded q tokenfactory denoms-from-creator quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 -quasarnoded q tokenfactory denom-authority-metadata factory/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec/ufoo --node tcp://localhost:26659 +quasard query bank denom-metadata --denom factory/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec/ufoo +quasard q tokenfactory denoms-from-creator quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +quasard q tokenfactory denom-authority-metadata factory/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec/ufoo --node tcp://localhost:26659 ``` @@ -189,5 +189,5 @@ quasarnoded q tokenfactory denom-authority-metadata factory/quasar1sqlsc5024ssz To see a list of tokens created by a specific account, use the denoms-from-creator command in the tokenfactory module. The following example shows tokens created by the account osmo1c584m4lq25h83yp6ag8hh4htjr92d954vklzja: ```sh -quasarnoded query tokenfactory denoms-from-creator quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec +quasard query tokenfactory denoms-from-creator quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec ``` diff --git a/x/tokenfactory/bindings/custom_query_test.go b/x/tokenfactory/bindings/custom_query_test.go index fea175c1c..c8cc0d2fa 100644 --- a/x/tokenfactory/bindings/custom_query_test.go +++ b/x/tokenfactory/bindings/custom_query_test.go @@ -6,13 +6,11 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/require" - - wasmvmtypes "github.com/CosmWasm/wasmvm/types" + wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/app" - bindings "github.com/quasarlabs/quasarnode/x/tokenfactory/bindings/types" + "github.com/quasar-finance/quasar/app" + bindings "github.com/quasar-finance/quasar/x/tokenfactory/bindings/types" + "github.com/stretchr/testify/require" ) func TestQueryFullDenom(t *testing.T) { diff --git a/x/tokenfactory/bindings/helpers_test.go b/x/tokenfactory/bindings/helpers_test.go index 79229e1a5..28c1b62d9 100644 --- a/x/tokenfactory/bindings/helpers_test.go +++ b/x/tokenfactory/bindings/helpers_test.go @@ -6,17 +6,14 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - + "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/crypto/ed25519" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/CosmWasm/wasmd/x/wasm/keeper" - "github.com/quasarlabs/quasarnode/app" + "github.com/quasar-finance/quasar/app" + "github.com/stretchr/testify/require" ) func CreateTestInput() (*app.TokenApp, sdk.Context) { diff --git a/x/tokenfactory/bindings/message_plugin.go b/x/tokenfactory/bindings/message_plugin.go index 314b7f3da..a12a7d7a4 100644 --- a/x/tokenfactory/bindings/message_plugin.go +++ b/x/tokenfactory/bindings/message_plugin.go @@ -1,19 +1,19 @@ package bindings import ( - errorsmod "cosmossdk.io/errors" "encoding/json" + errorsmod "cosmossdk.io/errors" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" + wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - - bindingstypes "github.com/quasarlabs/quasarnode/x/tokenfactory/bindings/types" - tokenfactorykeeper "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" - tokenfactorytypes "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + bindingstypes "github.com/quasar-finance/quasar/x/tokenfactory/bindings/types" + tokenfactorykeeper "github.com/quasar-finance/quasar/x/tokenfactory/keeper" + tokenfactorytypes "github.com/quasar-finance/quasar/x/tokenfactory/types" ) // CustomMessageDecorator returns decorator for custom CosmWasm bindings messages @@ -39,16 +39,19 @@ var _ wasmkeeper.Messenger = (*CustomMessenger)(nil) // through the CustomMessages struct which is made to implement the wasmkeeper.Messenger. This struct has token factory keeper so has all the capabilities of // the token factory. It also has wasm keeper so after doing its job on token factory, it can call back the wasm keeper function for providing the token factory // function responses. -func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) ([]sdk.Event, [][]byte, error) { +func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, + contractAddr sdk.AccAddress, + contractIBCPortID string, + msg wasmvmtypes.CosmosMsg) ([]sdk.Event, [][]byte, [][]*codectypes.Any, error) { if msg.Custom != nil { // only handle the happy path where this is really creating / minting / swapping ... // leave everything else for the wrapped version var contractMsg bindingstypes.TokenFactoryMsg if err := json.Unmarshal(msg.Custom, &contractMsg); err != nil { - return nil, nil, errorsmod.Wrap(err, "token factory msg") + return nil, nil, nil, errorsmod.Wrap(err, "token factory msg") } if contractMsg.Token == nil { - return nil, nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "nil token field") + return nil, nil, nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "nil token field") } tokenMsg := contractMsg.Token @@ -73,17 +76,23 @@ func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddre } // createDenom creates a new token denom -func (m *CustomMessenger) createDenom(ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindingstypes.CreateDenom) ([]sdk.Event, [][]byte, error) { +func (m *CustomMessenger) createDenom(ctx sdk.Context, + contractAddr sdk.AccAddress, + createDenom *bindingstypes.CreateDenom) ([]sdk.Event, [][]byte, [][]*codectypes.Any, error) { bz, err := PerformCreateDenom(m.tokenFactory, m.bank, ctx, contractAddr, createDenom) if err != nil { - return nil, nil, errorsmod.Wrap(err, "perform create denom") + return nil, nil, nil, errorsmod.Wrap(err, "perform create denom") } // TODO: double check how this is all encoded to the contract - return nil, [][]byte{bz}, nil + return nil, [][]byte{bz}, nil, nil } // PerformCreateDenom is used with createDenom to create a token denom; validates the msgCreateDenom. -func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindingstypes.CreateDenom) ([]byte, error) { +func PerformCreateDenom(f *tokenfactorykeeper.Keeper, + b *bankkeeper.BaseKeeper, + ctx sdk.Context, + contractAddr sdk.AccAddress, + createDenom *bindingstypes.CreateDenom) ([]byte, error) { if createDenom == nil { return nil, wasmvmtypes.InvalidRequest{Err: "create denom null create denom"} } @@ -98,7 +107,7 @@ func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, // Create denom resp, err := msgServer.CreateDenom( - sdk.WrapSDKContext(ctx), + ctx, msgCreateDenom, ) if err != nil { @@ -117,16 +126,21 @@ func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, } // mintTokens mints tokens of a specified denom to an address. -func (m *CustomMessenger) mintTokens(ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) ([]sdk.Event, [][]byte, error) { +func (m *CustomMessenger) mintTokens(ctx sdk.Context, + contractAddr sdk.AccAddress, + mint *bindingstypes.MintTokens) ([]sdk.Event, [][]byte, [][]*codectypes.Any, error) { err := PerformMint(m.tokenFactory, m.bank, ctx, contractAddr, mint) if err != nil { - return nil, nil, errorsmod.Wrap(err, "perform mint") + return nil, nil, nil, errorsmod.Wrap(err, "perform mint") } - return nil, nil, nil + return nil, nil, nil, nil } // PerformMint used with mintTokens to validate the mint message and mint through token factory. -func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) error { +func PerformMint(f *tokenfactorykeeper.Keeper, + b *bankkeeper.BaseKeeper, + ctx sdk.Context, + contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) error { if mint == nil { return wasmvmtypes.InvalidRequest{Err: "mint token null mint"} } @@ -144,7 +158,7 @@ func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk // Mint through token factory / message server msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) - _, err = msgServer.Mint(sdk.WrapSDKContext(ctx), sdkMsg) + _, err = msgServer.Mint(ctx, sdkMsg) if err != nil { return errorsmod.Wrap(err, "minting coins from message") } @@ -161,12 +175,14 @@ func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk } // changeAdmin changes the admin. -func (m *CustomMessenger) changeAdmin(ctx sdk.Context, contractAddr sdk.AccAddress, changeAdmin *bindingstypes.ChangeAdmin) ([]sdk.Event, [][]byte, error) { +func (m *CustomMessenger) changeAdmin(ctx sdk.Context, + contractAddr sdk.AccAddress, + changeAdmin *bindingstypes.ChangeAdmin) ([]sdk.Event, [][]byte, [][]*codectypes.Any, error) { err := ChangeAdmin(m.tokenFactory, ctx, contractAddr, changeAdmin) if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to change admin") + return nil, nil, nil, errorsmod.Wrap(err, "failed to change admin") } - return nil, nil, nil + return nil, nil, nil, nil } // ChangeAdmin is used with changeAdmin to validate changeAdmin messages and to dispatch. @@ -185,7 +201,7 @@ func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk } msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) - _, err = msgServer.ChangeAdmin(sdk.WrapSDKContext(ctx), changeAdminMsg) + _, err = msgServer.ChangeAdmin(ctx, changeAdminMsg) if err != nil { return errorsmod.Wrap(err, "failed changing admin from message") } @@ -193,12 +209,14 @@ func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk } // burnTokens burns tokens. -func (m *CustomMessenger) burnTokens(ctx sdk.Context, contractAddr sdk.AccAddress, burn *bindingstypes.BurnTokens) ([]sdk.Event, [][]byte, error) { +func (m *CustomMessenger) burnTokens(ctx sdk.Context, + contractAddr sdk.AccAddress, + burn *bindingstypes.BurnTokens) ([]sdk.Event, [][]byte, [][]*codectypes.Any, error) { err := PerformBurn(m.tokenFactory, ctx, contractAddr, burn) if err != nil { - return nil, nil, errorsmod.Wrap(err, "perform burn") + return nil, nil, nil, errorsmod.Wrap(err, "perform burn") } - return nil, nil, nil + return nil, nil, nil, nil } // PerformBurn performs token burning after validating tokenBurn message. @@ -221,7 +239,7 @@ func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk // Burn through token factory / message server msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) - _, err := msgServer.Burn(sdk.WrapSDKContext(ctx), sdkMsg) + _, err := msgServer.Burn(ctx, sdkMsg) if err != nil { return errorsmod.Wrap(err, "burning coins from message") } @@ -229,17 +247,21 @@ func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk } // createDenom creates a new token denom -func (m *CustomMessenger) setMetadata(ctx sdk.Context, contractAddr sdk.AccAddress, setMetadata *bindingstypes.SetMetadata) ([]sdk.Event, [][]byte, error) { +func (m *CustomMessenger) setMetadata(ctx sdk.Context, + contractAddr sdk.AccAddress, + setMetadata *bindingstypes.SetMetadata) ([]sdk.Event, [][]byte, [][]*codectypes.Any, error) { err := PerformSetMetadata(m.tokenFactory, m.bank, ctx, contractAddr, setMetadata.Denom, setMetadata.Metadata) if err != nil { - return nil, nil, errorsmod.Wrap(err, "perform create denom") + return nil, nil, nil, errorsmod.Wrap(err, "perform create denom") } - return nil, nil, nil + return nil, nil, nil, nil } // PerformSetMetadata is used with setMetadata to add new metadata // It also is called inside CreateDenom if optional metadata field is set -func PerformSetMetadata(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, denom string, metadata bindingstypes.Metadata) error { +func PerformSetMetadata(f *tokenfactorykeeper.Keeper, + b *bankkeeper.BaseKeeper, + ctx sdk.Context, contractAddr sdk.AccAddress, denom string, metadata bindingstypes.Metadata) error { // ensure contract address is admin of denom auth, err := f.GetAuthorityMetadata(ctx, denom) if err != nil { diff --git a/x/tokenfactory/bindings/queries.go b/x/tokenfactory/bindings/queries.go index 185dd922d..3714638d3 100644 --- a/x/tokenfactory/bindings/queries.go +++ b/x/tokenfactory/bindings/queries.go @@ -4,27 +4,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - - bindingstypes "github.com/quasarlabs/quasarnode/x/tokenfactory/bindings/types" - tokenfactorykeeper "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" + bindingstypes "github.com/quasar-finance/quasar/x/tokenfactory/bindings/types" ) -// QueryPlugin represents a plugin that provides query functionalities related -// to banking and token factory modules. -type QueryPlugin struct { - bankKeeper *bankkeeper.BaseKeeper - tokenFactoryKeeper *tokenfactorykeeper.Keeper -} - -// NewQueryPlugin returns a reference to a new QueryPlugin object. -func NewQueryPlugin(b *bankkeeper.BaseKeeper, tfk *tokenfactorykeeper.Keeper) *QueryPlugin { - return &QueryPlugin{ - bankKeeper: b, - tokenFactoryKeeper: tfk, - } -} - // GetDenomAdmin is a query to get denom admin. func (qp QueryPlugin) GetDenomAdmin(ctx sdk.Context, denom string) (*bindingstypes.AdminResponse, error) { metadata, err := qp.tokenFactoryKeeper.GetAuthorityMetadata(ctx, denom) @@ -36,7 +18,11 @@ func (qp QueryPlugin) GetDenomAdmin(ctx sdk.Context, denom string) (*bindingstyp // GetDenomsByCreator is a query to get list of denom strings created by a creator. func (qp QueryPlugin) GetDenomsByCreator(ctx sdk.Context, creator string) (*bindingstypes.DenomsByCreatorResponse, error) { - // TODO: validate creator address + //validate creator address + _, err := sdk.AccAddressFromBech32(creator) + if err != nil { + return nil, fmt.Errorf("invalid creator address: %s", creator) + } denoms := qp.tokenFactoryKeeper.GetDenomsFromCreator(ctx, creator) return &bindingstypes.DenomsByCreatorResponse{Denoms: denoms}, nil } diff --git a/x/tokenfactory/bindings/query_plugin.go b/x/tokenfactory/bindings/query_plugin.go index 656aa748b..cb5f16cfe 100644 --- a/x/tokenfactory/bindings/query_plugin.go +++ b/x/tokenfactory/bindings/query_plugin.go @@ -1,17 +1,33 @@ package bindings import ( - errorsmod "cosmossdk.io/errors" "encoding/json" "fmt" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" + errorsmod "cosmossdk.io/errors" + wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - bindingstypes "github.com/quasarlabs/quasarnode/x/tokenfactory/bindings/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bindingstypes "github.com/quasar-finance/quasar/x/tokenfactory/bindings/types" + tokenfactorykeeper "github.com/quasar-finance/quasar/x/tokenfactory/keeper" ) +// QueryPlugin represents a plugin that provides query functionalities related +// to banking and token factory modules. +type QueryPlugin struct { + bankKeeper *bankkeeper.BaseKeeper + tokenFactoryKeeper *tokenfactorykeeper.Keeper +} + +// NewQueryPlugin returns a reference to a new QueryPlugin object. +func NewQueryPlugin(b *bankkeeper.BaseKeeper, tfk *tokenfactorykeeper.Keeper) *QueryPlugin { + return &QueryPlugin{ + bankKeeper: b, + tokenFactoryKeeper: tfk, + } +} + // CustomQuerier dispatches custom CosmWasm bindings queries. func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { return func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { @@ -104,8 +120,8 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag } // ConvertSdkCoinsToWasmCoins converts sdk type coins to wasm vm type coins -func ConvertSdkCoinsToWasmCoins(coins []sdk.Coin) wasmvmtypes.Coins { - var toSend wasmvmtypes.Coins +func ConvertSdkCoinsToWasmCoins(coins []sdk.Coin) []wasmvmtypes.Coin { + var toSend []wasmvmtypes.Coin for _, coin := range coins { c := ConvertSdkCoinToWasmCoin(coin) toSend = append(toSend, c) diff --git a/x/tokenfactory/bindings/types/types.go b/x/tokenfactory/bindings/types/types.go index 2c75feebb..4eeeed90a 100644 --- a/x/tokenfactory/bindings/types/types.go +++ b/x/tokenfactory/bindings/types/types.go @@ -1,7 +1,7 @@ package types import ( - wasmvmtypes "github.com/CosmWasm/wasmvm/types" + wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" ) type Metadata struct { diff --git a/x/tokenfactory/bindings/validate_msg_test.go b/x/tokenfactory/bindings/validate_msg_test.go index d50761e48..56c8481c5 100644 --- a/x/tokenfactory/bindings/validate_msg_test.go +++ b/x/tokenfactory/bindings/validate_msg_test.go @@ -6,11 +6,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - - wasmbinding "github.com/quasarlabs/quasarnode/x/tokenfactory/bindings" - bindings "github.com/quasarlabs/quasarnode/x/tokenfactory/bindings/types" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" - + wasmbinding "github.com/quasar-finance/quasar/x/tokenfactory/bindings" + bindings "github.com/quasar-finance/quasar/x/tokenfactory/bindings/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/stretchr/testify/require" ) diff --git a/x/tokenfactory/bindings/validate_queries_test.go b/x/tokenfactory/bindings/validate_queries_test.go index b5c276170..650a61fff 100644 --- a/x/tokenfactory/bindings/validate_queries_test.go +++ b/x/tokenfactory/bindings/validate_queries_test.go @@ -5,12 +5,10 @@ import ( "fmt" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" + wasmbinding "github.com/quasar-finance/quasar/x/tokenfactory/bindings" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - sdk "github.com/cosmos/cosmos-sdk/types" - - wasmbinding "github.com/quasarlabs/quasarnode/x/tokenfactory/bindings" ) func TestFullDenom(t *testing.T) { diff --git a/x/tokenfactory/bindings/wasm.go b/x/tokenfactory/bindings/wasm.go index 825d49b75..bddf446b0 100644 --- a/x/tokenfactory/bindings/wasm.go +++ b/x/tokenfactory/bindings/wasm.go @@ -3,8 +3,7 @@ package bindings import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - - tokenfactorykeeper "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" + tokenfactorykeeper "github.com/quasar-finance/quasar/x/tokenfactory/keeper" ) func RegisterCustomPlugins( diff --git a/x/tokenfactory/client/cli/query.go b/x/tokenfactory/client/cli/query.go index f643ab7c6..fbf6f3318 100644 --- a/x/tokenfactory/client/cli/query.go +++ b/x/tokenfactory/client/cli/query.go @@ -5,9 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) // GetQueryCmd returns the cli query commands for this module @@ -25,6 +24,7 @@ func GetQueryCmd() *cobra.Command { GetParams(), GetCmdDenomAuthorityMetadata(), GetCmdDenomsFromCreator(), + GetCmdAllBeforeSendHooks(), ) return cmd @@ -114,3 +114,27 @@ func GetCmdDenomsFromCreator() *cobra.Command { return cmd } + +func GetCmdAllBeforeSendHooks() *cobra.Command { + cmd := &cobra.Command{ + Use: "all-before-send-hooks", + Short: "Returns a list of all before send hooks registered", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.AllBeforeSendHooksAddresses(cmd.Context(), &types.QueryAllBeforeSendHooksAddressesRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/tokenfactory/client/cli/tx.go b/x/tokenfactory/client/cli/tx.go index e8b928bdc..786e08009 100644 --- a/x/tokenfactory/client/cli/tx.go +++ b/x/tokenfactory/client/cli/tx.go @@ -7,9 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) // GetTxCmd returns the transaction commands for this module @@ -29,6 +28,7 @@ func GetTxCmd() *cobra.Command { NewMintToCmd(), NewBurnFromCmd(), NewChangeAdminCmd(), + NewSetBeforeSendHookCmd(), ) return cmd @@ -261,3 +261,34 @@ func NewBurnFromCmd() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } + +func NewSetBeforeSendHookCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-beforesend-hook [denom] [cosmwasm-address] [flags]", + Short: "Set a cosmwasm contract to be the beforesend hook for a factory-created denom. Must have admin authority to do so.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + msg := types.NewMsgSetBeforeSendHook( + clientCtx.GetFromAddress().String(), + args[0], + args[1], + ) + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/tokenfactory/keeper/admins.go b/x/tokenfactory/keeper/admins.go index 60103c405..bc315d616 100644 --- a/x/tokenfactory/keeper/admins.go +++ b/x/tokenfactory/keeper/admins.go @@ -3,8 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/gogoproto/proto" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "github.com/quasar-finance/quasar/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 new file mode 100644 index 000000000..8a6ee3102 --- /dev/null +++ b/x/tokenfactory/keeper/admins_test.go @@ -0,0 +1,535 @@ +package keeper_test + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + appparams "github.com/quasar-finance/quasar/app/params" + "github.com/quasar-finance/quasar/x/tokenfactory/types" +) + +func (s *KeeperTestSuite) TestAdminMsgs() { + addr0bal := int64(0) + addr1bal := int64(0) + + bankKeeper := s.App.BankKeeper + + s.CreateDefaultDenom() + // Make sure that the admin is set correctly + queryRes, err := s.queryClient.DenomAuthorityMetadata(s.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{ + Denom: s.defaultDenom, + }) + s.Require().NoError(err) + s.Require().Equal(s.TestAccs[0].String(), queryRes.AuthorityMetadata.Admin) + + // Test minting to admins own account + _, err = s.msgServer.Mint(s.Ctx, types.NewMsgMint(s.TestAccs[0].String(), sdk.NewInt64Coin(s.defaultDenom, 10))) + addr0bal += 10 + s.Require().NoError(err) + s.Require().True(bankKeeper.GetBalance(s.Ctx, s.TestAccs[0], s.defaultDenom).Amount.Int64() == addr0bal, bankKeeper.GetBalance(s.Ctx, s.TestAccs[0], s.defaultDenom)) + + // Test minting to a different account + _, err = s.msgServer.Mint(s.Ctx, types.NewMsgMintTo(s.TestAccs[0].String(), sdk.NewInt64Coin(s.defaultDenom, 10), s.TestAccs[1].String())) + addr1bal += 10 + s.Require().NoError(err) + s.Require().True(s.App.BankKeeper.GetBalance(s.Ctx, s.TestAccs[1], s.defaultDenom).Amount.Int64() == addr1bal, s.App.BankKeeper.GetBalance(s.Ctx, s.TestAccs[1], s.defaultDenom)) + + // Test force transferring + govModuleAccount := s.App.AccountKeeper.GetModuleAccount(s.Ctx, govtypes.ModuleName) + _, err = s.msgServer.ForceTransfer(s.Ctx, types.NewMsgForceTransfer(govModuleAccount.GetAddress().String(), sdk.NewInt64Coin(s.defaultDenom, 5), s.TestAccs[1].String(), s.TestAccs[0].String())) + addr1bal -= 5 + addr0bal += 5 + s.Require().NoError(err) + s.Require().True(s.App.BankKeeper.GetBalance(s.Ctx, s.TestAccs[0], s.defaultDenom).Amount.Int64() == addr0bal, s.App.BankKeeper.GetBalance(s.Ctx, s.TestAccs[0], s.defaultDenom)) + s.Require().True(s.App.BankKeeper.GetBalance(s.Ctx, s.TestAccs[1], s.defaultDenom).Amount.Int64() == addr1bal, s.App.BankKeeper.GetBalance(s.Ctx, s.TestAccs[1], s.defaultDenom)) + + // Test burning from own account + _, err = s.msgServer.Burn(s.Ctx, types.NewMsgBurn(s.TestAccs[0].String(), sdk.NewInt64Coin(s.defaultDenom, 5))) + s.Require().NoError(err) + s.Require().True(bankKeeper.GetBalance(s.Ctx, s.TestAccs[1], s.defaultDenom).Amount.Int64() == addr1bal) + + // Test Change Admin + _, err = s.msgServer.ChangeAdmin(s.Ctx, types.NewMsgChangeAdmin(s.TestAccs[0].String(), s.defaultDenom, s.TestAccs[1].String())) + s.Require().NoError(err) + queryRes, err = s.queryClient.DenomAuthorityMetadata(s.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{ + Denom: s.defaultDenom, + }) + s.Require().NoError(err) + s.Require().Equal(s.TestAccs[1].String(), queryRes.AuthorityMetadata.Admin) + + // Make sure old admin can no longer do actions + _, err = s.msgServer.Burn(s.Ctx, types.NewMsgBurn(s.TestAccs[0].String(), sdk.NewInt64Coin(s.defaultDenom, 5))) + s.Require().Error(err) + + // Make sure the new admin works + _, err = s.msgServer.Mint(s.Ctx, types.NewMsgMint(s.TestAccs[1].String(), sdk.NewInt64Coin(s.defaultDenom, 5))) + addr1bal += 5 + s.Require().NoError(err) + s.Require().True(bankKeeper.GetBalance(s.Ctx, s.TestAccs[1], s.defaultDenom).Amount.Int64() == addr1bal) + + // Try setting admin to empty + _, err = s.msgServer.ChangeAdmin(s.Ctx, types.NewMsgChangeAdmin(s.TestAccs[1].String(), s.defaultDenom, "")) + s.Require().NoError(err) + queryRes, err = s.queryClient.DenomAuthorityMetadata(s.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{ + Denom: s.defaultDenom, + }) + s.Require().NoError(err) + s.Require().Equal("", queryRes.AuthorityMetadata.Admin) +} + +// TestMintDenom ensures the following properties of the MintMessage: +// * No one can mint tokens for a denom that doesn't exist +// * Only the admin of a denom can mint tokens for it +// * The admin of a denom can mint tokens for it +func (s *KeeperTestSuite) TestMintDenom() { + balances := make(map[string]int64) + for _, acc := range s.TestAccs { + balances[acc.String()] = 0 + } + + // Create a denom + s.CreateDefaultDenom() + + for _, tc := range []struct { + desc string + mintMsg types.MsgMint + expectPass bool + }{ + { + desc: "denom does not exist", + mintMsg: *types.NewMsgMint( + s.TestAccs[0].String(), + sdk.NewInt64Coin("factory/osmo1t7egva48prqmzl59x5ngv4zx0dtrwewc9m7z44/evmos", 10), + ), + expectPass: false, + }, + { + desc: "mint is not by the admin", + mintMsg: *types.NewMsgMintTo( + s.TestAccs[1].String(), + sdk.NewInt64Coin(s.defaultDenom, 10), + s.TestAccs[0].String(), + ), + expectPass: false, + }, + { + desc: "success case - mint to self", + mintMsg: *types.NewMsgMint( + s.TestAccs[0].String(), + sdk.NewInt64Coin(s.defaultDenom, 10), + ), + expectPass: true, + }, + { + desc: "success case - mint to another address", + mintMsg: *types.NewMsgMintTo( + s.TestAccs[0].String(), + sdk.NewInt64Coin(s.defaultDenom, 10), + s.TestAccs[1].String(), + ), + expectPass: true, + }, + { + desc: "error: try minting non-tokenfactory denom", + mintMsg: *types.NewMsgMintTo( + s.TestAccs[0].String(), + sdk.NewInt64Coin(appparams.BaseCoinUnit, 10), + s.TestAccs[1].String(), + ), + expectPass: false, + }, + } { + s.Run(fmt.Sprintf("Case %s", tc.desc), func() { + _, err := s.msgServer.Mint(s.Ctx, &tc.mintMsg) + if tc.expectPass { + s.Require().NoError(err) + balances[tc.mintMsg.MintToAddress] += tc.mintMsg.Amount.Amount.Int64() + } else { + s.Require().Error(err) + } + + mintToAddr, _ := sdk.AccAddressFromBech32(tc.mintMsg.MintToAddress) + bal := s.App.BankKeeper.GetBalance(s.Ctx, mintToAddr, s.defaultDenom).Amount + s.Require().Equal(bal.Int64(), balances[tc.mintMsg.MintToAddress]) + }) + } +} + +func (s *KeeperTestSuite) TestBurnDenom() { + // Create a denom. + s.CreateDefaultDenom() + + // mint 1000 default token for all testAccs + balances := make(map[string]int64) + for _, acc := range s.TestAccs { + _, err := s.msgServer.Mint(s.Ctx, types.NewMsgMintTo(s.TestAccs[0].String(), sdk.NewInt64Coin(s.defaultDenom, 1000), acc.String())) + s.Require().NoError(err) + balances[acc.String()] = 1000 + } + + for _, tc := range []struct { + desc string + burnMsg types.MsgBurn + expectPass bool + }{ + { + desc: "denom does not exist", + burnMsg: *types.NewMsgBurn( + s.TestAccs[0].String(), + sdk.NewInt64Coin("factory/osmo1t7egva48prqmzl59x5ngv4zx0dtrwewc9m7z44/evmos", 10), + ), + expectPass: false, + }, + { + desc: "burn is not by the admin", + burnMsg: *types.NewMsgBurnFrom( + s.TestAccs[1].String(), + sdk.NewInt64Coin(s.defaultDenom, 10), + s.TestAccs[0].String(), + ), + expectPass: false, + }, + { + desc: "burn more than balance", + burnMsg: *types.NewMsgBurn( + s.TestAccs[0].String(), + sdk.NewInt64Coin(s.defaultDenom, 10000), + ), + expectPass: false, + }, + { + desc: "success case - burn from self", + burnMsg: *types.NewMsgBurn( + s.TestAccs[0].String(), + sdk.NewInt64Coin(s.defaultDenom, 10), + ), + expectPass: true, + }, + { + desc: "success case - burn from another address", + burnMsg: *types.NewMsgBurnFrom( + s.TestAccs[0].String(), + sdk.NewInt64Coin(s.defaultDenom, 10), + s.TestAccs[1].String(), + ), + expectPass: true, + }, + } { + s.Run(fmt.Sprintf("Case %s", tc.desc), func() { + _, err := s.msgServer.Burn(s.Ctx, &tc.burnMsg) + if tc.expectPass { + s.Require().NoError(err) + balances[tc.burnMsg.BurnFromAddress] -= tc.burnMsg.Amount.Amount.Int64() + } else { + s.Require().Error(err) + } + + burnFromAddr, _ := sdk.AccAddressFromBech32(tc.burnMsg.BurnFromAddress) + bal := s.App.BankKeeper.GetBalance(s.Ctx, burnFromAddr, s.defaultDenom).Amount + s.Require().Equal(bal.Int64(), balances[tc.burnMsg.BurnFromAddress]) + }) + } +} + +func (s *KeeperTestSuite) TestForceTransferDenom() { + // Create a denom. + s.CreateDefaultDenom() + + // mint 1000 default token for all testAccs + balances := make(map[string]int64) + for _, acc := range s.TestAccs { + _, err := s.msgServer.Mint(s.Ctx, types.NewMsgMintTo(s.TestAccs[0].String(), sdk.NewInt64Coin(s.defaultDenom, 1000), acc.String())) + s.Require().NoError(err) + balances[acc.String()] = 1000 + } + govModuleAccount := s.App.AccountKeeper.GetModuleAccount(s.Ctx, govtypes.ModuleName) + + for _, tc := range []struct { + desc string + forceTransferMsg types.MsgForceTransfer + expectPass bool + }{ + { + desc: "valid force transfer", + forceTransferMsg: *types.NewMsgForceTransfer( + govModuleAccount.GetAddress().String(), + sdk.NewInt64Coin(s.defaultDenom, 10), + s.TestAccs[1].String(), + s.TestAccs[2].String(), + ), + expectPass: true, + }, + { + desc: "denom does not exist", + forceTransferMsg: *types.NewMsgForceTransfer( + govModuleAccount.GetAddress().String(), + sdk.NewInt64Coin("factory/osmo1t7egva48prqmzl59x5ngv4zx0dtrwewc9m7z44/evmos", 10), + s.TestAccs[1].String(), + s.TestAccs[2].String(), + ), + expectPass: false, + }, + { + desc: "forceTransfer is not by the gov module account", + forceTransferMsg: *types.NewMsgForceTransfer( + s.TestAccs[1].String(), + sdk.NewInt64Coin(s.defaultDenom, 10), + s.TestAccs[1].String(), + s.TestAccs[2].String(), + ), + expectPass: false, + }, + { + desc: "forceTransfer is greater than the balance of", + forceTransferMsg: *types.NewMsgForceTransfer( + govModuleAccount.GetAddress().String(), + sdk.NewInt64Coin(s.defaultDenom, 10000), + s.TestAccs[1].String(), + s.TestAccs[2].String(), + ), + expectPass: false, + }, + } { + s.Run(fmt.Sprintf("Case %s", tc.desc), func() { + _, err := s.msgServer.ForceTransfer(s.Ctx, &tc.forceTransferMsg) + if tc.expectPass { + s.Require().NoError(err) + + balances[tc.forceTransferMsg.TransferFromAddress] -= tc.forceTransferMsg.Amount.Amount.Int64() + balances[tc.forceTransferMsg.TransferToAddress] += tc.forceTransferMsg.Amount.Amount.Int64() + } else { + s.Require().Error(err) + } + + fromAddr, err := sdk.AccAddressFromBech32(tc.forceTransferMsg.TransferFromAddress) + s.Require().NoError(err) + fromBal := s.App.BankKeeper.GetBalance(s.Ctx, fromAddr, s.defaultDenom).Amount + s.Require().True(fromBal.Int64() == balances[tc.forceTransferMsg.TransferFromAddress]) + + toAddr, err := sdk.AccAddressFromBech32(tc.forceTransferMsg.TransferToAddress) + s.Require().NoError(err) + toBal := s.App.BankKeeper.GetBalance(s.Ctx, toAddr, s.defaultDenom).Amount + s.Require().True(toBal.Int64() == balances[tc.forceTransferMsg.TransferToAddress]) + }) + } +} + +func (s *KeeperTestSuite) TestChangeAdminDenom() { + for _, tc := range []struct { + desc string + msgChangeAdmin func(denom string) *types.MsgChangeAdmin + expectedChangeAdminPass bool + expectedAdminIndex int + msgMint func(denom string) *types.MsgMint + expectedMintPass bool + }{ + { + desc: "creator admin can't mint after setting to '' ", + msgChangeAdmin: func(denom string) *types.MsgChangeAdmin { + return types.NewMsgChangeAdmin(s.TestAccs[0].String(), denom, "") + }, + expectedChangeAdminPass: true, + expectedAdminIndex: -1, + msgMint: func(denom string) *types.MsgMint { + return types.NewMsgMint(s.TestAccs[0].String(), sdk.NewInt64Coin(denom, 5)) + }, + expectedMintPass: false, + }, + { + desc: "non-admins can't change the existing admin", + msgChangeAdmin: func(denom string) *types.MsgChangeAdmin { + return types.NewMsgChangeAdmin(s.TestAccs[1].String(), denom, s.TestAccs[2].String()) + }, + expectedChangeAdminPass: false, + expectedAdminIndex: 0, + }, + { + desc: "success change admin", + msgChangeAdmin: func(denom string) *types.MsgChangeAdmin { + return types.NewMsgChangeAdmin(s.TestAccs[0].String(), denom, s.TestAccs[1].String()) + }, + expectedAdminIndex: 1, + expectedChangeAdminPass: true, + msgMint: func(denom string) *types.MsgMint { + return types.NewMsgMint(s.TestAccs[1].String(), sdk.NewInt64Coin(denom, 5)) + }, + expectedMintPass: true, + }, + } { + s.Run(fmt.Sprintf("Case %s", tc.desc), func() { + // setup test + s.SetupTest() + + // Create a denom and mint + res, err := s.msgServer.CreateDenom(s.Ctx, types.NewMsgCreateDenom(s.TestAccs[0].String(), "bitcoin")) + s.Require().NoError(err) + + testDenom := res.GetNewTokenDenom() + + _, err = s.msgServer.Mint(s.Ctx, types.NewMsgMint(s.TestAccs[0].String(), sdk.NewInt64Coin(testDenom, 10))) + s.Require().NoError(err) + + _, err = s.msgServer.ChangeAdmin(s.Ctx, tc.msgChangeAdmin(testDenom)) + if tc.expectedChangeAdminPass { + s.Require().NoError(err) + } else { + s.Require().Error(err) + } + + queryRes, err := s.queryClient.DenomAuthorityMetadata(s.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{ + Denom: testDenom, + }) + s.Require().NoError(err) + + // expectedAdminIndex with negative value is assumed as admin with value of "" + const emptyStringAdminIndexFlag = -1 + if tc.expectedAdminIndex == emptyStringAdminIndexFlag { + s.Require().Equal("", queryRes.AuthorityMetadata.Admin) + } else { + s.Require().Equal(s.TestAccs[tc.expectedAdminIndex].String(), queryRes.AuthorityMetadata.Admin) + } + + // we test mint to test if admin authority is performed properly after admin change. + if tc.msgMint != nil { + _, err := s.msgServer.Mint(s.Ctx, tc.msgMint(testDenom)) + if tc.expectedMintPass { + s.Require().NoError(err) + } else { + s.Require().Error(err) + } + } + }) + } +} + +func (s *KeeperTestSuite) TestSetDenomMetaData() { + // setup test + s.SetupTest() + s.CreateDefaultDenom() + + for _, tc := range []struct { + desc string + msgSetDenomMetadata types.MsgSetDenomMetadata + expectedPass bool + }{ + { + desc: "successful set denom metadata", + msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(s.TestAccs[0].String(), banktypes.Metadata{ + Description: "yeehaw", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: s.defaultDenom, + Exponent: 0, + }, + { + Denom: appparams.BaseCoinUnit, + Exponent: 6, + }, + }, + Base: s.defaultDenom, + Display: appparams.BaseCoinUnit, + Name: "OSMO", + Symbol: "OSMO", + }), + expectedPass: true, + }, + { + desc: "non existent factory denom name", + msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(s.TestAccs[0].String(), banktypes.Metadata{ + Description: "yeehaw", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: fmt.Sprintf("factory/%s/litecoin", s.TestAccs[0].String()), + Exponent: 0, + }, + { + Denom: appparams.BaseCoinUnit, + Exponent: 6, + }, + }, + Base: fmt.Sprintf("factory/%s/litecoin", s.TestAccs[0].String()), + Display: appparams.BaseCoinUnit, + Name: "OSMO", + Symbol: "OSMO", + }), + expectedPass: false, + }, + { + desc: "non-factory denom", + msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(s.TestAccs[0].String(), banktypes.Metadata{ + Description: "yeehaw", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: appparams.BaseCoinUnit, + Exponent: 0, + }, + { + Denom: "uosmoo", + Exponent: 6, + }, + }, + Base: appparams.BaseCoinUnit, + Display: "uosmoo", + Name: "OSMO", + Symbol: "OSMO", + }), + expectedPass: false, + }, + { + desc: "wrong admin", + msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(s.TestAccs[1].String(), banktypes.Metadata{ + Description: "yeehaw", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: s.defaultDenom, + Exponent: 0, + }, + { + Denom: appparams.BaseCoinUnit, + Exponent: 6, + }, + }, + Base: s.defaultDenom, + Display: appparams.BaseCoinUnit, + Name: "OSMO", + Symbol: "OSMO", + }), + expectedPass: false, + }, + { + desc: "invalid metadata (missing display denom unit)", + msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(s.TestAccs[0].String(), banktypes.Metadata{ + Description: "yeehaw", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: s.defaultDenom, + Exponent: 0, + }, + }, + Base: s.defaultDenom, + Display: appparams.BaseCoinUnit, + Name: "OSMO", + Symbol: "OSMO", + }), + expectedPass: false, + }, + } { + s.Run(fmt.Sprintf("Case %s", tc.desc), func() { + bankKeeper := s.App.BankKeeper + res, err := s.msgServer.SetDenomMetadata(s.Ctx, &tc.msgSetDenomMetadata) + if tc.expectedPass { + s.Require().NoError(err) + s.Require().NotNil(res) + + md, found := bankKeeper.GetDenomMetaData(s.Ctx, s.defaultDenom) + s.Require().True(found) + s.Require().Equal(tc.msgSetDenomMetadata.Metadata.Name, md.Name) + } else { + s.Require().Error(err) + } + }) + } + +} diff --git a/x/tokenfactory/keeper/bankactions.go b/x/tokenfactory/keeper/bankactions.go index 874abf160..c07b8a67b 100644 --- a/x/tokenfactory/keeper/bankactions.go +++ b/x/tokenfactory/keeper/bankactions.go @@ -1,9 +1,12 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "sort" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) func (k Keeper) mintTo(ctx sdk.Context, amount sdk.Coin, mintTo string) error { @@ -50,3 +53,45 @@ func (k Keeper) burnFrom(ctx sdk.Context, amount sdk.Coin, burnFrom string) erro return k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(amount)) } + +func (k Keeper) forceTransfer(ctx sdk.Context, amount sdk.Coin, fromAddr string, toAddr string) error { + // verify that denom is an x/tokenfactory denom + _, _, err := types.DeconstructDenom(amount.Denom) + if err != nil { + return err + } + + fromAcc, err := sdk.AccAddressFromBech32(fromAddr) + if err != nil { + return err + } + + sortedPermAddrs := make([]string, 0, len(k.permAddrs)) + for moduleName := range k.permAddrs { + sortedPermAddrs = append(sortedPermAddrs, moduleName) + } + sort.Strings(sortedPermAddrs) + + for _, moduleName := range sortedPermAddrs { + account := k.accountKeeper.GetModuleAccount(ctx, moduleName) + if account == nil { + return status.Errorf(codes.NotFound, "account %s not found", moduleName) + } + + if account.GetAddress().Equals(fromAcc) { + return status.Errorf(codes.Internal, "send from module acc not available") + } + } + + fromSdkAddr, err := sdk.AccAddressFromBech32(fromAddr) + if err != nil { + return err + } + + toSdkAddr, err := sdk.AccAddressFromBech32(toAddr) + if err != nil { + return err + } + + return k.bankKeeper.SendCoins(ctx, fromSdkAddr, toSdkAddr, sdk.NewCoins(amount)) +} diff --git a/x/tokenfactory/keeper/before_send.go b/x/tokenfactory/keeper/before_send.go new file mode 100644 index 000000000..21ae2c879 --- /dev/null +++ b/x/tokenfactory/keeper/before_send.go @@ -0,0 +1,180 @@ +package keeper + +import ( + "encoding/json" + "strings" + + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" +) + +func (k Keeper) setBeforeSendHook(ctx sdk.Context, denom string, cosmwasmAddress string) error { + // verify that denom is an x/tokenfactory denom + _, _, err := types.DeconstructDenom(denom) + if err != nil { + return err + } + + store := k.GetDenomPrefixStore(ctx, denom) + + // delete the store for denom prefix store when cosmwasm address is nil + if cosmwasmAddress == "" { + store.Delete([]byte(types.BeforeSendHookAddressPrefixKey)) + return nil + } else { + // if a contract is being set, call the contract using cache context + // to test if the contract is an existing, valid contract. + cacheCtx, _ := ctx.CacheContext() + + cwAddr, err := sdk.AccAddressFromBech32(cosmwasmAddress) + if err != nil { + return err + } + + tempMsg := types.TrackBeforeSendSudoMsg{ + TrackBeforeSend: types.TrackBeforeSendMsg{}, + } + msgBz, err := json.Marshal(tempMsg) + if err != nil { + return err + } + _, err = k.contractKeeper.Sudo(cacheCtx, cwAddr, msgBz) + + if err != nil && strings.Contains(err.Error(), "no such contract") { + return err + } + } + + _, err = sdk.AccAddressFromBech32(cosmwasmAddress) + if err != nil { + return err + } + + store.Set([]byte(types.BeforeSendHookAddressPrefixKey), []byte(cosmwasmAddress)) + + return nil +} + +func (k Keeper) GetBeforeSendHook(ctx sdk.Context, denom string) string { + store := k.GetDenomPrefixStore(ctx, denom) + + bz := store.Get([]byte(types.BeforeSendHookAddressPrefixKey)) + if bz == nil { + return "" + } + + return string(bz) +} + +func (k Keeper) GetAllBeforeSendHooks(ctx sdk.Context) ([]string, []string) { + denomsList := []string{} + beforeSendHooksList := []string{} + + iterator := k.GetAllDenomsIterator(ctx) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + denom := string(iterator.Value()) + + beforeSendHook := k.GetBeforeSendHook(ctx, denom) + if beforeSendHook != "" { + denomsList = append(denomsList, denom) + beforeSendHooksList = append(beforeSendHooksList, beforeSendHook) + } + } + return denomsList, beforeSendHooksList +} + +// Hooks wrapper struct for bank keeper +type Hooks struct { + k Keeper +} + +var _ types.BankHooks = Hooks{} + +// Return the wrapper struct +func (k Keeper) Hooks() Hooks { + return Hooks{k} +} + +// TrackBeforeSend calls the before send listener contract surpresses any errors +func (h Hooks) TrackBeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) { + _ = h.k.callBeforeSendListener(ctx, from, to, amount, false) +} + +// TrackBeforeSend calls the before send listener contract returns any errors +func (h Hooks) BlockBeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) error { + return h.k.callBeforeSendListener(ctx, from, to, amount, true) +} + +// callBeforeSendListener iterates over each coin and sends corresponding sudo msg to the contract address stored in state. +// If blockBeforeSend is true, sudoMsg wraps BlockBeforeSendMsg, otherwise sudoMsg wraps TrackBeforeSendMsg. +// Note that we gas meter trackBeforeSend to prevent infinite contract calls. +// CONTRACT: this should not be called in beginBlock or endBlock since out of gas will cause this method to panic. +func (k Keeper) callBeforeSendListener(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins, blockBeforeSend bool) (err error) { + defer func() { + if r := recover(); r != nil { + err = errorsmod.Wrapf(types.ErrBeforeSendHookOutOfGas, "%v", r) + } + }() + + for _, coin := range amount { + cosmwasmAddress := k.GetBeforeSendHook(ctx, coin.Denom) + if cosmwasmAddress != "" { + cwAddr, err := sdk.AccAddressFromBech32(cosmwasmAddress) + if err != nil { + return err + } + + var msgBz []byte + + // get msgBz, either BlockBeforeSend or TrackBeforeSend + // Note that for trackBeforeSend, we need to gas meter computations to prevent infinite loop + // specifically because module to module sends are not gas metered. + // We don't need to do this for blockBeforeSend since blockBeforeSend is not called during module to module sends. + if blockBeforeSend { + msg := types.BlockBeforeSendSudoMsg{ + BlockBeforeSend: types.BlockBeforeSendMsg{ + From: from.String(), + To: to.String(), + Amount: CWCoinFromSDKCoin(coin), + }, + } + msgBz, err = json.Marshal(msg) + } else { + msg := types.TrackBeforeSendSudoMsg{ + TrackBeforeSend: types.TrackBeforeSendMsg{ + From: from.String(), + To: to.String(), + Amount: CWCoinFromSDKCoin(coin), + }, + } + msgBz, err = json.Marshal(msg) + } + if err != nil { + return err + } + em := sdk.NewEventManager() + + childCtx := ctx.WithGasMeter(storetypes.NewGasMeter(types.BeforeSendHookGasLimit)) + _, err = k.contractKeeper.Sudo(childCtx.WithEventManager(em), cwAddr, msgBz) + if err != nil { + return errorsmod.Wrapf(err, "failed to call before send hook for denom %s", coin.Denom) + } + + // consume gas used for calling contract to the parent ctx + ctx.GasMeter().ConsumeGas(childCtx.GasMeter().GasConsumed(), "track before send gas") + } + } + return nil +} + +// Convert sdk.Coin to wasmvmtypes.Coin +func CWCoinFromSDKCoin(in sdk.Coin) wasmvmtypes.Coin { + return wasmvmtypes.Coin{ + Denom: in.GetDenom(), + Amount: in.Amount.String(), + } +} diff --git a/x/tokenfactory/keeper/createdenom.go b/x/tokenfactory/keeper/createdenom.go index 928909175..26790743d 100644 --- a/x/tokenfactory/keeper/createdenom.go +++ b/x/tokenfactory/keeper/createdenom.go @@ -5,8 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" ) // ConvertToBaseToken converts a fee amount in a whitelisted fee token to the base fee token amount @@ -16,7 +15,7 @@ func (k Keeper) CreateDenom(ctx sdk.Context, creatorAddr string, subdenom string return "", err } - err = k.chargeForCreateDenom(ctx, creatorAddr, subdenom) + err = k.chargeForCreateDenom(ctx, creatorAddr) if err != nil { return "", err } @@ -35,7 +34,10 @@ func (k Keeper) createDenomAfterValidation(ctx sdk.Context, creatorAddr string, Denom: denom, Exponent: 0, }}, - Base: denom, + Base: denom, + Name: denom, + Symbol: denom, + Display: denom, } k.bankKeeper.SetDenomMetaData(ctx, denomMetaData) @@ -73,20 +75,25 @@ func (k Keeper) validateCreateDenom(ctx sdk.Context, creatorAddr string, subdeno return denom, nil } -func (k Keeper) chargeForCreateDenom(ctx sdk.Context, creatorAddr string, subdenom string) (err error) { - // Send creation fee to community pool - creationFee := k.GetParams(ctx).DenomCreationFee - accAddr, err := sdk.AccAddressFromBech32(creatorAddr) - if err != nil { - return err - } - if creationFee != nil && !creationFee.IsZero() { - if err := k.communityPoolKeeper.FundCommunityPool(ctx, creationFee, accAddr); err != nil { +func (k Keeper) chargeForCreateDenom(ctx sdk.Context, creatorAddr string) (err error) { + params := k.GetParams(ctx) + + // if DenomCreationFee is non-zero, transfer the tokens from the creator + // account to community pool + if params.DenomCreationFee != nil { + accAddr, err := sdk.AccAddressFromBech32(creatorAddr) + if err != nil { return err } - } else { - gasIncrease := k.GetParams(ctx).DenomCreationGasConsume - ctx.GasMeter().ConsumeGas(gasIncrease, "consume denom creation gas") + + if err := k.communityPoolKeeper.FundCommunityPool(ctx, params.DenomCreationFee, accAddr); err != nil { + return err + } + } + + // if DenomCreationGasConsume is non-zero, consume the gas + if params.DenomCreationGasConsume != 0 { + ctx.GasMeter().ConsumeGas(params.DenomCreationGasConsume, "consume denom creation gas") } return nil diff --git a/x/tokenfactory/keeper/createdenom_test.go b/x/tokenfactory/keeper/createdenom_test.go index 467a636fd..b4bcb1301 100644 --- a/x/tokenfactory/keeper/createdenom_test.go +++ b/x/tokenfactory/keeper/createdenom_test.go @@ -4,17 +4,17 @@ import ( "fmt" "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/quasarlabs/quasarnode/testutil" + "github.com/quasar-finance/quasar/testutil" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) func TestMsgCreateDenom(t *testing.T) { setup := testutil.NewTestSetup(t) fundAccsAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, - types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)), sdk.NewCoin("uosmo", sdk.NewInt(10000000))) + types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)), sdk.NewCoin("uosmo", math.NewInt(10000000))) for _, acc := range setup.TestAccs { setup.FundAcc(t, acc, fundAccsAmount) } diff --git a/x/tokenfactory/keeper/creators.go b/x/tokenfactory/keeper/creators.go index 570d54b9f..8aa4de776 100644 --- a/x/tokenfactory/keeper/creators.go +++ b/x/tokenfactory/keeper/creators.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,6 +23,6 @@ func (k Keeper) GetDenomsFromCreator(ctx sdk.Context, creator string) []string { return denoms } -func (k Keeper) GetAllDenomsIterator(ctx sdk.Context) sdk.Iterator { +func (k Keeper) GetAllDenomsIterator(ctx sdk.Context) storetypes.Iterator { return k.GetCreatorsPrefixStore(ctx).Iterator(nil, nil) } diff --git a/x/tokenfactory/keeper/genesis.go b/x/tokenfactory/keeper/genesis.go index 016be30c0..d9be68bb4 100644 --- a/x/tokenfactory/keeper/genesis.go +++ b/x/tokenfactory/keeper/genesis.go @@ -2,8 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "github.com/quasar-finance/quasar/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 e28fa7d06..bf83d228c 100644 --- a/x/tokenfactory/keeper/genesis_test.go +++ b/x/tokenfactory/keeper/genesis_test.go @@ -5,10 +5,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/quasar-finance/quasar/testutil" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) func TestGenesis(t *testing.T) { diff --git a/x/tokenfactory/keeper/grpc_query.go b/x/tokenfactory/keeper/grpc_query.go index 666f92666..fda42690f 100644 --- a/x/tokenfactory/keeper/grpc_query.go +++ b/x/tokenfactory/keeper/grpc_query.go @@ -2,10 +2,10 @@ package keeper import ( "context" + "net/url" sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" ) var _ types.QueryServer = Keeper{} @@ -19,7 +19,10 @@ func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*typ func (k Keeper) DenomAuthorityMetadata(ctx context.Context, req *types.QueryDenomAuthorityMetadataRequest) (*types.QueryDenomAuthorityMetadataResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - + decodedDenom, err := url.QueryUnescape(req.Denom) + if err == nil { + req.Denom = decodedDenom + } authorityMetadata, err := k.GetAuthorityMetadata(sdkCtx, req.GetDenom()) if err != nil { return nil, err @@ -33,3 +36,22 @@ func (k Keeper) DenomsFromCreator(ctx context.Context, req *types.QueryDenomsFro denoms := k.GetDenomsFromCreator(sdkCtx, req.GetCreator()) return &types.QueryDenomsFromCreatorResponse{Denoms: denoms}, nil } + +func (k Keeper) BeforeSendHookAddress(ctx context.Context, req *types.QueryBeforeSendHookAddressRequest) (*types.QueryBeforeSendHookAddressResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + decodedDenom, err := url.QueryUnescape(req.Denom) + if err == nil { + req.Denom = decodedDenom + } + + cosmwasmAddress := k.GetBeforeSendHook(sdkCtx, req.GetDenom()) + + return &types.QueryBeforeSendHookAddressResponse{CosmwasmAddress: cosmwasmAddress}, nil +} + +func (k Keeper) AllBeforeSendHooksAddresses(ctx context.Context, req *types.QueryAllBeforeSendHooksAddressesRequest) (*types.QueryAllBeforeSendHooksAddressesResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + denoms, beforesendHookAddresses := k.GetAllBeforeSendHooks(sdkCtx) + + return &types.QueryAllBeforeSendHooksAddressesResponse{Denoms: denoms, BeforeSendHookAddresses: beforesendHookAddresses}, nil +} diff --git a/x/tokenfactory/keeper/keeper.go b/x/tokenfactory/keeper/keeper.go index fbb53064b..819b5b768 100644 --- a/x/tokenfactory/keeper/keeper.go +++ b/x/tokenfactory/keeper/keeper.go @@ -3,24 +3,27 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/log" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" ) type ( Keeper struct { - storeKey storetypes.StoreKey + storeKey storetypes.StoreKey + permAddrs map[string]authtypes.PermissionsForAddress paramSpace paramtypes.Subspace - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + contractKeeper types.ContractKeeper + communityPoolKeeper types.CommunityPoolKeeper } ) @@ -29,6 +32,7 @@ type ( func NewKeeper( storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace, + maccPerms map[string][]string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, communityPoolKeeper types.CommunityPoolKeeper, @@ -37,9 +41,15 @@ func NewKeeper( paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) } + permAddrs := make(map[string]authtypes.PermissionsForAddress) + for name, perms := range maccPerms { + permAddrs[name] = authtypes.NewPermissionsForAddress(name, perms) + } + return Keeper{ storeKey: storeKey, paramSpace: paramSpace, + permAddrs: permAddrs, accountKeeper: accountKeeper, bankKeeper: bankKeeper, @@ -53,28 +63,36 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { } // GetDenomPrefixStore returns the substore for a specific denom -func (k Keeper) GetDenomPrefixStore(ctx sdk.Context, denom string) sdk.KVStore { +func (k Keeper) GetDenomPrefixStore(ctx sdk.Context, denom string) storetypes.KVStore { store := ctx.KVStore(k.storeKey) return prefix.NewStore(store, types.GetDenomPrefixStore(denom)) } // GetCreatorPrefixStore returns the substore for a specific creator address -func (k Keeper) GetCreatorPrefixStore(ctx sdk.Context, creator string) sdk.KVStore { +func (k Keeper) GetCreatorPrefixStore(ctx sdk.Context, creator string) storetypes.KVStore { store := ctx.KVStore(k.storeKey) return prefix.NewStore(store, types.GetCreatorPrefix(creator)) } // GetCreatorsPrefixStore returns the substore that contains a list of creators -func (k Keeper) GetCreatorsPrefixStore(ctx sdk.Context) sdk.KVStore { +func (k Keeper) GetCreatorsPrefixStore(ctx sdk.Context) storetypes.KVStore { store := ctx.KVStore(k.storeKey) return prefix.NewStore(store, types.GetCreatorsPrefix()) } +// Set the wasm keeper. +func (k *Keeper) SetContractKeeper(contractKeeper types.ContractKeeper) { + k.contractKeeper = contractKeeper +} + // CreateModuleAccount creates a module account with minting and burning capabilities // This account isn't intended to store any coins, // it purely mints and burns them on behalf of the admin of respective denoms, // and sends to the relevant address. func (k Keeper) CreateModuleAccount(ctx sdk.Context) { - moduleAcc := authtypes.NewEmptyModuleAccount(types.ModuleName, authtypes.Minter, authtypes.Burner) - k.accountKeeper.SetModuleAccount(ctx, moduleAcc) + k.accountKeeper.GetModuleAccount(ctx, types.ModuleName) +} + +func (k *Keeper) GetGovAuthority(_ sdk.Context) string { + return sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), k.accountKeeper.GetModuleAddress(govtypes.ModuleName)) } diff --git a/x/tokenfactory/keeper/keeper_test.go b/x/tokenfactory/keeper/keeper_test.go new file mode 100644 index 000000000..4e0912b17 --- /dev/null +++ b/x/tokenfactory/keeper/keeper_test.go @@ -0,0 +1,96 @@ +package keeper_test + +import ( + "testing" + + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/quasar-finance/quasar/app/apptesting" + "github.com/quasar-finance/quasar/x/tokenfactory/keeper" + "github.com/quasar-finance/quasar/x/tokenfactory/types" + "github.com/stretchr/testify/suite" +) + +type KeeperTestSuite struct { + apptesting.KeeperTestHelper + + queryClient types.QueryClient + msgServer types.MsgServer + contractKeeper wasmtypes.ContractOpsKeeper + bankMsgServer banktypes.MsgServer + + // defaultDenom is on the suite, as it depends on the creator test address. + defaultDenom string +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +type SudoAuthorizationPolicy struct{} + +func (p SudoAuthorizationPolicy) CanCreateCode(chainAccesscoConfig wasmtypes.ChainAccessConfigs, actor sdk.AccAddress, config wasmtypes.AccessConfig) bool { + return true +} + +func (p SudoAuthorizationPolicy) CanInstantiateContract(config wasmtypes.AccessConfig, actor sdk.AccAddress) bool { + return true +} + +func (p SudoAuthorizationPolicy) CanModifyContract(admin, actor sdk.AccAddress) bool { + return true +} + +func (p SudoAuthorizationPolicy) CanModifyCodeAccessConfig(creator, actor sdk.AccAddress, isSubset bool) bool { + return true +} + +func (s *KeeperTestSuite) SetupTest() { + s.Setup() + // Fund every TestAcc with two denoms, one of which is the denom creation fee + fundAccsAmount := sdk.NewCoins(sdk.NewCoin(apptesting.TestDenom, apptesting.SecondaryAmount)) + fundAccsAmount2 := sdk.NewCoins(sdk.NewCoin("uqsr", apptesting.SecondaryAmount)) + for _, acc := range s.TestAccs { + s.FundAcc(acc, fundAccsAmount) + s.FundAcc(acc, fundAccsAmount2) + } + s.contractKeeper = wasmkeeper.NewGovPermissionKeeper(s.App.WasmKeeper) + s.queryClient = types.NewQueryClient(s.QueryHelper) + s.msgServer = keeper.NewMsgServerImpl(s.App.TfKeeper) + s.bankMsgServer = bankkeeper.NewMsgServerImpl(s.App.BankKeeper) +} + +func (s *KeeperTestSuite) CreateDefaultDenom() { + res, _ := s.msgServer.CreateDenom(s.Ctx, types.NewMsgCreateDenom(s.TestAccs[0].String(), "bitcoin")) + s.defaultDenom = res.GetNewTokenDenom() +} + +func (s *KeeperTestSuite) TestCreateModuleAccount() { + app := s.App + + // setup new next account number + nextAccountNumber := app.AccountKeeper.NextAccountNumber(s.Ctx) + + // remove module account + tokenfactoryModuleAccount := app.AccountKeeper.GetAccount(s.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) + app.AccountKeeper.RemoveAccount(s.Ctx, tokenfactoryModuleAccount) + + // ensure module account was removed + s.Ctx = app.BaseApp.NewContextLegacy(false, tmproto.Header{}) + tokenfactoryModuleAccount = app.AccountKeeper.GetAccount(s.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) + s.Require().Nil(tokenfactoryModuleAccount) + + // create module account + app.TfKeeper.CreateModuleAccount(s.Ctx) + + // check that the module account is now initialized + tokenfactoryModuleAccount = app.AccountKeeper.GetAccount(s.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) + s.Require().NotNil(tokenfactoryModuleAccount) + + // check that the account number of the module account is now initialized correctly + s.Require().Equal(nextAccountNumber+1, tokenfactoryModuleAccount.GetAccountNumber()) +} diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index 5e81b0336..9b816c36c 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -4,9 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" ) type msgServer struct { @@ -97,7 +96,7 @@ func (server msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types. } accountI := server.Keeper.accountKeeper.GetAccount(ctx, sdk.AccAddress(msg.BurnFromAddress)) - _, ok := accountI.(authtypes.ModuleAccountI) + _, ok := accountI.(sdk.ModuleAccountI) if ok { return nil, types.ErrBurnFromModuleAccount } @@ -119,6 +118,35 @@ func (server msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types. return &types.MsgBurnResponse{}, nil } +func (server msgServer) ForceTransfer(goCtx context.Context, msg *types.MsgForceTransfer) (*types.MsgForceTransferResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // checking msg authority is the gov module address + if server.Keeper.GetGovAuthority(ctx) != msg.Authority { + return nil, + govtypes.ErrInvalidSigner.Wrapf( + "invalid authority: expected %s, got %s", + server.Keeper.GetGovAuthority(ctx), msg.Authority, + ) + } + + err := server.Keeper.forceTransfer(ctx, msg.Amount, msg.TransferFromAddress, msg.TransferToAddress) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.TypeMsgForceTransfer, + sdk.NewAttribute(types.AttributeTransferFromAddress, msg.TransferFromAddress), + sdk.NewAttribute(types.AttributeTransferToAddress, msg.TransferToAddress), + sdk.NewAttribute(types.AttributeAmount, msg.Amount.String()), + ), + }) + + return &types.MsgForceTransferResponse{}, nil +} + func (server msgServer) ChangeAdmin(goCtx context.Context, msg *types.MsgChangeAdmin) (*types.MsgChangeAdminResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -176,3 +204,31 @@ func (server msgServer) SetDenomMetadata(goCtx context.Context, msg *types.MsgSe return &types.MsgSetDenomMetadataResponse{}, nil } + +func (server msgServer) SetBeforeSendHook(goCtx context.Context, msg *types.MsgSetBeforeSendHook) (*types.MsgSetBeforeSendHookResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + authorityMetadata, err := server.Keeper.GetAuthorityMetadata(ctx, msg.Denom) + if err != nil { + return nil, err + } + + if msg.Sender != authorityMetadata.GetAdmin() { + return nil, types.ErrUnauthorized + } + + err = server.Keeper.setBeforeSendHook(ctx, msg.Denom, msg.CosmwasmAddress) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.TypeMsgSetBeforeSendHook, + sdk.NewAttribute(types.AttributeDenom, msg.GetDenom()), + sdk.NewAttribute(types.AttributeBeforeSendHookAddress, msg.GetCosmwasmAddress()), + ), + }) + + return &types.MsgSetBeforeSendHookResponse{}, nil +} diff --git a/x/tokenfactory/keeper/params.go b/x/tokenfactory/keeper/params.go index 564e3107e..6bbbac8b0 100644 --- a/x/tokenfactory/keeper/params.go +++ b/x/tokenfactory/keeper/params.go @@ -2,8 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" + "github.com/quasar-finance/quasar/x/tokenfactory/types" ) // GetParams returns the total set params. @@ -16,3 +15,8 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { k.paramSpace.SetParamSet(ctx, ¶ms) } + +// SetParam sets a specific tokenfactory module's parameter with the provided parameter. +func (k Keeper) SetParam(ctx sdk.Context, key []byte, value interface{}) { + k.paramSpace.Set(ctx, key, value) +} diff --git a/x/tokenfactory/keeper/params_test.go b/x/tokenfactory/keeper/params_test.go index 2b49b1585..0b7c27fc1 100644 --- a/x/tokenfactory/keeper/params_test.go +++ b/x/tokenfactory/keeper/params_test.go @@ -3,10 +3,9 @@ package keeper_test import ( "testing" + "github.com/quasar-finance/quasar/testutil" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/testutil" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) func TestGetParams(t *testing.T) { diff --git a/x/tokenfactory/module.go b/x/tokenfactory/module.go index b9bc5c464..6118226b0 100644 --- a/x/tokenfactory/module.go +++ b/x/tokenfactory/module.go @@ -13,7 +13,7 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/appmodule" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -21,16 +21,20 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/quasar-finance/quasar/x/tokenfactory/client/cli" + "github.com/quasar-finance/quasar/x/tokenfactory/keeper" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/spf13/cobra" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/client/cli" - "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasGenesisBasics = AppModuleBasic{} + + _ appmodule.AppModule = AppModule{} + _ module.HasConsensusVersion = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} ) // ---------------------------------------------------------------------------- @@ -50,7 +54,9 @@ func (AppModuleBasic) Name() string { } func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) + // types.RegisterCodec(cdc) + types.RegisterLegacyAminoCodec(cdc) + } // RegisterInterfaces registers the module's interface types @@ -118,6 +124,12 @@ func NewAppModule( } } +// 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 x/tokenfactory module's name. func (am AppModule) Name() string { return am.AppModuleBasic.Name() @@ -144,13 +156,11 @@ func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // InitGenesis performs the x/tokenfactory module's genesis initialization. It // returns no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { var genState types.GenesisState cdc.MustUnmarshalJSON(gs, &genState) am.keeper.InitGenesis(ctx, genState) - - return []abci.ValidatorUpdate{} } // ExportGenesis returns the x/tokenfactory module's exported genesis state as raw @@ -164,10 +174,6 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock executes all ABCI BeginBlock logic respective to the tokenfactory module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} - -// EndBlock executes all ABCI EndBlock logic respective to the tokenfactory module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} +func (am AppModule) BeginBlock(context context.Context) error { + return nil } diff --git a/x/tokenfactory/simulation/sim_msgs.go b/x/tokenfactory/simulation/sim_msgs.go index e52ca2b14..c84c74eda 100644 --- a/x/tokenfactory/simulation/sim_msgs.go +++ b/x/tokenfactory/simulation/sim_msgs.go @@ -4,14 +4,12 @@ package simulation import ( "errors" + sdk "github.com/cosmos/cosmos-sdk/types" legacysimulationtype "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/osmosis-labs/osmosis/osmoutils" - "github.com/quasarlabs/quasarnode/simulation/simtypes" - "github.com/quasarlabs/quasarnode/x/tokenfactory/keeper" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" - - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasar-finance/quasar/simulation/simtypes" + "github.com/quasar-finance/quasar/x/tokenfactory/keeper" + "github.com/quasar-finance/quasar/x/tokenfactory/types" ) // RandomMsgCreateDenom creates a random tokenfactory denom that is no greater than 44 alphanumeric characters diff --git a/x/tokenfactory/testhelpers/consts.go b/x/tokenfactory/testhelpers/consts.go index d7804a372..7e4c8d0f4 100644 --- a/x/tokenfactory/testhelpers/consts.go +++ b/x/tokenfactory/testhelpers/consts.go @@ -1,8 +1,10 @@ package testhelpers -import sdk "github.com/cosmos/cosmos-sdk/types" +import ( + "cosmossdk.io/math" +) var ( SecondaryDenom = "uion" - SecondaryAmount = sdk.NewInt(100000000) + SecondaryAmount = math.NewInt(100000000) ) diff --git a/x/tokenfactory/testhelpers/suite.go b/x/tokenfactory/testhelpers/suite.go index 75098cf38..8063dbc32 100644 --- a/x/tokenfactory/testhelpers/suite.go +++ b/x/tokenfactory/testhelpers/suite.go @@ -15,7 +15,7 @@ import ( var ( Amino = codec.NewLegacyAmino() - AuthzModuleCdc = codec.NewAminoCodec(Amino) + AuthzModuleCdc = codec.NewLegacyAmino() ) func init() { diff --git a/x/tokenfactory/types/authorityMetadata.pb.go b/x/tokenfactory/types/authorityMetadata.pb.go index 988f6166d..bd05452e1 100644 --- a/x/tokenfactory/types/authorityMetadata.pb.go +++ b/x/tokenfactory/types/authorityMetadata.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/tokenfactory/v1beta1/authorityMetadata.proto +// source: quasar/tokenfactory/v1beta1/authorityMetadata.proto package types @@ -36,7 +36,7 @@ func (m *DenomAuthorityMetadata) Reset() { *m = DenomAuthorityMetadata{} func (m *DenomAuthorityMetadata) String() string { return proto.CompactTextString(m) } func (*DenomAuthorityMetadata) ProtoMessage() {} func (*DenomAuthorityMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_59f953360902a04e, []int{0} + return fileDescriptor_64b558c9d0a4ee95, []int{0} } func (m *DenomAuthorityMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -73,31 +73,30 @@ func (m *DenomAuthorityMetadata) GetAdmin() string { } func init() { - proto.RegisterType((*DenomAuthorityMetadata)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.DenomAuthorityMetadata") + proto.RegisterType((*DenomAuthorityMetadata)(nil), "quasar.tokenfactory.v1beta1.DenomAuthorityMetadata") } func init() { - proto.RegisterFile("quasarlabs/quasarnode/tokenfactory/v1beta1/authorityMetadata.proto", fileDescriptor_59f953360902a04e) + proto.RegisterFile("quasar/tokenfactory/v1beta1/authorityMetadata.proto", fileDescriptor_64b558c9d0a4ee95) } -var fileDescriptor_59f953360902a04e = []byte{ - // 244 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x2a, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x4b, 0xf2, - 0xb3, 0x53, 0xf3, 0xd2, 0x12, 0x93, 0x4b, 0xf2, 0x8b, 0x2a, 0xf5, 0xcb, 0x0c, 0x93, 0x52, 0x4b, - 0x12, 0x0d, 0xf5, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x7d, 0x53, 0x4b, 0x12, - 0x53, 0x12, 0x4b, 0x12, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xb4, 0x10, 0x66, 0xe8, 0x21, - 0xcc, 0xd0, 0x43, 0x36, 0x43, 0x0f, 0x6a, 0x86, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x58, 0x9b, - 0x3e, 0x88, 0x05, 0x31, 0x41, 0x4a, 0x2e, 0x39, 0xbf, 0x38, 0x37, 0xbf, 0x58, 0x3f, 0x29, 0xb1, - 0x38, 0x15, 0x6e, 0x5d, 0x72, 0x7e, 0x66, 0x1e, 0x44, 0x5e, 0xc9, 0x8d, 0x4b, 0xcc, 0x25, 0x35, - 0x2f, 0x3f, 0xd7, 0x11, 0xdd, 0x05, 0x42, 0x6a, 0x5c, 0xac, 0x89, 0x29, 0xb9, 0x99, 0x79, 0x12, - 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, 0x02, 0x9f, 0xee, 0xc9, 0xf3, 0x54, 0x26, 0xe6, 0xe6, 0x58, - 0x29, 0x81, 0x85, 0x95, 0x82, 0x20, 0xd2, 0x56, 0x2c, 0x2f, 0x16, 0xc8, 0x33, 0x3a, 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, 0x69, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xf6, 0x20, 0xa9, 0x40, 0x0d, 0x94, 0x92, 0xca, 0x82, 0xd4, - 0xe2, 0x24, 0x36, 0xb0, 0xfb, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xa2, 0x4b, 0xaa, - 0x47, 0x01, 0x00, 0x00, +var fileDescriptor_64b558c9d0a4ee95 = []byte{ + // 240 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x2e, 0x2c, 0x4d, 0x2c, + 0x4e, 0x2c, 0xd2, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x2c, 0x2d, 0xc9, 0xc8, 0x2f, 0xca, 0x2c, + 0xa9, 0xf4, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x92, 0x86, 0x68, 0xd2, 0x43, 0xd6, 0xa4, 0x07, 0xd5, 0x24, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, + 0x56, 0xa7, 0x0f, 0x62, 0x41, 0xb4, 0x48, 0xc9, 0x25, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, 0x27, + 0x25, 0x16, 0xa7, 0xc2, 0xcd, 0x4f, 0xce, 0xcf, 0xcc, 0x83, 0xc8, 0x2b, 0xb9, 0x71, 0x89, 0xb9, + 0xa4, 0xe6, 0xe5, 0xe7, 0x3a, 0xa2, 0x5b, 0x29, 0xa4, 0xc6, 0xc5, 0x9a, 0x98, 0x92, 0x9b, 0x99, + 0x27, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0xf0, 0xe9, 0x9e, 0x3c, 0x4f, 0x65, 0x62, 0x6e, + 0x8e, 0x95, 0x12, 0x58, 0x58, 0x29, 0x08, 0x22, 0x6d, 0xc5, 0xf2, 0x62, 0x81, 0x3c, 0xa3, 0x93, + 0xff, 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, 0x99, 0xa6, 0x67, 0x96, 0x64, + 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x43, 0xdc, 0xaf, 0x9b, 0x96, 0x99, 0x97, 0x98, 0x97, + 0x9c, 0x0a, 0xe5, 0xea, 0x57, 0xa0, 0x86, 0x42, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, + 0x7d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x41, 0x39, 0x18, 0x1b, 0x29, 0x01, 0x00, 0x00, } func (this *DenomAuthorityMetadata) Equal(that interface{}) bool { diff --git a/x/tokenfactory/types/authzcodec/codec.go b/x/tokenfactory/types/authzcodec/codec.go index 366e337a1..0bd313b8a 100644 --- a/x/tokenfactory/types/authzcodec/codec.go +++ b/x/tokenfactory/types/authzcodec/codec.go @@ -9,8 +9,7 @@ import ( ) var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(Amino) + Amino = codec.NewLegacyAmino() ) func init() { diff --git a/x/tokenfactory/types/before_send.go b/x/tokenfactory/types/before_send.go new file mode 100644 index 000000000..5bf0d958c --- /dev/null +++ b/x/tokenfactory/types/before_send.go @@ -0,0 +1,23 @@ +package types + +import wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" + +type BlockBeforeSendSudoMsg struct { + BlockBeforeSend BlockBeforeSendMsg `json:"block_before_send,omitempty"` +} + +type TrackBeforeSendSudoMsg struct { + TrackBeforeSend TrackBeforeSendMsg `json:"track_before_send"` +} + +type TrackBeforeSendMsg struct { + From string `json:"from"` + To string `json:"to"` + Amount wasmvmtypes.Coin `json:"amount"` +} + +type BlockBeforeSendMsg struct { + From string `json:"from"` + To string `json:"to"` + Amount wasmvmtypes.Coin `json:"amount"` +} diff --git a/x/tokenfactory/types/codec.go b/x/tokenfactory/types/codec.go index 02387ba4e..7397be4cd 100644 --- a/x/tokenfactory/types/codec.go +++ b/x/tokenfactory/types/codec.go @@ -2,17 +2,24 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" ) -func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgCreateDenom{}, "quasar/tokenfactory/create-denom", nil) - cdc.RegisterConcrete(&MsgMint{}, "quasar/tokenfactory/mint", nil) - cdc.RegisterConcrete(&MsgBurn{}, "quasar/tokenfactory/burn", nil) - cdc.RegisterConcrete(&MsgChangeAdmin{}, "quasar/tokenfactory/change-admin", nil) +var ( + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) + +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + legacy.RegisterAminoMsg(cdc, &MsgCreateDenom{}, "quasar/tokenfactory/create-denom") + legacy.RegisterAminoMsg(cdc, &MsgMint{}, "quasar/tokenfactory/mint") + legacy.RegisterAminoMsg(cdc, &MsgBurn{}, "quasar/tokenfactory/burn") + legacy.RegisterAminoMsg(cdc, &MsgChangeAdmin{}, "quasar/tokenfactory/change-admin") + legacy.RegisterAminoMsg(cdc, &MsgSetDenomMetadata{}, "quasar/tokenfactory/set-denom-metadata") + legacy.RegisterAminoMsg(cdc, &MsgSetBeforeSendHook{}, "quasar/tokenfactory/set-bef-send-hook") + legacy.RegisterAminoMsg(cdc, &MsgForceTransfer{}, "quasar/tokenfactory/force-transfer") } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -22,24 +29,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgMint{}, &MsgBurn{}, &MsgChangeAdmin{}, + &MsgSetDenomMetadata{}, + &MsgSetBeforeSendHook{}, + &MsgForceTransfer{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) - -func init() { - RegisterCodec(amino) - // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be - // used to properly serialize MsgGrant and MsgExec instances - // Note: these 3 are inlines from authz/codec in 0.46 so we can be compatible with 0.45 - sdk.RegisterLegacyAminoCodec(amino) - // cryptocodec.RegisterCrypto(amino) - RegisterCodec(authzcodec.Amino) - // codec.RegisterEvidences(amino) - - amino.Seal() -} diff --git a/x/tokenfactory/types/constants.go b/x/tokenfactory/types/constants.go new file mode 100644 index 000000000..d73eae781 --- /dev/null +++ b/x/tokenfactory/types/constants.go @@ -0,0 +1,5 @@ +package types + +var ( + BeforeSendHookGasLimit = uint64(500_000) +) diff --git a/x/tokenfactory/types/denoms_test.go b/x/tokenfactory/types/denoms_test.go index 406233100..d8abf68e3 100644 --- a/x/tokenfactory/types/denoms_test.go +++ b/x/tokenfactory/types/denoms_test.go @@ -3,10 +3,9 @@ package types_test import ( "testing" + "github.com/quasar-finance/quasar/cmd/quasard/cmd" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/cmd/quasarnoded/cmd" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) func TestDeconstructDenom(t *testing.T) { diff --git a/x/tokenfactory/types/errors.go b/x/tokenfactory/types/errors.go index e6e2475a7..a3c1d794c 100644 --- a/x/tokenfactory/types/errors.go +++ b/x/tokenfactory/types/errors.go @@ -3,8 +3,9 @@ package types // DONTCOVER import ( - errorsmod "cosmossdk.io/errors" "fmt" + + errorsmod "cosmossdk.io/errors" ) // x/tokenfactory module sentinel errors @@ -19,4 +20,5 @@ var ( ErrCreatorTooLong = errorsmod.Register(ModuleName, 9, fmt.Sprintf("creator too long, max length is %d bytes", MaxCreatorLength)) ErrBurnFromModuleAccount = errorsmod.Register(ModuleName, 10, "burning from Module Account is not allowed") ErrDenomDoesNotExist = errorsmod.Register(ModuleName, 11, "denom does not exist") + ErrBeforeSendHookOutOfGas = errorsmod.Register(ModuleName, 12, "gas meter hit maximum limit") ) diff --git a/x/tokenfactory/types/events.go b/x/tokenfactory/types/events.go index cdacafbf3..31165511e 100644 --- a/x/tokenfactory/types/events.go +++ b/x/tokenfactory/types/events.go @@ -2,16 +2,17 @@ package types // event types const ( - AttributeAmount = "amount" - AttributeMsgSender = "sender" - AttributeCreator = "creator" - AttributeSubdenom = "subdenom" - AttributeNewTokenDenom = "new_token_denom" - AttributeMintToAddress = "mint_to_address" - AttributeBurnFromAddress = "burn_from_address" - AttributeTransferFromAddress = "transfer_from_address" - AttributeTransferToAddress = "transfer_to_address" - AttributeDenom = "denom" - AttributeNewAdmin = "new_admin" - AttributeDenomMetadata = "denom_metadata" + AttributeAmount = "amount" + AttributeMsgSender = "sender" + AttributeCreator = "creator" + AttributeSubdenom = "subdenom" + AttributeNewTokenDenom = "new_token_denom" + AttributeMintToAddress = "mint_to_address" + AttributeBurnFromAddress = "burn_from_address" + AttributeTransferFromAddress = "transfer_from_address" + AttributeTransferToAddress = "transfer_to_address" + AttributeDenom = "denom" + AttributeNewAdmin = "new_admin" + AttributeDenomMetadata = "denom_metadata" + AttributeBeforeSendHookAddress = "before_send_hook_address" ) diff --git a/x/tokenfactory/types/expected_keepers.go b/x/tokenfactory/types/expected_keepers.go index ca2e31575..5660383ae 100644 --- a/x/tokenfactory/types/expected_keepers.go +++ b/x/tokenfactory/types/expected_keepers.go @@ -1,33 +1,46 @@ package types import ( + context "context" + sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + // authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) type BankKeeper interface { // Methods imported from bank should be defined here - GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool) - SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata) + GetDenomMetaData(ctx context.Context, denom string) (banktypes.Metadata, bool) + SetDenomMetaData(ctx context.Context, denomMetaData banktypes.Metadata) - HasSupply(ctx sdk.Context, denom string) bool + HasSupply(ctx context.Context, denom string) bool - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error - HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool + SendCoins(ctx context.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + HasBalance(ctx context.Context, addr sdk.AccAddress, amt sdk.Coin) bool } type AccountKeeper interface { - SetModuleAccount(ctx sdk.Context, macc authtypes.ModuleAccountI) - GetAccount(sdk.Context, sdk.AccAddress) authtypes.AccountI + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI + GetModuleAddress(moduleName string) sdk.AccAddress +} + +// BankHooks event hooks +type BankHooks interface { + TrackBeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) // Must be before any send is executed + BlockBeforeSend(ctx sdk.Context, from, to sdk.AccAddress, amount sdk.Coins) error // Must be before any send is executed } // CommunityPoolKeeper defines the contract needed to be fulfilled for community pool interactions. type CommunityPoolKeeper interface { - FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error +} + +type ContractKeeper interface { + Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error) } diff --git a/x/tokenfactory/types/genesis.pb.go b/x/tokenfactory/types/genesis.pb.go index 5c6c2a48b..0ad30dc3d 100644 --- a/x/tokenfactory/types/genesis.pb.go +++ b/x/tokenfactory/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/tokenfactory/v1beta1/genesis.proto +// source: quasar/tokenfactory/v1beta1/genesis.proto package types @@ -34,7 +34,7 @@ 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_726e243da9e85842, []int{0} + return fileDescriptor_b0b7a07b3fcd95f4, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -89,7 +89,7 @@ func (m *GenesisDenom) Reset() { *m = GenesisDenom{} } func (m *GenesisDenom) String() string { return proto.CompactTextString(m) } func (*GenesisDenom) ProtoMessage() {} func (*GenesisDenom) Descriptor() ([]byte, []int) { - return fileDescriptor_726e243da9e85842, []int{1} + return fileDescriptor_b0b7a07b3fcd95f4, []int{1} } func (m *GenesisDenom) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -133,40 +133,39 @@ func (m *GenesisDenom) GetAuthorityMetadata() DenomAuthorityMetadata { } func init() { - proto.RegisterType((*GenesisState)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.GenesisState") - proto.RegisterType((*GenesisDenom)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.GenesisDenom") + proto.RegisterType((*GenesisState)(nil), "quasar.tokenfactory.v1beta1.GenesisState") + proto.RegisterType((*GenesisDenom)(nil), "quasar.tokenfactory.v1beta1.GenesisDenom") } func init() { - proto.RegisterFile("quasarlabs/quasarnode/tokenfactory/v1beta1/genesis.proto", fileDescriptor_726e243da9e85842) + proto.RegisterFile("quasar/tokenfactory/v1beta1/genesis.proto", fileDescriptor_b0b7a07b3fcd95f4) } -var fileDescriptor_726e243da9e85842 = []byte{ - // 369 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x28, 0x2c, 0x4d, 0x2c, - 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0x4b, 0xf2, - 0xb3, 0x53, 0xf3, 0xd2, 0x12, 0x93, 0x4b, 0xf2, 0x8b, 0x2a, 0xf5, 0xcb, 0x0c, 0x93, 0x52, 0x4b, - 0x12, 0x0d, 0xf5, 0xd3, 0x53, 0xf3, 0x52, 0x8b, 0x33, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, - 0x85, 0xb4, 0x10, 0x3a, 0xf5, 0x10, 0x3a, 0xf5, 0x90, 0x75, 0xea, 0x41, 0x75, 0x4a, 0x89, 0xa4, - 0xe7, 0xa7, 0xe7, 0x83, 0xb5, 0xe9, 0x83, 0x58, 0x10, 0x13, 0xa4, 0x9c, 0x48, 0xb0, 0x3b, 0xb1, - 0xb4, 0x24, 0x23, 0xbf, 0x28, 0xb3, 0xa4, 0xd2, 0x37, 0xb5, 0x24, 0x31, 0x25, 0xb1, 0x24, 0x11, - 0x6a, 0x86, 0x39, 0x09, 0x66, 0x14, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x9d, 0xaf, 0xf4, 0x80, 0x91, - 0x8b, 0xc7, 0x1d, 0xe2, 0xa1, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0xa1, 0x00, 0x2e, 0x36, 0x88, 0x02, - 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x23, 0x3d, 0xe2, 0x3d, 0xa8, 0x17, 0x00, 0xd6, 0xe9, - 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0xd4, 0x1c, 0xa1, 0x3a, 0x2e, 0x3e, 0xa8, 0xba, 0xf8, - 0x94, 0xd4, 0xbc, 0xfc, 0xdc, 0x62, 0x09, 0x26, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x0b, 0x52, 0x4c, - 0x86, 0xba, 0xd1, 0x05, 0x64, 0x80, 0x93, 0x2c, 0xc8, 0xfc, 0x4f, 0xf7, 0xe4, 0x45, 0x2b, 0x13, - 0x73, 0x73, 0xac, 0x94, 0x50, 0x4d, 0x57, 0x0a, 0xe2, 0x85, 0x0a, 0xb8, 0x40, 0xf8, 0x97, 0x11, - 0x5e, 0x04, 0x8b, 0x08, 0xa9, 0x71, 0xb1, 0x82, 0x95, 0x82, 0x7d, 0xc8, 0xe9, 0x24, 0xf0, 0xe9, - 0x9e, 0x3c, 0x0f, 0xc4, 0x24, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0x5a, 0x68, 0x0a, 0x23, 0x97, 0x10, - 0x3c, 0xc0, 0xe3, 0x73, 0xa1, 0x21, 0x2e, 0xc1, 0x04, 0x0e, 0x17, 0x27, 0x52, 0x5c, 0x0f, 0xb6, - 0xd7, 0x11, 0x3d, 0xee, 0x9c, 0x14, 0xa1, 0xfe, 0x90, 0x84, 0xd8, 0x8e, 0x69, 0x97, 0x52, 0x90, - 0x20, 0x46, 0x8c, 0x5b, 0xb1, 0xbc, 0x58, 0x20, 0xcf, 0xe8, 0xe4, 0x7f, 0xe2, 0x91, 0x1c, 0xe3, - 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, - 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xa6, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, - 0xb9, 0xfa, 0xd8, 0x93, 0x45, 0x05, 0x6a, 0xc2, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, - 0x27, 0x08, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x80, 0xca, 0x8a, 0x0b, 0x03, 0x00, - 0x00, +var fileDescriptor_b0b7a07b3fcd95f4 = []byte{ + // 363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2c, 0x2c, 0x4d, 0x2c, + 0x4e, 0x2c, 0xd2, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x86, 0x28, 0xd5, 0x43, 0x56, 0xaa, 0x07, 0x55, 0x2a, + 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa7, 0x0f, 0x62, 0x41, 0xb4, 0x48, 0x19, 0xe3, 0x33, + 0x3d, 0xb1, 0xb4, 0x24, 0x23, 0xbf, 0x28, 0xb3, 0xa4, 0xd2, 0x37, 0xb5, 0x24, 0x31, 0x25, 0xb1, + 0x24, 0x11, 0xaa, 0x49, 0x03, 0x9f, 0xa6, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0x8b, 0x94, 0x0e, + 0x31, 0x72, 0xf1, 0xb8, 0x43, 0xdc, 0x18, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0xe4, 0xc8, 0xc5, 0x06, + 0x51, 0x20, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, 0xac, 0x87, 0xc7, 0xcd, 0x7a, 0x01, 0x60, + 0xa5, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x35, 0x0a, 0xe5, 0x73, 0xf1, 0x41, 0xd5, + 0xc5, 0xa7, 0xa4, 0xe6, 0xe5, 0xe7, 0x16, 0x4b, 0x30, 0x29, 0x30, 0x6b, 0x70, 0x1b, 0x69, 0xe2, + 0x35, 0x0a, 0xea, 0x0a, 0x17, 0x90, 0x0e, 0x27, 0x59, 0x90, 0x81, 0x9f, 0xee, 0xc9, 0x8b, 0x56, + 0x26, 0xe6, 0xe6, 0x58, 0x29, 0xa1, 0x1a, 0xa7, 0x14, 0xc4, 0x0b, 0x15, 0x70, 0x81, 0xf0, 0x8f, + 0x20, 0x3c, 0x01, 0x16, 0x11, 0x52, 0xe3, 0x62, 0x05, 0x2b, 0x05, 0xfb, 0x81, 0xd3, 0x49, 0xe0, + 0xd3, 0x3d, 0x79, 0x1e, 0x88, 0x49, 0x60, 0x61, 0xa5, 0x20, 0x88, 0xb4, 0x50, 0x2b, 0x23, 0x97, + 0x10, 0x3c, 0x0c, 0xe3, 0x73, 0xa1, 0x81, 0x28, 0xc1, 0x04, 0xf6, 0xb9, 0x31, 0x5e, 0xe7, 0x82, + 0x2d, 0x72, 0x44, 0x0f, 0x7f, 0x27, 0x45, 0xa8, 0xc3, 0x25, 0x21, 0xd6, 0x61, 0x1a, 0xae, 0x14, + 0x24, 0x88, 0x11, 0x6b, 0x56, 0x2c, 0x2f, 0x16, 0xc8, 0x33, 0x3a, 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, 0x69, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, + 0x7e, 0xae, 0x3e, 0xc4, 0x51, 0xba, 0x69, 0x99, 0x79, 0x89, 0x79, 0xc9, 0xa9, 0x50, 0xae, 0x7e, + 0x05, 0x6a, 0x5c, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xe3, 0xd8, 0x18, 0x10, 0x00, + 0x00, 0xff, 0xff, 0x10, 0xd1, 0xf2, 0x6a, 0xa2, 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 33be2c3d2..4a171ac88 100644 --- a/x/tokenfactory/types/genesis_test.go +++ b/x/tokenfactory/types/genesis_test.go @@ -3,10 +3,9 @@ package types_test import ( "testing" + "github.com/quasar-finance/quasar/cmd/quasard/cmd" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/cmd/quasarnoded/cmd" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/tokenfactory/types/keys.go b/x/tokenfactory/types/keys.go index fac4a6e39..dd2ed9fe4 100644 --- a/x/tokenfactory/types/keys.go +++ b/x/tokenfactory/types/keys.go @@ -25,10 +25,11 @@ const ( const KeySeparator = "|" var ( - DenomAuthorityMetadataKey = "authoritymetadata" - DenomsPrefixKey = "denoms" - CreatorPrefixKey = "creator" - AdminPrefixKey = "admin" + DenomAuthorityMetadataKey = "authoritymetadata" + DenomsPrefixKey = "denoms" + CreatorPrefixKey = "creator" + AdminPrefixKey = "admin" + BeforeSendHookAddressPrefixKey = "beforesendhook" ) // GetDenomPrefixStore returns the store prefix where all the data associated with a specific denom diff --git a/x/tokenfactory/types/msgs.go b/x/tokenfactory/types/msgs.go index c65baaed2..521964dfc 100644 --- a/x/tokenfactory/types/msgs.go +++ b/x/tokenfactory/types/msgs.go @@ -2,7 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" - + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -10,11 +10,13 @@ import ( // constants const ( - TypeMsgCreateDenom = "create_denom" - TypeMsgMint = "tf_mint" - TypeMsgBurn = "tf_burn" - TypeMsgChangeAdmin = "change_admin" - TypeMsgSetDenomMetadata = "set_denom_metadata" + TypeMsgCreateDenom = "create_denom" + TypeMsgMint = "tf_mint" + TypeMsgBurn = "tf_burn" + TypeMsgForceTransfer = "force_transfer" + TypeMsgChangeAdmin = "change_admin" + TypeMsgSetDenomMetadata = "set_denom_metadata" + TypeMsgSetBeforeSendHook = "set_before_send_hook" ) var _ sdk.Msg = &MsgCreateDenom{} @@ -77,7 +79,7 @@ func (m MsgMint) ValidateBasic() error { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } - if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) { + if !m.Amount.IsValid() || m.Amount.Amount.Equal(math.ZeroInt()) { return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } @@ -120,7 +122,7 @@ func (m MsgBurn) ValidateBasic() error { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } - if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) { + if !m.Amount.IsValid() || m.Amount.Amount.Equal(math.ZeroInt()) { return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } @@ -136,6 +138,47 @@ func (m MsgBurn) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } +var _ sdk.Msg = &MsgForceTransfer{} + +// NewMsgForceTransfer creates a transfer funds from one account to another +func NewMsgForceTransfer(authorityModule string, amount sdk.Coin, fromAddr, toAddr string) *MsgForceTransfer { + return &MsgForceTransfer{ + Authority: authorityModule, + Amount: amount, + TransferFromAddress: fromAddr, + TransferToAddress: toAddr, + } +} + +func (m MsgForceTransfer) Route() string { return RouterKey } +func (m MsgForceTransfer) Type() string { return TypeMsgForceTransfer } +func (m MsgForceTransfer) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + } + + _, err = sdk.AccAddressFromBech32(m.TransferFromAddress) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(m.TransferToAddress) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err) + } + + if !m.Amount.IsValid() { + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) + } + + return nil +} + +func (m MsgForceTransfer) GetSigners() []sdk.AccAddress { + sender, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{sender} +} + var _ sdk.Msg = &MsgChangeAdmin{} // NewMsgChangeAdmin creates a message to burn tokens @@ -216,3 +259,42 @@ func (m MsgSetDenomMetadata) GetSigners() []sdk.AccAddress { sender, _ := sdk.AccAddressFromBech32(m.Sender) return []sdk.AccAddress{sender} } + +var _ sdk.Msg = &MsgSetBeforeSendHook{} + +// NewMsgSetBeforeSendHook creates a message to set a new before send hook +func NewMsgSetBeforeSendHook(sender string, denom string, cosmwasmAddress string) *MsgSetBeforeSendHook { + return &MsgSetBeforeSendHook{ + Sender: sender, + Denom: denom, + CosmwasmAddress: cosmwasmAddress, + } +} + +func (m MsgSetBeforeSendHook) Route() string { return RouterKey } +func (m MsgSetBeforeSendHook) Type() string { return TypeMsgSetBeforeSendHook } +func (m MsgSetBeforeSendHook) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.Sender) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + } + + if m.CosmwasmAddress != "" { + _, err = sdk.AccAddressFromBech32(m.CosmwasmAddress) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid cosmwasm contract address (%s)", err) + } + } + + _, _, err = DeconstructDenom(m.Denom) + if err != nil { + return ErrInvalidDenom + } + + return nil +} + +func (m MsgSetBeforeSendHook) GetSigners() []sdk.AccAddress { + sender, _ := sdk.AccAddressFromBech32(m.Sender) + return []sdk.AccAddress{sender} +} diff --git a/x/tokenfactory/types/msgs_test.go b/x/tokenfactory/types/msgs_test.go index 051638aaa..928461be8 100644 --- a/x/tokenfactory/types/msgs_test.go +++ b/x/tokenfactory/types/msgs_test.go @@ -4,13 +4,13 @@ import ( "fmt" "testing" + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/quasar-finance/quasar/x/tokenfactory/testhelpers" + "github.com/quasar-finance/quasar/x/tokenfactory/types" "github.com/stretchr/testify/require" - - "github.com/quasarlabs/quasarnode/x/tokenfactory/testhelpers" - "github.com/quasarlabs/quasarnode/x/tokenfactory/types" ) // // Test authz serialize and de-serializes for tokenfactory msg. @@ -18,7 +18,7 @@ func TestAuthzMsg(t *testing.T) { t.Skip("TODO: figure out how to register authz interfaces for tests") pk1 := ed25519.GenPrivKey().PubKey() addr1 := sdk.AccAddress(pk1.Address()).String() - coin := sdk.NewCoin("denom", sdk.NewInt(1)) + coin := sdk.NewCoin("denom", math.NewInt(1)) testCases := []struct { name string @@ -136,7 +136,7 @@ func TestMsgMint(t *testing.T) { createMsg := func(after func(msg types.MsgMint) types.MsgMint) types.MsgMint { properMsg := *types.NewMsgMint( addr1.String(), - sdk.NewCoin("bitcoin", sdk.NewInt(500000000)), + sdk.NewCoin("bitcoin", math.NewInt(500000000)), ) return after(properMsg) @@ -175,7 +175,7 @@ func TestMsgMint(t *testing.T) { { name: "zero amount", msg: createMsg(func(msg types.MsgMint) types.MsgMint { - msg.Amount = sdk.NewCoin("bitcoin", sdk.ZeroInt()) + msg.Amount = sdk.NewCoin("bitcoin", math.ZeroInt()) return msg }), expectPass: false, @@ -183,7 +183,7 @@ func TestMsgMint(t *testing.T) { { name: "negative amount", msg: createMsg(func(msg types.MsgMint) types.MsgMint { - msg.Amount.Amount = sdk.NewInt(-10000000) + msg.Amount.Amount = math.NewInt(-10000000) return msg }), expectPass: false, @@ -208,7 +208,7 @@ func TestMsgBurn(t *testing.T) { // make a proper burn message baseMsg := types.NewMsgBurn( addr1.String(), - sdk.NewCoin("bitcoin", sdk.NewInt(500000000)), + sdk.NewCoin("bitcoin", math.NewInt(500000000)), ) // validate burn message was created as intended @@ -244,7 +244,7 @@ func TestMsgBurn(t *testing.T) { name: "zero amount", msg: func() *types.MsgBurn { msg := baseMsg - msg.Amount.Amount = sdk.ZeroInt() + msg.Amount.Amount = math.ZeroInt() return msg }, expectPass: false, @@ -253,7 +253,7 @@ func TestMsgBurn(t *testing.T) { name: "negative amount", msg: func() *types.MsgBurn { msg := baseMsg - msg.Amount.Amount = sdk.NewInt(-10000000) + msg.Amount.Amount = math.NewInt(-10000000) return msg }, expectPass: false, diff --git a/x/tokenfactory/types/params.go b/x/tokenfactory/types/params.go index f20f81154..6e724a052 100644 --- a/x/tokenfactory/types/params.go +++ b/x/tokenfactory/types/params.go @@ -5,8 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - - appparams "github.com/quasarlabs/quasarnode/app/params" + appparams "github.com/quasar-finance/quasar/app/params" ) var _ paramtypes.ParamSet = (*Params)(nil) diff --git a/x/tokenfactory/types/params.pb.go b/x/tokenfactory/types/params.pb.go index 30aee9f18..c53c0cc63 100644 --- a/x/tokenfactory/types/params.pb.go +++ b/x/tokenfactory/types/params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/tokenfactory/v1beta1/params.proto +// source: quasar/tokenfactory/v1beta1/params.proto package types @@ -28,10 +28,14 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the tokenfactory module. type Params struct { + // DenomCreationFee defines the fee to be charged on the creation of a new + // denom. The fee is drawn from the MsgCreateDenom's sender account, and + // transferred to the community pool. DenomCreationFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=denom_creation_fee,json=denomCreationFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"denom_creation_fee" yaml:"denom_creation_fee"` - // if denom_creation_fee is an empty array, then this field is used to add more gas consumption - // to the base cost. - // https://github.com/CosmWasm/token-factory/issues/11 + // DenomCreationGasConsume defines the gas cost for creating a new denom. + // This is intended as a spam deterrence mechanism. + // + // See: https://github.com/CosmWasm/token-factory/issues/11 DenomCreationGasConsume uint64 `protobuf:"varint,2,opt,name=denom_creation_gas_consume,json=denomCreationGasConsume,proto3" json:"denom_creation_gas_consume,omitempty" yaml:"denom_creation_gas_consume"` } @@ -39,7 +43,7 @@ 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_006d2968fb3ee0dd, []int{0} + return fileDescriptor_7907a0525c7d0886, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -83,38 +87,38 @@ func (m *Params) GetDenomCreationGasConsume() uint64 { } func init() { - proto.RegisterType((*Params)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.Params") + proto.RegisterType((*Params)(nil), "quasar.tokenfactory.v1beta1.Params") } func init() { - proto.RegisterFile("quasarlabs/quasarnode/tokenfactory/v1beta1/params.proto", fileDescriptor_006d2968fb3ee0dd) + proto.RegisterFile("quasar/tokenfactory/v1beta1/params.proto", fileDescriptor_7907a0525c7d0886) } -var fileDescriptor_006d2968fb3ee0dd = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x31, 0x4f, 0xc2, 0x50, - 0x10, 0x80, 0x5b, 0x34, 0x0c, 0x75, 0x31, 0x8d, 0x89, 0xc0, 0xd0, 0x62, 0x27, 0x34, 0xb1, 0x0d, - 0x1a, 0x63, 0xe2, 0x58, 0x12, 0x9d, 0x88, 0x86, 0xd1, 0xa5, 0xb9, 0xb6, 0x8f, 0xd2, 0x40, 0xdf, - 0x61, 0xdf, 0xab, 0xb1, 0x3f, 0xc1, 0xcd, 0xc9, 0x1f, 0xe1, 0x2f, 0x61, 0x64, 0x74, 0xaa, 0x06, - 0xfe, 0x01, 0xbf, 0xc0, 0xd0, 0xf7, 0x14, 0x50, 0x16, 0xa7, 0xde, 0xe5, 0xfa, 0x7d, 0x77, 0xf7, - 0x4e, 0xbb, 0x7c, 0xc8, 0x80, 0x41, 0x3a, 0x02, 0x9f, 0x39, 0x22, 0xa4, 0x18, 0x12, 0x87, 0xe3, - 0x90, 0xd0, 0x3e, 0x04, 0x1c, 0xd3, 0xdc, 0x79, 0x6c, 0xfb, 0x84, 0x43, 0xdb, 0x19, 0x43, 0x0a, - 0x09, 0xb3, 0xc7, 0x29, 0x72, 0xd4, 0x4f, 0x56, 0xa0, 0xbd, 0x02, 0xed, 0x75, 0xd0, 0x96, 0x60, - 0xe3, 0x20, 0xc2, 0x08, 0x4b, 0xcc, 0x59, 0x46, 0xc2, 0xd0, 0x70, 0xff, 0xd1, 0x1a, 0x32, 0x3e, - 0xc0, 0x34, 0xe6, 0x79, 0x97, 0x70, 0x08, 0x81, 0x83, 0x74, 0xd4, 0x03, 0x64, 0x09, 0x32, 0x4f, - 0xc8, 0x45, 0x22, 0x4b, 0x86, 0xc8, 0x1c, 0x1f, 0x18, 0xf9, 0xf1, 0x04, 0x18, 0x53, 0x51, 0xb7, - 0x9e, 0x2b, 0x5a, 0xf5, 0xae, 0xdc, 0x48, 0x7f, 0x55, 0x35, 0x3d, 0x24, 0x14, 0x13, 0x2f, 0x48, - 0x09, 0xf0, 0x18, 0xa9, 0xd7, 0x27, 0xa4, 0xa6, 0x36, 0x77, 0x5a, 0x7b, 0x67, 0x75, 0x5b, 0x6a, - 0x97, 0xa2, 0xef, 0x95, 0xec, 0x0e, 0xc6, 0xd4, 0xed, 0x4e, 0x0a, 0x53, 0x59, 0x14, 0x66, 0x3d, - 0x87, 0x64, 0x74, 0x65, 0xfd, 0x55, 0x58, 0x6f, 0x1f, 0x66, 0x2b, 0x8a, 0xf9, 0x20, 0xf3, 0xed, - 0x00, 0x13, 0x39, 0xa0, 0xfc, 0x9c, 0xb2, 0x70, 0xe8, 0xf0, 0x7c, 0x4c, 0x58, 0x69, 0x63, 0xbd, - 0xfd, 0x52, 0xd0, 0x91, 0xfc, 0x35, 0x21, 0x7a, 0x5f, 0x6b, 0xfc, 0x92, 0x46, 0xc0, 0xbc, 0x00, - 0x29, 0xcb, 0x12, 0x52, 0xab, 0x34, 0xd5, 0xd6, 0xae, 0x7b, 0x3c, 0x29, 0x4c, 0x75, 0x51, 0x98, - 0x47, 0x5b, 0x87, 0x58, 0xfb, 0xdf, 0xea, 0x1d, 0x6e, 0x34, 0xb8, 0x01, 0xd6, 0x11, 0x15, 0xf7, - 0x76, 0x32, 0x33, 0xd4, 0xe9, 0xcc, 0x50, 0x3f, 0x67, 0x86, 0xfa, 0x32, 0x37, 0x94, 0xe9, 0xdc, - 0x50, 0xde, 0xe7, 0x86, 0x72, 0x7f, 0xb1, 0x36, 0xfd, 0xf6, 0x7b, 0x3d, 0x6d, 0x5e, 0xac, 0x5c, - 0xc8, 0xaf, 0x96, 0x6f, 0x7c, 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0xd5, 0xad, 0x19, 0x25, 0x5f, - 0x02, 0x00, 0x00, +var fileDescriptor_7907a0525c7d0886 = []byte{ + // 353 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xb1, 0x4e, 0xfb, 0x30, + 0x10, 0xc6, 0x93, 0xfe, 0xff, 0xea, 0x10, 0x16, 0x14, 0x21, 0xd1, 0x16, 0x29, 0x29, 0x99, 0xc2, + 0xd0, 0x44, 0xa5, 0x62, 0x61, 0x6c, 0x25, 0x98, 0x2a, 0x50, 0x47, 0x96, 0xe8, 0xe2, 0x3a, 0x69, + 0x54, 0xe2, 0x2b, 0xb1, 0x83, 0xc8, 0x23, 0xb0, 0x31, 0xf1, 0x10, 0x3c, 0x49, 0xc7, 0x8e, 0x4c, + 0x01, 0xb5, 0x6f, 0xd0, 0x27, 0x40, 0x8d, 0x0d, 0x6a, 0x01, 0x31, 0xd9, 0xa7, 0xfb, 0xbe, 0x9f, + 0xbf, 0xf3, 0x19, 0xee, 0x5d, 0x0e, 0x1c, 0x32, 0x5f, 0xe0, 0x94, 0xb2, 0x08, 0x88, 0xc0, 0xac, + 0xf0, 0xef, 0xbb, 0x21, 0x15, 0xd0, 0xf5, 0x67, 0x90, 0x41, 0xca, 0xbd, 0x59, 0x86, 0x02, 0xcd, + 0x23, 0xa9, 0xf4, 0xb6, 0x95, 0x9e, 0x52, 0xb6, 0x0e, 0x62, 0x8c, 0xb1, 0xd2, 0xf9, 0x9b, 0x9b, + 0xb4, 0xb4, 0x7a, 0x7f, 0xc1, 0x21, 0x17, 0x13, 0xcc, 0x12, 0x51, 0x0c, 0xa9, 0x80, 0x31, 0x08, + 0x50, 0xa6, 0x26, 0x41, 0x9e, 0x22, 0x0f, 0x24, 0x4d, 0x16, 0xaa, 0x65, 0xc9, 0xca, 0x0f, 0x81, + 0xd3, 0x2f, 0x0e, 0xc1, 0x84, 0xc9, 0xbe, 0xf3, 0x58, 0x33, 0xea, 0xd7, 0x55, 0x66, 0xf3, 0x59, + 0x37, 0xcc, 0x31, 0x65, 0x98, 0x06, 0x24, 0xa3, 0x20, 0x12, 0x64, 0x41, 0x44, 0x69, 0x43, 0x6f, + 0xff, 0x73, 0xf7, 0x4e, 0x9b, 0x9e, 0xc2, 0x6e, 0x40, 0x9f, 0x33, 0x78, 0x03, 0x4c, 0x58, 0x7f, + 0x38, 0x2f, 0x6d, 0x6d, 0x5d, 0xda, 0xcd, 0x02, 0xd2, 0xdb, 0x73, 0xe7, 0x27, 0xc2, 0x79, 0x79, + 0xb3, 0xdd, 0x38, 0x11, 0x93, 0x3c, 0xf4, 0x08, 0xa6, 0x2a, 0xa0, 0x3a, 0x3a, 0x7c, 0x3c, 0xf5, + 0x45, 0x31, 0xa3, 0xbc, 0xa2, 0xf1, 0xd1, 0x7e, 0x05, 0x18, 0x28, 0xff, 0x05, 0xa5, 0x66, 0x64, + 0xb4, 0xbe, 0x41, 0x63, 0xe0, 0x01, 0x41, 0xc6, 0xf3, 0x94, 0x36, 0x6a, 0x6d, 0xdd, 0xfd, 0xdf, + 0x3f, 0x99, 0x97, 0xb6, 0xbe, 0x2e, 0xed, 0xe3, 0x5f, 0x43, 0x6c, 0xe9, 0x9d, 0xd1, 0xe1, 0xce, + 0x03, 0x97, 0xc0, 0x07, 0xb2, 0xd3, 0xbf, 0x9a, 0x2f, 0x2d, 0x7d, 0xb1, 0xb4, 0xf4, 0xf7, 0xa5, + 0xa5, 0x3f, 0xad, 0x2c, 0x6d, 0xb1, 0xb2, 0xb4, 0xd7, 0x95, 0xa5, 0xdd, 0x9c, 0x6d, 0xa5, 0x97, + 0x0b, 0xea, 0x44, 0x09, 0x03, 0x46, 0xa8, 0x2a, 0xfd, 0x87, 0xdd, 0x8d, 0x55, 0x03, 0x85, 0xf5, + 0xea, 0x8f, 0x7b, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x91, 0x2e, 0x13, 0x03, 0x32, 0x02, 0x00, + 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/tokenfactory/types/query.pb.go b/x/tokenfactory/types/query.pb.go index a0a398131..e69b98f1b 100644 --- a/x/tokenfactory/types/query.pb.go +++ b/x/tokenfactory/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/tokenfactory/v1beta1/query.proto +// source: quasar/tokenfactory/v1beta1/query.proto package types @@ -38,7 +38,7 @@ 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_d91071b4dba9bb0c, []int{0} + return fileDescriptor_a68764de2ac1dbba, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +77,7 @@ 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_d91071b4dba9bb0c, []int{1} + return fileDescriptor_a68764de2ac1dbba, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -123,7 +123,7 @@ func (m *QueryDenomAuthorityMetadataRequest) Reset() { *m = QueryDenomAu func (m *QueryDenomAuthorityMetadataRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomAuthorityMetadataRequest) ProtoMessage() {} func (*QueryDenomAuthorityMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d91071b4dba9bb0c, []int{2} + return fileDescriptor_a68764de2ac1dbba, []int{2} } func (m *QueryDenomAuthorityMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -169,7 +169,7 @@ func (m *QueryDenomAuthorityMetadataResponse) Reset() { *m = QueryDenomA func (m *QueryDenomAuthorityMetadataResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomAuthorityMetadataResponse) ProtoMessage() {} func (*QueryDenomAuthorityMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d91071b4dba9bb0c, []int{3} + return fileDescriptor_a68764de2ac1dbba, []int{3} } func (m *QueryDenomAuthorityMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -215,7 +215,7 @@ func (m *QueryDenomsFromCreatorRequest) Reset() { *m = QueryDenomsFromCr func (m *QueryDenomsFromCreatorRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomsFromCreatorRequest) ProtoMessage() {} func (*QueryDenomsFromCreatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d91071b4dba9bb0c, []int{4} + return fileDescriptor_a68764de2ac1dbba, []int{4} } func (m *QueryDenomsFromCreatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -261,7 +261,7 @@ func (m *QueryDenomsFromCreatorResponse) Reset() { *m = QueryDenomsFromC func (m *QueryDenomsFromCreatorResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomsFromCreatorResponse) ProtoMessage() {} func (*QueryDenomsFromCreatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d91071b4dba9bb0c, []int{5} + return fileDescriptor_a68764de2ac1dbba, []int{5} } func (m *QueryDenomsFromCreatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -297,58 +297,260 @@ func (m *QueryDenomsFromCreatorResponse) GetDenoms() []string { return nil } +type QueryBeforeSendHookAddressRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` +} + +func (m *QueryBeforeSendHookAddressRequest) Reset() { *m = QueryBeforeSendHookAddressRequest{} } +func (m *QueryBeforeSendHookAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBeforeSendHookAddressRequest) ProtoMessage() {} +func (*QueryBeforeSendHookAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a68764de2ac1dbba, []int{6} +} +func (m *QueryBeforeSendHookAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBeforeSendHookAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBeforeSendHookAddressRequest.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 *QueryBeforeSendHookAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBeforeSendHookAddressRequest.Merge(m, src) +} +func (m *QueryBeforeSendHookAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBeforeSendHookAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBeforeSendHookAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBeforeSendHookAddressRequest proto.InternalMessageInfo + +func (m *QueryBeforeSendHookAddressRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QueryBeforeSendHookAddressResponse defines the response structure for the +// DenomBeforeSendHook gRPC query. +type QueryBeforeSendHookAddressResponse struct { + CosmwasmAddress string `protobuf:"bytes,1,opt,name=cosmwasm_address,json=cosmwasmAddress,proto3" json:"cosmwasm_address,omitempty" yaml:"cosmwasm_address"` +} + +func (m *QueryBeforeSendHookAddressResponse) Reset() { *m = QueryBeforeSendHookAddressResponse{} } +func (m *QueryBeforeSendHookAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBeforeSendHookAddressResponse) ProtoMessage() {} +func (*QueryBeforeSendHookAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a68764de2ac1dbba, []int{7} +} +func (m *QueryBeforeSendHookAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBeforeSendHookAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBeforeSendHookAddressResponse.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 *QueryBeforeSendHookAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBeforeSendHookAddressResponse.Merge(m, src) +} +func (m *QueryBeforeSendHookAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBeforeSendHookAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBeforeSendHookAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBeforeSendHookAddressResponse proto.InternalMessageInfo + +func (m *QueryBeforeSendHookAddressResponse) GetCosmwasmAddress() string { + if m != nil { + return m.CosmwasmAddress + } + return "" +} + +type QueryAllBeforeSendHooksAddressesRequest struct { +} + +func (m *QueryAllBeforeSendHooksAddressesRequest) Reset() { + *m = QueryAllBeforeSendHooksAddressesRequest{} +} +func (m *QueryAllBeforeSendHooksAddressesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllBeforeSendHooksAddressesRequest) ProtoMessage() {} +func (*QueryAllBeforeSendHooksAddressesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a68764de2ac1dbba, []int{8} +} +func (m *QueryAllBeforeSendHooksAddressesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBeforeSendHooksAddressesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBeforeSendHooksAddressesRequest.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 *QueryAllBeforeSendHooksAddressesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBeforeSendHooksAddressesRequest.Merge(m, src) +} +func (m *QueryAllBeforeSendHooksAddressesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBeforeSendHooksAddressesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBeforeSendHooksAddressesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBeforeSendHooksAddressesRequest proto.InternalMessageInfo + +// QueryAllBeforeSendHooksAddressesResponse defines the response structure for +// the AllBeforeSendHooksAddresses gRPC query. +type QueryAllBeforeSendHooksAddressesResponse struct { + Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty" yaml:"denoms"` + BeforeSendHookAddresses []string `protobuf:"bytes,2,rep,name=before_send_hook_addresses,json=beforeSendHookAddresses,proto3" json:"before_send_hook_addresses,omitempty" yaml:"before_send_addresses"` +} + +func (m *QueryAllBeforeSendHooksAddressesResponse) Reset() { + *m = QueryAllBeforeSendHooksAddressesResponse{} +} +func (m *QueryAllBeforeSendHooksAddressesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllBeforeSendHooksAddressesResponse) ProtoMessage() {} +func (*QueryAllBeforeSendHooksAddressesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a68764de2ac1dbba, []int{9} +} +func (m *QueryAllBeforeSendHooksAddressesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBeforeSendHooksAddressesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBeforeSendHooksAddressesResponse.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 *QueryAllBeforeSendHooksAddressesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBeforeSendHooksAddressesResponse.Merge(m, src) +} +func (m *QueryAllBeforeSendHooksAddressesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBeforeSendHooksAddressesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBeforeSendHooksAddressesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBeforeSendHooksAddressesResponse proto.InternalMessageInfo + +func (m *QueryAllBeforeSendHooksAddressesResponse) GetDenoms() []string { + if m != nil { + return m.Denoms + } + return nil +} + +func (m *QueryAllBeforeSendHooksAddressesResponse) GetBeforeSendHookAddresses() []string { + if m != nil { + return m.BeforeSendHookAddresses + } + return nil +} + func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryDenomAuthorityMetadataRequest)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest") - proto.RegisterType((*QueryDenomAuthorityMetadataResponse)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse") - proto.RegisterType((*QueryDenomsFromCreatorRequest)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest") - proto.RegisterType((*QueryDenomsFromCreatorResponse)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "quasar.tokenfactory.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "quasar.tokenfactory.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryDenomAuthorityMetadataRequest)(nil), "quasar.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest") + proto.RegisterType((*QueryDenomAuthorityMetadataResponse)(nil), "quasar.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse") + proto.RegisterType((*QueryDenomsFromCreatorRequest)(nil), "quasar.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest") + proto.RegisterType((*QueryDenomsFromCreatorResponse)(nil), "quasar.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse") + proto.RegisterType((*QueryBeforeSendHookAddressRequest)(nil), "quasar.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest") + proto.RegisterType((*QueryBeforeSendHookAddressResponse)(nil), "quasar.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse") + proto.RegisterType((*QueryAllBeforeSendHooksAddressesRequest)(nil), "quasar.tokenfactory.v1beta1.QueryAllBeforeSendHooksAddressesRequest") + proto.RegisterType((*QueryAllBeforeSendHooksAddressesResponse)(nil), "quasar.tokenfactory.v1beta1.QueryAllBeforeSendHooksAddressesResponse") } func init() { - proto.RegisterFile("quasarlabs/quasarnode/tokenfactory/v1beta1/query.proto", fileDescriptor_d91071b4dba9bb0c) -} - -var fileDescriptor_d91071b4dba9bb0c = []byte{ - // 582 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0x56, 0x13, 0xe9, 0xf8, 0x03, 0x33, 0x16, 0xd1, 0xa0, 0x1b, 0x1d, 0x41, 0x6a, 0x91, - 0x1d, 0x1a, 0x7f, 0x41, 0x0f, 0x8a, 0xab, 0x08, 0xb5, 0xc6, 0xb4, 0x0b, 0x5e, 0xbc, 0x84, 0x49, - 0x32, 0xdd, 0x06, 0xb3, 0xfb, 0x36, 0x33, 0x13, 0x31, 0x94, 0x5e, 0xfc, 0x0b, 0x0a, 0xfa, 0xe7, - 0x78, 0x15, 0x7a, 0x2c, 0x78, 0xf1, 0x14, 0x24, 0xf1, 0x2f, 0xc8, 0x5d, 0x90, 0xcc, 0x4c, 0x9b, - 0xd6, 0xc4, 0xd2, 0x2d, 0x3d, 0xed, 0x30, 0xef, 0xbd, 0xef, 0x7d, 0xdf, 0xf7, 0xde, 0x0e, 0x7a, - 0xdc, 0xee, 0x30, 0xc9, 0x44, 0x8b, 0xd5, 0x24, 0x35, 0xc7, 0x18, 0x1a, 0x9c, 0x2a, 0xf8, 0xc0, - 0xe3, 0x75, 0x56, 0x57, 0x20, 0xba, 0xf4, 0xe3, 0x62, 0x8d, 0x2b, 0xb6, 0x48, 0xdb, 0x1d, 0x2e, - 0xba, 0x5e, 0x22, 0x40, 0x01, 0x5e, 0x18, 0xd7, 0x79, 0xe3, 0x3a, 0xef, 0x60, 0x9d, 0x67, 0xeb, - 0x0a, 0x73, 0x21, 0x84, 0xa0, 0xcb, 0xe8, 0xe8, 0x64, 0x10, 0x0a, 0x37, 0x42, 0x80, 0xb0, 0xc5, - 0x29, 0x4b, 0x9a, 0x94, 0xc5, 0x31, 0x28, 0xa6, 0x9a, 0x10, 0x4b, 0x1b, 0x5d, 0xa8, 0x83, 0x8c, - 0x40, 0xd2, 0x1a, 0x93, 0xdc, 0x34, 0xde, 0xa7, 0x91, 0xb0, 0xb0, 0x19, 0xeb, 0x64, 0x9b, 0xeb, - 0xa7, 0xd0, 0xc0, 0x3a, 0x6a, 0x03, 0x44, 0x53, 0x75, 0xcb, 0x5c, 0xb1, 0x06, 0x53, 0xcc, 0x62, - 0x3c, 0x49, 0x81, 0x91, 0x30, 0xc1, 0x22, 0x4b, 0x94, 0xcc, 0x21, 0xbc, 0x36, 0xa2, 0xb7, 0xaa, - 0x2f, 0x03, 0xde, 0xee, 0x70, 0xa9, 0x48, 0x88, 0xae, 0x1c, 0xba, 0x95, 0x09, 0xc4, 0x92, 0xe3, - 0x55, 0x94, 0x33, 0xc5, 0xd7, 0x9c, 0x5b, 0xce, 0xfc, 0xf9, 0x52, 0xc9, 0x3b, 0xbe, 0x8d, 0x9e, - 0xc1, 0xf2, 0xcf, 0xee, 0xf4, 0x8a, 0x99, 0xc0, 0xe2, 0x90, 0x37, 0x88, 0xe8, 0x46, 0x2f, 0x79, - 0x0c, 0xd1, 0xf3, 0x7f, 0xc5, 0x59, 0x3a, 0xf8, 0x2e, 0xca, 0x36, 0x46, 0x09, 0xba, 0xed, 0xac, - 0x7f, 0x79, 0xd8, 0x2b, 0x5e, 0xe8, 0xb2, 0xa8, 0xb5, 0x44, 0xf4, 0x35, 0x09, 0x4c, 0x98, 0x7c, - 0x73, 0xd0, 0x9d, 0x23, 0xe1, 0xac, 0x8e, 0xaf, 0x0e, 0xc2, 0xfb, 0x4e, 0x56, 0x23, 0x1b, 0xb6, - 0xa2, 0xfc, 0x34, 0xa2, 0xa6, 0x37, 0xf2, 0x6f, 0x8f, 0x44, 0x0e, 0x7b, 0xc5, 0xeb, 0x86, 0xe5, - 0x64, 0x2f, 0x12, 0xe4, 0x27, 0x46, 0x49, 0xca, 0xe8, 0xe6, 0x98, 0xbd, 0x7c, 0x25, 0x20, 0x7a, - 0x21, 0x38, 0x53, 0x20, 0xf6, 0x7c, 0xb8, 0x8f, 0xce, 0xd5, 0xcd, 0x8d, 0x75, 0x02, 0x0f, 0x7b, - 0xc5, 0x4b, 0xa6, 0x87, 0x0d, 0x90, 0x60, 0x2f, 0x85, 0xac, 0x20, 0xf7, 0x7f, 0x70, 0xd6, 0x87, - 0x7b, 0x28, 0xa7, 0x8d, 0x1b, 0xcd, 0xf3, 0xcc, 0xfc, 0xac, 0x9f, 0x1f, 0xf6, 0x8a, 0x17, 0x0f, - 0x18, 0x2b, 0x49, 0x60, 0x13, 0x4a, 0xfd, 0x2c, 0xca, 0x6a, 0x34, 0xfc, 0xdd, 0x41, 0x39, 0x33, - 0x4b, 0xfc, 0x34, 0x8d, 0x55, 0x93, 0x6b, 0x56, 0x78, 0x76, 0xe2, 0x7a, 0x23, 0x80, 0x2c, 0x7d, - 0xfe, 0xf1, 0xfb, 0xcb, 0xcc, 0x43, 0x5c, 0xa2, 0xc7, 0x07, 0xb2, 0xfb, 0x8f, 0xb7, 0x67, 0xd0, - 0xd5, 0xe9, 0xe3, 0xc3, 0x6f, 0x53, 0xf3, 0x3a, 0x72, 0x7f, 0x0b, 0x95, 0x53, 0xc3, 0xb3, 0xba, - 0xdf, 0x69, 0xdd, 0x15, 0x5c, 0x4e, 0xa3, 0xdb, 0x4c, 0x92, 0x6e, 0xea, 0xef, 0x16, 0x9d, 0x5c, - 0x4a, 0xfc, 0xc7, 0x41, 0xf9, 0x89, 0x6d, 0xc1, 0xcb, 0x27, 0x63, 0x3f, 0x65, 0x81, 0x0b, 0xaf, - 0x4f, 0x03, 0xca, 0x7a, 0xb0, 0xa6, 0x3d, 0x58, 0xc1, 0xcb, 0xe9, 0x3d, 0xa8, 0xae, 0x0b, 0x88, - 0xaa, 0xf6, 0x3f, 0xa1, 0x9b, 0xf6, 0xb0, 0xe5, 0x57, 0x76, 0xfa, 0xae, 0xb3, 0xdb, 0x77, 0x9d, - 0x5f, 0x7d, 0xd7, 0xd9, 0x1e, 0xb8, 0x99, 0xdd, 0x81, 0x9b, 0xf9, 0x39, 0x70, 0x33, 0xef, 0x1f, - 0x85, 0x4d, 0xb5, 0xd1, 0xa9, 0x79, 0x75, 0x88, 0xe8, 0xf4, 0xa7, 0xf6, 0xd3, 0xe1, 0xc7, 0x56, - 0x75, 0x13, 0x2e, 0x6b, 0x39, 0xfd, 0xc8, 0x3e, 0xf8, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xa3, - 0x80, 0xcc, 0xa7, 0x06, 0x00, 0x00, + proto.RegisterFile("quasar/tokenfactory/v1beta1/query.proto", fileDescriptor_a68764de2ac1dbba) +} + +var fileDescriptor_a68764de2ac1dbba = []byte{ + // 814 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4f, 0x4f, 0x13, 0x4d, + 0x1c, 0xee, 0xf6, 0x7d, 0xe9, 0x1b, 0xe6, 0x7d, 0x5f, 0x85, 0x11, 0x05, 0x17, 0x6c, 0x61, 0x48, + 0xa4, 0x18, 0xed, 0x0a, 0x95, 0x0b, 0x18, 0xb0, 0x15, 0x89, 0x06, 0x09, 0xba, 0x5e, 0x4c, 0x8d, + 0x69, 0xa6, 0xed, 0xb4, 0x34, 0xec, 0xee, 0x94, 0x9d, 0xa9, 0xda, 0x10, 0x2e, 0x26, 0x1e, 0xbc, + 0x61, 0xbc, 0x78, 0xf3, 0x13, 0x78, 0x33, 0x7e, 0x06, 0x4e, 0x86, 0xc4, 0x8b, 0xa7, 0x8d, 0x01, + 0x13, 0xef, 0xfd, 0x00, 0xc6, 0x74, 0x66, 0x5a, 0xa1, 0x7f, 0xb6, 0x14, 0x4f, 0x6d, 0x66, 0x9e, + 0xe7, 0xf9, 0xfd, 0x9e, 0x67, 0x66, 0x7e, 0x59, 0x30, 0xb5, 0x55, 0xc6, 0x0c, 0xbb, 0x06, 0xa7, + 0x9b, 0xc4, 0xc9, 0xe3, 0x2c, 0xa7, 0x6e, 0xc5, 0x78, 0x36, 0x93, 0x21, 0x1c, 0xcf, 0x18, 0x5b, + 0x65, 0xe2, 0x56, 0x62, 0x25, 0x97, 0x72, 0x0a, 0x47, 0x25, 0x30, 0x76, 0x14, 0x18, 0x53, 0x40, + 0x7d, 0xa8, 0x40, 0x0b, 0x54, 0xe0, 0x8c, 0xda, 0x3f, 0x49, 0xd1, 0xc7, 0x0a, 0x94, 0x16, 0x2c, + 0x62, 0xe0, 0x52, 0xd1, 0xc0, 0x8e, 0x43, 0x39, 0xe6, 0x45, 0xea, 0x30, 0xb5, 0x7b, 0x25, 0x4b, + 0x99, 0x4d, 0x99, 0x91, 0xc1, 0x8c, 0xc8, 0x4a, 0x8d, 0xba, 0x25, 0x5c, 0x28, 0x3a, 0x02, 0xac, + 0xb0, 0x71, 0xbf, 0x2e, 0x71, 0x99, 0x6f, 0x50, 0xb7, 0xc8, 0x2b, 0x6b, 0x84, 0xe3, 0x1c, 0xe6, + 0x58, 0x91, 0xa2, 0x7e, 0xa4, 0x12, 0x76, 0xb1, 0xad, 0x5a, 0x41, 0x43, 0x00, 0x3e, 0xac, 0x35, + 0xf0, 0x40, 0x2c, 0x9a, 0x64, 0xab, 0x4c, 0x18, 0x47, 0x8f, 0xc1, 0xb9, 0x63, 0xab, 0xac, 0x44, + 0x1d, 0x46, 0x60, 0x02, 0x84, 0x24, 0x79, 0x44, 0x1b, 0xd7, 0xa2, 0xff, 0xce, 0x4e, 0xc6, 0x7c, + 0x92, 0x89, 0x49, 0x72, 0xf2, 0xef, 0x3d, 0x2f, 0x12, 0x30, 0x15, 0x11, 0xdd, 0x07, 0x48, 0x28, + 0x2f, 0x13, 0x87, 0xda, 0x89, 0xe6, 0xf6, 0x55, 0x7d, 0x78, 0x19, 0xf4, 0xe5, 0x6a, 0x00, 0x51, + 0xa7, 0x3f, 0x39, 0x50, 0xf5, 0x22, 0xff, 0x55, 0xb0, 0x6d, 0xcd, 0x23, 0xb1, 0x8c, 0x4c, 0xb9, + 0x8d, 0x3e, 0x68, 0x60, 0xd2, 0x57, 0x4e, 0x35, 0xfe, 0x4a, 0x03, 0xb0, 0x91, 0x55, 0xda, 0x56, + 0xdb, 0xca, 0x45, 0xdc, 0xd7, 0x45, 0x7b, 0xe5, 0xe4, 0x44, 0xcd, 0x55, 0xd5, 0x8b, 0x5c, 0x94, + 0x6d, 0xb5, 0x8a, 0x23, 0x73, 0xb0, 0xe5, 0x74, 0xd0, 0x1a, 0xb8, 0xf4, 0xbb, 0x5d, 0xb6, 0xe2, + 0x52, 0xfb, 0xb6, 0x4b, 0x30, 0xa7, 0x6e, 0xdd, 0xf8, 0x55, 0xf0, 0x4f, 0x56, 0xae, 0x28, 0xeb, + 0xb0, 0xea, 0x45, 0xce, 0xc8, 0x1a, 0x6a, 0x03, 0x99, 0x75, 0x08, 0x5a, 0x05, 0xe1, 0x4e, 0x72, + 0xca, 0xf8, 0x34, 0x08, 0x89, 0xa4, 0x6a, 0x27, 0xf6, 0x57, 0xb4, 0x3f, 0x39, 0x58, 0xf5, 0x22, + 0xff, 0x1f, 0x49, 0x92, 0x21, 0x53, 0x01, 0xd0, 0x2a, 0x98, 0x10, 0x62, 0x49, 0x92, 0xa7, 0x2e, + 0x79, 0x44, 0x9c, 0xdc, 0x5d, 0x4a, 0x37, 0x13, 0xb9, 0x9c, 0x4b, 0x18, 0xeb, 0xf5, 0x60, 0x2c, + 0x75, 0xcc, 0x1d, 0xc4, 0x54, 0x77, 0x2b, 0x60, 0xa0, 0xf6, 0x12, 0x9e, 0x63, 0x66, 0xa7, 0xb1, + 0xdc, 0x53, 0xc2, 0xa3, 0x55, 0x2f, 0x32, 0xac, 0x6c, 0x37, 0x21, 0x90, 0x79, 0xb6, 0xbe, 0xa4, + 0xf4, 0xd0, 0x34, 0x98, 0x12, 0xd5, 0x12, 0x96, 0x75, 0xbc, 0x20, 0x53, 0x08, 0xd2, 0xb8, 0xd9, + 0x1f, 0x35, 0x10, 0xed, 0x8e, 0xed, 0x39, 0x3d, 0xf8, 0x14, 0xe8, 0x19, 0x21, 0x97, 0x66, 0xc4, + 0xc9, 0xa5, 0x37, 0x28, 0xdd, 0xac, 0x37, 0x4c, 0xd8, 0x48, 0x50, 0xd0, 0xc7, 0xab, 0x5e, 0x64, + 0x4c, 0xd2, 0x8f, 0x62, 0x1b, 0x30, 0x64, 0x0e, 0x67, 0xda, 0xe5, 0x45, 0xd8, 0xec, 0xcf, 0x7e, + 0xd0, 0x27, 0xda, 0x86, 0x9f, 0x35, 0x10, 0x92, 0x2f, 0x0b, 0x1a, 0xbe, 0x17, 0xb7, 0xf5, 0x59, + 0xeb, 0xd7, 0x4f, 0x4e, 0x90, 0x09, 0x20, 0xfc, 0xf2, 0xcb, 0xf7, 0xb7, 0xc1, 0x27, 0xa9, 0x1b, + 0x70, 0xd6, 0x90, 0x5c, 0x0b, 0x67, 0x98, 0x92, 0x71, 0x68, 0x8e, 0xb4, 0x95, 0x52, 0x23, 0x06, + 0x4e, 0x1a, 0xdd, 0xe7, 0x10, 0xfc, 0x14, 0x04, 0x17, 0xda, 0x3f, 0x32, 0xb8, 0xd4, 0xbd, 0x5f, + 0xdf, 0x39, 0xa2, 0xdf, 0x3a, 0xbd, 0x80, 0x0a, 0xe0, 0x9d, 0x26, 0x12, 0x78, 0xa3, 0xa5, 0xd6, + 0xe1, 0x5a, 0x2f, 0x11, 0xc8, 0x7b, 0x61, 0x6c, 0x8b, 0xdf, 0x1d, 0xa3, 0x75, 0x40, 0xc0, 0x45, + 0xdf, 0x74, 0xba, 0xf3, 0xdf, 0x07, 0xc1, 0x60, 0xcb, 0xcb, 0x87, 0xf3, 0x27, 0xb4, 0xdc, 0x66, + 0xfa, 0xe8, 0x0b, 0xa7, 0xe2, 0xaa, 0xa4, 0x76, 0x65, 0x52, 0xaf, 0xb5, 0xd4, 0x2a, 0xbc, 0xd7, + 0x7b, 0x52, 0xe9, 0xbc, 0x4b, 0xed, 0xb4, 0x9a, 0x6c, 0xc6, 0xb6, 0xfa, 0xb3, 0x03, 0xe7, 0x4f, + 0x90, 0x52, 0x27, 0xae, 0xa7, 0x81, 0xf3, 0x6d, 0x27, 0x10, 0x5c, 0xec, 0xee, 0xd4, 0x6f, 0x0e, + 0xea, 0x4b, 0xa7, 0xe6, 0xab, 0xb4, 0x96, 0x45, 0x58, 0x8b, 0xf0, 0x66, 0x2f, 0x97, 0xa0, 0x79, + 0xc2, 0xc0, 0x1f, 0x1a, 0x18, 0xf5, 0x19, 0x64, 0x70, 0xb9, 0x7b, 0x9b, 0xdd, 0x67, 0xa6, 0x7e, + 0xe7, 0x0f, 0x55, 0x94, 0xe5, 0x05, 0x61, 0x79, 0x0e, 0xc6, 0x0d, 0xf1, 0xf5, 0x53, 0x64, 0x1d, + 0xbe, 0x69, 0x2c, 0x2b, 0xdd, 0x6c, 0x94, 0x25, 0xd7, 0xf7, 0x0e, 0xc2, 0xda, 0xfe, 0x41, 0x58, + 0xfb, 0x76, 0x10, 0xd6, 0x76, 0x0f, 0xc3, 0x81, 0xfd, 0xc3, 0x70, 0xe0, 0xeb, 0x61, 0x38, 0x90, + 0x9a, 0x2b, 0x14, 0xf9, 0x46, 0x39, 0x13, 0xcb, 0x52, 0x5b, 0x65, 0x79, 0x2d, 0x5f, 0x74, 0xb0, + 0x93, 0x25, 0xf5, 0x68, 0x5f, 0x1c, 0x2f, 0xc4, 0x2b, 0x25, 0xc2, 0x32, 0x21, 0xf1, 0xfd, 0x13, + 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xff, 0x2a, 0x23, 0x06, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -372,6 +574,15 @@ type QueryClient interface { // DenomsFromCreator defines a gRPC query method for fetching all // denominations created by a specific admin/creator. DenomsFromCreator(ctx context.Context, in *QueryDenomsFromCreatorRequest, opts ...grpc.CallOption) (*QueryDenomsFromCreatorResponse, error) + // 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) + // AllBeforeSendHooksAddresses defines a gRPC query method for + // getting all addresses with before send hook registered. + // The response returns two arrays, an array with a list of denom and an array + // of before send hook addresses. The idx of denom corresponds to before send + // hook addresse's idx. + AllBeforeSendHooksAddresses(ctx context.Context, in *QueryAllBeforeSendHooksAddressesRequest, opts ...grpc.CallOption) (*QueryAllBeforeSendHooksAddressesResponse, error) } type queryClient struct { @@ -384,7 +595,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.tokenfactory.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -393,7 +604,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) DenomAuthorityMetadata(ctx context.Context, in *QueryDenomAuthorityMetadataRequest, opts ...grpc.CallOption) (*QueryDenomAuthorityMetadataResponse, error) { out := new(QueryDenomAuthorityMetadataResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", in, out, opts...) if err != nil { return nil, err } @@ -402,7 +613,25 @@ func (c *queryClient) DenomAuthorityMetadata(ctx context.Context, in *QueryDenom func (c *queryClient) DenomsFromCreator(ctx context.Context, in *QueryDenomsFromCreatorRequest, opts ...grpc.CallOption) (*QueryDenomsFromCreatorResponse, error) { out := new(QueryDenomsFromCreatorResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.tokenfactory.v1beta1.Query/DenomsFromCreator", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Query/DenomsFromCreator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BeforeSendHookAddress(ctx context.Context, in *QueryBeforeSendHookAddressRequest, opts ...grpc.CallOption) (*QueryBeforeSendHookAddressResponse, error) { + out := new(QueryBeforeSendHookAddressResponse) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Query/BeforeSendHookAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllBeforeSendHooksAddresses(ctx context.Context, in *QueryAllBeforeSendHooksAddressesRequest, opts ...grpc.CallOption) (*QueryAllBeforeSendHooksAddressesResponse, error) { + out := new(QueryAllBeforeSendHooksAddressesResponse) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Query/AllBeforeSendHooksAddresses", in, out, opts...) if err != nil { return nil, err } @@ -420,6 +649,15 @@ type QueryServer interface { // DenomsFromCreator defines a gRPC query method for fetching all // denominations created by a specific admin/creator. DenomsFromCreator(context.Context, *QueryDenomsFromCreatorRequest) (*QueryDenomsFromCreatorResponse, error) + // BeforeSendHookAddress defines a gRPC query method for + // getting the address registered for the before send hook. + BeforeSendHookAddress(context.Context, *QueryBeforeSendHookAddressRequest) (*QueryBeforeSendHookAddressResponse, error) + // AllBeforeSendHooksAddresses defines a gRPC query method for + // getting all addresses with before send hook registered. + // The response returns two arrays, an array with a list of denom and an array + // of before send hook addresses. The idx of denom corresponds to before send + // hook addresse's idx. + AllBeforeSendHooksAddresses(context.Context, *QueryAllBeforeSendHooksAddressesRequest) (*QueryAllBeforeSendHooksAddressesResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -435,6 +673,12 @@ func (*UnimplementedQueryServer) DenomAuthorityMetadata(ctx context.Context, req func (*UnimplementedQueryServer) DenomsFromCreator(ctx context.Context, req *QueryDenomsFromCreatorRequest) (*QueryDenomsFromCreatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomsFromCreator not implemented") } +func (*UnimplementedQueryServer) BeforeSendHookAddress(ctx context.Context, req *QueryBeforeSendHookAddressRequest) (*QueryBeforeSendHookAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeforeSendHookAddress not implemented") +} +func (*UnimplementedQueryServer) AllBeforeSendHooksAddresses(ctx context.Context, req *QueryAllBeforeSendHooksAddressesRequest) (*QueryAllBeforeSendHooksAddressesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllBeforeSendHooksAddresses not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -450,7 +694,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.tokenfactory.v1beta1.Query/Params", + FullMethod: "/quasar.tokenfactory.v1beta1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -468,7 +712,7 @@ func _Query_DenomAuthorityMetadata_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", + FullMethod: "/quasar.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DenomAuthorityMetadata(ctx, req.(*QueryDenomAuthorityMetadataRequest)) @@ -486,7 +730,7 @@ func _Query_DenomsFromCreator_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.tokenfactory.v1beta1.Query/DenomsFromCreator", + FullMethod: "/quasar.tokenfactory.v1beta1.Query/DenomsFromCreator", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DenomsFromCreator(ctx, req.(*QueryDenomsFromCreatorRequest)) @@ -494,8 +738,44 @@ func _Query_DenomsFromCreator_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_BeforeSendHookAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBeforeSendHookAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BeforeSendHookAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/quasar.tokenfactory.v1beta1.Query/BeforeSendHookAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BeforeSendHookAddress(ctx, req.(*QueryBeforeSendHookAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllBeforeSendHooksAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllBeforeSendHooksAddressesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllBeforeSendHooksAddresses(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/quasar.tokenfactory.v1beta1.Query/AllBeforeSendHooksAddresses", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllBeforeSendHooksAddresses(ctx, req.(*QueryAllBeforeSendHooksAddressesRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.tokenfactory.v1beta1.Query", + ServiceName: "quasar.tokenfactory.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -510,9 +790,17 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "DenomsFromCreator", Handler: _Query_DenomsFromCreator_Handler, }, + { + MethodName: "BeforeSendHookAddress", + Handler: _Query_BeforeSendHookAddress_Handler, + }, + { + MethodName: "AllBeforeSendHooksAddresses", + Handler: _Query_AllBeforeSendHooksAddresses_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/tokenfactory/v1beta1/query.proto", + Metadata: "quasar/tokenfactory/v1beta1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { @@ -696,6 +984,130 @@ func (m *QueryDenomsFromCreatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryBeforeSendHookAddressRequest) 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 *QueryBeforeSendHookAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBeforeSendHookAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBeforeSendHookAddressResponse) 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 *QueryBeforeSendHookAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBeforeSendHookAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CosmwasmAddress) > 0 { + i -= len(m.CosmwasmAddress) + copy(dAtA[i:], m.CosmwasmAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CosmwasmAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllBeforeSendHooksAddressesRequest) 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 *QueryAllBeforeSendHooksAddressesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBeforeSendHooksAddressesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAllBeforeSendHooksAddressesResponse) 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 *QueryAllBeforeSendHooksAddressesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBeforeSendHooksAddressesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BeforeSendHookAddresses) > 0 { + for iNdEx := len(m.BeforeSendHookAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.BeforeSendHookAddresses[iNdEx]) + copy(dAtA[i:], m.BeforeSendHookAddresses[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BeforeSendHookAddresses[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Denoms) > 0 { + for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denoms[iNdEx]) + copy(dAtA[i:], m.Denoms[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -779,7 +1191,63 @@ func (m *QueryDenomsFromCreatorResponse) Size() (n int) { return n } -func sovQuery(x uint64) (n int) { +func (m *QueryBeforeSendHookAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBeforeSendHookAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CosmwasmAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllBeforeSendHooksAddressesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAllBeforeSendHooksAddressesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Denoms) > 0 { + for _, s := range m.Denoms { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.BeforeSendHookAddresses) > 0 { + for _, s := range m.BeforeSendHookAddresses { + l = len(s) + 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) { @@ -1247,6 +1715,334 @@ func (m *QueryDenomsFromCreatorResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryBeforeSendHookAddressRequest) 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: QueryBeforeSendHookAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBeforeSendHookAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = 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 *QueryBeforeSendHookAddressResponse) 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: QueryBeforeSendHookAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBeforeSendHookAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CosmwasmAddress", 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.CosmwasmAddress = 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 *QueryAllBeforeSendHooksAddressesRequest) 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: QueryAllBeforeSendHooksAddressesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBeforeSendHooksAddressesRequest: 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 *QueryAllBeforeSendHooksAddressesResponse) 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: QueryAllBeforeSendHooksAddressesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBeforeSendHooksAddressesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denoms", 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.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BeforeSendHookAddresses", 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.BeforeSendHookAddresses = append(m.BeforeSendHookAddresses, 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 ce5934835..491574186 100644 --- a/x/tokenfactory/types/query.pb.gw.go +++ b/x/tokenfactory/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: quasarlabs/quasarnode/tokenfactory/v1beta1/query.proto +// source: quasar/tokenfactory/v1beta1/query.proto /* Package types is a reverse proxy. @@ -51,6 +51,24 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_Params_1(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_1(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 + +} + func request_Query_DenomAuthorityMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryDenomAuthorityMetadataRequest var metadata runtime.ServerMetadata @@ -105,6 +123,60 @@ func local_request_Query_DenomAuthorityMetadata_0(ctx context.Context, marshaler } +func request_Query_DenomAuthorityMetadata_1(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomAuthorityMetadataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := client.DenomAuthorityMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomAuthorityMetadata_1(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomAuthorityMetadataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := server.DenomAuthorityMetadata(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_DenomsFromCreator_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryDenomsFromCreatorRequest var metadata runtime.ServerMetadata @@ -159,6 +231,132 @@ func local_request_Query_DenomsFromCreator_0(ctx context.Context, marshaler runt } +func request_Query_DenomsFromCreator_1(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsFromCreatorRequest + 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) + } + + msg, err := client.DenomsFromCreator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomsFromCreator_1(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsFromCreatorRequest + 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) + } + + msg, err := server.DenomsFromCreator(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_BeforeSendHookAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBeforeSendHookAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := client.BeforeSendHookAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BeforeSendHookAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBeforeSendHookAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := server.BeforeSendHookAddress(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_AllBeforeSendHooksAddresses_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBeforeSendHooksAddressesRequest + var metadata runtime.ServerMetadata + + msg, err := client.AllBeforeSendHooksAddresses(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllBeforeSendHooksAddresses_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBeforeSendHooksAddressesRequest + var metadata runtime.ServerMetadata + + msg, err := server.AllBeforeSendHooksAddresses(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. @@ -188,6 +386,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Params_1, 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_1(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_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_DenomAuthorityMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -211,6 +432,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DenomAuthorityMetadata_1, 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_DenomAuthorityMetadata_1(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_DenomAuthorityMetadata_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_DenomsFromCreator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -234,6 +478,75 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DenomsFromCreator_1, 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_DenomsFromCreator_1(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_DenomsFromCreator_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BeforeSendHookAddress_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_BeforeSendHookAddress_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_BeforeSendHookAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllBeforeSendHooksAddresses_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_AllBeforeSendHooksAddresses_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_AllBeforeSendHooksAddresses_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -295,6 +608,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Params_1, 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_1(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_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_DenomAuthorityMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -315,6 +648,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DenomAuthorityMetadata_1, 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_DenomAuthorityMetadata_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomAuthorityMetadata_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_DenomsFromCreator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -335,21 +688,101 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DenomsFromCreator_1, 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_DenomsFromCreator_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomsFromCreator_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BeforeSendHookAddress_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_BeforeSendHookAddress_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_BeforeSendHookAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllBeforeSendHooksAddresses_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_AllBeforeSendHooksAddresses_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_AllBeforeSendHooksAddresses_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}, []string{"quasarlabs.quasarnode.tokenfactory.v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"quasar", "tokenfactory", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Params_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"quasarlabs.quasarnode.tokenfactory.v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_DenomAuthorityMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"quasar", "tokenfactory", "v1beta1", "denoms", "denom", "authority_metadata"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_DenomAuthorityMetadata_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"quasarlabs.quasarnode.tokenfactory.v1beta1", "denoms", "denom", "authority_metadata"}, "", runtime.AssumeColonVerbOpt(true))) + + 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{"quasar", "tokenfactory", "v1beta1", "denoms_from_creator", "creator"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_DenomsFromCreator_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"quasarlabs.quasarnode.tokenfactory.v1beta1", "denoms_from_creator", "creator"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DenomAuthorityMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"quasarlabs.quasarnode.tokenfactory.v1beta1", "denoms", "denom", "authority_metadata"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_BeforeSendHookAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"quasar", "tokenfactory", "v1beta1", "denoms", "denom", "before_send_hook"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DenomsFromCreator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"quasarlabs.quasarnode.tokenfactory.v1beta1", "denoms_from_creator", "creator"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_AllBeforeSendHooksAddresses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "tokenfactory", "v1beta1", "all_before_send_hooks"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + forward_Query_Params_1 = runtime.ForwardResponseMessage + forward_Query_DenomAuthorityMetadata_0 = runtime.ForwardResponseMessage + forward_Query_DenomAuthorityMetadata_1 = runtime.ForwardResponseMessage + forward_Query_DenomsFromCreator_0 = runtime.ForwardResponseMessage + + forward_Query_DenomsFromCreator_1 = runtime.ForwardResponseMessage + + forward_Query_BeforeSendHookAddress_0 = runtime.ForwardResponseMessage + + forward_Query_AllBeforeSendHooksAddresses_0 = runtime.ForwardResponseMessage ) diff --git a/x/tokenfactory/types/tx.pb.go b/x/tokenfactory/types/tx.pb.go index 27f35abba..2c379ca0c 100644 --- a/x/tokenfactory/types/tx.pb.go +++ b/x/tokenfactory/types/tx.pb.go @@ -1,12 +1,15 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: quasarlabs/quasarnode/tokenfactory/v1beta1/tx.proto +// source: quasar/tokenfactory/v1beta1/tx.proto package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" types1 "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -49,7 +52,7 @@ func (m *MsgCreateDenom) Reset() { *m = MsgCreateDenom{} } func (m *MsgCreateDenom) String() string { return proto.CompactTextString(m) } func (*MsgCreateDenom) ProtoMessage() {} func (*MsgCreateDenom) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{0} + return fileDescriptor_c8bccd7946136ed9, []int{0} } func (m *MsgCreateDenom) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -102,7 +105,7 @@ func (m *MsgCreateDenomResponse) Reset() { *m = MsgCreateDenomResponse{} func (m *MsgCreateDenomResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateDenomResponse) ProtoMessage() {} func (*MsgCreateDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{1} + return fileDescriptor_c8bccd7946136ed9, []int{1} } func (m *MsgCreateDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -139,7 +142,9 @@ func (m *MsgCreateDenomResponse) GetNewTokenDenom() string { } // MsgMint is the sdk.Msg type for allowing an admin account to mint -// more of a token. For now, we only support minting to the sender account +// more of a token. +// Only the admin of the token factory denom has permission to mint unless +// the denom does not have any admin. type MsgMint struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount" yaml:"amount"` @@ -150,7 +155,7 @@ func (m *MsgMint) Reset() { *m = MsgMint{} } func (m *MsgMint) String() string { return proto.CompactTextString(m) } func (*MsgMint) ProtoMessage() {} func (*MsgMint) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{2} + return fileDescriptor_c8bccd7946136ed9, []int{2} } func (m *MsgMint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -207,7 +212,7 @@ func (m *MsgMintResponse) Reset() { *m = MsgMintResponse{} } func (m *MsgMintResponse) String() string { return proto.CompactTextString(m) } func (*MsgMintResponse) ProtoMessage() {} func (*MsgMintResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{3} + return fileDescriptor_c8bccd7946136ed9, []int{3} } func (m *MsgMintResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -237,7 +242,9 @@ func (m *MsgMintResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMintResponse proto.InternalMessageInfo // MsgBurn is the sdk.Msg type for allowing an admin account to burn -// a token. For now, we only support burning from the sender account. +// a token. +// Only the admin of the token factory denom has permission to burn unless +// the denom does not have any admin. type MsgBurn struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount" yaml:"amount"` @@ -248,7 +255,7 @@ func (m *MsgBurn) Reset() { *m = MsgBurn{} } func (m *MsgBurn) String() string { return proto.CompactTextString(m) } func (*MsgBurn) ProtoMessage() {} func (*MsgBurn) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{4} + return fileDescriptor_c8bccd7946136ed9, []int{4} } func (m *MsgBurn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +312,7 @@ func (m *MsgBurnResponse) Reset() { *m = MsgBurnResponse{} } func (m *MsgBurnResponse) String() string { return proto.CompactTextString(m) } func (*MsgBurnResponse) ProtoMessage() {} func (*MsgBurnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{5} + return fileDescriptor_c8bccd7946136ed9, []int{5} } func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -346,7 +353,7 @@ func (m *MsgChangeAdmin) Reset() { *m = MsgChangeAdmin{} } func (m *MsgChangeAdmin) String() string { return proto.CompactTextString(m) } func (*MsgChangeAdmin) ProtoMessage() {} func (*MsgChangeAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{6} + return fileDescriptor_c8bccd7946136ed9, []int{6} } func (m *MsgChangeAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -405,7 +412,7 @@ func (m *MsgChangeAdminResponse) Reset() { *m = MsgChangeAdminResponse{} func (m *MsgChangeAdminResponse) String() string { return proto.CompactTextString(m) } func (*MsgChangeAdminResponse) ProtoMessage() {} func (*MsgChangeAdminResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{7} + return fileDescriptor_c8bccd7946136ed9, []int{7} } func (m *MsgChangeAdminResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -434,6 +441,106 @@ func (m *MsgChangeAdminResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChangeAdminResponse proto.InternalMessageInfo +// MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to +// assign a CosmWasm contract to call with a BeforeSend hook +type MsgSetBeforeSendHook struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + CosmwasmAddress string `protobuf:"bytes,3,opt,name=cosmwasm_address,json=cosmwasmAddress,proto3" json:"cosmwasm_address,omitempty" yaml:"cosmwasm_address"` +} + +func (m *MsgSetBeforeSendHook) Reset() { *m = MsgSetBeforeSendHook{} } +func (m *MsgSetBeforeSendHook) String() string { return proto.CompactTextString(m) } +func (*MsgSetBeforeSendHook) ProtoMessage() {} +func (*MsgSetBeforeSendHook) Descriptor() ([]byte, []int) { + return fileDescriptor_c8bccd7946136ed9, []int{8} +} +func (m *MsgSetBeforeSendHook) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetBeforeSendHook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetBeforeSendHook.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 *MsgSetBeforeSendHook) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetBeforeSendHook.Merge(m, src) +} +func (m *MsgSetBeforeSendHook) XXX_Size() int { + return m.Size() +} +func (m *MsgSetBeforeSendHook) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetBeforeSendHook.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetBeforeSendHook proto.InternalMessageInfo + +func (m *MsgSetBeforeSendHook) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgSetBeforeSendHook) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *MsgSetBeforeSendHook) GetCosmwasmAddress() string { + if m != nil { + return m.CosmwasmAddress + } + return "" +} + +// MsgSetBeforeSendHookResponse defines the response structure for an executed +// MsgSetBeforeSendHook message. +type MsgSetBeforeSendHookResponse struct { +} + +func (m *MsgSetBeforeSendHookResponse) Reset() { *m = MsgSetBeforeSendHookResponse{} } +func (m *MsgSetBeforeSendHookResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetBeforeSendHookResponse) ProtoMessage() {} +func (*MsgSetBeforeSendHookResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c8bccd7946136ed9, []int{9} +} +func (m *MsgSetBeforeSendHookResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetBeforeSendHookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetBeforeSendHookResponse.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 *MsgSetBeforeSendHookResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetBeforeSendHookResponse.Merge(m, src) +} +func (m *MsgSetBeforeSendHookResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetBeforeSendHookResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetBeforeSendHookResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetBeforeSendHookResponse proto.InternalMessageInfo + // MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set // the denom's bank metadata type MsgSetDenomMetadata struct { @@ -445,7 +552,7 @@ func (m *MsgSetDenomMetadata) Reset() { *m = MsgSetDenomMetadata{} } func (m *MsgSetDenomMetadata) String() string { return proto.CompactTextString(m) } func (*MsgSetDenomMetadata) ProtoMessage() {} func (*MsgSetDenomMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{8} + return fileDescriptor_c8bccd7946136ed9, []int{10} } func (m *MsgSetDenomMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -497,7 +604,7 @@ func (m *MsgSetDenomMetadataResponse) Reset() { *m = MsgSetDenomMetadata func (m *MsgSetDenomMetadataResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetDenomMetadataResponse) ProtoMessage() {} func (*MsgSetDenomMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9ea04d4c00ebf9, []int{9} + return fileDescriptor_c8bccd7946136ed9, []int{11} } func (m *MsgSetDenomMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -526,67 +633,193 @@ func (m *MsgSetDenomMetadataResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetDenomMetadataResponse proto.InternalMessageInfo +type MsgForceTransfer struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount" yaml:"amount"` + TransferFromAddress string `protobuf:"bytes,3,opt,name=transferFromAddress,proto3" json:"transferFromAddress,omitempty" yaml:"transfer_from_address"` + TransferToAddress string `protobuf:"bytes,4,opt,name=transferToAddress,proto3" json:"transferToAddress,omitempty" yaml:"transfer_to_address"` +} + +func (m *MsgForceTransfer) Reset() { *m = MsgForceTransfer{} } +func (m *MsgForceTransfer) String() string { return proto.CompactTextString(m) } +func (*MsgForceTransfer) ProtoMessage() {} +func (*MsgForceTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_c8bccd7946136ed9, []int{12} +} +func (m *MsgForceTransfer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgForceTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgForceTransfer.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 *MsgForceTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgForceTransfer.Merge(m, src) +} +func (m *MsgForceTransfer) XXX_Size() int { + return m.Size() +} +func (m *MsgForceTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgForceTransfer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgForceTransfer proto.InternalMessageInfo + +func (m *MsgForceTransfer) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgForceTransfer) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +func (m *MsgForceTransfer) GetTransferFromAddress() string { + if m != nil { + return m.TransferFromAddress + } + return "" +} + +func (m *MsgForceTransfer) GetTransferToAddress() string { + if m != nil { + return m.TransferToAddress + } + return "" +} + +type MsgForceTransferResponse struct { +} + +func (m *MsgForceTransferResponse) Reset() { *m = MsgForceTransferResponse{} } +func (m *MsgForceTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgForceTransferResponse) ProtoMessage() {} +func (*MsgForceTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c8bccd7946136ed9, []int{13} +} +func (m *MsgForceTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgForceTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgForceTransferResponse.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 *MsgForceTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgForceTransferResponse.Merge(m, src) +} +func (m *MsgForceTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgForceTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgForceTransferResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgForceTransferResponse proto.InternalMessageInfo + func init() { - proto.RegisterType((*MsgCreateDenom)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgCreateDenom") - proto.RegisterType((*MsgCreateDenomResponse)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgCreateDenomResponse") - proto.RegisterType((*MsgMint)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgMint") - proto.RegisterType((*MsgMintResponse)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgMintResponse") - proto.RegisterType((*MsgBurn)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgBurn") - proto.RegisterType((*MsgBurnResponse)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgBurnResponse") - proto.RegisterType((*MsgChangeAdmin)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgChangeAdmin") - proto.RegisterType((*MsgChangeAdminResponse)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgChangeAdminResponse") - proto.RegisterType((*MsgSetDenomMetadata)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgSetDenomMetadata") - proto.RegisterType((*MsgSetDenomMetadataResponse)(nil), "quasarlabs.quasarnode.tokenfactory.v1beta1.MsgSetDenomMetadataResponse") + proto.RegisterType((*MsgCreateDenom)(nil), "quasar.tokenfactory.v1beta1.MsgCreateDenom") + proto.RegisterType((*MsgCreateDenomResponse)(nil), "quasar.tokenfactory.v1beta1.MsgCreateDenomResponse") + proto.RegisterType((*MsgMint)(nil), "quasar.tokenfactory.v1beta1.MsgMint") + proto.RegisterType((*MsgMintResponse)(nil), "quasar.tokenfactory.v1beta1.MsgMintResponse") + proto.RegisterType((*MsgBurn)(nil), "quasar.tokenfactory.v1beta1.MsgBurn") + proto.RegisterType((*MsgBurnResponse)(nil), "quasar.tokenfactory.v1beta1.MsgBurnResponse") + proto.RegisterType((*MsgChangeAdmin)(nil), "quasar.tokenfactory.v1beta1.MsgChangeAdmin") + proto.RegisterType((*MsgChangeAdminResponse)(nil), "quasar.tokenfactory.v1beta1.MsgChangeAdminResponse") + proto.RegisterType((*MsgSetBeforeSendHook)(nil), "quasar.tokenfactory.v1beta1.MsgSetBeforeSendHook") + proto.RegisterType((*MsgSetBeforeSendHookResponse)(nil), "quasar.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse") + proto.RegisterType((*MsgSetDenomMetadata)(nil), "quasar.tokenfactory.v1beta1.MsgSetDenomMetadata") + proto.RegisterType((*MsgSetDenomMetadataResponse)(nil), "quasar.tokenfactory.v1beta1.MsgSetDenomMetadataResponse") + proto.RegisterType((*MsgForceTransfer)(nil), "quasar.tokenfactory.v1beta1.MsgForceTransfer") + proto.RegisterType((*MsgForceTransferResponse)(nil), "quasar.tokenfactory.v1beta1.MsgForceTransferResponse") } func init() { - proto.RegisterFile("quasarlabs/quasarnode/tokenfactory/v1beta1/tx.proto", fileDescriptor_8a9ea04d4c00ebf9) -} - -var fileDescriptor_8a9ea04d4c00ebf9 = []byte{ - // 659 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4f, 0x4f, 0xd4, 0x40, - 0x14, 0xdf, 0x8a, 0x20, 0x0c, 0xe2, 0x42, 0x41, 0x5c, 0x57, 0x69, 0xcd, 0x1c, 0x8c, 0x7a, 0x68, - 0x03, 0xc4, 0x0b, 0x1e, 0x94, 0x62, 0xd0, 0xcb, 0xc6, 0xa4, 0x72, 0x32, 0x26, 0x9b, 0xe9, 0x76, - 0x28, 0x0d, 0x74, 0x06, 0x3b, 0x53, 0x81, 0x0f, 0x61, 0xe2, 0xc1, 0x78, 0xf2, 0x83, 0x78, 0xf4, - 0x64, 0x38, 0x72, 0xf4, 0xd4, 0x18, 0xf8, 0x06, 0xfd, 0x04, 0x66, 0x3a, 0xd3, 0x3f, 0xbb, 0xcb, - 0xc1, 0xe2, 0xc1, 0x5b, 0x77, 0xde, 0xfb, 0xfd, 0xde, 0xfb, 0xcd, 0xfb, 0xbd, 0x1d, 0xb0, 0xfe, - 0x21, 0x41, 0x0c, 0xc5, 0x07, 0xc8, 0x63, 0xb6, 0xfc, 0x24, 0xd4, 0xc7, 0x36, 0xa7, 0xfb, 0x98, - 0xec, 0xa2, 0x01, 0xa7, 0xf1, 0x89, 0xfd, 0x71, 0xd5, 0xc3, 0x1c, 0xad, 0xda, 0xfc, 0xd8, 0x3a, - 0x8c, 0x29, 0xa7, 0xfa, 0x93, 0x0a, 0x64, 0x55, 0x20, 0xab, 0x0e, 0xb2, 0x14, 0xa8, 0xbb, 0x14, - 0xd0, 0x80, 0xe6, 0x30, 0x5b, 0x7c, 0x49, 0x86, 0xae, 0x31, 0xa0, 0x2c, 0xa2, 0xcc, 0xf6, 0x10, - 0xc3, 0x25, 0xff, 0x80, 0x86, 0x64, 0x2c, 0x4e, 0xf6, 0xcb, 0xb8, 0xf8, 0x21, 0xe3, 0xf0, 0x00, - 0xdc, 0xea, 0xb1, 0x60, 0x2b, 0xc6, 0x88, 0xe3, 0x97, 0x98, 0xd0, 0x48, 0x7f, 0x0c, 0xa6, 0x18, - 0x26, 0x3e, 0x8e, 0x3b, 0xda, 0x03, 0xed, 0xd1, 0x8c, 0xb3, 0x90, 0xa5, 0xe6, 0xdc, 0x09, 0x8a, - 0x0e, 0x36, 0xa0, 0x3c, 0x87, 0xae, 0x4a, 0xd0, 0x6d, 0x30, 0xcd, 0x12, 0xcf, 0x17, 0xb0, 0xce, - 0xb5, 0x3c, 0x79, 0x31, 0x4b, 0xcd, 0xb6, 0x4a, 0x56, 0x11, 0xe8, 0x96, 0x49, 0xf0, 0x3d, 0x58, - 0x1e, 0xae, 0xe6, 0x62, 0x76, 0x48, 0x09, 0xc3, 0xba, 0x03, 0xda, 0x04, 0x1f, 0xf5, 0x73, 0xe5, - 0x7d, 0xc9, 0x28, 0xcb, 0x77, 0xb3, 0xd4, 0x5c, 0x96, 0x8c, 0x23, 0x09, 0xd0, 0x9d, 0x23, 0xf8, - 0x68, 0x47, 0x1c, 0xe4, 0x5c, 0xf0, 0x87, 0x06, 0x6e, 0xf4, 0x58, 0xd0, 0x0b, 0x09, 0x6f, 0xa2, - 0xe2, 0x35, 0x98, 0x42, 0x11, 0x4d, 0x08, 0xcf, 0x35, 0xcc, 0xae, 0xdd, 0xb5, 0xe4, 0x9d, 0x59, - 0xe2, 0x4e, 0x8b, 0xeb, 0xb7, 0xb6, 0x68, 0x48, 0x9c, 0xdb, 0xa7, 0xa9, 0xd9, 0xaa, 0x98, 0x24, - 0x0c, 0xba, 0x0a, 0xaf, 0xbf, 0x00, 0x73, 0x51, 0x48, 0xf8, 0x0e, 0xdd, 0xf4, 0xfd, 0x18, 0x33, - 0xd6, 0x99, 0x18, 0x95, 0x20, 0xc2, 0x7d, 0x4e, 0xfb, 0x48, 0x26, 0x40, 0x77, 0x18, 0x00, 0x17, - 0x40, 0x5b, 0x29, 0x28, 0x6e, 0x06, 0xfe, 0x94, 0xaa, 0x9c, 0x24, 0x26, 0xff, 0x47, 0xd5, 0x36, - 0x68, 0x7b, 0x49, 0x4c, 0xb6, 0x63, 0x1a, 0x0d, 0xeb, 0xba, 0x9f, 0xa5, 0x66, 0x47, 0x62, 0x44, - 0x42, 0x7f, 0x37, 0xa6, 0x51, 0xa5, 0x6c, 0x14, 0xa4, 0xb4, 0x09, 0x1d, 0xa5, 0xb6, 0xaf, 0x9a, - 0xb4, 0xdf, 0x1e, 0x22, 0x01, 0xde, 0xf4, 0xa3, 0xb0, 0x91, 0xc4, 0x87, 0x60, 0xb2, 0xee, 0xbd, - 0xf9, 0x2c, 0x35, 0x6f, 0xca, 0x4c, 0xe5, 0x0f, 0x19, 0xd6, 0x57, 0xc1, 0x8c, 0xb0, 0x0e, 0x12, - 0xfc, 0xaa, 0xf5, 0xa5, 0x2c, 0x35, 0xe7, 0x2b, 0x57, 0xe5, 0x21, 0xe8, 0x4e, 0x13, 0x7c, 0x94, - 0x77, 0x01, 0x3b, 0xd2, 0xa8, 0x55, 0x5f, 0x65, 0xcb, 0x5f, 0x34, 0xb0, 0xd8, 0x63, 0xc1, 0x5b, - 0xcc, 0x73, 0xd3, 0xf5, 0x30, 0x47, 0x3e, 0xe2, 0xa8, 0x49, 0xdf, 0x2e, 0x98, 0x8e, 0x14, 0x4c, - 0x0d, 0x67, 0xa5, 0x1a, 0x0e, 0xd9, 0x2f, 0x87, 0x53, 0x70, 0x3b, 0x77, 0xd4, 0x80, 0xd4, 0x66, - 0x15, 0x60, 0xe8, 0x96, 0x3c, 0x70, 0x05, 0xdc, 0xbb, 0xa4, 0xab, 0xa2, 0xeb, 0xb5, 0xef, 0x93, - 0x60, 0xa2, 0xc7, 0x02, 0xfd, 0x93, 0x06, 0x66, 0xeb, 0xcb, 0xbe, 0x61, 0xfd, 0xfd, 0x3f, 0x90, - 0x35, 0xbc, 0xba, 0x5d, 0xe7, 0xea, 0xd8, 0x72, 0xed, 0x8f, 0xc1, 0xf5, 0x7c, 0x5d, 0xd7, 0x1b, - 0x72, 0x09, 0x50, 0xf7, 0xd9, 0x15, 0x40, 0xf5, 0xca, 0xf9, 0x4a, 0x35, 0xad, 0x2c, 0x40, 0x8d, - 0x2b, 0xd7, 0x4d, 0x2f, 0x67, 0x50, 0x73, 0x7c, 0xe3, 0x19, 0x54, 0xd8, 0xe6, 0x33, 0x18, 0x77, - 0xb4, 0xfe, 0x4d, 0x03, 0xf3, 0x63, 0x76, 0x7e, 0xde, 0x90, 0x78, 0x94, 0xa0, 0xfb, 0xea, 0x1f, - 0x09, 0x8a, 0xf6, 0x9c, 0x37, 0xa7, 0xe7, 0x86, 0x76, 0x76, 0x6e, 0x68, 0xbf, 0xcf, 0x0d, 0xed, - 0xf3, 0x85, 0xd1, 0x3a, 0xbb, 0x30, 0x5a, 0xbf, 0x2e, 0x8c, 0xd6, 0xbb, 0xa7, 0x41, 0xc8, 0xf7, - 0x12, 0xcf, 0x1a, 0xd0, 0xc8, 0xbe, 0xfc, 0xf5, 0x3d, 0x1e, 0x7e, 0x7f, 0xf9, 0xc9, 0x21, 0x66, - 0xde, 0x54, 0xfe, 0xf2, 0xad, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x15, 0xe8, 0x95, 0xb2, - 0x07, 0x00, 0x00, + proto.RegisterFile("quasar/tokenfactory/v1beta1/tx.proto", fileDescriptor_c8bccd7946136ed9) +} + +var fileDescriptor_c8bccd7946136ed9 = []byte{ + // 950 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xf6, 0x4f, 0x48, 0xa6, 0x04, 0xdb, 0x9b, 0xd0, 0xb8, 0x9b, 0x64, 0x37, 0x1a, 0x15, + 0x0a, 0xa5, 0xf6, 0xe2, 0x56, 0x45, 0x90, 0x13, 0x75, 0x51, 0xd4, 0x03, 0x16, 0xd2, 0x26, 0xa7, + 0x0a, 0xc9, 0x1a, 0xdb, 0xe3, 0xcd, 0xca, 0xec, 0x4c, 0x98, 0x19, 0x37, 0xcd, 0x05, 0xc1, 0x95, + 0x13, 0x12, 0x7c, 0x01, 0xbe, 0x41, 0x0f, 0x5c, 0xb9, 0xf7, 0x58, 0x71, 0xe2, 0xb4, 0x45, 0x89, + 0x50, 0xef, 0xfb, 0x09, 0xd0, 0xfc, 0xd9, 0x5d, 0xff, 0x53, 0x1c, 0x4b, 0x20, 0x2e, 0xb6, 0x67, + 0xde, 0xef, 0xf7, 0xe6, 0xfd, 0xde, 0xbc, 0xf7, 0xc6, 0xe0, 0xf6, 0xb7, 0x43, 0xc4, 0x11, 0xf3, + 0x05, 0x1d, 0x60, 0xd2, 0x47, 0x5d, 0x41, 0xd9, 0xa9, 0xff, 0xac, 0xd1, 0xc1, 0x02, 0x35, 0x7c, + 0xf1, 0xbc, 0x7e, 0xcc, 0xa8, 0xa0, 0xf6, 0x96, 0x46, 0xd5, 0x47, 0x51, 0x75, 0x83, 0x72, 0x36, + 0x42, 0x1a, 0x52, 0x85, 0xf3, 0xe5, 0x2f, 0x4d, 0x71, 0x2a, 0x28, 0x8e, 0x08, 0xf5, 0xd5, 0xa7, + 0xd9, 0xba, 0xd5, 0xa5, 0x3c, 0xa6, 0xbc, 0xad, 0xb1, 0x7a, 0x61, 0x4c, 0xae, 0x5e, 0xf9, 0x1d, + 0xc4, 0x71, 0x7e, 0x7c, 0x97, 0x46, 0x64, 0xca, 0x4e, 0x06, 0xb9, 0x5d, 0x2e, 0x8c, 0x7d, 0xd3, + 0xd8, 0x63, 0x1e, 0xfa, 0xcf, 0x1a, 0xf2, 0x4b, 0x1b, 0xe0, 0xcf, 0x16, 0x78, 0xa7, 0xc5, 0xc3, + 0xc7, 0x0c, 0x23, 0x81, 0xbf, 0xc0, 0x84, 0xc6, 0xf6, 0x87, 0x60, 0x99, 0x63, 0xd2, 0xc3, 0xac, + 0x6a, 0xed, 0x5a, 0x1f, 0xac, 0x36, 0x2b, 0x69, 0xe2, 0xad, 0x9d, 0xa2, 0xf8, 0x9b, 0x3d, 0xa8, + 0xf7, 0x61, 0x60, 0x00, 0xb6, 0x0f, 0x56, 0xf8, 0xb0, 0xd3, 0x93, 0xb4, 0xea, 0x15, 0x05, 0x5e, + 0x4f, 0x13, 0xaf, 0x64, 0xc0, 0xc6, 0x02, 0x83, 0x1c, 0xb4, 0xf7, 0xde, 0x8f, 0x6f, 0x5e, 0xdc, + 0xdd, 0x9d, 0x95, 0xd3, 0xae, 0x8a, 0xa0, 0xa6, 0x19, 0x5f, 0x83, 0x9b, 0xe3, 0x41, 0x05, 0x98, + 0x1f, 0x53, 0xc2, 0xb1, 0xdd, 0x04, 0x25, 0x82, 0x4f, 0xda, 0x8a, 0xda, 0xd6, 0x07, 0xeb, 0x28, + 0x9d, 0x34, 0xf1, 0x6e, 0xea, 0x83, 0x27, 0x00, 0x30, 0x58, 0x23, 0xf8, 0xe4, 0x50, 0x6e, 0x28, + 0x5f, 0xf0, 0xb5, 0x05, 0xde, 0x6a, 0xf1, 0xb0, 0x15, 0x11, 0xb1, 0x88, 0xd8, 0x27, 0x60, 0x19, + 0xc5, 0x74, 0x48, 0x84, 0x92, 0x7a, 0xe3, 0xfe, 0xad, 0xba, 0xb9, 0x22, 0x79, 0x29, 0xd9, 0x6d, + 0xd7, 0x1f, 0xd3, 0x88, 0x34, 0xdf, 0x7d, 0x99, 0x78, 0x4b, 0x85, 0x27, 0x4d, 0x83, 0x81, 0xe1, + 0xdb, 0x9f, 0x83, 0xb5, 0x38, 0x22, 0xe2, 0x90, 0x3e, 0xea, 0xf5, 0x18, 0xe6, 0xbc, 0x7a, 0x75, + 0x52, 0x82, 0x34, 0xb7, 0x05, 0x6d, 0x23, 0x0d, 0x80, 0xc1, 0x38, 0x61, 0x6f, 0x47, 0xe6, 0xb1, + 0x3a, 0x2b, 0x8f, 0x12, 0x07, 0x2b, 0xa0, 0x64, 0x04, 0x66, 0x89, 0x83, 0x7f, 0x6b, 0xd1, 0xcd, + 0x21, 0x23, 0xff, 0x8f, 0xe8, 0x7d, 0x50, 0xea, 0x0c, 0x19, 0xd9, 0x67, 0x34, 0x1e, 0x97, 0xbd, + 0x9d, 0x26, 0x5e, 0x55, 0x73, 0x24, 0xa0, 0xdd, 0x67, 0x34, 0x2e, 0x84, 0x4f, 0x92, 0x2e, 0x90, + 0x2e, 0x91, 0x46, 0xba, 0x94, 0x99, 0x4b, 0xff, 0xdd, 0xd4, 0xf8, 0x11, 0x22, 0x21, 0x7e, 0xd4, + 0x8b, 0xa3, 0x85, 0x32, 0xf0, 0x3e, 0xb8, 0x3e, 0x5a, 0xe0, 0xe5, 0x34, 0xf1, 0xde, 0xd6, 0x48, + 0x53, 0x5d, 0xda, 0x6c, 0x37, 0xc0, 0xaa, 0x2c, 0x3c, 0x24, 0xfd, 0x1b, 0x65, 0x1b, 0x69, 0xe2, + 0x95, 0x8b, 0x9a, 0x54, 0x26, 0x18, 0xac, 0x10, 0x7c, 0xa2, 0xa2, 0xb8, 0xa8, 0x1b, 0x54, 0xac, + 0x35, 0xcd, 0xa8, 0xea, 0x6e, 0x28, 0xc2, 0xcf, 0x95, 0xbd, 0xb6, 0xc0, 0x46, 0x8b, 0x87, 0x07, + 0x58, 0x34, 0x71, 0x9f, 0x32, 0x7c, 0x80, 0x49, 0xef, 0x09, 0xa5, 0x83, 0xff, 0x42, 0xdf, 0x3e, + 0x28, 0xcb, 0xab, 0x3f, 0x41, 0x3c, 0xbf, 0x1d, 0x23, 0x73, 0x2b, 0x4d, 0xbc, 0x4d, 0x4d, 0x99, + 0x44, 0xc0, 0xa0, 0x94, 0x6d, 0x65, 0xf7, 0x77, 0x4f, 0x8a, 0xbe, 0x33, 0x4b, 0x34, 0xc7, 0xa2, + 0xd6, 0x51, 0x3a, 0x64, 0x68, 0xb5, 0x23, 0x4a, 0x07, 0xd0, 0x05, 0xdb, 0xb3, 0x04, 0xe6, 0x19, + 0xf8, 0xc5, 0x02, 0xeb, 0x1a, 0xa0, 0x7a, 0xbb, 0x85, 0x05, 0xea, 0x21, 0x81, 0x16, 0x49, 0x40, + 0x00, 0x56, 0x62, 0x43, 0x33, 0x45, 0xbe, 0x53, 0x14, 0x39, 0x19, 0xe4, 0x45, 0x9e, 0xf9, 0x6e, + 0x6e, 0x9a, 0x42, 0x37, 0x73, 0x2e, 0x23, 0xc3, 0x20, 0xf7, 0x03, 0x77, 0xc0, 0xd6, 0x8c, 0xa8, + 0x8a, 0x7b, 0xbb, 0x02, 0xca, 0x2d, 0x1e, 0xee, 0x53, 0xd6, 0xc5, 0x87, 0x0c, 0x11, 0xde, 0xc7, + 0xcc, 0xfe, 0x04, 0xac, 0xa2, 0xa1, 0x38, 0xa2, 0x2c, 0x12, 0xa7, 0x26, 0xea, 0xea, 0x1f, 0xbf, + 0xd5, 0x36, 0x4c, 0x2c, 0x26, 0x7f, 0x07, 0x82, 0x45, 0x24, 0x0c, 0x0a, 0xe8, 0xbf, 0xd8, 0xa2, + 0x01, 0x58, 0x17, 0x26, 0x9a, 0xe9, 0x36, 0xdd, 0x4d, 0x13, 0x6f, 0x5b, 0xf3, 0x32, 0xd0, 0x44, + 0xab, 0xce, 0x22, 0xdb, 0x5f, 0x82, 0x4a, 0xb6, 0x5d, 0xcc, 0xbb, 0x6b, 0xca, 0xa3, 0x9b, 0x26, + 0x9e, 0x33, 0xe1, 0x71, 0x74, 0xe6, 0x4d, 0x13, 0xf7, 0xee, 0xc8, 0xe2, 0x81, 0xb3, 0x8a, 0xa7, + 0x2f, 0x73, 0x59, 0xcb, 0x18, 0xd0, 0x01, 0xd5, 0xc9, 0x04, 0x67, 0xd9, 0xbf, 0xff, 0xeb, 0x32, + 0xb8, 0xda, 0xe2, 0xa1, 0x4d, 0xc1, 0x8d, 0xd1, 0x77, 0xef, 0xa3, 0xfa, 0x05, 0xaf, 0x78, 0x7d, + 0xfc, 0x3d, 0x72, 0x1e, 0x2c, 0x00, 0xce, 0x1f, 0xaf, 0xa7, 0xe0, 0x9a, 0x7a, 0x74, 0x6e, 0xcf, + 0x23, 0x4b, 0x94, 0x73, 0xef, 0x32, 0xa8, 0x51, 0xdf, 0x6a, 0xb6, 0xcf, 0xf5, 0x2d, 0x51, 0xf3, + 0x7d, 0x8f, 0x0e, 0x50, 0x95, 0xa8, 0x91, 0xe1, 0x39, 0x3f, 0x51, 0x05, 0xf8, 0x12, 0x89, 0x9a, + 0x9e, 0x6b, 0xf6, 0x77, 0xa0, 0x3c, 0xd5, 0xd1, 0x1f, 0xcf, 0x73, 0x34, 0xc9, 0x70, 0x3e, 0x5d, + 0x94, 0x91, 0x9f, 0xff, 0x83, 0x05, 0x2a, 0xd3, 0x43, 0xb5, 0x71, 0x09, 0x7f, 0xe3, 0x14, 0xe7, + 0xb3, 0x85, 0x29, 0x79, 0x0c, 0x43, 0xb0, 0x36, 0x3e, 0x1f, 0x6a, 0xf3, 0x7c, 0x8d, 0xc1, 0x9d, + 0x87, 0x0b, 0xc1, 0xb3, 0x63, 0x9d, 0xeb, 0xdf, 0xbf, 0x79, 0x71, 0xd7, 0x6a, 0x7e, 0xf5, 0xf2, + 0xcc, 0xb5, 0x5e, 0x9d, 0xb9, 0xd6, 0x5f, 0x67, 0xae, 0xf5, 0xd3, 0xb9, 0xbb, 0xf4, 0xea, 0xdc, + 0x5d, 0xfa, 0xf3, 0xdc, 0x5d, 0x7a, 0xfa, 0x30, 0x8c, 0xc4, 0xd1, 0xb0, 0x53, 0xef, 0xd2, 0xd8, + 0xd7, 0x27, 0xd4, 0xfa, 0x11, 0x41, 0xa4, 0x8b, 0xcd, 0xd2, 0x7f, 0x3e, 0xde, 0x99, 0xe2, 0xf4, + 0x18, 0xf3, 0xce, 0xb2, 0xfa, 0xbf, 0xf9, 0xe0, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0xfc, + 0x7b, 0xfc, 0x51, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -606,6 +839,8 @@ type MsgClient interface { Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) ChangeAdmin(ctx context.Context, in *MsgChangeAdmin, opts ...grpc.CallOption) (*MsgChangeAdminResponse, error) SetDenomMetadata(ctx context.Context, in *MsgSetDenomMetadata, opts ...grpc.CallOption) (*MsgSetDenomMetadataResponse, error) + SetBeforeSendHook(ctx context.Context, in *MsgSetBeforeSendHook, opts ...grpc.CallOption) (*MsgSetBeforeSendHookResponse, error) + ForceTransfer(ctx context.Context, in *MsgForceTransfer, opts ...grpc.CallOption) (*MsgForceTransferResponse, error) } type msgClient struct { @@ -618,7 +853,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) CreateDenom(ctx context.Context, in *MsgCreateDenom, opts ...grpc.CallOption) (*MsgCreateDenomResponse, error) { out := new(MsgCreateDenomResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/CreateDenom", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Msg/CreateDenom", in, out, opts...) if err != nil { return nil, err } @@ -627,7 +862,7 @@ func (c *msgClient) CreateDenom(ctx context.Context, in *MsgCreateDenom, opts .. func (c *msgClient) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) { out := new(MsgMintResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/Mint", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Msg/Mint", in, out, opts...) if err != nil { return nil, err } @@ -636,7 +871,7 @@ func (c *msgClient) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOpti func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) { out := new(MsgBurnResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/Burn", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Msg/Burn", in, out, opts...) if err != nil { return nil, err } @@ -645,7 +880,7 @@ func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOpti func (c *msgClient) ChangeAdmin(ctx context.Context, in *MsgChangeAdmin, opts ...grpc.CallOption) (*MsgChangeAdminResponse, error) { out := new(MsgChangeAdminResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/ChangeAdmin", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Msg/ChangeAdmin", in, out, opts...) if err != nil { return nil, err } @@ -654,7 +889,25 @@ func (c *msgClient) ChangeAdmin(ctx context.Context, in *MsgChangeAdmin, opts .. func (c *msgClient) SetDenomMetadata(ctx context.Context, in *MsgSetDenomMetadata, opts ...grpc.CallOption) (*MsgSetDenomMetadataResponse, error) { out := new(MsgSetDenomMetadataResponse) - err := c.cc.Invoke(ctx, "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/SetDenomMetadata", in, out, opts...) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Msg/SetDenomMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetBeforeSendHook(ctx context.Context, in *MsgSetBeforeSendHook, opts ...grpc.CallOption) (*MsgSetBeforeSendHookResponse, error) { + out := new(MsgSetBeforeSendHookResponse) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Msg/SetBeforeSendHook", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ForceTransfer(ctx context.Context, in *MsgForceTransfer, opts ...grpc.CallOption) (*MsgForceTransferResponse, error) { + out := new(MsgForceTransferResponse) + err := c.cc.Invoke(ctx, "/quasar.tokenfactory.v1beta1.Msg/ForceTransfer", in, out, opts...) if err != nil { return nil, err } @@ -668,6 +921,8 @@ type MsgServer interface { Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) ChangeAdmin(context.Context, *MsgChangeAdmin) (*MsgChangeAdminResponse, error) SetDenomMetadata(context.Context, *MsgSetDenomMetadata) (*MsgSetDenomMetadataResponse, error) + SetBeforeSendHook(context.Context, *MsgSetBeforeSendHook) (*MsgSetBeforeSendHookResponse, error) + ForceTransfer(context.Context, *MsgForceTransfer) (*MsgForceTransferResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -689,6 +944,12 @@ func (*UnimplementedMsgServer) ChangeAdmin(ctx context.Context, req *MsgChangeAd func (*UnimplementedMsgServer) SetDenomMetadata(ctx context.Context, req *MsgSetDenomMetadata) (*MsgSetDenomMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetDenomMetadata not implemented") } +func (*UnimplementedMsgServer) SetBeforeSendHook(ctx context.Context, req *MsgSetBeforeSendHook) (*MsgSetBeforeSendHookResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetBeforeSendHook not implemented") +} +func (*UnimplementedMsgServer) ForceTransfer(ctx context.Context, req *MsgForceTransfer) (*MsgForceTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ForceTransfer not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -704,7 +965,7 @@ func _Msg_CreateDenom_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/CreateDenom", + FullMethod: "/quasar.tokenfactory.v1beta1.Msg/CreateDenom", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CreateDenom(ctx, req.(*MsgCreateDenom)) @@ -722,7 +983,7 @@ func _Msg_Mint_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/Mint", + FullMethod: "/quasar.tokenfactory.v1beta1.Msg/Mint", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Mint(ctx, req.(*MsgMint)) @@ -740,7 +1001,7 @@ func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/Burn", + FullMethod: "/quasar.tokenfactory.v1beta1.Msg/Burn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Burn(ctx, req.(*MsgBurn)) @@ -758,7 +1019,7 @@ func _Msg_ChangeAdmin_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/ChangeAdmin", + FullMethod: "/quasar.tokenfactory.v1beta1.Msg/ChangeAdmin", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).ChangeAdmin(ctx, req.(*MsgChangeAdmin)) @@ -776,7 +1037,7 @@ func _Msg_SetDenomMetadata_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/quasarlabs.quasarnode.tokenfactory.v1beta1.Msg/SetDenomMetadata", + FullMethod: "/quasar.tokenfactory.v1beta1.Msg/SetDenomMetadata", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SetDenomMetadata(ctx, req.(*MsgSetDenomMetadata)) @@ -784,8 +1045,44 @@ func _Msg_SetDenomMetadata_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Msg_SetBeforeSendHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetBeforeSendHook) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetBeforeSendHook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/quasar.tokenfactory.v1beta1.Msg/SetBeforeSendHook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetBeforeSendHook(ctx, req.(*MsgSetBeforeSendHook)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ForceTransfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgForceTransfer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ForceTransfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/quasar.tokenfactory.v1beta1.Msg/ForceTransfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ForceTransfer(ctx, req.(*MsgForceTransfer)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "quasarlabs.quasarnode.tokenfactory.v1beta1.Msg", + ServiceName: "quasar.tokenfactory.v1beta1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -808,9 +1105,17 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SetDenomMetadata", Handler: _Msg_SetDenomMetadata_Handler, }, + { + MethodName: "SetBeforeSendHook", + Handler: _Msg_SetBeforeSendHook_Handler, + }, + { + MethodName: "ForceTransfer", + Handler: _Msg_ForceTransfer_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "quasarlabs/quasarnode/tokenfactory/v1beta1/tx.proto", + Metadata: "quasar/tokenfactory/v1beta1/tx.proto", } func (m *MsgCreateDenom) Marshal() (dAtA []byte, err error) { @@ -1087,6 +1392,73 @@ func (m *MsgChangeAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgSetBeforeSendHook) 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 *MsgSetBeforeSendHook) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetBeforeSendHook) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CosmwasmAddress) > 0 { + i -= len(m.CosmwasmAddress) + copy(dAtA[i:], m.CosmwasmAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.CosmwasmAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + 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 *MsgSetBeforeSendHookResponse) 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 *MsgSetBeforeSendHookResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetBeforeSendHookResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgSetDenomMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1150,30 +1522,107 @@ func (m *MsgSetDenomMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, er 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 *MsgForceTransfer) 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 *MsgCreateDenom) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgForceTransfer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgForceTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.TransferToAddress) > 0 { + i -= len(m.TransferToAddress) + copy(dAtA[i:], m.TransferToAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.TransferToAddress))) + i-- + dAtA[i] = 0x22 } - l = len(m.Subdenom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.TransferFromAddress) > 0 { + i -= len(m.TransferFromAddress) + copy(dAtA[i:], m.TransferFromAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.TransferFromAddress))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Amount.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 *MsgForceTransferResponse) 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 *MsgForceTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgForceTransferResponse) 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 *MsgCreateDenom) 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)) + } + l = len(m.Subdenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } return n } @@ -1277,6 +1726,36 @@ func (m *MsgChangeAdminResponse) Size() (n int) { return n } +func (m *MsgSetBeforeSendHook) 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)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CosmwasmAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetBeforeSendHookResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgSetDenomMetadata) Size() (n int) { if m == nil { return 0 @@ -1301,6 +1780,38 @@ func (m *MsgSetDenomMetadataResponse) Size() (n int) { return n } +func (m *MsgForceTransfer) 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.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.TransferFromAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.TransferToAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgForceTransferResponse) 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 } @@ -1326,21 +1837,446 @@ func (m *MsgCreateDenom) Unmarshal(dAtA []byte) error { if b < 0x80 { break } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateDenom: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateDenom: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDenom: 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 != 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 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.Subdenom = 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 *MsgCreateDenomResponse) 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: MsgCreateDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewTokenDenom", 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.NewTokenDenom = 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 *MsgMint) 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: MsgMint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMint: 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintToAddress", 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.MintToAddress = 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 *MsgMintResponse) 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: MsgMintResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMintResponse: 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 *MsgBurn) 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: MsgBurn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurn: 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 != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1350,27 +2286,28 @@ func (m *MsgCreateDenom) 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.Sender = string(dAtA[iNdEx:postIndex]) + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subdenom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BurnFromAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1398,7 +2335,7 @@ func (m *MsgCreateDenom) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Subdenom = string(dAtA[iNdEx:postIndex]) + m.BurnFromAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1421,7 +2358,7 @@ func (m *MsgCreateDenom) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateDenomResponse) Unmarshal(dAtA []byte) error { +func (m *MsgBurnResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1444,44 +2381,12 @@ func (m *MsgCreateDenomResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateDenomResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgBurnResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgBurnResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewTokenDenom", 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.NewTokenDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1503,7 +2408,7 @@ func (m *MsgCreateDenomResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgMint) Unmarshal(dAtA []byte) error { +func (m *MsgChangeAdmin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1526,10 +2431,10 @@ func (m *MsgMint) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgMint: wiretype end group for non-group") + return fmt.Errorf("proto: MsgChangeAdmin: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgChangeAdmin: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1566,9 +2471,9 @@ func (m *MsgMint) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1578,28 +2483,27 @@ func (m *MsgMint) 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 ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MintToAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NewAdmin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1627,7 +2531,7 @@ func (m *MsgMint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MintToAddress = string(dAtA[iNdEx:postIndex]) + m.NewAdmin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1650,7 +2554,7 @@ func (m *MsgMint) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgMintResponse) Unmarshal(dAtA []byte) error { +func (m *MsgChangeAdminResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1673,10 +2577,10 @@ func (m *MsgMintResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgMintResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgChangeAdminResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMintResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgChangeAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1700,7 +2604,7 @@ func (m *MsgMintResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgBurn) Unmarshal(dAtA []byte) error { +func (m *MsgSetBeforeSendHook) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1723,10 +2627,10 @@ func (m *MsgBurn) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgBurn: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetBeforeSendHook: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBurn: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetBeforeSendHook: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1763,9 +2667,9 @@ func (m *MsgBurn) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1775,28 +2679,27 @@ func (m *MsgBurn) 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 ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BurnFromAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CosmwasmAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1824,7 +2727,7 @@ func (m *MsgBurn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BurnFromAddress = string(dAtA[iNdEx:postIndex]) + m.CosmwasmAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1847,7 +2750,7 @@ func (m *MsgBurn) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgBurnResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSetBeforeSendHookResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1870,10 +2773,10 @@ func (m *MsgBurnResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgBurnResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetBeforeSendHookResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBurnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetBeforeSendHookResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1897,7 +2800,7 @@ func (m *MsgBurnResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgChangeAdmin) Unmarshal(dAtA []byte) error { +func (m *MsgSetDenomMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1920,10 +2823,10 @@ func (m *MsgChangeAdmin) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgChangeAdmin: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetDenomMetadata: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeAdmin: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetDenomMetadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1960,9 +2863,9 @@ func (m *MsgChangeAdmin) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1972,55 +2875,24 @@ func (m *MsgChangeAdmin) 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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewAdmin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.NewAdmin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2043,7 +2915,7 @@ func (m *MsgChangeAdmin) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgChangeAdminResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSetDenomMetadataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2066,10 +2938,10 @@ func (m *MsgChangeAdminResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgChangeAdminResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetDenomMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetDenomMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2093,7 +2965,7 @@ func (m *MsgChangeAdminResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetDenomMetadata) Unmarshal(dAtA []byte) error { +func (m *MsgForceTransfer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2116,15 +2988,15 @@ func (m *MsgSetDenomMetadata) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetDenomMetadata: wiretype end group for non-group") + return fmt.Errorf("proto: MsgForceTransfer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetDenomMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgForceTransfer: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2152,11 +3024,11 @@ func (m *MsgSetDenomMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2183,10 +3055,74 @@ func (m *MsgSetDenomMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferFromAddress", 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.TransferFromAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferToAddress", 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.TransferToAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2208,7 +3144,7 @@ func (m *MsgSetDenomMetadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetDenomMetadataResponse) Unmarshal(dAtA []byte) error { +func (m *MsgForceTransferResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2231,10 +3167,10 @@ func (m *MsgSetDenomMetadataResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetDenomMetadataResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgForceTransferResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetDenomMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgForceTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: