diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d921d0f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: +- package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2ade156 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: Build Quasar + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +# This workflow makes x86_64 binaries for linux. +# TODO: add darwin later +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + arch: [amd64] + targetos: [linux] + name: quasar ${{ matrix.arch }} for ${{ matrix.targetos }} + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Setup Golang + uses: actions/setup-go@v3 + with: + go-version: 1.18 + env: + GOOS: ${{ matrix.targetos }} + GOARCH: ${{ matrix.arch }} + - name: Display go version + run: go version + - name: Build quasarnoded + run: make build-reproducible-${{ matrix.arch }} + - uses: actions/upload-artifact@v2 + with: + name: quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }} + path: build/quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }} + # - name: Build smart contracts + # run: make compile-wasm-artifacts + # - uses: actions/upload-artifact@v2 + # with: + # name: smart-contracts + # path: | + # smart-contracts/artifacts/basic_vault.wasm + # smart-contracts/artifacts/lp_strategy.wasm diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7b4ffab --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Lint Quasar code + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +# This workflow makes x86_64 binaries for linux. +# TODO: add darwin later +jobs: + lint-go: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Setup Golang + uses: actions/setup-go@v3 + with: + go-version: 1.18 + - name: Display go version + run: go version + - name: Go lint + run: make lint + # lint-rust: + # runs-on: ubuntu-latest + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Install Rust + # uses: dtolnay/rust-toolchain@stable + # - name: Show versions + # run: rustc -V && cargo -V + # - name: Rust lint + # run: cd smart-contracts && RUSTFLAGS="-Dwarnings" cargo clippy --workspace -- -D warnings + # - name: Rust format check + # run: cd smart-contracts && cargo fmt --all -- --check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..006091e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +name: Test Quasar + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +# This workflow makes x86_64 binaries for linux. +# TODO: add darwin later +jobs: + test-go: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Setup Golang + uses: actions/setup-go@v3 + with: + go-version: 1.18 + - name: Display go version + run: go version + - name: Run all tests + run: make test-cover + - name: Code coverage report + uses: codecov/codecov-action@v1.5.2 + # test-rust: + # runs-on: ubuntu-latest + # steps: + # - name: Check out repository code + # uses: actions/checkout@v3 + # - name: Install Rust + # uses: dtolnay/rust-toolchain@stable + # - name: Run unit-tests + # run: cd smart-contracts && cargo test --lib + # - name: Run vault-tests + # run: cd smart-contracts && cargo test --lib -p basic-vault + # - name: Compile wasm code + # uses: docker://cosmwasm/rust-optimizer:0.12.6 + # with: + # args: >- + # --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 + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..28d4071 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +.idea/ +.vscode/ +.DS_Store +.env +tmp/ +*.tmp +*.log +__debug_bin + +release/ +build/ +run/ + +node_modules/ +vue/ + +**/**/artifacts +**/**/target +local_testnet_run-*nodes/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..93d3430 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,73 @@ +# syntax=docker/dockerfile:1 + +ARG GO_VERSION="1.18" +ARG RUNNER_IMAGE="gcr.io/distroless/static" + +# -------------------------------------------------------- +# Builder +# -------------------------------------------------------- + +FROM golang:${GO_VERSION}-alpine as builder + +ARG GIT_VERSION +ARG GIT_COMMIT + +RUN apk add --no-cache \ + ca-certificates \ + build-base \ + linux-headers + +# Download go dependencies +WORKDIR /quasar +COPY go.mod go.sum ./ +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/root/go/pkg/mod \ + go mod download + +# Cosmwasm - Download correct libwasmvm version +RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) && \ + wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \ + -O /lib/libwasmvm_muslc.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 $(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 +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 ./cmd/quasarnoded + + +# -------------------------------------------------------- +# Runner +# -------------------------------------------------------- + +FROM ${RUNNER_IMAGE} + +COPY --from=builder /quasar/build/quasarnoded /bin/quasarnoded + +ENV HOME /quasar +WORKDIR $HOME + +EXPOSE 26656 +EXPOSE 26657 +EXPOSE 1317 + +ENTRYPOINT ["quasarnoded"] \ No newline at end of file diff --git a/LOCALNET.md b/LOCALNET.md new file mode 100644 index 0000000..4d797a3 --- /dev/null +++ b/LOCALNET.md @@ -0,0 +1,132 @@ + +# Quasar Local Testnet (localnet) + +To run a small network of Quasar nodes locally, first generate their respective configuration: + +## Setup + +### Cosmovisor + +Cosmovisor should be installed and available to use, [follow these instructions](https://github.com/cosmos/cosmos-sdk/tree/main/cosmovisor#installation). + +Note, the current method for installation of the latest version of cosmovisor is broken, but you can still build it from source: + +```bash +git clone git@github.com:cosmos/cosmos-sdk +cd cosmos-sdk +git checkout cosmovisor/v1.1.0 +make cosmovisor +cp cosmovisor/cosmovisor ~/go/bin/cosmovisor +echo "$(which cosmovisor)" +``` + +```bash +make build # make sure we have a quasar executable available first +scripts/localnet init_default_cluster +``` + +This will create a set of configuration files per node, under `run/localnet`. + +By default, there is a total of 4 nodes: `node1`, `node2`, `node3`, `node4` + +The network is now ready to be started. + +Note that the chain state will be kept under the `run/localnet` node folders. +Running `scripts/localnet init_default_cluster` a second time will fail if existing state is present in `run/localnet`. + +If a reset is desired, the entire content of `run/localnet` can be removed and `scripts/localnet init_default_cluster` can be run again. + +## Start + +```bash +scripts/localnet start_all +``` + +To see if the nodes are running: + +```bash +scripts/localnet status_all +``` + +Once the network is running, you can see the logging per node, this way: + +```bash +scripts/localnet node 0 log +``` + +Here, `0` is the node identifier, you can use, `1`, `2`, or `3` to see the logging of the other nodes. + +## Commands + +You can also issue query or tx commands against each node: + +```bash +scripts/localnet node 0 cmd tx bank send main quasar1khfcjt5w0dfjgkcudlrnnun2rtq359ulrgv7gw 1000uqsar +``` + +This will send a bank transfer from `node0`'s `main` address, to another quasar address `quasar1khfcjt5w0dfjgkcudlrnnun2rtq359ulrgv7gw`. + +You can check the balance after the transfer: + +```bash +curl http://localhost:1300/bank/balances/quasar1khfcjt5w0dfjgkcudlrnnun2rtq359ulrgv7gw +``` + +Note that the API for `node0` is available at `localhost:1300`, while the API for `node1` is at `localhost:1301`, and so forth. + +## Test a chain upgrade + +You can test a dummy upgrade by doing the following steps. + +Once the network is running, you can first introduce a Quasar upgrade, using the following script. It will add source code for a dummy upgrade under `app/upgrades/dummy`: + +```bash +scripts/add_dummy_upgrade +``` + +Then make sure the upgrade is registered in the `app.go`: + +```golang +// imports +// ... +dummy "github.com/quasarlabs/quasarnode/app/upgrades/dummy" + +// var block declaration +// ... +Upgrades = []upgrades.Upgrade{dummy.Upgrade} +``` + +Then you can recompile the quasar node binary and install it in the local node folders: + +```bash +make build +scripts/localnet install_upgrade_binaries dummy +``` + +You can confirm that the new binaries are installed correctly and ready to be used: + +```bash +ls run/localnet/node*/home/cosmovisor/upgrades/dummy/bin +``` + +Now we can trigger the upgrade via a governance proposal and `cosmovisor` will swap and restart the new binary. + +You can also run a terminal window tailing the logging of one of the nodes (`scripts/localnet node 0 log`), to witness the upgrade happening. + +```bash +scripts/localnet register_upgrade 1 BLOCK_HEIGHT dummy +``` + +Here we instruct the first proposal (`1`), to run the `dummy` upgrade at height `BLOCK_HEIGHT`. + +The script will instruct all 4 validator nodes to vote yes on this proposal, that will happen at `BLOCK_HEIGHT`, choose a block height about a minute in the future, ~100 blocks away from now for instance, this will allow for the voting period to end (20 seconds configured) and the proposal to pass successfully. + +After the target block height has been reached, you should see the restart happening in the logs, as well as the dummy print statement from the upgrade itself (`Dummy Quasar migration`). + +## Stop + +Last but not least, to stop the network: + +```bash +scripts/localnet stop_all +``` diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d5aa2d4 --- /dev/null +++ b/Makefile @@ -0,0 +1,279 @@ +#!/usr/bin/make -f + +VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') +COMMIT := $(shell git log -1 --format='%H') +LEDGER_ENABLED ?= true +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) +BUILDDIR ?= $(CURDIR)/build +MOCKSDIR = $(CURDIR)/testutil/mock + +export GO111MODULE = on + +# process build tags + +build_tags = netgo +ifeq ($(LEDGER_ENABLED),true) + ifeq ($(OS),Windows_NT) + GCCEXE = $(shell where gcc.exe 2> NUL) + ifeq ($(GCCEXE),) + $(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false) + else + build_tags += ledger + endif + else + UNAME_S = $(shell uname -s) + ifeq ($(UNAME_S),OpenBSD) + $(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988)) + else + GCC = $(shell command -v gcc 2> /dev/null) + ifeq ($(GCC),) + $(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false) + else + build_tags += ledger + endif + endif + endif +endif + +ifeq (cleveldb,$(findstring cleveldb,$(QUASAR_BUILD_OPTIONS))) + build_tags += gcc +else ifeq (rocksdb,$(findstring rocksdb,$(QUASAR_BUILD_OPTIONS))) + build_tags += gcc +endif +build_tags += $(BUILD_TAGS) +build_tags_debug += $(BUILD_TAGS) +build_tags := $(strip $(build_tags)) + +whitespace := +whitespace += $(whitespace) +comma := , +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.Version=$(VERSION) \ + -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" + +ifeq (cleveldb,$(findstring cleveldb,$(QUASAR_BUILD_OPTIONS))) + ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb +else ifeq (rocksdb,$(findstring rocksdb,$(QUASAR_BUILD_OPTIONS))) + ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=rocksdb +endif + +ldflags-debug := $(ldflags) + +ifeq (,$(findstring nostrip,$(QUASAR_BUILD_OPTIONS))) + ldflags += -w -s +endif + +ifeq ($(LINK_STATICALLY),true) + ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" + ldflags-debug += -linkmode=external -extldflags "-Wl,-z,muldefs -static" +endif + +ldflags += $(LDFLAGS) +ldflags-debug += $(LDFLAGS) + +ldflags := $(strip $(ldflags)) + +BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' +BUILD_FLAGS_DEBUG := -tags "$(build_tags_debug)" -ldflags '$(ldflags-debug)' +# check for nostrip option +ifeq (,$(findstring nostrip,$(QUASAR_BUILD_OPTIONS))) + BUILD_FLAGS += -trimpath +endif + +############################################################################### +### Build ### +############################################################################### + +all: install lint test + +BUILD_TARGETS := build install +#BUILD_TARGETS_DEBUG := build install +build: BUILD_ARGS=-o $(BUILDDIR)/ + +$(BUILD_TARGETS): go.sum $(BUILDDIR)/ + go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./cmd/quasarnoded + +$(BUILD_TARGETS_DEBUG): go.sum $(BUILDDIR)/ + go $@ -mod=readonly $(BUILD_FLAGS_DEBUG) -gcflags='all=-N -l' $(BUILD_ARGS) ./cmd/quasarnoded + +$(BUILDDIR)/: + mkdir -p $(BUILDDIR)/ + +# 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 + +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 + +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 + +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 + +############################################################################### +### Proto & Mock Generation ### +############################################################################### + +proto-all: proto-format proto-gen + +proto-gen: + @echo "Generating Protobuf files" + @sh ./scripts/protocgen.sh + +proto-doc: + @echo "Generating Protoc docs" + @sh ./scripts/generate-docs.sh + +.PHONY: proto-gen proto-doc + +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 + mockgen -package=mock -destination=$(MOCKSDIR)/ics4_wrapper_mocks.go $(GOMOD)/x/qoracle/types ICS4Wrapper + mockgen -package=mock -destination=$(MOCKSDIR)/ibc_port_mocks.go $(GOMOD)/x/qoracle/types PortKeeper +# mockgen -package=mock -destination=$(MOCKSDIR)/ibc_connection_mocks.go $(GOMOD)/x/intergamm/types ConnectionKeeper +# mockgen -package=mock -destination=$(MOCKSDIR)/ibc_client_mocks.go $(GOMOD)/x/intergamm/types ClientKeeper + +$(MOCKSDIR)/: + mkdir -p $(MOCKSDIR)/ + +############################################################################### +### Tests & Simulation ### +############################################################################### + +PACKAGES_UNIT=$(shell go list ./x/epochs/... ./x/qoracle/... | grep -E -v "simapp|e2e" | grep -E -v "x/qoracle/client/cli") +PACKAGES_E2E=$(shell go list ./... | grep '/e2e') +PACKAGES_SIM=$(shell go list ./... | grep '/tests/simulator') +TEST_PACKAGES=./... + +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) + +############################################################################### +### Smart Contracts ### +############################################################################### + +compile-wasm-artifacts: + cd smart-contracts && \ + ./compile_contracts.sh + + +############################################################################### +### Docker ### +############################################################################### + +RUNNER_BASE_IMAGE_DISTROLESS := gcr.io/distroless/static +RUNNER_BASE_IMAGE_ALPINE := alpine:3.16 +RUNNER_BASE_IMAGE_NONROOT := gcr.io/distroless/static: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 . + +############################################################################### +### 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 new file mode 100644 index 0000000..f60d12a --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Quasar + +This is the official Quasar Labs repository. Quasar is building decentralized vaults for creating custom and sovereign investment vehicles in the Cosmos ecosystem and beyond. + +Quasar is focused in utilizing the latest and contributing to building IBC features including: +IBC features that we are developing on: +1. Interchain Accounts (ICA). +2. Async Interchain Queries (Async - ICQ). +3. IBC hook middleware for token transfer. + +Quasar is working hard to simplfy and add ease to collaborative investment with digital assets. We are creating a decentralized platform for creating custom, soverign vaults that can be molded into any imaginable investment financial instrument from ETFs, mutual fund, SPAC, or whatever. +The galaxy is the limit. + +Our flagship product starts with vault that implements optimal LPing into pools on Osmosis DEX. + +## DISCLAIMER +The current codebase is experimental and undergoing continuous testing and auditing. + +## Quasar Node +**quasarnode** is a capital management blockchain built using Cosmos SDK, delegated proof of stake and ibc stack. + +### Build Quasar + +```bash +make install +``` + + +## Quasar Local Testnet (localnet) + +We have created several demo directories for the different usecases. You can find ./quasar_local.sh in demo/orion_manual_demo dir, and similar scripts in the other directories. + +## Learn more +1. + +## Attributions +1. x/qtransfer and x/epochs module are utilised from the osmosis x/ibc_hooks and x/epochs module. \ No newline at end of file diff --git a/SCM.md b/SCM.md new file mode 100644 index 0000000..f3a7d61 --- /dev/null +++ b/SCM.md @@ -0,0 +1,128 @@ +# Quasar Source Code Management + +## General considerations + +Quasar development team follows a light git flow approach for source control management. It is light in the sense that new code is merged directly into the `main` branch instead of an intermediary `dev` branch. + +The `main` branch reflects the most recent stable state of the application code. +Anything that merges to `main` is a candidate for release. + +## Pull-requests + +Features or bug fixes are merged frequently to the `main` branch via pull-requests (PR) and mandatory code review. + +All pull-requests should be merged with a forced merge commit, this helps for traceability as **github** will insert details about the pull-request in the commit message. The Github repo is configured to enforce this. + +As much as possible, pull-requests should be rebased onto `main` before merging, this helps in creating a clean and straight history for the `main` branch. + +### Review process + +All pull-requests on **github** have to be approved (after review) before they can be merged. + +When creating a PR, do not assign any reviewers yet. Assigning some people or all people to reviewing a PR often leads to planning issues and lack of ownership for the reviewing task. + +Instead, discuss with the development team about the review (at standup) and ask who can do it. One someone is appointed reviewer, the author update the merge-request with the reviewer's name. + +Usually, one reviewer is sufficient. However, if the work requires more specific knowledge, the author can ask for more than one person to review. The reviewer can also appoint someone else if agreed. + +### Pull-request review material + +[Official Github documentation](https://docs.github.com/en/pull-requests) +[Pull-requests review best practices](https://rewind.com/blog/best-practices-for-reviewing-pull-requests-in-github/) +["Semi-linear" or "Rebase, merge" strategy](https://stackoverflow.com/questions/59714347/semi-linear-merge) + +## Feature & bugfix workflow + +New code can be added via either a **feature** or **bugfix** branch, using the `feature/` or `bugfix/` branch name prefix respectively, followed by a sentence-like description of the feature or bugfix separated by underscores (i.e `feature/my_feature_desc`). + +Example: create a new feature branch out of `main` + +```bash +git checkout main # assuming not on main already +git pull # make sure main is in sync with remote +git checkout -b feature/abc_123 # create the new branch +``` + +Usually, a single developer will work on a feature branch, so it is fine to re-write the history in these branch (with `git rebase` for instance). In practice it can be used when new code has been merged to `main` in the meantime. + +Example: sync new code from `main` via rebase: + +```bash +git fetch --all # fetch new code from remote origin +git rebase origin/main # rebase current branch on top of new code +``` + +If developers work on a feature together, they can individually branch off from the feature branch, as long as the merge is done via either a squash commit or a fast-forward commit (`--ff-only`). +By doing this, the feature branch will still be a single series of commits (no intermediate branching will be visible) and therefore the clear history visibility will be preserved. + +### Visual example + +``` +* 0d54d68 - (3 seconds ago) Merge branch 'bugfix/bug_1' - Alice (HEAD -> main) +|\ +| * 912ce23 - (15 seconds ago) Fix 3 - Alice (bugfix/bug_1) +| * d988e05 - (26 seconds ago) Fix 2 - Alice +| * e9cf5d9 - (65 seconds ago) Fix 1 - Alice +|/ +* 736087f - (4 minutes ago) Merge branch 'feature/feature_1' - Bob +|\ +| * b7e26f3 - (5 minutes ago) Update README with 2 - Bob (feature/feature_1) +| * 0b085c6 - (5 minutes ago) Update README with 1 - Bob +|/ +* 9460178 - (8 minutes ago) Init - Alice +``` + +## Release process + +At any point, on the `main` branch, a commit can be selected for release. For that a git tag needs to be created (see conventions). + +This new git tag can be used to triggers automated CI/CD workflows that will build the release artifacts, publish and deploy them. The tag can also be used for versioning the artifacts (see versioning conventions). + +If release notes and other documentation needs to be updated prior to releasing, it should be done via a **feature** branch and merged to `main`. This merge commit will be the one to be tagged to represent the new release. + +Release tags can be created directly from the Github interface, by selecting the proper commit, or via command-line on a developer's machine as follows: + +```bash +git checkout main # assuming not on main already +git pull # make sure main is in sync with remote +git tag v2.0 # create the new tag +git push origin v2.0 # push tag to remote +``` + +### Hotfix workflow + +If a bug needs to be fixed on a version already released, a branch can be created out of the release tag, with the prefix `release/`. + +Commits can then be cherry-picked to this new branch, if a fix is already available on `main`, or directly in the new branch (decide if we need a special **hotfix** branch here with mandatory PR review). + +Example: create a hotfix on existing release v2.0 + +```bash +git checkout -b release/v2.0 v2.0 # create release branch out of tag +git push -u origin release/v2.0 # push new branch to remote +# do the hotfix work +git add . # make sure main is in sync with remote +git commit -m "hotfix abc" # create the new tag +git push # push commit to remote release branch +``` + +### Visual example + +``` +* 9b470d3 - (8 minutes ago) Merge branch 'feature/feature_43' - Alice +|\ +| * 6e4fe81 - (8 minutes ago) Work on feature_3 - Alice (feature/feature_43) +|/ +| * b80093a - (3 minutes ago) hotfix 2 - Bob (release/v2.0) +| * 981ca74 - (4 minutes ago) hotfix 1 - Bob +|/ +* 5522161 - (9 minutes ago) Merge branch 'feature/release_v2.0_prep' - Alice (tag: v2.0) +|\ +| * b303e19 - (9 minutes ago) Prepare release v2.0 - Alice (feature/release_v2.0_prep) +|/ +* c6de55a - (14 minutes ago) Merge branch 'feature/feature_42' - Alice +|\ +| * 7850c00 - (14 minutes ago) Work on feature_42 - Alice (feature/feature_42) +|/ +* 0d54d68 - (19 minutes ago) Merge branch 'bugfix/bug_13' - Bob +``` diff --git a/app/app.go b/app/app.go new file mode 100644 index 0000000..2b2b65d --- /dev/null +++ b/app/app.go @@ -0,0 +1,1085 @@ +package app + +import ( + "fmt" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "io" + "net/http" + "os" + "path/filepath" + "strings" + + appParams "github.com/quasarlabs/quasarnode/app/params" + "github.com/quasarlabs/quasarnode/app/upgrades" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + "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/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/cosmos-sdk/x/auth" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" + authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + 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" + "github.com/cosmos/cosmos-sdk/x/bank" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/capability" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distr "github.com/cosmos/cosmos-sdk/x/distribution" + distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/evidence" + evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + "github.com/cosmos/cosmos-sdk/x/feegrant" + feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + 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" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/mint" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/params" + paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + "github.com/cosmos/cosmos-sdk/x/slashing" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + "github.com/cosmos/cosmos-sdk/x/staking" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/cosmos-sdk/x/upgrade" + upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts" + icacontrollerkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" + "github.com/cosmos/ibc-go/v4/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v4/modules/core" + ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + ibcporttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" + "github.com/spf13/cast" + "github.com/quasarlabs/quasarnode/app/openapiconsole" + abci "github.com/tendermint/tendermint/abci/types" + tmjson "github.com/tendermint/tendermint/libs/json" + "github.com/tendermint/tendermint/libs/log" + tmos "github.com/tendermint/tendermint/libs/os" + dbm "github.com/tendermint/tm-db" + + // Quasar imports + "github.com/quasarlabs/quasarnode/docs" + + "github.com/CosmWasm/wasmd/x/wasm" + wasmclient "github.com/CosmWasm/wasmd/x/wasm/client" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + owasm "github.com/quasarlabs/quasarnode/wasmbinding" + + epochsmodule "github.com/quasarlabs/quasarnode/x/epochs" + epochsmodulekeeper "github.com/quasarlabs/quasarnode/x/epochs/keeper" + epochsmoduletypes "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/quasarlabs/quasarnode/x/qtransfer" + qtransferkeeper "github.com/quasarlabs/quasarnode/x/qtransfer/keeper" + qtransfertypes "github.com/quasarlabs/quasarnode/x/qtransfer/types" + + qoraclemodule "github.com/quasarlabs/quasarnode/x/qoracle" + 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" + // this line is used by starport scaffolding # stargate/app/moduleImport +) + +const ( + AccountAddressPrefix = "quasar" + Name = "quasarnode" +) + +var ( + // WasmProposalsEnabled enables all x/wasm proposals when it's value is "true" + // and EnableSpecificWasmProposals is empty. Otherwise, all x/wasm proposals + // are disabled. + WasmProposalsEnabled = "true" + + // EnableSpecificWasmProposals, if set, must be comma-separated list of values + // that are all a subset of "EnableAllProposals", which takes precedence over + // WasmProposalsEnabled. + // + // See: https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 + EnableSpecificWasmProposals = "" + + // EmptyWasmOpts defines a type alias for a list of wasm options. + EmptyWasmOpts []wasm.Option +) + +func getGovProposalHandlers() []govclient.ProposalHandler { + var govProposalHandlers []govclient.ProposalHandler + // this line is used by starport scaffolding # stargate/app/govProposalHandlers + + govProposalHandlers = append(govProposalHandlers, + paramsclient.ProposalHandler, + distrclient.ProposalHandler, + upgradeclient.ProposalHandler, + upgradeclient.CancelProposalHandler, + ibcclientclient.UpdateClientProposalHandler, + ibcclientclient.UpgradeProposalHandler, + // this line is used by starport scaffolding # stargate/app/govProposalHandler + ) + govProposalHandlers = append(govProposalHandlers, wasmclient.ProposalHandlers...) + + return govProposalHandlers +} + +// GetWasmEnabledProposals parses the WasmProposalsEnabled and +// EnableSpecificWasmProposals values to produce a list of enabled proposals to +// pass into the application. +func GetWasmEnabledProposals() []wasm.ProposalType { + if EnableSpecificWasmProposals == "" { + if WasmProposalsEnabled == "true" { + return wasm.EnableAllProposals + } + + return wasm.DisableAllProposals + } + + chunks := strings.Split(EnableSpecificWasmProposals, ",") + + proposals, err := wasm.ConvertToProposals(chunks) + if err != nil { + panic(err) + } + return proposals +} + +// overrideWasmVariables overrides the wasm variables to: +// - allow for larger wasm files +func overrideWasmVariables() { + // Override Wasm size limitation from WASMD. + wasmtypes.MaxWasmSize = 3 * 1024 * 1024 + wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize +} + +var ( + // DefaultNodeHome default home directories for the application daemon + DefaultNodeHome string + + // ModuleBasics defines the module BasicManager is in charge of setting up basic, + // non-dependant module elements, such as codec registration + // and genesis verification. + ModuleBasics = module.NewBasicManager( + auth.AppModuleBasic{}, + genutil.AppModuleBasic{}, + bank.AppModuleBasic{}, + capability.AppModuleBasic{}, + staking.AppModuleBasic{}, + mint.AppModuleBasic{}, + distr.AppModuleBasic{}, + gov.NewAppModuleBasic(getGovProposalHandlers()...), + params.AppModuleBasic{}, + crisis.AppModuleBasic{}, + slashing.AppModuleBasic{}, + feegrantmodule.AppModuleBasic{}, + ibc.AppModuleBasic{}, + upgrade.AppModuleBasic{}, + evidence.AppModuleBasic{}, + transfer.AppModuleBasic{}, + vesting.AppModuleBasic{}, + epochsmodule.AppModuleBasic{}, + qoraclemodule.AppModuleBasic{}, + ica.AppModuleBasic{}, + // this line is used by starport scaffolding # stargate/app/moduleBasic + wasm.AppModuleBasic{}, + qtransfer.AppModuleBasic{}, + ) + + // module account permissions + maccPerms = map[string][]string{ + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + icatypes.ModuleName: nil, + // this line is used by starport scaffolding # stargate/app/maccPerms + wasm.ModuleName: {authtypes.Burner}, + } + + Upgrades = []upgrades.Upgrade{} +) + +var ( + _ servertypes.Application = (*App)(nil) + _ simapp.App = (*App)(nil) +) + +func init() { + userHomeDir, err := os.UserHomeDir() + if err != nil { + panic(err) + } + + DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) +} + +// App extends an ABCI application, but with most of its parameters exported. +// They are exported for convenience in creating helper functions, as object +// capabilities aren't needed for testing. +type App struct { + *baseapp.BaseApp + + cdc *codec.LegacyAmino + appCodec codec.Codec + interfaceRegistry types.InterfaceRegistry + + invCheckPeriod uint + + // keys to access the substores + keys map[string]*sdk.KVStoreKey + tkeys map[string]*sdk.TransientStoreKey + memKeys map[string]*sdk.MemoryStoreKey + + // keepers + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + CapabilityKeeper *capabilitykeeper.Keeper + StakingKeeper stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.Keeper + DistrKeeper distrkeeper.Keeper + GovKeeper govkeeper.Keeper + CrisisKeeper crisiskeeper.Keeper + UpgradeKeeper upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + EvidenceKeeper evidencekeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + WasmKeeper wasm.Keeper + + // make scoped keepers public for test purposes + ScopedIBCKeeper capabilitykeeper.ScopedKeeper + ScopedTransferKeeper capabilitykeeper.ScopedKeeper + ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper + ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + ScopedIntergammKeeper capabilitykeeper.ScopedKeeper + scopedQOracleKeeper capabilitykeeper.ScopedKeeper + ScopedWasmKeeper capabilitykeeper.ScopedKeeper + + QTransferKeeper qtransferkeeper.Keeper + EpochsKeeper *epochsmodulekeeper.Keeper + QOsmosisKeeper qosmokeeper.Keeper + QOracleKeeper qoraclemodulekeeper.Keeper + + ICAControllerKeeper icacontrollerkeeper.Keeper + ICAHostKeeper icahostkeeper.Keeper + // this line is used by starport scaffolding # stargate/app/keeperDeclaration + // transfer module + RawIcs20TransferAppModule transfer.AppModule + TransferStack *qtransfer.IBCMiddleware + Ics20WasmHooks *qtransfer.WasmHooks + HooksICS4Wrapper qtransfer.ICS4Middleware + + // mm is the module manager + mm *module.Manager + + // sm is the simulation manager + sm *module.SimulationManager + + configurator module.Configurator +} + +func (app *App) GetStakingKeeper() stakingkeeper.Keeper { + return app.StakingKeeper +} + +// New returns a reference to an initialized blockchain app +func New( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + loadLatest bool, + skipUpgradeHeights map[int64]bool, + homePath string, + invCheckPeriod uint, + encodingConfig appParams.EncodingConfig, + appOpts servertypes.AppOptions, + wasmEnabledProposals []wasm.ProposalType, + wasmOpts []wasm.Option, + baseAppOptions ...func(*baseapp.BaseApp), +) *App { + overrideWasmVariables() + appCodec := encodingConfig.Marshaler + cdc := encodingConfig.Amino + interfaceRegistry := encodingConfig.InterfaceRegistry + + bApp := baseapp.NewBaseApp( + Name, + logger, + db, + encodingConfig.TxConfig.TxDecoder(), + baseAppOptions..., + ) + bApp.SetCommitMultiStoreTracer(traceStore) + bApp.SetVersion(version.Version) + bApp.SetInterfaceRegistry(interfaceRegistry) + + keys := sdk.NewKVStoreKeys( + authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, + minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, + evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, + epochsmoduletypes.StoreKey, + qoraclemoduletypes.StoreKey, + qosmotypes.StoreKey, + icacontrollertypes.StoreKey, + icahosttypes.StoreKey, + wasm.StoreKey, + qtransfertypes.StoreKey, + // this line is used by starport scaffolding # stargate/app/storeKey + ) + tkeys := sdk.NewTransientStoreKeys( + paramstypes.TStoreKey, + qoraclemoduletypes.TStoreKey, + ) + memKeys := sdk.NewMemoryStoreKeys( + capabilitytypes.MemStoreKey, + qoraclemoduletypes.MemStoreKey, + ) + + app := &App{ + BaseApp: bApp, + cdc: cdc, + appCodec: appCodec, + interfaceRegistry: interfaceRegistry, + invCheckPeriod: invCheckPeriod, + keys: keys, + tkeys: tkeys, + memKeys: memKeys, + } + + app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) + + // set the BaseApp's parameter store + bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) + + // add capability keeper and ScopeToModule for ibc module + app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) + + // grant capabilities for the ibc and ibc-transfer modules + scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) + scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) + scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + scopedQOsmosisKeeper := app.CapabilityKeeper.ScopeToModule(qosmotypes.SubModuleName) + scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasm.ModuleName) + + // this line is used by starport scaffolding # stargate/app/scopedKeeper + + // add keepers + app.AccountKeeper = authkeeper.NewAccountKeeper( + appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, + ) + app.BankKeeper = bankkeeper.NewBaseKeeper( + appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.BlockedModuleAccountAddrs(), + ) + stakingKeeper := stakingkeeper.NewKeeper( + appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), + ) + app.MintKeeper = mintkeeper.NewKeeper( + appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), &stakingKeeper, + app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, + ) + app.DistrKeeper = distrkeeper.NewKeeper( + appCodec, + keys[distrtypes.StoreKey], + app.GetSubspace(distrtypes.ModuleName), + app.AccountKeeper, + app.BankKeeper, + &stakingKeeper, + authtypes.FeeCollectorName, + app.ModuleAccountAddrs(), + ) + app.SlashingKeeper = slashingkeeper.NewKeeper( + appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName), + ) + app.CrisisKeeper = crisiskeeper.NewKeeper( + app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, + ) + + app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) + app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp) + + // register the staking hooks + // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks + app.StakingKeeper = *stakingKeeper.SetHooks( + stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), + ) + + // ... other modules keepers + + // Create IBC Keeper + app.IBCKeeper = ibckeeper.NewKeeper( + appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, + ) + + // register the proposal types + govRouter := govtypes.NewRouter() + govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). + AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). + AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). + AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). + AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). + AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) + // The gov proposal types can be individually enabled + if len(wasmEnabledProposals) != 0 { + govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(&app.WasmKeeper, wasmEnabledProposals)) + } + + // IBC Modules & Keepers + + app.TransferKeeper = ibctransferkeeper.NewKeeper( + appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, + ) + // transferModule := transfer.NewAppModule(app.TransferKeeper) + // TODO_IMPORTANT + // transferIbcModule := transfer.NewIBCModule(app.TransferKeeper) + app.RawIcs20TransferAppModule = transfer.NewAppModule(app.TransferKeeper) + transferIbcModule := transfer.NewIBCModule(app.TransferKeeper) + // Hooks Middleware + hooksTransferModule := qtransfer.NewIBCMiddleware(&transferIbcModule, &app.HooksICS4Wrapper) + app.TransferStack = &hooksTransferModule + + app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( + appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), + app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee + app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), + ) + app.ICAHostKeeper = icahostkeeper.NewKeeper( + appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), + app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), + ) + icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper) + + // icaControllerIBCModule := icacontroller.NewIBCModule(app.ICAControllerKeeper, intergammIBCModule) + icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) + + // TODO AUDIT Above lines + + // Create evidence Keeper for to register the IBC light client misbehaviour evidence route + evidenceKeeper := evidencekeeper.NewKeeper( + appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper, + ) + // If evidence needs to be handled for the app, set routes in router here and seal + app.EvidenceKeeper = *evidenceKeeper + + app.GovKeeper = govkeeper.NewKeeper( + appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, + &stakingKeeper, govRouter, + ) + + app.EpochsKeeper = epochsmodulekeeper.NewKeeper(appCodec, keys[epochsmoduletypes.StoreKey]) + epochsModule := epochsmodule.NewAppModule(appCodec, app.EpochsKeeper) + + app.QOracleKeeper = qoraclemodulekeeper.NewKeeper( + appCodec, + keys[qoraclemoduletypes.StoreKey], + memKeys[qoraclemoduletypes.MemStoreKey], + tkeys[qoraclemoduletypes.TStoreKey], + app.GetSubspace(qoraclemoduletypes.ModuleName), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + app.QOsmosisKeeper = qosmokeeper.NewKeeper( + appCodec, + keys[qosmotypes.StoreKey], + app.GetSubspace(qosmotypes.SubModuleName), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.IBCKeeper.ClientKeeper, + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + scopedQOsmosisKeeper, + app.QOracleKeeper, + ) + qosmoIBCModule := qosmo.NewIBCModule(app.QOsmosisKeeper) + + app.QOracleKeeper.RegisterPoolOracle(app.QOsmosisKeeper) + app.QOracleKeeper.Seal() + qoracleModule := qoraclemodule.NewAppModule(appCodec, app.QOracleKeeper, app.QOsmosisKeeper) + + app.QTransferKeeper = qtransferkeeper.NewKeeper( + appCodec, + keys[qtransfertypes.ModuleName], + app.GetSubspace(qtransfertypes.ModuleName), + app.AccountKeeper, + ) + qtranserModule := qtransfer.NewAppModule(app.QTransferKeeper) + + // Set epoch hooks + app.EpochsKeeper.SetHooks( + epochsmoduletypes.NewMultiEpochHooks( + app.QOsmosisKeeper.EpochHooks(), + ), + ) + + // create the wasm callback plugin + // TODO_IMPORTANT - CALL BACK ACCOUNT + + // callback := owasm.NewCallbackPlugin(&app.WasmKeeper, app.OrionKeeper.GetOrionAcc()) + // var tmpacc sdk.AccAddress + // callback := owasm.NewCallbackPlugin(&app.WasmKeeper, tmpacc) + + callback := owasm.NewCallbackPlugin(&app.WasmKeeper, app.QTransferKeeper.GetQTransferAcc()) + wasmDir := filepath.Join(homePath, "wasm") + wasmConfig, err := wasm.ReadWasmConfig(appOpts) + if err != nil { + panic(fmt.Sprintf("error while reading wasm config: %s", err)) + } + + wasmOpts = append(owasm.RegisterCustomPlugins(app.QOracleKeeper, &bankkeeper.BaseKeeper{}, callback), wasmOpts...) + + // The last arguments can contain custom message handlers, and custom query handlers, + // if we want to allow any custom callbacks + supportedFeatures := "iterator,staking,stargate" + app.WasmKeeper = wasm.NewKeeper( + appCodec, + keys[wasm.StoreKey], + app.GetSubspace(wasm.ModuleName), + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.DistrKeeper, + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + scopedWasmKeeper, + app.TransferKeeper, + app.MsgServiceRouter(), + app.GRPCQueryRouter(), + wasmDir, + wasmConfig, + supportedFeatures, + wasmOpts..., + ) + + /* + // TODO_IMPORTANT - add qtransfer module + var decoratedTransferIBCModule ibcporttypes.IBCModule + decoratedTransferIBCModule = decorators.NewIBCTransferIntergammDecorator( + app.IntergammKeeper, + transferIbcModule, + ) + decoratedTransferIBCModule = decorators.NewIBCTransferWasmDecorator( + &app.WasmKeeper, + decoratedTransferIBCModule, + ) + */ + // Set Intergamm hooks + + // IBC + + // Osmosis + + // this line is used by starport scaffolding # stargate/app/keeperDefinition + + // Create static IBC router, add transfer route, then set and seal it + ibcRouter := ibcporttypes.NewRouter() + + wasmHooks := qtransfer.NewWasmHooks(app.QTransferKeeper, app.WasmKeeper) + app.Ics20WasmHooks = &wasmHooks + app.HooksICS4Wrapper = qtransfer.NewICS4Middleware( + app.IBCKeeper.ChannelKeeper, + app.Ics20WasmHooks, + ) + // Register host and authentication routes + // TODO_IMPORTANT - addition of qtransfer module + // TODO_IMPORTANT - CROSS VERIFY wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper)) + ibcRouter.AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper)). + AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). + AddRoute(ibctransfertypes.ModuleName, app.TransferStack). + // AddRoute(ibctransfertypes.ModuleName, decoratedTransferIBCModule). + // AddRoute(intergammmoduletypes.ModuleName, icaControllerIBCModule). + AddRoute(qosmotypes.SubModuleName, qosmoIBCModule) + // AddRoute(qoraclemoduletypes.ModuleName, qoracleIBCModule) + + /* + ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). + AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper)). + AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). + AddRoute(ibctransfertypes.ModuleName, decoratedTransferIBCModule). + AddRoute(intergammmoduletypes.ModuleName, icaControllerIBCModule). + AddRoute(qoraclemoduletypes.ModuleName, qoracleIBCModule) + */ + + app.IBCKeeper.SetRouter(ibcRouter) + + /**** Module Options ****/ + + // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment + // we prefer to be more strict in what arguments the modules expect. + skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) + + // NOTE: Any module instantiated in the module manager that is later modified + // must be passed by reference here. + + app.mm = module.NewManager( + genutil.NewAppModule( + app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, + encodingConfig.TxConfig, + ), + auth.NewAppModule(appCodec, app.AccountKeeper, nil), + vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), + capability.NewAppModule(appCodec, *app.CapabilityKeeper), + feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), + crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), + gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), + distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), + staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), + upgrade.NewAppModule(app.UpgradeKeeper), + evidence.NewAppModule(app.EvidenceKeeper), + ibc.NewAppModule(app.IBCKeeper), + params.NewAppModule(app.ParamsKeeper), + wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), + app.RawIcs20TransferAppModule, + epochsModule, + qoracleModule, + qtranserModule, + icaModule, + // this line is used by starport scaffolding # stargate/app/appModule + ) + + // 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. + // NOTE: staking module is required if HistoricalEntries param > 0 + app.mm.SetOrderBeginBlockers( + upgradetypes.ModuleName, + epochsmoduletypes.ModuleName, + capabilitytypes.ModuleName, + minttypes.ModuleName, + distrtypes.ModuleName, + slashingtypes.ModuleName, + evidencetypes.ModuleName, + stakingtypes.ModuleName, + ibchost.ModuleName, + feegrant.ModuleName, + // TODO check the order of the below + vestingtypes.ModuleName, + icatypes.ModuleName, + ibctransfertypes.ModuleName, + genutiltypes.ModuleName, + banktypes.ModuleName, + govtypes.ModuleName, + qoraclemoduletypes.ModuleName, + qtransfertypes.ModuleName, + crisistypes.ModuleName, + paramstypes.ModuleName, + authtypes.ModuleName, + wasm.ModuleName, + ) + + app.mm.SetOrderEndBlockers(crisistypes.ModuleName, + govtypes.ModuleName, + stakingtypes.ModuleName, + qoraclemoduletypes.ModuleName, + qtransfertypes.ModuleName, + // TODO check the order of the below + evidencetypes.ModuleName, + ibchost.ModuleName, + feegrant.ModuleName, + minttypes.ModuleName, + slashingtypes.ModuleName, + ibctransfertypes.ModuleName, + vestingtypes.ModuleName, + capabilitytypes.ModuleName, + upgradetypes.ModuleName, + paramstypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + icatypes.ModuleName, + genutiltypes.ModuleName, + epochsmoduletypes.ModuleName, + wasm.ModuleName, + ) + + // NOTE: The genutils module must occur after staking so that pools are + // properly initialized with tokens from genesis accounts. + // NOTE: Capability module must occur first so that it can initialize any capabilities + // so that other modules that want to create or claim capabilities afterwards in InitChain + // can do so safely. + // NOTE: wasm module should be at the end as it can call other module functionality direct or via message dispatching during + // genesis phase. For example bank transfer, auth account check, staking, ... + app.mm.SetOrderInitGenesis( + capabilitytypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + crisistypes.ModuleName, + ibchost.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + ibctransfertypes.ModuleName, + qoraclemoduletypes.ModuleName, + icatypes.ModuleName, + // TODO check the order of the below + vestingtypes.ModuleName, + feegrant.ModuleName, + upgradetypes.ModuleName, + paramstypes.ModuleName, + epochsmoduletypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/initGenesis + // wasm after ibc transfer + wasm.ModuleName, + qtransfertypes.ModuleName, + ) + + app.mm.RegisterInvariants(&app.CrisisKeeper) + app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) + app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) + app.mm.RegisterServices(app.configurator) + + app.setupUpgradeHandlers() + + // 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, + // TODO fix qoracle testing for sim + // qoracleModule, + // TODO fix intergam genesis + testing first (right now, test code does not even compile...) + // intergammModule, + // this line is used by starport scaffolding # stargate/app/appModule + ) + app.sm.RegisterStoreDecoders() + + // initialize stores + app.MountKVStores(keys) + app.MountTransientStores(tkeys) + app.MountMemoryStores(memKeys) + + // initialize BaseApp + app.SetInitChainer(app.InitChainer) + app.SetBeginBlocker(app.BeginBlocker) + + anteHandler, err := ante.NewAnteHandler( + ante.HandlerOptions{ + AccountKeeper: app.AccountKeeper, + BankKeeper: app.BankKeeper, + SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), + FeegrantKeeper: app.FeeGrantKeeper, + SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + }, + ) + if err != nil { + panic(err) + } + + app.SetAnteHandler(anteHandler) + app.SetEndBlocker(app.EndBlocker) + + // must be before Loading version + // requires the snapshot store to be created and registered as a BaseAppOption + // see cmd/wasmd/root.go: 206 - 214 approx + if manager := app.SnapshotManager(); manager != nil { + err := manager.RegisterExtensions( + wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper), + ) + if err != nil { + panic(fmt.Errorf("failed to register snapshot extension: %s", err)) + } + } + + if loadLatest { + if err := app.LoadLatestVersion(); err != nil { + tmos.Exit(err.Error()) + } + } + + app.ScopedIBCKeeper = scopedIBCKeeper + app.ScopedTransferKeeper = scopedTransferKeeper + app.ScopedWasmKeeper = scopedWasmKeeper + app.scopedQOracleKeeper = scopedQOsmosisKeeper + app.ScopedICAControllerKeeper = scopedICAControllerKeeper + app.ScopedICAHostKeeper = scopedICAHostKeeper + // app.ScopedIntergammKeeper = scopedIntergammKeeper + // this line is used by starport scaffolding # stargate/app/beforeInitReturn + + fmt.Printf("APP TESTING - maccPerms=%v\n", maccPerms) + return app +} + +func (app *App) setupUpgradeHandlers() { + for _, upgrade := range Upgrades { + app.UpgradeKeeper.SetUpgradeHandler( + upgrade.UpgradeName, + upgrade.CreateUpgradeHandler( + app.mm, + app.configurator, + app.BaseApp, + // TODO pass the keepers necessary for the upgrades + ), + ) + } +} + +// Name returns the name of the App +func (app *App) Name() string { return app.BaseApp.Name() } + +// GetBaseApp returns the base app of the application +func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } + +// BeginBlocker application updates every begin block +func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { + return app.mm.BeginBlock(ctx, req) +} + +// EndBlocker application updates every end block +func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { + return app.mm.EndBlock(ctx, req) +} + +// InitChainer application update at chain initialization +func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { + 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) +} + +// LoadHeight loads a particular height +func (app *App) LoadHeight(height int64) error { + return app.LoadVersion(height) +} + +// ModuleAccountAddrs returns all the app's module account addresses. +func (app *App) ModuleAccountAddrs() map[string]bool { + modAccAddrs := make(map[string]bool) + for acc := range maccPerms { + modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true + } + + return modAccAddrs +} + +// BlockedModuleAccountAddrs returns all the app's blocked module account +// addresses. +func (app *App) 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 +} + +// TODO AG: move the below function to a test package + +// LegacyAmino returns SimApp's amino 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 *App) LegacyAmino() *codec.LegacyAmino { + return app.cdc +} + +// AppCodec returns an app 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 *App) AppCodec() codec.Codec { + return app.appCodec +} + +// InterfaceRegistry returns an InterfaceRegistry +func (app *App) InterfaceRegistry() types.InterfaceRegistry { + return app.interfaceRegistry +} + +// GetKey returns the KVStoreKey for the provided store key. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetKey(storeKey string) *sdk.KVStoreKey { + return app.keys[storeKey] +} + +// GetTKey returns the TransientStoreKey for the provided store key. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetTKey(storeKey string) *sdk.TransientStoreKey { + return app.tkeys[storeKey] +} + +// GetMemKey returns the MemStoreKey for the provided mem key. +// +// NOTE: This is solely used for testing purposes. +func (app *App) GetMemKey(storeKey string) *sdk.MemoryStoreKey { + return app.memKeys[storeKey] +} + +// GetSubspace returns a param subspace for a given module name. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { + subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) + return subspace +} + +// RegisterAPIRoutes registers all application module routes with the provided +// API server. +func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { + clientCtx := apiSvr.ClientCtx + rpc.RegisterRoutes(clientCtx, apiSvr.Router) + // Register legacy tx routes. + authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) + // 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) + + // Register legacy and grpc-gateway routes for all modules. + ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) + ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + + // register app's OpenAPI routes. + apiSvr.Router.Handle("/static/openapi.yml", http.FileServer(http.FS(docs.Docs))) + apiSvr.Router.HandleFunc("/", openapiconsole.Handler(appParams.Name, "/static/openapi.yml")) +} + +// RegisterTxService implements the Application.RegisterTxService method. +func (app *App) RegisterTxService(clientCtx client.Context) { + authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) +} + +// RegisterTendermintService implements the Application.RegisterTendermintService method. +func (app *App) RegisterTendermintService(clientCtx client.Context) { + tmservice.RegisterTendermintService( + app.BaseApp.GRPCQueryRouter(), + clientCtx, + app.interfaceRegistry, + //app.Query, + ) +} + +// GetMaccPerms returns a copy of the module account permissions +func GetMaccPerms() map[string][]string { + dupMaccPerms := make(map[string][]string) + for k, v := range maccPerms { + dupMaccPerms[k] = v + } + return dupMaccPerms +} + +// initParamsKeeper init params keeper and its subspaces +func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { + paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) + + paramsKeeper.Subspace(authtypes.ModuleName) + paramsKeeper.Subspace(banktypes.ModuleName) + paramsKeeper.Subspace(stakingtypes.ModuleName) + paramsKeeper.Subspace(minttypes.ModuleName) + paramsKeeper.Subspace(distrtypes.ModuleName) + paramsKeeper.Subspace(slashingtypes.ModuleName) + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) + paramsKeeper.Subspace(crisistypes.ModuleName) + paramsKeeper.Subspace(ibctransfertypes.ModuleName) + paramsKeeper.Subspace(ibchost.ModuleName) + paramsKeeper.Subspace(epochsmoduletypes.ModuleName) + // paramsKeeper.Subspace(qbankmoduletypes.ModuleName) + // paramsKeeper.Subspace(orionmoduletypes.ModuleName) + paramsKeeper.Subspace(qoraclemoduletypes.ModuleName).WithKeyTable(qoraclemoduletypes.ParamKeyTable()) + paramsKeeper.Subspace(qosmotypes.SubModuleName) + paramsKeeper.Subspace(icacontrollertypes.SubModuleName) + paramsKeeper.Subspace(icahosttypes.SubModuleName) + // paramsKeeper.Subspace(intergammmoduletypes.ModuleName) + paramsKeeper.Subspace(wasm.ModuleName) + paramsKeeper.Subspace(qtransfertypes.ModuleName) + // this line is used by starport scaffolding # stargate/app/paramSubspace + + return paramsKeeper +} + +// SimulationManager implements the SimulationApp interface +func (app *App) SimulationManager() *module.SimulationManager { + return app.sm +} + +// Required for ibctesting +/* +func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper { + return app.StakingKeeper // Dereferencing the pointer +} +*/ +func (app *App) GetIBCKeeper() *ibckeeper.Keeper { + return app.IBCKeeper // This is a *ibckeeper.Keeper +} + +func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { + return app.ScopedIBCKeeper +} + +func (app *App) GetTxConfig() client.TxConfig { + return MakeEncodingConfig().TxConfig +} diff --git a/app/encoding.go b/app/encoding.go new file mode 100644 index 0000000..ac713cb --- /dev/null +++ b/app/encoding.go @@ -0,0 +1,35 @@ +package app + +import ( + "github.com/quasarlabs/quasarnode/app/params" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/std" + "github.com/cosmos/cosmos-sdk/x/auth/tx" +) + +// makeEncodingConfig creates an EncodingConfig for an amino based test configuration. +func makeEncodingConfig() params.EncodingConfig { + amino := codec.NewLegacyAmino() + interfaceRegistry := types.NewInterfaceRegistry() + marshaler := codec.NewProtoCodec(interfaceRegistry) + txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) + + return params.EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Marshaler: marshaler, + TxConfig: txCfg, + Amino: amino, + } +} + +// MakeEncodingConfig creates an EncodingConfig for testing +func MakeEncodingConfig() params.EncodingConfig { + encodingConfig := makeEncodingConfig() + std.RegisterLegacyAminoCodec(encodingConfig.Amino) + std.RegisterInterfaces(encodingConfig.InterfaceRegistry) + ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) + ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) + return encodingConfig +} diff --git a/app/export.go b/app/export.go new file mode 100644 index 0000000..41dcc83 --- /dev/null +++ b/app/export.go @@ -0,0 +1,186 @@ +package app + +import ( + "encoding/json" + "log" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + servertypes "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + "github.com/cosmos/cosmos-sdk/x/staking" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// ExportAppStateAndValidators exports the state of the application for a genesis +// file. +func (app *App) ExportAppStateAndValidators( + forZeroHeight bool, jailAllowedAddrs []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()}) + + // We export at last height + 1, because that's the height at which + // Tendermint will start InitChain. + height := app.LastBlockHeight() + 1 + if forZeroHeight { + height = 0 + app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) + } + + genState := app.mm.ExportGenesis(ctx, app.appCodec) + appState, err := json.MarshalIndent(genState, "", " ") + if err != nil { + return servertypes.ExportedApp{}, err + } + + validators, err := staking.WriteValidators(ctx, app.StakingKeeper) + if err != nil { + return servertypes.ExportedApp{}, err + } + return servertypes.ExportedApp{ + AppState: appState, + Validators: validators, + Height: height, + ConsensusParams: app.BaseApp.GetConsensusParams(ctx), + }, nil +} + +// prepare for fresh start at zero height +// NOTE zero height genesis is a temporary feature which will be deprecated +// +// in favour of export at a block height +func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { + applyAllowedAddrs := false + + // check if there is a allowed address list + if len(jailAllowedAddrs) > 0 { + applyAllowedAddrs = true + } + + allowedAddrsMap := make(map[string]bool) + + for _, addr := range jailAllowedAddrs { + _, err := sdk.ValAddressFromBech32(addr) + if err != nil { + log.Fatal(err) + } + allowedAddrsMap[addr] = true + } + + /* Just to be safe, assert the invariants on current state. */ + app.CrisisKeeper.AssertInvariants(ctx) + + /* 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()) + if err != nil { + panic(err) + } + return false + }) + + // withdraw all delegator rewards + dels := app.StakingKeeper.GetAllDelegations(ctx) + for _, delegation := range dels { + _, err := app.DistrKeeper.WithdrawDelegationRewards(ctx, delegation.GetDelegatorAddr(), delegation.GetValidatorAddr()) + if err != nil { + panic(err) + } + } + + // clear validator slash events + app.DistrKeeper.DeleteAllValidatorSlashEvents(ctx) + + // clear validator historical rewards + app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx) + + // set context height to zero + height := ctx.BlockHeight() + ctx = ctx.WithBlockHeight(0) + + // reinitialize all validators + 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) + + app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + return false + }) + + // reinitialize all delegations + for _, del := range dels { + app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) + app.DistrKeeper.Hooks().AfterDelegationModified(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) + } + + // reset context height + ctx = ctx.WithBlockHeight(height) + + /* Handle staking state. */ + + // iterate through redelegations, reset creation height + 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) + return false + }) + + // iterate through unbonding delegations, reset creation height + 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) + return false + }) + + // Iterate through validators by power descending, reset bond heights, and + // update bond intra-tx counters. + store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) + iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + counter := int16(0) + + 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") + } + + validator.UnbondingHeight = 0 + if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { + validator.Jailed = true + } + + app.StakingKeeper.SetValidator(ctx, validator) + counter++ + } + + iter.Close() + + if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil { + panic(err) + } + + /* Handle slashing state. */ + + // reset start height on signing infos + app.SlashingKeeper.IterateValidatorSigningInfos( + ctx, + func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { + info.StartHeight = 0 + app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + return false + }, + ) +} diff --git a/app/genesis.go b/app/genesis.go new file mode 100644 index 0000000..5bf0c1d --- /dev/null +++ b/app/genesis.go @@ -0,0 +1,21 @@ +package app + +import ( + "encoding/json" + + "github.com/cosmos/cosmos-sdk/codec" +) + +// The genesis state of the blockchain is represented here as a map of raw json +// messages key'd by a identifier string. +// The identifier is used to determine which module genesis information belongs +// to so it may be appropriately routed during init chain. +// Within this application default genesis information is retrieved from +// the ModuleBasicManager which populates json from each BasicModule +// object provided to it during init. +type GenesisState map[string]json.RawMessage + +// NewDefaultGenesisState generates the default state for the application. +func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState { + return ModuleBasics.DefaultGenesis(cdc) +} diff --git a/app/openapiconsole/console.go b/app/openapiconsole/console.go new file mode 100644 index 0000000..465f5bb --- /dev/null +++ b/app/openapiconsole/console.go @@ -0,0 +1,25 @@ +package openapiconsole + +import ( + "embed" + "html/template" + "net/http" +) + +//go:embed index.tpl +var index embed.FS + +// Handler returns an http handler that servers OpenAPI console for an OpenAPI spec at specURL. +func Handler(title, specURL string) http.HandlerFunc { + t, _ := template.ParseFS(index, "index.tpl") + + return func(w http.ResponseWriter, req *http.Request) { + t.Execute(w, struct { //nolint:errcheck + Title string + URL string + }{ + title, + specURL, + }) + } +} diff --git a/app/openapiconsole/index.tpl b/app/openapiconsole/index.tpl new file mode 100644 index 0000000..d88cd5b --- /dev/null +++ b/app/openapiconsole/index.tpl @@ -0,0 +1,25 @@ + + + + + {{ .Title }} + + + + +
+ + + + + \ No newline at end of file diff --git a/app/params/encoding.go b/app/params/encoding.go new file mode 100644 index 0000000..3d634ab --- /dev/null +++ b/app/params/encoding.go @@ -0,0 +1,16 @@ +package params + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" +) + +// EncodingConfig specifies the concrete encoding types to use for a given app. +// This is provided for compatibility between protobuf and amino implementations. +type EncodingConfig struct { + InterfaceRegistry types.InterfaceRegistry + Marshaler codec.Codec + TxConfig client.TxConfig + Amino *codec.LegacyAmino +} diff --git a/app/params/params.go b/app/params/params.go new file mode 100644 index 0000000..853be88 --- /dev/null +++ b/app/params/params.go @@ -0,0 +1,12 @@ +package params + +const ( + HumanCoinUnit = "qsr" + BaseCoinUnit = "uqsr" + QsrExponent = 6 + + DefaultBondDenom = BaseCoinUnit + + AccountAddressPrefix = "quasar" + Name = "quasarnode" +) diff --git a/app/simulation_test.go b/app/simulation_test.go new file mode 100644 index 0000000..00a4360 --- /dev/null +++ b/app/simulation_test.go @@ -0,0 +1,74 @@ +package app_test + +import ( + "os" + "testing" + + "github.com/cosmos/cosmos-sdk/simapp" + simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + "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, + simapp.EmptyAppOptions{}, + app.GetWasmEnabledProposals(), + 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 new file mode 100644 index 0000000..ab4d3d2 --- /dev/null +++ b/app/upgrades/types.go @@ -0,0 +1,35 @@ +package upgrades + +import ( + 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" + abci "github.com/tendermint/tendermint/abci/types" +) + +// 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) *abci.ConsensusParams + StoreConsensusParams(ctx sdk.Context, cp *abci.ConsensusParams) +} + +// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal +// must have written, in order for the state migration to go smoothly. +// An upgrade must implement this struct, and then set it in the app.go. +// The app.go will then define the handler. +type Upgrade struct { + // Upgrade version name, for the upgrade handler, e.g. `v7` + UpgradeName string + + // CreateUpgradeHandler defines the function that creates an upgrade handler + CreateUpgradeHandler func( + mm *module.Manager, + configurator module.Configurator, + bam BaseAppParamManager, + ) upgradetypes.UpgradeHandler + + // Store upgrades, should be used for any new modules introduced, new modules deleted, or store names renamed. + StoreUpgrades store.StoreUpgrades +} diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 0000000..d3ed9b5 --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,4 @@ +version: v1 +directories: + - proto + - third_party/proto \ No newline at end of file diff --git a/cmd/quasarnoded/cmd/config.go b/cmd/quasarnoded/cmd/config.go new file mode 100644 index 0000000..235bb5f --- /dev/null +++ b/cmd/quasarnoded/cmd/config.go @@ -0,0 +1,23 @@ +package cmd + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/quasarlabs/quasarnode/app" +) + +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/cmd/genaccounts.go b/cmd/quasarnoded/cmd/genaccounts.go new file mode 100644 index 0000000..c3b2c92 --- /dev/null +++ b/cmd/quasarnoded/cmd/genaccounts.go @@ -0,0 +1,191 @@ +package cmd + +import ( + "bufio" + "encoding/json" + "errors" + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + "github.com/spf13/cobra" +) + +const ( + flagVestingStart = "vesting-start-time" + flagVestingEnd = "vesting-end-time" + flagVestingAmt = "vesting-amount" +) + +// AddGenesisAccountCmd returns add-genesis-account cobra Command. +func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { + cmd := &cobra.Command{ + Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", + Short: "Add a genesis account to genesis.json", + Long: `Add a genesis account to genesis.json. The provided account must specify +the account address or key name and a list of initial coins. If a key name is given, +the address will be looked up in the local Keybase. The list of initial tokens must +contain valid denominations. Accounts may optionally be supplied with vesting parameters. +`, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + + config.SetRoot(clientCtx.HomeDir) + + var kr keyring.Keyring + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + inBuf := bufio.NewReader(cmd.InOrStdin()) + keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) + if err != nil { + return fmt.Errorf("failed to parse keyring backend: %w", err) + } + if keyringBackend != "" && clientCtx.Keyring == nil { + var err error + kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf) + if err != nil { + return err + } + } else { + kr = clientCtx.Keyring + } + + info, err := kr.Key(args[0]) + if err != nil { + return fmt.Errorf("failed to get address from Keyring: %w", err) + } + addr = info.GetAddress() + } + + coins, err := sdk.ParseCoinsNormalized(args[1]) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + vestingStart, err := cmd.Flags().GetInt64(flagVestingStart) + if err != nil { + return fmt.Errorf("failed to parse vesting start: %w", err) + } + vestingEnd, err := cmd.Flags().GetInt64(flagVestingEnd) + if err != nil { + return fmt.Errorf("failed to parse vesting end: %w", err) + } + vestingAmtStr, err := cmd.Flags().GetString(flagVestingAmt) + if err != nil { + return fmt.Errorf("failed to parse vesting amount: %w", err) + } + + vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) + if err != nil { + return fmt.Errorf("failed to parse vesting amount: %w", err) + } + + // create concrete account type based on input parameters + var genAccount authtypes.GenesisAccount + + balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + + if !vestingAmt.IsZero() { + baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + + if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || + baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { + return errors.New("vesting amount cannot be greater than total amount") + } + + switch { + case vestingStart != 0 && vestingEnd != 0: + genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) + + case vestingEnd != 0: + genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) + + default: + return errors.New("invalid vesting parameters; must supply start and end time or end time") + } + } else { + genAccount = baseAccount + } + + if err := genAccount.Validate(); err != nil { + return fmt.Errorf("failed to validate new genesis account: %w", err) + } + + genFile := config.GenesisFile() + appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + if accs.Contains(addr) { + return fmt.Errorf("cannot add account at existing address %s", addr) + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + accs = append(accs, genAccount) + accs = authtypes.SanitizeGenesisAccounts(accs) + + genAccs, err := authtypes.PackAccounts(accs) + if err != nil { + return fmt.Errorf("failed to convert accounts into any's: %w", err) + } + authGenState.Accounts = genAccs + + authGenStateBz, err := clientCtx.Codec.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + + appState[authtypes.ModuleName] = authGenStateBz + + bankGenState := banktypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + bankGenState.Balances = append(bankGenState.Balances, balances) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) + + bankGenStateBz, err := clientCtx.Codec.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + + appState[banktypes.ModuleName] = bankGenStateBz + + appStateJSON, err := json.Marshal(appState) + if err != nil { + return fmt.Errorf("failed to marshal application genesis state: %w", err) + } + + genDoc.AppState = appStateJSON + return genutil.ExportGenesisFile(genDoc, genFile) + }, + } + + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") + cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") + cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/cmd/quasarnoded/cmd/root.go b/cmd/quasarnoded/cmd/root.go new file mode 100644 index 0000000..082deed --- /dev/null +++ b/cmd/quasarnoded/cmd/root.go @@ -0,0 +1,356 @@ +package cmd + +import ( + "errors" + "io" + "os" + "path/filepath" + + "github.com/CosmWasm/wasmd/x/wasm" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/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/rpc" + "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" + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + "github.com/prometheus/client_golang/prometheus" + "github.com/quasarlabs/quasarnode/app" + appparams "github.com/quasarlabs/quasarnode/app/params" + "github.com/spf13/cast" + "github.com/spf13/cobra" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" +) + +// NewRootCmd creates a new root command for a Cosmos SDK application +func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) { + encodingConfig := app.MakeEncodingConfig() + initClientCtx := client.Context{}. + WithCodec(encodingConfig.Marshaler). + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithInput(os.Stdin). + WithAccountRetriever(types.AccountRetriever{}). + WithHomeDir(app.DefaultNodeHome). + WithViper("") + + rootCmd := &cobra.Command{ + Use: app.Name + "d", + Short: "Start Quasar App", + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + 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 { + return err + } + + customAppTemplate, customAppConfig := initAppConfig() + // customTMConfig := initTendermintConfig() + return server.InterceptConfigsPreRunHandler( + cmd, customAppTemplate, customAppConfig, + ) + }, + } + + initRootCmd(rootCmd, encodingConfig) + + return rootCmd, encodingConfig +} + +// initTendermintConfig helps to override default Tendermint Config values. +// return tmcfg.DefaultConfig if no custom configuration is required for the application. +//func initTendermintConfig() *tmcfg.Config { +// cfg := tmcfg.DefaultConfig() +// return cfg +//} + +func initRootCmd( + rootCmd *cobra.Command, + encodingConfig appparams.EncodingConfig, +) { + // Set config + initSDKConfig() + + rootCmd.AddCommand( + genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), + genutilcli.MigrateGenesisCmd(), + genutilcli.GenTxCmd( + app.ModuleBasics, + encodingConfig.TxConfig, + banktypes.GenesisBalancesIterator{}, + app.DefaultNodeHome, + ), + genutilcli.ValidateGenesisCmd(app.ModuleBasics), + AddGenesisAccountCmd(app.DefaultNodeHome), + tmcli.NewCompletionCmd(rootCmd, true), + debug.Cmd(), + config.Cmd(), + ) + + a := appCreator{ + encodingConfig, + } + + // add server commands + server.AddCommands( + rootCmd, + app.DefaultNodeHome, + a.newApp, + a.appExport, + addModuleInitFlags, + ) + + // add keybase, auxiliary RPC, query, and tx child commands + rootCmd.AddCommand( + rpc.StatusCommand(), + queryCommand(), + txCommand(), + keys.Commands(app.DefaultNodeHome), + ) +} + +// queryCommand returns the sub-command to send queries to the app +func queryCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetAccountCmd(), + rpc.ValidatorCommand(), + rpc.BlockCommand(), + 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 { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetValidateSignaturesCommand(), + flags.LineBreak, + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + ) + + app.ModuleBasics.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) +} + +type appCreator struct { + encodingConfig appparams.EncodingConfig +} + +// newApp creates a new Cosmos SDK app +func (a appCreator) newApp( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + appOpts servertypes.AppOptions, +) servertypes.Application { + var cache sdk.MultiStorePersistentCache + + if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { + cache = store.NewCommitKVStoreCacheManager() + } + + skipUpgradeHeights := make(map[int64]bool) + for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { + skipUpgradeHeights[int64(h)] = true + } + + pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) + if err != nil { + panic(err) + } + + snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") + snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir) + if err != nil { + panic(err) + } + snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) + if err != nil { + panic(err) + } + + var wasmOpts []wasm.Option + if cast.ToBool(appOpts.Get("telemetry.enabled")) { + wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) + } + + return app.New( + logger, + db, + traceStore, + true, + skipUpgradeHeights, + cast.ToString(appOpts.Get(flags.FlagHome)), + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + a.encodingConfig, + appOpts, + app.GetWasmEnabledProposals(), + wasmOpts, + baseapp.SetPruning(pruningOpts), + baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), + baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), + baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), + baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), + baseapp.SetInterBlockCache(cache), + baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), + baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), + baseapp.SetSnapshotStore(snapshotStore), + baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))), + baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))), + baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))), + baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))), + ) +} + +// appExport creates a new simapp (optionally at a given height) +func (a appCreator) appExport( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + height int64, + forZeroHeight bool, + jailAllowedAddrs []string, + appOpts servertypes.AppOptions, +) (servertypes.ExportedApp, error) { + homePath, ok := appOpts.Get(flags.FlagHome).(string) + if !ok || homePath == "" { + return servertypes.ExportedApp{}, errors.New("application home not set") + } + + app := app.New( + logger, + db, + traceStore, + height == -1, // -1: no height provided + map[int64]bool{}, + homePath, + uint(1), + a.encodingConfig, + appOpts, + app.GetWasmEnabledProposals(), + app.EmptyWasmOpts, + ) + + if height != -1 { + if err := app.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } + + return app.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) +} + +// initAppConfig helps to override default appConfig template and configs. +// return "", nil if no custom configuration is required for the application. +func initAppConfig() (string, interface{}) { + // The following code snippet is just for reference. + + // WASMConfig defines configuration for the wasm module. + type WASMConfig struct { + // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries + QueryGasLimit uint64 `mapstructure:"query_gas_limit"` + + // Address defines the gRPC-web server to listen on + LruSize uint64 `mapstructure:"lru_size"` + } + + type CustomAppConfig struct { + serverconfig.Config + + WASM WASMConfig `mapstructure:"wasm"` + } + + // Optionally allow the chain developer to overwrite the SDK's default + // server config. + srvCfg := serverconfig.DefaultConfig() + // The SDK's default minimum gas price is set to "" (empty value) inside + // app.toml. If left empty by validators, the node will halt on startup. + // However, the chain developer can set a default app.toml value for their + // validators here. + // + // In summary: + // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their + // own app.toml config, + // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their + // own app.toml to override, or use this default value. + // + // In simapp, we set the min gas prices to 0. + srvCfg.MinGasPrices = "0uqsr" + + customAppConfig := CustomAppConfig{ + Config: *srvCfg, + WASM: WASMConfig{ + LruSize: 1, + QueryGasLimit: 300000, + }, + } + + customAppTemplate := serverconfig.DefaultConfigTemplate + ` +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This is the number of wasm vm instances we keep cached in memory for speed-up +# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally +lru_size = 0` + + return customAppTemplate, customAppConfig +} diff --git a/cmd/quasarnoded/main.go b/cmd/quasarnoded/main.go new file mode 100644 index 0000000..4d56553 --- /dev/null +++ b/cmd/quasarnoded/main.go @@ -0,0 +1,26 @@ +package main + +import ( + "os" + + "github.com/cosmos/cosmos-sdk/server" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + + app "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 { + switch e := err.(type) { + case server.ErrorCode: + os.Exit(e.Code) + + default: + os.Exit(1) + } + } +} diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..ec99a83 --- /dev/null +++ b/config.yml @@ -0,0 +1,80 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000token", "200000000stake", "1000000000uqsr"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000token", "100000000stake", "1000000000uqsr"] +validator: + name: alice + staked: "100000000uqsr" +genesis: + chain_id: "quasar" + app_state: + staking: + params: + bond_denom: uqsr + intergamm: + params: + osmo_token_transfer_channels: + osmosis-test: channel-1 + osmosis: channel-1 + dest_to_intr_zone_map: + osmosis-01: cosmos + intr_rcvrs: + - zone_info: + chain_id: 'cosmos' + connection_id: 'connection-02' + rcvr_address: 'cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu' + next_zone_route_map: + osmosis-01: + local_zone_id: osmosis-01 + connection_id: 'connection-01' + chain_id: "osmosis" + transfer_channel_id: "channel-01" + osmosis-02: + local_zone_id: osmosis-02 + connection_id: 'connection-02' + chain_id: "osmosis2" + transfer_channel_id: "channel-02" + orion: + params: + enabled: false + lp_epoch_id: day #override day for testing + mgmt_fee_per: '0.003000000000000000' + perf_fee_per: '0.020000000000000000' + destination_chain_id: osmosis + white_listed_pools : [1,2,3] + osmosis_local_info: + local_zone_id : osmosis-01 + chain_id: 'osmosis' + connection_id: 'connection-01' + qoracle: + params: + oracleAccounts: 'quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec' + qbank: + params: + enabled: true + min_orion_epoch_denom_dollar_deposit: '100.000000000000000000' + orion_epoch_identifier: day #override day for testing + white_listed_denoms_in_orion: + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + origin_name: uatom +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +client: + openapi: + path: "docs/static/openapi.yml" +faucet: + name: bob + coins: ["5token", "100000stake", "10000uqsr"] +init: + home: "$HOME/.quasar" \ No newline at end of file diff --git a/demos/bandchain-config/README.md b/demos/bandchain-config/README.md new file mode 100644 index 0000000..18c2169 --- /dev/null +++ b/demos/bandchain-config/README.md @@ -0,0 +1,50 @@ +The purpose of this demo is to demonstrate the ibc connection establishment between bandchain testnet and quasar localnet. And also checking the stable price query update in the quasar chain. + + +1. Remove previous relayer configuration by running the following command +``` +rm -rf ~/.ignite/relayer +``` + +2. Start the chain with default config +``` +ignite chain serve --reset-once -v +``` + +3. Configure a channel for bandchain testnet + +Cross check the value of each field based on your current chain setup. Bandchain also regularly +updating their testnet so its rpc and faucet address are also changing. + +``` +ignite relayer configure -a \ +--target-rpc "https://rpc.laozi-testnet5.bandchain.org" \ +--target-faucet "https://laozi-testnet5.bandchain.org/faucet" \ +--target-port "oracle" \ +--target-gasprice "0uband" \ +--target-gaslimit 5000000 \ +--target-prefix "band" \ +--target-version "bandchain-1" \ +--source-rpc "http://localhost:26659" \ +--source-faucet "http://localhost:4500" \ +--source-port "qoracle" \ +--source-gasprice "0.0stake" \ +--source-gaslimit 300000 \ +--source-prefix "quasar" \ +--source-version "bandchain-1" +``` + +1. Start the relayer +``` +ignite relayer connect +``` +Wait for the channel and relayer to come online + +5. Watch for changes in state +Use the right api port based on config.yml file. +In this repo it is 1311 +``` +http://localhost:1317/quasarlabs/quasarnode/qoracle/state +or +http://localhost:1311/quasarlabs/quasarnode/qoracle/state +``` diff --git a/demos/gas-demo/demo.md b/demos/gas-demo/demo.md new file mode 100644 index 0000000..13e606d --- /dev/null +++ b/demos/gas-demo/demo.md @@ -0,0 +1,69 @@ +# How to use other denom as gas price + +I did a simple experiment to try with gas estimation and payment with other denom with bank tx. +- The minimum-gas-prices is set to `0.001stake` in the app.toml +- In the real scenario; stake could be ibc hex hash of `uosmo` present in the quasar chain. +- Signer can set the gas price he is willing to pay using --gas-price + + ` + +## 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 +` +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 +` +- +- Actual Gas was - 66983 +- Fee deducted - 200stake + + +## 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 +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 +` + +- Actual Gas was - 66983 +- Fee deducted 2000stake + +## By providing fees explicitly using --fees flag + +### 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 +` +-output +` +{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec","to_address":"quasar1828z63g9wp3qwyn4p64adc3ungsv56ux5aacmu","amount":[{"denom":"uqsr","amount":"10"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]} + +confirm transaction before signing and broadcasting [y/N]: y +code: 13 +codespace: sdk +data: "" +events: [] +gas_used: "0" +gas_wanted: "0" +height: "0" +info: "" +logs: [] +raw_log: 'insufficient fees; got: required: 200stake: insufficient fee' +timestamp: "" +tx: null +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 +` diff --git a/demos/gas-demo/quasar_key.txt b/demos/gas-demo/quasar_key.txt new file mode 100644 index 0000000..6c5cdd6 --- /dev/null +++ b/demos/gas-demo/quasar_key.txt @@ -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 \ No newline at end of file diff --git a/demos/gas-demo/quasar_localnet.sh b/demos/gas-demo/quasar_localnet.sh new file mode 100755 index 0000000..28319eb --- /dev/null +++ b/demos/gas-demo/quasar_localnet.sh @@ -0,0 +1,97 @@ +#!/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 +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" +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="old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license" +ALICE_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 + +# Remove previous setup +rm -rf $HOME_QSR + +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID --home $HOME_QSR + +# Bootstrap the quasar local network with single node + +echo $ALICE | $BINARY keys add alice --keyring-backend test --recover --home $HOME_QSR +echo $BOB | $BINARY keys add bob --keyring-backend test --recover --home $HOME_QSR +echo $USER_1 | $BINARY keys add user1 --keyring-backend test --recover --home $HOME_QSR +echo $USER_2 | $BINARY keys add user2 --keyring-backend test --recover --home $HOME_QSR +echo $RELAYER_ACC | $BINARY keys add relayer_acc --keyring-backend test --recover --home $HOME_QSR + + +$BINARY add-genesis-account $($BINARY keys show alice --keyring-backend test -a --home $HOME_QSR) $ALICE_GENESIS_COINS --home $HOME_QSR +$BINARY add-genesis-account $($BINARY keys show bob --keyring-backend test -a --home $HOME_QSR) $BOB_GENESIS_COINS --home $HOME_QSR +$BINARY add-genesis-account $($BINARY keys show user1 --keyring-backend test -a --home $HOME_QSR) $USER_1_GENESIS_COINS --home $HOME_QSR +$BINARY add-genesis-account $($BINARY keys show user2 --keyring-backend test -a --home $HOME_QSR) $USER_2_GENESIS_COINS --home $HOME_QSR +$BINARY add-genesis-account $($BINARY keys show relayer_acc --keyring-backend test -a --home $HOME_QSR) $RELAYER_ACC_GENESIS_COINS --home $HOME_QSR +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test --home $HOME_QSR +$BINARY collect-gentxs --home $HOME_QSR + + +# 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.001stake"+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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 = ""/minimum-gas-prices = "0uatom"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="120s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' | + # jq '.app_state.qoracle.bandchain_genesis_state.params.authorized_channel="channel-0"' | + jq '.app_state.qoracle.osmosis_genesis_state.params.authorized_channel="channel-0"' >$HOME_QSR/config/genesis.json + # jq '.app_state.qoracle.bandchain_genesis_state.params.coin_rates_params.script_params.fee_limit[0].amount="200"' >$HOME_QSR/config/genesis.json + + +# Start +$BINARY start --home $HOME_QSR > quasar.log 2>&1 diff --git a/demos/gov-add-price-mapping/README.md b/demos/gov-add-price-mapping/README.md new file mode 100644 index 0000000..4d8bd84 --- /dev/null +++ b/demos/gov-add-price-mapping/README.md @@ -0,0 +1,34 @@ + +# This demo demonstrate the param change gov procedure + +1. Kill any previous running chain binary. +2. Clean previous chain state +3. And clone new chain source code. and Run the chain +` +ignite chain serve -c demos/gov-add-price-mapping/config.yml --home run/quasar/home --reset-once -v +` +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 + +` +5. Query the proposal state. +` +quasarnoded 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 + +` +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 + +` + +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 +` \ No newline at end of file diff --git a/demos/gov-add-price-mapping/config.yml b/demos/gov-add-price-mapping/config.yml new file mode 100644 index 0000000..ee13fb5 --- /dev/null +++ b/demos/gov-add-price-mapping/config.yml @@ -0,0 +1,69 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000token", "200000000stake", "1000000000uqsr"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000token", "100000000stake", "1000000000uqsr"] +validator: + name: alice + staked: "100000000uqsr" +genesis: + chain_id: "quasar" + app_state: + gov: + deposit_params: + max_deposit_period: 172800s + min_deposit: + - amount: '1' + denom: uqsr + deposits: [] + proposals: [] + starting_proposal_id: '1' + tally_params: + quorum: '00.000000000000000001' + threshold: '0.000000000000000001' + veto_threshold: '0.334000000000000000' + votes: [] + voting_params: + voting_period: 300s + staking: + params: + bond_denom: uqsr + mint: + params: + mint_denom: uqsr + orion: + params: + enabled: false + lp_epoch_id: day #override day for testing + mgmt_fee_per: '0.003000000000000000' + perf_fee_per: '0.020000000000000000' + white_listed_pools : [1,2,3] + qoracle: + params: + oracleAccounts: 'quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec' + qbank: + params: + enabled: true + min_orion_epoch_denom_dollar_deposit: '100.000000000000000000' + orion_epoch_identifier: day #override day for testing + white_listed_denoms_in_orion: + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + origin_name: uatom + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: uqsr + origin_name: uqsr +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +faucet: + name: bob + coins: ["5token", "100000stake", "10000uqsr"] \ No newline at end of file diff --git a/demos/gov-add-price-mapping/proposal.json b/demos/gov-add-price-mapping/proposal.json new file mode 100644 index 0000000..4e0b24d --- /dev/null +++ b/demos/gov-add-price-mapping/proposal.json @@ -0,0 +1,23 @@ +{ + "title": "Add a denom price mapping", + "description": "Add uosmo price mapping", + "changes": [ + { + "subspace": "qoracle", + "key": "DenomPriceMappings", + "value": [ + { + "denom": "uatom", + "oracle_denom": "ATOM", + "multiplier": "0.000001000000000000" + }, + { + "denom": "uosmo", + "oracle_denom": "OSMO", + "multiplier": "0.000001000000000000" + } + ] + } + ], + "deposit": "10000uqsr" +} \ No newline at end of file diff --git a/demos/ibc-transfer-test/README.md b/demos/ibc-transfer-test/README.md new file mode 100644 index 0000000..2b47349 --- /dev/null +++ b/demos/ibc-transfer-test/README.md @@ -0,0 +1,54 @@ +# IBC Transfer Test +This demo tests whether IBC transfers will ack back into the contract when transfers are sent from a contract. + +## To run +Launch quasar chain, osmo chain, and relayer +```bash +cd demos/ibc-transfer-test + +./quasar-localnet.sh +# in a separate terminal +./osmo-localnet.sh +# in a separate terminal +./setup-go-relayer.sh +rly start # once relayer starts, proceed +``` + + +In a separate terminal +`cd smart-contracts` + +### Build +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` + +### 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` + +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":{}}'` + +This will return +``` +data: + transfer_happened: false +``` + +### 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` + +Wait approx 16 seconds + +### Query again +`quasarnoded query wasm contract-state smart REPLACE_ME_WITH_INSTANTIATED_CONTRACT_ADDR '{"state":{}}'` + +If everything worked, this will return +``` +data: + transfer_happened: true +``` \ No newline at end of file diff --git a/demos/ibc-transfer-test/go-relayer-config/chains/osmosis.json b/demos/ibc-transfer-test/go-relayer-config/chains/osmosis.json new file mode 100644 index 0000000..80d0389 --- /dev/null +++ b/demos/ibc-transfer-test/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.3, + "gas-prices": "0.1uosmo", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/ibc-transfer-test/go-relayer-config/chains/quasar.json b/demos/ibc-transfer-test/go-relayer-config/chains/quasar.json new file mode 100644 index 0000000..af02f5a --- /dev/null +++ b/demos/ibc-transfer-test/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": 1.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/ibc-transfer-test/go-relayer-config/paths/quasar_osmosis.json b/demos/ibc-transfer-test/go-relayer-config/paths/quasar_osmosis.json new file mode 100644 index 0000000..f3d5672 --- /dev/null +++ b/demos/ibc-transfer-test/go-relayer-config/paths/quasar_osmosis.json @@ -0,0 +1,12 @@ +{ + "src": { + "chain-id": "osmosis" + }, + "dst": { + "chain-id": "quasar" + }, + "src-channel-filter": { + "rule": null, + "channel-list": [] + } +} \ No newline at end of file diff --git a/demos/ibc-transfer-test/go-relayer-osmosis.json b/demos/ibc-transfer-test/go-relayer-osmosis.json new file mode 100644 index 0000000..399006f --- /dev/null +++ b/demos/ibc-transfer-test/go-relayer-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.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/ibc-transfer-test/go-relayer-quasar.json b/demos/ibc-transfer-test/go-relayer-quasar.json new file mode 100644 index 0000000..af02f5a --- /dev/null +++ b/demos/ibc-transfer-test/go-relayer-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": 1.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/ibc-transfer-test/keys/gaia.key b/demos/ibc-transfer-test/keys/gaia.key new file mode 100644 index 0000000..a8cddb0 --- /dev/null +++ b/demos/ibc-transfer-test/keys/gaia.key @@ -0,0 +1 @@ +ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle diff --git a/demos/ibc-transfer-test/keys/osmo.key b/demos/ibc-transfer-test/keys/osmo.key new file mode 100644 index 0000000..771f703 --- /dev/null +++ b/demos/ibc-transfer-test/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/ibc-transfer-test/keys/qsr.key b/demos/ibc-transfer-test/keys/qsr.key new file mode 100644 index 0000000..d47463a --- /dev/null +++ b/demos/ibc-transfer-test/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/ibc-transfer-test/osmo_localnet.sh b/demos/ibc-transfer-test/osmo_localnet.sh new file mode 100755 index 0000000..839eaf2 --- /dev/null +++ b/demos/ibc-transfer-test/osmo_localnet.sh @@ -0,0 +1,159 @@ +# 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="rabbit garlic monitor wish pony magic budget someone room torch celery empower word assume digital rack electric weapon urban foot sketch jelly wet myself" +ALICE_GENESIS_COINS=10000000000000uosmo,2000000000stake,20000000uatom +BOB_GENESIS_COINS=10000000000000uosmo,1000000000stake +USER_1_GENESIS_COINS=10000000000stake,10000000000uosmo +USER_2_GENESIS_COINS=10000000000stake,10000000000uosmo +RELAYER_ACC_GENESIS_COINS=10000000uosmo + +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 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 +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.mint = { + minter: { + epoch_provisions: "0.000000000000000000" + }, + params: { + distribution_proportions: { + community_pool: "0.100000000000000000", + developer_rewards: "0.200000000000000000", + pool_incentives: "0.300000000000000000", + staking: "0.400000000000000000" + }, + epoch_identifier: "day", + genesis_epoch_provisions: "5000000.000000000000000000", + mint_denom: "uosmo", + minting_rewards_distribution_start_epoch: "0", + reduction_factor: "0.500000000000000000", + reduction_period_in_epochs: "156", + weighted_developer_rewards_receivers: [] + } + }' | + jq '.app_state.incentives = { + last_gauge_id: "0", + lockable_durations: [ + "1s", + "120s", + "180s", + "240s" + ], + params: { + distr_epoch_identifier: "day" + } + }' | + jq '.app_state.poolincentives = { + distr_info: { + records: [ + { + gauge_id: "0", + weight: "10000" + }, + { + gauge_id: "1", + weight: "1000" + }, + { + gauge_id: "2", + weight: "100" + } + ], + total_weight: "11100" + }, + lockable_durations: [ + "120s", + "180s", + "240s" + ], + params: { + minted_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"}' | + jq '.app_state.interchainquery = { + host_port: "icqhost", + params: { + host_enabled: true, + allow_queries: [ + "/osmosis.epochs.v1beta1.Query/EpochInfos", + "/osmosis.gamm.v1beta1.Query/Pool", + "/osmosis.poolincentives.v1beta1.Query/LockableDurations", + "/osmosis.mint.v1beta1.Query/Params", + "/osmosis.mint.v1beta1.Query/EpochProvisions", + "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools", + "/osmosis.poolincentives.v1beta1.Query/GaugeIds", + "/osmosis.poolincentives.v1beta1.Query/DistrInfo" + ] + } + }' \ + > $HOME_OSMOSIS/config/genesis.json + +# Start +$BINARY start --home $HOME_OSMOSIS \ No newline at end of file diff --git a/demos/ibc-transfer-test/quasar.yml b/demos/ibc-transfer-test/quasar.yml new file mode 100644 index 0000000..b43ee19 --- /dev/null +++ b/demos/ibc-transfer-test/quasar.yml @@ -0,0 +1,87 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000token", "200000000stake", "1000000000uqsr"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000token", "100000000stake", "1000000000uqsr"] + - name: relayer_acc + mnemonic: old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license + # corresponding address is quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew + coins: ["1000000stake", "100000000uqsr"] +validator: + name: alice + staked: "100000000uqsr" +genesis: + chain_id: "quasar" + app_state: + staking: + params: + bond_denom: uqsr + intergamm: + params: + osmo_token_transfer_channels: + osmosis-test: channel-1 + osmosis: channel-1 + dest_to_intr_zone_map: + osmosis-01: cosmos + intr_rcvrs: + - zone_info: + chain_id: 'cosmos' + connection_id: 'connection-02' + rcvr_address: 'cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu' + next_zone_route_map: + osmosis-01: + local_zone_id: osmosis-01 + connection_id: 'connection-01' + chain_id: "osmosis" + transfer_channel_id: "channel-01" + osmosis-02: + local_zone_id: osmosis-02 + connection_id: 'connection-02' + chain_id: "osmosis2" + transfer_channel_id: "channel-02" + orion: + params: + enabled: false + lp_epoch_id: day #override day for testing + mgmt_fee_per: '0.003000000000000000' + perf_fee_per: '0.020000000000000000' + destination_chain_id: osmosis + white_listed_pools : [1,2,3] + osmosis_local_info: + local_zone_id : osmosis-01 + chain_id: 'osmosis' + connection_id: 'connection-01' + qoracle: + params: + oracleAccounts: 'quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec' + qbank: + params: + enabled: true + min_orion_epoch_denom_dollar_deposit: '100.000000000000000000' + orion_epoch_identifier: day #override day for testing + white_listed_denoms_in_orion: + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + origin_name: uatom + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: uqsr + origin_name: uqsr +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +#client: +# openapi: +# path: "docs/client/static/openapi/openapi.yml" +# vuex: +# path: "vue/src/store" +faucet: + name: bob + coins: ["5token", "100000stake", "10000uqsr"] diff --git a/demos/ibc-transfer-test/quasar_localnet.sh b/demos/ibc-transfer-test/quasar_localnet.sh new file mode 100755 index 0000000..08fbd69 --- /dev/null +++ b/demos/ibc-transfer-test/quasar_localnet.sh @@ -0,0 +1,89 @@ +## 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 +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" +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="old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license" +ALICE_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 + +# Remove previous setup +rm -rf $HOME_QSR + +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID + +# Bootstrap the quasar local network with single node + +echo $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$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 = ""/minimum-gas-prices = "0uqsr"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 = ""/minimum-gas-prices = "0uatom"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="60s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' | + jq '.app_state.qoracle.params.bandchain_params.coin_rates_params.script_params.fee_limit[0].amount="200"' > $HOME_QSR/config/genesis.json + +# Start +$BINARY start --home $HOME_QSR \ No newline at end of file diff --git a/demos/ibc-transfer-test/run_go_relayer.sh b/demos/ibc-transfer-test/run_go_relayer.sh new file mode 100755 index 0000000..0fb4c51 --- /dev/null +++ b/demos/ibc-transfer-test/run_go_relayer.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# restore the keys from the mnemomic phrases, same phrases as the hermes script +rly keys restore quasar quasarkey "ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle" + +rly q balance quasar + +rly chains add -f go-relayer-quasar.json quasar + diff --git a/demos/ibc-transfer-test/setup_go_relayer.sh b/demos/ibc-transfer-test/setup_go_relayer.sh new file mode 100755 index 0000000..8aeafcb --- /dev/null +++ b/demos/ibc-transfer-test/setup_go_relayer.sh @@ -0,0 +1,24 @@ +#!/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 >> ./logs/rly_qo_setup.log 2>&1 + diff --git a/demos/ica-packet-forward/README.md b/demos/ica-packet-forward/README.md new file mode 100644 index 0000000..6baec5a --- /dev/null +++ b/demos/ica-packet-forward/README.md @@ -0,0 +1,78 @@ +Start a quasar node + +``` +ignite chain serve --config demos/ica-packet-forward/quasar.yml --reset-once -v +``` + +Clone gaia from this repo (https://github.com/quasar-finance/gaia/tree/bugfix/replace_default_transfer_with_router_module) and run it by copying the the cosmos.yml file to gaia project root and running the following command: + +``` +cd ../gaia +ignite chain serve --config cosmos.yml --reset-once -v +``` + +(For now we use another instance of quasar as osmosis since icahost is not implemented yet in osmosis) + +``` +ignite chain serve --config demos/ica-packet-forward/osmosis.yml --reset-once -v +``` + +``` +cp ./demos/ica-packet-forward/hermes_config.toml ~/.hermes/config.toml +``` + +Using hermes v0.15.0 + +``` +hermes keys restore --mnemonic "jungle law popular reunion festival horn divorce quarter image gather october weird slide trend resource render abuse food tomorrow multiply price fun ask quarter" quasar + +hermes keys restore --mnemonic "blade trap agent boy note critic jazz nuclear eight lion pipe fresh tourist make broken inquiry close agree usual human stock move remain swim" cosmos + +hermes keys restore --mnemonic "act scale exhibit enough swamp vivid bleak eagle giggle brass desert debris network scrub hazard fame salon normal over between inform advance sick dinner" osmosis +``` + +Create ibc connection between quasar and osmosis for ICA usage + +``` +hermes create connection quasar osmosis +``` + +Create transfer channels between osmosis <-> cosmos and cosmos <-> quasar + +``` +hermes create channel osmosis --chain-b cosmos --port-a transfer --port-b transfer --new-client-connection + +hermes create channel cosmos --chain-b quasar --port-a transfer --port-b transfer --new-client-connection +``` + +``` +hermes start +``` + +Register interchain account + +``` +quasarnoded tx intergamm register-account connection-0 --chain-id=quasar --node=tcp://localhost:26659 --home ~/.qsr --from alice +``` + +Query the interchain account address on osmosis + +``` +quasarnoded query intergamm interchain-account-from-address connection-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node=tcp://localhost:26659 +``` + +Send some tokens to the interchain account address on osmosis + +``` +quasarnoded tx bank send alice quasar1hphwfu3yjf82z8xpcl6e05gzkjwjmu8ts2m97mdk62feuqm77f2sj52eta 10uosmo --chain-id=osmosis --node=tcp://localhost:26669 --home ~/.osmo --from alice +``` + +Issue the interchain tx to ibc transfer some tokens to quasar from interchain account on osmosis through cosmos + +``` +quasarnoded tx intergamm forward-ibc-transfer connection-0 transfer channel-0 10uosmo transfer channel-1 cosmos1e3geute48fzym40um7gw2kjt87q7nkeel7mept quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --chain-id=quasar --node=tcp://localhost:26659 --home ~/.qsr --from alice +``` + +Check balance of quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec from the link below, it should contain 10ibc/C9B459D627233FC6E5049A27B5465D76C7F69D7FCB7F843EAC2B6A38B668F9F1 + +http://localhost:1311/bank/balances/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec \ No newline at end of file diff --git a/demos/ica-packet-forward/cosmos.yml b/demos/ica-packet-forward/cosmos.yml new file mode 100644 index 0000000..2c0d9d4 --- /dev/null +++ b/demos/ica-packet-forward/cosmos.yml @@ -0,0 +1,30 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000000uatom", "2000000000stake"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000000uatom", "1000000000stake"] + - name: relayer_acc + coins: ["10000stake"] + address: cosmos14ahzv9ldtfn7ktgnd0m8k70d6l080lvdlrrsth +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4501" + name: bob + coins: ["1000000uatom", "100000000stake"] +host: + rpc: ":26559" + p2p: ":26662" + prof: ":6062" + grpc: ":9096" + grpc-web: ":8092" + api: ":1312" + frontend: ":8082" + dev-ui: ":12352" +genesis: + chain_id: "cosmos" +init: + home: "$HOME/.cosmos" diff --git a/demos/ica-packet-forward/hermes_config.toml b/demos/ica-packet-forward/hermes_config.toml new file mode 100644 index 0000000..9b624f5 --- /dev/null +++ b/demos/ica-packet-forward/hermes_config.toml @@ -0,0 +1,178 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'cosmos' +rpc_addr = 'http://127.0.0.1:26669' +grpc_addr = 'http://127.0.0.1:9097' +websocket_addr = 'ws://127.0.0.1:26669/websocket' +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'cosmoskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uatom' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'band-laozi-testnet5' +rpc_addr = 'https://rpc.laozi-testnet5.bandchain.org:443' +grpc_addr = 'https://laozi-testnet5.bandchain.org' +websocket_addr = 'ws://rpc.laozi-testnet5.bandchain.org:443/websocket' +rpc_timeout = '10s' +account_prefix = 'band' +key_name = 'bandkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uband' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } diff --git a/demos/ica-packet-forward/osmosis.yml b/demos/ica-packet-forward/osmosis.yml new file mode 100644 index 0000000..9c8e29a --- /dev/null +++ b/demos/ica-packet-forward/osmosis.yml @@ -0,0 +1,35 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000000uosmo", "2000000000stake"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000000uosmo", "1000000000stake"] + - name: relayer_acc + coins: ["10000stake"] + address: quasar139njd402zqj368sk65y753ppp4hxr926pkhrkk +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4502" + name: bob + coins: ["1000000uosmo", "100000000stake"] +host: + rpc: ":26669" + p2p: ":26663" + prof: ":6063" + grpc: ":9097" + grpc-web: ":8093" + api: ":1313" + frontend: ":8083" + dev-ui: ":12353" +genesis: + chain_id: "osmosis" + app_state: + interchainaccounts: + host_genesis_state: + params: + allow_messages: ["/ibc.applications.transfer.v1.MsgTransfer"] +init: + home: "$HOME/.osmo" diff --git a/demos/ica-packet-forward/quasar.yml b/demos/ica-packet-forward/quasar.yml new file mode 100644 index 0000000..0da2c6e --- /dev/null +++ b/demos/ica-packet-forward/quasar.yml @@ -0,0 +1,30 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000000qsr", "2000000000stake"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000000qsr", "1000000000stake"] + - name: relayer_acc + coins: ["10000stake"] + address: quasar1tshnze3yrtv3hk9x536p7znpxeckd4v9ha0trg +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4500" + name: bob + coins: ["1000000qsr", "100000000stake"] +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +genesis: + chain_id: "quasar" +init: + home: "$HOME/.qsr" diff --git a/demos/ica-smart-contract/README.md b/demos/ica-smart-contract/README.md new file mode 100644 index 0000000..6b1ccd4 --- /dev/null +++ b/demos/ica-smart-contract/README.md @@ -0,0 +1,8 @@ +# ICA smart contract +This demo shows how to set and run the ica smart contract. Currently, this is not expected to work against the current Osmosis release. In order to run this, the osmosis binary has to be built from a version that replaces ibc-go with https://github.com/quasar-finance/ibc-go/tree/laurens-hacking, a prepared version of osmosis for this can be found at https://github.com/quasar-finance/osmosis/tree/laurens/hacking + +## Setup +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 diff --git a/demos/ica-smart-contract/cosmos.yml b/demos/ica-smart-contract/cosmos.yml new file mode 100644 index 0000000..4742f11 --- /dev/null +++ b/demos/ica-smart-contract/cosmos.yml @@ -0,0 +1,31 @@ +accounts: + - name: alice + mnemonic: blur service enlist into false certain replace arrow until fatal glory mule design into dilemma palm helmet upper behave gallery into afford candy exercise + coins: ["20000000uatom", "2000000000stake"] + - name: bob + mnemonic: lucky surface version conduct ketchup cash unfair rival shoulder example demand upset deny tilt very clinic tribe rather renew skirt naive sweet box chicken + coins: ["10000000uatom", "1000000000stake"] + - name: relayer_acc + mnemonic: ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle + # corresponding address is cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc + coins: ["10000stake", "10000000uatom"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4502" + name: bob + coins: ["1000000uatom", "100000000stake"] +host: + rpc: ":26669" + p2p: ":26663" + prof: ":6063" + grpc: ":9097" + grpc-web: ":8093" + api: ":1313" + frontend: ":8083" + dev-ui: ":12353" +genesis: + chain_id: "cosmos" +#init: +# home: "${home_dir}" diff --git a/demos/ica-smart-contract/create_and_execute_contract.sh b/demos/ica-smart-contract/create_and_execute_contract.sh new file mode 100755 index 0000000..f651699 --- /dev/null +++ b/demos/ica-smart-contract/create_and_execute_contract.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +set -e + +CHAIN_ID="quasar" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +RPC="http://127.0.0.1:26659" +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" +echo $NODE +# the callback_address is the address of the orion module +INIT='{"default_timeout": 1000}' + +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) +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]') +echo "Got address of deployed contract = $ADDR" + +echo "setting up channel" +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 + +CHANNEL=$(rly q channels quasar | jq -s --arg ADDR $ADDR '.[] | select(.port_id=="wasm." + $ADDR).channel_id') +SENDER=$(rly q channels quasar | jq -s --arg ADDR $ADDR '.[] | select(.port_id=="wasm." + $ADDR).version | fromjson | .address') +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 + +cd - diff --git a/demos/ica-smart-contract/go-relayer-config/chains/osmosis.json b/demos/ica-smart-contract/go-relayer-config/chains/osmosis.json new file mode 100644 index 0000000..80d0389 --- /dev/null +++ b/demos/ica-smart-contract/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.3, + "gas-prices": "0.1uosmo", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/ica-smart-contract/go-relayer-config/chains/quasar.json b/demos/ica-smart-contract/go-relayer-config/chains/quasar.json new file mode 100644 index 0000000..af02f5a --- /dev/null +++ b/demos/ica-smart-contract/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": 1.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/ica-smart-contract/go-relayer-config/paths/quasar_osmosis.json b/demos/ica-smart-contract/go-relayer-config/paths/quasar_osmosis.json new file mode 100644 index 0000000..9cabcc0 --- /dev/null +++ b/demos/ica-smart-contract/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": [] + } +} \ No newline at end of file diff --git a/demos/ica-smart-contract/keys/gaia.key b/demos/ica-smart-contract/keys/gaia.key new file mode 100644 index 0000000..2805733 --- /dev/null +++ b/demos/ica-smart-contract/keys/gaia.key @@ -0,0 +1 @@ +ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle \ No newline at end of file diff --git a/demos/ica-smart-contract/keys/osmo.key b/demos/ica-smart-contract/keys/osmo.key new file mode 100644 index 0000000..3d08a9b --- /dev/null +++ b/demos/ica-smart-contract/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 \ No newline at end of file diff --git a/demos/ica-smart-contract/keys/qsr.key b/demos/ica-smart-contract/keys/qsr.key new file mode 100644 index 0000000..6c5cdd6 --- /dev/null +++ b/demos/ica-smart-contract/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 \ No newline at end of file diff --git a/demos/ica-smart-contract/osmo_localnet.sh b/demos/ica-smart-contract/osmo_localnet.sh new file mode 100755 index 0000000..9fb550c --- /dev/null +++ b/demos/ica-smart-contract/osmo_localnet.sh @@ -0,0 +1,109 @@ +#!/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 +BOB_GENESIS_COINS=10000000000000uosmo,1000000000stake +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 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.mint.params.mint_denom="uosmo"' | + jq '.app_state.poolincentives.params.minted_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"}' | + jq '.app_state.interchainaccounts.host_genesis_state.port="icahost"' | + jq '.app_state.interchainaccounts.host_genesis_state.params= + { + host_enabled:true, + allow_messages: [ + "/ibc.applications.transfer.v1.MsgTransfer", + "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + "/osmosis.gamm.v1beta1.MsgJoinPool", + "/osmosis.gamm.v1beta1.MsgExitPool", + "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn", + "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut", + "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut", + "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn", + "/osmosis.lockup.MsgLockTokens", + "/osmosis.lockup.MsgBeginUnlocking" + ] + }' \ + > $HOME_OSMOSIS/config/genesis.json + +# Start +$BINARY start --home $HOME_OSMOSIS >> ./logs/osmo_localnet.log 2>&1 \ No newline at end of file diff --git a/demos/ica-smart-contract/osmosis.yml b/demos/ica-smart-contract/osmosis.yml new file mode 100644 index 0000000..c1bf297 --- /dev/null +++ b/demos/ica-smart-contract/osmosis.yml @@ -0,0 +1,34 @@ +version: 1 +accounts: + - name: alice + mnemonic: cruise scene law sea push expose scorpion wire trick repair wave quote task dose inner denial alpha favorite certain blouse motion flash split lunch + coins: ["20000000uosmo", "2000000000stake"] + - name: bob + mnemonic: lizard garlic canyon winner cheese tent drip task because ecology clay bridge junk critic track artefact gather harsh deliver unit vacant earth diesel stool + coins: ["10000000000000uosmo", "1000000000stake"] + - name: relayer_acc + 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 + # corresponding address is osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz + coins: ["100000stake", "10000000000000uosmo"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4501" + name: bob + coins: ["100000000000uosmo", "100000000stake"] +host: + rpc: ":26679" + p2p: ":26662" + prof: ":6062" + grpc: ":9096" + grpc-web: ":8092" + api: ":1312" + frontend: ":8082" + dev-ui: ":12352" +genesis: + chain_id: "osmosis" +#init: +# home: "${home_dir}" +build: + main: "cmd/osmosisd" diff --git a/demos/ica-smart-contract/quasar.yml b/demos/ica-smart-contract/quasar.yml new file mode 100644 index 0000000..b43ee19 --- /dev/null +++ b/demos/ica-smart-contract/quasar.yml @@ -0,0 +1,87 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000token", "200000000stake", "1000000000uqsr"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000token", "100000000stake", "1000000000uqsr"] + - name: relayer_acc + mnemonic: old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license + # corresponding address is quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew + coins: ["1000000stake", "100000000uqsr"] +validator: + name: alice + staked: "100000000uqsr" +genesis: + chain_id: "quasar" + app_state: + staking: + params: + bond_denom: uqsr + intergamm: + params: + osmo_token_transfer_channels: + osmosis-test: channel-1 + osmosis: channel-1 + dest_to_intr_zone_map: + osmosis-01: cosmos + intr_rcvrs: + - zone_info: + chain_id: 'cosmos' + connection_id: 'connection-02' + rcvr_address: 'cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu' + next_zone_route_map: + osmosis-01: + local_zone_id: osmosis-01 + connection_id: 'connection-01' + chain_id: "osmosis" + transfer_channel_id: "channel-01" + osmosis-02: + local_zone_id: osmosis-02 + connection_id: 'connection-02' + chain_id: "osmosis2" + transfer_channel_id: "channel-02" + orion: + params: + enabled: false + lp_epoch_id: day #override day for testing + mgmt_fee_per: '0.003000000000000000' + perf_fee_per: '0.020000000000000000' + destination_chain_id: osmosis + white_listed_pools : [1,2,3] + osmosis_local_info: + local_zone_id : osmosis-01 + chain_id: 'osmosis' + connection_id: 'connection-01' + qoracle: + params: + oracleAccounts: 'quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec' + qbank: + params: + enabled: true + min_orion_epoch_denom_dollar_deposit: '100.000000000000000000' + orion_epoch_identifier: day #override day for testing + white_listed_denoms_in_orion: + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + origin_name: uatom + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: uqsr + origin_name: uqsr +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +#client: +# openapi: +# path: "docs/client/static/openapi/openapi.yml" +# vuex: +# path: "vue/src/store" +faucet: + name: bob + coins: ["5token", "100000stake", "10000uqsr"] diff --git a/demos/ica-smart-contract/quasar_localnet.sh b/demos/ica-smart-contract/quasar_localnet.sh new file mode 100755 index 0000000..892256b --- /dev/null +++ b/demos/ica-smart-contract/quasar_localnet.sh @@ -0,0 +1,135 @@ +#!/bin/sh + +## 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 +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" +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)" + +ALICE_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 $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$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 = ""/minimum-gas-prices = "0uqsr"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 = ""/minimum-gas-prices = "0uatom"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 + 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 +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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="60s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' | + jq '.app_state.orion = { + "lpPosition": null, + "lpStat": null, + "params": { + "destination_chain_id": "osmosis", + "enabled": true, + "lp_epoch_id": "minute", + "mgmt_fee_per": "0.003000000000000000", + "osmosis_local_info": { + "chain_id": "osmosis", + "connection_id": "connection-1", + "local_zone_id": "osmosis-1" + }, + "perf_fee_per": "0.020000000000000000", + "white_listed_pools": [ + 1, + 2, + 3 + ] + }, + "rewardCollection": null + }' | + jq '.app_state.qbank = { + "claimableRewards": [], + "depositInfos": [], + "params": { + "enabled": true, + "min_orion_epoch_denom_dollar_deposit": "100.000000000000000000", + "orion_epoch_identifier": "minute", + "white_listed_denoms_in_orion": [ + { + "onehop_osmo": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", + "onehop_quasar": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", + "origin_name": "uatom" + } + ] + }, + "totalClaimedRewards": [], + "totalDeposits": [], + "totalWithdraws": [], + "withdrawables": [] + }' > $HOME_QSR/config/genesis.json + +# Start +$BINARY start --home $HOME_QSR >> ./logs/quasar_localnet.log 2>&1 diff --git a/demos/ica-smart-contract/run_all.sh b/demos/ica-smart-contract/run_all.sh new file mode 100755 index 0000000..c4e75d9 --- /dev/null +++ b/demos/ica-smart-contract/run_all.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# trap ctrl-c and ctrl-d +cleanup() +{ + kill $COSMOS_PID + kill $OSMO_PID + kill $QUASAR_PID + kill $HERMES_PID + kill $RLY_PID_1 +} + +trap cleanup 1 2 3 6 + +# reset logs dir +rm -rf ./logs +mkdir ./logs + +# run quasar and save pid +./quasar_localnet.sh & +QUASAR_PID=$! + +#run osmo and save pid +./osmo_localnet.sh & +OSMO_PID=$! + +# wait for chains to start +sleep 10 +# run hermes and save pid, run_hermes and setup_go_relayer might not relay over the same channel out of the box due to connection creation in both scripts +# ./run_hermes.sh & + +# Currently we're not using Hermes due to an issue with relaying new channels https://github.com/informalsystems/ibc-rs/issues/2608 +# starting hermes +# echo "starting hermes" +# hermes start >> ./logs/hermes_start.log 2>&1 +# HERMES_PID=$! + +echo "setting up go relayer" +./setup_go_relayer.sh + +echo "starting relaying" +# run an instance of go relayer for each path, thus 3 in total +rly start quasar_osmosis --debug-addr "localhost:7598" -p events >> ./logs/quasar_osmosis.log 2>&1 & +RLY_PID_2=$! + +wait diff --git a/demos/ica-smart-contract/setup_go_relayer.sh b/demos/ica-smart-contract/setup_go_relayer.sh new file mode 100755 index 0000000..cfc6e12 --- /dev/null +++ b/demos/ica-smart-contract/setup_go_relayer.sh @@ -0,0 +1,24 @@ +#!/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 >> ./logs/rly_qo_setup.log 2>&1 + diff --git a/demos/icq-smart-contract/README.md b/demos/icq-smart-contract/README.md new file mode 100644 index 0000000..dda12a7 --- /dev/null +++ b/demos/icq-smart-contract/README.md @@ -0,0 +1,11 @@ +# ICQ smart contract demo + +## Demo Contents +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`. + +## Instructions +Assuming you're in the icq-smart-contract directory, +first, run ```./run_all.sh``` and wait until you see `starting relaying`. Now in a seperate window run ```./create_and_execute_contract.sh```. The script will compile our smart contracts, store the `icq` contract on the quasar chain, instantiate the contract, open an IBC channel between our contract and the `icqhost` on the osmosis chain, and send a query over icq. The user will be propmted to send this query. \ No newline at end of file diff --git a/demos/icq-smart-contract/create_and_execute_contract.sh b/demos/icq-smart-contract/create_and_execute_contract.sh new file mode 100755 index 0000000..d0cb3e6 --- /dev/null +++ b/demos/icq-smart-contract/create_and_execute_contract.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +CHAIN_ID="quasar" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +RPC="http://127.0.0.1:26659" +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" +echo $NODE +INIT='{"default_timeout": 100}' +# quasar <-> osmosis channel is connection 2 in current setup + +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) +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]') +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 +echo "creating icq channel" +rly transact channel quasar_osmosis --src-port "wasm.$ADDR" --dst-port icqhost --order unordered --version icq-1 --override +CHANNEL=$(rly q channels quasar | jq -s --arg ADDR $ADDR '[.[] | select(.port_id=="wasm." + $ADDR)][0].channel_id') +MSG="{\"query_all_balance\":{\"channel\":$CHANNEL, \"address\":\"osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz\"}}" + + +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\"" +cd - \ No newline at end of file diff --git a/demos/icq-smart-contract/go-relayer-config/chains/osmosis.json b/demos/icq-smart-contract/go-relayer-config/chains/osmosis.json new file mode 100644 index 0000000..89a53c6 --- /dev/null +++ b/demos/icq-smart-contract/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.2, + "gas-prices": "0.01uosmo", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/icq-smart-contract/go-relayer-config/chains/quasar.json b/demos/icq-smart-contract/go-relayer-config/chains/quasar.json new file mode 100644 index 0000000..af02f5a --- /dev/null +++ b/demos/icq-smart-contract/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": 1.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/icq-smart-contract/go-relayer-config/paths/quasar_osmosis.json b/demos/icq-smart-contract/go-relayer-config/paths/quasar_osmosis.json new file mode 100644 index 0000000..9cabcc0 --- /dev/null +++ b/demos/icq-smart-contract/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": [] + } +} \ No newline at end of file diff --git a/demos/icq-smart-contract/hermes_config.toml b/demos/icq-smart-contract/hermes_config.toml new file mode 100644 index 0000000..4a93418 --- /dev/null +++ b/demos/icq-smart-contract/hermes_config.toml @@ -0,0 +1,174 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = false + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'cosmos' +rpc_addr = 'http://127.0.0.1:26669' +grpc_addr = 'http://127.0.0.1:9097' +websocket_addr = 'ws://127.0.0.1:26669/websocket' +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'cosmoskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uatom' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +# [[chains]] +# id = 'band-laozi-testnet5' +# rpc_addr = 'https://rpc.laozi-testnet5.bandchain.org:443' +# grpc_addr = 'https://laozi-testnet5.bandchain.org' +# websocket_addr = 'ws://rpc.laozi-testnet5.bandchain.org:443/websocket' +# rpc_timeout = '10s' +# account_prefix = 'band' +# key_name = 'bandkey' +# store_prefix = 'ibc' +# default_gas = 100000 +# max_gas = 3000000 +# gas_price = { price = 0.001, denom = 'uband' } +# gas_multiplier = 1.1 +# max_msg_num = 30 +# max_tx_size = 2097152 +# clock_drift = '5s' +# max_block_time = '10s' +# trusting_period = '14days' +# trust_threshold = { numerator = '1', denominator = '3' } +# address_type = { derivation = 'cosmos' } \ No newline at end of file diff --git a/demos/icq-smart-contract/host_mapping.md b/demos/icq-smart-contract/host_mapping.md new file mode 100644 index 0000000..bd17d82 --- /dev/null +++ b/demos/icq-smart-contract/host_mapping.md @@ -0,0 +1,78 @@ +config.yaml host section configuration ip address maps according to below mapping. + +host: +1. rpc address + +config.yml +rpc: ":26659" + +config.toml: +[rpc] +# TCP or UNIX socket address for the RPC server to listen on +laddr = "tcp://0.0.0.0:26659" + +2. p2p address + +config.yml +p2p: ":26661" + +config.toml: +[p2p] + +# Address to listen for incoming connections +laddr = "tcp://0.0.0.0:26661" + +3. prof +config.yml +prof: ":6061" + +config.toml: +# pprof listen address (https://golang.org/pkg/net/http/pprof) +pprof_laddr = ":6061" + +4. grpc + +config.yml +grpc: ":9095" + +app.toml +[grpc] + address = ":9095" + enable = true + +5. grpc-web + +config.yml +grpc-web: ":8091" + +app.toml +[grpc-web] + address = ":8091" + +6. api + +config.yml + api: ":1311" + +app.toml +[api] + address = "tcp://0.0.0.0:1311" + +7. frontend + +config.yml +frontend: ":8081" +dev-ui: ":12351" + +no mapping in the config directory. These two are specific to frontend application. + + +### for this demo + +field | default | quasar | cosmos hub | osmosis +rpc | 26657 | 26659 | 26669 | 26679 +p2p | 26656 | 26661 | 26663 | 26662 +prof | 6060 | 6061 | 6063 | 6062 +grpc | 9090 | 9095 | 9097 | 9096 +grpc-web| 9091 | 8081 | 8093 | 8092 +api | 1313 | 1311 | 1313 | 1312 diff --git a/demos/icq-smart-contract/keys/osmo.key b/demos/icq-smart-contract/keys/osmo.key new file mode 100644 index 0000000..3d08a9b --- /dev/null +++ b/demos/icq-smart-contract/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 \ No newline at end of file diff --git a/demos/icq-smart-contract/keys/qsr.key b/demos/icq-smart-contract/keys/qsr.key new file mode 100644 index 0000000..6c5cdd6 --- /dev/null +++ b/demos/icq-smart-contract/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 \ No newline at end of file diff --git a/demos/icq-smart-contract/osmo_localnet.sh b/demos/icq-smart-contract/osmo_localnet.sh new file mode 100755 index 0000000..a4057f1 --- /dev/null +++ b/demos/icq-smart-contract/osmo_localnet.sh @@ -0,0 +1,166 @@ +#!/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 +BOB_GENESIS_COINS=10000000000000uosmo,1000000000stake +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 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='mac' +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 = 'mac' ]; 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 mac 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.mint = { + minter: { + epoch_provisions: "0.000000000000000000" + }, + params: { + distribution_proportions: { + community_pool: "0.100000000000000000", + developer_rewards: "0.200000000000000000", + pool_incentives: "0.300000000000000000", + staking: "0.400000000000000000" + }, + epoch_identifier: "day", + genesis_epoch_provisions: "5000000.000000000000000000", + mint_denom: "uosmo", + minting_rewards_distribution_start_epoch: "0", + reduction_factor: "0.500000000000000000", + reduction_period_in_epochs: "156", + weighted_developer_rewards_receivers: [] + } + }' | + jq '.app_state.incentives = { + last_gauge_id: "0", + lockable_durations: [ + "1s", + "120s", + "180s", + "240s" + ], + params: { + distr_epoch_identifier: "day" + } + }' | + jq '.app_state.poolincentives = { + distr_info: { + records: [ + { + gauge_id: "0", + weight: "10000" + }, + { + gauge_id: "1", + weight: "1000" + }, + { + gauge_id: "2", + weight: "100" + } + ], + total_weight: "11100" + }, + lockable_durations: [ + "120s", + "180s", + "240s" + ], + params: { + minted_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"}' | + jq '.app_state.interchainquery = { + host_port: "icqhost", + params: { + host_enabled: true, + allow_queries: [ + "/cosmos.bank.v1beta1.Query/AllBalances", + "/cosmos.bank.v1beta1.Query/Balance", + "/osmosis.epochs.v1beta1.Query/EpochInfos", + "/osmosis.gamm.v1beta1.Query/Pool", + "/osmosis.poolincentives.v1beta1.Query/LockableDurations", + "/osmosis.mint.v1beta1.Query/Params", + "/osmosis.mint.v1beta1.Query/EpochProvisions", + "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools", + "/osmosis.poolincentives.v1beta1.Query/GaugeIds", + "/osmosis.poolincentives.v1beta1.Query/DistrInfo" + ] + } + }' \ + > $HOME_OSMOSIS/config/genesis.json + +# Start +$BINARY start --home $HOME_OSMOSIS >> ./logs/osmo_localnet.log 2>&1 \ No newline at end of file diff --git a/demos/icq-smart-contract/osmosis.yml b/demos/icq-smart-contract/osmosis.yml new file mode 100644 index 0000000..c1bf297 --- /dev/null +++ b/demos/icq-smart-contract/osmosis.yml @@ -0,0 +1,34 @@ +version: 1 +accounts: + - name: alice + mnemonic: cruise scene law sea push expose scorpion wire trick repair wave quote task dose inner denial alpha favorite certain blouse motion flash split lunch + coins: ["20000000uosmo", "2000000000stake"] + - name: bob + mnemonic: lizard garlic canyon winner cheese tent drip task because ecology clay bridge junk critic track artefact gather harsh deliver unit vacant earth diesel stool + coins: ["10000000000000uosmo", "1000000000stake"] + - name: relayer_acc + 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 + # corresponding address is osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz + coins: ["100000stake", "10000000000000uosmo"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4501" + name: bob + coins: ["100000000000uosmo", "100000000stake"] +host: + rpc: ":26679" + p2p: ":26662" + prof: ":6062" + grpc: ":9096" + grpc-web: ":8092" + api: ":1312" + frontend: ":8082" + dev-ui: ":12352" +genesis: + chain_id: "osmosis" +#init: +# home: "${home_dir}" +build: + main: "cmd/osmosisd" diff --git a/demos/icq-smart-contract/quasar.yml b/demos/icq-smart-contract/quasar.yml new file mode 100644 index 0000000..b43ee19 --- /dev/null +++ b/demos/icq-smart-contract/quasar.yml @@ -0,0 +1,87 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000token", "200000000stake", "1000000000uqsr"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000token", "100000000stake", "1000000000uqsr"] + - name: relayer_acc + mnemonic: old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license + # corresponding address is quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew + coins: ["1000000stake", "100000000uqsr"] +validator: + name: alice + staked: "100000000uqsr" +genesis: + chain_id: "quasar" + app_state: + staking: + params: + bond_denom: uqsr + intergamm: + params: + osmo_token_transfer_channels: + osmosis-test: channel-1 + osmosis: channel-1 + dest_to_intr_zone_map: + osmosis-01: cosmos + intr_rcvrs: + - zone_info: + chain_id: 'cosmos' + connection_id: 'connection-02' + rcvr_address: 'cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu' + next_zone_route_map: + osmosis-01: + local_zone_id: osmosis-01 + connection_id: 'connection-01' + chain_id: "osmosis" + transfer_channel_id: "channel-01" + osmosis-02: + local_zone_id: osmosis-02 + connection_id: 'connection-02' + chain_id: "osmosis2" + transfer_channel_id: "channel-02" + orion: + params: + enabled: false + lp_epoch_id: day #override day for testing + mgmt_fee_per: '0.003000000000000000' + perf_fee_per: '0.020000000000000000' + destination_chain_id: osmosis + white_listed_pools : [1,2,3] + osmosis_local_info: + local_zone_id : osmosis-01 + chain_id: 'osmosis' + connection_id: 'connection-01' + qoracle: + params: + oracleAccounts: 'quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec' + qbank: + params: + enabled: true + min_orion_epoch_denom_dollar_deposit: '100.000000000000000000' + orion_epoch_identifier: day #override day for testing + white_listed_denoms_in_orion: + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + origin_name: uatom + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: uqsr + origin_name: uqsr +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +#client: +# openapi: +# path: "docs/client/static/openapi/openapi.yml" +# vuex: +# path: "vue/src/store" +faucet: + name: bob + coins: ["5token", "100000stake", "10000uqsr"] diff --git a/demos/icq-smart-contract/quasar_localnet.sh b/demos/icq-smart-contract/quasar_localnet.sh new file mode 100755 index 0000000..a7cabe4 --- /dev/null +++ b/demos/icq-smart-contract/quasar_localnet.sh @@ -0,0 +1,169 @@ +#!/bin/sh + +## 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 +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" +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)" + +ALICE_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 $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$BINARY collect-gentxs + +# Check platform +platform='unknown' +unamestr=`uname` +if [ "$unamestr" = 'Linux' ]; then + platform='linux' +elif [ "$unamestr" = 'Darwin' ]; then + platform='mac' +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 = ""/minimum-gas-prices = "0uqsr"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1311"+g' $HOME_QSR/config/app.toml + sed -i 's+address = ":8080"+address = ":8081"+g' $HOME_QSR/config/app.toml +elif [ $platform = 'mac' ]; 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 = ""/minimum-gas-prices = "0uqsr"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 mac 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_QSR/config/app.toml + sed -i '' 's/swagger = false/swagger = true/g' $HOME_QSR/config/app.toml +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.deposit_params.min_deposit=[{denom:"uqsr",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"}' | + jq ".app_state.qoracle.params.oracleAccounts=\"$($BINARY keys show alice --keyring-backend test -a)\"" | + jq '.app_state.orion = { + "lpPosition": null, + "lpStat": null, + "params": { + "destination_chain_id": "osmosis", + "enabled": true, + "lp_epoch_id": "minute", + "mgmt_fee_per": "0.003000000000000000", + "osmosis_local_info": { + "chain_id": "osmosis", + "connection_id": "connection-1", + "local_zone_id": "osmosis-1" + }, + "perf_fee_per": "0.020000000000000000", + "white_listed_pools": [ + 1, + 2, + 3 + ] + }, + "rewardCollection": null + }' | + jq '.app_state.intergamm = { + "params": { + "dest_to_intr_zone_map": { + "osmosis-01": "cosmos" + }, + "intr_rcvrs": [ + { + "next_zone_route_map": { + "osmosis-01": { + "chain_id": "osmosis", + "connection_id": "connection-1", + "local_zone_id": "osmosis-1", + "transfer_channel_id": "channel-1" + }, + "osmosis-02": { + "chain_id": "osmosis2", + "connection_id": "connection-2", + "local_zone_id": "osmosis-2", + "transfer_channel_id": "channel-2" + } + }, + "rcvr_address": "cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu", + "zone_info": { + "chain_id": "cosmos", + "connection_id": "connection-2" + } + } + ], + "osmo_token_transfer_channels": { + "osmosis": "channel-1", + "osmosis-test": "channel-1" + } + } + }' | + jq '.app_state.qbank = { + "claimableRewards": [], + "depositInfos": [], + "params": { + "enabled": true, + "min_orion_epoch_denom_dollar_deposit": "100.000000000000000000", + "orion_epoch_identifier": "minute", + "white_listed_denoms_in_orion": [ + { + "onehop_osmo": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", + "onehop_quasar": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", + "origin_name": "uatom" + } + ] + }, + "totalClaimedRewards": [], + "totalDeposits": [], + "totalWithdraws": [], + "withdrawables": [] + }' > $HOME_QSR/config/genesis.json + +# Start +$BINARY start --home $HOME_QSR >> ./logs/quasar_localnet.log 2>&1 diff --git a/demos/icq-smart-contract/run_all.sh b/demos/icq-smart-contract/run_all.sh new file mode 100755 index 0000000..9b79063 --- /dev/null +++ b/demos/icq-smart-contract/run_all.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# trap ctrl-c and ctrl-d +cleanup() +{ + kill $OSMO_PID + kill $QUASAR_PID + kill $HERMES_PID + kill $RLY_PID_1 + +} + +trap cleanup 1 2 3 6 + +# reset logs dir +rm -rf ./logs +mkdir ./logs + +# run quasar and save pid +./quasar_localnet.sh & +QUASAR_PID=$! + +#run osmo and save pid +./osmo_localnet.sh & +OSMO_PID=$! + +# wait for chains to start +sleep 10 + +# run hermes and save pid, run_hermes and setup_go_relayer might not relay over the same channel out of the box due to connection creation in both scripts +# ./run_hermes.sh & + +# Currently we're not using Hermes due to an issue with relaying new channels https://github.com/informalsystems/ibc-rs/issues/2608 +# starting hermes +# echo "starting hermes" +# hermes start >> ./logs/hermes_start.log 2>&1 +# HERMES_PID=$! + +./setup_go_relayer.sh + +echo "starting relaying" +# # run an instance of go relayer for each path, thus 3 in total +rly start quasar_osmosis --debug-addr "localhost:7598" -p events >> ./logs/quasar_osmosis.log 2>&1 & +RLY_PID_1=$! + +wait diff --git a/demos/icq-smart-contract/run_hermes.sh b/demos/icq-smart-contract/run_hermes.sh new file mode 100755 index 0000000..236d7e7 --- /dev/null +++ b/demos/icq-smart-contract/run_hermes.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +cp ./hermes_config.toml ~/.hermes/config.toml + +hermes keys add --chain quasar --mnemonic-file keys/qsr.key + +hermes keys add --chain cosmos --mnemonic-file keys/gaia.key + +hermes keys add --chain osmosis --mnemonic-file keys/osmo.key + + +# BANDCHAIN="band-laozi-testnet5" +# 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 +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 + + +# Create connection +echo "creating connection for quasar cosmos" +hermes create connection --a-chain quasar --b-chain cosmos >> ./logs/hermes_qc.log 2>&1 + +echo "creating connection for quasar osmosis" +hermes create connection --a-chain quasar --b-chain osmosis >> ./logs/hermes_qc.log 2>&1 + +echo "creating connection for osmosis cosmos" +hermes create connection --a-chain osmosis --b-chain cosmos >> ./logs/hermes_oc.log 2>&1 + +# hermes create connection quasar $BANDCHAIN + +# Create channel +echo "creating default channel for quasar cosmos" +hermes create channel --a-chain cosmos --a-connection connection-0 --a-port transfer --b-port transfer >> ./logs/hermes_qc.log 2>&1 + +echo "creating default channel for cosmos osmosis" +hermes create channel --a-chain cosmos --a-connection connection-1 --a-port transfer --b-port transfer >> ./logs/hermes_oc.log 2>&1 + +echo "creating default channel for quasar osmosis" +hermes create channel --a-chain quasar --a-connection connection-1 --a-port transfer --b-port transfer >> ./logs/hermes_qo.log 2>&1 + +# hermes create channel --port-a qoracle --port-b oracle quasar connection-2 -v bandchain-1 diff --git a/demos/icq-smart-contract/setup_go_relayer.sh b/demos/icq-smart-contract/setup_go_relayer.sh new file mode 100755 index 0000000..e03ba64 --- /dev/null +++ b/demos/icq-smart-contract/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 >> ./logs/rly_qo_setup.log 2>&1 + diff --git a/demos/local-integrated-setup/README.md b/demos/local-integrated-setup/README.md new file mode 100644 index 0000000..4823860 --- /dev/null +++ b/demos/local-integrated-setup/README.md @@ -0,0 +1,90 @@ +# Description + +This guide shows how to set up a local integrated environment with quasar, osmosis and gaia chains running in the local machine of developers. + +## Clone and compile the chain binary +In this step you need to clone the chain source code from the right repository with your choice of branch or tag. + +This guide shows to clone from their projects main repository except gaia and main branch. + +1. Clone and compile quasar +``` +git clone git@github.com:bandprotocol/chain.git band +cd band +make install +``` + +2. Clone and compile osmosis + +``` +git clone git@github.com:osmosis-labs/osmosis.git +cd osmosis +make install +``` + +3. Clone and compile gaia + +``` +git clone git@github.com:quasar-finance/gaia.git -b bugfix/replace_default_transfer_with_router_module +cd gaia +make install +``` + +4. Clone and compile band protocol +``` +git clone git@github.com:bandprotocol/chain.git band +cd band +make install +``` + + +## Clean the environment +Run the following command to clean the environment from previous state. +``` +./kill_n_clean.sh +``` +Check the running status command. +``` +./running_status.sh +``` + +## Start the chains with gen tx procedure +``` +./run_all_chains_with_gentx.sh +``` +Check the running status command. +``` +./running_status.sh +``` +## Establish the ibc connections + +To check the hermes configurations please go to the hermes/v[0/1] directory and verify that the hermes configuration is as per your expectations. + + +### Option #1 +If you want quasar to connect to band chain also for getting stable prices from the band. Please not that the v0 and v1 in the script name for the specific version of hermes that you are using. If you are using v0.y.z version, use the script whch has v0 in its name, if you are using v1.y.z version, use the script with v1 in its name. + +``` +cd hermes +./run_hermes_v[0/1]_withbandchain.sh +``` + +### Option #2 +If you don't want quasar to connect to bandchain, maybe because your testing use case don't require stable prices. +``` +cd hermes +./run_hermes_v[0/1]_nobandchain.sh +``` + +### Check the ibc connection among chains + +You can use below two scrips for output the connection and channel mappings among the chains. +Use the band chain version if you are using the band chain too. The script will exit if something is wrong with the connection or the connection or channel are not yet established. + +It works well when connection and channels are established properly. +``` +./ibc_connection_status_with_bandchain.sh +./ibc_connection_status.sh +./ibc_channel_status.sh +./ibc_channel_status_with_bandchain.sh +``` diff --git a/demos/local-integrated-setup/clean_all_chains.sh b/demos/local-integrated-setup/clean_all_chains.sh new file mode 100755 index 0000000..2043419 --- /dev/null +++ b/demos/local-integrated-setup/clean_all_chains.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -o xtrace + +echo "Cleaning all the node states" + +rm -rf ~/.quasarnode +rm -rf ~/.osmosis +rm -rf ~/.osmosisd +rm -rf ~/.gaia + +rm -rf ~/.hermes/ diff --git a/demos/local-integrated-setup/cosmos.seeds b/demos/local-integrated-setup/cosmos.seeds new file mode 100644 index 0000000..a8cddb0 --- /dev/null +++ b/demos/local-integrated-setup/cosmos.seeds @@ -0,0 +1 @@ +ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle diff --git a/demos/local-integrated-setup/cosmos_localnet.sh b/demos/local-integrated-setup/cosmos_localnet.sh new file mode 100755 index 0000000..a88dbdb --- /dev/null +++ b/demos/local-integrated-setup/cosmos_localnet.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +# Configure variables +BINARY=gaiad +HOME_COSMOSHUB=$HOME/.gaia +CHAIN_ID=cosmos +ALICE="blur service enlist into false certain replace arrow until fatal glory mule design into dilemma palm helmet upper behave gallery into afford candy exercise" +BOB="lucky surface version conduct ketchup cash unfair rival shoulder example demand upset deny tilt very clinic tribe rather renew skirt naive sweet box chicken" +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="ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle" +ALICE_GENESIS_COINS=200000000uatom,2000000000stake +BOB_GENESIS_COINS=10000000uatom,1000000000stake +USER_1_GENESIS_COINS=10000000000stake,10000000000uatom,10000000000uusd +USER_2_GENESIS_COINS=10000000000stake,10000000000uatom +RELAYER_ACC_GENESIS_COINS=10000000uatom + +# Remove previous setup +rm -rf $HOME_COSMOSHUB + +# Bootstrap +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID --home $HOME_COSMOSHUB +echo $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY add-genesis-account $($BINARY keys show bob --keyring-backend test -a) $BOB_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY add-genesis-account $($BINARY keys show user1 --keyring-backend test -a) $USER_1_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY add-genesis-account $($BINARY keys show user2 --keyring-backend test -a) $USER_2_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY add-genesis-account $($BINARY keys show relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY gentx alice 100000000uatom --chain-id $CHAIN_ID --keyring-backend test --home $HOME_COSMOSHUB +#$BINARY gentx bob 100000000uatom --chain-id $CHAIN_ID --keyring-backend test --home $HOME_COSMOSHUB +$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_COSMOSHUB/config/app.toml + sed -i 's/swagger = false/swagger = true/g' $HOME_COSMOSHUB/config/app.toml + sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/g' $HOME_COSMOSHUB/config/app.toml + sed -i 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26669"+g' $HOME_COSMOSHUB/config/config.toml + sed -i 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26669"+g' $HOME_COSMOSHUB/config/client.toml + sed -i 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26663"+g' $HOME_COSMOSHUB/config/config.toml + sed -i 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6063"+g' $HOME_COSMOSHUB/config/config.toml + sed -i 's+address = "0.0.0.0:9090"+address = "0.0.0.0:9097"+g' $HOME_COSMOSHUB/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8093"+g' $HOME_COSMOSHUB/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1313"+g' $HOME_COSMOSHUB/config/app.toml + sed -i 's+address = ":8080"+address = ":8083"+g' $HOME_COSMOSHUB/config/app.toml +elif [ $platform = 'macos' ]; then + sed -i'.original' -e 's/enable = false/enable = true/g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's/swagger = false/swagger = true/g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26669"+g' $HOME_COSMOSHUB/config/config.toml + sed -i'.original' -e 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26669"+g' $HOME_COSMOSHUB/config/client.toml + sed -i'.original' -e 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26663"+g' $HOME_COSMOSHUB/config/config.toml + sed -i'.original' -e 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6063"+g' $HOME_COSMOSHUB/config/config.toml + sed -i'.original' -e 's+address = "0.0.0.0:9090"+address = "0.0.0.0:9097"+g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8093"+g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1313"+g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's+address = ":8080"+address = ":8083"+g' $HOME_COSMOSHUB/config/app.toml +else + echo "only linux platforms are supported, if you are using other platforms you should probably improve this script." + exit 1 +fi + +cp $HOME_COSMOSHUB/config/genesis.json $HOME_COSMOSHUB/config/genesis_original.json +cat $HOME_COSMOSHUB/config/genesis_original.json | + jq '.app_state.crisis.constant_fee.denom="uatom"' | + jq '.app_state.staking.params.bond_denom="uatom"' | + jq '.app_state.mint.params.mint_denom="uatom"' | + jq '.app_state.liquidity.params.pool_creation_fee=[{denom:"uatom",amount:"1"}]' | + jq '.app_state.gov.deposit_params.min_deposit=[{denom:"uatom",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_COSMOSHUB/config/genesis.json + +# Start +$BINARY start --home $HOME_COSMOSHUB > cosmos.log 2>&1 & diff --git a/demos/local-integrated-setup/hermes/band.seeds b/demos/local-integrated-setup/hermes/band.seeds new file mode 100644 index 0000000..f975fbc --- /dev/null +++ b/demos/local-integrated-setup/hermes/band.seeds @@ -0,0 +1 @@ +machine danger crush duck always will liberty popular security shoulder bargain day repair focus fog evoke market gossip love curious question kingdom armor crazy diff --git a/demos/local-integrated-setup/hermes/cosmos.seeds b/demos/local-integrated-setup/hermes/cosmos.seeds new file mode 100644 index 0000000..a8cddb0 --- /dev/null +++ b/demos/local-integrated-setup/hermes/cosmos.seeds @@ -0,0 +1 @@ +ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle diff --git a/demos/local-integrated-setup/hermes/osmosis.seeds b/demos/local-integrated-setup/hermes/osmosis.seeds new file mode 100644 index 0000000..771f703 --- /dev/null +++ b/demos/local-integrated-setup/hermes/osmosis.seeds @@ -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/local-integrated-setup/hermes/quasar.seeds b/demos/local-integrated-setup/hermes/quasar.seeds new file mode 100644 index 0000000..d47463a --- /dev/null +++ b/demos/local-integrated-setup/hermes/quasar.seeds @@ -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/local-integrated-setup/hermes/run_hermes_v0_nobandchain.sh b/demos/local-integrated-setup/hermes/run_hermes_v0_nobandchain.sh new file mode 100755 index 0000000..dbb83f3 --- /dev/null +++ b/demos/local-integrated-setup/hermes/run_hermes_v0_nobandchain.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +## This hermes script will establish connections among quasar, cosmos and osmosis local network. +## This script is using the hermes 0.x.x version. +## This script is not taking band chain into considerations. + +v=`hermes --version` +STR="$v" +SUB='hermes 0' +echo $STR +if echo "$STR" | grep -q "$SUB"; then + echo "hermes version is correct for this script." + echo "continuing ..." +else + echo "$STR" + echo "$SUB" + echo "hermes version is not correct for this script. Please use hermes 0.x.x version for this script" + echo "exiting ..." + exit 1 +fi + +../running_status.sh + +is_processes_running=`echo $?` + +if [ "$is_processes_running" = "0" ] +then + echo "All processes are running." + echo "Continuing..." +else + echo "All processes are not running." + echo "Exiting..." + exit 1 +fi + +mkdir -p ~/.hermes/ +pwd +cp v0/hermes_config_nobandchain.toml ~/.hermes/config.toml + +hermes keys restore --mnemonic "old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license" quasar +hermes keys restore --mnemonic "ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle" cosmos +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 +gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 +osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 + + +# Create connection +hermes create connection quasar cosmos +hermes create connection quasar osmosis +hermes create connection osmosis cosmos + +# Create channel + +hermes create channel --port-a transfer --port-b transfer cosmos connection-0 +hermes create channel --port-a transfer --port-b transfer cosmos connection-1 +hermes create channel --port-a transfer --port-b transfer quasar connection-1 + +# hermes start +hermes start > hermes.log 2>&1 diff --git a/demos/local-integrated-setup/hermes/run_hermes_v0_withbandchain.sh b/demos/local-integrated-setup/hermes/run_hermes_v0_withbandchain.sh new file mode 100755 index 0000000..9420513 --- /dev/null +++ b/demos/local-integrated-setup/hermes/run_hermes_v0_withbandchain.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +## This hermes script will establish connections among quasar, cosmos and osmosis local network. +## This script is using the hermes 0.x.x version. +## This script is not taking band chain into considerations. + +v=`hermes --version` +STR="$v" +SUB='hermes 0' +echo $STR +if echo "$STR" | grep -q "$SUB"; then + echo "hermes version is correct for this script." + echo "continuing ..." +else + echo "$STR" + echo "$SUB" + echo "hermes version is not correct for this script. Please use hermes 0.x.x version for this script" + echo "exiting ..." + exit 1 +fi + +../running_status.sh + +is_processes_running=`echo $?` + +if [ "$is_processes_running" = "0" ] +then + echo "All processes are running." + echo "Continuing..." +else + echo "All processes are not running." + echo "Exiting..." + exit 1 +fi + +mkdir -p ~/.hermes/ +pwd +cp v0/hermes_config_with_bandchain.toml ~/.hermes/config.toml + +BANDCHAIN="band-laozi-testnet5" + +quasar_seeds=$(cat quasar.seeds) +cosmos_seeds=$(cat cosmos.seeds) +osmosis_seeds=$(cat osmosis.seeds) +band_seeds=$(cat band.seeds) +hermes keys restore --mnemonic "$quasar_seeds" quasar +hermes keys restore --mnemonic "$cosmos_seeds" cosmos +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 +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 + + +# Create connection +hermes create connection quasar cosmos +hermes create connection quasar osmosis +hermes create connection osmosis cosmos +hermes create connection quasar $BANDCHAIN + +# Create channel + +hermes create channel --port-a transfer --port-b transfer cosmos connection-0 +hermes create channel --port-a transfer --port-b transfer cosmos connection-1 +hermes create channel --port-a transfer --port-b transfer quasar connection-1 +hermes create channel --port-a qoracle --port-b oracle quasar connection-2 -v bandchain-1 + +#hermes start +hermes start > hermes.log 2>&1 diff --git a/demos/local-integrated-setup/hermes/run_hermes_v1_nobandchain.sh b/demos/local-integrated-setup/hermes/run_hermes_v1_nobandchain.sh new file mode 100755 index 0000000..fa58e6b --- /dev/null +++ b/demos/local-integrated-setup/hermes/run_hermes_v1_nobandchain.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +## This hermes script will establish connections among quasar, cosmos and osmosis local network. +## This script is using the hermes 1.x.x version. +## This script is not taking band chain into considerations. + +v=`hermes --version` +STR="$v" +SUB='hermes 1' +echo $STR +if echo "$STR" | grep -q "$SUB"; then + echo "hermes version is correct for this script." + echo "continuing ..." +else + echo "$STR" + echo "$SUB" + echo "hermes version is not correct for this script. Please use hermes 1.x.x version for this script" + echo "exiting ..." + exit 1 +fi + +../running_status.sh + +is_processes_running=`echo $?` + +echo "hello $is_processes_running" + +if [ "$is_processes_running" = "0" ] +then + echo "All processes are running." + echo "Continuing..." +else + echo "All processes are not running." + echo "Exiting..." + exit 1 +fi + +mkdir -p ~/.hermes/ +pwd +cp v1/hermes_config_nobandchain.toml ~/.hermes/config.toml + +hermes keys add --chain quasar --mnemonic-file quasar.seeds +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 +gaiad q bank balances cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc --node tcp://localhost:26669 +osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 + +# Create connection + +hermes create connection --a-chain quasar --b-chain cosmos +hermes create connection --a-chain quasar --b-chain osmosis +hermes create connection --a-chain osmosis --b-chain cosmos + +# Create channel + +hermes create channel --a-chain cosmos --a-connection connection-0 --a-port transfer --b-port transfer +hermes create channel --a-chain cosmos --a-connection connection-1 --a-port transfer --b-port transfer +hermes create channel --a-chain quasar --a-connection connection-1 --a-port transfer --b-port transfer + +# start +hermes start > hermes.log 2>&1 diff --git a/demos/local-integrated-setup/hermes/run_hermes_v1_withbandchain.sh b/demos/local-integrated-setup/hermes/run_hermes_v1_withbandchain.sh new file mode 100755 index 0000000..f8edb4c --- /dev/null +++ b/demos/local-integrated-setup/hermes/run_hermes_v1_withbandchain.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +## This hermes script will establish connections among quasar, cosmos and osmosis local network. +## This script is using the hermes 1.x.x version. +## This script is not taking band chain into considerations. + +v=`hermes --version` +STR="$v" +SUB='hermes 1' +echo $STR +if echo "$STR" | grep -q "$SUB"; then + echo "hermes version is correct for this script." + echo "continuing ..." +else + echo "$STR" + echo "$SUB" + echo "hermes version is not correct for this script. Please use hermes 1.x.x version for this script" + echo "exiting ..." + exit 1 +fi + +../running_status.sh + +is_processes_running=`echo $?` + +echo "hello $is_processes_running" + +if [ "$is_processes_running" = "0" ] +then + echo "All processes are running." + echo "Continuing..." +else + echo "All processes are not running." + echo "Exiting..." + exit 1 +fi + + +mkdir -p ~/.hermes/ +pwd +cp v1/hermes_config_with_bandchain.toml ~/.hermes/config.toml + + +hermes keys add --chain quasar --mnemonic-file quasar.seeds +hermes keys add --chain osmosis --mnemonic-file osmosis.seeds +hermes keys add --chain cosmos --mnemonic-file cosmos.seeds + +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 +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 + + +# Create connection + + +hermes create connection --a-chain quasar --b-chain cosmos +hermes create connection --a-chain quasar --b-chain osmosis +hermes create connection --a-chain osmosis --b-chain cosmos +hermes create connection --a-chain quasar --b-chain $BANDCHAIN + +# Create channel + +hermes create channel --a-chain cosmos --a-connection connection-0 --a-port transfer --b-port transfer +hermes create channel --a-chain cosmos --a-connection connection-1 --a-port transfer --b-port transfer +hermes create channel --a-chain quasar --a-connection connection-1 --a-port transfer --b-port transfer +hermes create channel --a-chain quasar --a-connection connection-2 --a-port qoracle --b-port oracle --channel-version bandchain-1 + +# start +hermes start > hermes.log 2>&1 diff --git a/demos/local-integrated-setup/hermes/v0/hermes_config_nobandchain.toml b/demos/local-integrated-setup/hermes/v0/hermes_config_nobandchain.toml new file mode 100644 index 0000000..c572599 --- /dev/null +++ b/demos/local-integrated-setup/hermes/v0/hermes_config_nobandchain.toml @@ -0,0 +1,177 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'cosmos' +rpc_addr = 'http://127.0.0.1:26669' +grpc_addr = 'http://127.0.0.1:9097' +websocket_addr = 'ws://127.0.0.1:26669/websocket' +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'cosmoskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uatom' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +#[[chains]] +#id = 'band-laozi-testnet5' +#rpc_addr = 'https://rpc.laozi-testnet5.bandchain.org:443' +#grpc_addr = 'https://laozi-testnet5.bandchain.org' +#websocket_addr = 'ws://rpc.laozi-testnet5.bandchain.org:443/websocket' +#rpc_timeout = '10s' +#account_prefix = 'band' +#key_name = 'bandkey' +#store_prefix = 'ibc' +#default_gas = 100000 +#max_gas = 3000000 +#gas_price = { price = 0.001, denom = 'uband' } +#gas_adjustment = 0.1 +#max_msg_num = 30 +#max_tx_size = 2097152 +#clock_drift = '5s' +#max_block_time = '10s' +#trusting_period = '14days' +#trust_threshold = { numerator = '1', denominator = '3' } +#mDdress_type = { derivation = 'cosmos' } diff --git a/demos/local-integrated-setup/hermes/v0/hermes_config_with_bandchain.toml b/demos/local-integrated-setup/hermes/v0/hermes_config_with_bandchain.toml new file mode 100644 index 0000000..9b624f5 --- /dev/null +++ b/demos/local-integrated-setup/hermes/v0/hermes_config_with_bandchain.toml @@ -0,0 +1,178 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'cosmos' +rpc_addr = 'http://127.0.0.1:26669' +grpc_addr = 'http://127.0.0.1:9097' +websocket_addr = 'ws://127.0.0.1:26669/websocket' +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'cosmoskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uatom' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'band-laozi-testnet5' +rpc_addr = 'https://rpc.laozi-testnet5.bandchain.org:443' +grpc_addr = 'https://laozi-testnet5.bandchain.org' +websocket_addr = 'ws://rpc.laozi-testnet5.bandchain.org:443/websocket' +rpc_timeout = '10s' +account_prefix = 'band' +key_name = 'bandkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uband' } +#gas_multiplier = 1.1 +gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } diff --git a/demos/local-integrated-setup/hermes/v1/hermes_config_nobandchain.toml b/demos/local-integrated-setup/hermes/v1/hermes_config_nobandchain.toml new file mode 100644 index 0000000..066795f --- /dev/null +++ b/demos/local-integrated-setup/hermes/v1/hermes_config_nobandchain.toml @@ -0,0 +1,177 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +gas_multiplier = 1.1 +#gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'cosmos' +rpc_addr = 'http://127.0.0.1:26669' +grpc_addr = 'http://127.0.0.1:9097' +websocket_addr = 'ws://127.0.0.1:26669/websocket' +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'cosmoskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uatom' } +gas_multiplier = 1.1 +#gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +gas_multiplier = 1.1 +#gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +#[[chains]] +#id = 'band-laozi-testnet5' +#rpc_addr = 'https://rpc.laozi-testnet5.bandchain.org:443' +#grpc_addr = 'https://laozi-testnet5.bandchain.org' +#websocket_addr = 'ws://rpc.laozi-testnet5.bandchain.org:443/websocket' +#rpc_timeout = '10s' +#account_prefix = 'band' +#key_name = 'bandkey' +#store_prefix = 'ibc' +#default_gas = 100000 +#max_gas = 3000000 +#gas_price = { price = 0.001, denom = 'uband' } +#gas_adjustment = 0.1 +#max_msg_num = 30 +#max_tx_size = 2097152 +#clock_drift = '5s' +#max_block_time = '10s' +#trusting_period = '14days' +#trust_threshold = { numerator = '1', denominator = '3' } +#mDdress_type = { derivation = 'cosmos' } diff --git a/demos/local-integrated-setup/hermes/v1/hermes_config_with_bandchain.toml b/demos/local-integrated-setup/hermes/v1/hermes_config_with_bandchain.toml new file mode 100644 index 0000000..076e841 --- /dev/null +++ b/demos/local-integrated-setup/hermes/v1/hermes_config_with_bandchain.toml @@ -0,0 +1,178 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +gas_multiplier = 1.1 +#gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'cosmos' +rpc_addr = 'http://127.0.0.1:26669' +grpc_addr = 'http://127.0.0.1:9097' +websocket_addr = 'ws://127.0.0.1:26669/websocket' +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'cosmoskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uatom' } +gas_multiplier = 1.1 +#gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +gas_multiplier = 1.1 +#gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'band-laozi-testnet5' +rpc_addr = 'https://rpc.laozi-testnet5.bandchain.org:443' +grpc_addr = 'https://laozi-testnet5.bandchain.org' +websocket_addr = 'ws://rpc.laozi-testnet5.bandchain.org:443/websocket' +rpc_timeout = '10s' +account_prefix = 'band' +key_name = 'bandkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uband' } +gas_multiplier = 1.1 +#gas_adjustment = 0.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } diff --git a/demos/local-integrated-setup/ibc_channel_status.sh b/demos/local-integrated-setup/ibc_channel_status.sh new file mode 100755 index 0000000..55709b0 --- /dev/null +++ b/demos/local-integrated-setup/ibc_channel_status.sh @@ -0,0 +1,103 @@ +#!/bin/bash +#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 '"'` + +echo $num_channels +echo "state | port_id | channel_id | cp_port_id | cp_channel_id " +echo "$state | $port_id | $channel_id | $cp_port_id | $cp_channel_id " +' +test_error() { +if [ "$1" = "" ] +then + echo "Previous command did not run properly. Exiting." + exit 1 +fi +} + + +binary_name="" +grpc_port="" +declare -a binary_arr=("quasarnoded" "osmosisd" "gaiad") +#declare -a binary_arr=("quasarnoded") + +for b in "${binary_arr[@]}" +do + binary_name=$b + echo " " + echo "### $binary_name ############################" + case "$binary_name" in + "quasarnoded") grpc_port="26659" + ;; + "osmosisd") grpc_port="26679" + ;; + "gaiad") grpc_port="26669" + ;; + esac + echo " " + echo "binary_name=$binary_name" + 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 + # 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") + for conn in "${conn_arr[@]}" + do + echo " " + echo "### $conn ##########################" + nc=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels | length" | tr -d '"'` + test_error $nc + + ibc_client_id=`$binary_name q ibc connection end $conn --node tcp://localhost:$grpc_port -o json | jq '.connection.client_id' | tr -d '"'` + test_error $ibc_client_id + + ibc_cp_chainid=`$binary_name q ibc client state $ibc_client_id --node tcp://localhost:$grpc_port -o json | jq ".client_state.chain_id" | tr -d '""'` + test_error $ibc_cp_chainid + + ibc_cp_client_id=`$binary_name q ibc connection end $conn --node tcp://localhost:$grpc_port -o json | jq ".connection.counterparty.client_id" | tr -d '""'` + test_error $ibc_cp_client_id + + ibc_cp_conn_id=`$binary_name q ibc connection end $conn --node tcp://localhost:$grpc_port -o json | jq ".connection.counterparty.connection_id" | tr -d '""'` + test_error $ibc_cp_conn_id + + for (( i=0; i < $nc; ++i )) + do + port_id=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].port_id" | tr -d '"'` + test_error $port_id + + channel_id=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].channel_id" | tr -d '"'` + test_error $channel_id + + cp_port_id=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].counterparty.port_id" | tr -d '"'` + test_error $cp_port_id + + cp_channel_id=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].counterparty.channel_id" | tr -d '"'` + test_error $cp_channel_id + + state=`$binary_name q ibc channel channels --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].state" | tr -d '"'` + test_error $state + + echo "### $channel_id #############################" + echo "number_of_channels=$nc" + echo "connection_id=$conn" + echo "client_id=$ibc_client_id" + echo "port_id=$port_id" + echo "channel_id=$channel_id" + echo "cp_chainid=$ibc_cp_chainid" + echo "cp_connection_id=$ibc_cp_conn_id" + echo "cp_client_id=$ibc_cp_client_id" + echo "cp_port_id=$cp_port_id" + echo "cp_channel_id=$cp_channel_id" + echo "channel_state=$state" + done # channel + done # connection +done # binary diff --git a/demos/local-integrated-setup/ibc_channel_status_with_bandchain.sh b/demos/local-integrated-setup/ibc_channel_status_with_bandchain.sh new file mode 100755 index 0000000..e6c1bce --- /dev/null +++ b/demos/local-integrated-setup/ibc_channel_status_with_bandchain.sh @@ -0,0 +1,108 @@ +#!/bin/bash +#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 '"'` + +echo $num_channels +echo "state | port_id | channel_id | cp_port_id | cp_channel_id " +echo "$state | $port_id | $channel_id | $cp_port_id | $cp_channel_id " +' +test_error() { +if [ "$1" = "" ] +then + echo "Previous command did not run properly. Exiting." + exit 1 +fi +} + + +binary_name="" +grpc_port="" +declare -a binary_arr=("quasarnoded" "osmosisd" "gaiad") +#declare -a binary_arr=("quasarnoded") + +for b in "${binary_arr[@]}" +do + binary_name=$b + echo " " + echo "### $binary_name ############################" + case "$binary_name" in + "quasarnoded") grpc_port="26659" + ;; + "osmosisd") grpc_port="26679" + ;; + "gaiad") grpc_port="26669" + ;; + esac + echo " " + echo "binary_name=$binary_name" + 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 + # 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" ]] + then + continue + fi + + echo " " + echo "### $conn ##########################" + nc=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels | length" | tr -d '"'` + test_error $nc + + ibc_client_id=`$binary_name q ibc connection end $conn --node tcp://localhost:$grpc_port -o json | jq '.connection.client_id' | tr -d '"'` + test_error $ibc_client_id + + ibc_cp_chainid=`$binary_name q ibc client state $ibc_client_id --node tcp://localhost:$grpc_port -o json | jq ".client_state.chain_id" | tr -d '""'` + test_error $ibc_cp_chainid + + ibc_cp_client_id=`$binary_name q ibc connection end $conn --node tcp://localhost:$grpc_port -o json | jq ".connection.counterparty.client_id" | tr -d '""'` + test_error $ibc_cp_client_id + + ibc_cp_conn_id=`$binary_name q ibc connection end $conn --node tcp://localhost:$grpc_port -o json | jq ".connection.counterparty.connection_id" | tr -d '""'` + test_error $ibc_cp_conn_id + + for (( i=0; i < $nc; ++i )) + do + port_id=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].port_id" | tr -d '"'` + test_error $port_id + + channel_id=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].channel_id" | tr -d '"'` + test_error $channel_id + + cp_port_id=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].counterparty.port_id" | tr -d '"'` + test_error $cp_port_id + + cp_channel_id=`$binary_name q ibc channel connections $conn --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].counterparty.channel_id" | tr -d '"'` + test_error $cp_channel_id + + state=`$binary_name q ibc channel channels --node tcp://localhost:$grpc_port -o json | jq ".channels[$i].state" | tr -d '"'` + test_error $state + + echo "### $channel_id #############################" + echo "number_of_channels=$nc" + echo "connection_id=$conn" + echo "client_id=$ibc_client_id" + echo "port_id=$port_id" + echo "channel_id=$channel_id" + echo "cp_chainid=$ibc_cp_chainid" + echo "cp_connection_id=$ibc_cp_conn_id" + echo "cp_client_id=$ibc_cp_client_id" + echo "cp_port_id=$cp_port_id" + echo "cp_channel_id=$cp_channel_id" + echo "channel_state=$state" + done # channel + done # connection +done # binary diff --git a/demos/local-integrated-setup/ibc_connection_status.sh b/demos/local-integrated-setup/ibc_connection_status.sh new file mode 100755 index 0000000..f63181b --- /dev/null +++ b/demos/local-integrated-setup/ibc_connection_status.sh @@ -0,0 +1,57 @@ +#!/bin/bash +#set -o xtrace + +# This script will output the connection-id, client-id and chain-id mapping fo the local testing environment. +# This is very useful to know which connections belongs to which counter party chain +# Note - A generic script with configurations can be created for the production monitoring and analysis." +declare -a conn_arr=("connection-0" "connection-1") + +test_error() { +if [ "$1" = "" ] +then + echo "Previous command did not run properly. Exiting." + exit 1 +fi +} + +echo " " +echo "QUASAR CONNECTIONS " +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 '"'` + 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 '""'` + test_error $ibc_q_cp_chainid + echo "cp chain id - $ibc_q_cp_chainid" +done + +echo " " +echo "OSMOSIS CONNECTIONS " +for i in "${conn_arr[@]}" +do + echo "##########################" + echo "connection-id - $i" + 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 '""'` + test_error $ibc_q_cp_chainid + echo "cp chain id - $ibc_q_cp_chainid" +done + +echo " " +echo "COSMOS CONNECTIONS " +for i in "${conn_arr[@]}" +do + echo "##########################" + echo "connection-id - $i" + 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 '""'` + 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 new file mode 100755 index 0000000..a9fe4e0 --- /dev/null +++ b/demos/local-integrated-setup/ibc_connection_status_with_bandchain.sh @@ -0,0 +1,58 @@ +#!/bin/bash +#set -o xtrace + +# This script will output the connection-id, client-id and chain-id mapping fo the local testing environment. +# This is very useful to know which connections belongs to which counter party chain +# Note - A generic script with configurations can be created for the production monitoring and analysis." +declare -a conn_arr=("connection-0" "connection-1" "connection-2") + +test_error() { +if [ "$1" = "" ] +then + echo "Previous command did not run properly. Exiting." + exit 1 +fi +} + +echo " " +echo "QUASAR CONNECTIONS " +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 '"'` + 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 '""'` + test_error $ibc_q_cp_chainid + echo "cp chain id - $ibc_q_cp_chainid" +done + +declare -a conn_arr=("connection-0" "connection-1") +echo " " +echo "OSMOSIS CONNECTIONS " +for i in "${conn_arr[@]}" +do + echo "##########################" + echo "connection-id - $i" + 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 '""'` + test_error $ibc_q_cp_chainid + echo "cp chain id - $ibc_q_cp_chainid" +done + +echo " " +echo "COSMOS CONNECTIONS " +for i in "${conn_arr[@]}" +do + echo "##########################" + echo "connection-id - $i" + 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 '""'` + 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 new file mode 100755 index 0000000..7eb810a --- /dev/null +++ b/demos/local-integrated-setup/kill_all.sh @@ -0,0 +1,31 @@ +#!/bin/sh + + +qpid=`ps -ef | grep quasarnoded | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$qpid" ] +then + echo "quasarnoded not running." +else + echo "quasarnoded is running with process id $qpid - killing" + pkill quasarnoded +fi + +opid=`ps -ef | grep osmosisd | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$opid" ] +then + echo "osmosisd not running" +else + echo "osmosisd is running with process id $opid - killing" + pkill osmosisd +fi + +gpid=`ps -ef | grep "gaiad" | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$gpid" ] +then + echo "gaiad not running" +else + echo "gaiad is running with process id $gpid - killing" + pkill gaiad +fi + + diff --git a/demos/local-integrated-setup/kill_n_clean.sh b/demos/local-integrated-setup/kill_n_clean.sh new file mode 100755 index 0000000..4c1e751 --- /dev/null +++ b/demos/local-integrated-setup/kill_n_clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -o xtrace + +./kill_all.sh +./clean_all_chains.sh diff --git a/demos/local-integrated-setup/osmo_localnet.sh b/demos/local-integrated-setup/osmo_localnet.sh new file mode 100755 index 0000000..08701de --- /dev/null +++ b/demos/local-integrated-setup/osmo_localnet.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +# 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="rabbit garlic monitor wish pony magic budget someone room torch celery empower word assume digital rack electric weapon urban foot sketch jelly wet myself" +ALICE_GENESIS_COINS=20000000uosmo,2000000000stake +BOB_GENESIS_COINS=10000000000000uosmo,1000000000stake +USER_1_GENESIS_COINS=10000000000stake,10000000000uosmo +USER_2_GENESIS_COINS=10000000000stake,10000000000uosmo +RELAYER_ACC_GENESIS_COINS=10000000uosmo + +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 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 platforms are supported, if you are using other platforms you should probably improve this script." + exit 1 +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.mint.params.mint_denom="uosmo"' | + jq '.app_state.poolincentives.params.minted_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"}' | + jq '.app_state.interchainaccounts.host_genesis_state.port="icahost"' | + jq '.app_state.interchainaccounts.host_genesis_state.params= + { + host_enabled:true, + allow_messages: [ + "/ibc.applications.transfer.v1.MsgTransfer", + "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + "/osmosis.gamm.v1beta1.MsgJoinPool", + "/osmosis.gamm.v1beta1.MsgExitPool", + "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn", + "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut", + "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut", + "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn", + "/osmosis.lockup.MsgLockTokens", + "/osmosis.lockup.MsgBeginUnlocking" + ] + }' \ + > $HOME_OSMOSIS/config/genesis.json + +# Start +$BINARY start --home $HOME_OSMOSIS > osmosis.log 2>&1 & diff --git a/demos/local-integrated-setup/osmosis.seeds b/demos/local-integrated-setup/osmosis.seeds new file mode 100644 index 0000000..771f703 --- /dev/null +++ b/demos/local-integrated-setup/osmosis.seeds @@ -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/local-integrated-setup/quasar.seeds b/demos/local-integrated-setup/quasar.seeds new file mode 100644 index 0000000..d47463a --- /dev/null +++ b/demos/local-integrated-setup/quasar.seeds @@ -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/local-integrated-setup/quasar_localnet.sh b/demos/local-integrated-setup/quasar_localnet.sh new file mode 100755 index 0000000..8b01d44 --- /dev/null +++ b/demos/local-integrated-setup/quasar_localnet.sh @@ -0,0 +1,133 @@ +#!/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 +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" +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="old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license" +ALICE_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 + +# Remove previous setup +rm -rf $HOME_QSR + +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID + +# Bootstrap the quasar local network with single node + +echo $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$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 = ""/minimum-gas-prices = "0uqsr"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 = ""/minimum-gas-prices = "0uatom"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="60s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' | + jq '.app_state.qoracle.params.bandchain_params.coin_rates_params.script_params.fee_limit[0].amount="200"' | + jq '.app_state.orion = { + "lpPosition": null, + "lpStat": null, + "params": { + "destination_chain_id": "osmosis", + "enabled": false, + "lp_epoch_id": "minute", + "mgmt_fee_per": "0.003000000000000000", + "osmosis_local_info": { + "chain_id": "osmosis", + "connection_id": "connection-1", + "local_zone_id": "osmosis-1" + }, + "perf_fee_per": "0.020000000000000000", + "white_listed_pools": [ + 1, + 2, + 3 + ] + }, + "rewardCollection": null + }' | + jq '.app_state.qbank = { + "claimableRewards": [], + "depositInfos": [], + "params": { + "enabled": true, + "min_orion_epoch_denom_dollar_deposit": "100.000000000000000000", + "orion_epoch_identifier": "minute", + "white_listed_denoms_in_orion": [ + { + "onehop_osmo": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", + "onehop_quasar": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", + "origin_name": "uatom" + } + ] + }, + "totalClaimedRewards": [], + "totalDeposits": [], + "totalWithdraws": [], + "withdrawables": [] + }' > $HOME_QSR/config/genesis.json + +# Start +$BINARY start --home $HOME_QSR > quasar.log 2>&1 & diff --git a/demos/local-integrated-setup/run_all_chains_with_gentx.sh b/demos/local-integrated-setup/run_all_chains_with_gentx.sh new file mode 100755 index 0000000..cbc437f --- /dev/null +++ b/demos/local-integrated-setup/run_all_chains_with_gentx.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +set -o xtrace + + +sleep 3 + +qpid=`ps -ef | grep quasarnoded | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$qpid" ] +then + echo "quasarnoded not running" +else + echo "quasarnoded is running with process id $qpid" +fi + +opid=`ps -ef | grep osmosisd | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$opid" ] +then + echo "osmosisd not running" +else + echo "osmosisd is running with process id $opid" +fi + +gpid=`ps -ef | grep "gaiad" | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$gpid" ] +then + echo "gaiad not running" +else + echo "gaiad is running with process id $gpid" +fi + +if [ ! -z "$qpid" ] || [ ! -z "$opid" ] || [ ! -z "$gpid" ] +then + echo "Some processes are already running." + exit 1 +fi + +./clean_all_chains.sh + +echo "----STARTING CHAIN PROCESSES----" +sleep 3 + +./quasar_localnet.sh +echo "-----------------------------------------" +sleep 3 +./osmo_localnet.sh +echo "-----------------------------------------" +sleep 3 +./cosmos_localnet.sh +echo "-----------------------------------------" + +sleep 10 + +exit 10 +#watch ./pid_running_status.sh + diff --git a/demos/local-integrated-setup/run_all_with_ignite.sh b/demos/local-integrated-setup/run_all_with_ignite.sh new file mode 100755 index 0000000..d8ab1c4 --- /dev/null +++ b/demos/local-integrated-setup/run_all_with_ignite.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +cd ~/quasar-demo/quasar +ignite chain serve -c demos/orion-manual-demo/quasar.yml --reset-once --home demos/orion-manual-demo/run/home/quasarnode/ -v > quasar.log 2>&1 & + +cd ~/quasar-demo/gaia +go mod tidy -go=1.16 && go mod tidy -go=1.17 +ignite chain serve -c ~/quasar-demo/quasar/demos/orion-manual-demo/cosmos.yml --reset-once --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/cosmos-hub/ -v > cosmos.log 2>&1 & + +cd ~/quasar-demo/osmosis +ignite chain serve -c ~/quasar-demo/quasar/demos/orion-manual-demo/osmosis.yml --reset-once --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/osmosis/ -v > osmosis.log 2>&1 & + + diff --git a/demos/local-integrated-setup/running_status.sh b/demos/local-integrated-setup/running_status.sh new file mode 100755 index 0000000..5554ec9 --- /dev/null +++ b/demos/local-integrated-setup/running_status.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +qpid=`ps -ef | grep quasarnoded | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$qpid" ] +then + echo "quasarnoded not running" +else + echo "quasarnoded is running with process id $qpid" +fi + +opid=`ps -ef | grep osmosisd | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$opid" ] +then + echo "osmosisd not running" +else + echo "osmosisd is running with process id $opid" +fi + +gpid=`ps -ef | grep "gaiad" | grep -v "grep" | awk '{ printf $2 }'` +if [ -z "$gpid" ] +then + echo "gaiad not running" +else + echo "gaiad is running with process id $gpid" +fi + +if [ -z "$qpid" ] || [ -z "$opid" ] || [ -z "$gpid" ] +then + echo "Some processes are not running." + exit 1 +else + echo "All processes are running." + exit 0 +fi + + + + + + + + + diff --git a/demos/local-testnet/README.md b/demos/local-testnet/README.md new file mode 100644 index 0000000..fe43044 --- /dev/null +++ b/demos/local-testnet/README.md @@ -0,0 +1,83 @@ +# Local testnet + +This demo tutorial demonstrates how to run a local testnet comprising an arbitrary number of validator nodes using docker. + +## Prerequisites + +* docker: [install guide](https://docs.docker.com/engine/install/) + +## Setup + +The default number of validator nodes is 4. +If you'd like to change that you can use the following command: + + export NUM_NODES=5 + +Then run the below command to initialize the configs for the local testnet: + + make local-testnet-init + +Finally, you can start/stop the local testnet using: + + make local-testnet-start + make local-testnet-stop + +To check if the nodes are successfully running, you can check their logs: + + sudo docker logs -f quasarnode0 + +In case of success, you should see new blocks every few seconds. +The nodes are numbered from 0 to NUM_NODES-1. + +## Running commands on the nodes + +### Quasar command on already running testnet + +To run a quasar command on a node while the testnet is running, use: + + make local-testnet-exec-quasar node= cmd= + +For example: + + make local-testnet-exec-quasar node=0 cmd='query bank total --denom=uqsr' + +### Quasar command on stopped testnet + +To run a quasar command on a node while the testnet is not running, use: + + make local-testnet-run-quasar node= cmd= + +For example: + + make local-testnet-run-quasar node=0 cmd='keys list --keyring-backend=test' + +### bash command on already running testnet + +To run a bash command on a node while the testnet is running, use: + + make local-testnet-exec-bash node= cmd= + +For example: + + make local-testnet-exec-bash node=0 cmd='ls' + +### bash command on stopped testnet + +To run a bash command on a node while the testnet is not running, use: + + make local-testnet-run-bash node= cmd= + +For example: + + make local-testnet-run-bash node=0 cmd='ls' + + +## Cleanup + +In order to stop the current local testnet and remove its file, use: + + make clean-local-testnet + +To do the same for all local testnets: + + make clean-all-local-testnet diff --git a/demos/orion-manual-demo/.gitignore b/demos/orion-manual-demo/.gitignore new file mode 100644 index 0000000..98d8a5a --- /dev/null +++ b/demos/orion-manual-demo/.gitignore @@ -0,0 +1 @@ +logs diff --git a/demos/orion-manual-demo/LP-strategy-demo.md b/demos/orion-manual-demo/LP-strategy-demo.md new file mode 100644 index 0000000..512835e --- /dev/null +++ b/demos/orion-manual-demo/LP-strategy-demo.md @@ -0,0 +1,15 @@ +# LP-strategy demo + +## Introduction +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. + +## 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. + +## what's where +The contract currently provides 2 entry points: `TransferJoinLock` and `DepositAndLockTokens`; `TransferJoinLock` is the entrypoint as expected to be used and called by the bookkeeping vault. `DepositAndLockTokens` allows for more parameters to be set by the caller. This message does not trigger a transfer. Eventually this will be removed and replaced with better testing setups. + +Internally, after one of the two initial execute messages is called, an ibc packet is dispatched, the sequence number is saved and an enum is saved. On the ibc ack, the original message's enum is looked up in the contracts state and a new ibc message is dispatched. The message are done in the following order. ibc_transfer -> join_pool_extern_swap_amount_in -> lock_tokens. ibc acks to transfer messages are provided by our local transfer decorator, found in `decorators/ibc_transfer_wasm_decorator.go` \ No newline at end of file diff --git a/demos/orion-manual-demo/band_testnet_init.sh b/demos/orion-manual-demo/band_testnet_init.sh new file mode 100755 index 0000000..45def38 --- /dev/null +++ b/demos/orion-manual-demo/band_testnet_init.sh @@ -0,0 +1,59 @@ +## This script helps to initialize accounts on the testnet of the band for test purposes. + +usage() { + echo "usage: $0 [-h | --use-faucet]" + exit +} + +while [ "$1" ]; +do + arg="$1" + case $arg in + --use-faucet) + shift + echo use_faucet + use_faucet=true + ;; + -h) + shift + usage + ;; + *) + shift + echo "error: unknown argument" + usage + ;; + esac +done + +# Configure variables +BINARY=bandd +HOME_BAND=$HOME/.band +CHAIN_ID=band +ALICE="use struggle faith reason method camp stay hair rabbit click across stadium there intact catalog segment drill summer oak tell tell success giraffe direct" +BOB="universe include catalog auction allow digital purity glimpse trash desert mom sea cry exchange question weekend post rival mutual scale staff law modify flee" +RELAYER_ACC="machine danger crush duck always will liberty popular security shoulder bargain day repair focus fog evoke market gossip love curious question kingdom armor crazy" + +# Remove previous setup +rm -rf $HOME_BAND + +# Bootstrap the quasar local network with single node + +echo $ALICE | $BINARY keys add alice --keyring-backend test --recover +echo $BOB | $BINARY keys add bob --keyring-backend test --recover +echo $RELAYER_ACC | $BINARY keys add relayer_acc --keyring-backend test --recover + +if [ "$use_faucet" = true ] +then + # Get some tokens from faucet + FAUCET_ADDR="https://laozi-testnet5.bandchain.org/faucet" + curl -X POST -d '{"address":"'$($BINARY keys show alice --keyring-backend test -a)'"}' $FAUCET_ADDR ; echo + curl -X POST -d '{"address":"'$($BINARY keys show bob --keyring-backend test -a)'"}' $FAUCET_ADDR ; echo + curl -X POST -d '{"address":"'$($BINARY keys show relayer_acc --keyring-backend test -a)'"}' $FAUCET_ADDR ; echo +fi + +# Check balances +RPC_ADDR="https://rpc.laozi-testnet5.bandchain.org:443" +$BINARY q bank balances $($BINARY keys show alice --keyring-backend test -a) --node $RPC_ADDR +$BINARY q bank balances $($BINARY keys show bob --keyring-backend test -a) --node $RPC_ADDR +$BINARY q bank balances $($BINARY keys show relayer_acc --keyring-backend test -a) --node $RPC_ADDR diff --git a/demos/orion-manual-demo/change_quasar_param.sh b/demos/orion-manual-demo/change_quasar_param.sh new file mode 100755 index 0000000..36d4dd3 --- /dev/null +++ b/demos/orion-manual-demo/change_quasar_param.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Configure variables +BINARY=quasarnoded +HOME_QSR=$HOME/.quasarnode +CHAIN_ID=quasar + +send_tx_get_output() { + $BINARY tx $@ --from alice --chain-id $CHAIN_ID --home "$HOME_QSR" --node tcp://localhost:26659 --keyring-backend test -y -b block -o json +} + +SUBMIT_PROPOSAL_OUTPUT=$(send_tx_get_output gov submit-proposal param-change quasar_denom_to_native_zone_id_map-proposal.json) +if [ "$(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.code')" != 0 ] +then + echo "error: $BINARY returned non-zero code" + echo "raw log: $(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.raw_log')" +fi + +PROPOSAL_ID=$(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.logs[0].events[]|select(.type=="submit_proposal").attributes[]|select(.key=="proposal_id").value' -r) +VOTE_OUTPUT=$(send_tx_get_output gov vote "$PROPOSAL_ID" yes) +if [ "$(echo "$VOTE_OUTPUT" | jq '.code')" != 0 ] +then + echo "error: $BINARY returned non-zero code" + echo "raw log: $(echo "$VOTE_OUTPUT" | jq '.raw_log')" +fi + +SUBMIT_PROPOSAL_OUTPUT=$(send_tx_get_output gov submit-proposal param-change osmosis_denom_to_quasar_denom_map-proposal.json) +if [ "$(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.code')" != 0 ] +then + echo "error: $BINARY returned non-zero code" + echo "raw log: $(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.raw_log')" +fi + +PROPOSAL_ID=$(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.logs[0].events[]|select(.type=="submit_proposal").attributes[]|select(.key=="proposal_id").value' -r) +VOTE_OUTPUT=$(send_tx_get_output gov vote "$PROPOSAL_ID" yes) +if [ "$(echo "$VOTE_OUTPUT" | jq '.code')" != 0 ] +then + echo "error: $BINARY returned non-zero code" + echo "raw log: $(echo "$VOTE_OUTPUT" | jq '.raw_log')" +fi + +SUBMIT_PROPOSAL_OUTPUT=$(send_tx_get_output gov submit-proposal param-change complete_zone_info_map-proposal.json --gas 1000000) +if [ "$(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.code')" != 0 ] +then + echo "error: $BINARY returned non-zero code" + echo "raw log: $(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.raw_log')" +fi + +PROPOSAL_ID=$(echo "$SUBMIT_PROPOSAL_OUTPUT" | jq '.logs[0].events[]|select(.type=="submit_proposal").attributes[]|select(.key=="proposal_id").value' -r) +VOTE_OUTPUT=$(send_tx_get_output gov vote "$PROPOSAL_ID" yes) +if [ "$(echo "$VOTE_OUTPUT" | jq '.code')" != 0 ] +then + echo "error: $BINARY returned non-zero code" + echo "raw log: $(echo "$VOTE_OUTPUT" | jq '.raw_log')" +fi diff --git a/demos/orion-manual-demo/complete_zone_info_map-proposal.json b/demos/orion-manual-demo/complete_zone_info_map-proposal.json new file mode 100644 index 0000000..4f4a9a5 --- /dev/null +++ b/demos/orion-manual-demo/complete_zone_info_map-proposal.json @@ -0,0 +1,59 @@ +{ + "title": "denom_to_native_zone_id_map Param Change", + "description": "Update CompleteZoneInfoMap", + "changes": [ + { + "subspace": "intergamm", + "key": "CompleteZoneInfoMap", + "value": { + "osmosis": { + "zone_route_info": { + "zone_id": "quasar", + "chain_id": "quasar", + "counterparty_zone_id": "osmosis", + "counterparty_chain_id": "osmosis", + "connection_id": "connection-1", + "port_id": "transfer", + "channel_id": "channel-1", + "counterparty_connection_id": "connection-0", + "counterparty_port_id": "transfer", + "counterparty_channel_id": "channel-1", + "counterparty_version": "" + }, + "next_zone_route_map": {} + }, + "cosmos": { + "zone_route_info": { + "zone_id": "quasar", + "chain_id": "quasar", + "counterparty_zone_id": "cosmos", + "counterparty_chain_id": "cosmos", + "connection_id": "connection-0", + "port_id": "transfer", + "channel_id": "channel-0", + "counterparty_connection_id": "connection-0", + "counterparty_port_id": "transfer", + "counterparty_channel_id": "channel-0", + "counterparty_version": "" + }, + "next_zone_route_map": { + "osmosis": { + "zone_id": "cosmos", + "chain_id": "cosmos", + "counterparty_zone_id": "osmosis", + "counterparty_chain_id": "osmosis", + "connection_id": "connection-1", + "port_id": "transfer", + "channel_id": "channel-1", + "counterparty_connection_id": "connection-1", + "counterparty_port_id": "transfer", + "counterparty_channel_id": "channel-0", + "counterparty_version": "" + } + } + } + } + } + ], + "deposit": "1uqsr" +} diff --git a/demos/orion-manual-demo/cosmos.yml b/demos/orion-manual-demo/cosmos.yml new file mode 100644 index 0000000..4742f11 --- /dev/null +++ b/demos/orion-manual-demo/cosmos.yml @@ -0,0 +1,31 @@ +accounts: + - name: alice + mnemonic: blur service enlist into false certain replace arrow until fatal glory mule design into dilemma palm helmet upper behave gallery into afford candy exercise + coins: ["20000000uatom", "2000000000stake"] + - name: bob + mnemonic: lucky surface version conduct ketchup cash unfair rival shoulder example demand upset deny tilt very clinic tribe rather renew skirt naive sweet box chicken + coins: ["10000000uatom", "1000000000stake"] + - name: relayer_acc + mnemonic: ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle + # corresponding address is cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc + coins: ["10000stake", "10000000uatom"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4502" + name: bob + coins: ["1000000uatom", "100000000stake"] +host: + rpc: ":26669" + p2p: ":26663" + prof: ":6063" + grpc: ":9097" + grpc-web: ":8093" + api: ":1313" + frontend: ":8083" + dev-ui: ":12353" +genesis: + chain_id: "cosmos" +#init: +# home: "${home_dir}" diff --git a/demos/orion-manual-demo/cosmos_localnet.sh b/demos/orion-manual-demo/cosmos_localnet.sh new file mode 100755 index 0000000..b362a32 --- /dev/null +++ b/demos/orion-manual-demo/cosmos_localnet.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +# Configure variables +BINARY=gaiad +HOME_COSMOSHUB=$HOME/.gaia +CHAIN_ID=cosmos +ALICE="blur service enlist into false certain replace arrow until fatal glory mule design into dilemma palm helmet upper behave gallery into afford candy exercise" +BOB="lucky surface version conduct ketchup cash unfair rival shoulder example demand upset deny tilt very clinic tribe rather renew skirt naive sweet box chicken" +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/gaia.key)" + +ALICE_GENESIS_COINS=200000000uatom,2000000000stake +BOB_GENESIS_COINS=10000000uatom,1000000000stake +USER_1_GENESIS_COINS=10000000000stake,10000000000uatom,10000000000uusd +USER_2_GENESIS_COINS=10000000000stake,10000000000uatom +RELAYER_ACC_GENESIS_COINS=10000000uatom,10000000000stake + +# Remove previous setup +rm -rf $HOME_COSMOSHUB + +# Bootstrap +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID --home $HOME_COSMOSHUB +echo $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY add-genesis-account $($BINARY keys show bob --keyring-backend test -a) $BOB_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY add-genesis-account $($BINARY keys show user1 --keyring-backend test -a) $USER_1_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY add-genesis-account $($BINARY keys show user2 --keyring-backend test -a) $USER_2_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY add-genesis-account $($BINARY keys show relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS --home $HOME_COSMOSHUB +$BINARY gentx alice 100000000uatom --chain-id $CHAIN_ID --keyring-backend test --home $HOME_COSMOSHUB +#$BINARY gentx bob 100000000uatom --chain-id $CHAIN_ID --keyring-backend test --home $HOME_COSMOSHUB +$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_COSMOSHUB/config/app.toml + sed -i 's/swagger = false/swagger = true/g' $HOME_COSMOSHUB/config/app.toml + sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/g' $HOME_COSMOSHUB/config/app.toml + sed -i 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26669"+g' $HOME_COSMOSHUB/config/config.toml + sed -i 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26669"+g' $HOME_COSMOSHUB/config/client.toml + sed -i 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26663"+g' $HOME_COSMOSHUB/config/config.toml + sed -i 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6063"+g' $HOME_COSMOSHUB/config/config.toml + sed -i 's+address = "0.0.0.0:9090"+address = "0.0.0.0:9097"+g' $HOME_COSMOSHUB/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8093"+g' $HOME_COSMOSHUB/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1313"+g' $HOME_COSMOSHUB/config/app.toml + sed -i 's+address = ":8080"+address = ":8083"+g' $HOME_COSMOSHUB/config/app.toml +elif [ $platform = 'macos' ]; then + sed -i'.original' -e 's/enable = false/enable = true/g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's/swagger = false/swagger = true/g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26669"+g' $HOME_COSMOSHUB/config/config.toml + sed -i'.original' -e 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26669"+g' $HOME_COSMOSHUB/config/client.toml + sed -i'.original' -e 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26663"+g' $HOME_COSMOSHUB/config/config.toml + sed -i'.original' -e 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6063"+g' $HOME_COSMOSHUB/config/config.toml + sed -i'.original' -e 's+address = "0.0.0.0:9090"+address = "0.0.0.0:9097"+g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8093"+g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1313"+g' $HOME_COSMOSHUB/config/app.toml + sed -i'.original' -e 's+address = ":8080"+address = ":8083"+g' $HOME_COSMOSHUB/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_COSMOSHUB/config/app.toml + sed -i '' 's/swagger = false/swagger = true/g' $HOME_COSMOSHUB/config/app.toml +fi + +cp $HOME_COSMOSHUB/config/genesis.json $HOME_COSMOSHUB/config/genesis_original.json +cat $HOME_COSMOSHUB/config/genesis_original.json | + jq '.app_state.crisis.constant_fee.denom="uatom"' | + jq '.app_state.staking.params.bond_denom="uatom"' | + jq '.app_state.mint.params.mint_denom="uatom"' | + jq '.app_state.liquidity.params.pool_creation_fee=[{denom:"uatom",amount:"1"}]' | + jq '.app_state.gov.deposit_params.min_deposit=[{denom:"uatom",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_COSMOSHUB/config/genesis.json + +# Start +$BINARY start --home $HOME_COSMOSHUB >> ./logs/cosmos_localnet.log 2>&1 diff --git a/demos/orion-manual-demo/create_and_execute_contract.sh b/demos/orion-manual-demo/create_and_execute_contract.sh new file mode 100755 index 0000000..e09a382 --- /dev/null +++ b/demos/orion-manual-demo/create_and_execute_contract.sh @@ -0,0 +1,120 @@ +#!/bin/sh + +set -e + +CHAIN_ID="quasar" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +RPC="http://127.0.0.1:26659" +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" +echo $NODE +# lock_period is 60 for 60 sec, in prod should be at least: 60 sec/min * 60 min/hr * 24hr * 14days "1209600" +# pool_id is hardcoded to 1 for this testing setup, expected to be done by the instantiater on local/testnet +# pool_denom should be looked up and hardcoded aswell +# base_denom: base_denom should be the denom of the token on osmosos, for now uosmo +# local_denom: the denom of the token used locally, in this testing case: the denom of the path transfer/channel-1/uosmo +# quote_denom is the denom other denom in the pool, stake for now +INIT1='{"lock_period":6,"pool_id":1,"pool_denom":"gamm/pool/1","base_denom":"uosmo","local_denom":"ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518","quote_denom":"stake","return_source_channel":"channel-0","transfer_channel":"channel-0","expected_connection":"connection-0"}' +INIT2='{"lock_period":6,"pool_id":2,"pool_denom":"gamm/pool/2","base_denom":"stake","local_denom":"ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878","quote_denom":"fakestake","return_source_channel":"channel-0","transfer_channel":"channel-0","expected_connection":"connection-0"}' +INIT3='{"lock_period":6,"pool_id":3,"pool_denom":"gamm/pool/3","base_denom":"fakestake","local_denom":"ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1","quote_denom":"uosmo","return_source_channel":"channel-0","transfer_channel":"channel-0","expected_connection":"connection-0"}' + +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) +CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') +echo "Got CODE_ID = $CODE_ID" + +echo "Deploying lp-strategy 1" +# 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]') +echo "Got address of deployed contract = $ADDR1" + +# quasarnoded tx wasm execute $ADDR1 '{"bond":{"id": "my-id"}}' -y --from alice --keyring-backend test --amount 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 $TXFLAG +sleep 2 + +echo "Deploying lp-strategy 2" + +# 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]') +# echo "Got address of deployed contract = $ADDR2" + +# sleep 6 + +# echo "Deploying lp-strategy 3" + +# 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]') +# echo "Got address of deployed contract = $ADDR3" + + +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 + +# rly transact channel quasar_osmosis --src-port "wasm.$ADDR2" --dst-port icqhost --order unordered --version icq-1 --override +# rly transact channel quasar_osmosis --src-port "wasm.$ADDR2" --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 + +# rly transact channel quasar_osmosis --src-port "wasm.$ADDR3" --dst-port icqhost --order unordered --version icq-1 --override +# rly transact channel quasar_osmosis --src-port "wasm.$ADDR3" --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 + +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) +# echo "bonding tokens, to replay: " +# echo $BOND +# $BOND + +VAULT_INIT='{"decimals":6,"symbol":"ORN","min_withdrawal":"1","name":"ORION","primitives":[{"address":"'$ADDR1'","weight":"0.5","init":{"l_p":'$INIT1'}}]}' +# {"address":"'$ADDR2'","weight":"0.333333333333","init":{"l_p":'$INIT2'}},{"address":"'$ADDR3'","weight":"0.333333333333","init":{"l_p":'$INIT3'}}]}' +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) + +VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value') + +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]') + +echo "Got address of deployed contract = $VAULT_ADDR (vault)" + +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 +sleep 5 +# 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 +# sleep 5 +# 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 1000ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518,1000ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878,1000ibc/391EB817CD435CDBDFC5C85301E06E1512800C98C0232E9C00AD95C77A73BFE1 + +echo "Sleeping for 80 seconds" +sleep 80 + +echo "Querying alice balance" +quasarnoded 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 "" + +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 + +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 + +cd - diff --git a/demos/orion-manual-demo/demo.md b/demos/orion-manual-demo/demo.md new file mode 100644 index 0000000..957523f --- /dev/null +++ b/demos/orion-manual-demo/demo.md @@ -0,0 +1,729 @@ +# Set up - +- Up the quasar chain +- Up the cosmos-hub chain +- Up the osmosis chain +- Relayer connect quasar and cosmos-hub +- Relayer connect quasar and osmosis +- Relayer connect osmosis and cosmos-hub + +# Scenarios +- IBC transfer 10000 uatom from cosmos-hub to quasar to alice account. +- IBC transfer 30000 uosmo from osmosis to quasar. +- Create pool uatom - usmo pool in osmosis. +- Deposit ibc uatom to orion vault using qbank for 7 days. And verify account balance. +- Deposit ibc uosmo to orion vault using qbank for 7 days. And verify account balance. +- Verify the Join pool is happening or not. +- Note down all the module accounts. + + +# Prerequisites +1. `go` version 1.19https://github.com/osmohttps://github.com/osmosis-labs/osmosishttps://github.com/osmosis-labs/osmosissis-labs/osmosis +2. The cosmos-hub `gaia` repo should be cloned from https://github.com/quasar-finance/gaia +3. The osmosis `osmosis` repo should be cloned from https://github.com/osmosis-labs/osmosis +4. The quasar `quasar` repo should be cloned from https://github.com/quasar-finance/quasar + +## Steps +- Create a demo directory in home directory. +- Clone a quasar and create a following directory structure. +```bash +mkdir quasar-demo +cd quasar-demo +``` +- clone quasar, gaia and osmosis. + + +## Up the quasar-chain, in the cloned quasar directory +```bash +cd quasar-demo/quasar/demos/orion-manual-demo/ +./quasar_localnet.sh +``` +You can do `tail -f quasar.log` to monitor quasar logs in a terminal. + +## Up the osmosis chain, in the cloned osmosis (with ica) directory +```bash +cd quasar-demo/quasar/demos/orion-manual-demo/ +./osmo_localnet.sh +``` +You can do `tail -f osmosis.log` to monitor osmosis logs in a terminal. + +## Up the cosmos-hub chain, in the gaid cloned directory +```bash +cd quasar-demo/quasar/demos/orion-manual-demo/ +./cosmos_localnet.sh +``` +You can do `tail -f osmosis.log` to monitor osmosis logs in a terminal. + +## Relayer setup + +### copy hermes config +```bash +cp ~/quasar-demo/quasar/demos/orion-manual-demo/hermes_config.toml ~/.hermes/config.toml +``` + +### hermes automatic setup + +It is sufficient to just run the following: +```bash +./run_hermes.sh +``` + +### hermes manual setup ; Recommended for new devs who want to understand each steps +### Hermes Key restore +```bash +hermes keys restore --mnemonic "jungle law popular reunion festival horn divorce quarter image gather october weird slide trend resource render abuse food tomorrow multiply price fun ask quarter" quasar +``` + +2022-06-01T06:24:07.459912Z INFO ThreadId(01) using default configuration from '/home/ak/.hermes/config.toml' +Success: Restored key 'testkey1' (quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew) on chain quasar + +```bash +hermes keys restore --mnemonic "blade trap agent boy note critic jazz nuclear eight lion pipe fresh tourist make broken inquiry close agree usual human stock move remain swim" cosmos +``` +2022-06-01T06:24:15.776985Z INFO ThreadId(01) using default configuration from '/home/ak/.hermes/config.toml' +Success: Restored key 'testkey2' (cosmos1lrelhs37akgz2wht0y377uerxjm9fh33ke3ksc) on chain cosmos + +```bash +hermes keys restore --mnemonic "act scale exhibit enough swamp vivid bleak eagle giggle brass desert debris network scrub hazard fame salon normal over between inform advance sick dinner" osmosis +``` + +2022-06-01T06:24:30.371926Z INFO ThreadId(01) using default configuration from '/home/ak/.hermes/config.toml' +Success: Restored key 'testkey3' (osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz) on chain osmosis + +### Connecting the chains + +### First pre-check relayer balances in each chain +```bash +quasarnoded 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 +``` +### Connect quasar and cosmos +```bash +hermes create connection quasar cosmos +``` + +- Expected Example Output - +- Connection handshake finished for [Connection { + delay_period: 0ns, + a_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "quasar", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: Some( + ConnectionId( + "connection-0", + ), + ), + }, + b_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "cosmos", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: Some( + ConnectionId( + "connection-0", + ), + ), + }, +}] + +Success: Connection { + delay_period: 0ns, + a_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "quasar", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: Some( + ConnectionId( + "connection-0", + ), + ), + }, + b_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "cosmos", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: Some( + ConnectionId( + "connection-0", + ), + ), + }, +} + + +- Post connection - check the relayer balances again; You will observe gas fee deduction +- Post connection - check the connection using hermes command. + +```bash +hermes query connections quasar +hermes query connections cosmos +hermes query connection end quasar connection-0 +hermes query connection end cosmos connection-0 +hermes query clients quasar +hermes query clients cosmos +hermes query client state quasar 07-tendermint-0 +hermes query client state cosmos 07-tendermint-0 +hermes query client state quasar 07-tendermint-1 +hermes query client connections quasar 07-tendermint-0 +hermes query client connections quasar 07-tendermint-1 +hermes query client connections cosmos 07-tendermint-0 +``` + + +### Connect quasar and osmosis +```bash +hermes create connection quasar osmosis +``` +- Expected output - + +Connection handshake finished for [Connection { + delay_period: 0ns, + a_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "quasar", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: Some( + ConnectionId( + "connection-1", + ), + ), + }, + b_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "osmosis", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: Some( + ConnectionId( + "connection-0", + ), + ), + }, +}] + +Success: Connection { + delay_period: 0ns, + a_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "quasar", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: Some( + ConnectionId( + "connection-1", + ), + ), + }, + b_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "osmosis", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: Some( + ConnectionId( + "connection-0", + ), + ), + }, +} + +- Post connection - check the relayer balances again; You will observe gas fee deduction +- Post connection - check the connection using hermes command. +```bash +hermes query connections quasar +hermes query connections cosmos +hermes query connection end quasar connection-0 +hermes query connection end cosmos connection-0 +hermes query clients quasar +hermes query clients cosmos +hermes query clients osmosis +hermes query client state quasar 07-tendermint-0 +hermes query client state quasar 07-tendermint-1 +hermes query client state cosmos 07-tendermint-0 +hermes query client state osmosis 07-tendermint-0 +hermes query client connections quasar 07-tendermint-0 +hermes query client connections quasar 07-tendermint-1 +hermes query client connections cosmos 07-tendermint-0 +``` + +### Connect osmosis and cosmos hub +```bash +hermes create connection osmosis cosmos +``` +- Expected output - + +Connection handshake finished for [Connection { + delay_period: 0ns, + a_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "osmosis", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: Some( + ConnectionId( + "connection-1", + ), + ), + }, + b_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "cosmos", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: Some( + ConnectionId( + "connection-1", + ), + ), + }, +}] + +Success: Connection { + delay_period: 0ns, + a_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "osmosis", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: Some( + ConnectionId( + "connection-1", + ), + ), + }, + b_side: ConnectionSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "cosmos", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: Some( + ConnectionId( + "connection-1", + ), + ), + }, +} + +- Post connection - check the relayer balances aganin; You will observe gas fee deduction +- Post connection - check the connection using hermes command. + +```bash +hermes query connections quasar +hermes query connections cosmos +hermes query connections osmosis +hermes query connection end quasar connection-0 +hermes query connection end quasar connection-1 +hermes query connection end cosmos connection-0 +hermes query connection end cosmos connection-1 +hermes query connection end osmosis connection-0 +hermes query connection end osmosis connection-1 + +hermes query clients quasar +hermes query clients cosmos +hermes query clients osmosis +hermes query client state quasar 07-tendermint-0 +hermes query client state quasar 07-tendermint-1 +hermes query client state cosmos 07-tendermint-0 +hermes query client state cosmos 07-tendermint-1 +hermes query client state osmosis 07-tendermint-0 +hermes query client state osmosis 07-tendermint-1 +hermes query client connections quasar 07-tendermint-0 +hermes query client connections quasar 07-tendermint-1 +hermes query client connections cosmos 07-tendermint-0 +hermes query client connections cosmos 07-tendermint-1 +hermes query client connections osmosis 07-tendermint-0 +hermes query client connections osmosis 07-tendermint-1 +``` + + +### IBC token transfer channel creation + +### Create token transfer channel between cosmos and quasar +``` +hermes create channel --port-a transfer --port-b transfer cosmos connection-0 +``` +- Expected output - +Success: Channel { + ordering: Unordered, + a_side: ChannelSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "cosmos", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: ConnectionId( + "connection-0", + ), + port_id: PortId( + "transfer", + ), + channel_id: Some( + ChannelId( + "channel-0", + ), + ), + version: None, + }, + b_side: ChannelSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "quasar", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: ConnectionId( + "connection-0", + ), + port_id: PortId( + "transfer", + ), + channel_id: Some( + ChannelId( + "channel-0", + ), + ), + version: None, + }, + connection_delay: 0ns, +} + +- Hermes query channel status post checks +``` +hermes query channels quasar +hermes query channels cosmos +hermes query channels osmosis +``` +### Create token transfer channel between cosmos and osmosis +``` +hermes create channel --port-a transfer --port-b transfer cosmos connection-1 +``` + +- Expected output - +Success: Channel { + ordering: Unordered, + a_side: ChannelSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "cosmos", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: ConnectionId( + "connection-1", + ), + port_id: PortId( + "transfer", + ), + channel_id: Some( + ChannelId( + "channel-1", + ), + ), + version: None, + }, + b_side: ChannelSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "osmosis", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: ConnectionId( + "connection-1", + ), + port_id: PortId( + "transfer", + ), + channel_id: Some( + ChannelId( + "channel-0", + ), + ), + version: None, + }, + connection_delay: 0ns, +} + +- Hermes query channel status post checks +``` +hermes query channels quasar +hermes query channels cosmos +hermes query channels osmosis +``` + +### Create token transfer channel between osmosis and quasar +``` +hermes create channel --port-a transfer --port-b transfer quasar connection-1 +``` + +Success: Channel { + ordering: Unordered, + a_side: ChannelSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "quasar", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-1", + ), + connection_id: ConnectionId( + "connection-1", + ), + port_id: PortId( + "transfer", + ), + channel_id: Some( + ChannelId( + "channel-1", + ), + ), + version: None, + }, + b_side: ChannelSide { + chain: BaseChainHandle { + chain_id: ChainId { + id: "osmosis", + version: 0, + }, + runtime_sender: Sender { .. }, + }, + client_id: ClientId( + "07-tendermint-0", + ), + connection_id: ConnectionId( + "connection-0", + ), + port_id: PortId( + "transfer", + ), + channel_id: Some( + ChannelId( + "channel-1", + ), + ), + version: None, + }, + connection_delay: 0ns, +} + +- Hermes query channel status post checks +``` +hermes query channels quasar +hermes query channels cosmos +hermes query channels osmosis +``` +### Detailed channel status commands + +With queries you should be able to track the associated self connection-id, self client-id, counterparty chain-id, counterparty client id, and counterparty connection-id + +Tracking Hint +- Channel ID - > [ Self - Connection ID, Counterparty port id, Counterparty channel id ]-> [ Client -ID, Counterparty clientid, Counterparty connection -id ] -> counterparty party Chain-ID + + +```bash +hermes query channel end quasar transfer channel-0 +hermes query channel end quasar transfer channel-1 + +hermes query channel end cosmos transfer channel-0 +hermes query channel end cosmos transfer channel-1 + +hermes query channel end osmosis transfer channel-0 +hermes query channel end osmosis transfer channel-1 +``` +### Start hermes + +```bash +hermes start +``` + +## IBC token transfer +- 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/ + osmosisd keys list --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/osmosis/ +``` + +- Prechecks account balances + +```bash +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 + +osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 +osmosisd q bank balances osmo1ez43ye5qn3q2zwh8uvswppvducwnkq6wjqc87d --node tcp://localhost:26679 + +``` +### IBC token transfer from cosmos to quasar +- Precheck account balances + +``` +gaiad q bank balances cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu --node tcp://localhost:26669 +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +``` + +- IBC transfer + +``` +gaiad tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 1000uatom --from alice --chain-id cosmos --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/cosmos-hub --node tcp://localhost:26669 + +``` +- Post check account balances +``` +gaiad q bank balances cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu --node tcp://localhost:26669 +quasarnoded 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 +``` + +- IBC Transfer + +``` +osmosisd tx ibc-transfer transfer transfer channel-1 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 100uosmo --from alice --chain-id osmosis --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/osmosis/ --node tcp://localhost:26679 +``` + +- Post check account balances + +``` +osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +``` + + +## Set the Price of in quasarnode +``` +quasarnoded tx qoracle stable-price ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 "1" --from alice --node tcp://localhost:26659 --chain-id quasar --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/quasarnode/ +``` + +## Request Deposit +``` +quasarnoded tx qbank request-deposit "MID" "orion" 110ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 Days_7 --from alice --node tcp://localhost:26659 --chain-id quasar --home ~/quasar-demo/quasar/demos/orion-manual-demo/run/home/quasarnode/ +``` +- Post check - +Note that, it will also packet forward the deposited tokens to osmosis via cosmos. Check the +osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq address for initial version ( hardcoded in code ) + +## Other sample commands +### Query port info from intergamm module +``` +quasarnoded q intergamm get-port-info osmosis transfer --node tcp://localhost:26659 +portInfo: + channelID: channel-2 + connectionID: connection-1 + counterpartyChannelID: channel-1 + portID: transfer +``` +``` +quasarnoded q intergamm get-port-info osmosis icacontroller-quasar14yjkz7yxapuee3d7qkhwzlumwrarayfh0pycxc --node tcp://localhost:26659 +portInfo: + channelID: channel-1 + connectionID: connection-1 + counterpartyChannelID: channel-2 + portID: icacontroller-quasar14yjkz7yxapuee3d7qkhwzlumwrarayfh0pycxc +``` diff --git a/demos/orion-manual-demo/deploy_and_test_ica.sh b/demos/orion-manual-demo/deploy_and_test_ica.sh new file mode 100755 index 0000000..3c1d1f0 --- /dev/null +++ b/demos/orion-manual-demo/deploy_and_test_ica.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +CHAIN_ID="quasar" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +# STAKE_DENOM="urock" +BECH32_HRP="quas" +WASMD_VERSION="v0.23.0" +CONFIG_DIR=".wasmd" +BINARY="wasmd" +COSMJS_VERSION="v0.27.1" +GENESIS_URL="https://raw.githubusercontent.com/CosmWasm/testnets/master/cliffnet-1/config/genesis.json" +RPC="http://127.0.0.1:26659" +# RPC="https://rpc.cliffnet.cosmwasm.com:443" +LCD="https://lcd.cliffnet.cosmwasm.com" +FAUCET="https://faucet.cliffnet.cosmwasm.com" +# https://rpc-edgenet.dev-osmosis.zone/ +# https://lcd-edgenet.dev-osmosis.zone/ +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" + +INIT="{}" +MSG='{"register_interchain_account":{"connection_id":"connection-1"}}' + +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) +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]') +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 + +cd - \ No newline at end of file diff --git a/demos/orion-manual-demo/forwarding-demo.md b/demos/orion-manual-demo/forwarding-demo.md new file mode 100644 index 0000000..16527fa --- /dev/null +++ b/demos/orion-manual-demo/forwarding-demo.md @@ -0,0 +1,28 @@ +This demo shows us how to set up an environment and test packet forwarding. + +1. Run the steps described in the `run_integrated_testnet.md` to initialize the chains and the channels between them. + +2. Check the initial balances +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +gaiad q bank balances cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu --node tcp://localhost:26669 +osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 +``` + +3. Transfer some atom to quasar and gaia +``` +gaiad tx ibc-transfer transfer transfer channel-0 "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" 100uatom --from alice --chain-id cosmos --home ~/.gaia/ --node tcp://localhost:26669 --keyring-backend test -y + +gaiad tx ibc-transfer transfer transfer channel-1 "osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq" 100uatom --from alice --chain-id cosmos --home ~/.gaia/ --node tcp://localhost:26669 --keyring-backend test -y +``` + +4. Optionally you can transfer some atom back to gaia to see if the quasar->gaia route works. +``` +quasarnoded tx ibc-transfer transfer transfer channel-0 "cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu" 5ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +``` + +5. Finally transfer some atom from quasar to osmosis via gaia +``` +quasarnoded tx ibc-transfer transfer transfer channel-0 "cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu|transfer/channel-1:osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq" 20ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +``` + diff --git a/demos/orion-manual-demo/go-relayer-config/chains/cosmos.json b/demos/orion-manual-demo/go-relayer-config/chains/cosmos.json new file mode 100644 index 0000000..90f7a47 --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-config/chains/cosmos.json @@ -0,0 +1,16 @@ +{ + "type": "cosmos", + "value": { + "key": "cosmoskey", + "chain-id": "cosmos", + "rpc-addr": "http://127.0.0.1:26669", + "account-prefix": "cosmos", + "keyring-backend": "test", + "gas-adjustment": 1.2, + "gas-prices": "0.01uatom", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-config/chains/osmosis.json b/demos/orion-manual-demo/go-relayer-config/chains/osmosis.json new file mode 100644 index 0000000..80d0389 --- /dev/null +++ b/demos/orion-manual-demo/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.3, + "gas-prices": "0.1uosmo", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-config/chains/quasar.json b/demos/orion-manual-demo/go-relayer-config/chains/quasar.json new file mode 100644 index 0000000..af02f5a --- /dev/null +++ b/demos/orion-manual-demo/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": 1.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-config/chains/simd.json b/demos/orion-manual-demo/go-relayer-config/chains/simd.json new file mode 100644 index 0000000..7446944 --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-config/chains/simd.json @@ -0,0 +1,16 @@ +{ + "type": "cosmos", + "value": { + "key": "quasarkey", + "chain-id": "simd", + "rpc-addr": "http://localhost:26659", + "account-prefix": "cosmos", + "keyring-backend": "test", + "gas-adjustment": 1.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-config/paths/cosmos_osmosis.json b/demos/orion-manual-demo/go-relayer-config/paths/cosmos_osmosis.json new file mode 100644 index 0000000..751a52f --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-config/paths/cosmos_osmosis.json @@ -0,0 +1,12 @@ +{ + "src": { + "chain-id": "cosmos" + }, + "dst": { + "chain-id": "osmosis" + }, + "src-channel-filter": { + "rule": null, + "channel-list": [] + } + } \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-config/paths/quasar_cosmos.json b/demos/orion-manual-demo/go-relayer-config/paths/quasar_cosmos.json new file mode 100644 index 0000000..8193478 --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-config/paths/quasar_cosmos.json @@ -0,0 +1,12 @@ +{ + "src": { + "chain-id": "quasar" + }, + "dst": { + "chain-id": "cosmos" + }, + "src-channel-filter": { + "rule": null, + "channel-list": [] + } + } \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-config/paths/quasar_osmosis.json b/demos/orion-manual-demo/go-relayer-config/paths/quasar_osmosis.json new file mode 100644 index 0000000..9cabcc0 --- /dev/null +++ b/demos/orion-manual-demo/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": [] + } +} \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-config/paths/simd_cosmos.json b/demos/orion-manual-demo/go-relayer-config/paths/simd_cosmos.json new file mode 100644 index 0000000..931f403 --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-config/paths/simd_cosmos.json @@ -0,0 +1,12 @@ +{ + "src": { + "chain-id": "simd" + }, + "dst": { + "chain-id": "cosmos" + }, + "src-channel-filter": { + "rule": null, + "channel-list": [] + } + } \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-config/paths/simd_osmosis.json b/demos/orion-manual-demo/go-relayer-config/paths/simd_osmosis.json new file mode 100644 index 0000000..34ac3e4 --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-config/paths/simd_osmosis.json @@ -0,0 +1,12 @@ +{ + "src": { + "chain-id": "simd" + }, + "dst": { + "chain-id": "osmosis" + }, + "src-channel-filter": { + "rule": null, + "channel-list": [] + } + } \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-cosmoshub.json b/demos/orion-manual-demo/go-relayer-cosmoshub.json new file mode 100644 index 0000000..b4d8a22 --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-cosmoshub.json @@ -0,0 +1,16 @@ +{ + "type": "cosmos", + "value": { + "key": "cosmokey", + "chain-id": "cosmos", + "rpc-addr": "http://127.0.0.1:26669", + "account-prefix": "cosmos", + "keyring-backend": "test", + "gas-adjustment": 1.2, + "gas-prices": "0.01uatom", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-osmosis.json b/demos/orion-manual-demo/go-relayer-osmosis.json new file mode 100644 index 0000000..399006f --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-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.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/orion-manual-demo/go-relayer-quasar.json b/demos/orion-manual-demo/go-relayer-quasar.json new file mode 100644 index 0000000..af02f5a --- /dev/null +++ b/demos/orion-manual-demo/go-relayer-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": 1.2, + "gas-prices": "0.01uqsr", + "debug": true, + "timeout": "20s", + "output-format": "json", + "sign-mode": "direct" + } +} \ No newline at end of file diff --git a/demos/orion-manual-demo/hermes_config.toml b/demos/orion-manual-demo/hermes_config.toml new file mode 100644 index 0000000..1b4bcff --- /dev/null +++ b/demos/orion-manual-demo/hermes_config.toml @@ -0,0 +1,174 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'info' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = false + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'cosmos' +rpc_addr = 'http://127.0.0.1:26669' +grpc_addr = 'http://127.0.0.1:9097' +websocket_addr = 'ws://127.0.0.1:26669/websocket' +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'cosmoskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uatom' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +# [[chains]] +# id = 'band-laozi-testnet5' +# rpc_addr = 'https://rpc.laozi-testnet5.bandchain.org:443' +# grpc_addr = 'https://laozi-testnet5.bandchain.org' +# websocket_addr = 'ws://rpc.laozi-testnet5.bandchain.org:443/websocket' +# rpc_timeout = '10s' +# account_prefix = 'band' +# key_name = 'bandkey' +# store_prefix = 'ibc' +# default_gas = 100000 +# max_gas = 3000000 +# gas_price = { price = 0.001, denom = 'uband' } +# gas_multiplier = 1.1 +# max_msg_num = 30 +# max_tx_size = 2097152 +# clock_drift = '5s' +# max_block_time = '10s' +# trusting_period = '14days' +# trust_threshold = { numerator = '1', denominator = '3' } +# address_type = { derivation = 'cosmos' } \ No newline at end of file diff --git a/demos/orion-manual-demo/host_mapping.md b/demos/orion-manual-demo/host_mapping.md new file mode 100644 index 0000000..bd17d82 --- /dev/null +++ b/demos/orion-manual-demo/host_mapping.md @@ -0,0 +1,78 @@ +config.yaml host section configuration ip address maps according to below mapping. + +host: +1. rpc address + +config.yml +rpc: ":26659" + +config.toml: +[rpc] +# TCP or UNIX socket address for the RPC server to listen on +laddr = "tcp://0.0.0.0:26659" + +2. p2p address + +config.yml +p2p: ":26661" + +config.toml: +[p2p] + +# Address to listen for incoming connections +laddr = "tcp://0.0.0.0:26661" + +3. prof +config.yml +prof: ":6061" + +config.toml: +# pprof listen address (https://golang.org/pkg/net/http/pprof) +pprof_laddr = ":6061" + +4. grpc + +config.yml +grpc: ":9095" + +app.toml +[grpc] + address = ":9095" + enable = true + +5. grpc-web + +config.yml +grpc-web: ":8091" + +app.toml +[grpc-web] + address = ":8091" + +6. api + +config.yml + api: ":1311" + +app.toml +[api] + address = "tcp://0.0.0.0:1311" + +7. frontend + +config.yml +frontend: ":8081" +dev-ui: ":12351" + +no mapping in the config directory. These two are specific to frontend application. + + +### for this demo + +field | default | quasar | cosmos hub | osmosis +rpc | 26657 | 26659 | 26669 | 26679 +p2p | 26656 | 26661 | 26663 | 26662 +prof | 6060 | 6061 | 6063 | 6062 +grpc | 9090 | 9095 | 9097 | 9096 +grpc-web| 9091 | 8081 | 8093 | 8092 +api | 1313 | 1311 | 1313 | 1312 diff --git a/demos/orion-manual-demo/keys/gaia.key b/demos/orion-manual-demo/keys/gaia.key new file mode 100644 index 0000000..a8cddb0 --- /dev/null +++ b/demos/orion-manual-demo/keys/gaia.key @@ -0,0 +1 @@ +ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle diff --git a/demos/orion-manual-demo/keys/osmo.key b/demos/orion-manual-demo/keys/osmo.key new file mode 100644 index 0000000..771f703 --- /dev/null +++ b/demos/orion-manual-demo/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/orion-manual-demo/keys/qsr.key b/demos/orion-manual-demo/keys/qsr.key new file mode 100644 index 0000000..d47463a --- /dev/null +++ b/demos/orion-manual-demo/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/orion-manual-demo/monitor.sh b/demos/orion-manual-demo/monitor.sh new file mode 100755 index 0000000..9fa48f1 --- /dev/null +++ b/demos/orion-manual-demo/monitor.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "Health Check..." + +hermes health-check diff --git a/demos/orion-manual-demo/osmo_localnet.sh b/demos/orion-manual-demo/osmo_localnet.sh new file mode 100755 index 0000000..fd66f15 --- /dev/null +++ b/demos/orion-manual-demo/osmo_localnet.sh @@ -0,0 +1,203 @@ +#!/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 +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 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.mint = { + minter: { + epoch_provisions: "0.000000000000000000" + }, + params: { + distribution_proportions: { + community_pool: "0.100000000000000000", + developer_rewards: "0.200000000000000000", + pool_incentives: "0.300000000000000000", + staking: "0.400000000000000000" + }, + epoch_identifier: "day", + genesis_epoch_provisions: "5000000.000000000000000000", + mint_denom: "uosmo", + minting_rewards_distribution_start_epoch: "0", + reduction_factor: "0.500000000000000000", + reduction_period_in_epochs: "156", + weighted_developer_rewards_receivers: [] + } + }' | + jq '.app_state.incentives = { + last_gauge_id: "0", + lockable_durations: [ + "1s", + "120s", + "180s", + "240s" + ], + params: { + distr_epoch_identifier: "day" + } + }' | + jq '.app_state.poolincentives = { + distr_info: { + records: [ + { + gauge_id: "0", + weight: "10000" + }, + { + gauge_id: "1", + weight: "1000" + }, + { + gauge_id: "2", + weight: "100" + } + ], + total_weight: "11100" + }, + lockable_durations: [ + "120s", + "180s", + "240s" + ], + params: { + minted_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"}' | + jq '.app_state.interchainaccounts = { + host_genesis_state: { + port: "icahost", + params: { + host_enabled: true, + allow_messages: [ + "/ibc.applications.transfer.v1.MsgTransfer", + "/cosmos.bank.v1beta1.MsgSend", + "/cosmos.staking.v1beta1.MsgDelegate", + "/cosmos.staking.v1beta1.MsgBeginRedelegate", + "/cosmos.staking.v1beta1.MsgCreateValidator", + "/cosmos.staking.v1beta1.MsgEditValidator", + "/cosmos.staking.v1beta1.MsgUndelegate", + "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + "/cosmos.gov.v1beta1.MsgVote", + "/osmosis.gamm.v1beta1.MsgJoinPool", + "/osmosis.gamm.v1beta1.MsgExitPool", + "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn", + "/osmosis.gamm.v1beta1.MsgSwapExactAmountOut", + "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn", + "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut", + "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut", + "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn", + "/osmosis.lockup.MsgBeginUnlocking", + "/osmosis.lockup.MsgLockTokens", + "/osmosis.superfluid.MsgSuperfluidUnbondLock" + ] + } + } + }' | + jq '.app_state.interchainquery = { + host_port: "icqhost", + params: { + host_enabled: true, + allow_queries: [ + "/cosmos.bank.v1beta1.Query/AllBalances", + "/cosmos.bank.v1beta1.Query/Balance", + "/osmosis.epochs.v1beta1.Query/EpochInfos", + "/osmosis.gamm.v1beta1.Query/Pool", + "/osmosis.gamm.v1beta1.Query/CalcJoinPoolShares", + "/osmosis.gamm.v1beta1.Query/CalcExitPoolCoinsFromShares", + "/osmosis.gamm.v2.Query/SpotPrice", + "/osmosis.poolincentives.v1beta1.Query/LockableDurations", + "/osmosis.mint.v1beta1.Query/Params", + "/osmosis.mint.v1beta1.Query/EpochProvisions", + "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools", + "/osmosis.poolincentives.v1beta1.Query/GaugeIds", + "/osmosis.poolincentives.v1beta1.Query/DistrInfo" + ] + } + }' \ + >$HOME_OSMOSIS/config/genesis.json + +# Start +$BINARY start --home $HOME_OSMOSIS >>./logs/osmo_localnet.log 2>&1 diff --git a/demos/orion-manual-demo/osmosis.yml b/demos/orion-manual-demo/osmosis.yml new file mode 100644 index 0000000..b0ca8c6 --- /dev/null +++ b/demos/orion-manual-demo/osmosis.yml @@ -0,0 +1,34 @@ +version: 1 +accounts: + - name: alice + mnemonic: cruise scene law sea push expose scorpion wire trick repair wave quote task dose inner denial alpha favorite certain blouse motion flash split lunch + coins: ["20000000000000uosmo", "200000000000stake"] + - name: bob + mnemonic: lizard garlic canyon winner cheese tent drip task because ecology clay bridge junk critic track artefact gather harsh deliver unit vacant earth diesel stool + coins: ["1000000000000000uosmo", "1000000000stake"] + - name: relayer_acc + 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 + # corresponding address is osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz + coins: ["100000stake", "10000000000000uosmo"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4501" + name: bob + coins: ["100000000000uosmo", "100000000stake"] +host: + rpc: ":26679" + p2p: ":26662" + prof: ":6062" + grpc: ":9096" + grpc-web: ":8092" + api: ":1312" + frontend: ":8082" + dev-ui: ":12352" +genesis: + chain_id: "osmosis" +#init: +# home: "${home_dir}" +build: + main: "cmd/osmosisd" diff --git a/demos/orion-manual-demo/osmosis_denom_to_quasar_denom_map-proposal.json b/demos/orion-manual-demo/osmosis_denom_to_quasar_denom_map-proposal.json new file mode 100644 index 0000000..7edba59 --- /dev/null +++ b/demos/orion-manual-demo/osmosis_denom_to_quasar_denom_map-proposal.json @@ -0,0 +1,16 @@ +{ + "title": "osmosis_denom_to_quasar_denom_map Param Change", + "description": "Update OsmosisDenomToQuasarDenomMap", + "changes": [ + { + "subspace": "intergamm", + "key": "OsmosisDenomToQuasarDenomMap", + "value": { + "ibc/C18695C91D20F11FEE3919D7822B34651277CA84550EF33379E823AD9702B257": "uqsr", + "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", + "uosmo": "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B" + } + } + ], + "deposit": "1uqsr" +} diff --git a/demos/orion-manual-demo/quasar.yml b/demos/orion-manual-demo/quasar.yml new file mode 100644 index 0000000..b43ee19 --- /dev/null +++ b/demos/orion-manual-demo/quasar.yml @@ -0,0 +1,87 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000token", "200000000stake", "1000000000uqsr"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000token", "100000000stake", "1000000000uqsr"] + - name: relayer_acc + mnemonic: old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license + # corresponding address is quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew + coins: ["1000000stake", "100000000uqsr"] +validator: + name: alice + staked: "100000000uqsr" +genesis: + chain_id: "quasar" + app_state: + staking: + params: + bond_denom: uqsr + intergamm: + params: + osmo_token_transfer_channels: + osmosis-test: channel-1 + osmosis: channel-1 + dest_to_intr_zone_map: + osmosis-01: cosmos + intr_rcvrs: + - zone_info: + chain_id: 'cosmos' + connection_id: 'connection-02' + rcvr_address: 'cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu' + next_zone_route_map: + osmosis-01: + local_zone_id: osmosis-01 + connection_id: 'connection-01' + chain_id: "osmosis" + transfer_channel_id: "channel-01" + osmosis-02: + local_zone_id: osmosis-02 + connection_id: 'connection-02' + chain_id: "osmosis2" + transfer_channel_id: "channel-02" + orion: + params: + enabled: false + lp_epoch_id: day #override day for testing + mgmt_fee_per: '0.003000000000000000' + perf_fee_per: '0.020000000000000000' + destination_chain_id: osmosis + white_listed_pools : [1,2,3] + osmosis_local_info: + local_zone_id : osmosis-01 + chain_id: 'osmosis' + connection_id: 'connection-01' + qoracle: + params: + oracleAccounts: 'quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec' + qbank: + params: + enabled: true + min_orion_epoch_denom_dollar_deposit: '100.000000000000000000' + orion_epoch_identifier: day #override day for testing + white_listed_denoms_in_orion: + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + origin_name: uatom + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: uqsr + origin_name: uqsr +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +#client: +# openapi: +# path: "docs/client/static/openapi/openapi.yml" +# vuex: +# path: "vue/src/store" +faucet: + name: bob + coins: ["5token", "100000stake", "10000uqsr"] diff --git a/demos/orion-manual-demo/quasar_denom_to_native_zone_id_map-proposal.json b/demos/orion-manual-demo/quasar_denom_to_native_zone_id_map-proposal.json new file mode 100644 index 0000000..49a4519 --- /dev/null +++ b/demos/orion-manual-demo/quasar_denom_to_native_zone_id_map-proposal.json @@ -0,0 +1,16 @@ +{ + "title": "quasar_denom_to_native_zone_id_map Param Change", + "description": "Update QuasarDenomToNativeZoneIdMap", + "changes": [ + { + "subspace": "intergamm", + "key": "QuasarDenomToNativeZoneIdMap", + "value": { + "uqsr": "quasar", + "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2": "cosmos", + "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B": "osmosis" + } + } + ], + "deposit": "1uqsr" +} diff --git a/demos/orion-manual-demo/quasar_localnet.sh b/demos/orion-manual-demo/quasar_localnet.sh new file mode 100755 index 0000000..3edff81 --- /dev/null +++ b/demos/orion-manual-demo/quasar_localnet.sh @@ -0,0 +1,136 @@ +#!/bin/sh + +## 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 +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" +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)" + +ALICE_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 $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$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 = ""/minimum-gas-prices = "0uqsr"/g' $HOME_QSR/config/app.toml + sed -i 's/query_gas_limit = 300000/query_gas_limit = 800000/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 = ""/minimum-gas-prices = "0uatom"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 + 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 +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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="60s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' | + jq '.app_state.orion = { + "lpPosition": null, + "lpStat": null, + "params": { + "destination_chain_id": "osmosis", + "enabled": true, + "lp_epoch_id": "minute", + "mgmt_fee_per": "0.003000000000000000", + "osmosis_local_info": { + "chain_id": "osmosis", + "connection_id": "connection-1", + "local_zone_id": "osmosis-1" + }, + "perf_fee_per": "0.020000000000000000", + "white_listed_pools": [ + 1, + 2, + 3 + ] + }, + "rewardCollection": null + }' | + jq '.app_state.qbank = { + "claimableRewards": [], + "depositInfos": [], + "params": { + "enabled": true, + "min_orion_epoch_denom_dollar_deposit": "100.000000000000000000", + "orion_epoch_identifier": "minute", + "white_listed_denoms_in_orion": [ + { + "onehop_osmo": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", + "onehop_quasar": "ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC", + "origin_name": "uatom" + } + ] + }, + "totalClaimedRewards": [], + "totalDeposits": [], + "totalWithdraws": [], + "withdrawables": [] + }' > $HOME_QSR/config/genesis.json + +# Start +$BINARY start --home $HOME_QSR >> ./logs/quasar_localnet.log 2>&1 diff --git a/demos/orion-manual-demo/run_all.sh b/demos/orion-manual-demo/run_all.sh new file mode 100755 index 0000000..ca74436 --- /dev/null +++ b/demos/orion-manual-demo/run_all.sh @@ -0,0 +1,85 @@ +#!/bin/sh + +# trap ctrl-c and ctrl-d +cleanup() +{ + kill $COSMOS_PID + kill $OSMO_PID + kill $QUASAR_PID + kill $HERMES_PID + kill $RLY_PID_1 + kill $RLY_PID_2 + kill $RLY_PID_3 + +} + +trap cleanup 1 2 3 6 + +# reset logs dir +rm -rf ./logs +mkdir ./logs + +# run cosmos and save pid +./cosmos_localnet.sh & +COSMOS_PID=$! + +# run quasar and save pid +./quasar_localnet.sh & +QUASAR_PID=$! + +#run osmo and save pid +./osmo_localnet.sh & +OSMO_PID=$! + +# wait for chains to start +sleep 10 + +# create a pool on osmosis to test against +osmosisd tx gamm create-pool --pool-file ./sample_pool1.json --node http://127.0.0.1:26679 --from bob --keyring-backend test --home $HOME/.osmosis --chain-id osmosis -y --gas-prices 1uosmo +sleep 6 +osmosisd tx gamm create-pool --pool-file ./sample_pool2.json --node http://127.0.0.1:26679 --from bob --keyring-backend test --home $HOME/.osmosis --chain-id osmosis -y --gas-prices 1uosmo +sleep 6 +osmosisd tx gamm create-pool --pool-file ./sample_pool3.json --node http://127.0.0.1:26679 --from bob --keyring-backend test --home $HOME/.osmosis --chain-id osmosis -y --gas-prices 1uosmo + +# run hermes and save pid, run_hermes and setup_go_relayer might not relay over the same channel out of the box due to connection creation in both scripts +# ./run_hermes.sh & + +# Currently we're not using Hermes due to an issue with relaying new channels https://github.com/informalsystems/ibc-rs/issues/2608 + + +# setup and run hermes +./run_hermes_v1.sh + +# echo "starting hermes" +hermes start >> ./logs/hermes_start.log 2>&1 & +HERMES_PID=$! + +echo "setting up go relayer" +./setup_go_relayer.sh + +echo "starting go relaying" +# run an instance of go relayer for each path, thus 3 in total +rly start quasar_cosmos --debug-addr "localhost:7597" --time-threshold 300s -p events >> ./logs/quasar_cosmos_rly.log 2>&1 & +RLY_PID_1=$! + +rly start quasar_osmosis --debug-addr "localhost:7598" -p events --time-threshold 300s >> ./logs/quasar_osmosis.log 2>&1 & +RLY_PID_2=$! + +rly start cosmos_osmosis --debug-addr "localhost:7599" -p events >> ./logs/cosmos_osmosis.log 2>&1 & +RLY_PID_3=$! + +echo "ibc transferring uosmo" +osmosisd tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10001uosmo --from bob --keyring-backend test --home $HOME/.osmosis --node http://127.0.0.1:26679 --chain-id osmosis -y --gas-prices 1uosmo +sleep 6 +osmosisd tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10002stake --from bob --keyring-backend test --home $HOME/.osmosis --node http://127.0.0.1:26679 --chain-id osmosis -y --gas-prices 1uosmo +sleep 6 +osmosisd tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 100003fakestake --from bob --keyring-backend test --home $HOME/.osmosis --node http://127.0.0.1:26679 --chain-id osmosis -y --gas-prices 1uosmo + + +sleep 20 + +quasarnoded query bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec + +echo "setup ready for use" + +wait \ No newline at end of file diff --git a/demos/orion-manual-demo/run_contract.sh b/demos/orion-manual-demo/run_contract.sh new file mode 100644 index 0000000..b2936e5 --- /dev/null +++ b/demos/orion-manual-demo/run_contract.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +CHAIN_ID="quasar" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +# STAKE_DENOM="urock" +BECH32_HRP="quas" +WASMD_VERSION="v0.23.0" +CONFIG_DIR=".wasmd" +BINARY="wasmd" +COSMJS_VERSION="v0.27.1" +GENESIS_URL="https://raw.githubusercontent.com/CosmWasm/testnets/master/cliffnet-1/config/genesis.json" +RPC="http://127.0.0.1:26659" +# RPC="https://rpc.cliffnet.cosmwasm.com:443" +LCD="https://lcd.cliffnet.cosmwasm.com" +FAUCET="https://faucet.cliffnet.cosmwasm.com" +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" +echo $RPC +echo $NODE +INIT="{}" +MSG='{"register_interchain_account":{"connection_id":"1"}}' + +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) +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]') +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 + +cd - \ No newline at end of file diff --git a/demos/orion-manual-demo/run_go_relayer.sh b/demos/orion-manual-demo/run_go_relayer.sh new file mode 100755 index 0000000..e572c58 --- /dev/null +++ b/demos/orion-manual-demo/run_go_relayer.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# restore the keys from the mnemomic phrases, same phrases as the hermes script +rly keys restore cosmos cosmokey "old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license" +rly keys restore quasar quasarkey "ready hundred phrase theme bar breeze zone system bitter double flush deposit sugar swap burger outside primary nature attend caught wire ticket depth cycle" +rly keys restore osmosis osmokey "rabbit garlic monitor wish pony magic budget someone room torch celery empower word assume digital rack electric weapon urban foot sketch jelly wet myself" + +rly q balance quasar +rly q balance cosmos +rly q balance osmosis + +rly chains add -f go-relayer-quasar.json quasar +rly chains add -f go-relayer-cosmoshub.json cosmos +rly chains add -f go-relayer-osmosis.json osmosis + diff --git a/demos/orion-manual-demo/run_hermes_v1.sh b/demos/orion-manual-demo/run_hermes_v1.sh new file mode 100755 index 0000000..97de22e --- /dev/null +++ b/demos/orion-manual-demo/run_hermes_v1.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +cp ./hermes_config.toml ~/.hermes/config.toml + +hermes keys add --chain quasar --mnemonic-file keys/qsr.key + +hermes keys add --chain cosmos --mnemonic-file keys/gaia.key + +hermes keys add --chain osmosis --mnemonic-file keys/osmo.key + + +# BANDCHAIN="band-laozi-testnet5" +# 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 +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 + + +# # Create connection +# hermes create connection --a-chain quasar --b-chain cosmos + +# hermes create connection --a-chain quasar --b-chain osmosis + +# hermes create connection --a-chain osmosis --b-chain cosmos + +# hermes create connection quasar $BANDCHAIN + +# Create channel + +# hermes create channel --a-chain cosmos --a-connection connection-0 --a-port transfer --b-port transfer + +# hermes create channel --a-chain cosmos --a-connection connection-1 --a-port transfer --port-b transfer + +# hermes create channel --a-chain quasar --a-connection connection-1 --a-port transfer --port-b transfer + +# hermes create channel --port-a qoracle --port-b oracle quasar connection-2 -v bandchain-1 \ No newline at end of file diff --git a/demos/orion-manual-demo/run_integrated_testnet.md b/demos/orion-manual-demo/run_integrated_testnet.md new file mode 100644 index 0000000..a8bb0be --- /dev/null +++ b/demos/orion-manual-demo/run_integrated_testnet.md @@ -0,0 +1,32 @@ +This demo describes how to run local quasar, osmosis, and gaia chains, +and how to connect them to each other and to the band testnet using hermes IBC relayer. + +1. Clone quasar-finance fork of gaia and checkout `bugfix/replace_default_transfer_with_router_module` branch, then cd into it. +``` +git clone git@github.com:quasar-finance/gaia.git -b bugfix/replace_default_transfer_with_router_module +cd gaia +``` + +2. Update the dependencies with `go mod download` and rebuild gaia with `make install` + +3. Clone osmosis and band, and build them with `make install`. Also rebuild quasar if not updated. +``` +cd .. +git clone git@github.com:bandprotocol/chain.git band +cd band +make install +cd .. +git clone git@github.com:osmosis-labs/osmosis.git +cd osmosis +make install +``` + +4. Go into quasar dir and then into `demos/orion-manual-demo` + +5. Run `band_testnet_init.sh` to initialize local config for band testnet. + +6. Run `quasar_localnet.sh`, `osmo_localnet.sh`, and `cosmos_localnet.sh` in 3 separate terminals. + Wait until all of them are initialized and recording blocks. + +7. Run `run_hermes.sh` in a separate terminal. Wait until you see "INFO ThreadId(01) Hermes has started" message. + diff --git a/demos/orion-manual-demo/run_primitive_and_vault.sh b/demos/orion-manual-demo/run_primitive_and_vault.sh new file mode 100755 index 0000000..071b619 --- /dev/null +++ b/demos/orion-manual-demo/run_primitive_and_vault.sh @@ -0,0 +1,105 @@ +#!/bin/sh + +set -e + +CHAIN_ID="quasar" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +RPC="http://127.0.0.1:26659" +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" +echo $NODE +# duration is 60 sec/min * 60 min/hr * 24hr * 14days "1209600" +# pool_id is hardcoded to 1 for this testing setup, expected to be done by the instantiater on local/testnet +# pool_denom should be looked up and hardcoded aswell +# base_denom: base_denom should be the denom of the token on osmosos, for now uosmo +# local_denom: the denom of the token used locally, in this testing case: the denom of the path transfer/channel-1/uosmo +# quote_denom is the denom other denom in the pool, stake for now +INIT='{"lock_period":60,"pool_id":1,"pool_denom":"gamm/pool/1","base_denom":"uosmo","local_denom":"ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518","quote_denom":"stake","return_source_channel":"channel-0","transfer_channel":"channel-0"}' + +cd ../../smart-contracts/contracts/lp-strategy + +RUSTFLAGS='-C link-arg=-s' cargo wasm +# 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 + +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) +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]') +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') + +echo $CADDR + +# trim CADDR by one character on both sides +CADDR2=$(echo $CADDR | cut -c 2- | rev | cut -c 2- | rev) + +AMOUNT="100000uosmo" +HOME_OSMOSIS=$HOME/.osmosis +# echo $CADDR +# echo "preloading the ICA address with $AMOUNT to play around with" +BANTX=$(osmosisd tx bank send bob $CADDR2 $AMOUNT -y --keyring-backend test --node tcp://localhost:26679 --chain-id osmosis --gas 583610 --home $HOME_OSMOSIS) +# BANKTX=$(printf 'osmosisd tx bank send bob %s %s -y --keyring-backend test --node tcp://localhost:26679 --chain-id osmosis --gas 583610 --home %s' $CADDR $AMOUNT $HOME_OSMOSIS) +# echo $BANTX +# $BANKTX + +echo "joining pool and locking all lp tokens using preloaded funds" + +JOINMSG=$(printf '{ + "deposit_and_lock_tokens": { + "amount": "1000", + "denom": "uosmo", + "pool_id": 1, + "share_out_min_amount": "1" + } +}') + +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 + +## MULTI ASSET VAULT ZONE +echo "Starting multi-asset vault init" + +VAULT_INIT='{"decimals":6,"symbol":"ORN","min_withdrawal":"1","name":"ORION","primitives":[{"address":"'$ADDR'","weight":"1.0","init":{"l_p":'$INIT'}}]}' +echo $VAULT_INIT + +RUSTFLAGS='-C link-arg=-s' cargo wasm +# 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.10 +# 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) + +VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') + +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]') + +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 +# 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 + +cd - diff --git a/demos/orion-manual-demo/sample_pool1.json b/demos/orion-manual-demo/sample_pool1.json new file mode 100644 index 0000000..666eca4 --- /dev/null +++ b/demos/orion-manual-demo/sample_pool1.json @@ -0,0 +1,7 @@ +{ + "weights": "4stake,4uosmo", + "initial-deposit": "100000stake,100000uosmo", + "swap-fee": "0.01", + "exit-fee": "0.01", + "future-governor": "168h" +} \ No newline at end of file diff --git a/demos/orion-manual-demo/sample_pool2.json b/demos/orion-manual-demo/sample_pool2.json new file mode 100644 index 0000000..b066ff1 --- /dev/null +++ b/demos/orion-manual-demo/sample_pool2.json @@ -0,0 +1,7 @@ +{ + "weights": "4stake,4fakestake", + "initial-deposit": "100000stake,100000fakestake", + "swap-fee": "0.01", + "exit-fee": "0.01", + "future-governor": "168h" +} \ No newline at end of file diff --git a/demos/orion-manual-demo/sample_pool3.json b/demos/orion-manual-demo/sample_pool3.json new file mode 100644 index 0000000..96ce393 --- /dev/null +++ b/demos/orion-manual-demo/sample_pool3.json @@ -0,0 +1,7 @@ +{ + "weights": "4fakestake,4uosmo", + "initial-deposit": "100000fakestake,100000uosmo", + "swap-fee": "0.01", + "exit-fee": "0.01", + "future-governor": "168h" +} \ No newline at end of file diff --git a/demos/orion-manual-demo/setup_go_relayer.sh b/demos/orion-manual-demo/setup_go_relayer.sh new file mode 100755 index 0000000..0b7371c --- /dev/null +++ b/demos/orion-manual-demo/setup_go_relayer.sh @@ -0,0 +1,29 @@ +#!/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 +COSMOSKEY="$(cat ./keys/gaia.key)" +OSMOKEY="$(cat ./keys/osmo.key)" +QUASARKEY="$(cat ./keys/qsr.key)" + +rly keys restore cosmos cosmoskey "$COSMOSKEY" +rly keys restore quasar quasarkey "$QUASARKEY" +rly keys restore osmosis osmokey "$OSMOKEY" + +rly q balance quasar +rly q balance cosmos +rly q balance osmosis + +rly paths add-dir ./go-relayer-config/paths +# rly tx link quasar_cosmos --debug >> ./logs/rly_qc_setup.log 2>&1 +rly tx link quasar_osmosis --debug --override >> ./logs/rly_qo_setup.log 2>&1 +rly tx link cosmos_osmosis --debug --override >> ./logs/rly_co_setup.log 2>&1 + diff --git a/demos/orion-manual-demo/setup_pool.sh b/demos/orion-manual-demo/setup_pool.sh new file mode 100755 index 0000000..2b3e544 --- /dev/null +++ b/demos/orion-manual-demo/setup_pool.sh @@ -0,0 +1,9 @@ +OSMOICA=$(quasarnoded 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 +POOLID=$(osmosisd query gamm pools --output json --node tcp://localhost:26679 | jq .pools[0].id) +POOLADDR=$(osmosisd query gamm pools --output json --node tcp://localhost:26679 | jq .pools[0].address) +echo "got poolID $POOLID with address $POOLADDR" + + diff --git a/demos/orion-manual-demo/simd_localnet.sh b/demos/orion-manual-demo/simd_localnet.sh new file mode 100755 index 0000000..88ee922 --- /dev/null +++ b/demos/orion-manual-demo/simd_localnet.sh @@ -0,0 +1,93 @@ +#!/bin/sh + +## 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=simd +HOME_SIMD=$HOME/.simapp +CHAIN_ID=simd +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" +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)" + +ALICE_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_SIMD + +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID + +# Bootstrap the quasar local network with single node + +echo $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$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_SIMD/config/app.toml + sed -i 's/swagger = false/swagger = true/g' $HOME_SIMD/config/app.toml + sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0uqsr"/g' $HOME_SIMD/config/app.toml + sed -i 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26659"+g' $HOME_SIMD/config/config.toml + sed -i 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26659"+g' $HOME_SIMD/config/client.toml + sed -i 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26661"+g' $HOME_SIMD/config/config.toml + sed -i 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6061"+g' $HOME_SIMD/config/config.toml + sed -i 's+address = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_SIMD/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_SIMD/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1311"+g' $HOME_SIMD/config/app.toml + sed -i 's+address = ":8080"+address = ":8081"+g' $HOME_SIMD/config/app.toml +elif [ $platform = 'macos' ]; then + sed -i'.original' -e 's/enable = false/enable = true/g' $HOME_SIMD/config/app.toml + sed -i'.original' -e 's/swagger = false/swagger = true/g' $HOME_SIMD/config/app.toml + sed -i'.original' -e 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/g' $HOME_SIMD/config/app.toml + sed -i'.original' -e 's+laddr = "tcp://127.0.0.1:26657"+laddr = "tcp://127.0.0.1:26659"+g' $HOME_SIMD/config/config.toml + sed -i'.original' -e 's+node = "tcp://localhost:26657"+node = "tcp://localhost:26659"+g' $HOME_SIMD/config/client.toml + sed -i'.original' -e 's+laddr = "tcp://0.0.0.0:26656"+laddr = "tcp://0.0.0.0:26661"+g' $HOME_SIMD/config/config.toml + sed -i'.original' -e 's+pprof_laddr = "localhost:6060"+pprof_laddr = "localhost:6061"+g' $HOME_SIMD/config/config.toml + sed -i'.original' -e 's+address = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_SIMD/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_SIMD/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0:1311"+g' $HOME_SIMD/config/app.toml + sed -i'.original' -e 's+address = ":8080"+address = ":8081"+g' $HOME_SIMD/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_SIMD/config/app.toml + sed -i '' 's/swagger = false/swagger = true/g' $HOME_SIMD/config/app.toml +fi + +cp $HOME_SIMD/config/genesis.json $HOME_SIMD/config/genesis_original.json +cat $HOME_SIMD/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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="60s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' > $HOME_SIMD/config/genesis.json + +# Start +$BINARY start --home $HOME_SIMD >> ./logs/simd_localnet.log 2>&1 diff --git a/demos/orion-manual-demo/test-intergamm-forwarding-and-request-deposit-demo.md b/demos/orion-manual-demo/test-intergamm-forwarding-and-request-deposit-demo.md new file mode 100644 index 0000000..233af0c --- /dev/null +++ b/demos/orion-manual-demo/test-intergamm-forwarding-and-request-deposit-demo.md @@ -0,0 +1,92 @@ +This demo demonstrates how to set intergamm params through gov procedures, +make request deposit txs, +and test if the deposits are actually transferred to osmosis properly from quasar. + +1. Run the steps described in the `run_integrated_testnet.md` to initialize the chains and the channels between them. + +2. First we need to verify connection and channel IDs among chains. + All channels of a chain can be listed by: +``` +hermes query channels osmosis +hermes query channels cosmos +hermes query channels quasar +``` +Focus on channels whose port ID is "transfer". +For these channels view their details by: +``` +hermes query channel ends osmosis transfer +``` +For example: +``` +hermes query channel ends osmosis transfer channel-0 +``` +Check their chain_id, counterparty_chain_id, channel_id, and counterparty_channel_id. +the channel IDs should be as follows: +quasar->osmosis channel-1 +osmosis->quasar channel-1 +quasar->cosmos channel-0 +cosmos->quasar channel-0 +cosmos->osmosis channel-1 +osmosis->cosmos channel-0 + +3. If the channel IDs found in previous step are different, + edit the `complete_zone_info_map-proposal.json` accordingly. + +4. Check the initial balances (of account alice). +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +gaiad q bank balances cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu --node tcp://localhost:26669 +osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 +``` + +5. Transfer some uatom to quasar and osmosis to find its ibc denoms in those chains. +``` +gaiad tx ibc-transfer transfer transfer channel-0 "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" 10000uatom --from alice --chain-id cosmos --home ~/.gaia/ --node tcp://localhost:26669 --keyring-backend test -y + +gaiad tx ibc-transfer transfer transfer channel-1 "osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq" 100uatom --from alice --chain-id cosmos --home ~/.gaia/ --node tcp://localhost:26669 --keyring-backend test -y +``` + +6. Check the balances (of account alice) on quasar and osmosis and note the ibc denom of uatom in both chains. +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 +``` + +7. If ibc denom of uatom on quasar is different from "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", +modify the denom_to_native_zone_id_map-proposal.json file and change it. + +8. Transfer some uosmo to quasar to find its ibc denom. +``` +osmosisd tx ibc-transfer transfer transfer channel-1 "quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec" 10000uosmo --from alice --chain-id osmosis --home ~/.osmosis/ --node tcp://localhost:26679 --keyring-backend test -y +``` + +9. Check the balances (of account alice) on quasar and note the ibc denom of uosmo. +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +``` + +10. If ibc denom of uosmo on quasar is different from "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B", +modify the denom_to_native_zone_id_map-proposal.json file and change it. + +11. Run the change_quasar_param.sh script to submit param change proposals and vote on them. +You need to wait 90 seconds until these changes takes effect. + +12. Set stable prices of uqsr, uosmo, uatom. +``` +quasarnoded tx qoracle stable-price uqsr 1.3 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +quasarnoded tx qoracle stable-price ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B 1.3 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +quasarnoded tx qoracle stable-price ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 1.3 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +``` + +13. Submit request deposit txs. +``` +quasarnoded tx qbank request-deposit orion 1000uqsr Days_7 "" --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +quasarnoded tx qbank request-deposit orion 1000ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B Days_7 "" --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +quasarnoded tx qbank request-deposit orion 1000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 Days_7 "" --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +``` + +14. Finally, check the balance of orion ICA on osmosis: +``` +osmosisd q bank balances osmo1dzgzjwvtu77x7p36xh9ut0xpek34y706rt6p5djn038455qtxjmsg4akrw --node tcp://localhost:26679 +``` + diff --git a/demos/orion-manual-demo/test-intergamm-token-transfer.md b/demos/orion-manual-demo/test-intergamm-token-transfer.md new file mode 100644 index 0000000..1a17652 --- /dev/null +++ b/demos/orion-manual-demo/test-intergamm-token-transfer.md @@ -0,0 +1,116 @@ +This demo demonstrates how to set intergamm params through gov procedures +and how to test intergamm token transferred. + +There are 6 cases that need to be tested: +1. transfer quasar-native token (e.g. uqsr) from quasar to osmosis +2. transfer quasar-native token (e.g. uqsr) from osmosis to quasar +3. transfer osmosis-native token (e.g. uosmo) from quasar to osmosis +4. transfer osmosis-native token (e.g. uosmo) from osmosis to quasar +5. transfer 3rd party token (e.g. uatom) from quasar to osmosis +6. transfer 3rd party token (e.g. uatom) from osmosis to quasar + +# Preparing the test setup + +1. Run the steps described in the `run_integrated_testnet.md` to initialize the chains and the channels between them. + +2. Run the steps described in the `verify-channel-ids-guide.md` and check if your channel IDs match what we assume in these guides. + +3. Run the steps described in the `verify-ibc-denoms-guide.md` and check if the IBC denoms in your test setup match what we assume in these guides. + +4. Check the initial balances of alice on quasar. +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +``` + +5. Set the intergamm module parameters by running `change_quasar_param.sh`. + This scripts submits needed gov proposals and votes on them. + You need to wait 90 seconds until these changes takes effect. + +6. Register an ICA for alice on osmosis (necessary for testing cases #2, #4, and #6). +``` +quasarnoded tx intergamm register-ica-on-zone osmosis --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y -b block +``` +Wait for about 30 seconds until the ICA and its channels are fully initialized and opened. +If Successful the following command should output the ICA address of alice on osmosis: +``` +quasarnoded q intergamm ica-address-on-zone $(quasarnoded keys show -a alice --keyring-backend test) osmosis +``` + +6. Register an ICA for alice on the native zone of uatom (necessary for testing cases #5 and #6). +``` +quasarnoded tx intergamm register-ica-on-denom-native-zone ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y -b block +``` +Wait for about 30 seconds until the ICA and its channels are fully initialized and opened. +If Successful the following command should output the ICA address of alice on osmosis: +``` +quasarnoded q intergamm ica-address-on-denom-native-zone $(quasarnoded keys show -a alice --keyring-backend test) ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 +``` + +7. Check quasar balance of alice and also her ICA balance on osmosis +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +osmosisd q bank balances osmo1hphwfu3yjf82z8xpcl6e05gzkjwjmu8ts2m97mdk62feuqm77f2skm6qcy --node tcp://localhost:26679 +``` + +# Testing case #1 and #2 (uqsr) + +1. Test case #1 (uqsr from quasar to osmosis): +``` +quasarnoded tx intergamm send-token-to-ica osmosis 5000uqsr --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y -b block +``` +This command sends tokens from alice account on quasar to her ICA on osmosis. +You can also use `quasarnoded tx intergamm send-token` to send tokens to an arbitrary account on osmosis, +but for testing case #2 you need to send to alice's ICA. + +2. Check balances (after a few seconds): +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +osmosisd q bank balances osmo1hphwfu3yjf82z8xpcl6e05gzkjwjmu8ts2m97mdk62feuqm77f2skm6qcy --node tcp://localhost:26679 +``` + +3. Test case #2 (uqsr from osmosis to quasar): +``` +quasarnoded tx intergamm transmit-ica-transfer quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 4000ibc/C18695C91D20F11FEE3919D7822B34651277CA84550EF33379E823AD9702B257 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y -b block +``` + +# Testing case #3 and #4 (uosmo) + +1. Test case #3 (uosmo from quasar to osmosis): +``` +quasarnoded tx intergamm send-token-to-ica osmosis 5000ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y -b block +``` +This command sends tokens from alice account on quasar to her ICA on osmosis. +You can also use `quasarnoded tx intergamm send-token` to send tokens to an arbitrary account on osmosis, +but for testing case #4 you need to send to alice's ICA. + +2. Check balances (after a few seconds): +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +osmosisd q bank balances osmo1hphwfu3yjf82z8xpcl6e05gzkjwjmu8ts2m97mdk62feuqm77f2skm6qcy --node tcp://localhost:26679 +``` + +3. Test case #4 (uosmo from osmosis to quasar): +``` +quasarnoded tx intergamm transmit-ica-transfer quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 4000uosmo --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y -b block +``` + +# Testing case #5 and #6 (uatom) + +1. Test case #5 (uatom from quasar to osmosis): +``` +quasarnoded tx intergamm send-token-to-ica osmosis 5000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y -b block +``` +This command sends tokens from alice account on quasar to her ICA on osmosis. +You can also use `quasarnoded tx intergamm send-token` to send tokens to an arbitrary account on osmosis, +but for testing case #6 you need to send to alice's ICA. + +2. Check balances (after a few seconds): +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +osmosisd q bank balances osmo1hphwfu3yjf82z8xpcl6e05gzkjwjmu8ts2m97mdk62feuqm77f2skm6qcy --node tcp://localhost:26679 +``` + +3. Test case #6 (uatom from osmosis to quasar): +``` +quasarnoded tx intergamm transmit-ica-transfer quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 4000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y -b block +``` diff --git a/demos/orion-manual-demo/verify-channel-ids-guide.md b/demos/orion-manual-demo/verify-channel-ids-guide.md new file mode 100644 index 0000000..a74d3d9 --- /dev/null +++ b/demos/orion-manual-demo/verify-channel-ids-guide.md @@ -0,0 +1,30 @@ +This purpose of this guide is to demonstrate how to find the channel IDs in your test setup and +find out if they match what we expect in the demos of this directory. + +1. First we need to verify channel IDs among chains. + All channels of a chain can be listed by: +``` +hermes query channels osmosis +hermes query channels cosmos +hermes query channels quasar +``` +Focus on channels whose port ID is "transfer". +For these channels view their details by: +``` +hermes query channel ends osmosis transfer +``` +For example: +``` +hermes query channel ends osmosis transfer channel-0 +``` +Check their chain_id, counterparty_chain_id, channel_id, and counterparty_channel_id. +the channel IDs should be as follows: +quasar->osmosis channel-1 +osmosis->quasar channel-1 +quasar->cosmos channel-0 +cosmos->quasar channel-0 +cosmos->osmosis channel-1 +osmosis->cosmos channel-0 + +2. If the channel IDs found in previous step are different, + edit the `complete_zone_info_map-proposal.json` accordingly. diff --git a/demos/orion-manual-demo/verify-ibc-denoms-guide.md b/demos/orion-manual-demo/verify-ibc-denoms-guide.md new file mode 100644 index 0000000..7c6dca3 --- /dev/null +++ b/demos/orion-manual-demo/verify-ibc-denoms-guide.md @@ -0,0 +1,55 @@ +This purpose of this guide is to demonstrate how to find +the IBC denoms of uqsr, uosmo, and uatom in other chains in your test setup and +find out if they match what we expect in the demos of this directory. + +Our expectation: +* uqsr on osmosis: ibc/C18695C91D20F11FEE3919D7822B34651277CA84550EF33379E823AD9702B257 +* uosmo on quasar: ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B +* uatom on quasar: inc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 +* uatom on osmosis: inc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 + +Note: generally uatom should hae different denoms on quasar and osmosis. +The reason they're the same here is that it arrives via the same port and channel IDs. + +1. Check the initial balances (of account alice). +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +gaiad q bank balances cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu --node tcp://localhost:26669 +osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 +``` + +2. Transfer some uqsr to osmosis to find its IBC denom. +``` +quasarnoded tx ibc-transfer transfer transfer channel-1 osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq 10000uqsr --from alice --chain-id quasar --home ~/.quasarnode/ --node tcp://localhost:26659 --keyring-backend test -y +``` + +3. Check the balances (of account alice) on osmosis and note the IBC denom of uqsr. +``` +osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 +``` + +4. Transfer some uosmo to quasar to find its IBC denom. +``` +osmosisd tx ibc-transfer transfer transfer channel-1 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10000uosmo --from alice --chain-id osmosis --home ~/.osmosis/ --node tcp://localhost:26679 --keyring-backend test -y +``` + +5. Check the balances (of account alice) on quasar and note the IBC denom of uosmo. +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +``` + +6. Transfer some uatom to quasar and osmosis to find its IBC denoms in those chains. +``` +gaiad tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 10000uatom --from alice --chain-id cosmos --home ~/.gaia/ --node tcp://localhost:26669 --keyring-backend test -y +gaiad tx ibc-transfer transfer transfer channel-1 osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq 10000uatom --from alice --chain-id cosmos --home ~/.gaia/ --node tcp://localhost:26669 --keyring-backend test -y +``` + +7. Check the balances (of account alice) on quasar and osmosis and note the IBC denom of uatom in both chains. +``` +quasarnoded q bank balances quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec --node tcp://localhost:26659 +osmosisd q bank balances osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq --node tcp://localhost:26679 +``` + +8. If the IBC denoms found in previous steps are different from the expectations listed in the beginning, + edit the `quasar_denom_to_native_zone_id_map-proposal.json` and + `osmosis_denom_to_quasar_denom_map-proposal` accordingly. diff --git a/demos/osmosis-config/README.md b/demos/osmosis-config/README.md new file mode 100644 index 0000000..5b1239d --- /dev/null +++ b/demos/osmosis-config/README.md @@ -0,0 +1,294 @@ +# Prerequisites +1. `go` v1.19 +2. `hermes` v1.0.0 +3. osmosis repo with async-icq or quasar repo sdk45 ( feature/sdk45_chainupdates or main-sdk45) + +# Setup +Install the main binary of this source code with the following command: +```bash +make install +``` +Clone osmosis v15 release candidate branch. and install the osmosisd binary with the following commands: +```bash + +clone the tag/v15.0.0-rc0 , https://github.com/osmosis-labs/osmosis/releases/tag/v15.0.0-rc0 + +cd ./osmosis + +make install +``` + +# Starting Quasar node +Run the following commands to start a single node of quasar in local machine with the preset of parameters needed for this demo: +```bash +cd ./demos/osmosis-config + +./quasar_localnet.sh +``` +After this you should see block logs written in the stdout of your terminal. + +# Starting Osmosis node +Run the following commands to start a single node of osmosis in local machine with the preset of parameters needed for this demo: +```bash +cd ./demos/osmosis-config + +./osmo_localnet.sh +``` +After this you should see block logs written in the stdout of your terminal. + +# Config and Start the Hermes Relayer + +Before running the relayer checkout http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/state by the response should be in the below format. +Values must be zero initially. + +```json +{ + "params_request_state": { + "packet_sequence": "14", + "acknowledged": true, + "failed": false, + "updated_at_height": "99" + }, + "incentivized_pools_state": { + "packet_sequence": "13", + "acknowledged": true, + "failed": false, + "updated_at_height": "99" + }, + "pools_state": { + "packet_sequence": "0", + "acknowledged": false, + "failed": false, + "updated_at_height": "0" + } +} +``` +Simply run the following commands to config and start the hermes relayer. +## Note - This demo does not intend to run bandchain part of the qoracle. + +```bash +cd ./demos/osmosis-config + +### Run hermes relayer and create necessary connections using below commands. + +[run_hermes_only_osmosis.sh](./run_hermes_only_osmosis.sh) +``` + +# Updating Osmosis Chain Params +Before updating the osmosis chain params http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/chain_params returns empty result like: +```json +{ + "epochs_info": [ + ], + "lockable_durations": [ + ], + "mint_params": { + "mint_denom": "", + "genesis_epoch_provisions": "0.000000000000000000", + "epoch_identifier": "", + "reduction_period_in_epochs": "0", + "reduction_factor": "0.000000000000000000", + "distribution_proportions": { + "staking": "0.000000000000000000", + "pool_incentives": "0.000000000000000000", + "developer_rewards": "0.000000000000000000", + "community_pool": "0.000000000000000000" + }, + "weighted_developer_rewards_receivers": [ + ], + "minting_rewards_distribution_start_epoch": "0" + }, + "mint_epoch_provisions": "\u003cnil\u003e", + "distr_info": { + "total_weight": "0", + "records": [ + ] + } +} +``` +## Update the chain params of osmosis in quasar run the following command. This will be happening automatically in the epoch hooks on every configured interval. + +- For testing this interval is set to 1 minute. In the live scenario it could be done once per day. + + +After hermes relayed the acknowledgement the result of http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/chain_params will change to: +```json +{ + "epochs_info": [ + { + "identifier": "day", + "start_time": "2022-09-21T17:11:05.191976Z", + "duration": "86400s", + "current_epoch": "1", + "current_epoch_start_time": "2022-09-21T17:11:05.191976Z", + "epoch_counting_started": true, + "current_epoch_start_height": "1" + }, + { + "identifier": "hour", + "start_time": "2022-09-21T17:11:05.191976Z", + "duration": "3600s", + "current_epoch": "1", + "current_epoch_start_time": "2022-09-21T17:11:05.191976Z", + "epoch_counting_started": true, + "current_epoch_start_height": "1" + }, + { + "identifier": "week", + "start_time": "2022-09-21T17:11:05.191976Z", + "duration": "604800s", + "current_epoch": "1", + "current_epoch_start_time": "2022-09-21T17:11:05.191976Z", + "epoch_counting_started": true, + "current_epoch_start_height": "1" + } + ], + "lockable_durations": [ + "120s", + "180s", + "240s" + ], + "mint_params": { + "mint_denom": "uosmo", + "genesis_epoch_provisions": "5000000.000000000000000000", + "epoch_identifier": "day", + "reduction_period_in_epochs": "156", + "reduction_factor": "0.500000000000000000", + "distribution_proportions": { + "staking": "0.400000000000000000", + "pool_incentives": "0.300000000000000000", + "developer_rewards": "0.200000000000000000", + "community_pool": "0.100000000000000000" + }, + "weighted_developer_rewards_receivers": [ + ], + "minting_rewards_distribution_start_epoch": "0" + }, + "mint_epoch_provisions": "5000000.000000000000000000", + "distr_info": { + "total_weight": "11100", + "records": [ + { + "gauge_id": "0", + "weight": "10000" + }, + { + "gauge_id": "1", + "weight": "1000" + }, + { + "gauge_id": "2", + "weight": "100" + } + ] + } +} +``` + + +# Creating a Pool in Osmosis +To create a pool in osmosis simply run the following command which will create a simple pool with `uosmo` and dummy `uatom` tokens: +```bash +cd ./demos/osmosis-config + +osmosisd tx gamm create-pool --pool-file demo_pool.json --home ~/.osmosis --chain-id osmosis --node=http://localhost:26679 --from alice --gas=300000 --output json --keyring-backend test +``` +On successful execution of tx you should see the pool in response of http://localhost:1312/osmosis/gamm/v1beta1/pools +```json +{ + "pools": [ + { + "@type": "/osmosis.gamm.v1beta1.Pool", + "address": "osmo1mw0ac6rwlp5r8wapwk3zs6g29h8fcscxqakdzw9emkne6c8wjp9q0t3v8t", + "id": "1", + "pool_params": { + "swap_fee": "0.001000000000000000", + "exit_fee": "0.001000000000000000", + "smooth_weight_change_params": null + }, + "future_pool_governor": "", + "total_shares": { + "denom": "gamm/pool/1", + "amount": "100000000000000000000" + }, + "pool_assets": [ + { + "token": { + "denom": "uatom", + "amount": "2000" + }, + "weight": "2147483648" + }, + { + "token": { + "denom": "uosmo", + "amount": "1000" + }, + "weight": "1073741824" + } + ], + "total_weight": "3221225472" + } + ], + "pagination": { + "next_key": null, + "total": "1" + } +} +``` +And after about a minute (maximum) quasar should be updated as well so checking the http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/pools should response the following results: +```json +{ + "pools": [ + { + "pool_info": { + "address": "osmo1mw0ac6rwlp5r8wapwk3zs6g29h8fcscxqakdzw9emkne6c8wjp9q0t3v8t", + "id": "1", + "poolParams": { + "swapFee": "0.001000000000000000", + "exitFee": "0.001000000000000000", + "smoothWeightChangeParams": null + }, + "future_pool_governor": "", + "totalShares": { + "denom": "gamm/pool/1", + "amount": "100000000000000000000" + }, + "poolAssets": [ + { + "token": { + "denom": "uatom", + "amount": "2000" + }, + "weight": "2147483648" + }, + { + "token": { + "denom": "uosmo", + "amount": "1000" + }, + "weight": "1073741824" + } + ], + "totalWeight": "3221225472" + }, + "metrics": { + "apy": "228679.752403732192854600", + "tvl": "0.029779015000000000" + } + } + ], + "pagination": { + "next_key": null, + "total": "1" + } +} +``` +Note that the `apy` and `tvl will be zero at this point. As in this version of the codebase we don't have integrated any stable price oracle yet. + + +## TO DO QUICK TESTING for param update ; just run , run_test.sh and verify chain_param after 2-3 minutes +` +curl http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/chain_params +` +- Values will not be zero. \ No newline at end of file diff --git a/demos/osmosis-config/bandchain_key.txt b/demos/osmosis-config/bandchain_key.txt new file mode 100644 index 0000000..7ee6417 --- /dev/null +++ b/demos/osmosis-config/bandchain_key.txt @@ -0,0 +1 @@ +machine danger crush duck always will liberty popular security shoulder bargain day repair focus fog evoke market gossip love curious question kingdom armor crazy \ No newline at end of file diff --git a/demos/osmosis-config/demo_pool.json b/demos/osmosis-config/demo_pool.json new file mode 100644 index 0000000..e2a0499 --- /dev/null +++ b/demos/osmosis-config/demo_pool.json @@ -0,0 +1,6 @@ +{ + "weights": "1uosmo,2uatom", + "initial-deposit": "1000uosmo,2000uatom", + "swap-fee": "0.001", + "exit-fee": "0.001" +} \ No newline at end of file diff --git a/demos/osmosis-config/example_denom_symbol_map.json b/demos/osmosis-config/example_denom_symbol_map.json new file mode 100644 index 0000000..ee68e19 --- /dev/null +++ b/demos/osmosis-config/example_denom_symbol_map.json @@ -0,0 +1,13 @@ + "denom_symbol_mappings": [ + { + "denom": "uatom", + "oracle_symbol": "ATOM", + "multiplier": "0.000001000000000000" + }, + { + "denom": "uosmo", + "oracle_symbol": "OSMO", + "multiplier": "0.000001000000000000" + } + ], + diff --git a/demos/osmosis-config/hermes_config.toml b/demos/osmosis-config/hermes_config.toml new file mode 100644 index 0000000..6ff0eaa --- /dev/null +++ b/demos/osmosis-config/hermes_config.toml @@ -0,0 +1,132 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = false + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.01, denom = 'uosmo' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.01, denom = 'uqsr' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } diff --git a/demos/osmosis-config/osmo_localnet.sh b/demos/osmosis-config/osmo_localnet.sh new file mode 100755 index 0000000..a8179f7 --- /dev/null +++ b/demos/osmosis-config/osmo_localnet.sh @@ -0,0 +1,159 @@ +# 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="rabbit garlic monitor wish pony magic budget someone room torch celery empower word assume digital rack electric weapon urban foot sketch jelly wet myself" +ALICE_GENESIS_COINS=10000000000000uosmo,2000000000stake,20000000uatom +BOB_GENESIS_COINS=10000000000000uosmo,1000000000stake +USER_1_GENESIS_COINS=10000000000stake,10000000000uosmo +USER_2_GENESIS_COINS=10000000000stake,10000000000uosmo +RELAYER_ACC_GENESIS_COINS=10000000uosmo + +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 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 +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.mint = { + minter: { + epoch_provisions: "0.000000000000000000" + }, + params: { + distribution_proportions: { + community_pool: "0.100000000000000000", + developer_rewards: "0.200000000000000000", + pool_incentives: "0.300000000000000000", + staking: "0.400000000000000000" + }, + epoch_identifier: "day", + genesis_epoch_provisions: "5000000.000000000000000000", + mint_denom: "uosmo", + minting_rewards_distribution_start_epoch: "0", + reduction_factor: "0.500000000000000000", + reduction_period_in_epochs: "156", + weighted_developer_rewards_receivers: [] + } + }' | + jq '.app_state.incentives = { + last_gauge_id: "0", + lockable_durations: [ + "1s", + "120s", + "180s", + "240s" + ], + params: { + distr_epoch_identifier: "day" + } + }' | + jq '.app_state.poolincentives = { + distr_info: { + records: [ + { + gauge_id: "0", + weight: "10000" + }, + { + gauge_id: "1", + weight: "1000" + }, + { + gauge_id: "2", + weight: "100" + } + ], + total_weight: "11100" + }, + lockable_durations: [ + "120s", + "180s", + "240s" + ], + params: { + minted_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"}' | + jq '.app_state.interchainquery = { + host_port: "icqhost", + params: { + host_enabled: true, + allow_queries: [ + "/osmosis.epochs.v1beta1.Query/EpochInfos", + "/osmosis.gamm.v1beta1.Query/Pool", + "/osmosis.poolincentives.v1beta1.Query/LockableDurations", + "/osmosis.mint.v1beta1.Query/Params", + "/osmosis.mint.v1beta1.Query/EpochProvisions", + "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools", + "/osmosis.poolincentives.v1beta1.Query/GaugeIds", + "/osmosis.poolincentives.v1beta1.Query/DistrInfo" + ] + } + }' \ + > $HOME_OSMOSIS/config/genesis.json + +# Start +$BINARY start --home $HOME_OSMOSIS > osmosis.log 2>&1 & \ No newline at end of file diff --git a/demos/osmosis-config/osmosis_key.txt b/demos/osmosis-config/osmosis_key.txt new file mode 100644 index 0000000..3d08a9b --- /dev/null +++ b/demos/osmosis-config/osmosis_key.txt @@ -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 \ No newline at end of file diff --git a/demos/osmosis-config/quasar_key.txt b/demos/osmosis-config/quasar_key.txt new file mode 100644 index 0000000..6c5cdd6 --- /dev/null +++ b/demos/osmosis-config/quasar_key.txt @@ -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 \ No newline at end of file diff --git a/demos/osmosis-config/quasar_localnet.sh b/demos/osmosis-config/quasar_localnet.sh new file mode 100755 index 0000000..8a04f79 --- /dev/null +++ b/demos/osmosis-config/quasar_localnet.sh @@ -0,0 +1,92 @@ +#!/bin/zsh + +## 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 +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" +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="old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license" +ALICE_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 + +# Remove previous setup +rm -rf $HOME_QSR + +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID + +# Bootstrap the quasar local network with single node + +echo $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$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 = ""/minimum-gas-prices = "0uqsr"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 = ""/minimum-gas-prices = "0uatom"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="60s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' | + # jq '.app_state.qoracle.bandchain_genesis_state.params.authorized_channel="channel-0"' | + jq '.app_state.qoracle.osmosis_genesis_state.params.authorized_channel="channel-0"' >$HOME_QSR/config/genesis.json + # jq '.app_state.qoracle.bandchain_genesis_state.params.coin_rates_params.script_params.fee_limit[0].amount="200"' >$HOME_QSR/config/genesis.json + +# Start +$BINARY start --home $HOME_QSR > quasar.log 2>&1 diff --git a/demos/osmosis-config/query_hermes.sh b/demos/osmosis-config/query_hermes.sh new file mode 100755 index 0000000..47c773f --- /dev/null +++ b/demos/osmosis-config/query_hermes.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +hermes query packet pending --chain quasar --port qosmosisoracle --channel channel-0 diff --git a/demos/osmosis-config/query_quasar.sh b/demos/osmosis-config/query_quasar.sh new file mode 100755 index 0000000..521f9d5 --- /dev/null +++ b/demos/osmosis-config/query_quasar.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +curl http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/pools + +curl http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/chain_params \ No newline at end of file diff --git a/demos/osmosis-config/run_hermes_only_osmosis.sh b/demos/osmosis-config/run_hermes_only_osmosis.sh new file mode 100755 index 0000000..1274620 --- /dev/null +++ b/demos/osmosis-config/run_hermes_only_osmosis.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +project_dir="$(cd "$(dirname "${0}")/../.." ; pwd)" # Absolute path to project dir +this_dir="${project_dir}/demos/osmosis-config" +this_script="${this_dir}/$(basename "${0}")" + +echo "$project_dir" +echo "$this_dir" +echo "$this_script" + + +rm -r ~/.hermes +mkdir ~/.hermes +cd $this_dir +cp ./hermes_config.toml ~/.hermes/config.toml + +hermes keys add --chain quasar --mnemonic-file quasar_key.txt +# SUCCESS Restored key 'quasarkey' (quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew) on chain quasar + +hermes keys add --chain osmosis --mnemonic-file osmosis_key.txt +# SUCCESS Restored key 'osmosiskey' (osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz) on chain osmosis + +# 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 +osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 + +# Create connections +#hermes create connection --a-chain quasar --b-chain $BANDCHAIN +hermes create connection --a-chain quasar --b-chain osmosis + +# Create channel +#hermes create channel --a-chain quasar --a-connection connection-0 --a-port qbandchainoracle --b-port oracle --channel-version bandchain-1 +hermes create channel --a-chain quasar --a-connection connection-0 --a-port qosmosisoracle --b-port icqhost --channel-version icq-1 + +# start +hermes start \ No newline at end of file diff --git a/demos/osmosis-config/run_test.sh b/demos/osmosis-config/run_test.sh new file mode 100755 index 0000000..e519a10 --- /dev/null +++ b/demos/osmosis-config/run_test.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +./quasar_localnet.sh & + +./osmo_localnet.sh & + +sleep 15 + +./run_hermes_only_osmosis.sh \ No newline at end of file diff --git a/demos/packet-forwarder/README.md b/demos/packet-forwarder/README.md new file mode 100644 index 0000000..b06f89c --- /dev/null +++ b/demos/packet-forwarder/README.md @@ -0,0 +1,155 @@ +# IBC Packet forwarder demo + +This demo tutorial demonstrates the working of multi-hop packet forwarding by using three chains from their latest source code in the local environment. The three chains used for the demo purpose are `quasar`, `cosmos-hub`, and `osmosis`. + +Repo links +1. [quasar](https://github.com/quasar-finance/quasar) +2. [cosmos-hub](https://github.com/quasar-finance/gaia) +3. [osmosis](https://github.com/osmosis-labs/osmosis) +4. [multi-hop packet forwarder](https://github.com/strangelove-ventures/packet-forward-middleware) + +These 3 blockchains will be communicating for the purpose of demonstrating a token transfer from `cosmos` to `quasar`, then from `quasar` to osmosis, using the IBC packet forwarding feature. + +## Prerequisites + +1. Both the `gaia` and `osmosis` repositories need to be cloned in a `contrib/` directory at the same level as the `quasar` repository. +2. The cosmos-hub `gaia` repo should be cloned from our fork https://github.com/quasar-finance/gaia and the branch `bugfix/replace_default_transfer_with_router_module` should be checked out. +3. `osmosis` require go version 1.18 +4. `ignite` latest version should be installed (see https://docs.ignite.com/guide/install.html) +5. `gnome terminal` should also be installed if not already installed, to spawn terminal windows. + +For ubuntu: + +```bash +sudo apt-get install gnome-terminal +``` + +## Setup + +1. Go to the `quasar` cloned directory, and cd `demos/packet-forwarder`. All steps below will be run from this directory. + +```bash +cd demos/packet-forwarder +``` + +A `demo` script is there to run all the demo steps. + +2. Start the 3 blockchains locally + +```bash +./demo start_all +``` + +3. Configure and start the `transfer` channel on ignite relayer only and wait for it to finish creating the connections, it might take a couple of minutes. + +```bash +./demo init_relayer +``` + +Now the 3 blockchains are able to communicate. + +## Token transfer scenario + +1. Get the Alice's address in the quasar chain. +Users' addresses are already fixed in the yaml config files file with mnemonics. + +```bash +quasarnoded keys list --home run/quasar/home/ +``` + +Alice's address on quasar is: `quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec` + +2. Check that Alice on Quasar does not have yet any ATOM: + +```bash +curl http://localhost:1311/bank/balances/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec +``` + +or + +```bash +quasarnoded q bank balances $(quasarnoded 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` + +```bash +./demo tx_bob_cosmos_to_alice_quasar +``` + +Now the new ATOM transferred to alice on `quasar` should be visible: + +```bash +curl http://localhost:1311/bank/balances/quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec +``` + +or + +```bash +quasarnoded q bank balances $(quasarnoded 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. + +Alice's address on osmosis is: `osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq` + +Therefore the receiver address looks like: +`cosmos1vzxkv3lxccnttr9rs0002s93sgw72h7ghukuhs|transfer/channel-1:osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq` + +The initial cosmos address can be a random address. It is in fact a temporary address that will hold the denom + amount, from which the fee will be deducted and retained by cosmos, before being forwarded to osmosis. + +We check first that the receiver on `osmosis` does not yet have the atom balance. + +```bash +curl http://localhost:1312/bank/balances/osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq +``` + +or + +```bash +osmosisd q bank balances $(osmosisd keys show -a alice --home run/osmosis/home) --home run/osmosis/home/ --node http://localhost:26559 +``` + +Then we make the tx: + +```bash +./demo tx_alice_quasar_to_alice_osmosis_via_cosmos +``` + +And we check the balance again for Alice on `osmosis`: +```bash +curl http://localhost:1312/bank/balances/osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq +``` + +or + +```bash +osmosisd q bank balances $(osmosisd keys show -a alice --home run/osmosis/home) --home run/osmosis/home/ --node http://localhost:26559 +``` + +It should display the 1000 IBC denom for the original ATOM. + +4. Send 1000 uatom (one hop ibc transfer) from cosmos-hub to osmosis using alice as sender and receiver. + +```bash +./demo tx_alice_cosmos_to_alice_osmosis +``` + +Then verify the balance, it should be 2000: + +```bash +curl http://localhost:1312/bank/balances/osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq +``` + +or + +```bash +osmosisd q bank balances $(osmosisd keys show -a alice --home run/osmosis/home) --home run/osmosis/home/ --node http://localhost:26559 +``` + +This step is to verify that the final denom that reaches to osmosis via both the paths are same. + +1. Path #1 `quasar` (one hop atom hex hash ( `cosmos-hub` -> `quasar` ) -> `cosmos-hub` -> `osmosis` +2. Path #2 `cosmos-hub` -> `osmosis` + +This step should update the alice ibc hex hash atom balance to be increased by the sent amount. diff --git a/demos/packet-forwarder/cosmos.yml b/demos/packet-forwarder/cosmos.yml new file mode 100644 index 0000000..7139f45 --- /dev/null +++ b/demos/packet-forwarder/cosmos.yml @@ -0,0 +1,27 @@ +accounts: + - name: alice + mnemonic: blur service enlist into false certain replace arrow until fatal glory mule design into dilemma palm helmet upper behave gallery into afford candy exercise + coins: ["20000000uatom", "2000000000stake"] + - name: bob + mnemonic: lucky surface version conduct ketchup cash unfair rival shoulder example demand upset deny tilt very clinic tribe rather renew skirt naive sweet box chicken + coins: ["10000000uatom", "1000000000stake"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4502" + name: bob + coins: ["1000000uatom", "100000000stake"] +host: + rpc: ":26669" + p2p: ":26663" + prof: ":6063" + grpc: ":9097" + grpc-web: ":8093" + api: ":1313" + frontend: ":8083" + dev-ui: ":12353" +genesis: + chain_id: "cosmos" +init: + home: "${home_dir}" diff --git a/demos/packet-forwarder/demo b/demos/packet-forwarder/demo new file mode 100755 index 0000000..51abf8f --- /dev/null +++ b/demos/packet-forwarder/demo @@ -0,0 +1,176 @@ +#!/usr/bin/env bash + +set -Cue -o pipefail + +project_dir="$(cd "$(dirname "${0}")/../.." ; pwd)" # Absolute path to project dir +this_dir="${project_dir}/demos/packet-forwarder" +this_script="${this_dir}/$(basename "${0}")" +run_dir="${this_dir}/run" +reset_run="${RESET:-true}" + +fail() { + echo "$*" + false +} + +cmd_exists() { + type "$1" >/dev/null 2>&1 || fail "command '${1}' not available" +} + +env_subst() { + python -c ' +import os, sys +data = sys.stdin.read(65536) +for v in os.environ: + data = data.replace("$%s" % v, os.environ[v]) + data = data.replace("${%s}" % v, os.environ[v]) +sys.stdout.write(data) ; sys.stdout.flush() +' +} + +# TODO make macos / darwin version of this +run_in_terminal() { + gnome-terminal -- "$@" +} + +run_chain() { + ( + local name="$1" ; shift + local dir="$1" ; shift + + echo "running ${name} chain" + + cd "$dir" + + local chain_dir="${run_dir}/${name}" + + if [ "$reset_run" == true ] ; then + rm -rf "$chain_dir" + fi + + export home_dir="${chain_dir}/home" + mkdir -p "$home_dir" + + cat "${this_dir}/${name}.yml" | env_subst >| "${chain_dir}/config.yml" + + ignite chain serve --config "${chain_dir}/config.yml" -v + ) +} + +start_cosmos() { run_chain "cosmos" "${project_dir}/../contrib/gaia" ; } +start_osmosis() { run_chain "osmosis" "${project_dir}/../contrib/osmosis" ; } +start_quasar() { run_chain "quasar" "${project_dir}" ; } + +start_all() { + if [ "$reset_run" == true ] ; then + rm -rf ~/.ignite/ + fi + + run_in_terminal "$this_script" start_osmosis + sleep 1 + run_in_terminal "$this_script" start_quasar + sleep 1 + run_in_terminal "$this_script" start_cosmos + sleep 1 +} + +init_relayer() { + ignite relayer configure \ + --source-rpc "http://localhost:26659" \ + --source-faucet "http://localhost:4500" \ + --source-account default \ + --source-gaslimit 300000 \ + --source-gasprice 0.00025stake \ + --source-prefix quasar \ + \ + --target-rpc "http://localhost:26559" \ + --target-faucet "http://localhost:4501" \ + --target-account default \ + --target-gaslimit 300000 \ + --target-gasprice 0.00025stake \ + --target-prefix osmo + + ignite relayer configure \ + --source-rpc "http://localhost:26659" \ + --source-faucet "http://localhost:4500" \ + --source-account default \ + --source-gaslimit 300000 \ + --source-gasprice 0.00025stake \ + --source-prefix quasar \ + \ + --target-rpc "http://localhost:26669" \ + --target-faucet "http://localhost:4502" \ + --target-account default \ + --target-gaslimit 300000 \ + --target-gasprice 0.00025stake \ + --target-prefix cosmos + + ignite relayer configure \ + --source-rpc "http://localhost:26559" \ + --source-faucet "http://localhost:4501" \ + --source-account default \ + --source-gaslimit 300000 \ + --source-gasprice 0.00025stake \ + --source-prefix osmo \ + \ + --target-rpc "http://localhost:26669" \ + --target-faucet "http://localhost:4502" \ + --target-account default \ + --target-gaslimit 300000 \ + --target-gasprice 0.00025stake \ + --target-prefix cosmos + + ignite relayer connect +} + +tx_bob_cosmos_to_alice_quasar() { + local home_dir="${run_dir}/cosmos/home" + + gaiad \ + --home "$home_dir" \ + --node=http://localhost:26669 \ + --chain-id cosmos \ + tx --from bob \ + ibc-transfer transfer \ + transfer channel-0 \ + quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec \ + 2000uatom +} + +tx_alice_quasar_to_alice_osmosis_via_cosmos() { + local home_dir="${run_dir}/quasar/home" + + quasarnoded \ + --home "$home_dir" \ + --node=http://localhost:26659 \ + --chain-id quasar \ + tx --from alice \ + ibc-transfer transfer \ + transfer channel-1 \ + "cosmos1vzxkv3lxccnttr9rs0002s93sgw72h7ghukuhs|transfer/channel-1:osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq" \ + 1ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9 +} + +tx_alice_cosmos_to_alice_osmosis() { + local home_dir="${run_dir}/cosmos/home" + + gaiad \ + --home "$home_dir" \ + --node=http://localhost:26669 \ + --chain-id cosmos \ + tx --from alice \ + ibc-transfer transfer \ + transfer channel-1 \ + osmo1t8eh66t2w5k67kwurmn5gqhtq6d2ja0vp7jmmq \ + 1000uatom +} + + +test -d "${project_dir}/../contrib/gaia" || fail "gaia dir not found" +test -d "${project_dir}/../contrib/osmosis" || fail "osmosis dir not found" + +cmd_exists "gaiad" +cmd_exists "osmosisd" +cmd_exists "quasarnoded" + +"$@" diff --git a/demos/packet-forwarder/osmosis.yml b/demos/packet-forwarder/osmosis.yml new file mode 100644 index 0000000..f0eb0e2 --- /dev/null +++ b/demos/packet-forwarder/osmosis.yml @@ -0,0 +1,30 @@ +version: 1 +accounts: + - name: alice + mnemonic: cruise scene law sea push expose scorpion wire trick repair wave quote task dose inner denial alpha favorite certain blouse motion flash split lunch + coins: ["20000000uosmo", "2000000000stake"] + - name: bob + mnemonic: lizard garlic canyon winner cheese tent drip task because ecology clay bridge junk critic track artefact gather harsh deliver unit vacant earth diesel stool + coins: ["10000000000000uosmo", "1000000000stake"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4501" + name: bob + coins: ["100000000000uosmo", "100000000stake"] +host: + rpc: ":26559" + p2p: ":26662" + prof: ":6062" + grpc: ":9096" + grpc-web: ":8092" + api: ":1312" + frontend: ":8082" + dev-ui: ":12352" +genesis: + chain_id: "osmosis" +init: + home: "${home_dir}" +build: + main: "cmd/osmosisd" diff --git a/demos/packet-forwarder/quasar.yml b/demos/packet-forwarder/quasar.yml new file mode 100644 index 0000000..75dad1b --- /dev/null +++ b/demos/packet-forwarder/quasar.yml @@ -0,0 +1,27 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000000qsr", "2000000000stake"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000000qsr", "1000000000stake"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4500" + name: bob + coins: ["1000000qsr", "100000000stake"] +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +genesis: + chain_id: "quasar" +init: + home: "${home_dir}" diff --git a/demos/paramchange/demo.md b/demos/paramchange/demo.md new file mode 100644 index 0000000..3bdc4ec --- /dev/null +++ b/demos/paramchange/demo.md @@ -0,0 +1,34 @@ + +# This demo demonstrate the param change gov procedure + +1. Kill any previous running chain binary. +2. Clean previous chain state +3. And clone new chain source code. and Run the chain +` +ignite chain serve -c demos/paramchange/quasar.yml --home run/quasar/home --reset-once -v +` +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 + +` +5. Query the proposal state. +` +quasarnoded 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 + +` +7. Vote +` +quasarnoded 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 +` diff --git a/demos/paramchange/demo_ica_param_change.md b/demos/paramchange/demo_ica_param_change.md new file mode 100644 index 0000000..60be1b2 --- /dev/null +++ b/demos/paramchange/demo_ica_param_change.md @@ -0,0 +1,16 @@ +# Example commands +` +osmosisd tx gov submit-proposal param-change ica-host-osmo.json --node tcp://localhost:26679 --from alice --chain-id osmosis --keyring-backend test --home ~/.osmosis --output json | jq +` +` +osmosisd q gov proposals --node tcp://localhost:26679 --chain-id osmosis --output json | jq +` +` +osmosisd tx gov vote 3 yes --node tcp://localhost:26679 --chain-id osmosis --from alice --home ~/.osmosis --keyring-backend test --output json | jq +` +` +osmosisd q gov proposals --node tcp://localhost:26679 --chain-id osmosis --output json | jq +` +` +osmosisd q interchain-accounts host param --node tcp://localhost:26679 +` diff --git a/demos/paramchange/ica-host-osmo.json b/demos/paramchange/ica-host-osmo.json new file mode 100644 index 0000000..dceec1e --- /dev/null +++ b/demos/paramchange/ica-host-osmo.json @@ -0,0 +1,12 @@ +{ + "title": "Enable ica unlock", + "description": "Add MsgBeginUnlocking to allowed ICA messages", + "changes": [ + { + "subspace": "icahost", + "key": "AllowMessages", + "value": ["/ibc.applications.transfer.v1.MsgTransfer", "/cosmos.bank.v1beta1.MsgSend", "/cosmos.staking.v1beta1.MsgDelegate", "/cosmos.staking.v1beta1.MsgBeginRedelegate", "/cosmos.staking.v1beta1.MsgCreateValidator", "/cosmos.staking.v1beta1.MsgEditValidator", "/cosmos.staking.v1beta1.MsgUndelegate", "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", "/cosmos.distribution.v1beta1.MsgFundCommunityPool", "/cosmos.gov.v1beta1.MsgVote", "/osmosis.gamm.v1beta1.MsgJoinPool", "/osmosis.gamm.v1beta1.MsgExitPool", "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn", "/osmosis.gamm.v1beta1.MsgSwapExactAmountOut", "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn", "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut", "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut", "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn", "/osmosis.lockup.MsgLockTokens", "/osmosis.superfluid.MsgSuperfluidUnbondLock", "/osmosis.lockup.MsgBeginUnlocking" ] + } + ], + "deposit": "1000uosmo" +} diff --git a/demos/paramchange/ica-host.json b/demos/paramchange/ica-host.json new file mode 100644 index 0000000..1ff826a --- /dev/null +++ b/demos/paramchange/ica-host.json @@ -0,0 +1,12 @@ +{ + "title": "Enable ica unlock", + "description": "Add MsgBeginUnlocking to allowed ICA messages", + "changes": [ + { + "subspace": "icahost", + "key": "AllowMessages", + "value": ["/ibc.applications.transfer.v1.MsgTransfer", "/cosmos.bank.v1beta1.MsgSend", "/cosmos.staking.v1beta1.MsgDelegate", "/cosmos.staking.v1beta1.MsgBeginRedelegate", "/cosmos.staking.v1beta1.MsgCreateValidator", "/cosmos.staking.v1beta1.MsgEditValidator", "/cosmos.staking.v1beta1.MsgUndelegate", "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", "/cosmos.distribution.v1beta1.MsgFundCommunityPool", "/cosmos.gov.v1beta1.MsgVote", "/osmosis.gamm.v1beta1.MsgJoinPool", "/osmosis.gamm.v1beta1.MsgExitPool", "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn", "/osmosis.gamm.v1beta1.MsgSwapExactAmountOut", "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn", "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut", "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut", "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn", "/osmosis.lockup.MsgLockTokens", "/osmosis.superfluid.MsgSuperfluidUnbondLock", "/osmosis.lockup.MsgBeginUnlocking" ] + } + ], + "deposit": "1000uqsr" +} diff --git a/demos/paramchange/mint_param_change.json b/demos/paramchange/mint_param_change.json new file mode 100644 index 0000000..d1496db --- /dev/null +++ b/demos/paramchange/mint_param_change.json @@ -0,0 +1,12 @@ +{ + "title": "Create a new mint param", + "description": "Testing mint param change", + "changes":[ + { + "subspace": "mint", + "key": "InflationRateChange", + "value": "1.00" + } + ], + "deposit": "10000uqsr" +} diff --git a/demos/paramchange/quasar.yml b/demos/paramchange/quasar.yml new file mode 100644 index 0000000..570ad20 --- /dev/null +++ b/demos/paramchange/quasar.yml @@ -0,0 +1,74 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000token", "200000000stake", "1000000000uqsr"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000token", "100000000stake", "1000000000uqsr"] +validator: + name: alice + staked: "100000000uqsr" +genesis: + chain_id: "quasar" + app_state: + gov: + deposit_params: + max_deposit_period: 172800s + min_deposit: + - amount: '1' + denom: uqsr + deposits: [] + proposals: [] + starting_proposal_id: '1' + tally_params: + quorum: '00.000000000000000001' + threshold: '0.000000000000000001' + veto_threshold: '0.334000000000000000' + votes: [] + voting_params: + voting_period: 300s + staking: + params: + bond_denom: uqsr + mint: + params: + mint_denom: uqsr + orion: + params: + enabled: false + lp_epoch_id: day #override day for testing + mgmt_fee_per: '0.003000000000000000' + perf_fee_per: '0.020000000000000000' + white_listed_pools : [1,2,3] + qoracle: + params: + oracleAccounts: 'quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec' + qbank: + params: + enabled: true + min_orion_epoch_denom_dollar_deposit: '100.000000000000000000' + orion_epoch_identifier: day #override day for testing + white_listed_denoms_in_orion: + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + origin_name: uatom + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: uqsr + origin_name: uqsr +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +#client: +# openapi: +# path: "docs/client/static/openapi/openapi.yml" +# vuex: +# path: "vue/src/store" +faucet: + name: bob + coins: ["5token", "100000stake", "10000uqsr"] diff --git a/demos/qtransfer-demos/README.md b/demos/qtransfer-demos/README.md new file mode 100644 index 0000000..bd97080 --- /dev/null +++ b/demos/qtransfer-demos/README.md @@ -0,0 +1,64 @@ +## Prerequisites +1. `go` v1.19 +2. `hermes` v1.0.0 +3. osmosis repo with async-icq v15 +4. quasar repo sdk45 ( main-sdk45) + +## Setup +Install the main binary of osmosis and quasar with the following command: +```bash +make install +``` +Clone osmosis v15 release candidate branch. and install the osmosisd binary with the following commands: +clone the tag/v15.0.0-rc0 , https://github.com/osmosis-labs/osmosis/releases/tag/v15.0.0-rc0 +```bash +git clone git@github.com:osmosis-labs/osmosis.git +cd ./osmosis +git checkout tags/v15.0.0-rc0 +make install +``` + +## Clone quasar node and install + +```bash +git clone git@github.com:quasar-finance/quasar.git +cd ./quasar +git switch main-sdk45 +make install +``` + +# MANUAL START +## Starting Quasar node +Run the following commands to start a single node of quasar in local machine with the preset of parameters needed for this demo: +```bash +cd ./demos/qtransfer-demos +./quasar_localnet.sh +``` +You can do tail -f quasar.log to see logs in the terminals. + +## Starting Osmosis node +Run the following commands to start a single node of osmosis in local machine with the preset of parameters needed for this demo: + +```bash +./osmo_localnet.sh +``` +You can do tail -f osmosis.log to see logs in the terminals. + +## Run Relayer +``` +./run_hermes.sh +``` +# AUTO START ALL PROCESSES +To start quasar, osmosis and hermes in one go, use `run_all.sh` + +```bash +./run_all.sh +``` + +## TOKEN TRANSFER + +To do ibc token transfer use `ibc_token_transfer.sh` to quickly do the steps. + +If you are debugging ; attach the quasarnode process id with the IDE (goland/vscode) and set the breakpoints in wasm_hooks or ibc middle ware receiver methods. + +## TESTING ICS-20 ACKNOWLEDGEMENTS OVERRIDES. diff --git a/demos/qtransfer-demos/balance_check.sh b/demos/qtransfer-demos/balance_check.sh new file mode 100755 index 0000000..c5e1525 --- /dev/null +++ b/demos/qtransfer-demos/balance_check.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "osmosis sender balance" +echo "user address - $(osmosisd keys show alice -a --keyring-backend test --home ~/.osmosis) " +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 + diff --git a/demos/qtransfer-demos/flow.md b/demos/qtransfer-demos/flow.md new file mode 100644 index 0000000..5f84273 --- /dev/null +++ b/demos/qtransfer-demos/flow.md @@ -0,0 +1,184 @@ +# A few important code references to understand the low level code flow. + +## If you are a debugger - I recommend to use debugger and set breakpoints in below methods + +```golang +// modules/core/04-channel/types/tx.pb.go +func _Msg_RecvPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +in := new(MsgRecvPacket) +if err := dec(in); err != nil { +return nil, err +} +if interceptor == nil { +return srv.(MsgServer).RecvPacket(ctx, in) +} +info := &grpc.UnaryServerInfo{ +Server: srv, +FullMethod: "/ibc.core.channel.v1.Msg/RecvPacket", +} +handler := func(ctx context.Context, req interface{}) (interface{}, error) { +return srv.(MsgServer).RecvPacket(ctx, req.(*MsgRecvPacket)) +} +return interceptor(ctx, in, info, handler) +} +``` + +```golang +// modules/core/keeper/msg_server.go +func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacket) (*channeltypes.MsgRecvPacketResponse, error) { +} +``` + +``` +cbs, ok := k.Router.GetRoute(module) +``` + +``` +err = k.ChannelKeeper.RecvPacket(cacheCtx, cap, msg.Packet, msg.ProofCommitment, msg.ProofHeight) +(modules/core/04-channel/keeper/packet.go ) + +ack := cbs.OnRecvPacket(cacheCtx, msg.Packet, relayer) ( modules/core/keeper/msg_server.go ) +``` + +``` +-> func (im IBCMiddleware) OnRecvPacket( +ctx sdk.Context, +packet channeltypes.Packet, +relayer sdk.AccAddress, +) ibcexported.Acknowledgement { } ( x/qtransfer/ibc_module.go ) + +``` + +``` + if hook, ok := im.ICS4Middleware.Hooks.(OnRecvPacketOverrideHooks); ok { + return hook.OnRecvPacketOverride(im, ctx, packet, relayer) + } + +func (h WasmHooks) OnRecvPacketOverride(im IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) ibcexported.Acknowledgement {..} +(x/qtransfer/wasm_hooks.go) + +``` + +``` +func (im IBCModule) OnRecvPacket( +ctx sdk.Context, +packet channeltypes.Packet, +relayer sdk.AccAddress, +) ibcexported.Acknowledgement {} ( modules/apps/transfer/ibc_module.go ) + +``` +``` +func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data types.FungibleTokenPacketData) error ( modules/apps/transfer/keeper/relay.go ) +``` + +# ACKNOWLEDGEMENT + + +func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) {} + +result, err = app.runMsgs(runMsgCtx, msgs, mode) {} + + +baseapp/baseapp.go +func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*sdk.Result, error) + + + +baseapp/msg_service_router.go + +func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) + + + + +func _Msg_Acknowledgement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +in := new(MsgAcknowledgement) +if err := dec(in); err != nil { +return nil, err +} +if interceptor == nil { +return srv.(MsgServer).Acknowledgement(ctx, in) +} +info := &grpc.UnaryServerInfo{ +Server: srv, +FullMethod: "/ibc.core.channel.v1.Msg/Acknowledgement", +} +handler := func(ctx context.Context, req interface{}) (interface{}, error) { +return srv.(MsgServer).Acknowledgement(ctx, req.(*MsgAcknowledgement)) +} +return interceptor(ctx, in, info, handler) +} + + +modules/core/keeper/msg_server.go + +// Acknowledgement defines a rpc handler method for MsgAcknowledgement. +func (k Keeper) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAcknowledgement) { +... + + +// Perform application logic callback +err = cbs.OnAcknowledgementPacket(ctx, msg.Packet, msg.Acknowledgement, relayer) + +..... +} + +x/qtransfer/wasm_hooks.go +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) { +} + +-> +modules/apps/transfer/ibc_module.go + +// OnAcknowledgementPacket implements the IBCModule interface +func (im IBCModule) OnAcknowledgementPacket( +ctx sdk.Context, +packet channeltypes.Packet, +acknowledgement []byte, +relayer sdk.AccAddress, +) error {} + +-> +modules/apps/transfer/keeper/relay.go +func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, data types.FungibleTokenPacketData, ack channeltypes.Acknowledgement) error {...} + + + +-> +modules/apps/transfer/ibc_module.go +if hook, ok := im.ICS4Middleware.Hooks.(OnAcknowledgementPacketOverrideHooks); ok { +**_return hook.OnAcknowledgementPacketOverride(im, ctx, packet, acknowledgement, relayer)**_ +} + +-> +x/qtransfer/ibc_module.go -> + +// OnAcknowledgementPacket implements the IBCMiddleware interface +func (im IBCMiddleware) OnAcknowledgementPacket( +ctx sdk.Context, +packet channeltypes.Packet, +acknowledgement []byte, +relayer sdk.AccAddress, +) + +-> +x/qtransfer/wasm_hooks.go + +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 +} + +} + + +modules/apps/transfer/ibc_module.go +// OnAcknowledgementPacket implements the IBCMiddleware interface +func (im IBCMiddleware) OnAcknowledgementPacket( +ctx sdk.Context, +packet channeltypes.Packet, +acknowledgement []byte, +relayer sdk.AccAddress, +) error { diff --git a/demos/qtransfer-demos/hermes_config.toml b/demos/qtransfer-demos/hermes_config.toml new file mode 100644 index 0000000..d8471ea --- /dev/null +++ b/demos/qtransfer-demos/hermes_config.toml @@ -0,0 +1,132 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = false + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } \ No newline at end of file diff --git a/demos/qtransfer-demos/ibc_token_transfer-r.sh b/demos/qtransfer-demos/ibc_token_transfer-r.sh new file mode 100755 index 0000000..d8dd95c --- /dev/null +++ b/demos/qtransfer-demos/ibc_token_transfer-r.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +#osmosisd tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 100uosmo --from alice --chain-id osmosis --home ~/.osmosis --node tcp://localhost:26679 --keyring-backend test +#osmosisd keys show alice -a --home ~/.osmosis --keyring-backend test +#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 diff --git a/demos/qtransfer-demos/ibc_token_transfer.sh b/demos/qtransfer-demos/ibc_token_transfer.sh new file mode 100755 index 0000000..59baadb --- /dev/null +++ b/demos/qtransfer-demos/ibc_token_transfer.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +#osmosisd tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 100uosmo --from alice --chain-id osmosis --home ~/.osmosis --node tcp://localhost:26679 --keyring-backend test + +echo "ibc token tx with some random memo - " +osmosisd tx ibc-transfer transfer transfer channel-0 quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec 100uosmo --memo "\"{ \"wasm\": { \"contract\": \"osmo1contractAddr\", \"msg\": { \"execute_IBC_receive\": \"raw_message_data\"}}}" --from alice --chain-id osmosis --home ~/.osmosis --node tcp://localhost:26679 --keyring-backend test diff --git a/demos/qtransfer-demos/osmo_localnet.sh b/demos/qtransfer-demos/osmo_localnet.sh new file mode 100755 index 0000000..e323bfd --- /dev/null +++ b/demos/qtransfer-demos/osmo_localnet.sh @@ -0,0 +1,159 @@ +# 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="rabbit garlic monitor wish pony magic budget someone room torch celery empower word assume digital rack electric weapon urban foot sketch jelly wet myself" +ALICE_GENESIS_COINS=10000000000000uosmo,2000000000stake,20000000uatom +BOB_GENESIS_COINS=10000000000000uosmo,1000000000stake +USER_1_GENESIS_COINS=10000000000stake,10000000000uosmo +USER_2_GENESIS_COINS=10000000000stake,10000000000uosmo +RELAYER_ACC_GENESIS_COINS=10000000uosmo + +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 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 +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.mint = { + minter: { + epoch_provisions: "0.000000000000000000" + }, + params: { + distribution_proportions: { + community_pool: "0.100000000000000000", + developer_rewards: "0.200000000000000000", + pool_incentives: "0.300000000000000000", + staking: "0.400000000000000000" + }, + epoch_identifier: "day", + genesis_epoch_provisions: "5000000.000000000000000000", + mint_denom: "uosmo", + minting_rewards_distribution_start_epoch: "0", + reduction_factor: "0.500000000000000000", + reduction_period_in_epochs: "156", + weighted_developer_rewards_receivers: [] + } + }' | + jq '.app_state.incentives = { + last_gauge_id: "0", + lockable_durations: [ + "1s", + "120s", + "180s", + "240s" + ], + params: { + distr_epoch_identifier: "day" + } + }' | + jq '.app_state.poolincentives = { + distr_info: { + records: [ + { + gauge_id: "0", + weight: "10000" + }, + { + gauge_id: "1", + weight: "1000" + }, + { + gauge_id: "2", + weight: "100" + } + ], + total_weight: "11100" + }, + lockable_durations: [ + "120s", + "180s", + "240s" + ], + params: { + minted_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"}' | + jq '.app_state.interchainquery = { + host_port: "icqhost", + params: { + host_enabled: true, + allow_queries: [ + "/osmosis.epochs.v1beta1.Query/EpochInfos", + "/osmosis.gamm.v1beta1.Query/Pool", + "/osmosis.poolincentives.v1beta1.Query/LockableDurations", + "/osmosis.mint.v1beta1.Query/Params", + "/osmosis.mint.v1beta1.Query/EpochProvisions", + "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools", + "/osmosis.poolincentives.v1beta1.Query/GaugeIds", + "/osmosis.poolincentives.v1beta1.Query/DistrInfo" + ] + } + }' \ + > $HOME_OSMOSIS/config/genesis.json + +# Start +$BINARY start --home $HOME_OSMOSIS > osmosis.log 2>&1 & diff --git a/demos/qtransfer-demos/osmosis_key.txt b/demos/qtransfer-demos/osmosis_key.txt new file mode 100644 index 0000000..3d08a9b --- /dev/null +++ b/demos/qtransfer-demos/osmosis_key.txt @@ -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 \ No newline at end of file diff --git a/demos/qtransfer-demos/quasar_key.txt b/demos/qtransfer-demos/quasar_key.txt new file mode 100644 index 0000000..6c5cdd6 --- /dev/null +++ b/demos/qtransfer-demos/quasar_key.txt @@ -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 \ No newline at end of file diff --git a/demos/qtransfer-demos/quasar_localnet.sh b/demos/qtransfer-demos/quasar_localnet.sh new file mode 100755 index 0000000..12f7c97 --- /dev/null +++ b/demos/qtransfer-demos/quasar_localnet.sh @@ -0,0 +1,95 @@ +#!/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 +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" +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="old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license" +ALICE_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 + +# Remove previous setup + +rm -rf $HOME_QSR + +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID --home $HOME_QSR + +# Bootstrap the quasar local network with single node + +echo $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS + +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$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 = ""/minimum-gas-prices = "0uqsr"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 = ""/minimum-gas-prices = "0uatom"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="60s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' | + # jq '.app_state.qoracle.bandchain_genesis_state.params.authorized_channel="channel-0"' | + jq '.app_state.qoracle.osmosis_genesis_state.params.authorized_channel="channel-0"' | + jq '.app_state.qoracle.bandchain_genesis_state.params.coin_rates_params.script_params.fee_limit[0].amount="200"' >$HOME_QSR/config/genesis.json + +# Start +$BINARY start --home $HOME_QSR > quasar.log 2>&1 & diff --git a/demos/qtransfer-demos/run_all.sh b/demos/qtransfer-demos/run_all.sh new file mode 100755 index 0000000..22f2b62 --- /dev/null +++ b/demos/qtransfer-demos/run_all.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +## Run Quasar +./quasar_localnet.sh & +## Run Osmosis +./osmo_localnet.sh & + +echo "Waiting 15 sec" +sleep 15 + +echo "Starting run hermes" +## Run Relayer +#./run_hermes.sh diff --git a/demos/qtransfer-demos/run_hermes.sh b/demos/qtransfer-demos/run_hermes.sh new file mode 100755 index 0000000..1368df6 --- /dev/null +++ b/demos/qtransfer-demos/run_hermes.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +rm -rf ~/.hermes +mkdir ~/.hermes + +cp ./hermes_config.toml ~/.hermes/config.toml + +hermes keys add --chain quasar --mnemonic-file quasar_key.txt +# SUCCESS Restored key 'quasarkey' (quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew) on chain quasar + +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 +osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 + +# Create connections +hermes create connection --a-chain quasar --b-chain osmosis + +# Create channel +hermes create channel --a-chain quasar --a-connection connection-0 --a-port transfer --b-port transfer --channel-version ics20-1 + +# start +hermes start > hermes.log 2>&1 & diff --git a/demos/qtransfer-demos/run_test.sh b/demos/qtransfer-demos/run_test.sh new file mode 100755 index 0000000..e91e933 --- /dev/null +++ b/demos/qtransfer-demos/run_test.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +pkill quasarnoded +pkill osmosisd + +## Run Quasar +./quasar_localnet.sh & +## Run Osmosis +./osmo_localnet.sh & + +sleep 10 +## Run Relayer +./run_hermes.sh & + +sleep 30 + +./balance_check.sh + +sleep 5 + +./ibc_token_transfer.sh & + +sleep 10 + +./balance_check.sh + +sleep 5 + +./ibc_token_transfer-r.sh + +sleep 10 +./balance_check.sh + + diff --git a/demos/quasar-bindings-test/README.md b/demos/quasar-bindings-test/README.md new file mode 100644 index 0000000..d3f4466 --- /dev/null +++ b/demos/quasar-bindings-test/README.md @@ -0,0 +1,9 @@ +# qOracle bindings test + +* in a separate terminal window, run ./quasar_localnet.sh +* in a separate terminal window, run ./osmo_localnet.sh +* in a separate terminal window, run ./run_hermes.sh +* wait for "Hermes has started" message +* In a separate terminal window, run ./deploy_and_exec_contract.sh + * You will have to run set up every time you restart the chains + hermes + * If you keep the chains running, you'll only have to run set up the first time \ No newline at end of file diff --git a/demos/quasar-bindings-test/bandchain_key.txt b/demos/quasar-bindings-test/bandchain_key.txt new file mode 100644 index 0000000..7ee6417 --- /dev/null +++ b/demos/quasar-bindings-test/bandchain_key.txt @@ -0,0 +1 @@ +machine danger crush duck always will liberty popular security shoulder bargain day repair focus fog evoke market gossip love curious question kingdom armor crazy \ No newline at end of file diff --git a/demos/quasar-bindings-test/demo_pool.json b/demos/quasar-bindings-test/demo_pool.json new file mode 100644 index 0000000..e2a0499 --- /dev/null +++ b/demos/quasar-bindings-test/demo_pool.json @@ -0,0 +1,6 @@ +{ + "weights": "1uosmo,2uatom", + "initial-deposit": "1000uosmo,2000uatom", + "swap-fee": "0.001", + "exit-fee": "0.001" +} \ No newline at end of file diff --git a/demos/quasar-bindings-test/deploy_and_exec_contract.sh b/demos/quasar-bindings-test/deploy_and_exec_contract.sh new file mode 100755 index 0000000..a5dff2c --- /dev/null +++ b/demos/quasar-bindings-test/deploy_and_exec_contract.sh @@ -0,0 +1,106 @@ +#!/bin/sh + +set -e + +CHAIN_ID="quasar" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +# STAKE_DENOM="urock" +BECH32_HRP="quas" +WASMD_VERSION="v0.23.0" +CONFIG_DIR=".wasmd" +BINARY="wasmd" +COSMJS_VERSION="v0.27.1" +GENESIS_URL="https://raw.githubusercontent.com/CosmWasm/testnets/master/cliffnet-1/config/genesis.json" +RPC="http://127.0.0.1:26659" +# RPC="https://rpc.cliffnet.cosmwasm.com:443" +LCD="https://lcd.cliffnet.cosmwasm.com" +FAUCET="https://faucet.cliffnet.cosmwasm.com" +# https://rpc-edgenet.dev-osmosis.zone/ +# https://lcd-edgenet.dev-osmosis.zone/ +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" + +# Prep quasar & osmo chains + +read -p "Should we run setup ? (Y/n)" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then + # Get Oracle Prices + read -p "Do we have oracle prices? Refresh here until yes: http://localhost:1311/quasarlabs/quasarnode/qoracle/oracle_prices (Y/n)" -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]] + then + echo "Exiting deploy_and_exec_contract.sh." + exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell + fi + + # 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 + 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 + echo + if [[ ! $REPLY =~ ^[Yy]$ ]] + then + echo "Exiting deploy_and_exec_contract.sh." + exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell + fi + + # Deploy Osmo pool + echo + echo "Deploying Osmosis Pool..." + osmosisd tx gamm create-pool --pool-fi\le demo_pool.json --home ~/.osmosis --chain-id osmosis --node=http://localhost:26679 --from alice --gas=300000 --output json --keyring-backend test + echo + echo "Does quasar have the osmosis pool (maximum 1 minute)?\nOsmosis link:http://localhost:1312/osmosis/gamm/v1beta1/pools \nQuasar link: http://localhost:1311/quasarlabs/quasarnode/qoracle/osmosis/pools\n" + + read -p "(Y/n)" -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]] + then + echo "Exiting deploy_and_exec_contract.sh." + exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell + fi +fi + + +INIT="{}" +MSG1='{"demo_osmosis_pools":{}}' +MSG2='{"demo_osmosis_pool_info":{}}' +MSG3='{"demo_oracle_prices":{}}' + +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 +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) +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]') +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 + +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 + +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 + +cd - \ No newline at end of file diff --git a/demos/quasar-bindings-test/hermes_config.toml b/demos/quasar-bindings-test/hermes_config.toml new file mode 100644 index 0000000..40add3e --- /dev/null +++ b/demos/quasar-bindings-test/hermes_config.toml @@ -0,0 +1,153 @@ +# The global section has parameters that apply globally to the relayer operation. +[global] + +# Specify the verbosity for the relayer logging output. Default: 'info' +# Valid options are 'error', 'warn', 'info', 'debug', 'trace'. +log_level = 'debug' + + +# Specify the mode to be used by the relayer. [Required] +[mode] + +# Specify the client mode. +[mode.clients] + +# Whether or not to enable the client workers. [Required] +enabled = true + +# Whether or not to enable periodic refresh of clients. [Default: true] +# Note: Even if this is disabled, clients will be refreshed automatically if +# there is activity on a connection or channel they are involved with. +refresh = true + +# Whether or not to enable misbehaviour detection for clients. [Default: false] +misbehaviour = true + +# Specify the connections mode. +[mode.connections] + +# Whether or not to enable the connection workers for handshake completion. [Required] +enabled = true + +# Specify the channels mode. +[mode.channels] + +# Whether or not to enable the channel workers for handshake completion. [Required] +enabled = true + +# Specify the packets mode. +[mode.packets] + +# Whether or not to enable the packet workers. [Required] +enabled = true + +# Parametrize the periodic packet clearing feature. +# Interval (in number of blocks) at which pending packets +# should be eagerly cleared. A value of '0' will disable +# periodic packet clearing. [Default: 100] +clear_interval = 100 + +# Whether or not to clear packets on start. [Default: false] +clear_on_start = true + +# Toggle the transaction confirmation mechanism. +# The tx confirmation mechanism periodically queries the `/tx_search` RPC +# endpoint to check that previously-submitted transactions +# (to any chain in this config file) have delivered successfully. +# Experimental feature. Affects telemetry if set to false. +# [Default: true] +tx_confirmation = true + +# The REST section defines parameters for Hermes' built-in RESTful API. +# https://hermes.informal.systems/rest.html +[rest] + +# Whether or not to enable the REST service. Default: false +enabled = true + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful +# API requests. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the restful API +# requests. Default: 3000 +port = 3000 + + +# The telemetry section defines parameters for Hermes' built-in telemetry capabilities. +# https://hermes.informal.systems/telemetry.html +[telemetry] + +# Whether or not to enable the telemetry service. Default: false +enabled = false + +# Specify the IPv4/6 host over which the built-in HTTP server will serve the metrics +# gathered by the telemetry service. Default: 127.0.0.1 +host = '127.0.0.1' + +# Specify the port over which the built-in HTTP server will serve the metrics gathered +# by the telemetry service. Default: 3001 +port = 3001 + +[[chains]] +id = 'osmosis' +rpc_addr = 'http://127.0.0.1:26679' +grpc_addr = 'http://127.0.0.1:9096' +websocket_addr = 'ws://127.0.0.1:26679/websocket' +rpc_timeout = '10s' +account_prefix = 'osmo' +key_name = 'osmosiskey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uosmo' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'quasar' +rpc_addr = 'http://127.0.0.1:26659' +grpc_addr = 'http://127.0.0.1:9095' +websocket_addr = 'ws://127.0.0.1:26659/websocket' +rpc_timeout = '10s' +account_prefix = 'quasar' +key_name = 'quasarkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uqsr' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'band-laozi-testnet5' +rpc_addr = 'https://rpc.laozi-testnet5.bandchain.org:443' +grpc_addr = 'https://laozi-testnet5.bandchain.org' +websocket_addr = 'wss://rpc.laozi-testnet5.bandchain.org/websocket' +rpc_timeout = '10s' +account_prefix = 'band' +key_name = 'bandkey' +store_prefix = 'ibc' +default_gas = 100000 +max_gas = 3000000 +gas_price = { price = 0.001, denom = 'uband' } +gas_multiplier = 1.1 +max_msg_num = 30 +max_tx_size = 2097152 +clock_drift = '5s' +max_block_time = '10s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } diff --git a/demos/quasar-bindings-test/osmo_localnet.sh b/demos/quasar-bindings-test/osmo_localnet.sh new file mode 100755 index 0000000..839eaf2 --- /dev/null +++ b/demos/quasar-bindings-test/osmo_localnet.sh @@ -0,0 +1,159 @@ +# 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="rabbit garlic monitor wish pony magic budget someone room torch celery empower word assume digital rack electric weapon urban foot sketch jelly wet myself" +ALICE_GENESIS_COINS=10000000000000uosmo,2000000000stake,20000000uatom +BOB_GENESIS_COINS=10000000000000uosmo,1000000000stake +USER_1_GENESIS_COINS=10000000000stake,10000000000uosmo +USER_2_GENESIS_COINS=10000000000stake,10000000000uosmo +RELAYER_ACC_GENESIS_COINS=10000000uosmo + +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 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 +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.mint = { + minter: { + epoch_provisions: "0.000000000000000000" + }, + params: { + distribution_proportions: { + community_pool: "0.100000000000000000", + developer_rewards: "0.200000000000000000", + pool_incentives: "0.300000000000000000", + staking: "0.400000000000000000" + }, + epoch_identifier: "day", + genesis_epoch_provisions: "5000000.000000000000000000", + mint_denom: "uosmo", + minting_rewards_distribution_start_epoch: "0", + reduction_factor: "0.500000000000000000", + reduction_period_in_epochs: "156", + weighted_developer_rewards_receivers: [] + } + }' | + jq '.app_state.incentives = { + last_gauge_id: "0", + lockable_durations: [ + "1s", + "120s", + "180s", + "240s" + ], + params: { + distr_epoch_identifier: "day" + } + }' | + jq '.app_state.poolincentives = { + distr_info: { + records: [ + { + gauge_id: "0", + weight: "10000" + }, + { + gauge_id: "1", + weight: "1000" + }, + { + gauge_id: "2", + weight: "100" + } + ], + total_weight: "11100" + }, + lockable_durations: [ + "120s", + "180s", + "240s" + ], + params: { + minted_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"}' | + jq '.app_state.interchainquery = { + host_port: "icqhost", + params: { + host_enabled: true, + allow_queries: [ + "/osmosis.epochs.v1beta1.Query/EpochInfos", + "/osmosis.gamm.v1beta1.Query/Pool", + "/osmosis.poolincentives.v1beta1.Query/LockableDurations", + "/osmosis.mint.v1beta1.Query/Params", + "/osmosis.mint.v1beta1.Query/EpochProvisions", + "/osmosis.poolincentives.v1beta1.Query/IncentivizedPools", + "/osmosis.poolincentives.v1beta1.Query/GaugeIds", + "/osmosis.poolincentives.v1beta1.Query/DistrInfo" + ] + } + }' \ + > $HOME_OSMOSIS/config/genesis.json + +# Start +$BINARY start --home $HOME_OSMOSIS \ No newline at end of file diff --git a/demos/quasar-bindings-test/osmosis_key.txt b/demos/quasar-bindings-test/osmosis_key.txt new file mode 100644 index 0000000..3d08a9b --- /dev/null +++ b/demos/quasar-bindings-test/osmosis_key.txt @@ -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 \ No newline at end of file diff --git a/demos/quasar-bindings-test/quasar.yml b/demos/quasar-bindings-test/quasar.yml new file mode 100644 index 0000000..b43ee19 --- /dev/null +++ b/demos/quasar-bindings-test/quasar.yml @@ -0,0 +1,87 @@ +accounts: + - name: alice + mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit + coins: ["20000token", "200000000stake", "1000000000uqsr"] + - name: bob + mnemonic: harvest ill mean warfare gospel slide tragic palace model excess surprise distance voyage change bus grant special artwork win width group dwarf today jar + coins: ["10000token", "100000000stake", "1000000000uqsr"] + - name: relayer_acc + mnemonic: old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license + # corresponding address is quasar143wwmxhsd8nkwu7j8gzpv9ca503g8j55h059ew + coins: ["1000000stake", "100000000uqsr"] +validator: + name: alice + staked: "100000000uqsr" +genesis: + chain_id: "quasar" + app_state: + staking: + params: + bond_denom: uqsr + intergamm: + params: + osmo_token_transfer_channels: + osmosis-test: channel-1 + osmosis: channel-1 + dest_to_intr_zone_map: + osmosis-01: cosmos + intr_rcvrs: + - zone_info: + chain_id: 'cosmos' + connection_id: 'connection-02' + rcvr_address: 'cosmos1ppkxa0hxak05tcqq3338k76xqxy2qse96uelcu' + next_zone_route_map: + osmosis-01: + local_zone_id: osmosis-01 + connection_id: 'connection-01' + chain_id: "osmosis" + transfer_channel_id: "channel-01" + osmosis-02: + local_zone_id: osmosis-02 + connection_id: 'connection-02' + chain_id: "osmosis2" + transfer_channel_id: "channel-02" + orion: + params: + enabled: false + lp_epoch_id: day #override day for testing + mgmt_fee_per: '0.003000000000000000' + perf_fee_per: '0.020000000000000000' + destination_chain_id: osmosis + white_listed_pools : [1,2,3] + osmosis_local_info: + local_zone_id : osmosis-01 + chain_id: 'osmosis' + connection_id: 'connection-01' + qoracle: + params: + oracleAccounts: 'quasar1sqlsc5024sszglyh7pswk5hfpc5xtl77gqjwec' + qbank: + params: + enabled: true + min_orion_epoch_denom_dollar_deposit: '100.000000000000000000' + orion_epoch_identifier: day #override day for testing + white_listed_denoms_in_orion: + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + origin_name: uatom + - onehop_osmo: ibc/BE1BB42D4BE3C30D50B68D7C41DB4DFCE9678E8EF8C539F6E6A9345048894FCC + onehop_quasar: uqsr + origin_name: uqsr +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +#client: +# openapi: +# path: "docs/client/static/openapi/openapi.yml" +# vuex: +# path: "vue/src/store" +faucet: + name: bob + coins: ["5token", "100000stake", "10000uqsr"] diff --git a/demos/quasar-bindings-test/quasar_key.txt b/demos/quasar-bindings-test/quasar_key.txt new file mode 100644 index 0000000..6c5cdd6 --- /dev/null +++ b/demos/quasar-bindings-test/quasar_key.txt @@ -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 \ No newline at end of file diff --git a/demos/quasar-bindings-test/quasar_localnet.sh b/demos/quasar-bindings-test/quasar_localnet.sh new file mode 100755 index 0000000..08fbd69 --- /dev/null +++ b/demos/quasar-bindings-test/quasar_localnet.sh @@ -0,0 +1,89 @@ +## 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 +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" +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="old cinnamon boy hurry pipe upset exhibit title copy squirrel grit eye love toy cotton connect inhale cost quarter mistake ahead endless bless license" +ALICE_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 + +# Remove previous setup +rm -rf $HOME_QSR + +$BINARY init $CHAIN_ID --chain-id $CHAIN_ID + +# Bootstrap the quasar local network with single node + +echo $ALICE | $BINARY keys add alice --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 alice --keyring-backend test -a) $ALICE_GENESIS_COINS +$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 relayer_acc --keyring-backend test -a) $RELAYER_ACC_GENESIS_COINS +$BINARY gentx alice 100000000uqsr --chain-id $CHAIN_ID --keyring-backend test +$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 = ""/minimum-gas-prices = "0uqsr"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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 = ""/minimum-gas-prices = "0uatom"/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 = "0.0.0.0:9090"+address = "0.0.0.0:9095"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "0.0.0.0:9091"+address = "0.0.0.0:8091"+g' $HOME_QSR/config/app.toml + sed -i'.original' -e 's+address = "tcp://0.0.0.0:1317"+address = "tcp://0.0.0.0: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.deposit_params.min_deposit=[{denom:"uqsr",amount:"1"}]' | + jq '.app_state.gov.voting_params.voting_period="60s"' | + jq '.app_state.gov.tally_params={quorum:"0.000000000000000001",threshold:"0.5",veto_threshold:"0.334"}' | + jq '.app_state.qoracle.params.bandchain_params.coin_rates_params.script_params.fee_limit[0].amount="200"' > $HOME_QSR/config/genesis.json + +# Start +$BINARY start --home $HOME_QSR \ No newline at end of file diff --git a/demos/quasar-bindings-test/run_hermes.sh b/demos/quasar-bindings-test/run_hermes.sh new file mode 100755 index 0000000..eca6dd6 --- /dev/null +++ b/demos/quasar-bindings-test/run_hermes.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +BANDCHAIN="band-laozi-testnet5" + +rm -r ~/.hermes +mkdir ~/.hermes + +cp ./hermes_config.toml ~/.hermes/config.toml + +hermes keys add --chain quasar --mnemonic-file quasar_key.txt +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 +osmosisd q bank balances osmo194580p9pyxakf3y3nqqk9hc3w9a7x0yrnv7wcz --node tcp://localhost:26679 + +# Create connections +hermes create connection --a-chain quasar --b-chain $BANDCHAIN +hermes create connection --a-chain quasar --b-chain osmosis + +# Create channel +hermes create channel --a-chain quasar --a-connection connection-0 --a-port qoracle --b-port oracle --channel-version bandchain-1 +hermes create channel --a-chain quasar --a-connection connection-1 --a-port qoracle --b-port icqhost --channel-version icq-1 + +# start +hermes start diff --git a/demos/wasm/README.md b/demos/wasm/README.md new file mode 100644 index 0000000..824cf46 --- /dev/null +++ b/demos/wasm/README.md @@ -0,0 +1,31 @@ +# WASM demo + +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 + +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 +```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.11.3``` + +Now that we can interact with the chain and have a contract to work with, we can do the actual demo. + +## Demo +Run the local node: +```ignite chain serve --reset-once``` + +List all wasm bytecodes on chain: +```wasmd query wasm list-code --node http://0.0.0.0:26657``` +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``` + +rerunning the list command: +```quasarnoded 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 diff --git a/demos/wasm/nameservice/.cargo/config b/demos/wasm/nameservice/.cargo/config new file mode 100644 index 0000000..2a01f1d --- /dev/null +++ b/demos/wasm/nameservice/.cargo/config @@ -0,0 +1,5 @@ +[alias] +wasm = "build --release --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --example schema" diff --git a/demos/wasm/nameservice/.editorconfig b/demos/wasm/nameservice/.editorconfig new file mode 100644 index 0000000..3d36f20 --- /dev/null +++ b/demos/wasm/nameservice/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.rs] +indent_size = 4 diff --git a/demos/wasm/nameservice/.gitignore b/demos/wasm/nameservice/.gitignore new file mode 100644 index 0000000..70132c4 --- /dev/null +++ b/demos/wasm/nameservice/.gitignore @@ -0,0 +1,5 @@ +/target +/artifacts +**/*.rs.bk +*.iml +.idea diff --git a/demos/wasm/nameservice/Cargo.lock b/demos/wasm/nameservice/Cargo.lock new file mode 100644 index 0000000..77ea9e9 --- /dev/null +++ b/demos/wasm/nameservice/Cargo.lock @@ -0,0 +1,571 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[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 = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[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.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c32f031ea41b4291d695026c023b95d59db2d8a2c7640800ed56bc8f510f22" + +[[package]] +name = "cosmwasm-crypto" +version = "1.0.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6da9aa7d6d1f5607b184bb207ead134df3ddc99ddb1a2d8d9915b59454d535" +dependencies = [ + "digest", + "ed25519-zebra", + "k256", + "rand_core 0.5.1", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "1.0.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb6c5b99d05fcf047bafc0fc093e8e7b7ecb63b76791f644f5dc3eca5a548de1" +dependencies = [ + "syn", +] + +[[package]] +name = "cosmwasm-schema" +version = "1.0.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e4b3f6933f94acdd3ddb931af4870c2002e3331a4a8b247a4ef070dd31ccb0" +dependencies = [ + "schemars", + "serde_json", +] + +[[package]] +name = "cosmwasm-std" +version = "1.0.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b7214fed59d78adc13b98e68072bf49f5273c8a6713ca98cb7784339f49ef01" +dependencies = [ + "base64", + "cosmwasm-crypto", + "cosmwasm-derive", + "schemars", + "serde", + "serde-json-wasm", + "thiserror", + "uint", +] + +[[package]] +name = "cosmwasm-storage" +version = "1.0.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "665cf97ad42be46936f6e6739711824a9bf21c440a6c98e185a3404aef0c3b81" +dependencies = [ + "cosmwasm-std", + "serde", +] + +[[package]] +name = "cpufeatures" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +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.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc209804a22c34a98fe26a32d997ac64d4284816f65cf1a529c4e31a256218a0" +dependencies = [ + "generic-array", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "cw-nameservice" +version = "0.11.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-storage", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "der" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e21d2d0f22cde6e88694108429775c0219760a07779bf96503b434a03d7412" +dependencies = [ + "const-oid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "dyn-clone" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" + +[[package]] +name = "ecdsa" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372" +dependencies = [ + "der", + "elliptic-curve", + "hmac", + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a128b76af6dd4b427e34a6fd43dc78dbfe73672ec41ff615a2414c1a0ad0409" +dependencies = [ + "curve25519-dalek", + "hex", + "rand_core 0.5.1", + "serde", + "sha2", + "thiserror", +] + +[[package]] +name = "elliptic-curve" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beca177dcb8eb540133e7680baff45e7cc4d93bf22002676cec549f82343721b" +dependencies = [ + "crypto-bigint", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f40b2dcd8bc322217a5f6559ae5f9e9d1de202a2ecee2e9eafcbece7562a4f" +dependencies = [ + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] + +[[package]] +name = "group" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c363a5301b8f153d80747126a04b3c82073b9fe3130571a9d170cacdeaf7912" +dependencies = [ + "ff", + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac", + "digest", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "k256" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903ae2481bcdfdb7b68e0a9baa4b7c9aff600b9ae2e8e5bb5833b8c91ab851ea" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5" + +[[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.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbee84ed13e44dd82689fa18348a49934fa79cc774a344c42fc9b301c71b140a" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "proc-macro2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.3", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "schemars" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6ab463ae35acccb5cba66c0084c985257b797d288b6050cc2f6ac1b266cb78" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "902fdfbcf871ae8f653bddf4b2c05905ddaabc08f69d32a915787e3be0d31356" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn", +] + +[[package]] +name = "serde" +version = "1.0.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1f72836d2aa753853178eda473a3b9d8e4eefdaf20523b919677e6de489f8f1" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-json-wasm" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50eef3672ec8fa45f3457fd423ba131117786784a895548021976117c1ded449" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57ae87ad533d9a56427558b516d0adac283614e347abf85b0dc0cbbf0a249f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_derive_internals" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +dependencies = [ + "block-buffer", + "cfg-if", + "cpufeatures", + "digest", + "opaque-debug", +] + +[[package]] +name = "signature" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335" +dependencies = [ + "digest", + "rand_core 0.6.3", +] + +[[package]] +name = "spki" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "987637c5ae6b3121aba9d513f869bd2bff11c4cc086c22473befd6649c0bd521" +dependencies = [ + "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.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "thiserror" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typenum" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" + +[[package]] +name = "uint" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "version_check" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "zeroize" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "377db0846015f7ae377174787dd452e1c5f5a9050bc6f954911d01f116daa0cd" diff --git a/demos/wasm/nameservice/Cargo.toml b/demos/wasm/nameservice/Cargo.toml new file mode 100644 index 0000000..0bade80 --- /dev/null +++ b/demos/wasm/nameservice/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "cw-nameservice" +description = "A name service" +version = "0.11.0" +authors = ["Cory Levinson "] +edition = "2018" +license = "Apache-2.0" +repository = "https://github.com/CosmWasm/cosmwasm-examples" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[features] +backtraces = ["cosmwasm-std/backtraces"] +# use library feature to disable all instantiate/execute/query exports +library = [] + +[dependencies] +cosmwasm-std = "1.0.0-beta" +cosmwasm-storage = "1.0.0-beta" +thiserror = { version = "1.0.23" } +schemars = "0.8.1" +serde = { version = "1.0.125", default-features = false, features = ["derive"] } + +[dev-dependencies] +cosmwasm-schema = { version = "1.0.0-beta" } diff --git a/demos/wasm/nameservice/LICENSE b/demos/wasm/nameservice/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/demos/wasm/nameservice/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/demos/wasm/nameservice/NOTICE b/demos/wasm/nameservice/NOTICE new file mode 100644 index 0000000..8504d3d --- /dev/null +++ b/demos/wasm/nameservice/NOTICE @@ -0,0 +1,13 @@ +Copyright 2020 Cory Levinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/demos/wasm/nameservice/README.md b/demos/wasm/nameservice/README.md new file mode 100644 index 0000000..cc073e4 --- /dev/null +++ b/demos/wasm/nameservice/README.md @@ -0,0 +1,9 @@ +# Name Service + +This is a CosmWasm derivation of [Cosmos SDK's name service application](https://tutorials.cosmos.network/nameservice/tutorial/01-app-design.html) + +The goal of the application you are building is to let users buy names and to set a value these names resolve to. +The owner of a given name will be the current highest bidder. In this section, you will learn how these simple + requirements translate to application design. + +Here is the tutorial for this application: [tutorial](https://docs.cosmwasm.com/0.14/learn/name-service/intro.html) diff --git a/demos/wasm/nameservice/examples/schema.rs b/demos/wasm/nameservice/examples/schema.rs new file mode 100644 index 0000000..7159040 --- /dev/null +++ b/demos/wasm/nameservice/examples/schema.rs @@ -0,0 +1,17 @@ +use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; +use std::env::current_dir; +use std::fs::create_dir_all; + +use cw_nameservice::msg::{ExecuteMsg, InstantiateMsg, QueryMsg, ResolveRecordResponse}; + +fn main() { + let mut out_dir = current_dir().unwrap(); + out_dir.push("schema"); + create_dir_all(&out_dir).unwrap(); + remove_schemas(&out_dir).unwrap(); + + export_schema(&schema_for!(InstantiateMsg), &out_dir); + export_schema(&schema_for!(ExecuteMsg), &out_dir); + export_schema(&schema_for!(QueryMsg), &out_dir); + export_schema(&schema_for!(ResolveRecordResponse), &out_dir); +} diff --git a/demos/wasm/nameservice/helpers.ts b/demos/wasm/nameservice/helpers.ts new file mode 100644 index 0000000..542dfb8 --- /dev/null +++ b/demos/wasm/nameservice/helpers.ts @@ -0,0 +1,234 @@ +/* + * This is a set of helpers meant for use with @cosmjs/cli + * With these you can easily use the cw20 contract without worrying about forming messages and parsing queries. + * + * Usage: npx @cosmjs/cli@^0.23 --init https://raw.githubusercontent.com/CosmWasm/cosmwasm-examples/main/nameservice/helpers.ts + * + * Create a client: + * const client = await useOptions(coralnetOptions).setup(password); + * await client.getAccount() + * + * Get the mnemonic: + * await useOptions(coralnetOptions).recoverMnemonic(password) + * + * If you want to use this code inside an app, you will need several imports from https://github.com/CosmWasm/cosmjs + */ + +const path = require("path"); + +interface Options { + readonly httpUrl: string + readonly networkId: string + readonly feeToken: string + readonly gasPrice: GasPrice + readonly bech32prefix: string + readonly hdPath: HdPath + readonly faucetUrl?: string + readonly defaultKeyFile: string + readonly gasLimits: Partial> // only set the ones you want to override +} + +const coralnetOptions: Options = { + httpUrl: 'https://lcd.coralnet.cosmwasm.com', + networkId: 'cosmwasm-coral', + feeToken: 'ucosm', + gasPrice: GasPrice.fromString("0.025ucosm"), + bech32prefix: 'cosmos', + faucetToken: 'SHELL', + faucetUrl: 'https://faucet.coralnet.cosmwasm.com/credit', + hdPath: makeCosmoshubPath(0), + defaultKeyFile: path.join(process.env.HOME, ".coral.key"), + gasLimits: { + upload: 1500000, + init: 600000, + register:800000, + transfer: 80000, + }, +} + +interface Network { + setup: (password: string, filename?: string) => Promise + recoverMnemonic: (password: string, filename?: string) => Promise +} + +const useOptions = (options: Options): Network => { + + const loadOrCreateWallet = async (options: Options, filename: string, password: string): Promise => { + let encrypted: string; + try { + encrypted = fs.readFileSync(filename, 'utf8'); + } catch (err) { + // generate if no file exists + const wallet = await Secp256k1HdWallet.generate(12, options.hdPath, options.bech32prefix); + const encrypted = await wallet.serialize(password); + fs.writeFileSync(filename, encrypted, 'utf8'); + return wallet; + } + // otherwise, decrypt the file (we cannot put deserialize inside try or it will over-write on a bad password) + const wallet = await Secp256k1HdWallet.deserialize(encrypted, password); + return wallet; + }; + + const connect = async ( + wallet: Secp256k1HdWallet, + options: Options + ): Promise => { + const [{ address }] = await wallet.getAccounts(); + + const client = new SigningCosmWasmClient( + options.httpUrl, + address, + wallet, + coralnetOptions.gasPrice, + coralnetOptions.gasLimits, + ); + return client; + }; + + const hitFaucet = async ( + faucetUrl: string, + address: string, + denom: string + ): Promise => { + await axios.post(faucetUrl, { denom, address }); + } + + const setup = async (password: string, filename?: string): Promise => { + const keyfile = filename || options.defaultKeyFile; + const wallet = await loadOrCreateWallet(coralnetOptions, keyfile, password); + const client = await connect(wallet, coralnetOptions); + + // ensure we have some tokens + if (options.faucetUrl) { + const account = await client.getAccount(); + if (!account) { + console.log(`Getting ${options.feeToken} from faucet`); + await hitFaucet(options.faucetUrl, client.senderAddress, options.feeToken); + } + } + + return client; + } + + const recoverMnemonic = async (password: string, filename?: string): Promise => { + const keyfile = filename || options.defaultKeyFile; + const wallet = await loadOrCreateWallet(coralnetOptions, keyfile, password); + return wallet.mnemonic; + } + + return {setup, recoverMnemonic}; +} + +interface Config { + readonly purchase_price?: Coin + readonly transfer_price?: Coin +} + +interface ResolveRecordResponse { + readonly address?: string +} + +interface InitMsg { + + readonly purchase_price?: Coin + readonly transfer_price?: Coin +} + +interface NameServiceInstance { + readonly contractAddress: string + + // queries + record: (name: string) => Promise + config: () => Promise + + // actions + register: (name: string, amount: Coin[]) => Promise + transfer: (name: string, to: string, amount: Coin[]) => Promise +} + +interface NameServiceContract { + upload: () => Promise + + instantiate: (codeId: number, initMsg: InitMsg, label: string) => Promise + + use: (contractAddress: string) => NameServiceInstance +} + +const NameService = (client: SigningCosmWasmClient): NameServiceContract => { + const use = (contractAddress: string): NameServiceInstance => { + const record = async (name: string): Promise => { + return client.queryContractSmart(contractAddress, {resolve_record: { name }}); + }; + + const config = async (): Promise => { + return client.queryContractSmart(contractAddress, {config: { }}); + }; + + const register = async (name: string, amount: Coin[]): Promise => { + const result = await client.execute(contractAddress, {register: { name }}, "", amount); + return result.transactionHash; + }; + + const transfer = async (name: string, to: string, amount: Coin[]): Promise => { + const result = await client.execute(contractAddress, {transfer: { name, to }}, "", amount); + return result.transactionHash; + }; + + return { + contractAddress, + record, + config, + register, + transfer, + }; + } + + const downloadWasm = async (url: string): Promise => { + const r = await axios.get(url, { responseType: 'arraybuffer' }) + if (r.status !== 200) { + throw new Error(`Download error: ${r.status}`) + } + return r.data + } + + const upload = async (): Promise => { + const meta = { + source: "https://github.com/CosmWasm/cosmwasm-examples/tree/nameservice-0.7.0/nameservice", + builder: "cosmwasm/rust-optimizer:0.10.4" + }; + const sourceUrl = "https://github.com/CosmWasm/cosmwasm-examples/releases/download/nameservice-0.7.0/contract.wasm"; + const wasm = await downloadWasm(sourceUrl); + const result = await client.upload(wasm, meta); + return result.codeId; + } + + const instantiate = async (codeId: number, initMsg: Record, label: string): Promise => { + const result = await client.instantiate(codeId, initMsg, label, { memo: `Init ${label}`}); + return use(result.contractAddress); + } + + return { upload, instantiate, use }; +} + +// Demo: +// const client = await useOptions(coralnetOptions).setup(PASSWORD); +// const { address } = await client.getAccount() +// const factory = NameService(client) +// +// const codeId = await factory.upload(); +// codeId -> 12 +// const initMsg = { purchase_price: { denom: "ushell", amount:"1000" }, transfer_price: { denom: "ushell", amount:"1000" }} +// const contract = await factory.instantiate(12, initMsg, "My Name Service") +// contract.contractAddress -> 'coral1267wq2zk22kt5juypdczw3k4wxhc4z47mug9fd' +// +// OR +// +// const contract = factory.use('coral1267wq2zk22kt5juypdczw3k4wxhc4z47mug9fd') +// +// const randomAddress = 'coral162d3zk45ufaqke5wgcd3kh336k6p3kwwkdj3ma' +// +// contract.config() +// contract.register("name", [{"denom": "ushell", amount: "4000" }]) +// contract.record("name") +// contract.transfer("name", randomAddress, [{"denom": "ushell", amount: "2000" }]) +// diff --git a/demos/wasm/nameservice/rustfmt.toml b/demos/wasm/nameservice/rustfmt.toml new file mode 100644 index 0000000..11a85e6 --- /dev/null +++ b/demos/wasm/nameservice/rustfmt.toml @@ -0,0 +1,15 @@ +# stable +newline_style = "unix" +hard_tabs = false +tab_spaces = 4 + +# unstable... should we require `rustup run nightly cargo fmt` ? +# or just update the style guide when they are stable? +#fn_single_line = true +#format_code_in_doc_comments = true +#overflow_delimited_expr = true +#reorder_impl_items = true +#struct_field_align_threshold = 20 +#struct_lit_single_line = true +#report_todo = "Always" + diff --git a/demos/wasm/nameservice/schema/execute_msg.json b/demos/wasm/nameservice/schema/execute_msg.json new file mode 100644 index 0000000..146f305 --- /dev/null +++ b/demos/wasm/nameservice/schema/execute_msg.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "anyOf": [ + { + "type": "object", + "required": [ + "register" + ], + "properties": { + "register": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "transfer" + ], + "properties": { + "transfer": { + "type": "object", + "required": [ + "name", + "to" + ], + "properties": { + "name": { + "type": "string" + }, + "to": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] +} diff --git a/demos/wasm/nameservice/schema/instantiate_msg.json b/demos/wasm/nameservice/schema/instantiate_msg.json new file mode 100644 index 0000000..a30b5b1 --- /dev/null +++ b/demos/wasm/nameservice/schema/instantiate_msg.json @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "properties": { + "purchase_price": { + "anyOf": [ + { + "$ref": "#/definitions/Coin" + }, + { + "type": "null" + } + ] + }, + "transfer_price": { + "anyOf": [ + { + "$ref": "#/definitions/Coin" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/demos/wasm/nameservice/schema/query_msg.json b/demos/wasm/nameservice/schema/query_msg.json new file mode 100644 index 0000000..33b4b15 --- /dev/null +++ b/demos/wasm/nameservice/schema/query_msg.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "anyOf": [ + { + "type": "object", + "required": [ + "resolve_record" + ], + "properties": { + "resolve_record": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object" + } + }, + "additionalProperties": false + } + ] +} diff --git a/demos/wasm/nameservice/schema/resolve_record_response.json b/demos/wasm/nameservice/schema/resolve_record_response.json new file mode 100644 index 0000000..625b6f3 --- /dev/null +++ b/demos/wasm/nameservice/schema/resolve_record_response.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ResolveRecordResponse", + "type": "object", + "properties": { + "address": { + "type": [ + "string", + "null" + ] + } + } +} diff --git a/demos/wasm/nameservice/src/coin_helpers.rs b/demos/wasm/nameservice/src/coin_helpers.rs new file mode 100644 index 0000000..c7c0892 --- /dev/null +++ b/demos/wasm/nameservice/src/coin_helpers.rs @@ -0,0 +1,62 @@ +use crate::error::ContractError; +use cosmwasm_std::Coin; + +pub fn assert_sent_sufficient_coin( + sent: &[Coin], + required: Option, +) -> Result<(), ContractError> { + if let Some(required_coin) = required { + let required_amount = required_coin.amount.u128(); + if required_amount > 0 { + let sent_sufficient_funds = sent.iter().any(|coin| { + // check if a given sent coin matches denom + // and has sufficient amount + coin.denom == required_coin.denom && coin.amount.u128() >= required_amount + }); + + if sent_sufficient_funds { + return Ok(()); + } else { + return Err(ContractError::InsufficientFundsSend {}); + } + } + } + Ok(()) +} + +#[cfg(test)] +mod test { + use super::*; + use cosmwasm_std::{coin, coins}; + + #[test] + fn assert_sent_sufficient_coin_works() { + match assert_sent_sufficient_coin(&[], Some(coin(0, "token"))) { + Ok(()) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + }; + + match assert_sent_sufficient_coin(&[], Some(coin(5, "token"))) { + Ok(()) => panic!("Should have raised insufficient funds error"), + Err(ContractError::InsufficientFundsSend {}) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + }; + + match assert_sent_sufficient_coin(&coins(10, "smokin"), Some(coin(5, "token"))) { + Ok(()) => panic!("Should have raised insufficient funds error"), + Err(ContractError::InsufficientFundsSend {}) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + }; + + match assert_sent_sufficient_coin(&coins(10, "token"), Some(coin(5, "token"))) { + Ok(()) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + }; + + let sent_coins = vec![coin(2, "smokin"), coin(5, "token"), coin(1, "earth")]; + match assert_sent_sufficient_coin(&sent_coins, Some(coin(5, "token"))) { + Ok(()) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + }; + } +} diff --git a/demos/wasm/nameservice/src/contract.rs b/demos/wasm/nameservice/src/contract.rs new file mode 100644 index 0000000..0893e70 --- /dev/null +++ b/demos/wasm/nameservice/src/contract.rs @@ -0,0 +1,144 @@ +use cosmwasm_std::{ + entry_point, to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult, +}; + +use crate::coin_helpers::assert_sent_sufficient_coin; +use crate::error::ContractError; +use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg, ResolveRecordResponse}; +use crate::state::{config, config_read, resolver, resolver_read, Config, NameRecord}; + +const MIN_NAME_LENGTH: u64 = 3; +const MAX_NAME_LENGTH: u64 = 64; + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn instantiate( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + msg: InstantiateMsg, +) -> Result { + let config_state = Config { + purchase_price: msg.purchase_price, + transfer_price: msg.transfer_price, + }; + + config(deps.storage).save(&config_state)?; + + Ok(Response::default()) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn execute( + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, +) -> Result { + match msg { + ExecuteMsg::Register { name } => execute_register(deps, env, info, name), + ExecuteMsg::Transfer { name, to } => execute_transfer(deps, env, info, name, to), + } +} + +pub fn execute_register( + deps: DepsMut, + _env: Env, + info: MessageInfo, + name: String, +) -> Result { + // we only need to check here - at point of registration + validate_name(&name)?; + let config_state = config(deps.storage).load()?; + assert_sent_sufficient_coin(&info.funds, config_state.purchase_price)?; + + let key = name.as_bytes(); + let record = NameRecord { owner: info.sender }; + + if (resolver(deps.storage).may_load(key)?).is_some() { + // name is already taken + return Err(ContractError::NameTaken { name }); + } + + // name is available + resolver(deps.storage).save(key, &record)?; + + Ok(Response::default()) +} + +pub fn execute_transfer( + deps: DepsMut, + _env: Env, + info: MessageInfo, + name: String, + to: String, +) -> Result { + let config_state = config(deps.storage).load()?; + assert_sent_sufficient_coin(&info.funds, config_state.transfer_price)?; + + let new_owner = deps.api.addr_validate(&to)?; + let key = name.as_bytes(); + resolver(deps.storage).update(key, |record| { + if let Some(mut record) = record { + if info.sender != record.owner { + return Err(ContractError::Unauthorized {}); + } + + record.owner = new_owner.clone(); + Ok(record) + } else { + Err(ContractError::NameNotExists { name: name.clone() }) + } + })?; + Ok(Response::default()) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::ResolveRecord { name } => query_resolver(deps, env, name), + QueryMsg::Config {} => to_binary(&config_read(deps.storage).load()?), + } +} + +fn query_resolver(deps: Deps, _env: Env, name: String) -> StdResult { + let key = name.as_bytes(); + + let address = match resolver_read(deps.storage).may_load(key)? { + Some(record) => Some(String::from(&record.owner)), + None => None, + }; + let resp = ResolveRecordResponse { address }; + + to_binary(&resp) +} + +// let's not import a regexp library and just do these checks by hand +fn invalid_char(c: char) -> bool { + let is_valid = c.is_digit(10) || c.is_ascii_lowercase() || (c == '.' || c == '-' || c == '_'); + !is_valid +} + +/// validate_name returns an error if the name is invalid +/// (we require 3-64 lowercase ascii letters, numbers, or . - _) +fn validate_name(name: &str) -> Result<(), ContractError> { + let length = name.len() as u64; + if (name.len() as u64) < MIN_NAME_LENGTH { + Err(ContractError::NameTooShort { + length, + min_length: MIN_NAME_LENGTH, + }) + } else if (name.len() as u64) > MAX_NAME_LENGTH { + Err(ContractError::NameTooLong { + length, + max_length: MAX_NAME_LENGTH, + }) + } else { + match name.find(invalid_char) { + None => Ok(()), + Some(bytepos_invalid_char_start) => { + let c = name[bytepos_invalid_char_start..].chars().next().unwrap(); + Err(ContractError::InvalidCharacter { c }) + } + } + } +} diff --git a/demos/wasm/nameservice/src/error.rs b/demos/wasm/nameservice/src/error.rs new file mode 100644 index 0000000..c70a2c1 --- /dev/null +++ b/demos/wasm/nameservice/src/error.rs @@ -0,0 +1,29 @@ +use cosmwasm_std::StdError; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum ContractError { + #[error("{0}")] + Std(#[from] StdError), + + #[error("Unauthorized")] + Unauthorized {}, + + #[error("Insufficient funds sent")] + InsufficientFundsSend {}, + + #[error("Name does not exist (name {name})")] + NameNotExists { name: String }, + + #[error("Name has been taken (name {name})")] + NameTaken { name: String }, + + #[error("Name too short (length {length} min_length {min_length})")] + NameTooShort { length: u64, min_length: u64 }, + + #[error("Name too long (length {length} min_length {max_length})")] + NameTooLong { length: u64, max_length: u64 }, + + #[error("Invalid character(char {c}")] + InvalidCharacter { c: char }, +} diff --git a/demos/wasm/nameservice/src/lib.rs b/demos/wasm/nameservice/src/lib.rs new file mode 100644 index 0000000..9287301 --- /dev/null +++ b/demos/wasm/nameservice/src/lib.rs @@ -0,0 +1,10 @@ +pub mod coin_helpers; +pub mod contract; +mod error; +pub mod msg; +pub mod state; + +#[cfg(test)] +mod tests; + +pub use crate::error::ContractError; diff --git a/demos/wasm/nameservice/src/msg.rs b/demos/wasm/nameservice/src/msg.rs new file mode 100644 index 0000000..92db090 --- /dev/null +++ b/demos/wasm/nameservice/src/msg.rs @@ -0,0 +1,30 @@ +use cosmwasm_std::Coin; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +pub struct InstantiateMsg { + pub purchase_price: Option, + pub transfer_price: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub enum ExecuteMsg { + Register { name: String }, + Transfer { name: String, to: String }, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub enum QueryMsg { + // ResolveAddress returns the current address that the name resolves to + ResolveRecord { name: String }, + Config {}, +} + +// We define a custom struct for each query response +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +pub struct ResolveRecordResponse { + pub address: Option, +} diff --git a/demos/wasm/nameservice/src/state.rs b/demos/wasm/nameservice/src/state.rs new file mode 100644 index 0000000..f210e43 --- /dev/null +++ b/demos/wasm/nameservice/src/state.rs @@ -0,0 +1,38 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +use cosmwasm_std::{Addr, Coin, Storage}; +use cosmwasm_storage::{ + bucket, bucket_read, singleton, singleton_read, Bucket, ReadonlyBucket, ReadonlySingleton, + Singleton, +}; + +pub static NAME_RESOLVER_KEY: &[u8] = b"nameresolver"; +pub static CONFIG_KEY: &[u8] = b"config"; + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +pub struct Config { + pub purchase_price: Option, + pub transfer_price: Option, +} + +pub fn config(storage: &mut dyn Storage) -> Singleton { + singleton(storage, CONFIG_KEY) +} + +pub fn config_read(storage: &dyn Storage) -> ReadonlySingleton { + singleton_read(storage, CONFIG_KEY) +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +pub struct NameRecord { + pub owner: Addr, +} + +pub fn resolver(storage: &mut dyn Storage) -> Bucket { + bucket(storage, NAME_RESOLVER_KEY) +} + +pub fn resolver_read(storage: &dyn Storage) -> ReadonlyBucket { + bucket_read(storage, NAME_RESOLVER_KEY) +} diff --git a/demos/wasm/nameservice/src/tests.rs b/demos/wasm/nameservice/src/tests.rs new file mode 100644 index 0000000..6059488 --- /dev/null +++ b/demos/wasm/nameservice/src/tests.rs @@ -0,0 +1,372 @@ +#[cfg(test)] +mod tests { + use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; + use cosmwasm_std::{coin, coins, from_binary, Coin, Deps, DepsMut}; + + use crate::contract::{execute, instantiate, query}; + use crate::error::ContractError; + use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg, ResolveRecordResponse}; + use crate::state::Config; + + fn assert_name_owner(deps: Deps, name: &str, owner: &str) { + let res = query( + deps, + mock_env(), + QueryMsg::ResolveRecord { + name: name.to_string(), + }, + ) + .unwrap(); + + let value: ResolveRecordResponse = from_binary(&res).unwrap(); + assert_eq!(Some(owner.to_string()), value.address); + } + + fn assert_config_state(deps: Deps, expected: Config) { + let res = query(deps, mock_env(), QueryMsg::Config {}).unwrap(); + let value: Config = from_binary(&res).unwrap(); + assert_eq!(value, expected); + } + + fn mock_init_with_price(deps: DepsMut, purchase_price: Coin, transfer_price: Coin) { + let msg = InstantiateMsg { + purchase_price: Some(purchase_price), + transfer_price: Some(transfer_price), + }; + + let info = mock_info("creator", &coins(2, "token")); + let _res = instantiate(deps, mock_env(), info, msg) + .expect("contract successfully handles InstantiateMsg"); + } + + fn mock_init_no_price(deps: DepsMut) { + let msg = InstantiateMsg { + purchase_price: None, + transfer_price: None, + }; + + let info = mock_info("creator", &coins(2, "token")); + let _res = instantiate(deps, mock_env(), info, msg) + .expect("contract successfully handles InstantiateMsg"); + } + + fn mock_alice_registers_name(deps: DepsMut, sent: &[Coin]) { + // alice can register an available name + let info = mock_info("alice_key", sent); + let msg = ExecuteMsg::Register { + name: "alice".to_string(), + }; + let _res = execute(deps, mock_env(), info, msg) + .expect("contract successfully handles Register message"); + } + + #[test] + fn proper_init_no_fees() { + let mut deps = mock_dependencies(&[]); + + mock_init_no_price(deps.as_mut()); + + assert_config_state( + deps.as_ref(), + Config { + purchase_price: None, + transfer_price: None, + }, + ); + } + + #[test] + fn proper_init_with_fees() { + let mut deps = mock_dependencies(&[]); + + mock_init_with_price(deps.as_mut(), coin(3, "token"), coin(4, "token")); + + assert_config_state( + deps.as_ref(), + Config { + purchase_price: Some(coin(3, "token")), + transfer_price: Some(coin(4, "token")), + }, + ); + } + + #[test] + fn register_available_name_and_query_works() { + let mut deps = mock_dependencies(&[]); + mock_init_no_price(deps.as_mut()); + mock_alice_registers_name(deps.as_mut(), &[]); + + // querying for name resolves to correct address + assert_name_owner(deps.as_ref(), "alice", "alice_key"); + } + + #[test] + fn register_available_name_and_query_works_with_fees() { + let mut deps = mock_dependencies(&[]); + mock_init_with_price(deps.as_mut(), coin(2, "token"), coin(2, "token")); + mock_alice_registers_name(deps.as_mut(), &coins(2, "token")); + + // anyone can register an available name with more fees than needed + let info = mock_info("bob_key", &coins(5, "token")); + let msg = ExecuteMsg::Register { + name: "bob".to_string(), + }; + + let _res = execute(deps.as_mut(), mock_env(), info, msg) + .expect("contract successfully handles Register message"); + + // querying for name resolves to correct address + assert_name_owner(deps.as_ref(), "alice", "alice_key"); + assert_name_owner(deps.as_ref(), "bob", "bob_key"); + } + + #[test] + fn fails_on_register_already_taken_name() { + let mut deps = mock_dependencies(&[]); + mock_init_no_price(deps.as_mut()); + mock_alice_registers_name(deps.as_mut(), &[]); + + // bob can't register the same name + let info = mock_info("bob_key", &coins(2, "token")); + let msg = ExecuteMsg::Register { + name: "alice".to_string(), + }; + let res = execute(deps.as_mut(), mock_env(), info, msg); + + match res { + Ok(_) => panic!("Must return error"), + Err(ContractError::NameTaken { .. }) => {} + Err(_) => panic!("Unknown error"), + } + // alice can't register the same name again + let info = mock_info("alice_key", &coins(2, "token")); + let msg = ExecuteMsg::Register { + name: "alice".to_string(), + }; + let res = execute(deps.as_mut(), mock_env(), info, msg); + + match res { + Ok(_) => panic!("Must return error"), + Err(ContractError::NameTaken { .. }) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + } + } + + #[test] + fn register_available_name_fails_with_invalid_name() { + let mut deps = mock_dependencies(&[]); + mock_init_no_price(deps.as_mut()); + let info = mock_info("bob_key", &coins(2, "token")); + + // hi is too short + let msg = ExecuteMsg::Register { + name: "hi".to_string(), + }; + match execute(deps.as_mut(), mock_env(), info.clone(), msg) { + Ok(_) => panic!("Must return error"), + Err(ContractError::NameTooShort { .. }) => {} + Err(_) => panic!("Unknown error"), + } + + // 65 chars is too long + let msg = ExecuteMsg::Register { + name: "01234567890123456789012345678901234567890123456789012345678901234".to_string(), + }; + match execute(deps.as_mut(), mock_env(), info.clone(), msg) { + Ok(_) => panic!("Must return error"), + Err(ContractError::NameTooLong { .. }) => {} + Err(_) => panic!("Unknown error"), + } + + // no upper case... + let msg = ExecuteMsg::Register { + name: "LOUD".to_string(), + }; + match execute(deps.as_mut(), mock_env(), info.clone(), msg) { + Ok(_) => panic!("Must return error"), + Err(ContractError::InvalidCharacter { c }) => assert_eq!(c, 'L'), + Err(_) => panic!("Unknown error"), + } + // ... or spaces + let msg = ExecuteMsg::Register { + name: "two words".to_string(), + }; + match execute(deps.as_mut(), mock_env(), info, msg) { + Ok(_) => panic!("Must return error"), + Err(ContractError::InvalidCharacter { .. }) => {} + Err(_) => panic!("Unknown error"), + } + } + + #[test] + fn fails_on_register_insufficient_fees() { + let mut deps = mock_dependencies(&[]); + mock_init_with_price(deps.as_mut(), coin(2, "token"), coin(2, "token")); + + // anyone can register an available name with sufficient fees + let info = mock_info("alice_key", &[]); + let msg = ExecuteMsg::Register { + name: "alice".to_string(), + }; + + let res = execute(deps.as_mut(), mock_env(), info, msg); + + match res { + Ok(_) => panic!("register call should fail with insufficient fees"), + Err(ContractError::InsufficientFundsSend {}) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + } + } + + #[test] + fn fails_on_register_wrong_fee_denom() { + let mut deps = mock_dependencies(&[]); + mock_init_with_price(deps.as_mut(), coin(2, "token"), coin(2, "token")); + + // anyone can register an available name with sufficient fees + let info = mock_info("alice_key", &coins(2, "earth")); + let msg = ExecuteMsg::Register { + name: "alice".to_string(), + }; + + let res = execute(deps.as_mut(), mock_env(), info, msg); + + match res { + Ok(_) => panic!("register call should fail with insufficient fees"), + Err(ContractError::InsufficientFundsSend {}) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + } + } + + #[test] + fn transfer_works() { + let mut deps = mock_dependencies(&[]); + mock_init_no_price(deps.as_mut()); + mock_alice_registers_name(deps.as_mut(), &[]); + + // alice can transfer her name successfully to bob + let info = mock_info("alice_key", &[]); + let msg = ExecuteMsg::Transfer { + name: "alice".to_string(), + to: "bob_key".to_string(), + }; + + let _res = execute(deps.as_mut(), mock_env(), info, msg) + .expect("contract successfully handles Transfer message"); + // querying for name resolves to correct address (bob_key) + assert_name_owner(deps.as_ref(), "alice", "bob_key"); + } + + #[test] + fn transfer_works_with_fees() { + let mut deps = mock_dependencies(&[]); + mock_init_with_price(deps.as_mut(), coin(2, "token"), coin(2, "token")); + mock_alice_registers_name(deps.as_mut(), &coins(2, "token")); + + // alice can transfer her name successfully to bob + let info = mock_info("alice_key", &[coin(1, "earth"), coin(2, "token")]); + let msg = ExecuteMsg::Transfer { + name: "alice".to_string(), + to: "bob_key".to_string(), + }; + + let _res = execute(deps.as_mut(), mock_env(), info, msg) + .expect("contract successfully handles Transfer message"); + // querying for name resolves to correct address (bob_key) + assert_name_owner(deps.as_ref(), "alice", "bob_key"); + } + + #[test] + fn fails_on_transfer_non_existent() { + let mut deps = mock_dependencies(&[]); + mock_init_no_price(deps.as_mut()); + mock_alice_registers_name(deps.as_mut(), &[]); + + // alice can transfer her name successfully to bob + let info = mock_info("frank_key", &coins(2, "token")); + let msg = ExecuteMsg::Transfer { + name: "alice42".to_string(), + to: "bob_key".to_string(), + }; + + let res = execute(deps.as_mut(), mock_env(), info, msg); + + match res { + Ok(_) => panic!("Must return error"), + Err(ContractError::NameNotExists { name }) => assert_eq!(name, "alice42"), + Err(e) => panic!("Unexpected error: {:?}", e), + } + + // querying for name resolves to correct address (alice_key) + assert_name_owner(deps.as_ref(), "alice", "alice_key"); + } + + #[test] + fn fails_on_transfer_from_nonowner() { + let mut deps = mock_dependencies(&[]); + mock_init_no_price(deps.as_mut()); + mock_alice_registers_name(deps.as_mut(), &[]); + + // alice can transfer her name successfully to bob + let info = mock_info("frank_key", &coins(2, "token")); + let msg = ExecuteMsg::Transfer { + name: "alice".to_string(), + to: "bob_key".to_string(), + }; + + let res = execute(deps.as_mut(), mock_env(), info, msg); + + match res { + Ok(_) => panic!("Must return error"), + Err(ContractError::Unauthorized { .. }) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + } + + // querying for name resolves to correct address (alice_key) + assert_name_owner(deps.as_ref(), "alice", "alice_key"); + } + + #[test] + fn fails_on_transfer_insufficient_fees() { + let mut deps = mock_dependencies(&[]); + mock_init_with_price(deps.as_mut(), coin(2, "token"), coin(5, "token")); + mock_alice_registers_name(deps.as_mut(), &coins(2, "token")); + + // alice can transfer her name successfully to bob + let info = mock_info("alice_key", &[coin(1, "earth"), coin(2, "token")]); + let msg = ExecuteMsg::Transfer { + name: "alice".to_string(), + to: "bob_key".to_string(), + }; + + let res = execute(deps.as_mut(), mock_env(), info, msg); + + match res { + Ok(_) => panic!("register call should fail with insufficient fees"), + Err(ContractError::InsufficientFundsSend {}) => {} + Err(e) => panic!("Unexpected error: {:?}", e), + } + + // querying for name resolves to correct address (bob_key) + assert_name_owner(deps.as_ref(), "alice", "alice_key"); + } + + #[test] + fn returns_empty_on_query_unregistered_name() { + let mut deps = mock_dependencies(&[]); + + mock_init_no_price(deps.as_mut()); + + // querying for unregistered name results in NotFound error + let res = query( + deps.as_ref(), + mock_env(), + QueryMsg::ResolveRecord { + name: "alice".to_string(), + }, + ) + .unwrap(); + let value: ResolveRecordResponse = from_binary(&res).unwrap(); + assert_eq!(None, value.address); + } +} diff --git a/docs/docs.go b/docs/docs.go new file mode 100644 index 0000000..1167d56 --- /dev/null +++ b/docs/docs.go @@ -0,0 +1,6 @@ +package docs + +import "embed" + +//go:embed static +var Docs embed.FS diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 0000000..342dd1a --- /dev/null +++ b/docs/package.json @@ -0,0 +1,14 @@ +{ + "name": "docs", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "scripts": { + "combine": "swagger-combine ./swagger-combine.config.json -o ../tmp-swagger-gen/swagger.yml -f yaml --continueOnConflictingPaths --includeDefinitions", + "convert": "swagger2openapi ../tmp-swagger-gen/swagger.yml --outfile static/openapi.yml --yaml" + }, + "dependencies": { + "swagger-combine": "^1.4.0", + "swagger2openapi": "^7.0.3" + } + } \ No newline at end of file diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml new file mode 100644 index 0000000..216345f --- /dev/null +++ b/docs/static/openapi.yml @@ -0,0 +1,8113 @@ +openapi: 3.0.0 +info: + title: Quasar - GRPC Gateway Docs + description: A REST interface for state queries, legacy transactions + version: 1.0.0 +paths: + /quasarlabs/epochs/v1beta1/current_epoch: + get: + summary: CurrentEpoch provide current epoch of specified identifier + operationId: CurrentEpoch + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + current_epoch: + type: string + format: int64 + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: identifier + in: query + required: false + schema: + type: string + tags: + - Query + /quasarlabs/epochs/v1beta1/epochs: + get: + summary: EpochInfos provide running epochInfos + operationId: EpochInfos + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + epochs: + type: array + items: + type: object + properties: + identifier: + type: string + start_time: + type: string + format: date-time + duration: + type: string + current_epoch: + type: string + format: int64 + current_epoch_start_time: + type: string + format: date-time + epoch_counting_started: + type: boolean + current_epoch_start_height: + type: string + format: int64 + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + "/quasarlabs/quasarnode/intergamm/get_port_info/{portID}/{destinationChainID}": + get: + summary: Queries a list of GetPortInfo items. + operationId: GetPortInfo + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + portInfo: + type: object + properties: + portID: + type: string + channelID: + type: string + counterpartyChannelID: + type: string + connectionID: + type: string + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: portID + in: path + required: true + schema: + type: string + - name: destinationChainID + in: path + required: true + schema: + type: string + tags: + - Query + "/quasarlabs/quasarnode/intergamm/ica_address_on_denom_native_zone/{owner}/{denom}": + get: + summary: Queries a list of ICAAddressOnDenomNativeZone items. + operationId: ICAAddressOnDenomNativeZone + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + icaAddress: + type: string + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: owner + in: path + required: true + schema: + type: string + - name: denom + in: path + required: true + schema: + type: string + tags: + - Query + "/quasarlabs/quasarnode/intergamm/ica_address_on_zone/{owner}/{zoneId}": + get: + summary: Queries a list of ICAAddressOnZone items. + operationId: ICAAddressOnZone + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + icaAddress: + type: string + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: owner + in: path + required: true + schema: + type: string + - name: zoneId + in: path + required: true + schema: + type: string + tags: + - Query + /quasarlabs/quasarnode/intergamm/interchain_account_from_address: + get: + summary: Queries a list of InterchainAccountFromAddress items. + operationId: InterchainAccountFromAddress + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + interchain_account_address: + type: string + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: owner + in: query + required: false + schema: + type: string + - name: connection_id + in: query + required: false + schema: + type: string + tags: + - Query + /quasarlabs/quasarnode/intergamm/params: + get: + summary: Parameters queries the parameters of the module. + operationId: IntergammParams + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + quasar_denom_to_native_zone_id_map: + type: object + additionalProperties: + type: string + osmosis_denom_to_quasar_denom_map: + type: object + additionalProperties: + type: string + complete_zone_info_map: + type: object + additionalProperties: + type: object + properties: + zone_route_info: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + next_zone_route_map: + type: object + additionalProperties: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + title: IntermediateReceiver + description: QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + /quasarlabs/quasarnode/orion/list_active_lps: + get: + summary: Queries a list of ListActiveLps items. + operationId: ListActiveLps + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + lpIds: + type: array + items: + type: string + format: uint64 + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + /quasarlabs/quasarnode/orion/list_module_accounts: + get: + summary: Queries a list of ListModuleAccounts items. + operationId: ListModuleAccounts + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + accInfo: + type: array + items: + type: object + properties: + name: + type: string + account: + type: string + balance: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: AccountInfo is used for orion module reserve account detail + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + /quasarlabs/quasarnode/orion/lp_epoch_pairs: + get: + summary: Queries a list of LpEpochPairs items. + operationId: LpEpochPairs + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + lpEpochPairs: + type: array + items: + type: object + properties: + lpId: + type: string + format: uint64 + epochDay: + type: string + format: uint64 + description: LpEpochPair indicates the epoch day on which lpId was created. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + /quasarlabs/quasarnode/orion/lp_position: + get: + summary: Queries a LpPosition by index. + operationId: LpPosition + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + LpPosition: + type: object + properties: + seqNo: + type: string + format: uint64 + lpID: + type: string + format: uint64 + lockID: + type: string + format: uint64 + state: + type: string + enum: + - INIT + - JOINING + - JOINED + - JOIN_FAILED + - JOINING_TIMEOUT + - EXITING + - EXITED + - EXIT_FAILED + - EXITING_TIMEOUT + - SETTLED + default: INIT + startTime: + type: string + format: date-time + bondingStartEpochDay: + type: string + format: uint64 + bondDuration: + type: string + format: uint64 + unbondingStartEpochDay: + type: string + format: uint64 + unbondingDuration: + type: string + format: uint64 + poolID: + type: string + format: uint64 + lptoken: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + gaugelocks: + type: array + items: + type: object + properties: + gaugeID: + type: string + format: uint64 + isActive: + type: boolean + lockupDuration: + type: string + expectedApy: + type: string + startTime: + type: string + format: date-time + title: >- + GaugeLockInfo object is used to save the lockup + period, associated approx apy + + and state whether it is active, and start time of this gauge to check the expected aPY + + on any given day. Multiple gaugeLockInfo objects will be associated with each LPPosition + description: >- + LpPosition is used by the strategy during the the Lping + activity. + + Whenever orion module creates an LP position; an object of LpPosition will be created + + for book keeping in the KV store. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: lpId + in: query + required: false + schema: + type: string + format: uint64 + tags: + - Query + /quasarlabs/quasarnode/orion/lp_stat: + get: + summary: Queries a LpStat by index. + operationId: LpStat + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + LpStat: + type: object + properties: + lpCount: + type: string + format: uint64 + totalLPCoins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: >- + LpStat is used to do the book keeping of Lping activity on + a given epochday. + + Which includes, total number of Lping position and total LP tokens as []sdk.Coin + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: epochDay + in: query + required: false + schema: + type: string + format: uint64 + tags: + - Query + /quasarlabs/quasarnode/orion/params: + get: + summary: Parameters queries the parameters of the module. + operationId: OrionParams + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + perf_fee_per: + type: string + mgmt_fee_per: + type: string + lp_epoch_id: + type: string + destination_chain_id: + type: string + enabled: + type: boolean + white_listed_pools: + type: array + items: + type: string + format: uint64 + osmosis_local_info: + type: object + properties: + local_zone_id: + type: string + connection_id: + type: string + chain_id: + type: string + description: Local Information of the other zone in the intergamm module. + description: QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + /quasarlabs/quasarnode/orion/reserve_balance_all: + get: + summary: Queries a list of ReserveBalanceAll items. + operationId: ReserveBalanceAll + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + accInfo: + type: array + items: + type: object + properties: + name: + type: string + account: + type: string + balance: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: AccountInfo is used for orion module reserve account detail + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + /quasarlabs/quasarnode/orion/reward_collection: + get: + summary: Queries a RewardCollection by index. + operationId: RewardCollection + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + RewardCollection: + type: object + properties: + timeCollected: + type: string + format: date-time + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: >- + RewardCollection is used to do the book keeping of the + reward + + collected from the osmosis on a given epochday. This is further used for the approx distribution. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: epochDay + in: query + required: false + schema: + type: string + format: uint64 + tags: + - Query + "/quasarlabs/quasarnode/qbank/get_all_depsoit_infos/{vaultID}": + get: + summary: Queries a list of GetAllDepsoitInfos items. + operationId: GetAllDepsoitInfos + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + depositInfos: + type: array + items: + type: object + properties: + vaultID: + type: string + epochDay: + type: string + format: uint64 + lockupPeriod: + type: string + enum: + - Invalid + - Days_7 + - Days_21 + - Months_1 + - Months_3 + default: Invalid + title: LockupTypes defines different types of locktypes to be used in the system + for users deposit + depositorAccAddress: + type: string + coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: DepositInfo represents the state of a particular deposit + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: vaultID + in: path + required: true + schema: + type: string + tags: + - Query + /quasarlabs/quasarnode/qbank/params: + get: + summary: Parameters queries the parameters of the module. + operationId: QBankParams + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + enabled: + type: boolean + min_orion_epoch_denom_dollar_deposit: + type: string + orion_epoch_identifier: + type: string + white_listed_denoms_in_orion: + type: array + items: + type: object + properties: + origin_name: + type: string + onehop_quasar: + type: string + onehop_osmo: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + "/quasarlabs/quasarnode/qbank/total_claimed/{userAcc}/{vaultID}": + get: + summary: Queries a list of TotalClaimed items. + operationId: TotalClaimed + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + coins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: userAcc + in: path + required: true + schema: + type: string + - name: vaultID + in: path + required: true + schema: + type: string + tags: + - Query + "/quasarlabs/quasarnode/qbank/total_withdraw/{userAcc}/{vaultID}": + get: + summary: Queries a list of TotalWithdraw items. + operationId: TotalWithdraw + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + coins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: userAcc + in: path + required: true + schema: + type: string + - name: vaultID + in: path + required: true + schema: + type: string + tags: + - Query + "/quasarlabs/quasarnode/qbank/user_claim_rewards/{userAcc}": + get: + summary: Queries a list of UserClaimRewards items. + operationId: UserClaimRewards + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + coins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: userAcc + in: path + required: true + schema: + type: string + tags: + - Query + "/quasarlabs/quasarnode/qbank/user_denom_deposit/{userAcc}": + get: + summary: Queries a list of UserDenomDeposit items. + operationId: UserDenomDeposit + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + amount: + type: string + format: uint64 + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: userAcc + in: path + required: true + schema: + type: string + - name: denom + in: query + required: false + schema: + type: string + tags: + - Query + "/quasarlabs/quasarnode/qbank/user_deposit/{userAcc}": + get: + summary: Queries a list of UserDeposit items. + operationId: UserDeposit + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + coins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: userAcc + in: path + required: true + schema: + type: string + tags: + - Query + "/quasarlabs/quasarnode/qbank/withdrawable/{userAccount}/{denom}": + get: + summary: Queries a list of Withdrawable items. + operationId: Withdrawable + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: userAccount + in: path + required: true + schema: + type: string + - name: denom + in: path + required: true + schema: + type: string + tags: + - Query + /quasarlabs/quasarnode/qoracle/oracle_prices: + get: + summary: Queries a list of OraclePrices items. + operationId: OraclePrices + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + prices: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the custom method + + signatures required by gogoproto. + updated_at_height: + type: string + format: int64 + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /quasarlabs/quasarnode/qoracle/osmosis/chain_params: + get: + summary: Queries a list of OsmosisChainParams items. + operationId: OsmosisChainParams + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + epochs_info: + type: array + items: + type: object + properties: + identifier: + type: string + description: identifier is a unique reference to this particular timer. + start_time: + type: string + format: date-time + description: >- + 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. + duration: + type: string + description: >- + 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. + current_epoch: + type: string + format: int64 + description: >- + 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. + current_epoch_start_time: + type: string + format: date-time + description: >- + 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] + epoch_counting_started: + type: boolean + description: >- + epoch_counting_started is a boolean, that indicates + whether this + + epoch timer has began yet. + current_epoch_start_height: + type: string + format: int64 + title: >- + current_epoch_start_height is the block height at + which the current epoch + + started. (The block height at which the timer last ticked) + description: |- + EpochInfo is a struct that describes the data going into + a timer defined by the x/epochs module. + lockable_durations: + type: array + items: + type: string + format: int64 + mint_params: + type: object + properties: + mint_denom: + type: string + description: mint_denom is the denom of the coin to mint. + genesis_epoch_provisions: + type: string + description: genesis_epoch_provisions epoch provisions from the first epoch. + epoch_identifier: + type: string + description: epoch_identifier mint epoch identifier e.g. (day, week). + reduction_period_in_epochs: + type: string + format: int64 + description: >- + reduction_period_in_epochs the number of epochs it + takes + + to reduce the rewards. + reduction_factor: + type: string + description: >- + reduction_factor is the reduction multiplier to + execute + + at the end of each period set by reduction_period_in_epochs. + distribution_proportions: + description: >- + distribution_proportions defines the distribution + proportions of the minted + + denom. In other words, defines which stakeholders will receive the minted + + denoms and how much. + type: object + properties: + staking: + type: string + description: >- + staking defines the proportion of the minted + mint_denom that is to be + + allocated as staking rewards. + pool_incentives: + type: string + description: >- + pool_incentives defines the proportion of the + minted mint_denom that is + + to be allocated as pool incentives. + developer_rewards: + type: string + description: >- + developer_rewards defines the proportion of the + minted mint_denom that is + + to be allocated to developer rewards address. + community_pool: + type: string + description: >- + community_pool defines the proportion of the + minted mint_denom that is + + to be allocated to the community pool. + weighted_developer_rewards_receivers: + type: array + items: + type: object + properties: + address: + type: string + weight: + type: string + description: >- + 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. + description: >- + 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. + minting_rewards_distribution_start_epoch: + type: string + format: int64 + title: >- + minting_rewards_distribution_start_epoch start epoch + to distribute minting + + rewards + description: Params holds parameters for the x/mint module. + mint_epoch_provisions: + type: string + distr_info: + type: object + properties: + total_weight: + type: string + records: + type: array + items: + type: object + properties: + gauge_id: + type: string + format: uint64 + weight: + type: string + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /quasarlabs/quasarnode/qoracle/osmosis/incentivized_pools: + get: + summary: Queries a list of OsmosisIncentivizedPools items. + operationId: OsmosisIncentivizedPools + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + incentivized_pools: + type: array + items: + type: object + properties: + pool_id: + type: string + format: uint64 + lockable_duration: + type: string + gauge_id: + type: string + format: uint64 + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /quasarlabs/quasarnode/qoracle/osmosis/pools: + get: + summary: Queries a list of OsmosisPools items. + operationId: OsmosisPools + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + pools: + type: array + items: + type: object + properties: + pool_info: + type: object + properties: + address: + type: string + id: + type: string + format: uint64 + pool_params: + type: object + properties: + swap_fee: + type: string + exit_fee: + type: string + smooth_weight_change_params: + type: object + properties: + start_time: + type: string + format: date-time + description: >- + 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. + duration: + type: string + title: Duration for the weights to change over + initial_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + target_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + title: >- + 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 + description: >- + 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. + future_pool_governor: + type: string + title: >- + 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 + total_shares: + title: sum of all LP tokens sent out + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + pool_assets: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + title: >- + These are assumed to be sorted by denomiation. + + They contain the pool asset and the information about the weight + total_weight: + type: string + title: sum of all non-normalized pool weights + metrics: + type: object + properties: + apy: + type: string + format: byte + tvl: + type: string + format: byte + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: >- + next_key is the key to be passed to PageRequest.key to + + query the next page most efficiently. It will be empty if + + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages + where the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + schema: + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key should + + be set. + in: query + required: false + schema: + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + schema: + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in UIs. + + count_total is only respected when offset is used. It is ignored when key + + is set. + in: query + required: false + schema: + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + schema: + type: boolean + tags: + - Query + /quasarlabs/quasarnode/qoracle/params: + get: + summary: Parameters queries the parameters of the module. + operationId: QOracleParams + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + bandchain_params: + type: object + properties: + oracle_ibc_params: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + coin_rates_params: + type: object + properties: + epoch_identifier: + type: string + symbols: + type: array + items: + type: string + script_params: + type: object + properties: + script_id: + type: string + format: uint64 + ask_count: + type: string + format: uint64 + min_count: + type: string + format: uint64 + fee_limit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination + and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + prepare_gas: + type: string + format: uint64 + execute_gas: + type: string + format: uint64 + osmosis_params: + type: object + properties: + icq_params: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + epoch_identifier: + type: string + denom_price_mappings: + type: array + items: + type: object + properties: + denom: + type: string + oracle_denom: + type: string + multiplier: + type: string + oneHopDenomMap: + type: array + items: + type: object + properties: + originName: + type: string + quasar: + type: string + osmo: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /quasarlabs/quasarnode/qoracle/state: + get: + summary: Queries a list of State items. + operationId: State + responses: + "200": + description: A successful response. + content: + "*/*": + schema: + type: object + properties: + coin_rates_state: + type: object + properties: + call_data: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + request_packet_sequence: + type: string + format: uint64 + oracle_request_id: + type: string + format: uint64 + result_packet_sequence: + type: string + format: uint64 + result: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + failed: + type: boolean + updated_at_height: + type: string + format: int64 + osmosis_params_request_state: + type: object + properties: + packet_sequence: + type: string + format: uint64 + acknowledged: + type: boolean + failed: + type: boolean + updated_at_height: + type: string + format: int64 + osmosis_incentivized_pools_state: + type: object + properties: + packet_sequence: + type: string + format: uint64 + acknowledged: + type: boolean + failed: + type: boolean + updated_at_height: + type: string + format: int64 + osmosis_pools_state: + type: object + properties: + packet_sequence: + type: string + format: uint64 + acknowledged: + type: boolean + failed: + type: boolean + updated_at_height: + type: string + format: int64 + default: + description: An unexpected error response. + content: + "*/*": + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query +components: + schemas: + google.protobuf.Any: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + grpc.gateway.runtime.Error: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + quasarlabs.quasarnode.epochs.EpochInfo: + type: object + properties: + identifier: + type: string + start_time: + type: string + format: date-time + duration: + type: string + current_epoch: + type: string + format: int64 + current_epoch_start_time: + type: string + format: date-time + epoch_counting_started: + type: boolean + current_epoch_start_height: + type: string + format: int64 + quasarlabs.quasarnode.epochs.QueryCurrentEpochResponse: + type: object + properties: + current_epoch: + type: string + format: int64 + quasarlabs.quasarnode.epochs.QueryEpochsInfoResponse: + type: object + properties: + epochs: + type: array + items: + type: object + properties: + identifier: + type: string + start_time: + type: string + format: date-time + duration: + type: string + current_epoch: + type: string + format: int64 + current_epoch_start_time: + type: string + format: date-time + epoch_counting_started: + type: boolean + current_epoch_start_height: + type: string + format: int64 + quasarlabs.quasarnode.intergamm.Params: + type: object + properties: + quasar_denom_to_native_zone_id_map: + type: object + additionalProperties: + type: string + osmosis_denom_to_quasar_denom_map: + type: object + additionalProperties: + type: string + complete_zone_info_map: + type: object + additionalProperties: + type: object + properties: + zone_route_info: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + next_zone_route_map: + type: object + additionalProperties: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + title: IntermediateReceiver + description: Params defines the parameters for the module. + quasarlabs.quasarnode.intergamm.PortInfo: + type: object + properties: + portID: + type: string + channelID: + type: string + counterpartyChannelID: + type: string + connectionID: + type: string + quasarlabs.quasarnode.intergamm.QueryGetPortInfoResponse: + type: object + properties: + portInfo: + type: object + properties: + portID: + type: string + channelID: + type: string + counterpartyChannelID: + type: string + connectionID: + type: string + quasarlabs.quasarnode.intergamm.QueryICAAddressOnDenomNativeZoneResponse: + type: object + properties: + icaAddress: + type: string + quasarlabs.quasarnode.intergamm.QueryICAAddressOnZoneResponse: + type: object + properties: + icaAddress: + type: string + quasarlabs.quasarnode.intergamm.QueryInterchainAccountFromAddressResponse: + type: object + properties: + interchain_account_address: + type: string + quasarlabs.quasarnode.intergamm.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + quasar_denom_to_native_zone_id_map: + type: object + additionalProperties: + type: string + osmosis_denom_to_quasar_denom_map: + type: object + additionalProperties: + type: string + complete_zone_info_map: + type: object + additionalProperties: + type: object + properties: + zone_route_info: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + next_zone_route_map: + type: object + additionalProperties: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + title: IntermediateReceiver + description: QueryParamsResponse is response type for the Query/Params RPC method. + quasarlabs.quasarnode.intergamm.ZoneCompleteInfo: + type: object + properties: + zone_route_info: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + next_zone_route_map: + type: object + additionalProperties: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + title: IntermediateReceiver + quasarlabs.quasarnode.intergamm.ZoneRouteInfo: + type: object + properties: + zone_id: + type: string + title: "zone ID: a unique ID for source zone of this route" + chain_id: + type: string + title: chain ID of the source zone + counterparty_zone_id: + type: string + title: "counterparty zone ID: a unique ID for destination zone of this route" + counterparty_chain_id: + type: string + title: chain ID of the destination zone + connection_id: + type: string + title: IBC connection ID from source to destination + port_id: + type: string + title: IBC port ID from source to destination (usually 'transfer') + channel_id: + type: string + title: IBC channel ID from source to destination + counterparty_connection_id: + type: string + title: IBC counterparty connection ID from destination to source + counterparty_port_id: + type: string + title: IBC counterparty port ID from destination to source (usually 'transfer') + counterparty_channel_id: + type: string + title: IBC counterparty channel ID from destination to source + counterparty_version: + type: string + title: IBC counterparty version + cosmos.base.v1beta1.Coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + quasarlabs.quasarnode.orion.AccountInfo: + type: object + properties: + name: + type: string + account: + type: string + balance: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: AccountInfo is used for orion module reserve account detail + quasarlabs.quasarnode.orion.GaugeLockInfo: + type: object + properties: + gaugeID: + type: string + format: uint64 + isActive: + type: boolean + lockupDuration: + type: string + expectedApy: + type: string + startTime: + type: string + format: date-time + title: >- + GaugeLockInfo object is used to save the lockup period, associated + approx apy + + and state whether it is active, and start time of this gauge to check the expected aPY + + on any given day. Multiple gaugeLockInfo objects will be associated with each LPPosition + quasarlabs.quasarnode.orion.LpEpochPair: + type: object + properties: + lpId: + type: string + format: uint64 + epochDay: + type: string + format: uint64 + description: LpEpochPair indicates the epoch day on which lpId was created. + quasarlabs.quasarnode.orion.LpPosition: + type: object + properties: + seqNo: + type: string + format: uint64 + lpID: + type: string + format: uint64 + lockID: + type: string + format: uint64 + state: + type: string + enum: + - INIT + - JOINING + - JOINED + - JOIN_FAILED + - JOINING_TIMEOUT + - EXITING + - EXITED + - EXIT_FAILED + - EXITING_TIMEOUT + - SETTLED + default: INIT + startTime: + type: string + format: date-time + bondingStartEpochDay: + type: string + format: uint64 + bondDuration: + type: string + format: uint64 + unbondingStartEpochDay: + type: string + format: uint64 + unbondingDuration: + type: string + format: uint64 + poolID: + type: string + format: uint64 + lptoken: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + gaugelocks: + type: array + items: + type: object + properties: + gaugeID: + type: string + format: uint64 + isActive: + type: boolean + lockupDuration: + type: string + expectedApy: + type: string + startTime: + type: string + format: date-time + title: >- + GaugeLockInfo object is used to save the lockup period, associated + approx apy + + and state whether it is active, and start time of this gauge to check the expected aPY + + on any given day. Multiple gaugeLockInfo objects will be associated with each LPPosition + description: >- + LpPosition is used by the strategy during the the Lping activity. + + Whenever orion module creates an LP position; an object of LpPosition will be created + + for book keeping in the KV store. + quasarlabs.quasarnode.orion.LpStat: + type: object + properties: + lpCount: + type: string + format: uint64 + totalLPCoins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: >- + LpStat is used to do the book keeping of Lping activity on a given + epochday. + + Which includes, total number of Lping position and total LP tokens as []sdk.Coin + quasarlabs.quasarnode.orion.LpState: + type: string + enum: + - INIT + - JOINING + - JOINED + - JOIN_FAILED + - JOINING_TIMEOUT + - EXITING + - EXITED + - EXIT_FAILED + - EXITING_TIMEOUT + - SETTLED + default: INIT + quasarlabs.quasarnode.orion.Params: + type: object + properties: + perf_fee_per: + type: string + mgmt_fee_per: + type: string + lp_epoch_id: + type: string + destination_chain_id: + type: string + enabled: + type: boolean + white_listed_pools: + type: array + items: + type: string + format: uint64 + osmosis_local_info: + type: object + properties: + local_zone_id: + type: string + connection_id: + type: string + chain_id: + type: string + description: Local Information of the other zone in the intergamm module. + description: Params defines the parameters for the module. + quasarlabs.quasarnode.orion.QueryGetLpPositionResponse: + type: object + properties: + LpPosition: + type: object + properties: + seqNo: + type: string + format: uint64 + lpID: + type: string + format: uint64 + lockID: + type: string + format: uint64 + state: + type: string + enum: + - INIT + - JOINING + - JOINED + - JOIN_FAILED + - JOINING_TIMEOUT + - EXITING + - EXITED + - EXIT_FAILED + - EXITING_TIMEOUT + - SETTLED + default: INIT + startTime: + type: string + format: date-time + bondingStartEpochDay: + type: string + format: uint64 + bondDuration: + type: string + format: uint64 + unbondingStartEpochDay: + type: string + format: uint64 + unbondingDuration: + type: string + format: uint64 + poolID: + type: string + format: uint64 + lptoken: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + gaugelocks: + type: array + items: + type: object + properties: + gaugeID: + type: string + format: uint64 + isActive: + type: boolean + lockupDuration: + type: string + expectedApy: + type: string + startTime: + type: string + format: date-time + title: >- + GaugeLockInfo object is used to save the lockup period, + associated approx apy + + and state whether it is active, and start time of this gauge to check the expected aPY + + on any given day. Multiple gaugeLockInfo objects will be associated with each LPPosition + description: >- + LpPosition is used by the strategy during the the Lping activity. + + Whenever orion module creates an LP position; an object of LpPosition will be created + + for book keeping in the KV store. + quasarlabs.quasarnode.orion.QueryGetLpStatResponse: + type: object + properties: + LpStat: + type: object + properties: + lpCount: + type: string + format: uint64 + totalLPCoins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: >- + LpStat is used to do the book keeping of Lping activity on a given + epochday. + + Which includes, total number of Lping position and total LP tokens as []sdk.Coin + quasarlabs.quasarnode.orion.QueryGetRewardCollectionResponse: + type: object + properties: + RewardCollection: + type: object + properties: + timeCollected: + type: string + format: date-time + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: >- + RewardCollection is used to do the book keeping of the reward + + collected from the osmosis on a given epochday. This is further used for the approx distribution. + quasarlabs.quasarnode.orion.QueryListActiveLpsResponse: + type: object + properties: + lpIds: + type: array + items: + type: string + format: uint64 + quasarlabs.quasarnode.orion.QueryListModuleAccountsResponse: + type: object + properties: + accInfo: + type: array + items: + type: object + properties: + name: + type: string + account: + type: string + balance: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: AccountInfo is used for orion module reserve account detail + quasarlabs.quasarnode.orion.QueryLpEpochPairsResponse: + type: object + properties: + lpEpochPairs: + type: array + items: + type: object + properties: + lpId: + type: string + format: uint64 + epochDay: + type: string + format: uint64 + description: LpEpochPair indicates the epoch day on which lpId was created. + quasarlabs.quasarnode.orion.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + perf_fee_per: + type: string + mgmt_fee_per: + type: string + lp_epoch_id: + type: string + destination_chain_id: + type: string + enabled: + type: boolean + white_listed_pools: + type: array + items: + type: string + format: uint64 + osmosis_local_info: + type: object + properties: + local_zone_id: + type: string + connection_id: + type: string + chain_id: + type: string + description: Local Information of the other zone in the intergamm module. + description: QueryParamsResponse is response type for the Query/Params RPC method. + quasarlabs.quasarnode.orion.QueryReserveBalanceAllResponse: + type: object + properties: + accInfo: + type: array + items: + type: object + properties: + name: + type: string + account: + type: string + balance: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: AccountInfo is used for orion module reserve account detail + quasarlabs.quasarnode.orion.RewardCollection: + type: object + properties: + timeCollected: + type: string + format: date-time + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: >- + RewardCollection is used to do the book keeping of the reward + + collected from the osmosis on a given epochday. This is further used for the approx distribution. + quasarlabs.quasarnode.orion.ZoneLocalInfo: + type: object + properties: + local_zone_id: + type: string + connection_id: + type: string + chain_id: + type: string + description: Local Information of the other zone in the intergamm module. + quasarlabs.quasarnode.qbank.DepositInfo: + type: object + properties: + vaultID: + type: string + epochDay: + type: string + format: uint64 + lockupPeriod: + type: string + enum: + - Invalid + - Days_7 + - Days_21 + - Months_1 + - Months_3 + default: Invalid + title: LockupTypes defines different types of locktypes to be used in the system + for users deposit + depositorAccAddress: + type: string + coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: DepositInfo represents the state of a particular deposit + quasarlabs.quasarnode.qbank.LockupTypes: + type: string + enum: + - Invalid + - Days_7 + - Days_21 + - Months_1 + - Months_3 + default: Invalid + title: LockupTypes defines different types of locktypes to be used in the system + for users deposit + quasarlabs.quasarnode.qbank.Params: + type: object + properties: + enabled: + type: boolean + min_orion_epoch_denom_dollar_deposit: + type: string + orion_epoch_identifier: + type: string + white_listed_denoms_in_orion: + type: array + items: + type: object + properties: + origin_name: + type: string + onehop_quasar: + type: string + onehop_osmo: + type: string + description: Params defines the parameters for the module. + quasarlabs.quasarnode.qbank.QCoins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + quasarlabs.quasarnode.qbank.QueryGetAllDepsoitInfosResponse: + type: object + properties: + depositInfos: + type: array + items: + type: object + properties: + vaultID: + type: string + epochDay: + type: string + format: uint64 + lockupPeriod: + type: string + enum: + - Invalid + - Days_7 + - Days_21 + - Months_1 + - Months_3 + default: Invalid + title: LockupTypes defines different types of locktypes to be used in the system + for users deposit + depositorAccAddress: + type: string + coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + title: DepositInfo represents the state of a particular deposit + quasarlabs.quasarnode.qbank.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + enabled: + type: boolean + min_orion_epoch_denom_dollar_deposit: + type: string + orion_epoch_identifier: + type: string + white_listed_denoms_in_orion: + type: array + items: + type: object + properties: + origin_name: + type: string + onehop_quasar: + type: string + onehop_osmo: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + quasarlabs.quasarnode.qbank.QueryTotalClaimedResponse: + type: object + properties: + coins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + quasarlabs.quasarnode.qbank.QueryTotalWithdrawResponse: + type: object + properties: + coins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + quasarlabs.quasarnode.qbank.QueryUserClaimRewardsResponse: + type: object + properties: + coins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + quasarlabs.quasarnode.qbank.QueryUserDenomDepositResponse: + type: object + properties: + amount: + type: string + format: uint64 + quasarlabs.quasarnode.qbank.QueryUserDepositResponse: + type: object + properties: + coins: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + description: QCoins defines encoding/decoding for the slice of sdk.coins to be + used in KV stores. + quasarlabs.quasarnode.qbank.QueryWithdrawableResponse: + type: object + properties: + coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + quasarlabs.quasarnode.qbank.WhiteListedDenomInOrion: + type: object + properties: + origin_name: + type: string + onehop_quasar: + type: string + onehop_osmo: + type: string + cosmos.base.query.v1beta1.PageRequest: + type: object + properties: + key: + type: string + format: byte + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + offset: + type: string + format: uint64 + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key should + + be set. + limit: + type: string + format: uint64 + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + count_total: + type: boolean + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in UIs. + + count_total is only respected when offset is used. It is ignored when key + + is set. + reverse: + type: boolean + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + description: |- + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } + title: |- + PageRequest is to be embedded in gRPC request messages for efficient + pagination. Ex: + cosmos.base.query.v1beta1.PageResponse: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + cosmos.base.v1beta1.DecCoin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + ibc.core.client.v1.Height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + osmosis.epochs.v1beta1.EpochInfo: + type: object + properties: + identifier: + type: string + description: identifier is a unique reference to this particular timer. + start_time: + type: string + format: date-time + description: >- + 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. + duration: + type: string + description: |- + 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. + current_epoch: + type: string + format: int64 + description: >- + 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. + current_epoch_start_time: + type: string + format: date-time + description: >- + 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] + epoch_counting_started: + type: boolean + description: |- + epoch_counting_started is a boolean, that indicates whether this + epoch timer has began yet. + current_epoch_start_height: + type: string + format: int64 + title: >- + current_epoch_start_height is the block height at which the current + epoch + + started. (The block height at which the timer last ticked) + description: |- + EpochInfo is a struct that describes the data going into + a timer defined by the x/epochs module. + osmosis.gamm.v1beta1.Pool: + type: object + properties: + address: + type: string + id: + type: string + format: uint64 + pool_params: + type: object + properties: + swap_fee: + type: string + exit_fee: + type: string + smooth_weight_change_params: + type: object + properties: + start_time: + type: string + format: date-time + description: >- + 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. + duration: + type: string + title: Duration for the weights to change over + initial_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + target_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + title: >- + 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 + description: >- + 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. + future_pool_governor: + type: string + title: >- + 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 + total_shares: + title: sum of all LP tokens sent out + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + pool_assets: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: |- + 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. + title: |- + These are assumed to be sorted by denomiation. + They contain the pool asset and the information about the weight + total_weight: + type: string + title: sum of all non-normalized pool weights + osmosis.gamm.v1beta1.PoolAsset: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: |- + 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. + osmosis.gamm.v1beta1.PoolParams: + type: object + properties: + swap_fee: + type: string + exit_fee: + type: string + smooth_weight_change_params: + type: object + properties: + start_time: + type: string + format: date-time + description: |- + 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. + duration: + type: string + title: Duration for the weights to change over + initial_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + target_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + title: >- + 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 + description: >- + 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. + osmosis.gamm.v1beta1.SmoothWeightChangeParams: + type: object + properties: + start_time: + type: string + format: date-time + description: |- + 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. + duration: + type: string + title: Duration for the weights to change over + initial_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: |- + 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. + description: >- + 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. + target_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: |- + 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. + description: >- + 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. + title: |- + 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 + osmosis.mint.v1beta1.DistributionProportions: + type: object + properties: + staking: + type: string + description: >- + staking defines the proportion of the minted mint_denom that is to + be + + allocated as staking rewards. + pool_incentives: + type: string + description: >- + pool_incentives defines the proportion of the minted mint_denom that + is + + to be allocated as pool incentives. + developer_rewards: + type: string + description: >- + developer_rewards defines the proportion of the minted mint_denom + that is + + to be allocated to developer rewards address. + community_pool: + type: string + description: >- + community_pool defines the proportion of the minted mint_denom that + is + + to be allocated to the community pool. + description: >- + DistributionProportions defines the distribution proportions of the + minted + + denom. In other words, defines which stakeholders will receive the minted + + denoms and how much. + osmosis.mint.v1beta1.Params: + type: object + properties: + mint_denom: + type: string + description: mint_denom is the denom of the coin to mint. + genesis_epoch_provisions: + type: string + description: genesis_epoch_provisions epoch provisions from the first epoch. + epoch_identifier: + type: string + description: epoch_identifier mint epoch identifier e.g. (day, week). + reduction_period_in_epochs: + type: string + format: int64 + description: |- + reduction_period_in_epochs the number of epochs it takes + to reduce the rewards. + reduction_factor: + type: string + description: |- + reduction_factor is the reduction multiplier to execute + at the end of each period set by reduction_period_in_epochs. + distribution_proportions: + description: >- + distribution_proportions defines the distribution proportions of the + minted + + denom. In other words, defines which stakeholders will receive the minted + + denoms and how much. + type: object + properties: + staking: + type: string + description: >- + staking defines the proportion of the minted mint_denom that is + to be + + allocated as staking rewards. + pool_incentives: + type: string + description: >- + pool_incentives defines the proportion of the minted mint_denom + that is + + to be allocated as pool incentives. + developer_rewards: + type: string + description: >- + developer_rewards defines the proportion of the minted + mint_denom that is + + to be allocated to developer rewards address. + community_pool: + type: string + description: >- + community_pool defines the proportion of the minted mint_denom + that is + + to be allocated to the community pool. + weighted_developer_rewards_receivers: + type: array + items: + type: object + properties: + address: + type: string + weight: + type: string + description: >- + 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. + description: >- + 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. + minting_rewards_distribution_start_epoch: + type: string + format: int64 + title: >- + minting_rewards_distribution_start_epoch start epoch to distribute + minting + + rewards + description: Params holds parameters for the x/mint module. + osmosis.mint.v1beta1.WeightedAddress: + type: object + properties: + address: + type: string + weight: + type: string + description: |- + 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. + osmosis.poolincentives.v1beta1.DistrInfo: + type: object + properties: + total_weight: + type: string + records: + type: array + items: + type: object + properties: + gauge_id: + type: string + format: uint64 + weight: + type: string + osmosis.poolincentives.v1beta1.DistrRecord: + type: object + properties: + gauge_id: + type: string + format: uint64 + weight: + type: string + osmosis.poolincentives.v1beta1.IncentivizedPool: + type: object + properties: + pool_id: + type: string + format: uint64 + lockable_duration: + type: string + gauge_id: + type: string + format: uint64 + quasarlabs.quasarnode.qoracle.BandchainParams: + type: object + properties: + oracle_ibc_params: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + coin_rates_params: + type: object + properties: + epoch_identifier: + type: string + symbols: + type: array + items: + type: string + script_params: + type: object + properties: + script_id: + type: string + format: uint64 + ask_count: + type: string + format: uint64 + min_count: + type: string + format: uint64 + fee_limit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + prepare_gas: + type: string + format: uint64 + execute_gas: + type: string + format: uint64 + quasarlabs.quasarnode.qoracle.CoinRatesParams: + type: object + properties: + epoch_identifier: + type: string + symbols: + type: array + items: + type: string + script_params: + type: object + properties: + script_id: + type: string + format: uint64 + ask_count: + type: string + format: uint64 + min_count: + type: string + format: uint64 + fee_limit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + prepare_gas: + type: string + format: uint64 + execute_gas: + type: string + format: uint64 + quasarlabs.quasarnode.qoracle.DenomPriceMapping: + type: object + properties: + denom: + type: string + oracle_denom: + type: string + multiplier: + type: string + quasarlabs.quasarnode.qoracle.IBCParams: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + quasarlabs.quasarnode.qoracle.OneHopIbcDenomMapping: + type: object + properties: + originName: + type: string + quasar: + type: string + osmo: + type: string + quasarlabs.quasarnode.qoracle.OracleScriptParams: + type: object + properties: + script_id: + type: string + format: uint64 + ask_count: + type: string + format: uint64 + min_count: + type: string + format: uint64 + fee_limit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + prepare_gas: + type: string + format: uint64 + execute_gas: + type: string + format: uint64 + quasarlabs.quasarnode.qoracle.OracleScriptState: + type: object + properties: + call_data: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + request_packet_sequence: + type: string + format: uint64 + oracle_request_id: + type: string + format: uint64 + result_packet_sequence: + type: string + format: uint64 + result: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + failed: + type: boolean + updated_at_height: + type: string + format: int64 + quasarlabs.quasarnode.qoracle.OsmosisParams: + type: object + properties: + icq_params: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + epoch_identifier: + type: string + quasarlabs.quasarnode.qoracle.OsmosisPool: + type: object + properties: + pool_info: + type: object + properties: + address: + type: string + id: + type: string + format: uint64 + pool_params: + type: object + properties: + swap_fee: + type: string + exit_fee: + type: string + smooth_weight_change_params: + type: object + properties: + start_time: + type: string + format: date-time + description: >- + 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. + duration: + type: string + title: Duration for the weights to change over + initial_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + target_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + title: >- + 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 + description: >- + 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. + future_pool_governor: + type: string + title: >- + 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 + total_shares: + title: sum of all LP tokens sent out + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + pool_assets: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + title: |- + These are assumed to be sorted by denomiation. + They contain the pool asset and the information about the weight + total_weight: + type: string + title: sum of all non-normalized pool weights + metrics: + type: object + properties: + apy: + type: string + format: byte + tvl: + type: string + format: byte + quasarlabs.quasarnode.qoracle.OsmosisPoolMetrics: + type: object + properties: + apy: + type: string + format: byte + tvl: + type: string + format: byte + quasarlabs.quasarnode.qoracle.OsmosisRequestState: + type: object + properties: + packet_sequence: + type: string + format: uint64 + acknowledged: + type: boolean + failed: + type: boolean + updated_at_height: + type: string + format: int64 + quasarlabs.quasarnode.qoracle.Params: + type: object + properties: + bandchain_params: + type: object + properties: + oracle_ibc_params: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + coin_rates_params: + type: object + properties: + epoch_identifier: + type: string + symbols: + type: array + items: + type: string + script_params: + type: object + properties: + script_id: + type: string + format: uint64 + ask_count: + type: string + format: uint64 + min_count: + type: string + format: uint64 + fee_limit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + prepare_gas: + type: string + format: uint64 + execute_gas: + type: string + format: uint64 + osmosis_params: + type: object + properties: + icq_params: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + epoch_identifier: + type: string + denom_price_mappings: + type: array + items: + type: object + properties: + denom: + type: string + oracle_denom: + type: string + multiplier: + type: string + oneHopDenomMap: + type: array + items: + type: object + properties: + originName: + type: string + quasar: + type: string + osmo: + type: string + description: Params defines the parameters for the module. + quasarlabs.quasarnode.qoracle.QueryOraclePricesResponse: + type: object + properties: + prices: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal amount. + + + NOTE: The amount field is an Dec which implements the custom method + + signatures required by gogoproto. + updated_at_height: + type: string + format: int64 + quasarlabs.quasarnode.qoracle.QueryOsmosisChainParamsResponse: + type: object + properties: + epochs_info: + type: array + items: + type: object + properties: + identifier: + type: string + description: identifier is a unique reference to this particular timer. + start_time: + type: string + format: date-time + description: >- + 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. + duration: + type: string + description: |- + 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. + current_epoch: + type: string + format: int64 + description: >- + 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. + current_epoch_start_time: + type: string + format: date-time + description: >- + 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] + epoch_counting_started: + type: boolean + description: >- + epoch_counting_started is a boolean, that indicates whether + this + + epoch timer has began yet. + current_epoch_start_height: + type: string + format: int64 + title: >- + current_epoch_start_height is the block height at which the + current epoch + + started. (The block height at which the timer last ticked) + description: |- + EpochInfo is a struct that describes the data going into + a timer defined by the x/epochs module. + lockable_durations: + type: array + items: + type: string + format: int64 + mint_params: + type: object + properties: + mint_denom: + type: string + description: mint_denom is the denom of the coin to mint. + genesis_epoch_provisions: + type: string + description: genesis_epoch_provisions epoch provisions from the first epoch. + epoch_identifier: + type: string + description: epoch_identifier mint epoch identifier e.g. (day, week). + reduction_period_in_epochs: + type: string + format: int64 + description: |- + reduction_period_in_epochs the number of epochs it takes + to reduce the rewards. + reduction_factor: + type: string + description: |- + reduction_factor is the reduction multiplier to execute + at the end of each period set by reduction_period_in_epochs. + distribution_proportions: + description: >- + distribution_proportions defines the distribution proportions of + the minted + + denom. In other words, defines which stakeholders will receive the minted + + denoms and how much. + type: object + properties: + staking: + type: string + description: >- + staking defines the proportion of the minted mint_denom that + is to be + + allocated as staking rewards. + pool_incentives: + type: string + description: >- + pool_incentives defines the proportion of the minted + mint_denom that is + + to be allocated as pool incentives. + developer_rewards: + type: string + description: >- + developer_rewards defines the proportion of the minted + mint_denom that is + + to be allocated to developer rewards address. + community_pool: + type: string + description: >- + community_pool defines the proportion of the minted + mint_denom that is + + to be allocated to the community pool. + weighted_developer_rewards_receivers: + type: array + items: + type: object + properties: + address: + type: string + weight: + type: string + description: >- + 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. + description: >- + 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. + minting_rewards_distribution_start_epoch: + type: string + format: int64 + title: >- + minting_rewards_distribution_start_epoch start epoch to + distribute minting + + rewards + description: Params holds parameters for the x/mint module. + mint_epoch_provisions: + type: string + distr_info: + type: object + properties: + total_weight: + type: string + records: + type: array + items: + type: object + properties: + gauge_id: + type: string + format: uint64 + weight: + type: string + quasarlabs.quasarnode.qoracle.QueryOsmosisIncentivizedPoolsResponse: + type: object + properties: + incentivized_pools: + type: array + items: + type: object + properties: + pool_id: + type: string + format: uint64 + lockable_duration: + type: string + gauge_id: + type: string + format: uint64 + quasarlabs.quasarnode.qoracle.QueryOsmosisPoolsResponse: + type: object + properties: + pools: + type: array + items: + type: object + properties: + pool_info: + type: object + properties: + address: + type: string + id: + type: string + format: uint64 + pool_params: + type: object + properties: + swap_fee: + type: string + exit_fee: + type: string + smooth_weight_change_params: + type: object + properties: + start_time: + type: string + format: date-time + description: >- + 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. + duration: + type: string + title: Duration for the weights to change over + initial_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + target_pool_weights: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + description: >- + 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. + title: >- + 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 + description: >- + 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. + future_pool_governor: + type: string + title: >- + 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 + total_shares: + title: sum of all LP tokens sent out + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + pool_assets: + type: array + items: + type: object + properties: + token: + description: >- + Coins we are talking about, + + the denomination must be unique amongst all PoolAssets for this pool. + type: object + properties: + denom: + type: string + amount: + type: string + weight: + type: string + title: Weight that is not normalized. This weight must be less than 2^50 + description: >- + 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. + title: >- + These are assumed to be sorted by denomiation. + + They contain the pool asset and the information about the weight + total_weight: + type: string + title: sum of all non-normalized pool weights + metrics: + type: object + properties: + apy: + type: string + format: byte + tvl: + type: string + format: byte + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + quasarlabs.quasarnode.qoracle.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + bandchain_params: + type: object + properties: + oracle_ibc_params: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + coin_rates_params: + type: object + properties: + epoch_identifier: + type: string + symbols: + type: array + items: + type: string + script_params: + type: object + properties: + script_id: + type: string + format: uint64 + ask_count: + type: string + format: uint64 + min_count: + type: string + format: uint64 + fee_limit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the custom method + + signatures required by gogoproto. + prepare_gas: + type: string + format: uint64 + execute_gas: + type: string + format: uint64 + osmosis_params: + type: object + properties: + icq_params: + type: object + properties: + authorized_channel: + type: string + timeout_height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + 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 + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating and + + freezing clients + timeout_timestamp: + type: string + format: uint64 + epoch_identifier: + type: string + denom_price_mappings: + type: array + items: + type: object + properties: + denom: + type: string + oracle_denom: + type: string + multiplier: + type: string + oneHopDenomMap: + type: array + items: + type: object + properties: + originName: + type: string + quasar: + type: string + osmo: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + quasarlabs.quasarnode.qoracle.QueryStateResponse: + type: object + properties: + coin_rates_state: + type: object + properties: + call_data: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + request_packet_sequence: + type: string + format: uint64 + oracle_request_id: + type: string + format: uint64 + result_packet_sequence: + type: string + format: uint64 + result: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they + + expect it to use in the context of Any. However, for URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + failed: + type: boolean + updated_at_height: + type: string + format: int64 + osmosis_params_request_state: + type: object + properties: + packet_sequence: + type: string + format: uint64 + acknowledged: + type: boolean + failed: + type: boolean + updated_at_height: + type: string + format: int64 + osmosis_incentivized_pools_state: + type: object + properties: + packet_sequence: + type: string + format: uint64 + acknowledged: + type: boolean + failed: + type: boolean + updated_at_height: + type: string + format: int64 + osmosis_pools_state: + type: object + properties: + packet_sequence: + type: string + format: uint64 + acknowledged: + type: boolean + failed: + type: boolean + updated_at_height: + type: string + format: int64 diff --git a/docs/swagger-combine.config.json b/docs/swagger-combine.config.json new file mode 100644 index 0000000..dcbe6cb --- /dev/null +++ b/docs/swagger-combine.config.json @@ -0,0 +1,50 @@ +{ + "swagger": "2.0", + "info": { + "title": "Quasar - GRPC Gateway Docs", + "description": "A REST interface for state queries, legacy transactions", + "version": "1.0.0" + }, + "apis": [ + { + "url": "../tmp-swagger-gen/epochs/query.swagger.json", + "operationIds": { + "rename": { + "Params": "EpochsParams" + } + } + }, + { + "url": "../tmp-swagger-gen/intergamm/query.swagger.json", + "operationIds": { + "rename": { + "Params": "IntergammParams" + } + } + }, + { + "url": "../tmp-swagger-gen/orion/query.swagger.json", + "operationIds": { + "rename": { + "Params": "OrionParams" + } + } + }, + { + "url": "../tmp-swagger-gen/qbank/query.swagger.json", + "operationIds": { + "rename": { + "Params": "QBankParams" + } + } + }, + { + "url": "../tmp-swagger-gen/qoracle/query.swagger.json", + "operationIds": { + "rename": { + "Params": "QOracleParams" + } + } + } + ] +} \ No newline at end of file diff --git a/docs/yarn.lock b/docs/yarn.lock new file mode 100644 index 0000000..7664c74 --- /dev/null +++ b/docs/yarn.lock @@ -0,0 +1,423 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@apidevtools/json-schema-ref-parser@9.0.9", "@apidevtools/json-schema-ref-parser@^9.0.6": + version "9.0.9" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#d720f9256e3609621280584f2b47ae165359268b" + integrity sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w== + dependencies: + "@jsdevtools/ono" "^7.1.3" + "@types/json-schema" "^7.0.6" + call-me-maybe "^1.0.1" + js-yaml "^4.1.0" + +"@apidevtools/openapi-schemas@^2.0.4": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz#9fa08017fb59d80538812f03fc7cac5992caaa17" + integrity sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ== + +"@apidevtools/swagger-methods@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz#b789a362e055b0340d04712eafe7027ddc1ac267" + integrity sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg== + +"@apidevtools/swagger-parser@10.0.3": + version "10.0.3" + resolved "https://registry.yarnpkg.com/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz#32057ae99487872c4dd96b314a1ab4b95d89eaf5" + integrity sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g== + dependencies: + "@apidevtools/json-schema-ref-parser" "^9.0.6" + "@apidevtools/openapi-schemas" "^2.0.4" + "@apidevtools/swagger-methods" "^3.0.2" + "@jsdevtools/ono" "^7.1.3" + call-me-maybe "^1.0.1" + z-schema "^5.0.1" + +"@exodus/schemasafe@^1.0.0-rc.2": + version "1.0.0-rc.7" + resolved "https://registry.yarnpkg.com/@exodus/schemasafe/-/schemasafe-1.0.0-rc.7.tgz#aded6839c2369883dafa46608a135c82b42ed76b" + integrity sha512-+1mBLsa+vvlV0lwEAP1hwgmOPkjMnoJ8hyCMfCCJga0sVDwDzrPJjnxZwdDaUmOh/vbFHQGBTk+FxsVjoI/CjQ== + +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + +"@types/json-schema@^7.0.6": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +es6-promise@^3.2.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" + integrity sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +fast-safe-stringify@^2.0.7: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +http2-client@^1.2.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/http2-client/-/http2-client-1.3.5.tgz#20c9dc909e3cc98284dd20af2432c524086df181" + integrity sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-schema-ref-parser@^9.0.9: + version "9.0.9" + resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#66ea538e7450b12af342fa3d5b8458bc1e1e013f" + integrity sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q== + dependencies: + "@apidevtools/json-schema-ref-parser" "9.0.9" + +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +minimist@^1.2.5: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + +node-fetch-h2@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/node-fetch-h2/-/node-fetch-h2-2.3.0.tgz#c6188325f9bd3d834020bf0f2d6dc17ced2241ac" + integrity sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg== + dependencies: + http2-client "^1.2.5" + +node-fetch@^2.6.1: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" + +node-readfiles@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/node-readfiles/-/node-readfiles-0.2.0.tgz#dbbd4af12134e2e635c245ef93ffcf6f60673a5d" + integrity sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA== + dependencies: + es6-promise "^3.2.1" + +oas-kit-common@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/oas-kit-common/-/oas-kit-common-1.0.8.tgz#6d8cacf6e9097967a4c7ea8bcbcbd77018e1f535" + integrity sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ== + dependencies: + fast-safe-stringify "^2.0.7" + +oas-linter@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/oas-linter/-/oas-linter-3.2.2.tgz#ab6a33736313490659035ca6802dc4b35d48aa1e" + integrity sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ== + dependencies: + "@exodus/schemasafe" "^1.0.0-rc.2" + should "^13.2.1" + yaml "^1.10.0" + +oas-resolver@^2.5.6: + version "2.5.6" + resolved "https://registry.yarnpkg.com/oas-resolver/-/oas-resolver-2.5.6.tgz#10430569cb7daca56115c915e611ebc5515c561b" + integrity sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ== + dependencies: + node-fetch-h2 "^2.3.0" + oas-kit-common "^1.0.8" + reftools "^1.1.9" + yaml "^1.10.0" + yargs "^17.0.1" + +oas-schema-walker@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/oas-schema-walker/-/oas-schema-walker-1.1.5.tgz#74c3cd47b70ff8e0b19adada14455b5d3ac38a22" + integrity sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ== + +oas-validator@^5.0.8: + version "5.0.8" + resolved "https://registry.yarnpkg.com/oas-validator/-/oas-validator-5.0.8.tgz#387e90df7cafa2d3ffc83b5fb976052b87e73c28" + integrity sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw== + dependencies: + call-me-maybe "^1.0.1" + oas-kit-common "^1.0.8" + oas-linter "^3.2.2" + oas-resolver "^2.5.6" + oas-schema-walker "^1.1.5" + reftools "^1.1.9" + should "^13.2.1" + yaml "^1.10.0" + +reftools@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.9.tgz#e16e19f662ccd4648605312c06d34e5da3a2b77e" + integrity sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +should-equal@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/should-equal/-/should-equal-2.0.0.tgz#6072cf83047360867e68e98b09d71143d04ee0c3" + integrity sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA== + dependencies: + should-type "^1.4.0" + +should-format@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/should-format/-/should-format-3.0.3.tgz#9bfc8f74fa39205c53d38c34d717303e277124f1" + integrity sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q== + dependencies: + should-type "^1.3.0" + should-type-adaptors "^1.0.1" + +should-type-adaptors@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz#401e7f33b5533033944d5cd8bf2b65027792e27a" + integrity sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA== + dependencies: + should-type "^1.3.0" + should-util "^1.0.0" + +should-type@^1.3.0, should-type@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/should-type/-/should-type-1.4.0.tgz#0756d8ce846dfd09843a6947719dfa0d4cff5cf3" + integrity sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ== + +should-util@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/should-util/-/should-util-1.0.1.tgz#fb0d71338f532a3a149213639e2d32cbea8bcb28" + integrity sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g== + +should@^13.2.1: + version "13.2.3" + resolved "https://registry.yarnpkg.com/should/-/should-13.2.3.tgz#96d8e5acf3e97b49d89b51feaa5ae8d07ef58f10" + integrity sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ== + dependencies: + should-equal "^2.0.0" + should-format "^3.0.3" + should-type "^1.4.0" + should-type-adaptors "^1.0.1" + should-util "^1.0.0" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +swagger-combine@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/swagger-combine/-/swagger-combine-1.4.0.tgz#f66ccc5fe26ff3a3fb22d986d598dfcc0e0bc956" + integrity sha512-nVQPzSGixSJ6U3BSTBYswIbamumNCz1ZXPqnCrXYz6BHlSeOtfGKuyZ+sAWtpOepUFuOu93x+VOIzAxLKK6xYw== + dependencies: + call-me-maybe "^1.0.1" + js-yaml "^4.1.0" + json-schema-ref-parser "^9.0.9" + lodash "^4.17.21" + minimist "^1.2.5" + swagger-parser "^10.0.3" + traverse "^0.6.6" + url-join "^4.0.1" + +swagger-parser@^10.0.3: + version "10.0.3" + resolved "https://registry.yarnpkg.com/swagger-parser/-/swagger-parser-10.0.3.tgz#04cb01c18c3ac192b41161c77f81e79309135d03" + integrity sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg== + dependencies: + "@apidevtools/swagger-parser" "10.0.3" + +swagger2openapi@^7.0.3: + version "7.0.8" + resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-7.0.8.tgz#12c88d5de776cb1cbba758994930f40ad0afac59" + integrity sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g== + dependencies: + call-me-maybe "^1.0.1" + node-fetch "^2.6.1" + node-fetch-h2 "^2.3.0" + node-readfiles "^0.2.0" + oas-kit-common "^1.0.8" + oas-resolver "^2.5.6" + oas-schema-walker "^1.1.5" + oas-validator "^5.0.8" + reftools "^1.1.9" + yaml "^1.10.0" + yargs "^17.0.1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +traverse@^0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + integrity sha512-kdf4JKs8lbARxWdp7RKdNzoJBhGUcIalSYibuGyHJbmk40pOysQ0+QPvlkCOICOivDWU2IJo2rkrxyTK2AH4fw== + +url-join@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" + integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== + +validator@^13.7.0: + version "13.7.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857" + integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yaml@^1.10.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + +yargs-parser@^21.0.0: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.0.1: + version "17.5.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e" + integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.0.0" + +z-schema@^5.0.1: + version "5.0.4" + resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-5.0.4.tgz#ecad8bc5ef3283ae032d603286386cfb1380cce5" + integrity sha512-gm/lx3hDzJNcLwseIeQVm1UcwhWIKpSB4NqH89pTBtFns4k/HDHudsICtvG05Bvw/Mv3jMyk700y5dadueLHdA== + dependencies: + lodash.get "^4.4.2" + lodash.isequal "^4.5.0" + validator "^13.7.0" + optionalDependencies: + commander "^2.20.3" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a34a97e --- /dev/null +++ b/go.mod @@ -0,0 +1,303 @@ +module github.com/quasarlabs/quasarnode + +go 1.18 + +require ( + github.com/CosmWasm/wasmd v0.31.0 + github.com/cosmos/cosmos-sdk v0.45.14 + github.com/cosmos/ibc-go/v4 v4.3.0 + github.com/gogo/protobuf v1.3.3 + github.com/golang/mock v1.6.0 + github.com/golang/protobuf v1.5.2 + github.com/golangci/golangci-lint v1.50.1 + github.com/gorilla/mux v1.8.0 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/pelletier/go-toml/v2 v2.0.5 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/regen-network/cosmos-proto v0.3.1 // indirect + github.com/spf13/cast v1.5.0 + github.com/spf13/cobra v1.6.1 + github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/testify v1.8.2 + github.com/tendermint/tendermint v0.34.26 + github.com/tendermint/tm-db v0.6.7 + google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa + google.golang.org/grpc v1.53.0 + google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect + gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +require ( + github.com/CosmWasm/wasmvm v1.2.1 + github.com/cosmos/cosmos-proto v1.0.0-beta.2 + github.com/cosmos/gogoproto v1.4.6 + github.com/strangelove-ventures/async-icq/v4 v4.0.0-rc0 +) + +require ( + cosmossdk.io/api v0.2.6 // indirect + cosmossdk.io/core v0.5.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.3 // indirect + github.com/Abirdcfly/dupword v0.0.7 // indirect + github.com/DataDog/zstd v1.4.5 // indirect + github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect + github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 // indirect + github.com/curioswitch/go-reassign v0.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/docker/distribution v2.8.1+incompatible // indirect + github.com/getsentry/sentry-go v0.17.0 // indirect + github.com/golang/glog v1.0.0 // indirect + github.com/kkHAIKE/contextcheck v1.1.3 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/linxGnu/grocksdb v1.7.10 // indirect + github.com/maratori/testableexamples v1.0.0 // indirect + github.com/onsi/ginkgo v1.16.4 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/sashamelentyev/interfacebloat v1.1.0 // indirect + github.com/tidwall/btree v1.5.0 // indirect + github.com/timonwong/loggercheck v0.9.3 // indirect + github.com/zondax/ledger-go v0.14.1 // indirect +) + +require ( + 4d63.com/gochecknoglobals v0.1.0 // indirect + filippo.io/edwards25519 v1.0.0-rc.1 // 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/Antonboom/errname v0.1.7 // indirect + github.com/Antonboom/nilnil v0.1.1 // indirect + github.com/BurntSushi/toml v1.2.1 // indirect + github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/OpenPeeDeeP/depguard v1.1.1 // indirect + github.com/Workiva/go-datastructures v1.0.53 // indirect + github.com/alexkohler/prealloc v1.0.0 // indirect + github.com/alingse/asasalint v0.0.11 // indirect + github.com/armon/go-metrics v0.4.1 // indirect + github.com/ashanbrown/forbidigo v1.3.0 // indirect + github.com/ashanbrown/makezero v1.1.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bkielbasa/cyclop v1.2.0 // indirect + github.com/blizzy78/varnamelen v0.8.0 // indirect + github.com/bombsimon/wsl/v3 v3.3.0 // indirect + github.com/breml/bidichk v0.2.3 // indirect + github.com/breml/errchkjson v0.3.0 // indirect + github.com/btcsuite/btcd v0.22.2 // indirect + github.com/butuzov/ireturn v0.1.1 // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/charithe/durationcheck v0.0.9 // indirect + github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 // indirect + github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect + github.com/confio/ics23/go v0.9.0 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/gorocksdb v1.2.0 // indirect + github.com/cosmos/iavl v0.19.5 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect + github.com/creachadair/taskgroup v0.3.2 // indirect + github.com/daixiang0/gci v0.8.1 // indirect + github.com/danieljoos/wincred v1.1.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/denis-tingaikin/go-header v0.4.3 // indirect + github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect + github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac // indirect + github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/esimonov/ifshort v1.0.4 // indirect + github.com/ettle/strcase v0.1.1 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/fatih/structtag v1.2.0 // indirect + github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/firefart/nonamedreturns v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fzipp/gocyclo v0.6.0 // indirect + github.com/go-critic/go-critic v0.6.5 // 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.5.1 // indirect + github.com/go-toolsmith/astcast v1.0.0 // indirect + github.com/go-toolsmith/astcopy v1.0.2 // indirect + github.com/go-toolsmith/astequal v1.0.3 // indirect + github.com/go-toolsmith/astfmt v1.0.0 // indirect + github.com/go-toolsmith/astp v1.0.0 // indirect + github.com/go-toolsmith/strparse v1.0.0 // indirect + github.com/go-toolsmith/typep v1.0.2 // indirect + github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect + github.com/gobwas/glob v0.2.3 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gofrs/flock v0.8.1 // indirect + github.com/gogo/gateway v1.1.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect + github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect + github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect + github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect + github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect + github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect + github.com/golangci/misspell v0.3.5 // indirect + github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect + github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect + github.com/google/btree v1.1.2 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 // indirect + github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/gostaticanalysis/analysisutil v0.7.1 // indirect + github.com/gostaticanalysis/comment v1.4.2 // indirect + github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect + github.com/gostaticanalysis/nilerr v0.1.1 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/gtank/merlin v0.1.1 // indirect + github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect + github.com/hexops/gotextdiff v1.0.3 // indirect + github.com/improbable-eng/grpc-web v0.14.1 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/jgautheron/goconst v1.5.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/jmhodges/levigo v1.0.0 // indirect + github.com/julz/importas v0.1.0 // indirect + github.com/kisielk/errcheck v1.6.2 // indirect + github.com/kisielk/gotool v1.0.0 // indirect + github.com/klauspost/compress v1.15.11 // indirect + github.com/kulti/thelper v0.6.3 // indirect + github.com/kunwardeep/paralleltest v1.0.6 // indirect + github.com/kyoh86/exportloopref v0.1.8 // indirect + github.com/ldez/gomoddirectives v0.2.3 // indirect + github.com/ldez/tagliatelle v0.3.1 // indirect + github.com/leonklingele/grouper v1.1.0 // indirect + github.com/lib/pq v1.10.6 // indirect + github.com/libp2p/go-buffer-pool v0.1.0 // indirect + github.com/lufeee/execinquery v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/maratori/testpackage v1.1.0 // indirect + github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/mbilski/exhaustivestruct v1.2.0 // indirect + github.com/mgechev/revive v1.2.4 // indirect + github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect + github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moricho/tparallel v0.2.1 // indirect + github.com/mtibben/percent v0.2.1 // indirect + github.com/nakabonne/nestif v0.3.1 // indirect + github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect + github.com/nishanths/exhaustive v0.8.3 // indirect + github.com/nishanths/predeclared v0.2.2 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/polyfloyd/go-errorlint v1.0.5 // indirect + github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect + github.com/quasilyte/go-ruleguard v0.3.18 // indirect + github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f // indirect + github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // 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/rs/cors v1.8.2 // indirect + github.com/rs/zerolog v1.27.0 // indirect + github.com/ryancurrah/gomodguard v1.2.4 // indirect + github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect + github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect + github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sashamelentyev/usestdlibvars v1.20.0 // indirect + github.com/securego/gosec/v2 v2.13.1 // indirect + github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect + github.com/sirupsen/logrus v1.9.0 // indirect + github.com/sivchari/containedctx v1.0.2 // indirect + github.com/sivchari/nosnakecase v1.7.0 // indirect + github.com/sivchari/tenv v1.7.0 // indirect + github.com/sonatard/noctx v0.0.1 // indirect + github.com/sourcegraph/go-diff v0.6.1 // indirect + github.com/spf13/afero v1.9.2 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/viper v1.14.0 // indirect + github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect + github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect + github.com/stretchr/objx v0.5.0 // indirect + github.com/subosito/gotenv v1.4.1 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/tdakkota/asciicheck v0.1.1 // indirect + github.com/tendermint/go-amino v0.16.0 // indirect + github.com/tetafro/godot v1.4.11 // indirect + github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 // indirect + github.com/tomarrell/wrapcheck/v2 v2.7.0 // indirect + github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect + github.com/ultraware/funlen v0.0.3 // indirect + github.com/ultraware/whitespace v0.0.5 // indirect + github.com/uudashr/gocognit v1.0.6 // indirect + github.com/yagipy/maintidx v1.0.0 // indirect + github.com/yeya24/promlinter v0.2.0 // indirect + github.com/zondax/hid v0.9.1 // indirect + gitlab.com/bosi/decorder v0.2.3 // indirect + go.etcd.io/bbolt v1.3.6 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/multierr v1.8.0 // indirect + go.uber.org/zap v1.23.0 // indirect + golang.org/x/crypto v0.5.0 // indirect + golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect + golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 // indirect + golang.org/x/mod v0.8.0 // indirect + golang.org/x/net v0.6.0 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect + golang.org/x/tools v0.6.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + honnef.co/go/tools v0.3.3 // indirect + mvdan.cc/gofumpt v0.4.0 // indirect + mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect + mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect + mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 // indirect + nhooyr.io/websocket v1.8.6 // indirect +) + +replace ( + // To fix the security issue https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702 + github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 + // used latest commit of branch v3.3.0-icq + // github.com/cosmos/ibc-go/v4 => github.com/strangelove-ventures/ibc-go/v3 v3.0.0-20221014082552-99c8caa484af + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + // use informal system fork of tendermint + // See https://twitter.com/informalinc/status/1613580954383040512 + github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.26 + // To fix https://github.com/cosmos/cosmos-sdk/issues/8426 + google.golang.org/grpc => google.golang.org/grpc v1.33.2 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..dfd4877 --- /dev/null +++ b/go.sum @@ -0,0 +1,1795 @@ +4d63.com/gochecknoglobals v0.1.0 h1:zeZSRqj5yCg28tCkIV/z/lWbwvNm5qnKVS15PI8nhD0= +4d63.com/gochecknoglobals v0.1.0/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= +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.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +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.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= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +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/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cosmossdk.io/api v0.2.6 h1:AoNwaLLapcLsphhMK6+o0kZl+D6MMUaHVqSdwinASGU= +cosmossdk.io/api v0.2.6/go.mod h1:u/d+GAxil0nWpl1XnQL8nkziQDIWuBDhv8VnDm/s6dI= +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.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= +cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= +filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= +github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= +github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= +github.com/Abirdcfly/dupword v0.0.7 h1:z14n0yytA3wNO2gpCD/jVtp/acEXPGmYu0esewpBt6Q= +github.com/Abirdcfly/dupword v0.0.7/go.mod h1:K/4M1kj+Zh39d2aotRwypvasonOyAMH1c/IZJzE0dmk= +github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/Antonboom/errname v0.1.7 h1:mBBDKvEYwPl4WFFNwec1CZO096G6vzK9vvDQzAwkako= +github.com/Antonboom/errname v0.1.7/go.mod h1:g0ONh16msHIPgJSGsecu1G/dcF2hlYR/0SddnIAGavU= +github.com/Antonboom/nilnil v0.1.1 h1:PHhrh5ANKFWRBh7TdYmyyq2gyT2lotnvFvvFbylF81Q= +github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= +github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= +github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= +github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= +github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/CosmWasm/wasmd v0.31.0 h1:xACf6A/SkCeGWQWrKGsR4X9PQb5G4XYuNfnrl+HQ1mE= +github.com/CosmWasm/wasmd v0.31.0/go.mod h1:VcyDGk/ISVlMUeW+1GGL0zdHWBS2FPwLEV2qZ86l7l8= +github.com/CosmWasm/wasmvm v1.2.1 h1:si0tRsRDdUShV0k51Wn6zRKlmj3/WWP9Yr4cLmDTf+8= +github.com/CosmWasm/wasmvm v1.2.1/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= +github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +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/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7IAzX8QezqtFV9m0MUHFJgts= +github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmcxJL+UEG2f8cQploZm1mR/v6BW0mU0= +github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OpenPeeDeeP/depguard v1.1.1 h1:TSUznLjvp/4IUP+OQ0t/4jF4QUyxIcVX8YnghZdunyA= +github.com/OpenPeeDeeP/depguard v1.1.1/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= +github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +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.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= +github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= +github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= +github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= +github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +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/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= +github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= +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/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= +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.3.0 h1:VkYIwb/xxdireGAdJNZoo24O4lmnEWkactplBlWTShc= +github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= +github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= +github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +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/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= +github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= +github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= +github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= +github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxjM= +github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= +github.com/breml/bidichk v0.2.3 h1:qe6ggxpTfA8E75hdjWPZ581sY3a2lnl0IRxLQFelECI= +github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= +github.com/breml/errchkjson v0.3.0 h1:YdDqhfqMT+I1vIxPSas44P+9Z9HzJwCeAzjB8PxP1xw= +github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= +github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= +github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= +github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= +github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +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/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +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/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/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= +github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +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.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/charithe/durationcheck v0.0.9 h1:mPP4ucLrf/rKZiIG/a9IPXHGlh8p4CzgpyTy6EEutYk= +github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= +github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 h1:E7LT642ysztPWE0dfz43cWOvMiF42DyTRC+eZIaO4yI= +github.com/chavacava/garif v0.0.0-20220630083739-93517212f375/go.mod h1:4m1Rv7xfuwWPNKXlThldNuJvutYM6J95wNuuVmn55To= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= +github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= +github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= +github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 h1:qbb/AE938DFhOajUYh9+OXELpSF9KZw2ZivtmW6eX1Q= +github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677/go.mod h1:890yq1fUb9b6dGNwssgeUO5vQV9qfXnCPxAJhBQfXw0= +github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= +github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg= +github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= +github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +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.3.3-0.20220203105225-a9a7ef127534/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 v0.0.0-20221226095112-f3c38ecb5e32 h1:zlCp9n3uwQieELltZWHRmwPmPaZ8+XoL2Sj+A2YJlr8= +github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32/go.mod h1:kwMlEC4wWvB48zAShGKVqboJL6w4zCLesaNQ3YLU2BQ= +github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= +github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= +github.com/cosmos/cosmos-sdk v0.45.14 h1:l6yid1Lft5dd8ymKO36qJf1phsE0shJLNkZQYTwjxOg= +github.com/cosmos/cosmos-sdk v0.45.14/go.mod h1:bF1fyVbRDvZ922GMByg9opQT26sQwabwYqaYIchwdyw= +github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= +github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= +github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= +github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4= +github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI= +github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= +github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= +github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= +github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/ibc-go/v4 v4.3.0 h1:yOzVsyZzsv4XPBux8gq+D0LhZn45yGWKjvT+6Vyo5no= +github.com/cosmos/ibc-go/v4 v4.3.0/go.mod h1:CcLvIoi9NNtIbNsxs4KjBGjYhlwqtsmXy1AKARKiMzQ= +github.com/cosmos/interchain-accounts v0.2.6 h1:TV2M2g1/Rb9MCNw1YePdBKE0rcEczNj1RGHT+2iRYas= +github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= +github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= +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.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= +github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= +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/cristalhq/acmd v0.8.1/go.mod h1:LG5oa43pE/BbxtfMoImHCQN++0Su7dzipdgBjMCBVDQ= +github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= +github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= +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/daixiang0/gci v0.8.1 h1:T4xpSC+hmsi4CSyuYfIJdMZAr9o7xZmHpQVygMghGZ4= +github.com/daixiang0/gci v0.8.1/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= +github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= +github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +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 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= +github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= +github.com/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 v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= +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/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= +github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +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.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= +github.com/docker/distribution v2.8.1+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/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +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-0.20200219035652-afde56e7acac h1:opbrjaN/L8gg6Xh5D04Tem+8xVcz6ajZlGCs49mQgyg= +github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= +github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= +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/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= +github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= +github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= +github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= +github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= +github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +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 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= +github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= +github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= +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/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= +github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= +github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= +github.com/getsentry/sentry-go v0.17.0 h1:UustVWnOoDFHBS7IJUB2QK/nB5pap748ZEp0swnQJak= +github.com/getsentry/sentry-go v0.17.0/go.mod h1:B82dxtBvxG0KaPD8/hfSV+VcHD+Lg/xUS4JuQn1P4cM= +github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +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/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= +github.com/go-critic/go-critic v0.6.5 h1:fDaR/5GWURljXwF8Eh31T2GZNz9X4jeboS912mWF8Uo= +github.com/go-critic/go-critic v0.6.5/go.mod h1:ezfP/Lh7MA6dBNn4c6ab5ALv3sKnZVLx37tr00uuaOY= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +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.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +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= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +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= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +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-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= +github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= +github.com/go-toolsmith/astcopy v1.0.2 h1:YnWf5Rnh1hUudj11kei53kI57quN/VH6Hp1n+erozn0= +github.com/go-toolsmith/astcopy v1.0.2/go.mod h1:4TcEdbElGc9twQEYpVo/aieIXfHhiuLh4aLAck6dO7Y= +github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= +github.com/go-toolsmith/astequal v1.0.2/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= +github.com/go-toolsmith/astequal v1.0.3 h1:+LVdyRatFS+XO78SGV4I3TCEA0AC7fKEGma+fH+674o= +github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= +github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= +github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= +github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg= +github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= +github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5 h1:eD9POs68PHkwrx7hAB78z1cb6PfGq/jyWn3wJywsH1o= +github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= +github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= +github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/typep v1.0.2 h1:8xdsa1+FSIH/RhEkgnD1j2CJOy5mNllW1Q9tRiYwvlk= +github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4/FHQWkvVRmgijNXRfzkIDHh23ggEo= +github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/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/pool v0.2.0/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= +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 v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= +github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= +github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= +github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +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= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= +github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= +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/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6J5HIP8ZtyMdiDscjMLfRBSPuzVVeo= +github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= +github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 h1:amWTbTGqOZ71ruzrdA+Nx5WA3tV1N0goTspwmKCQvBY= +github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2/go.mod h1:9wOXstvyDRshQ9LggQuzBCGysxs3b6Uo/1MvYCR2NMs= +github.com/golangci/golangci-lint v1.50.1 h1:C829clMcZXEORakZlwpk7M4iDw2XiwxxKaG504SZ9zY= +github.com/golangci/golangci-lint v1.50.1/go.mod h1:AQjHBopYS//oB8xs0y0M/dtxdKHkdhl0RvmjUct0/4w= +github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= +github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= +github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= +github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= +github.com/golangci/misspell v0.3.5 h1:pLzmVdl3VxTOncgzHcvLOKirdvcx/TydsClUQXTehjo= +github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= +github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= +github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= +github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= +github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= +github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +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/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= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +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/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +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/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= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 h1:PVRE9d4AQKmbelZ7emNig1+NT27DUmKZn5qXxfio54U= +github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/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/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/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/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.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= +github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= +github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= +github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= +github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= +github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= +github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= +github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= +github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= +github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= +github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= +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/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/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-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +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/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +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-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-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-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +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-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 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +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.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/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/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= +github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= +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/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= +github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +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/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= +github.com/improbable-eng/grpc-web v0.14.1 h1:NrN4PY71A6tAz2sKDvC5JCauENWp0ykG8Oq1H3cpFvw= +github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/informalsystems/tendermint v0.34.26 h1:89XvVexAy62geGWxmDmdmmJvfindx+Su2oTuwfSWMeU= +github.com/informalsystems/tendermint v0.34.26/go.mod h1:q3uAZ/t5+MblQhFuHSd4flqaLDx7iUtWpwWbwvHAFhs= +github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= +github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= +github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= +github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= +github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= +github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/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.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= +github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c h1:XImQJfpJLmGEEd8ll5yPVyL/aEvmgGHW4WYTyNseLOM= +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/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= +github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +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= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +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/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= +github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= +github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= +github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= +github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= +github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= +github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= +github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= +github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/errcheck v1.6.2 h1:uGQ9xI8/pgc9iOoCe7kWQgRE6SBTrCGmTSf0LrEtY7c= +github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkHAIKE/contextcheck v1.1.3 h1:l4pNvrb8JSwRd51ojtcOxOeHJzHek+MtOyXbaR0uvmw= +github.com/kkHAIKE/contextcheck v1.1.3/go.mod h1:PG/cwd6c0705/LM0KTr1acO2gORUxkSVWyLJOFW5qoo= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.7/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 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +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/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +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.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +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= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +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.6 h1:FCKYMF1OF2+RveWlABsdnmsvJrei5aoyZoaGS+Ugg8g= +github.com/kunwardeep/paralleltest v1.0.6/go.mod h1:Y0Y0XISdZM5IKm3TREQMZ6iteqn1YuwCsJO/0kL9Zes= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/kyoh86/exportloopref v0.1.8 h1:5Ry/at+eFdkX9Vsdw3qU4YkvGtzuVfzT4X7S77LoN/M= +github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= +github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= +github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= +github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= +github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= +github.com/ldez/tagliatelle v0.3.1 h1:3BqVVlReVUZwafJUwQ+oxbx2BEX2vUG4Yu/NOfMiKiM= +github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= +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/leonklingele/grouper v1.1.0 h1:tC2y/ygPbMFSBOs3DcyaEMKnnwH7eYKzohOtRrf0SAg= +github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= +github.com/lib/pq v1.10.6/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.7.10 h1:dz7RY7GnFUA+GJO6jodyxgkUeGMEkPp3ikt9hAcNGEw= +github.com/linxGnu/grocksdb v1.7.10/go.mod h1:0hTf+iA+GOr0jDX4CgIYyJZxqOH9XlBh6KVj8+zmF34= +github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= +github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= +github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= +github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= +github.com/maratori/testpackage v1.1.0 h1:GJY4wlzQhuBusMF1oahQCBtUV/AQ/k69IZ68vxaac2Q= +github.com/maratori/testpackage v1.1.0/go.mod h1:PeAhzU8qkCwdGEMTEupsHJNlQu2gZopMC6RjbhmHeDc= +github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 h1:pWxk9e//NbPwfxat7RXkts09K+dEBJWakUWwICVqYbA= +github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/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/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.0/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.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.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +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-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +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.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.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 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +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.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= +github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= +github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= +github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= +github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= +github.com/mgechev/revive v1.2.4 h1:+2Hd/S8oO2H0Ikq2+egtNwQsVhAeELHjxjIUFX5ajLI= +github.com/mgechev/revive v1.2.4/go.mod h1:iAWlQishqCuj4yhV24FTnKSXGpbAA+0SckXB8GQMX/Q= +github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +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= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +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.3.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/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= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +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/moricho/tparallel v0.2.1 h1:95FytivzT6rYzdJLdtfn6m1bfFJylOJK41+lgv/EHf4= +github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= +github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +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/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= +github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= +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/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= +github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= +github.com/neilotoole/errgroup v0.1.5/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.8.3 h1:pw5O09vwg8ZaditDp/nQRqVnrMczSJDxRDJMowvhsrM= +github.com/nishanths/exhaustive v0.8.3/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg= +github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= +github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= +github.com/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/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/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= +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.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +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.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +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= +github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +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.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= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= +github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +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/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= +github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +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/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/polyfloyd/go-errorlint v1.0.5 h1:AHB5JRCjlmelh9RrLxT9sgzpalIwwq4hqE8EkwIwKdY= +github.com/polyfloyd/go-errorlint v1.0.5/go.mod h1:APVvOesVSAnne5SClsPxPdfvZTVDojXh1/G3qb5wjGI= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +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.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +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/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.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.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +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.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= +github.com/quasilyte/go-ruleguard v0.3.18 h1:sd+abO1PEI9fkYennwzHn9kl3nqP6M5vE7FiOzZ+5CE= +github.com/quasilyte/go-ruleguard v0.3.18/go.mod h1:lOIzcYlgxrQ2sGJ735EHXmf/e9MJ516j16K/Ifcttvs= +github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= +github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= +github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f h1:6Gtn2i04RD0gVyYf2/IUMTIs+qYleBt4zxDqkLTcu4U= +github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= +github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 h1:L8QM9bvf68pVdQ3bCFZMDmnt9yqcMBro1pC7F+IPYMY= +github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= +github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= +github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +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/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= +github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= +github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= +github.com/rivo/uniseg v0.2.0/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= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= +github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= +github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= +github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +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.2.4 h1:CpMSDKan0LtNGGhPrvupAoLeObRFjND8/tU1rEOtBp4= +github.com/ryancurrah/gomodguard v1.2.4/go.mod h1:+Kem4VjWwvFpUJRJSwa16s1tBJe+vbv02+naTow2f6M= +github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= +github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sanposhiho/wastedassign/v2 v2.0.6 h1:+6/hQIHKNJAUixEj6EmOngGIisyeI+T3335lYTyxRoA= +github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= +github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= +github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/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.20.0 h1:K6CXjqqtSYSsuyRDDC7Sjn6vTMLiSJa4ZmDkiokoqtw= +github.com/sashamelentyev/usestdlibvars v1.20.0/go.mod h1:0GaP+ecfZMXShS0A94CJn6aEuPRILv8h/VuWI9n1ygg= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/securego/gosec/v2 v2.13.1 h1:7mU32qn2dyC81MH9L2kefnQyRMUarfDER3iQyMHcjYM= +github.com/securego/gosec/v2 v2.13.1/go.mod h1:EO1sImBMBWFjOTFzMWfTRrZW6M15gm60ljzrmy/wtHo= +github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/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 v2.20.5+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= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sivchari/containedctx v1.0.2 h1:0hLQKpgC53OVF1VT7CeoFHk9YKstur1XOgfYIc1yrHI= +github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= +github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= +github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= +github.com/sivchari/tenv v1.7.0 h1:d4laZMBK6jpe5PWepxlV9S+LC0yXqvYHiq8E6ceoVVE= +github.com/sivchari/tenv v1.7.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= +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= +github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= +github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/go-diff v0.6.1 h1:hmA1LzxW0n1c3Q4YbrFgg4P99GSnebYa3x8gr0HZqLQ= +github.com/sourcegraph/go-diff v0.6.1/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.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +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.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag 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.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= +github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= +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/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= +github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= +github.com/strangelove-ventures/async-icq/v4 v4.0.0-rc0 h1:foE/5O2/XiqGsdTKx3R0BTfKgW9KnUYyQLZt0WFSesE= +github.com/strangelove-ventures/async-icq/v4 v4.0.0-rc0/go.mod h1:thzXHoaK1MgPDCjN7Rp9A/VcHA4cmjQpKCtVNt2O2xk= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.1.4/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= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +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.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +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/tdakkota/asciicheck v0.1.1 h1:PKzG7JUTUmVspQTDqtkX9eSiLGossXTybutHwTXuO0A= +github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= +github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= +github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= +github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= +github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= +github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= +github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= +github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= +github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= +github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= +github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= +github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= +github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 h1:kl4KhGNsJIbDHS9/4U9yQo1UcPQM0kOMJHn29EoH/Ro= +github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= +github.com/timonwong/loggercheck v0.9.3 h1:ecACo9fNiHxX4/Bc02rW2+kaJIAMAes7qJ7JKxt0EZI= +github.com/timonwong/loggercheck v0.9.3/go.mod h1:wUqnk9yAOIKtGA39l1KLE9Iz0QiTocu/YZoOf+OzFdw= +github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tomarrell/wrapcheck/v2 v2.7.0 h1:J/F8DbSKJC83bAvC6FoZaRjZiZ/iKoueSdrEkmGeacA= +github.com/tomarrell/wrapcheck/v2 v2.7.0/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= +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/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= +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.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +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/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= +github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= +github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= +github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/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/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= +github.com/uudashr/gocognit v1.0.6 h1:2Cgi6MweCsdB6kpcVQp7EW4U23iBFQWfTXiWlyp842Y= +github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= +github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= +github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= +github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= +github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= +github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= +github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= +github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= +github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= +github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= +gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +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= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +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.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= +go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +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-20191227163750-53104e6ec876/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-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= +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-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 h1:BEABXpNXLEz0WxtA+6CQIz2xkg80e+1zrhWyMcq8VzE= +golang.org/x/exp v0.0.0-20230131160201-f062dba9d201/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 h1:Ic/qN6TEifvObMGQy72k0n1LlJr7DjWWEi+MOsDOiSk= +golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91/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-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +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/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= +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.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +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= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +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-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +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-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211008194852-3b03d305991f/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= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +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= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +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= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +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= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-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= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/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= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/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-20210909193231-528a39cd75f3/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-20211007075335-d3039528d8ac/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-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/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-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +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= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +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.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +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/tools v0.0.0-20180525024113-a5b4c53f6e8b/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-20181221001348-537d06c36207/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-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +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-20190916130336-e45ffcd953cc/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= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +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-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +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= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201230224404-63754364767c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +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.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +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= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +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= +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= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +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= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +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= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +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-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= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +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-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= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa h1:qQPhfbPO23fwm/9lQr91L1u62Zo6cm+zI+slZT+uf+o= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +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= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +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= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +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.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA= +honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= +mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= +mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= +mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= +mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= +mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= +mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= +mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 h1:seuXWbRB1qPrS3NQnHmFKLJLtskWyueeIzmLXghMGgk= +mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2YjFf5CaW0Bw4RL8RfbEf4GRggJk= +nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= +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= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/osmosis/epochs/types/genesis.pb.go b/osmosis/epochs/types/genesis.pb.go new file mode 100644 index 0000000..0609614 --- /dev/null +++ b/osmosis/epochs/types/genesis.pb.go @@ -0,0 +1,820 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/epochs/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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_7ecf3e4d59074cbd, []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_7ecf3e4d59074cbd, []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/genesis.proto", fileDescriptor_7ecf3e4d59074cbd) } + +var fileDescriptor_7ecf3e4d59074cbd = []byte{ + // 479 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x3f, 0x8f, 0xd3, 0x30, + 0x1c, 0xad, 0x69, 0x29, 0xa9, 0xef, 0x10, 0x60, 0x1d, 0x47, 0xa8, 0x20, 0x09, 0x61, 0x89, 0x04, + 0x72, 0xd4, 0x03, 0x16, 0x18, 0x90, 0x0a, 0x88, 0x3f, 0xcb, 0x49, 0x29, 0x03, 0x62, 0xa9, 0x9c, + 0xd6, 0x4d, 0x2c, 0x35, 0x71, 0x88, 0x1d, 0xa4, 0x6e, 0x7c, 0x84, 0x8e, 0x7c, 0xa4, 0x1b, 0x6f, + 0x64, 0x0a, 0xa8, 0xdd, 0x18, 0xef, 0x13, 0xa0, 0xd8, 0x49, 0x29, 0x77, 0x45, 0xb7, 0x39, 0x7e, + 0xef, 0xf7, 0x9e, 0xdf, 0xd3, 0x2f, 0xf0, 0x1e, 0x17, 0x09, 0x17, 0x4c, 0xf8, 0x34, 0xe3, 0x93, + 0x58, 0xf8, 0x11, 0x4d, 0xa9, 0x60, 0x02, 0x67, 0x39, 0x97, 0x1c, 0x1d, 0xd6, 0x28, 0xd6, 0x28, + 0xfe, 0x3a, 0x08, 0xa9, 0x24, 0x83, 0xfe, 0x41, 0xc4, 0x23, 0xae, 0x28, 0x7e, 0x75, 0xd2, 0xec, + 0xbe, 0x15, 0x71, 0x1e, 0xcd, 0xa9, 0xaf, 0xbe, 0xc2, 0x62, 0xe6, 0x4f, 0x8b, 0x9c, 0x48, 0xc6, + 0xd3, 0x1a, 0xb7, 0xcf, 0xe3, 0x92, 0x25, 0x54, 0x48, 0x92, 0x64, 0x9a, 0xe0, 0x2e, 0x3b, 0xb0, + 0xf7, 0xa6, 0x72, 0x7a, 0x9f, 0xce, 0x38, 0xb2, 0x20, 0x64, 0x53, 0x9a, 0x4a, 0x36, 0x63, 0x34, + 0x37, 0x81, 0x03, 0xbc, 0x5e, 0xb0, 0x75, 0x83, 0x3e, 0x41, 0x28, 0x24, 0xc9, 0xe5, 0xb8, 0x92, + 0x31, 0xaf, 0x38, 0xc0, 0xdb, 0x3b, 0xea, 0x63, 0xed, 0x81, 0x1b, 0x0f, 0xfc, 0xb1, 0xf1, 0x18, + 0xde, 0x3f, 0x29, 0xed, 0xd6, 0x59, 0x69, 0xdf, 0x5a, 0x90, 0x64, 0xfe, 0xdc, 0xfd, 0x3b, 0xeb, + 0x2e, 0x7f, 0xda, 0x20, 0xe8, 0xa9, 0x8b, 0x8a, 0x8e, 0x62, 0x68, 0x34, 0x4f, 0x37, 0xdb, 0x4a, + 0xf7, 0xee, 0x05, 0xdd, 0xd7, 0x35, 0x61, 0x38, 0xa8, 0x64, 0x7f, 0x97, 0x36, 0x6a, 0x46, 0x1e, + 0xf3, 0x84, 0x49, 0x9a, 0x64, 0x72, 0x71, 0x56, 0xda, 0x37, 0xb4, 0x59, 0x83, 0xb9, 0xdf, 0x2b, + 0xab, 0x8d, 0x3a, 0x7a, 0x08, 0xaf, 0x4f, 0x8a, 0x3c, 0xa7, 0xa9, 0x1c, 0xab, 0x8a, 0xcd, 0x8e, + 0x03, 0xbc, 0x76, 0xb0, 0x5f, 0x5f, 0xaa, 0x32, 0xd0, 0x37, 0x00, 0xcd, 0x7f, 0x58, 0xe3, 0xad, + 0xdc, 0x57, 0x2f, 0xcd, 0xfd, 0xa8, 0xce, 0x6d, 0xeb, 0xa7, 0xfc, 0x4f, 0x49, 0xb7, 0x70, 0x7b, + 0xdb, 0x79, 0xb4, 0x69, 0xe4, 0x29, 0x3c, 0xd4, 0xfc, 0x09, 0x2f, 0x52, 0xc9, 0xd2, 0x48, 0x0f, + 0xd2, 0xa9, 0xd9, 0x75, 0x80, 0x67, 0x04, 0x07, 0x0a, 0x7d, 0x55, 0x83, 0x23, 0x8d, 0xa1, 0x17, + 0xb0, 0xbf, 0xcb, 0x2d, 0xa6, 0x2c, 0x8a, 0xa5, 0x69, 0xa8, 0xa8, 0x77, 0x2e, 0x18, 0xbe, 0x53, + 0xf0, 0x87, 0x8e, 0x71, 0xed, 0xa6, 0xe1, 0x1e, 0xc3, 0xfd, 0xb7, 0x7a, 0x25, 0x47, 0x92, 0x48, + 0x8a, 0x5e, 0xc2, 0xae, 0xde, 0x45, 0x13, 0x38, 0x6d, 0x6f, 0xef, 0xe8, 0x01, 0xde, 0xbd, 0xa2, + 0x78, 0xb3, 0x47, 0xc3, 0x4e, 0x95, 0x3f, 0xa8, 0xc7, 0x86, 0xc7, 0x27, 0x2b, 0x0b, 0x9c, 0xae, + 0x2c, 0xf0, 0x6b, 0x65, 0x81, 0xe5, 0xda, 0x6a, 0x9d, 0xae, 0xad, 0xd6, 0x8f, 0xb5, 0xd5, 0xfa, + 0xfc, 0x2c, 0x62, 0x32, 0x2e, 0x42, 0x3c, 0xe1, 0x89, 0xff, 0xa5, 0x20, 0x82, 0xe4, 0x73, 0x12, + 0x8a, 0xfa, 0x98, 0xf2, 0x29, 0xf5, 0xcf, 0xfd, 0x2b, 0x72, 0x91, 0x51, 0x11, 0x76, 0x55, 0xe5, + 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x99, 0x0c, 0x63, 0x4a, 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_gogo_protobuf_types.StdTimeMarshalTo(m.CurrentEpochStartTime, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovGenesis(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovGenesis(uint64(l)) + if m.CurrentEpoch != 0 { + n += 1 + sovGenesis(uint64(m.CurrentEpoch)) + } + l = github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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 new file mode 100644 index 0000000..6181561 --- /dev/null +++ b/osmosis/epochs/types/query.pb.go @@ -0,0 +1,910 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/epochs/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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_574bd176519c765f, []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_574bd176519c765f, []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_574bd176519c765f, []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_574bd176519c765f, []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/query.proto", fileDescriptor_574bd176519c765f) } + +var fileDescriptor_574bd176519c765f = []byte{ + // 389 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xbf, 0x4e, 0xe3, 0x30, + 0x18, 0x8f, 0xdb, 0xbb, 0x4a, 0xe7, 0xeb, 0x2d, 0xd6, 0xa9, 0x97, 0x8b, 0x4e, 0xbe, 0x5e, 0x4e, + 0x40, 0x17, 0x62, 0x5a, 0xc4, 0xc2, 0x02, 0x2a, 0x62, 0x60, 0x42, 0x64, 0xec, 0x82, 0x92, 0xd4, + 0x4d, 0x23, 0xb5, 0x76, 0x1a, 0x3b, 0x48, 0x5d, 0x79, 0x02, 0x24, 0xc4, 0x0b, 0xf0, 0x2c, 0x0c, + 0x1d, 0x2b, 0xb1, 0x30, 0x21, 0xd4, 0xf2, 0x20, 0x28, 0x8e, 0x41, 0xa5, 0xa4, 0x08, 0x36, 0xc7, + 0xbf, 0xbf, 0xdf, 0x17, 0x43, 0x8b, 0x8b, 0x21, 0x17, 0x91, 0x20, 0x34, 0xe6, 0x41, 0x5f, 0x90, + 0x51, 0x4a, 0x93, 0xb1, 0x13, 0x27, 0x5c, 0x72, 0x54, 0xd3, 0x98, 0x93, 0x63, 0xce, 0x59, 0xd3, + 0xa7, 0xd2, 0x6b, 0x5a, 0x3f, 0x43, 0x1e, 0x72, 0x45, 0x21, 0xd9, 0x29, 0x67, 0x5b, 0x7f, 0x42, + 0xce, 0xc3, 0x01, 0x25, 0x5e, 0x1c, 0x11, 0x8f, 0x31, 0x2e, 0x3d, 0x19, 0x71, 0x26, 0x9e, 0xd1, + 0xa5, 0x9c, 0x90, 0x32, 0x9a, 0x59, 0x2b, 0xd4, 0x36, 0x61, 0xed, 0x24, 0x0b, 0x3e, 0x54, 0xe0, + 0x11, 0xeb, 0x71, 0x97, 0x8e, 0x52, 0x2a, 0xa4, 0xdd, 0x81, 0xbf, 0xde, 0x20, 0x22, 0xe6, 0x4c, + 0x50, 0xb4, 0x07, 0x2b, 0xb9, 0x99, 0x09, 0xea, 0xe5, 0xc6, 0xf7, 0xd6, 0x3f, 0xa7, 0xb8, 0xaf, + 0xa3, 0xb4, 0x99, 0xb4, 0xfd, 0x65, 0x72, 0xff, 0xd7, 0x70, 0xb5, 0xcc, 0xde, 0x85, 0xa6, 0xf2, + 0x3e, 0x48, 0x93, 0x84, 0x32, 0xa9, 0x68, 0x3a, 0x17, 0x61, 0x08, 0xa3, 0x2e, 0x65, 0x32, 0xea, + 0x45, 0x34, 0x31, 0x41, 0x1d, 0x34, 0xbe, 0xb9, 0x0b, 0x37, 0xf6, 0x3e, 0xfc, 0x5d, 0xa0, 0xd5, + 0xcd, 0xfe, 0xc3, 0x1f, 0x41, 0x7e, 0x7f, 0xaa, 0xa2, 0x94, 0xbe, 0xec, 0x56, 0x83, 0x05, 0x72, + 0xeb, 0xa6, 0x04, 0xbf, 0x2a, 0x0b, 0x74, 0x05, 0x20, 0x7c, 0xe9, 0x28, 0x90, 0xb3, 0x6a, 0x8e, + 0xe2, 0x15, 0x59, 0xe4, 0xc3, 0xfc, 0xbc, 0x9e, 0xbd, 0x7e, 0x7e, 0xfb, 0x78, 0x59, 0xaa, 0x23, + 0x4c, 0x96, 0x7e, 0x8a, 0x16, 0xea, 0x4f, 0x74, 0x0d, 0x60, 0x75, 0x71, 0x3e, 0xb4, 0xf5, 0x6e, + 0x52, 0xc1, 0x1a, 0xad, 0xe6, 0x27, 0x14, 0xba, 0xdd, 0xa6, 0x6a, 0xb7, 0x81, 0xd6, 0x56, 0xb5, + 0x7b, 0xb5, 0xda, 0xf6, 0xf1, 0x64, 0x86, 0xc1, 0x74, 0x86, 0xc1, 0xc3, 0x0c, 0x83, 0x8b, 0x39, + 0x36, 0xa6, 0x73, 0x6c, 0xdc, 0xcd, 0xb1, 0xd1, 0xd9, 0x09, 0x23, 0xd9, 0x4f, 0x7d, 0x27, 0xe0, + 0x43, 0x32, 0x4a, 0x3d, 0xe1, 0x25, 0x03, 0xcf, 0x17, 0xfa, 0xc8, 0x78, 0x97, 0x2e, 0x07, 0xc8, + 0x71, 0x4c, 0x85, 0x5f, 0x51, 0x4f, 0x72, 0xfb, 0x29, 0x00, 0x00, 0xff, 0xff, 0x92, 0x2c, 0xf1, + 0x51, 0x1a, 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/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 new file mode 100644 index 0000000..bf3b25a --- /dev/null +++ b/osmosis/epochs/types/query.pb.gw.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: osmosis/epochs/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(false))) + + 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(false))) +) + +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 new file mode 100644 index 0000000..a3a5118 --- /dev/null +++ b/osmosis/gamm/pool-models/balancer/balancerPool.pb.go @@ -0,0 +1,1515 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/gamm/pool-models/balancer/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" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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_7e991f749f68c2a4, []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_7e991f749f68c2a4, []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 types1.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_7e991f749f68c2a4, []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() types1.Coin { + if m != nil { + return m.Token + } + return types1.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 types1.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_7e991f749f68c2a4, []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/pool-models/balancer/balancerPool.proto", fileDescriptor_7e991f749f68c2a4) +} + +var fileDescriptor_7e991f749f68c2a4 = []byte{ + // 816 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x4e, 0xeb, 0x46, + 0x14, 0x8e, 0x93, 0x40, 0x2e, 0x93, 0x7b, 0x6f, 0xc5, 0x90, 0x85, 0x09, 0x6a, 0x8c, 0xa6, 0x52, + 0x85, 0x2a, 0xb0, 0x05, 0xed, 0x8a, 0x4d, 0x85, 0x81, 0x56, 0xec, 0xa8, 0xa9, 0x44, 0x5b, 0x21, + 0x59, 0x93, 0x78, 0xe2, 0x58, 0xd8, 0x1e, 0xd7, 0x33, 0x81, 0xf2, 0x06, 0x5d, 0xb2, 0x6c, 0x77, + 0xdd, 0x77, 0x55, 0xa9, 0x0f, 0x81, 0xda, 0x0d, 0xcb, 0xaa, 0x0b, 0xb7, 0x82, 0xae, 0xba, 0xcc, + 0x13, 0x54, 0xf3, 0xe3, 0x24, 0xd0, 0x44, 0x80, 0xee, 0x2a, 0x33, 0x67, 0xce, 0xf9, 0xbe, 0xf3, + 0xf3, 0x1d, 0x07, 0x7c, 0x42, 0x59, 0x42, 0x59, 0xc4, 0x9c, 0x10, 0x27, 0x89, 0x93, 0x51, 0x1a, + 0x6f, 0x25, 0x34, 0x20, 0x31, 0x73, 0xba, 0x38, 0xc6, 0x69, 0x8f, 0xe4, 0xe3, 0xc3, 0x31, 0xa5, + 0xb1, 0x9d, 0xe5, 0x94, 0x53, 0xd8, 0xd2, 0x51, 0xb6, 0x88, 0xb2, 0x2f, 0xb6, 0xbb, 0x84, 0xe3, + 0xed, 0xf6, 0x6a, 0x4f, 0x9a, 0x7d, 0xe9, 0xe3, 0xa8, 0x8b, 0x0a, 0x68, 0xb7, 0x42, 0x1a, 0x52, + 0x65, 0x17, 0x27, 0x6d, 0xed, 0x84, 0x94, 0x86, 0x31, 0x71, 0xe4, 0xad, 0x3b, 0xec, 0x3b, 0xc1, + 0x30, 0xc7, 0x3c, 0xa2, 0xa9, 0x7e, 0xb7, 0x1e, 0xbf, 0xf3, 0x28, 0x21, 0x8c, 0xe3, 0x24, 0x2b, + 0x01, 0x14, 0x89, 0xd3, 0xc5, 0x8c, 0x38, 0x3a, 0x0d, 0xa7, 0x47, 0x23, 0x0d, 0x80, 0x7e, 0xaf, + 0x01, 0xf3, 0x24, 0xa1, 0x94, 0x0f, 0x4e, 0x49, 0x14, 0x0e, 0xf8, 0xfe, 0x00, 0xa7, 0x21, 0x39, + 0xc6, 0x39, 0x4e, 0x18, 0xfc, 0x0a, 0x00, 0xc6, 0x71, 0xce, 0x7d, 0x81, 0x6a, 0x1a, 0xeb, 0xc6, + 0x46, 0x73, 0xa7, 0x6d, 0x2b, 0x4a, 0xbb, 0xa4, 0xb4, 0xbf, 0x2c, 0x29, 0xdd, 0xf7, 0x6f, 0x0a, + 0xab, 0x32, 0x2a, 0xac, 0xe5, 0x2b, 0x9c, 0xc4, 0xbb, 0x68, 0x12, 0x8b, 0xae, 0xff, 0xb2, 0x0c, + 0x6f, 0x49, 0x1a, 0x84, 0x3b, 0x1c, 0x80, 0x57, 0x65, 0x25, 0x66, 0x55, 0xe2, 0xae, 0xfe, 0x0f, + 0xf7, 0x40, 0x3b, 0xb8, 0xdb, 0x02, 0xf6, 0xdf, 0xc2, 0x82, 0x65, 0xc8, 0x26, 0x4d, 0x22, 0x4e, + 0x92, 0x8c, 0x5f, 0x8d, 0x0a, 0xeb, 0x3d, 0x45, 0x56, 0xbe, 0xa1, 0x1f, 0x04, 0xd5, 0x18, 0x1d, + 0x5e, 0x80, 0x56, 0x94, 0x46, 0x3c, 0xc2, 0xb1, 0x2f, 0x66, 0xe7, 0x5f, 0xca, 0x32, 0x99, 0x59, + 0x5b, 0xaf, 0x6d, 0x34, 0x77, 0x2c, 0x7b, 0xd6, 0x9c, 0x6c, 0x31, 0xc8, 0x3d, 0xc6, 0x08, 0x77, + 0x3f, 0xd0, 0x25, 0xad, 0x29, 0x96, 0x59, 0x50, 0xc8, 0x83, 0xda, 0x2c, 0xc2, 0x54, 0x1b, 0x19, + 0x64, 0x60, 0x85, 0xe3, 0x3c, 0x24, 0xfc, 0x21, 0x6d, 0xfd, 0x79, 0xb4, 0x48, 0xd3, 0xb6, 0x15, + 0xed, 0x0c, 0x24, 0xe4, 0x2d, 0x2b, 0xeb, 0x14, 0x29, 0xfa, 0xa7, 0x0a, 0x80, 0xb8, 0xeb, 0xf9, + 0x9d, 0x81, 0x57, 0xec, 0x12, 0x67, 0x7e, 0x9f, 0xa8, 0xe9, 0x2d, 0xb9, 0x7b, 0x02, 0xf7, 0xcf, + 0xc2, 0xfa, 0x30, 0x8c, 0xf8, 0x60, 0xd8, 0xb5, 0x7b, 0x34, 0xd1, 0x32, 0xd4, 0x3f, 0x5b, 0x2c, + 0x38, 0x77, 0xf8, 0x55, 0x46, 0x98, 0x7d, 0x40, 0x7a, 0x93, 0xf6, 0x96, 0x38, 0xc8, 0x6b, 0x88, + 0xe3, 0x67, 0x84, 0x08, 0x74, 0xf2, 0x5d, 0xc4, 0x25, 0x7a, 0xf5, 0xdd, 0xd0, 0x4b, 0x1c, 0xe4, + 0x35, 0xc4, 0x51, 0xa0, 0xff, 0x68, 0x80, 0x35, 0x26, 0x85, 0xa9, 0x2b, 0xf6, 0x7b, 0x52, 0x9a, + 0x7e, 0x26, 0x6b, 0x33, 0x6b, 0x52, 0x35, 0xf6, 0xec, 0x46, 0xce, 0x53, 0xb4, 0xfb, 0xd1, 0x4d, + 0x61, 0x19, 0xa3, 0xc2, 0x42, 0xba, 0xaa, 0xf9, 0x04, 0xc8, 0x33, 0xd9, 0x1c, 0x14, 0xf4, 0xb3, + 0x01, 0x96, 0xc6, 0xb3, 0x82, 0x87, 0x60, 0x81, 0xd3, 0x73, 0x92, 0xea, 0x05, 0x59, 0xb5, 0xf5, + 0x5e, 0x8b, 0x95, 0x1b, 0x67, 0xb4, 0x4f, 0xa3, 0xd4, 0x6d, 0xe9, 0xa9, 0xbe, 0xd6, 0x53, 0x15, + 0x51, 0xc8, 0x53, 0xd1, 0xf0, 0x14, 0x2c, 0xaa, 0x3c, 0x74, 0x33, 0x3f, 0x7d, 0x41, 0x33, 0x8f, + 0x52, 0x3e, 0x2a, 0xac, 0x37, 0x0a, 0x56, 0xa1, 0x20, 0x4f, 0xc3, 0xa1, 0x5f, 0xea, 0xa0, 0x2e, + 0xb2, 0x85, 0x9b, 0xa0, 0x81, 0x83, 0x20, 0x27, 0x8c, 0x69, 0x35, 0xc0, 0x51, 0x61, 0xbd, 0x55, + 0x41, 0xfa, 0x01, 0x79, 0xa5, 0x0b, 0x7c, 0x0b, 0xaa, 0x51, 0x20, 0x73, 0xa9, 0x7b, 0xd5, 0x28, + 0x80, 0x7d, 0xd0, 0x94, 0xfa, 0x7b, 0xd0, 0xff, 0xf5, 0xf9, 0x42, 0xd6, 0x1d, 0x7f, 0xb4, 0x40, + 0xe5, 0xa7, 0xd2, 0x9f, 0xc2, 0x42, 0x1e, 0xc8, 0x26, 0xa2, 0xfd, 0x02, 0xb4, 0xfa, 0x43, 0x3e, + 0xcc, 0x89, 0x72, 0x09, 0xe9, 0x05, 0xc9, 0x53, 0x9a, 0x9b, 0x75, 0x99, 0xb2, 0x35, 0x81, 0x9a, + 0xe5, 0x85, 0x3c, 0xa8, 0xcc, 0x22, 0x83, 0xcf, 0xb5, 0x11, 0x7e, 0x0d, 0x5e, 0x73, 0xca, 0x71, + 0xec, 0xb3, 0x01, 0xce, 0x09, 0x33, 0x17, 0x9e, 0x1a, 0xd4, 0x9a, 0x4e, 0x7a, 0xa5, 0x1c, 0xd4, + 0x24, 0x18, 0x79, 0x4d, 0x79, 0x3d, 0x91, 0x37, 0x78, 0xa6, 0xbb, 0x82, 0x85, 0x14, 0x98, 0xb9, + 0xf8, 0xbc, 0xf5, 0x6e, 0x6b, 0x7c, 0xa8, 0xf0, 0xa7, 0x10, 0x74, 0x2f, 0xa4, 0x1b, 0x83, 0x83, + 0x32, 0x71, 0xad, 0x8c, 0x86, 0xec, 0xc1, 0xe1, 0x8b, 0x95, 0xf1, 0xa0, 0x8e, 0x52, 0x1f, 0xaa, + 0x0e, 0x25, 0xef, 0xdd, 0x37, 0xdf, 0xff, 0x64, 0x55, 0x7e, 0xfb, 0x75, 0x6b, 0x41, 0x24, 0x79, + 0xe4, 0x9e, 0xdd, 0xdc, 0x75, 0x8c, 0xdb, 0xbb, 0x8e, 0xf1, 0xf7, 0x5d, 0xc7, 0xb8, 0xbe, 0xef, + 0x54, 0x6e, 0xef, 0x3b, 0x95, 0x3f, 0xee, 0x3b, 0x95, 0x6f, 0xdc, 0x29, 0xd2, 0x6f, 0x87, 0x98, + 0xe1, 0x3c, 0xc6, 0x5d, 0xa6, 0x8f, 0x29, 0x0d, 0x88, 0xf3, 0xe4, 0xff, 0x65, 0x77, 0x51, 0x7e, + 0xe3, 0x3f, 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x33, 0xfe, 0x27, 0x5b, 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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovBalancerPool(uint64(l)) + l = github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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/msgs.go b/osmosis/gamm/pool-models/balancer/msgs.go new file mode 100644 index 0000000..e848ccc --- /dev/null +++ b/osmosis/gamm/pool-models/balancer/msgs.go @@ -0,0 +1,19 @@ +// This file contains dummy implementation of ValidateBasic and GetSigners method for Msg types +// so that they implement sdk.Msg interface. +package balancer + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + _ sdk.Msg = &MsgCreateBalancerPool{} +) + +func (msg MsgCreateBalancerPool) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgCreateBalancerPool) GetSigners() []sdk.AccAddress { + panic("not implemented") +} diff --git a/osmosis/gamm/pool-models/balancer/tx.pb.go b/osmosis/gamm/pool-models/balancer/tx.pb.go new file mode 100644 index 0000000..2a2a641 --- /dev/null +++ b/osmosis/gamm/pool-models/balancer/tx.pb.go @@ -0,0 +1,748 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/gamm/pool-models/balancer/tx/tx.proto + +package balancer + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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_0647ee155de97433, []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_0647ee155de97433, []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/pool-models/balancer/tx/tx.proto", fileDescriptor_0647ee155de97433) +} + +var fileDescriptor_0647ee155de97433 = []byte{ + // 428 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x4f, 0x6a, 0x14, 0x41, + 0x14, 0xc6, 0xa7, 0x32, 0xc3, 0x88, 0x35, 0xb8, 0xb0, 0x88, 0x32, 0x8c, 0xd8, 0x3d, 0xb4, 0x9b, + 0x71, 0x91, 0x2a, 0x32, 0xba, 0x72, 0x23, 0xb6, 0xc1, 0x90, 0x45, 0x20, 0xf6, 0x4e, 0x11, 0x42, + 0x75, 0xba, 0x6c, 0x07, 0xba, 0xfb, 0xb5, 0xf5, 0x6a, 0x42, 0xbc, 0x85, 0x27, 0x70, 0xe9, 0x19, + 0x3c, 0x42, 0x96, 0x59, 0xba, 0x6a, 0x64, 0xe6, 0x06, 0x73, 0x02, 0xa9, 0xaa, 0x1e, 0x89, 0xd0, + 0x12, 0x21, 0xbb, 0xc7, 0xab, 0xdf, 0xf7, 0xbd, 0x3f, 0xf5, 0xe8, 0x1e, 0x60, 0x09, 0xb8, 0x40, + 0x91, 0xcb, 0xb2, 0x14, 0x35, 0x40, 0xb1, 0x57, 0x42, 0xa6, 0x0a, 0x14, 0xa9, 0x2c, 0x64, 0x75, + 0xa6, 0xb4, 0x30, 0x17, 0xc2, 0x5c, 0xf0, 0x5a, 0x83, 0x01, 0x36, 0x6b, 0x71, 0x6e, 0x71, 0x6e, + 0x71, 0x4f, 0xf3, 0x2d, 0xcd, 0xcf, 0xf7, 0x53, 0x65, 0xe4, 0xfe, 0x64, 0x37, 0x87, 0x1c, 0x9c, + 0x48, 0xd8, 0xc8, 0xeb, 0x27, 0xcf, 0x6f, 0x2e, 0xb7, 0x0d, 0x4e, 0x00, 0x0a, 0xaf, 0x8a, 0x7e, + 0xec, 0xd0, 0x07, 0xc7, 0x98, 0xbf, 0xd6, 0x4a, 0x1a, 0x15, 0x5f, 0x7b, 0x67, 0x4f, 0xe9, 0x10, + 0x55, 0x95, 0x29, 0x3d, 0x26, 0x53, 0x32, 0xbb, 0x1b, 0xdf, 0xdf, 0x34, 0xe1, 0xbd, 0x2f, 0xb2, + 0x2c, 0x5e, 0x44, 0x3e, 0x1f, 0x25, 0x2d, 0xc0, 0xde, 0xd1, 0x91, 0xad, 0x77, 0x5a, 0x4b, 0x2d, + 0x4b, 0x1c, 0xef, 0x4c, 0xc9, 0x6c, 0x34, 0x9f, 0xf2, 0xbf, 0x06, 0x6a, 0x9b, 0xe7, 0xd6, 0xfb, + 0xc4, 0x71, 0xf1, 0xc3, 0x4d, 0x13, 0x32, 0xef, 0x78, 0x4d, 0x1e, 0x25, 0xb4, 0xfe, 0xc3, 0xb0, + 0x37, 0xad, 0xb5, 0x44, 0x54, 0x06, 0xc7, 0xfd, 0x69, 0x7f, 0x36, 0x9a, 0x87, 0xff, 0xb6, 0x7e, + 0x65, 0xb9, 0x78, 0x70, 0xd9, 0x84, 0x3d, 0xef, 0xe3, 0x12, 0xc8, 0xde, 0xd2, 0xdd, 0x8f, 0x4b, + 0xb3, 0xd4, 0xea, 0xd4, 0xd9, 0xe5, 0x70, 0xae, 0x74, 0x05, 0x7a, 0x3c, 0x70, 0xb3, 0x85, 0x9b, + 0x26, 0x7c, 0xe4, 0x3b, 0xe9, 0xa2, 0xa2, 0x84, 0xf9, 0xb4, 0xad, 0x70, 0xb8, 0x4d, 0x1e, 0xd0, + 0xc7, 0x9d, 0x9b, 0x4b, 0x14, 0xd6, 0x50, 0xa1, 0x62, 0x4f, 0xe8, 0x1d, 0x67, 0xb3, 0xc8, 0xdc, + 0x0a, 0x07, 0x31, 0x5d, 0x35, 0xe1, 0xd0, 0x22, 0x47, 0x07, 0xc9, 0xd0, 0x3e, 0x1d, 0x65, 0xf3, + 0xef, 0x84, 0xf6, 0x8f, 0x31, 0x67, 0xdf, 0x08, 0x65, 0x1d, 0xbf, 0xf0, 0x92, 0xff, 0xef, 0x59, + 0xf0, 0xce, 0x66, 0x26, 0x87, 0xb7, 0x34, 0xd8, 0x4e, 0x13, 0x7f, 0xb8, 0x5c, 0x05, 0xe4, 0x6a, + 0x15, 0x90, 0x5f, 0xab, 0x80, 0x7c, 0x5d, 0x07, 0xbd, 0xab, 0x75, 0xd0, 0xfb, 0xb9, 0x0e, 0x7a, + 0xef, 0xe3, 0x7c, 0x61, 0x3e, 0x2d, 0x53, 0x7e, 0x06, 0xa5, 0xf8, 0xbc, 0x94, 0x28, 0x75, 0x21, + 0x53, 0x6c, 0xc3, 0x0a, 0x32, 0x25, 0x6e, 0x3c, 0xcd, 0x74, 0xe8, 0xce, 0xf1, 0xd9, 0xef, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x25, 0xdd, 0x3d, 0x04, 0x35, 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/pool-models/balancer/tx/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/msgs.go b/osmosis/gamm/types/msgs.go new file mode 100644 index 0000000..7276faa --- /dev/null +++ b/osmosis/gamm/types/msgs.go @@ -0,0 +1,82 @@ +// This file contains dummy implementation of ValidateBasic and GetSigners method for Msg types +// so that they implement sdk.Msg interface. +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + _ sdk.Msg = &MsgSwapExactAmountIn{} + _ sdk.Msg = &MsgSwapExactAmountOut{} + _ sdk.Msg = &MsgJoinPool{} + _ sdk.Msg = &MsgExitPool{} + _ sdk.Msg = &MsgJoinSwapExternAmountIn{} + _ sdk.Msg = &MsgExitSwapExternAmountOut{} + _ sdk.Msg = &MsgJoinSwapShareAmountOut{} + _ sdk.Msg = &MsgExitSwapShareAmountIn{} +) + +func (msg MsgSwapExactAmountIn) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgSwapExactAmountIn) GetSigners() []sdk.AccAddress { + panic("not implemented") +} + +func (msg MsgSwapExactAmountOut) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgSwapExactAmountOut) GetSigners() []sdk.AccAddress { + panic("not implemented") +} + +func (msg MsgJoinPool) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgJoinPool) GetSigners() []sdk.AccAddress { + panic("not implemented") +} + +func (msg MsgExitPool) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgExitPool) GetSigners() []sdk.AccAddress { + panic("not implemented") +} + +func (msg MsgJoinSwapExternAmountIn) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgJoinSwapExternAmountIn) GetSigners() []sdk.AccAddress { + panic("not implemented") +} + +func (msg MsgJoinSwapShareAmountOut) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgJoinSwapShareAmountOut) GetSigners() []sdk.AccAddress { + panic("not implemented") +} + +func (msg MsgExitSwapExternAmountOut) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgExitSwapExternAmountOut) GetSigners() []sdk.AccAddress { + panic("not implemented") +} + +func (msg MsgExitSwapShareAmountIn) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgExitSwapShareAmountIn) GetSigners() []sdk.AccAddress { + panic("not implemented") +} diff --git a/osmosis/gamm/types/query.pb.go b/osmosis/gamm/types/query.pb.go new file mode 100644 index 0000000..e25a3b4 --- /dev/null +++ b/osmosis/gamm/types/query.pb.go @@ -0,0 +1,4370 @@ +// 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/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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 { + 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{ + // 1324 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x97, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xc0, 0xb3, 0xa9, 0x93, 0xc6, 0x93, 0x6f, 0xd3, 0x64, 0x9a, 0xb6, 0xae, 0xd3, 0x7a, 0xfb, + 0x1d, 0x44, 0x13, 0xda, 0x64, 0x97, 0x34, 0xe9, 0xa5, 0x02, 0x4a, 0x4d, 0x93, 0x36, 0x15, 0x6d, + 0xc3, 0x16, 0x81, 0x80, 0x83, 0x35, 0x89, 0x17, 0x77, 0x55, 0x7b, 0x67, 0xe3, 0x99, 0x25, 0x8d, + 0x50, 0x85, 0x84, 0x10, 0x27, 0x0e, 0x48, 0x85, 0x5b, 0xa5, 0x72, 0xe0, 0x80, 0x38, 0xf3, 0x2f, + 0x20, 0x55, 0x48, 0x48, 0x45, 0x5c, 0x10, 0x07, 0x83, 0x5a, 0x0e, 0x9c, 0xfd, 0x0f, 0x80, 0x66, + 0xe6, 0xed, 0x0f, 0x27, 0x1b, 0xdb, 0x09, 0x42, 0xe2, 0xe4, 0xdd, 0x79, 0xbf, 0x3e, 0xef, 0xbd, + 0x99, 0x9d, 0x67, 0x74, 0x9a, 0xf1, 0x06, 0xe3, 0x1e, 0xb7, 0x6b, 0xb4, 0xd1, 0xb0, 0x3f, 0x98, + 0x5f, 0x73, 0x05, 0x9d, 0xb7, 0x37, 0x42, 0xb7, 0xb9, 0x65, 0x05, 0x4d, 0x26, 0x18, 0x9e, 0x04, + 0x0d, 0x4b, 0x6a, 0x58, 0xa0, 0x51, 0x9c, 0xac, 0xb1, 0x1a, 0x53, 0x0a, 0xb6, 0x7c, 0xd2, 0xba, + 0xc5, 0x53, 0x99, 0xde, 0xc4, 0x3d, 0x10, 0x97, 0xd6, 0x95, 0xdc, 0x5e, 0xa3, 0xdc, 0x8d, 0xa5, + 0xeb, 0xcc, 0xf3, 0x41, 0x7e, 0x36, 0x2d, 0x57, 0x0c, 0xb1, 0x56, 0x40, 0x6b, 0x9e, 0x4f, 0x85, + 0xc7, 0x22, 0xdd, 0x93, 0x35, 0xc6, 0x6a, 0x75, 0xd7, 0xa6, 0x81, 0x67, 0x53, 0xdf, 0x67, 0x42, + 0x09, 0x39, 0x48, 0x4f, 0x80, 0x54, 0xbd, 0xad, 0x85, 0xef, 0xdb, 0xd4, 0xdf, 0x8a, 0x44, 0x3a, + 0x48, 0x45, 0xc3, 0xeb, 0x17, 0x2d, 0x22, 0x97, 0xd0, 0xf8, 0x1b, 0x32, 0xea, 0x2a, 0x63, 0x75, + 0xc7, 0xdd, 0x08, 0x5d, 0x2e, 0xf0, 0x39, 0x74, 0x30, 0x60, 0xac, 0x5e, 0xf1, 0xaa, 0x05, 0xe3, + 0xb4, 0x31, 0x93, 0x2b, 0xe3, 0x76, 0xcb, 0x1c, 0xdb, 0xa2, 0x8d, 0xfa, 0x45, 0x02, 0x02, 0xe2, + 0x0c, 0xcb, 0xa7, 0x95, 0x2a, 0xb9, 0x86, 0x26, 0x52, 0x0e, 0x78, 0xc0, 0x7c, 0xee, 0xe2, 0x05, + 0x94, 0x93, 0x62, 0x65, 0x3e, 0x7a, 0x7e, 0xd2, 0xd2, 0x68, 0x56, 0x84, 0x66, 0x5d, 0xf6, 0xb7, + 0xca, 0xf9, 0x1f, 0xbe, 0x9b, 0x1b, 0x92, 0x56, 0x2b, 0x8e, 0x52, 0x26, 0xef, 0xa5, 0x3c, 0xf1, + 0x88, 0x65, 0x19, 0xa1, 0xa4, 0x0e, 0x85, 0x41, 0xe5, 0xef, 0x8c, 0x05, 0x29, 0xc8, 0xa2, 0x59, + 0xba, 0x71, 0x50, 0x34, 0x6b, 0x95, 0xd6, 0x5c, 0xb0, 0x75, 0x52, 0x96, 0xe4, 0x0b, 0x03, 0xe1, + 0xb4, 0x77, 0x00, 0xbd, 0x80, 0x86, 0x64, 0x6c, 0x5e, 0x30, 0x4e, 0x1f, 0xe8, 0x87, 0x54, 0x6b, + 0xe3, 0xab, 0x19, 0x54, 0xd3, 0x3d, 0xa9, 0x74, 0xcc, 0x0e, 0xac, 0x63, 0x68, 0x52, 0x51, 0xdd, + 0x0c, 0x1b, 0xe9, 0xb4, 0xc9, 0x75, 0x74, 0x74, 0xdb, 0x3a, 0x00, 0xcf, 0xa3, 0xbc, 0x1f, 0x36, + 0x2a, 0x11, 0xb4, 0xec, 0xce, 0x64, 0xbb, 0x65, 0x8e, 0xeb, 0xee, 0xc4, 0x22, 0xe2, 0x8c, 0xf8, + 0x60, 0x4a, 0x96, 0xd0, 0xb1, 0x38, 0xf3, 0x55, 0xda, 0xa4, 0x0d, 0xbe, 0xaf, 0x46, 0x5f, 0x45, + 0xc7, 0x77, 0xb8, 0x01, 0xa8, 0x59, 0x34, 0x1c, 0xa8, 0x95, 0x6e, 0x0d, 0x77, 0x40, 0x87, 0xdc, + 0x40, 0x25, 0xe5, 0xe8, 0x4d, 0x26, 0x68, 0x5d, 0x7a, 0x7b, 0xdd, 0xdb, 0x08, 0xbd, 0xaa, 0x27, + 0xb6, 0xf6, 0xc5, 0xf5, 0x95, 0x81, 0xcc, 0x5d, 0xfd, 0x01, 0xe0, 0x7d, 0x94, 0xaf, 0x47, 0x8b, + 0xd0, 0xea, 0x13, 0x1d, 0xed, 0x8a, 0x1a, 0xf5, 0x1a, 0xf3, 0xfc, 0xf2, 0x95, 0xc7, 0x2d, 0x73, + 0x20, 0x29, 0x6a, 0x6c, 0x49, 0xbe, 0xfd, 0xcd, 0x9c, 0xa9, 0x79, 0xe2, 0x4e, 0xb8, 0x66, 0xad, + 0xb3, 0x06, 0x1c, 0x24, 0xf8, 0x99, 0xe3, 0xd5, 0xbb, 0xb6, 0xd8, 0x0a, 0x5c, 0xae, 0x9c, 0x70, + 0x27, 0x89, 0x48, 0x96, 0xa1, 0x74, 0x8a, 0xf0, 0xf6, 0x1d, 0xda, 0x74, 0xf7, 0xd7, 0x82, 0x10, + 0x15, 0x76, 0xfa, 0x81, 0x14, 0xdf, 0x41, 0xff, 0x13, 0x72, 0xb9, 0xc2, 0xd5, 0x3a, 0x74, 0xa2, + 0x4b, 0x96, 0x53, 0x90, 0xe5, 0x11, 0x1d, 0x2c, 0x6d, 0x4c, 0x9c, 0x51, 0x91, 0x84, 0x20, 0x7f, + 0x1a, 0xb0, 0x1b, 0x6f, 0x07, 0x4c, 0xac, 0x36, 0xbd, 0x75, 0x77, 0x3f, 0xf4, 0x78, 0x09, 0x8d, + 0x4b, 0x8a, 0x0a, 0xe5, 0xdc, 0x15, 0x95, 0xaa, 0xeb, 0xb3, 0x86, 0x3a, 0x3a, 0xf9, 0xf2, 0x54, + 0xbb, 0x65, 0x1e, 0xd7, 0x56, 0xdb, 0x35, 0x88, 0x33, 0x26, 0x97, 0x2e, 0xcb, 0x95, 0x2b, 0x72, + 0x01, 0x5f, 0x43, 0x13, 0x1b, 0x21, 0x13, 0x9d, 0x7e, 0x0e, 0x28, 0x3f, 0x27, 0xdb, 0x2d, 0xb3, + 0xa0, 0xfd, 0xec, 0x50, 0x21, 0xce, 0x61, 0xb5, 0x96, 0x78, 0xba, 0x9e, 0x1b, 0xc9, 0x8d, 0x0f, + 0x39, 0xa3, 0x9b, 0x9e, 0xb8, 0x73, 0x7b, 0x93, 0x06, 0xcb, 0xae, 0x4b, 0x6e, 0xc2, 0x59, 0x49, + 0x65, 0x0a, 0xf5, 0x5d, 0x44, 0x88, 0x07, 0x4c, 0x54, 0x02, 0xb9, 0xaa, 0xb2, 0xcd, 0x97, 0x8f, + 0xb6, 0x5b, 0xe6, 0x84, 0x8e, 0x97, 0xc8, 0x88, 0x93, 0xe7, 0x91, 0x35, 0xf9, 0xcb, 0x40, 0xa7, + 0xb4, 0xc3, 0x4d, 0x1a, 0x2c, 0xdd, 0xa3, 0xeb, 0xe2, 0x72, 0x83, 0x85, 0xbe, 0x58, 0xf1, 0xa3, + 0x12, 0xbe, 0x80, 0x86, 0xb9, 0xeb, 0x57, 0xdd, 0x26, 0xf8, 0x9c, 0x68, 0xb7, 0xcc, 0x43, 0xe0, + 0x53, 0xad, 0x13, 0x07, 0x14, 0xd2, 0xd5, 0x1e, 0xec, 0x59, 0x6d, 0x0b, 0x8d, 0x08, 0x76, 0xd7, + 0xf5, 0x2b, 0x9e, 0x0f, 0xd5, 0x39, 0xd2, 0x6e, 0x99, 0x87, 0xa3, 0x66, 0x6b, 0x09, 0x71, 0x0e, + 0xaa, 0xc7, 0x15, 0x1f, 0xbf, 0x85, 0x86, 0x9b, 0x2c, 0x14, 0x2e, 0x2f, 0xe4, 0xd4, 0xf9, 0x98, + 0xb6, 0xb2, 0x2e, 0x41, 0x4b, 0xe6, 0x11, 0xa7, 0x20, 0xf5, 0xcb, 0x47, 0x61, 0x1f, 0x01, 0xb4, + 0x76, 0x42, 0x1c, 0xf0, 0x46, 0xbe, 0x34, 0xe0, 0xb8, 0x67, 0x54, 0x00, 0x4a, 0xcb, 0xd1, 0xb8, + 0x06, 0x62, 0xa1, 0xa8, 0x50, 0x25, 0x85, 0x62, 0xac, 0x48, 0xdf, 0xbf, 0xb6, 0xcc, 0x33, 0x7d, + 0x9c, 0xba, 0x15, 0x5f, 0x24, 0xdb, 0x68, 0xbb, 0x3f, 0xe2, 0x8c, 0xa9, 0xa5, 0x5b, 0x21, 0x84, + 0x27, 0x9f, 0x0c, 0x66, 0x73, 0xdd, 0x0a, 0xc5, 0xbf, 0xdd, 0x9a, 0xb7, 0xe3, 0x52, 0x1f, 0x50, + 0xa5, 0x9e, 0xe9, 0x55, 0x6a, 0xc9, 0xd4, 0x47, 0xad, 0xe5, 0xe5, 0x10, 0x27, 0x5e, 0xc8, 0x29, + 0xe6, 0xd4, 0xe5, 0x10, 0x8b, 0x88, 0x33, 0x12, 0x15, 0x83, 0x3c, 0x88, 0xbe, 0x9e, 0x59, 0x65, + 0x80, 0xfe, 0x04, 0xe8, 0x70, 0xb4, 0x61, 0x3a, 0xdb, 0x73, 0x6d, 0xcf, 0xed, 0x39, 0xd6, 0xb9, + 0xff, 0xe2, 0xee, 0x1c, 0x82, 0x6d, 0x08, 0xcd, 0x39, 0x89, 0x8a, 0xc9, 0x87, 0x6e, 0xfb, 0xf5, + 0x40, 0x1e, 0x1a, 0x68, 0x2a, 0x53, 0xfc, 0x9f, 0xf8, 0xda, 0x9f, 0x7f, 0x74, 0x08, 0x0d, 0x29, + 0x3c, 0xfc, 0x11, 0x52, 0x63, 0x03, 0xc7, 0xbb, 0x1c, 0xa6, 0x1d, 0xe3, 0x4e, 0x71, 0xa6, 0xb7, + 0xa2, 0x4e, 0x92, 0x3c, 0xf7, 0xf1, 0xcf, 0x7f, 0x3c, 0x18, 0x3c, 0x85, 0xa7, 0xec, 0xcc, 0x01, + 0x54, 0xcf, 0x29, 0x9f, 0x19, 0x68, 0x24, 0x1a, 0x21, 0xf0, 0xd9, 0x2e, 0xbe, 0xb7, 0xcd, 0x1f, + 0xc5, 0x73, 0x7d, 0xe9, 0x02, 0xca, 0xb4, 0x42, 0xf9, 0x3f, 0x36, 0xb3, 0x51, 0xe2, 0xa1, 0x04, + 0x7f, 0x6d, 0xa0, 0xb1, 0xce, 0x9e, 0xe1, 0x17, 0xbb, 0x04, 0xca, 0xec, 0x7e, 0x71, 0x7e, 0x0f, + 0x16, 0x00, 0x38, 0xa7, 0x00, 0xa7, 0xf1, 0xf3, 0xd9, 0x80, 0xfa, 0xea, 0x8b, 0x1b, 0x88, 0x3f, + 0x35, 0x50, 0x4e, 0x66, 0x88, 0xcf, 0xf4, 0xe8, 0x46, 0x84, 0x34, 0xdd, 0x53, 0xaf, 0x3f, 0x10, + 0x55, 0x25, 0xfb, 0x43, 0xf8, 0x60, 0xdc, 0xc7, 0x8f, 0x0c, 0x84, 0x92, 0x71, 0x0b, 0xcf, 0xf6, + 0x08, 0xd3, 0x31, 0xdc, 0x15, 0xe7, 0xfa, 0xd4, 0x06, 0xb4, 0x45, 0x85, 0x66, 0xe1, 0xd9, 0xbe, + 0xd0, 0x6c, 0x3d, 0xcb, 0xe1, 0xef, 0x0d, 0x84, 0x77, 0xce, 0x5d, 0x78, 0xb1, 0x57, 0x8f, 0xb2, + 0xc6, 0xbe, 0xe2, 0x85, 0x3d, 0x5a, 0x01, 0x79, 0x59, 0x91, 0xbf, 0x84, 0x2f, 0xf6, 0x47, 0xae, + 0xbb, 0xad, 0x5e, 0x93, 0x96, 0x7f, 0x63, 0xa0, 0xd1, 0xd4, 0x54, 0x85, 0xe7, 0x7a, 0xa1, 0x74, + 0x4c, 0x71, 0x45, 0xab, 0x5f, 0x75, 0x40, 0xbe, 0xa8, 0x90, 0x17, 0xf1, 0xf9, 0xbd, 0x20, 0xeb, + 0xd9, 0x0c, 0x3f, 0x34, 0x50, 0x3e, 0x1e, 0x4f, 0x70, 0xb7, 0x83, 0xba, 0x7d, 0x5c, 0x2b, 0xce, + 0xf6, 0xa7, 0xbc, 0xcf, 0x1d, 0x21, 0x8d, 0x39, 0xfe, 0xd1, 0x40, 0x27, 0x96, 0xb8, 0xf0, 0x1a, + 0x54, 0xb8, 0x3b, 0xae, 0x7c, 0xbc, 0xd0, 0x8d, 0x60, 0x97, 0x11, 0xa9, 0xb8, 0xb8, 0x37, 0x23, + 0xc0, 0x5f, 0x52, 0xf8, 0x97, 0xf0, 0xcb, 0xd9, 0xf8, 0x09, 0xb8, 0x0b, 0xb4, 0x36, 0xdf, 0xa4, + 0x41, 0xc5, 0x95, 0xce, 0xe0, 0x5e, 0xaa, 0x78, 0x3e, 0xfe, 0xc9, 0x40, 0xc5, 0x5d, 0xf2, 0xb9, + 0x15, 0x0a, 0xbc, 0x07, 0xb6, 0x64, 0xb2, 0xe8, 0xba, 0xd3, 0x77, 0xbf, 0x88, 0xc9, 0xb2, 0x4a, + 0xe9, 0x55, 0xfc, 0xca, 0x3f, 0x48, 0x89, 0x85, 0xa2, 0x7c, 0xe3, 0xf1, 0xd3, 0x92, 0xf1, 0xe4, + 0x69, 0xc9, 0xf8, 0xfd, 0x69, 0xc9, 0xf8, 0xfc, 0x59, 0x69, 0xe0, 0xc9, 0xb3, 0xd2, 0xc0, 0x2f, + 0xcf, 0x4a, 0x03, 0xef, 0x2e, 0xa4, 0x2e, 0xbc, 0x8d, 0x90, 0x72, 0xda, 0xac, 0xd3, 0x35, 0x0e, + 0x8f, 0x3e, 0xab, 0xba, 0x9d, 0x91, 0xd5, 0x0d, 0xb8, 0x36, 0xac, 0xfe, 0xe6, 0x2d, 0xfc, 0x1d, + 0x00, 0x00, 0xff, 0xff, 0x69, 0x6a, 0x7e, 0x76, 0x59, 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 new file mode 100644 index 0000000..2762a4b --- /dev/null +++ b/osmosis/gamm/types/query.pb.gw.go @@ -0,0 +1,1062 @@ +// 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) +) + +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 new file mode 100644 index 0000000..27cc4a3 --- /dev/null +++ b/osmosis/gamm/types/tx.pb.go @@ -0,0 +1,4971 @@ +// 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/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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 new file mode 100644 index 0000000..92e6fa5 --- /dev/null +++ b/osmosis/incentives/types/gauge.pb.go @@ -0,0 +1,868 @@ +// 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/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/quasarlabs/quasarnode/osmosis/lockup/types" + 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_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.LockableDurations[iNdEx], dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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 new file mode 100644 index 0000000..4343357 --- /dev/null +++ b/osmosis/lockup/types/lock.pb.go @@ -0,0 +1,1229 @@ +// 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" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovLock(uint64(l)) + l = github_com_gogo_protobuf_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_gogo_protobuf_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovLock(uint64(l)) + l = github_com_gogo_protobuf_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_gogo_protobuf_types.SizeOfStdTime(m.EndTime) + n += 1 + l + sovLock(uint64(l)) + l = github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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, types1.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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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/msgs.go b/osmosis/lockup/types/msgs.go new file mode 100644 index 0000000..eea4ecd --- /dev/null +++ b/osmosis/lockup/types/msgs.go @@ -0,0 +1,28 @@ +// This file contains dummy implementation of ValidateBasic and GetSigners method for Msg types +// so that they implement sdk.Msg interface. +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + _ sdk.Msg = &MsgLockTokens{} + _ sdk.Msg = &MsgBeginUnlocking{} +) + +func (msg MsgLockTokens) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgLockTokens) GetSigners() []sdk.AccAddress { + panic("not implemented") +} + +func (msg MsgBeginUnlocking) ValidateBasic() error { + panic("not implemented") +} + +func (msg MsgBeginUnlocking) GetSigners() []sdk.AccAddress { + panic("not implemented") +} diff --git a/osmosis/lockup/types/tx.pb.go b/osmosis/lockup/types/tx.pb.go new file mode 100644 index 0000000..64f7baa --- /dev/null +++ b/osmosis/lockup/types/tx.pb.go @@ -0,0 +1,2015 @@ +// 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" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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" + 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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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, types1.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, types1.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_gogo_protobuf_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 new file mode 100644 index 0000000..e9df16c --- /dev/null +++ b/osmosis/mint/types/mint.pb.go @@ -0,0 +1,1405 @@ +// 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/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 + +// 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 new file mode 100644 index 0000000..ee16284 --- /dev/null +++ b/osmosis/mint/types/query.pb.go @@ -0,0 +1,870 @@ +// 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/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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 new file mode 100644 index 0000000..5a191f7 --- /dev/null +++ b/osmosis/mint/types/query.pb.gw.go @@ -0,0 +1,218 @@ +// 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(false))) + + 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(false))) +) + +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 new file mode 100644 index 0000000..270da71 --- /dev/null +++ b/osmosis/pool-incentives/types/incentives.pb.go @@ -0,0 +1,1407 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/pool-incentives/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/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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_a8153bad03e553d1, []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_a8153bad03e553d1, []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_a8153bad03e553d1, []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_a8153bad03e553d1, []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_a8153bad03e553d1, []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_a8153bad03e553d1, []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/pool-incentives/v1beta1/incentives.proto", fileDescriptor_a8153bad03e553d1) +} + +var fileDescriptor_a8153bad03e553d1 = []byte{ + // 558 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, 0x4c, 0x61, 0xcb, 0xc0, 0x10, 0x05, 0x50, 0x04, 0x43, 0x65, 0x81, 0x40, 0x2c, 0xd1, + 0x39, 0xbe, 0x3a, 0x56, 0x6d, 0xbf, 0xe0, 0xbb, 0x14, 0xf5, 0x3f, 0x40, 0x62, 0x61, 0x64, 0xe4, + 0xff, 0x60, 0x63, 0xea, 0xd8, 0x11, 0x31, 0x18, 0x94, 0x2c, 0xcc, 0xf9, 0x0b, 0x90, 0xcf, 0x67, + 0x72, 0x02, 0x51, 0xc1, 0xe4, 0xf7, 0xee, 0xdd, 0xf7, 0xbd, 0xef, 0x7b, 0xef, 0x64, 0x7c, 0x17, + 0x78, 0x02, 0x3c, 0xe2, 0xee, 0x0c, 0x20, 0xde, 0x8f, 0xd2, 0x09, 0x4b, 0x45, 0x74, 0xc2, 0xb8, + 0x7b, 0x72, 0xe0, 0x33, 0x41, 0x0f, 0xdc, 0xf5, 0x11, 0x99, 0x65, 0x20, 0xc0, 0xb4, 0x14, 0x82, + 0x14, 0x08, 0xad, 0xaa, 0x00, 0xbb, 0xd7, 0x43, 0x08, 0x41, 0x5e, 0x75, 0x8b, 0xa8, 0x44, 0xed, + 0x5a, 0x21, 0x40, 0x18, 0x33, 0x57, 0x66, 0xfe, 0xfc, 0xc8, 0x0d, 0xe6, 0x19, 0x15, 0x11, 0xa4, + 0x65, 0xdd, 0x19, 0xe2, 0xe6, 0x21, 0xcd, 0x68, 0xc2, 0xcd, 0x3e, 0x6e, 0x27, 0x51, 0x2a, 0x58, + 0x30, 0x0e, 0x58, 0x0a, 0x49, 0x07, 0x75, 0xd1, 0xde, 0xd6, 0xe0, 0xe6, 0x2a, 0xb7, 0xb7, 0x4f, + 0x69, 0x12, 0xf7, 0x1d, 0xbd, 0xea, 0x78, 0x46, 0x99, 0x0e, 0x65, 0xf6, 0x16, 0xe1, 0x1b, 0x4f, + 0x61, 0x72, 0x4c, 0xfd, 0x98, 0x0d, 0x55, 0x03, 0x3e, 0x4a, 0x8f, 0xc0, 0x04, 0x6c, 0xc6, 0xaa, + 0x30, 0xae, 0x5a, 0xf3, 0x0e, 0xea, 0x6e, 0xec, 0x19, 0xf7, 0x76, 0x48, 0x29, 0x8e, 0x54, 0xe2, + 0x48, 0x85, 0x1d, 0xdc, 0x3e, 0xcb, 0xed, 0xda, 0x2a, 0xb7, 0x77, 0xca, 0xd6, 0x7f, 0x52, 0x38, + 0x1f, 0xbe, 0xd9, 0xc8, 0xbb, 0x16, 0xff, 0xde, 0xd4, 0xf9, 0x8c, 0xf0, 0xd6, 0x30, 0xe2, 0x22, + 0x93, 0xed, 0xa7, 0xb8, 0x2d, 0x40, 0xd0, 0x78, 0xfc, 0x86, 0x45, 0xe1, 0x54, 0x28, 0x53, 0x0f, + 0x0b, 0xf6, 0xaf, 0xb9, 0x7d, 0x27, 0x8c, 0xc4, 0x74, 0xee, 0x93, 0x09, 0x24, 0xee, 0x44, 0x8e, + 0x57, 0x7d, 0xf6, 0x79, 0x70, 0xec, 0x8a, 0xd3, 0x19, 0xe3, 0x64, 0x94, 0x8a, 0xf5, 0x08, 0x74, + 0x2e, 0xc7, 0x33, 0x64, 0xfa, 0x42, 0x66, 0xe6, 0x13, 0xdc, 0xca, 0xd8, 0x04, 0xb2, 0x80, 0x77, + 0xea, 0xd2, 0x5d, 0x8f, 0x5c, 0xbc, 0x30, 0x22, 0x55, 0x7a, 0x12, 0x33, 0x68, 0x14, 0x8a, 0xbc, + 0x8a, 0xc1, 0x79, 0x87, 0xb0, 0xa1, 0x95, 0x4d, 0x82, 0x37, 0x43, 0x3a, 0x0f, 0xd9, 0x38, 0x0a, + 0xa4, 0x85, 0xc6, 0x60, 0x7b, 0x95, 0xdb, 0x57, 0x4a, 0x51, 0x55, 0xc5, 0xf1, 0x5a, 0x32, 0x1c, + 0x05, 0xe6, 0x23, 0xdc, 0x54, 0x86, 0xeb, 0xd2, 0x30, 0xf9, 0x3f, 0xc3, 0x9e, 0x42, 0xf7, 0x1b, + 0x3f, 0x3e, 0xda, 0xc8, 0xf9, 0x84, 0xb0, 0x71, 0x08, 0x10, 0x3f, 0x83, 0xc7, 0x05, 0xbf, 0xd9, + 0xc3, 0xad, 0xc2, 0xd2, 0x5a, 0x8c, 0xb9, 0xca, 0xed, 0xcb, 0xa5, 0x18, 0x55, 0x70, 0xbc, 0x66, + 0x11, 0x8d, 0x02, 0xb3, 0xa7, 0x49, 0xaf, 0xcb, 0xdb, 0x57, 0x57, 0xb9, 0xdd, 0xd6, 0xa4, 0x6b, + 0xba, 0x3d, 0xbc, 0x59, 0x6d, 0xb8, 0xb3, 0xd1, 0x45, 0x17, 0xbf, 0x91, 0x5b, 0xea, 0x8d, 0xa8, + 0x31, 0x54, 0xc0, 0xf2, 0x65, 0xfc, 0xe2, 0x71, 0x18, 0x6e, 0x6b, 0xe2, 0xb9, 0xf9, 0x1c, 0x5f, + 0x92, 0x22, 0x05, 0x8c, 0x65, 0xdb, 0x7f, 0x5d, 0x97, 0x46, 0xa2, 0xd6, 0x65, 0xcc, 0xb4, 0xa3, + 0x97, 0x67, 0x0b, 0x0b, 0x9d, 0x2f, 0x2c, 0xf4, 0x7d, 0x61, 0xa1, 0xf7, 0x4b, 0xab, 0x76, 0xbe, + 0xb4, 0x6a, 0x5f, 0x96, 0x56, 0xed, 0xd5, 0x03, 0x6d, 0xe8, 0xaf, 0xe7, 0x94, 0xd3, 0x2c, 0xa6, + 0x3e, 0x57, 0x61, 0x0a, 0x01, 0x73, 0xff, 0xf6, 0x2f, 0x90, 0x0b, 0xf1, 0x9b, 0xd2, 0xfa, 0xfd, + 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x3f, 0x90, 0xb6, 0x33, 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_gogo_protobuf_types.StdDurationMarshalTo(m.LockableDurations[iNdEx], dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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 new file mode 100644 index 0000000..4b8b12f --- /dev/null +++ b/osmosis/pool-incentives/types/query.pb.go @@ -0,0 +1,2793 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: osmosis/pool-incentives/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types1 "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" + 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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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_302873ecccbc7636, []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 []types1.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_302873ecccbc7636, []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() []types1.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/pool-incentives/v1beta1/query.proto", fileDescriptor_302873ecccbc7636) +} + +var fileDescriptor_302873ecccbc7636 = []byte{ + // 923 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, + 0xaa, 0x28, 0xbb, 0xad, 0xdd, 0xf6, 0x50, 0x42, 0x91, 0xdc, 0x20, 0x14, 0x89, 0x43, 0xd8, 0x0b, + 0x08, 0x0e, 0xd6, 0x38, 0x3b, 0xd9, 0x8c, 0xd8, 0xec, 0x38, 0x3b, 0xeb, 0x42, 0x40, 0xbd, 0x54, + 0xe2, 0x0e, 0xe2, 0xc2, 0x19, 0xd1, 0x33, 0x27, 0xfe, 0x01, 0x87, 0xde, 0xa8, 0xc4, 0x85, 0x0b, + 0x06, 0x25, 0x1c, 0x38, 0xfb, 0x17, 0xa0, 0x9d, 0x7d, 0xbb, 0xb1, 0xd7, 0x59, 0xaf, 0x9d, 0xde, + 0x36, 0xf3, 0xde, 0xfb, 0xde, 0xf7, 0xcd, 0x7b, 0xf3, 0x39, 0x78, 0x53, 0xaa, 0x23, 0xa9, 0x84, + 0xb2, 0x3b, 0x52, 0xfa, 0x5b, 0x22, 0xd8, 0xe7, 0x41, 0x24, 0x1e, 0x71, 0x65, 0x3f, 0xba, 0xdd, + 0xe6, 0x11, 0xbb, 0x6d, 0x1f, 0x77, 0x79, 0x78, 0x62, 0x75, 0x42, 0x19, 0x49, 0x62, 0x42, 0xb2, + 0x15, 0x27, 0x9f, 0xe7, 0x5a, 0x90, 0x6b, 0xac, 0x78, 0xd2, 0x93, 0x3a, 0xd5, 0x8e, 0xbf, 0x92, + 0x2a, 0xe3, 0x75, 0x4f, 0x4a, 0xcf, 0xe7, 0x36, 0xeb, 0x08, 0x9b, 0x05, 0x81, 0x8c, 0x58, 0x24, + 0x64, 0xa0, 0x20, 0x6a, 0x42, 0x54, 0xff, 0xd5, 0xee, 0x1e, 0xd8, 0x6e, 0x37, 0xd4, 0x09, 0x69, + 0x3c, 0x25, 0x38, 0xc0, 0xcd, 0x63, 0x5d, 0x8f, 0x43, 0xfc, 0x56, 0x99, 0x80, 0x01, 0x9e, 0xba, + 0x82, 0x3e, 0xc4, 0x2b, 0x1f, 0xc7, 0xa2, 0x3e, 0x8c, 0x51, 0x76, 0x5d, 0xe5, 0xf0, 0xe3, 0x2e, + 0x57, 0x11, 0xd9, 0xc4, 0x57, 0x63, 0x8c, 0x96, 0x70, 0xab, 0x68, 0x1d, 0x6d, 0xcc, 0x35, 0x49, + 0xbf, 0x57, 0x7b, 0xf9, 0x84, 0x1d, 0xf9, 0xf7, 0x29, 0x04, 0xa8, 0x33, 0x1f, 0x7f, 0xed, 0xba, + 0xf4, 0xdb, 0x59, 0xfc, 0x6a, 0x0e, 0x45, 0x75, 0x64, 0xa0, 0x38, 0xf9, 0x19, 0xe1, 0x55, 0x4d, + 0xb0, 0x25, 0x5c, 0xd5, 0xfa, 0x52, 0x44, 0x87, 0xad, 0x54, 0x52, 0x15, 0xad, 0xcf, 0x6e, 0x2c, + 0xd5, 0x77, 0xad, 0xf1, 0xf7, 0x68, 0x5d, 0x08, 0x6c, 0xc1, 0xc1, 0x27, 0x22, 0x3a, 0xdc, 0x01, + 0xc0, 0x26, 0xed, 0xf7, 0x6a, 0x66, 0x42, 0xb1, 0xa0, 0x27, 0x75, 0x56, 0x3c, 0x40, 0x1a, 0xac, + 0x34, 0x7e, 0x43, 0x78, 0xf9, 0x02, 0x44, 0x62, 0xe1, 0x85, 0x14, 0x09, 0xae, 0x61, 0xb9, 0xdf, + 0xab, 0xbd, 0x32, 0xdc, 0x83, 0x3a, 0x57, 0x01, 0x94, 0xbc, 0x8f, 0x17, 0x32, 0x79, 0x57, 0xd6, + 0xd1, 0xc6, 0x52, 0x7d, 0xcd, 0x4a, 0x46, 0x6a, 0xa5, 0x23, 0xb5, 0x32, 0xba, 0x0b, 0xcf, 0x7a, + 0xb5, 0x99, 0x1f, 0xff, 0xae, 0x21, 0x27, 0x2b, 0x22, 0xdb, 0xd8, 0x00, 0xd8, 0xf4, 0x22, 0x5a, + 0x1d, 0x1e, 0xc6, 0x9f, 0xcc, 0xe3, 0xd5, 0xd9, 0x75, 0xb4, 0xb1, 0xe8, 0x54, 0x93, 0x6e, 0x69, + 0xc2, 0x5e, 0x16, 0xa7, 0xab, 0x30, 0x86, 0x1d, 0xa1, 0xa2, 0x70, 0x37, 0x38, 0x90, 0x30, 0x4d, + 0xfa, 0x18, 0xbf, 0x96, 0x0f, 0xc0, 0x80, 0xf6, 0x31, 0x76, 0xe3, 0xc3, 0x96, 0x08, 0x0e, 0xa4, + 0xd6, 0xb8, 0x54, 0xbf, 0x59, 0x36, 0x92, 0x0c, 0xa6, 0xb9, 0x16, 0x6b, 0xe8, 0xf7, 0x6a, 0x95, + 0xe4, 0x4a, 0xce, 0xa1, 0xa8, 0xb3, 0xe8, 0xa6, 0x59, 0x74, 0x05, 0x13, 0xdd, 0x7e, 0x8f, 0x85, + 0xec, 0x28, 0x5d, 0x31, 0xfa, 0x39, 0x5e, 0x1e, 0x3a, 0x05, 0x46, 0x3b, 0x78, 0xbe, 0xa3, 0x4f, + 0x80, 0xcd, 0xdb, 0x65, 0x6c, 0x92, 0xfa, 0xe6, 0x5c, 0x4c, 0xc5, 0x81, 0x5a, 0x5a, 0xc3, 0x6f, + 0x68, 0xf0, 0x8f, 0xe4, 0xfe, 0x17, 0xac, 0xed, 0xf3, 0xf4, 0xd6, 0xb3, 0xee, 0xdf, 0x23, 0x6c, + 0x16, 0x65, 0x00, 0x13, 0x89, 0x89, 0x0f, 0xc1, 0x6c, 0x83, 0x14, 0xac, 0xed, 0x98, 0xb9, 0xde, + 0x80, 0x3b, 0x59, 0x4b, 0xee, 0x64, 0x14, 0x82, 0xea, 0xa1, 0x57, 0xfc, 0x7c, 0xe3, 0x8c, 0x74, + 0x3a, 0x5b, 0xf1, 0x35, 0x77, 0xf7, 0xa4, 0xf4, 0x33, 0xd2, 0x7f, 0x21, 0x7c, 0x2d, 0x1f, 0x9c, + 0xea, 0xa9, 0x12, 0x1f, 0x57, 0x46, 0x08, 0x95, 0xaf, 0xea, 0x75, 0x90, 0x54, 0x2d, 0x90, 0x94, + 0x28, 0xba, 0x96, 0x57, 0x34, 0xf4, 0x7e, 0x66, 0xcb, 0xdf, 0x0f, 0x7d, 0x9a, 0x0e, 0xe5, 0x82, + 0x1b, 0x80, 0xa1, 0x3c, 0x41, 0x98, 0x88, 0x81, 0x68, 0x2b, 0x16, 0x96, 0x4e, 0xe5, 0x56, 0xd9, + 0xae, 0xe4, 0x71, 0x9b, 0x6f, 0x0e, 0x0f, 0x6b, 0x14, 0x99, 0x3a, 0x15, 0x91, 0x27, 0x43, 0x6f, + 0xe0, 0xb7, 0x34, 0xcd, 0x0f, 0xbe, 0x8a, 0x78, 0x18, 0x30, 0x3f, 0x7b, 0x8c, 0xda, 0x44, 0x06, + 0x36, 0xfc, 0xfa, 0xf8, 0x34, 0xd0, 0xd4, 0xc0, 0x73, 0x2e, 0x8b, 0x58, 0xb6, 0x5a, 0xa9, 0x88, + 0x01, 0x01, 0xba, 0x02, 0x76, 0x5c, 0x27, 0xd7, 0x9f, 0x2e, 0xe2, 0x97, 0x34, 0x3a, 0xf9, 0x15, + 0xe1, 0x85, 0xd4, 0x20, 0xc9, 0x9d, 0x29, 0xfd, 0x54, 0x33, 0x35, 0xee, 0x5e, 0xca, 0x85, 0xe9, + 0xf6, 0x93, 0x3f, 0xfe, 0xfd, 0xe1, 0xca, 0x3d, 0x72, 0xc7, 0x2e, 0xfb, 0xe1, 0xd1, 0x13, 0xde, + 0x12, 0xae, 0xb2, 0xbf, 0x81, 0x9d, 0x7c, 0x4c, 0x7e, 0x41, 0x78, 0x31, 0xb3, 0x12, 0x32, 0x19, + 0x85, 0xbc, 0xb5, 0x19, 0xf7, 0xa6, 0x2d, 0x03, 0xea, 0x0d, 0x4d, 0x7d, 0x8b, 0x6c, 0x96, 0x52, + 0x3f, 0x37, 0x35, 0xf2, 0x13, 0xc2, 0xf3, 0x89, 0xdd, 0x90, 0xfa, 0x44, 0x7d, 0x87, 0x1c, 0xcf, + 0x68, 0x4c, 0x55, 0x03, 0x44, 0x6d, 0x4d, 0xf4, 0x26, 0x79, 0xa7, 0x94, 0x68, 0x62, 0x7d, 0xe4, + 0x77, 0x84, 0x2b, 0x23, 0xa6, 0x46, 0xde, 0x9b, 0xa8, 0x77, 0x91, 0x5d, 0x1a, 0x0f, 0x2e, 0x5b, + 0x0e, 0x2a, 0xde, 0xd5, 0x2a, 0xee, 0x92, 0x46, 0xa9, 0x8a, 0x51, 0xbf, 0xd4, 0x8a, 0x46, 0x1c, + 0x61, 0x42, 0x45, 0x45, 0x5e, 0x3a, 0xa1, 0xa2, 0x42, 0x23, 0x9a, 0x42, 0xd1, 0xa8, 0xa9, 0x90, + 0xff, 0x10, 0x5e, 0x2d, 0x70, 0x05, 0xf2, 0x70, 0x22, 0x62, 0xe3, 0xad, 0xc7, 0xd8, 0x79, 0x31, + 0x10, 0xd0, 0xd8, 0xd4, 0x1a, 0xb7, 0xc9, 0xfd, 0x52, 0x8d, 0x1c, 0x90, 0x06, 0xfe, 0x71, 0xd1, + 0x4f, 0x5e, 0x35, 0x3f, 0x7d, 0x76, 0x6a, 0xa2, 0xe7, 0xa7, 0x26, 0xfa, 0xe7, 0xd4, 0x44, 0xdf, + 0x9d, 0x99, 0x33, 0xcf, 0xcf, 0xcc, 0x99, 0x3f, 0xcf, 0xcc, 0x99, 0xcf, 0x1e, 0x78, 0x22, 0x3a, + 0xec, 0xb6, 0xad, 0x7d, 0x79, 0x64, 0x1f, 0x77, 0x99, 0x62, 0xa1, 0xcf, 0xda, 0x0a, 0x3e, 0x03, + 0xe9, 0xf2, 0xc2, 0xae, 0xd1, 0x49, 0x87, 0xab, 0xf6, 0xbc, 0xfe, 0xa1, 0x6a, 0xfc, 0x1f, 0x00, + 0x00, 0xff, 0xff, 0x2a, 0x12, 0x13, 0x13, 0xb7, 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/pool-incentives/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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.LockableDurations[iNdEx], dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.LockableDuration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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, types1.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 new file mode 100644 index 0000000..45710f9 --- /dev/null +++ b/osmosis/pool-incentives/types/query.pb.gw.go @@ -0,0 +1,514 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: osmosis/pool-incentives/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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) +) + +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/README.md b/proto/README.md new file mode 100644 index 0000000..e9c7068 --- /dev/null +++ b/proto/README.md @@ -0,0 +1,16 @@ +# Maintaining Quasar Proto Files +All Quasar proto files are defined here. We use buf (http://buf.build) to manage proto dependencies and generate go files and openapi docs from proto files. +## Updating the dependencies of third_party proto +To update the proto dependencies run the following commands at the root of repository: +```bash +# Update the deps hash in buf.yaml +cd proto +buf mod update + +# Generate go from proto files +cd .. +make proto-gen + +# Generate swagger/openapi docs from proto files +make proto-doc +``` \ No newline at end of file diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml new file mode 100644 index 0000000..f068b42 --- /dev/null +++ b/proto/buf.gen.gogo.yaml @@ -0,0 +1,8 @@ +version: v1 +plugins: + - name: gocosmos + out: . + opt: plugins=grpc,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mcosmos/orm/v1alpha1/orm.proto=github.com/cosmos/cosmos-sdk/api/cosmos/orm/v1alpha1 + - name: grpc-gateway + out: . + opt: logtostderr=true,allow_colon_final_segments=true diff --git a/proto/buf.gen.swagger.yaml b/proto/buf.gen.swagger.yaml new file mode 100644 index 0000000..c6915c9 --- /dev/null +++ b/proto/buf.gen.swagger.yaml @@ -0,0 +1,5 @@ +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 diff --git a/proto/buf.lock b/proto/buf.lock new file mode 100644 index 0000000..288c630 --- /dev/null +++ b/proto/buf.lock @@ -0,0 +1,19 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 1935555c206d4afb9e94615dfd0fad31 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: c62f4f2ddb034e60b5f8c96d8ec737ae + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 34d970b699f84aa382f3c29773a60836 + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 5abafbf55b5c4c07ad5fb06d2599560f diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 0000000..900a3ca --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,22 @@ +version: v1 +deps: + - buf.build/cosmos/cosmos-sdk + - buf.build/cosmos/cosmos-proto + - buf.build/cosmos/gogo-proto + - buf.build/googleapis/googleapis +breaking: + use: + - FILE +lint: + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + ignore: + - tendermint \ No newline at end of file diff --git a/proto/epochs/genesis.proto b/proto/epochs/genesis.proto new file mode 100644 index 0000000..ec3e96d --- /dev/null +++ b/proto/epochs/genesis.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package quasarlabs.quasarnode.epochs; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/quasarlabs/quasarnode/x/epochs/types"; + +message EpochInfo { + string identifier = 1; + google.protobuf.Timestamp start_time = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + google.protobuf.Duration duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + int64 current_epoch = 4; + google.protobuf.Timestamp current_epoch_start_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"current_epoch_start_time\"" + ]; + bool epoch_counting_started = 6; + reserved 7; + 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/epochs/query.proto b/proto/epochs/query.proto new file mode 100644 index 0000000..d4a3dd4 --- /dev/null +++ b/proto/epochs/query.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package quasarlabs.quasarnode.epochs; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "epochs/genesis.proto"; + +option go_package = "github.com/quasarlabs/quasarnode/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"; + } + // CurrentEpoch provide current epoch of specified identifier + rpc CurrentEpoch(QueryCurrentEpochRequest) + returns (QueryCurrentEpochResponse) { + option (google.api.http).get = "/quasarlabs/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; } diff --git a/proto/osmosis/README.md b/proto/osmosis/README.md new file mode 100644 index 0000000..3bd9107 --- /dev/null +++ b/proto/osmosis/README.md @@ -0,0 +1,45 @@ +# 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/genesis.proto b/proto/osmosis/epochs/genesis.proto new file mode 100644 index 0000000..8907759 --- /dev/null +++ b/proto/osmosis/epochs/genesis.proto @@ -0,0 +1,72 @@ +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/query.proto b/proto/osmosis/epochs/query.proto new file mode 100644 index 0000000..906e3ed --- /dev/null +++ b/proto/osmosis/epochs/query.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package osmosis.epochs.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "osmosis/epochs/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/pool-models/balancer/balancerPool.proto b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto new file mode 100644 index 0000000..bc6be60 --- /dev/null +++ b/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto @@ -0,0 +1,149 @@ +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"; + + 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/pool-models/balancer/tx/tx.proto b/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto new file mode 100644 index 0000000..159aca3 --- /dev/null +++ b/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package osmosis.gamm.poolmodels.balancer.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/gamm/pool-models/balancer/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/query.proto b/proto/osmosis/gamm/v1beta1/query.proto new file mode 100644 index 0000000..acc8172 --- /dev/null +++ b/proto/osmosis/gamm/v1beta1/query.proto @@ -0,0 +1,193 @@ +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) = "PoolI" ]; +} + +//=============================== 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) = "PoolI" ]; + + // 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 new file mode 100644 index 0000000..cdbca0b --- /dev/null +++ b/proto/osmosis/gamm/v1beta1/tx.proto @@ -0,0 +1,236 @@ +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 + ]; + // repeated cosmos.base.v1beta1.Coin tokensIn = 5 [ + // (gogoproto.moretags) = "yaml:\"tokens_in\"", + // (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 new file mode 100644 index 0000000..8f3c2c9 --- /dev/null +++ b/proto/osmosis/incentives/gauge.proto @@ -0,0 +1,60 @@ +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 new file mode 100644 index 0000000..114852c --- /dev/null +++ b/proto/osmosis/lockup/lock.proto @@ -0,0 +1,108 @@ +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 new file mode 100644 index 0000000..845e07d --- /dev/null +++ b/proto/osmosis/lockup/tx.proto @@ -0,0 +1,73 @@ +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 new file mode 100644 index 0000000..511fbc6 --- /dev/null +++ b/proto/osmosis/mint/v1beta1/mint.proto @@ -0,0 +1,107 @@ +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 new file mode 100644 index 0000000..fa25664 --- /dev/null +++ b/proto/osmosis/mint/v1beta1/query.proto @@ -0,0 +1,45 @@ +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/pool-incentives/v1beta1/incentives.proto b/proto/osmosis/pool-incentives/v1beta1/incentives.proto new file mode 100644 index 0000000..6294e9e --- /dev/null +++ b/proto/osmosis/pool-incentives/v1beta1/incentives.proto @@ -0,0 +1,56 @@ +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/pool-incentives/v1beta1/query.proto b/proto/osmosis/pool-incentives/v1beta1/query.proto new file mode 100644 index 0000000..ba22f4f --- /dev/null +++ b/proto/osmosis/pool-incentives/v1beta1/query.proto @@ -0,0 +1,108 @@ +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/pool-incentives/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/qoracle/genesis.proto b/proto/qoracle/genesis.proto new file mode 100644 index 0000000..668802f --- /dev/null +++ b/proto/qoracle/genesis.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package quasarlabs.quasarnode.qoracle; + +import "gogoproto/gogo.proto"; +import "qoracle/params.proto"; +import "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/qoracle/osmosis/osmosis.proto b/proto/qoracle/osmosis/osmosis.proto new file mode 100644 index 0000000..317cb5a --- /dev/null +++ b/proto/qoracle/osmosis/osmosis.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package quasarlabs.quasarnode.qoracle.osmosis; + +import "gogoproto/gogo.proto"; +import "osmosis/pool-incentives/v1beta1/query.proto"; +import "osmosis/epochs/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/qoracle/osmosis/params.proto b/proto/qoracle/osmosis/params.proto new file mode 100644 index 0000000..cb1cad0 --- /dev/null +++ b/proto/qoracle/osmosis/params.proto @@ -0,0 +1,20 @@ +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/qoracle/osmosis/query.proto b/proto/qoracle/osmosis/query.proto new file mode 100644 index 0000000..54834a2 --- /dev/null +++ b/proto/qoracle/osmosis/query.proto @@ -0,0 +1,90 @@ +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 "qoracle/osmosis/params.proto"; +import "qoracle/osmosis/osmosis.proto"; +import "osmosis/epochs/genesis.proto"; +import "osmosis/mint/v1beta1/mint.proto"; +import "osmosis/pool-incentives/v1beta1/incentives.proto"; +import "osmosis/pool-incentives/v1beta1/query.proto"; +import "osmosis/gamm/pool-models/balancer/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/qoracle/osmosis/tx.proto b/proto/qoracle/osmosis/tx.proto new file mode 100644 index 0000000..c044787 --- /dev/null +++ b/proto/qoracle/osmosis/tx.proto @@ -0,0 +1,19 @@ +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/qoracle/params.proto b/proto/qoracle/params.proto new file mode 100644 index 0000000..04eb812 --- /dev/null +++ b/proto/qoracle/params.proto @@ -0,0 +1,16 @@ +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/qoracle/pool.proto b/proto/qoracle/pool.proto new file mode 100644 index 0000000..f227f55 --- /dev/null +++ b/proto/qoracle/pool.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package quasarlabs.quasarnode.qoracle; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.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; // 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/qoracle/price_list.proto b/proto/qoracle/price_list.proto new file mode 100644 index 0000000..0063ada --- /dev/null +++ b/proto/qoracle/price_list.proto @@ -0,0 +1,15 @@ +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/qoracle/query.proto b/proto/qoracle/query.proto new file mode 100644 index 0000000..941dbed --- /dev/null +++ b/proto/qoracle/query.proto @@ -0,0 +1,60 @@ +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 "qoracle/params.proto"; +import "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/qoracle/tx.proto b/proto/qoracle/tx.proto new file mode 100644 index 0000000..d7267cc --- /dev/null +++ b/proto/qoracle/tx.proto @@ -0,0 +1,11 @@ +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/qtransfer/genesis.proto b/proto/qtransfer/genesis.proto new file mode 100644 index 0000000..c2e4eb1 --- /dev/null +++ b/proto/qtransfer/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package quasarlabs.quasarnode.qtransfer; + +import "gogoproto/gogo.proto"; +import "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/qtransfer/params.proto b/proto/qtransfer/params.proto new file mode 100644 index 0000000..dedf10d --- /dev/null +++ b/proto/qtransfer/params.proto @@ -0,0 +1,15 @@ +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/qtransfer/query.proto b/proto/qtransfer/query.proto new file mode 100644 index 0000000..f280663 --- /dev/null +++ b/proto/qtransfer/query.proto @@ -0,0 +1,27 @@ +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 "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/receiver.yml b/receiver.yml new file mode 100644 index 0000000..d5369a4 --- /dev/null +++ b/receiver.yml @@ -0,0 +1,25 @@ +accounts: + - name: alice + coins: ["1000token", "1000000000stake", "1000000uqsr"] + - name: greenman + coins: ["500token", "100000000stake", "1000000uqsr"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4502" + name: greenman + coins: ["5token", "100000stake", "1000000uqsr"] +host: + rpc: ":26559" + p2p: ":26662" + prof: ":6062" + grpc: ":9096" + grpc-web: ":8092" + api: ":1312" + frontend: ":8082" + dev-ui: ":12352" +genesis: + chain_id: "quasar2" +init: + home: "$HOME/.q2" diff --git a/scripts/add_dummy_upgrade b/scripts/add_dummy_upgrade new file mode 100755 index 0000000..c5801df --- /dev/null +++ b/scripts/add_dummy_upgrade @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -Cue -o pipefail + +# this contains a git patch of a dummy quasar chain upgrade, for testing purposes +load_patch() { + base64 -d << EOS | gunzip +H4sIAAAAAAAAA5VTwY6bMBA9w1eMOCUF7GQbRe1KldJuD72kSlvtXisDhliLbWqbNKtV/n1tB7Kg +TZXUF6Q3b2bezDwKVpaQphUzQDBpGtw2lSIF1bhoOX/CuRTaEGE0qiRklxihoH+hZDUFLgsK89ls +uViETBR0D7PjQ2iZf3i/yGiYpinggu6waOs6jOP4ivqrFaSzZAbxPJkvYbUK44bkj6SisLsJ4zBm +vJHKwCSMg8jOtG0zlEuOSUYq/KclmihhhY3aRC4v0EYqCsOcXGoudfdJdfGIPQebp8YnTV0exnB/ +rPOdcAoFLZmgGsyWghRpviVMQNcIhGOUUvmon60PoTD2U45qfYLIk7y+HVF90AZ66aiDnu0Ag9Rb +OL0BmljSnaLE0A78RkRRU3UL51DH/uXm7WB9Kuq3gEax54OlH8LigpdOsv9lpQHhKidlH8uszPJr +nTQsPzDSzeKCkUpujib5D0sF1jAX7NQbKbiChu0W2po6dtfEwxc67HtFY9OWrcjPHt1Nyzm8OzZD +ayLsQrwVrD1LVrWK2LNDF74bYI7z+9WXX4imn5tmQxThr1WmMNSOxr3BmVhR0yoBTuAkN3uwQ7g2 +hu5NAk1NxLjCxiIJ7Hiv6IEqzaRYk2YKkzdYAlQpqaa+U2CPijaKCVOLSRRN30Bf/Q/6wx8YOLNd +jS1zhhj5nQa9ds7Rz1as+wTt5khguD+n2JU5uH/mBXIJE8WABQAA +EOS +} + +load_patch | git apply + +echo "Dummy upgrade patch loaded" +echo "You can now register the dummy upgrade in the app.go then run a build with `make build`" diff --git a/scripts/deploy_contracts.sh b/scripts/deploy_contracts.sh new file mode 100755 index 0000000..4b6493e --- /dev/null +++ b/scripts/deploy_contracts.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +set -e + +CHAIN_ID="qsr-questnet-04" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +RPC="http://node3.tst4.qsr.network:26657/" +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" + +INIT1='{"lock_period":300,"pool_id":1,"pool_denom":"gamm/pool/1","base_denom":"uosmo","local_denom":"ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518","quote_denom":"ibc/6BEEEE6CC17BA0EE37857A1E2AF6EC53C50DB6B6F89463A3933D0859C4CF6087","return_source_channel":"channel-0","transfer_channel":"channel-0"}' +INIT2='{"lock_period":300,"pool_id":2,"pool_denom":"gamm/pool/2","base_denom":"ibc/DA3CEF7DEAF6983032E061030C63E13262957D223E9EDBBB7AF9B69F8F8BA090","local_denom":"uayy","quote_denom":"uosmo","return_source_channel":"channel-0","transfer_channel":"channel-0"}' +INIT3='{"lock_period":300,"pool_id":3,"pool_denom":"gamm/pool/3","base_denom":"ibc/6BEEEE6CC17BA0EE37857A1E2AF6EC53C50DB6B6F89463A3933D0859C4CF6087","local_denom":"uqsr","quote_denom":"ibc/DA3CEF7DEAF6983032E061030C63E13262957D223E9EDBBB7AF9B69F8F8BA090","return_source_channel":"channel-0","transfer_channel":"channel-0"}' + +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 laurens-2 --keyring-backend test -y --output json -b block $TXFLAG) +echo $RES +CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') +echo "Got CODE_ID = $CODE_ID" + +echo "Deploying contract" +# swallow output +OUT1=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT1" --from laurens-2 --keyring-backend test -y --label "primitive-1" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) +ADDR1=$(quasarnoded 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 + +# sleep 6 + +OUT2=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT2" --from laurens-2 --keyring-backend test --label "primitive-2" --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3 -b block -y --admin "quasar1wzdhlvurmav577eu7n3z329eg5ykaez050az8l" $NODE --chain-id $CHAIN_ID) +ADDR2=$(quasarnoded 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 +# rly transact channel quasar_osmosis --src-port "wasm.$ADDR2" --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 + +# sleep 6 + +OUT3=$(quasarnoded tx wasm instantiate $CODE_ID "$INIT3" --from laurens-2 --keyring-backend test --label "primitive-3" --gas-prices 10$FEE_DENOM --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]') +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 +# rly transact channel quasar_osmosis --src-port "wasm.$ADDR3" --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 + +echo "primitive contracts:\n$ADDR1\n$ADDR2\n$ADDR3\n" + +VAULT_INIT='{"decimals":6,"symbol":"ORN","min_withdrawal":"1","name":"ORION","primitives":[{"address":"'$ADDR1'","weight":"0.333333333333","init":{"l_p":'$INIT1'}},{"address":"'$ADDR2'","weight":"0.333333333333","init":{"l_p":'$INIT2'}},{"address":"'$ADDR3'","weight":"0.333333333333","init":{"l_p":'$INIT3'}}]}' +echo $VAULT_INIT + +echo "Running store code (vault)" +RES=$(quasarnoded tx wasm store artifacts/basic_vault.wasm --from laurens-2 --keyring-backend test -y --output json -b block $TXFLAG) + +VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') + +echo "Got CODE_ID = $VAULT_CODE_ID" + +echo "Deploying contract (vault)" +# swallow output +OUT=$(quasarnoded tx wasm instantiate $VAULT_CODE_ID "$VAULT_INIT" --from laurens-2 --keyring-backend test --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]') + +echo "Got address of deployed contract = $VAULT_ADDR (vault)" \ No newline at end of file diff --git a/scripts/deploy_vault.sh b/scripts/deploy_vault.sh new file mode 100755 index 0000000..7442d70 --- /dev/null +++ b/scripts/deploy_vault.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +set -e + +CHAIN_ID="qsr-questnet-04" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +RPC="http://node3.tst4.qsr.network:26657/" +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" + + +INIT1='{"lock_period":300,"pool_id":1,"pool_denom":"gamm/pool/1","base_denom":"uosmo","local_denom":"ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518","quote_denom":"ibc/6BEEEE6CC17BA0EE37857A1E2AF6EC53C50DB6B6F89463A3933D0859C4CF6087","return_source_channel":"channel-0","transfer_channel":"channel-0"}' +INIT2='{"lock_period":300,"pool_id":2,"pool_denom":"gamm/pool/2","base_denom":"ibc/DA3CEF7DEAF6983032E061030C63E13262957D223E9EDBBB7AF9B69F8F8BA090","local_denom":"uayy","quote_denom":"uosmo","return_source_channel":"channel-0","transfer_channel":"channel-0"}' +INIT3='{"lock_period":300,"pool_id":3,"pool_denom":"gamm/pool/3","base_denom":"ibc/6BEEEE6CC17BA0EE37857A1E2AF6EC53C50DB6B6F89463A3933D0859C4CF6087","local_denom":"uqsr","quote_denom":"ibc/DA3CEF7DEAF6983032E061030C63E13262957D223E9EDBBB7AF9B69F8F8BA090","return_source_channel":"channel-0","transfer_channel":"channel-0"}' + +ADDR1="quasar1wug8sewp6cedgkmrmvhl3lf3tulagm9hnvy8p0rppz9yjw0g4wtqu5prdk" +ADDR2="quasar1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqgsk7e6" +ADDR3="quasar1xr3rq8yvd7qplsw5yx90ftsr2zdhg4e9z60h5duusgxpv72hud3syhezhc" + +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 + + +VAULT_INIT='{"decimals":6,"symbol":"ORN","min_withdrawal":"1","name":"ORION","primitives":[{"address":"'$ADDR1'","weight":"0.333333333333","init":{"l_p":'$INIT1'}},{"address":"'$ADDR2'","weight":"0.333333333333","init":{"l_p":'$INIT2'}},{"address":"'$ADDR3'","weight":"0.333333333333","init":{"l_p":'$INIT3'}}]}' +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) + +VAULT_CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[0].value') + +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]') + +echo "Got address of deployed contract = $VAULT_ADDR (vault)" \ No newline at end of file diff --git a/scripts/generate-docs.sh b/scripts/generate-docs.sh new file mode 100755 index 0000000..ac1da18 --- /dev/null +++ b/scripts/generate-docs.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -Cue -o pipefail + +project_dir="$(cd "$(dirname "${0}")/.." ; pwd)" # Absolute path to project dir +docs_dir="${project_dir}/docs" +tmp_dir="${project_dir}/tmp-swagger-gen" + +mkdir -p $tmp_dir +trap "rm -rf ${tmp_dir}" 0 + +proto_dirs=$(find ${project_dir}/proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +for dir in $proto_dirs; do + # generate swagger files (filter query files) + query_file=$(find "${dir}" -maxdepth 1 \( -name 'query.proto' -o -name 'service.proto' \)) + if [[ ! -z "$query_file" ]]; then + buf generate --template "${project_dir}/proto/buf.gen.swagger.yaml" $query_file + fi +done + +( + cd "$docs_dir" + + yarn install + yarn combine + yarn convert +) diff --git a/scripts/generate-proto.sh b/scripts/generate-proto.sh new file mode 100644 index 0000000..6e50d05 --- /dev/null +++ b/scripts/generate-proto.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +# This script does not work with cosmos-sdk v0.46 and newer verisons and therefore is DEPRECATED. +# for replacement please use protocgen.sh in this directroy. +set -Cue -o pipefail + +project_dir="$(cd "$(dirname "${0}")/.." ; pwd)" # Absolute path to project dir +build_dir="${BUILD_DIR:-"${project_dir}/build"}" +tmp_dir="${build_dir}/proto" + +# Get the path of the cosmos-sdk repo from go/pkg/mod +locate_cosmos_sdk_dir() { + go list -f "{{ .Dir }}" -m github.com/cosmos/cosmos-sdk +} + +# Get the path of the ibc-go repo from go/pkg/mod +locate_ibc_go_dir() { + go list -f "{{ .Dir }}" -m github.com/cosmos/ibc-go/v4 +} + +# Collect all proto dirs +collect_proto_dirs() { + find "$@" -path -prune -o -name "*.proto" -print0 | xargs -0 -n1 dirname | sort | uniq +} + +mkdir -p "$tmp_dir" +trap "rm -rf ${tmp_dir}" 0 + +cosmos_sdk_dir="$(locate_cosmos_sdk_dir)" +ibc_go_dir="$(locate_ibc_go_dir)" + +( + cd "$project_dir" + + while read -r proto_child_dir <&3 ; do + echo "$proto_child_dir" + protoc \ + -I "${project_dir}/proto" \ + -I "${cosmos_sdk_dir}/third_party/proto" \ + -I "${cosmos_sdk_dir}/proto" \ + -I "${ibc_go_dir}/proto" \ + --gocosmos_out=plugins=interfacetype+grpc,\ +Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:"$tmp_dir" \ + --grpc-gateway_out=logtostderr=true:"$tmp_dir" \ + $(find "${proto_child_dir}" -name '*.proto') + done 3< <(collect_proto_dirs "${project_dir}/proto") + + # Remove any protobuf generated go file + find ${project_dir} -name "*.pb*.go" -not -path "${tmp_dir}/*" -type f -delete + + # Copy the generated go files over + cp -r "${tmp_dir}/github.com/quasarlabs/quasarnode/"* . +) diff --git a/scripts/localnet b/scripts/localnet new file mode 100755 index 0000000..deb6ee5 --- /dev/null +++ b/scripts/localnet @@ -0,0 +1,171 @@ +#!/usr/bin/env bash + +set -Cue -o pipefail + +project_dir="$(cd "$(dirname "${0}")/.." ; pwd)" # Absolute path to project dir +this_dir="${project_dir}/scripts" +this_script="${this_dir}/$(basename "${0}")" +run_dir="${project_dir}/run/localnet" + +fail() { + echo "$*" + false +} + +cmd_exists() { + type "$1" >/dev/null 2>&1 || fail "command '${1}' not available" +} + +json_pp() { + python3 -m json.tool +} + +gen_config() { + local n="$1" ; shift + + "${project_dir}/build/quasarnoded" testnet -n "$n" -o "$run_dir" +} + +for_all_nodes() { + local cmd="$1" ; shift + + while IFS= read -r -d '' node_dir <&3 ; do + "$cmd" "$node_dir" "$@" + done 3< <(find "$run_dir" -type d -name "node*" -print0 | sort -z) +} + +run_for_node() { + local node_dir="$1" ; shift + local home_dir="${node_dir}/home" + local node_name="$(basename "${node_dir}")" + + test -d "$node_dir" || fail "node '${node_name}' not found" + + ( + cd "$node_dir" + + cmd() { + local action="$1" + + if [ "$action" == "tx" ] ; then + "${home_dir}/cosmovisor/current/bin/quasarnoded" --home "$home_dir" --keyring-backend=test --from main "$@" + else + "${home_dir}/cosmovisor/current/bin/quasarnoded" --home "$home_dir" "$@" + fi + } + + start() { + if ! is_running ; then + ( + export DAEMON_NAME="quasarnoded" + 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" + ) + fi + } + + stop() { + kill "$(cat "quasarnoded.pid" 2> /dev/null)" > /dev/null 2>&1 || true + rm -f "quasarnoded.pid" + } + + is_running() { + ps -p "$(cat "quasarnoded.pid" 2> /dev/null)" > /dev/null 2>&1 + } + + status() { + if is_running ; then + echo "node '${node_name}' is running" + else + echo "node '${node_name}' is NOT running" + fi + } + + log() { + tail -f "quasarnoded.log" + } + + "$@" + ) +} + +start_all() { + for_all_nodes run_for_node start +} + +stop_all() { + for_all_nodes run_for_node stop + killall -9 "cosmovisor" > /dev/null 2>&1 || true +} + +status_all() { + for_all_nodes run_for_node status +} + +node() { + local id="$1" ; shift + local node_dir="${run_dir}/node${id}" + + run_for_node "$node_dir" "$@" +} + +install_binary() { + local node_dir="$1" ; shift + local name="$1" ; shift + + mkdir -p "${node_dir}/home/cosmovisor/genesis/bin" + mkdir -p "${node_dir}/home/cosmovisor/upgrades" + + if [ "$name" == "genesis" ] ; then + cp "${project_dir}/build/quasarnoded" "${node_dir}/home/cosmovisor/genesis/bin/quasarnoded" + 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" + fi +} + +install_binaries() { + for_all_nodes install_binary genesis +} + +install_upgrade_binaries() { + local name="$1" ; shift + + for_all_nodes install_binary "$name" +} + +register_upgrade() { + local id="$1" ; shift + local height="$1" ; shift + local name="$1" ; shift + + node 0 cmd tx gov submit-proposal software-upgrade "$name" --title "${name} upgrade" --description "${name} upgrade" --upgrade-height "$height" -y + + node 0 cmd tx gov deposit "$id" 1000000uqsar -y + node 1 cmd tx gov deposit "$id" 1000000uqsar -y + node 2 cmd tx gov deposit "$id" 1000000uqsar -y + node 3 cmd tx gov deposit "$id" 1000000uqsar -y + + node 0 cmd tx gov vote "$id" yes -y + node 1 cmd tx gov vote "$id" yes -y + node 2 cmd tx gov vote "$id" yes -y + node 3 cmd tx gov vote "$id" yes -y + + node 0 cmd query gov proposals | json_pp +} + +init_default_cluster() { + gen_config 4 + install_binaries +} + +cmd_exists nohup +cmd_exists killall +cmd_exists python3 +cmd_exists cosmovisor + +"$@" diff --git a/scripts/migrate_primitives.sh b/scripts/migrate_primitives.sh new file mode 100755 index 0000000..55c025c --- /dev/null +++ b/scripts/migrate_primitives.sh @@ -0,0 +1,24 @@ +set -e + +CHAIN_ID="qsr-questnet-04" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +RPC="http://node3.tst4.qsr.network:26657/" +NODE="--node $RPC" +TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 10$FEE_DENOM --gas auto --gas-adjustment 1.3" + +cd ../smart-contracts + +PRIM_CODE_ID=14 + +CONFIG1='{"lock_period":300,"pool_id":1,"pool_denom":"gamm/pool/1","base_denom":"uosmo","local_denom":"ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518","quote_denom":"ibc/6BEEEE6CC17BA0EE37857A1E2AF6EC53C50DB6B6F89463A3933D0859C4CF6087","return_source_channel":"channel-0","transfer_channel":"channel-0","expected_connection":"connection-0"}' +CONFIG2='{"lock_period":300,"pool_id":2,"pool_denom":"gamm/pool/2","base_denom":"ibc/DA3CEF7DEAF6983032E061030C63E13262957D223E9EDBBB7AF9B69F8F8BA090","local_denom":"uayy","quote_denom":"uosmo","return_source_channel":"channel-0","transfer_channel":"channel-0","expected_connection":"connection-0"}' +CONFIG3='{"lock_period":300,"pool_id":3,"pool_denom":"gamm/pool/3","base_denom":"ibc/6BEEEE6CC17BA0EE37857A1E2AF6EC53C50DB6B6F89463A3933D0859C4CF6087","local_denom":"uqsr","quote_denom":"ibc/DA3CEF7DEAF6983032E061030C63E13262957D223E9EDBBB7AF9B69F8F8BA090","return_source_channel":"channel-0","transfer_channel":"channel-0","expected_connection":"connection-0"}' + + +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 diff --git a/scripts/migrate_vault.sh b/scripts/migrate_vault.sh new file mode 100755 index 0000000..557f539 --- /dev/null +++ b/scripts/migrate_vault.sh @@ -0,0 +1,11 @@ +set -e + +CHAIN_ID="qsr-questnet-04" +TESTNET_NAME="quasar" +FEE_DENOM="uqsr" +RPC="http://node3.tst4.qsr.network:26657/" +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 diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh new file mode 100755 index 0000000..bcaba35 --- /dev/null +++ b/scripts/protocgen.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +#set -o xtrace +#set -Cue -o pipefail + +project_dir="$(cd "$(dirname "${0}")/.." ; pwd)" # Absolute path to project dir +echo "project dir - $project_dir" +trap "rm -rf github.com" 0 + +proto_dirs=$(find ${project_dir}/proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) + +#echo "DIRES - $proto_dirs" + +for dir in $proto_dirs; do +# echo "DIR - $dir" + for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do +# echo "FILE - $file" + if grep go_package $file &>/dev/null; then +# echo "Before buf" + buf generate --template "${project_dir}/proto/buf.gen.gogo.yaml" $file + fi + done +done + +# Remove old protobuf generated go files +find ${project_dir} -path "github.com" -prune -and -name "*.pb*.go" -type f -delete + +# Copy the generated go files over +cp -r github.com/quasarlabs/quasarnode/* . diff --git a/scripts/serve_doc_docker b/scripts/serve_doc_docker new file mode 100755 index 0000000..ef0ed4e --- /dev/null +++ b/scripts/serve_doc_docker @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -Cue -o pipefail + +project_dir="$(cd "$(dirname "${0}")/.." ; pwd)" # Absolute path to project dir +build_dir="${BUILD_DIR:-"${project_dir}/build"}" +docs_dir="${build_dir}/docs" +out_dir="${docs_dir}/grpc-swagger-doc" + +fail() { + echo "$*" + false +} + +test -f "${out_dir}/swagger.yaml" || \ + fail "swagger definition not found, did you run 'make docs_gen'?" + +docker run -p 8080:8080 \ + -e SWAGGER_JSON=/grpc-swagger-doc/swagger.yaml \ + -v "${out_dir}":"/grpc-swagger-doc" \ + swaggerapi/swagger-ui diff --git a/sender.yml b/sender.yml new file mode 100644 index 0000000..ecccc1a --- /dev/null +++ b/sender.yml @@ -0,0 +1,25 @@ +accounts: + - name: alice + coins: ["1000token", "100000000stake", "1000000uqsr"] + - name: tellurian + coins: ["500token", "100000000stake", "1000000uqsr"] +validator: + name: alice + staked: "100000000stake" +faucet: + host: ":4501" + name: tellurian + coins: ["500000token", "100000000stake", "1000000uqsr"] +host: + rpc: ":26659" + p2p: ":26661" + prof: ":6061" + grpc: ":9095" + grpc-web: ":8091" + api: ":1311" + frontend: ":8081" + dev-ui: ":12351" +genesis: + chain_id: "quasar1" +init: + home: "$HOME/.q1" diff --git a/testutil/error/recover.go b/testutil/error/recover.go new file mode 100644 index 0000000..a9c31a8 --- /dev/null +++ b/testutil/error/recover.go @@ -0,0 +1,9 @@ +package error + +import "fmt" + +func RecoverExpectedPanic() { + if err := recover(); err != nil { + fmt.Println("error recovered from panic:\n", err) + } +} diff --git a/testutil/event/event.go b/testutil/event/event.go new file mode 100644 index 0000000..fa76fe0 --- /dev/null +++ b/testutil/event/event.go @@ -0,0 +1,16 @@ +package events + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func AssertEventEmitted(t *testing.T, ctx sdk.Context, eventType string) { + for _, e := range ctx.EventManager().Events() { + if e.Type == eventType { + return + } + } + t.Fatalf("expected event '%s' not found", eventType) +} diff --git a/testutil/keeper/common.go b/testutil/keeper/common.go new file mode 100644 index 0000000..52b480f --- /dev/null +++ b/testutil/keeper/common.go @@ -0,0 +1,62 @@ +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" + 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" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +func (kf KeeperFactory) ParamsKeeper() paramskeeper.Keeper { + storeKey := sdk.NewKVStoreKey(paramstypes.StoreKey) + transientStoreKey := sdk.NewTransientStoreKey(paramstypes.TStoreKey) + kf.StateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, kf.DB) + kf.StateStore.MountStoreWithDB(transientStoreKey, sdk.StoreTypeTransient, kf.DB) + + paramsKeeper := paramskeeper.NewKeeper(kf.EncodingConfig.Marshaler, kf.EncodingConfig.Amino, storeKey, transientStoreKey) + + return paramsKeeper +} + +func (kf KeeperFactory) AccountKeeper(paramsKeeper paramskeeper.Keeper, maccPerms map[string][]string) authkeeper.AccountKeeper { + storeKey := sdk.NewKVStoreKey(authtypes.StoreKey) + kf.StateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, kf.DB) + + subspace := paramsKeeper.Subspace(authtypes.ModuleName) + accountKeeper := authkeeper.NewAccountKeeper( + kf.EncodingConfig.Marshaler, storeKey, subspace, authtypes.ProtoBaseAccount, maccPerms, + ) + + return accountKeeper +} + +func (kf KeeperFactory) BankKeeper(paramsKeeper paramskeeper.Keeper, accountKeeper authkeeper.AccountKeeper, blockedMaccAddresses map[string]bool) bankkeeper.Keeper { + storeKey := sdk.NewKVStoreKey(banktypes.StoreKey) + kf.StateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, kf.DB) + + subspace := paramsKeeper.Subspace(banktypes.ModuleName) + bankKeeper := bankkeeper.NewBaseKeeper( + kf.EncodingConfig.Marshaler, storeKey, accountKeeper, subspace, blockedMaccAddresses, + ) + + return bankKeeper +} + +func (kf KeeperFactory) CapabilityKeeper() capabilitykeeper.Keeper { + storeKey := sdk.NewKVStoreKey(capabilitytypes.StoreKey) + memStoreKey := storetypes.NewMemoryStoreKey(capabilitytypes.MemStoreKey) + kf.StateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, kf.DB) + kf.StateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) + + capabilityKeeper := capabilitykeeper.NewKeeper( + kf.EncodingConfig.Marshaler, storeKey, memStoreKey, + ) + + return *capabilityKeeper +} diff --git a/testutil/keeper/epochs.go b/testutil/keeper/epochs.go new file mode 100644 index 0000000..768ff3e --- /dev/null +++ b/testutil/keeper/epochs.go @@ -0,0 +1,21 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + "github.com/quasarlabs/quasarnode/x/epochs/keeper" + "github.com/quasarlabs/quasarnode/x/epochs/types" +) + +func (kf KeeperFactory) EpochsKeeper(paramsKeeper paramskeeper.Keeper) *keeper.Keeper { + storeKey := sdk.NewKVStoreKey(types.StoreKey) + kf.StateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, kf.DB) + + paramsKeeper.Subspace(types.ModuleName) + epochsKeeper := keeper.NewKeeper(kf.EncodingConfig.Marshaler, storeKey) + epochsKeeper.SetHooks( + types.NewMultiEpochHooks(), + ) + + return epochsKeeper +} diff --git a/testutil/keeper/factory.go b/testutil/keeper/factory.go new file mode 100644 index 0000000..ad98911 --- /dev/null +++ b/testutil/keeper/factory.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store" + 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" + tmdb "github.com/tendermint/tm-db" +) + +// Structure holding storage context for initializing test keepers +type KeeperFactory struct { + DB *tmdb.MemDB + StateStore store.CommitMultiStore + Ctx sdk.Context + EncodingConfig params.EncodingConfig +} + +// Create an KeeperFactory with in memory database and default codecs +func NewKeeperFactory( + db *tmdb.MemDB, + stateStore store.CommitMultiStore, + ctx sdk.Context, + encodingConfig params.EncodingConfig, +) KeeperFactory { + return KeeperFactory{ + DB: db, + StateStore: stateStore, + Ctx: ctx, + EncodingConfig: encodingConfig, + } +} + +// 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} + return moduleAccPerms +} + +// 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 { + modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true + } + + return modAccAddrs +} diff --git a/testutil/keeper/qoracle.go b/testutil/keeper/qoracle.go new file mode 100644 index 0000000..1bcf40d --- /dev/null +++ b/testutil/keeper/qoracle.go @@ -0,0 +1,74 @@ +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/v4/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 new file mode 100644 index 0000000..3ee6420 --- /dev/null +++ b/testutil/keeper/qtransfer.go @@ -0,0 +1,30 @@ +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/mock/ibc_channel_mocks.go b/testutil/mock/ibc_channel_mocks.go new file mode 100644 index 0000000..ac87610 --- /dev/null +++ b/testutil/mock/ibc_channel_mocks.go @@ -0,0 +1,114 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/quasarlabs/quasarnode/x/qoracle/types (interfaces: ChannelKeeper) + +// Package mock is a generated GoMock package. +package mock + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + exported "github.com/cosmos/ibc-go/v4/modules/core/exported" + gomock "github.com/golang/mock/gomock" +) + +// MockChannelKeeper is a mock of ChannelKeeper interface. +type MockChannelKeeper struct { + ctrl *gomock.Controller + recorder *MockChannelKeeperMockRecorder +} + +// MockChannelKeeperMockRecorder is the mock recorder for MockChannelKeeper. +type MockChannelKeeperMockRecorder struct { + mock *MockChannelKeeper +} + +// NewMockChannelKeeper creates a new mock instance. +func NewMockChannelKeeper(ctrl *gomock.Controller) *MockChannelKeeper { + mock := &MockChannelKeeper{ctrl: ctrl} + mock.recorder = &MockChannelKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChannelKeeper) EXPECT() *MockChannelKeeperMockRecorder { + return m.recorder +} + +// GetChannel mocks base method. +func (m *MockChannelKeeper) GetChannel(arg0 types.Context, arg1, arg2 string) (types0.Channel, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetChannel", arg0, arg1, arg2) + ret0, _ := ret[0].(types0.Channel) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetChannel indicates an expected call of GetChannel. +func (mr *MockChannelKeeperMockRecorder) GetChannel(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChannel", reflect.TypeOf((*MockChannelKeeper)(nil).GetChannel), arg0, arg1, arg2) +} + +// GetChannelClientState mocks base method. +func (m *MockChannelKeeper) GetChannelClientState(arg0 types.Context, arg1, arg2 string) (string, exported.ClientState, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetChannelClientState", arg0, arg1, arg2) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(exported.ClientState) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetChannelClientState indicates an expected call of GetChannelClientState. +func (mr *MockChannelKeeperMockRecorder) GetChannelClientState(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChannelClientState", reflect.TypeOf((*MockChannelKeeper)(nil).GetChannelClientState), arg0, arg1, arg2) +} + +// GetChannelConnection mocks base method. +func (m *MockChannelKeeper) GetChannelConnection(arg0 types.Context, arg1, arg2 string) (string, exported.ConnectionI, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetChannelConnection", arg0, arg1, arg2) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(exported.ConnectionI) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetChannelConnection indicates an expected call of GetChannelConnection. +func (mr *MockChannelKeeperMockRecorder) GetChannelConnection(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChannelConnection", reflect.TypeOf((*MockChannelKeeper)(nil).GetChannelConnection), arg0, arg1, arg2) +} + +// GetConnection mocks base method. +func (m *MockChannelKeeper) GetConnection(arg0 types.Context, arg1 string) (exported.ConnectionI, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConnection", arg0, arg1) + ret0, _ := ret[0].(exported.ConnectionI) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetConnection indicates an expected call of GetConnection. +func (mr *MockChannelKeeperMockRecorder) GetConnection(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConnection", reflect.TypeOf((*MockChannelKeeper)(nil).GetConnection), arg0, arg1) +} + +// GetNextSequenceSend mocks base method. +func (m *MockChannelKeeper) GetNextSequenceSend(arg0 types.Context, arg1, arg2 string) (uint64, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetNextSequenceSend", arg0, arg1, arg2) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetNextSequenceSend indicates an expected call of GetNextSequenceSend. +func (mr *MockChannelKeeperMockRecorder) GetNextSequenceSend(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNextSequenceSend", reflect.TypeOf((*MockChannelKeeper)(nil).GetNextSequenceSend), arg0, arg1, arg2) +} diff --git a/testutil/mock/ibc_client_mocks.go b/testutil/mock/ibc_client_mocks.go new file mode 100644 index 0000000..2502ae9 --- /dev/null +++ b/testutil/mock/ibc_client_mocks.go @@ -0,0 +1,81 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/quasarlabs/quasarnode/x/intergamm/types (interfaces: ClientKeeper) + +// Package mock is a generated GoMock package. +package mock + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/store/types" + types0 "github.com/cosmos/cosmos-sdk/types" + exported "github.com/cosmos/ibc-go/v4/modules/core/exported" + gomock "github.com/golang/mock/gomock" +) + +// MockClientKeeper is a mock of ClientKeeper interface. +type MockClientKeeper struct { + ctrl *gomock.Controller + recorder *MockClientKeeperMockRecorder +} + +// MockClientKeeperMockRecorder is the mock recorder for MockClientKeeper. +type MockClientKeeperMockRecorder struct { + mock *MockClientKeeper +} + +// NewMockClientKeeper creates a new mock instance. +func NewMockClientKeeper(ctrl *gomock.Controller) *MockClientKeeper { + mock := &MockClientKeeper{ctrl: ctrl} + mock.recorder = &MockClientKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClientKeeper) EXPECT() *MockClientKeeperMockRecorder { + return m.recorder +} + +// ClientStore mocks base method. +func (m *MockClientKeeper) ClientStore(arg0 types0.Context, arg1 string) types.KVStore { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClientStore", arg0, arg1) + ret0, _ := ret[0].(types.KVStore) + return ret0 +} + +// ClientStore indicates an expected call of ClientStore. +func (mr *MockClientKeeperMockRecorder) ClientStore(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStore", reflect.TypeOf((*MockClientKeeper)(nil).ClientStore), arg0, arg1) +} + +// GetClientConsensusState mocks base method. +func (m *MockClientKeeper) GetClientConsensusState(arg0 types0.Context, arg1 string, arg2 exported.Height) (exported.ConsensusState, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetClientConsensusState", arg0, arg1, arg2) + ret0, _ := ret[0].(exported.ConsensusState) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetClientConsensusState indicates an expected call of GetClientConsensusState. +func (mr *MockClientKeeperMockRecorder) GetClientConsensusState(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientConsensusState", reflect.TypeOf((*MockClientKeeper)(nil).GetClientConsensusState), arg0, arg1, arg2) +} + +// GetClientState mocks base method. +func (m *MockClientKeeper) GetClientState(arg0 types0.Context, arg1 string) (exported.ClientState, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetClientState", arg0, arg1) + ret0, _ := ret[0].(exported.ClientState) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetClientState indicates an expected call of GetClientState. +func (mr *MockClientKeeperMockRecorder) GetClientState(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientState", reflect.TypeOf((*MockClientKeeper)(nil).GetClientState), arg0, arg1) +} diff --git a/testutil/mock/ibc_connection_mocks.go b/testutil/mock/ibc_connection_mocks.go new file mode 100644 index 0000000..8e70804 --- /dev/null +++ b/testutil/mock/ibc_connection_mocks.go @@ -0,0 +1,65 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/quasarlabs/quasarnode/x/intergamm/types (interfaces: ConnectionKeeper) + +// Package mock is a generated GoMock package. +package mock + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + gomock "github.com/golang/mock/gomock" +) + +// MockConnectionKeeper is a mock of ConnectionKeeper interface. +type MockConnectionKeeper struct { + ctrl *gomock.Controller + recorder *MockConnectionKeeperMockRecorder +} + +// MockConnectionKeeperMockRecorder is the mock recorder for MockConnectionKeeper. +type MockConnectionKeeperMockRecorder struct { + mock *MockConnectionKeeper +} + +// NewMockConnectionKeeper creates a new mock instance. +func NewMockConnectionKeeper(ctrl *gomock.Controller) *MockConnectionKeeper { + mock := &MockConnectionKeeper{ctrl: ctrl} + mock.recorder = &MockConnectionKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConnectionKeeper) EXPECT() *MockConnectionKeeperMockRecorder { + return m.recorder +} + +// GetAllConnections mocks base method. +func (m *MockConnectionKeeper) GetAllConnections(arg0 types.Context) []types0.IdentifiedConnection { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllConnections", arg0) + ret0, _ := ret[0].([]types0.IdentifiedConnection) + return ret0 +} + +// GetAllConnections indicates an expected call of GetAllConnections. +func (mr *MockConnectionKeeperMockRecorder) GetAllConnections(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllConnections", reflect.TypeOf((*MockConnectionKeeper)(nil).GetAllConnections), arg0) +} + +// GetConnection mocks base method. +func (m *MockConnectionKeeper) GetConnection(arg0 types.Context, arg1 string) (types0.ConnectionEnd, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConnection", arg0, arg1) + ret0, _ := ret[0].(types0.ConnectionEnd) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetConnection indicates an expected call of GetConnection. +func (mr *MockConnectionKeeperMockRecorder) GetConnection(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConnection", reflect.TypeOf((*MockConnectionKeeper)(nil).GetConnection), arg0, arg1) +} diff --git a/testutil/mock/ibc_mocks.go b/testutil/mock/ibc_mocks.go new file mode 100644 index 0000000..78959cc --- /dev/null +++ b/testutil/mock/ibc_mocks.go @@ -0,0 +1,67 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/quasarlabs/quasarnode/x/intergamm/types (interfaces: IBCTransferKeeper) + +// Package mock is a generated GoMock package. +package mock + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + types1 "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + gomock "github.com/golang/mock/gomock" + bytes "github.com/tendermint/tendermint/libs/bytes" +) + +// MockIBCTransferKeeper is a mock of IBCTransferKeeper interface. +type MockIBCTransferKeeper struct { + ctrl *gomock.Controller + recorder *MockIBCTransferKeeperMockRecorder +} + +// MockIBCTransferKeeperMockRecorder is the mock recorder for MockIBCTransferKeeper. +type MockIBCTransferKeeperMockRecorder struct { + mock *MockIBCTransferKeeper +} + +// NewMockIBCTransferKeeper creates a new mock instance. +func NewMockIBCTransferKeeper(ctrl *gomock.Controller) *MockIBCTransferKeeper { + mock := &MockIBCTransferKeeper{ctrl: ctrl} + mock.recorder = &MockIBCTransferKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockIBCTransferKeeper) EXPECT() *MockIBCTransferKeeperMockRecorder { + return m.recorder +} + +// GetDenomTrace mocks base method. +func (m *MockIBCTransferKeeper) GetDenomTrace(arg0 types.Context, arg1 bytes.HexBytes) (types0.DenomTrace, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDenomTrace", arg0, arg1) + ret0, _ := ret[0].(types0.DenomTrace) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetDenomTrace indicates an expected call of GetDenomTrace. +func (mr *MockIBCTransferKeeperMockRecorder) GetDenomTrace(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDenomTrace", reflect.TypeOf((*MockIBCTransferKeeper)(nil).GetDenomTrace), arg0, arg1) +} + +// SendTransfer mocks base method. +func (m *MockIBCTransferKeeper) SendTransfer(arg0 types.Context, arg1, arg2 string, arg3 types.Coin, arg4 types.AccAddress, arg5 string, arg6 types1.Height, arg7 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendTransfer", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendTransfer indicates an expected call of SendTransfer. +func (mr *MockIBCTransferKeeperMockRecorder) SendTransfer(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendTransfer", reflect.TypeOf((*MockIBCTransferKeeper)(nil).SendTransfer), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) +} diff --git a/testutil/mock/ibc_port_mocks.go b/testutil/mock/ibc_port_mocks.go new file mode 100644 index 0000000..590f005 --- /dev/null +++ b/testutil/mock/ibc_port_mocks.go @@ -0,0 +1,64 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/quasarlabs/quasarnode/x/qoracle/types (interfaces: PortKeeper) + +// Package mock is a generated GoMock package. +package mock + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/capability/types" + gomock "github.com/golang/mock/gomock" +) + +// MockPortKeeper is a mock of PortKeeper interface. +type MockPortKeeper struct { + ctrl *gomock.Controller + recorder *MockPortKeeperMockRecorder +} + +// MockPortKeeperMockRecorder is the mock recorder for MockPortKeeper. +type MockPortKeeperMockRecorder struct { + mock *MockPortKeeper +} + +// NewMockPortKeeper creates a new mock instance. +func NewMockPortKeeper(ctrl *gomock.Controller) *MockPortKeeper { + mock := &MockPortKeeper{ctrl: ctrl} + mock.recorder = &MockPortKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPortKeeper) EXPECT() *MockPortKeeperMockRecorder { + return m.recorder +} + +// BindPort mocks base method. +func (m *MockPortKeeper) BindPort(arg0 types.Context, arg1 string) *types0.Capability { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BindPort", arg0, arg1) + ret0, _ := ret[0].(*types0.Capability) + return ret0 +} + +// BindPort indicates an expected call of BindPort. +func (mr *MockPortKeeperMockRecorder) BindPort(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BindPort", reflect.TypeOf((*MockPortKeeper)(nil).BindPort), arg0, arg1) +} + +// IsBound mocks base method. +func (m *MockPortKeeper) IsBound(arg0 types.Context, arg1 string) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsBound", arg0, arg1) + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsBound indicates an expected call of IsBound. +func (mr *MockPortKeeperMockRecorder) IsBound(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBound", reflect.TypeOf((*MockPortKeeper)(nil).IsBound), arg0, arg1) +} diff --git a/testutil/mock/ica_mocks.go b/testutil/mock/ica_mocks.go new file mode 100644 index 0000000..c9e9ed2 --- /dev/null +++ b/testutil/mock/ica_mocks.go @@ -0,0 +1,111 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/quasarlabs/quasarnode/x/intergamm/types (interfaces: ICAControllerKeeper) + +// Package mock is a generated GoMock package. +package mock + +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/v4/modules/apps/27-interchain-accounts/types" + gomock "github.com/golang/mock/gomock" +) + +// MockICAControllerKeeper is a mock of ICAControllerKeeper interface. +type MockICAControllerKeeper struct { + ctrl *gomock.Controller + recorder *MockICAControllerKeeperMockRecorder +} + +// MockICAControllerKeeperMockRecorder is the mock recorder for MockICAControllerKeeper. +type MockICAControllerKeeperMockRecorder struct { + mock *MockICAControllerKeeper +} + +// NewMockICAControllerKeeper creates a new mock instance. +func NewMockICAControllerKeeper(ctrl *gomock.Controller) *MockICAControllerKeeper { + mock := &MockICAControllerKeeper{ctrl: ctrl} + mock.recorder = &MockICAControllerKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockICAControllerKeeper) EXPECT() *MockICAControllerKeeperMockRecorder { + return m.recorder +} + +// GetActiveChannelID mocks base method. +func (m *MockICAControllerKeeper) GetActiveChannelID(arg0 types.Context, arg1, arg2 string) (string, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetActiveChannelID", arg0, arg1, arg2) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetActiveChannelID indicates an expected call of GetActiveChannelID. +func (mr *MockICAControllerKeeperMockRecorder) GetActiveChannelID(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetActiveChannelID", reflect.TypeOf((*MockICAControllerKeeper)(nil).GetActiveChannelID), arg0, arg1, arg2) +} + +// GetInterchainAccountAddress mocks base method. +func (m *MockICAControllerKeeper) GetInterchainAccountAddress(arg0 types.Context, arg1, arg2 string) (string, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetInterchainAccountAddress", arg0, arg1, arg2) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetInterchainAccountAddress indicates an expected call of GetInterchainAccountAddress. +func (mr *MockICAControllerKeeperMockRecorder) GetInterchainAccountAddress(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInterchainAccountAddress", reflect.TypeOf((*MockICAControllerKeeper)(nil).GetInterchainAccountAddress), arg0, arg1, arg2) +} + +// GetOpenActiveChannel mocks base method. +func (m *MockICAControllerKeeper) GetOpenActiveChannel(arg0 types.Context, arg1, arg2 string) (string, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOpenActiveChannel", arg0, arg1, arg2) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetOpenActiveChannel indicates an expected call of GetOpenActiveChannel. +func (mr *MockICAControllerKeeperMockRecorder) GetOpenActiveChannel(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOpenActiveChannel", reflect.TypeOf((*MockICAControllerKeeper)(nil).GetOpenActiveChannel), arg0, arg1, arg2) +} + +// RegisterInterchainAccount mocks base method. +func (m *MockICAControllerKeeper) RegisterInterchainAccount(arg0 types.Context, arg1, arg2, arg3 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegisterInterchainAccount", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// RegisterInterchainAccount indicates an expected call of RegisterInterchainAccount. +func (mr *MockICAControllerKeeperMockRecorder) RegisterInterchainAccount(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterchainAccount", reflect.TypeOf((*MockICAControllerKeeper)(nil).RegisterInterchainAccount), arg0, arg1, arg2, arg3) +} + +// SendTx mocks base method. +func (m *MockICAControllerKeeper) SendTx(arg0 types.Context, arg1 *types0.Capability, arg2, arg3 string, arg4 types1.InterchainAccountPacketData, arg5 uint64) (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendTx", arg0, arg1, arg2, arg3, arg4, arg5) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendTx indicates an expected call of SendTx. +func (mr *MockICAControllerKeeperMockRecorder) SendTx(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendTx", reflect.TypeOf((*MockICAControllerKeeper)(nil).SendTx), arg0, arg1, arg2, arg3, arg4, arg5) +} diff --git a/testutil/mock/ics4_wrapper_mocks.go b/testutil/mock/ics4_wrapper_mocks.go new file mode 100644 index 0000000..bb4078e --- /dev/null +++ b/testutil/mock/ics4_wrapper_mocks.go @@ -0,0 +1,80 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/cosmos/ibc-go/v5/modules/core/05-port/types (interfaces: ICS4Wrapper) + +// Package mock is a generated GoMock package. +package mock + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/capability/types" + exported "github.com/cosmos/ibc-go/v4/modules/core/exported" + gomock "github.com/golang/mock/gomock" +) + +// MockICS4Wrapper is a mock of ICS4Wrapper interface. +type MockICS4Wrapper struct { + ctrl *gomock.Controller + recorder *MockICS4WrapperMockRecorder +} + +// MockICS4WrapperMockRecorder is the mock recorder for MockICS4Wrapper. +type MockICS4WrapperMockRecorder struct { + mock *MockICS4Wrapper +} + +// NewMockICS4Wrapper creates a new mock instance. +func NewMockICS4Wrapper(ctrl *gomock.Controller) *MockICS4Wrapper { + mock := &MockICS4Wrapper{ctrl: ctrl} + mock.recorder = &MockICS4WrapperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockICS4Wrapper) EXPECT() *MockICS4WrapperMockRecorder { + return m.recorder +} + +// GetAppVersion mocks base method. +func (m *MockICS4Wrapper) GetAppVersion(arg0 types.Context, arg1, arg2 string) (string, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAppVersion", arg0, arg1, arg2) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetAppVersion indicates an expected call of GetAppVersion. +func (mr *MockICS4WrapperMockRecorder) GetAppVersion(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppVersion", reflect.TypeOf((*MockICS4Wrapper)(nil).GetAppVersion), arg0, arg1, arg2) +} + +// SendPacket mocks base method. +func (m *MockICS4Wrapper) SendPacket(arg0 types.Context, arg1 *types0.Capability, arg2 exported.PacketI) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendPacket", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendPacket indicates an expected call of SendPacket. +func (mr *MockICS4WrapperMockRecorder) SendPacket(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPacket", reflect.TypeOf((*MockICS4Wrapper)(nil).SendPacket), arg0, arg1, arg2) +} + +// WriteAcknowledgement mocks base method. +func (m *MockICS4Wrapper) WriteAcknowledgement(arg0 types.Context, arg1 *types0.Capability, arg2 exported.PacketI, arg3 exported.Acknowledgement) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteAcknowledgement", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// WriteAcknowledgement indicates an expected call of WriteAcknowledgement. +func (mr *MockICS4WrapperMockRecorder) WriteAcknowledgement(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteAcknowledgement", reflect.TypeOf((*MockICS4Wrapper)(nil).WriteAcknowledgement), arg0, arg1, arg2, arg3) +} diff --git a/testutil/network/network.go b/testutil/network/network.go new file mode 100644 index 0000000..05439fd --- /dev/null +++ b/testutil/network/network.go @@ -0,0 +1,80 @@ +package network + +import ( + "fmt" + "testing" + "time" + + "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" + "github.com/cosmos/cosmos-sdk/simapp" + pruningtypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/testutil/network" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + tmrand "github.com/tendermint/tendermint/libs/rand" + tmdb "github.com/tendermint/tm-db" + + "github.com/quasarlabs/quasarnode/app" +) + +type ( + Network = network.Network + Config = network.Config +) + +// New creates instance with fully configured cosmos network. +// Accepts optional config, that will be used in place of the DefaultConfig() if provided. +func New(t *testing.T, configs ...network.Config) *network.Network { + if len(configs) > 1 { + panic("at most one config should be provided") + } + var cfg network.Config + if len(configs) == 0 { + cfg = DefaultConfig() + } else { + cfg = configs[0] + } + net := network.New(t, cfg) + t.Cleanup(net.Cleanup) + return net +} + +// 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 +func DefaultConfig() network.Config { + encoding := app.MakeEncodingConfig() + return network.Config{ + Codec: encoding.Marshaler, + TxConfig: encoding.TxConfig, + LegacyAmino: encoding.Amino, + InterfaceRegistry: encoding.InterfaceRegistry, + AccountRetriever: authtypes.AccountRetriever{}, + AppConstructor: func(val network.Validator) servertypes.Application { + return app.New( + val.Ctx.Logger, tmdb.NewMemDB(), nil, true, map[int64]bool{}, val.Ctx.Config.RootDir, 0, + encoding, + simapp.EmptyAppOptions{}, + app.GetWasmEnabledProposals(), + app.EmptyWasmOpts, + baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), + baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), + ) + }, + GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Marshaler), + TimeoutCommit: 2 * time.Second, + ChainID: "chain-" + tmrand.NewRand().Str(6), + NumValidators: 1, + BondDenom: sdk.DefaultBondDenom, + MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), + AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction), + StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction), + BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), + PruningStrategy: pruningtypes.PruningOptionNothing, + CleanupDir: true, + SigningAlgo: string(hd.Secp256k1Type), + KeyringOptions: []keyring.Option{}, + } +} diff --git a/testutil/nullify/nullify.go b/testutil/nullify/nullify.go new file mode 100644 index 0000000..3b968c0 --- /dev/null +++ b/testutil/nullify/nullify.go @@ -0,0 +1,57 @@ +// Package nullify provides methods to init nil values structs for test assertion. +package nullify + +import ( + "reflect" + "unsafe" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + coinType = reflect.TypeOf(sdk.Coin{}) + coinsType = reflect.TypeOf(sdk.Coins{}) +) + +// Fill analyze all struct fields and slices with +// reflection and initialize the nil and empty slices, +// structs, and pointers. +func Fill(x interface{}) interface{} { + v := reflect.Indirect(reflect.ValueOf(x)) + switch v.Kind() { + case reflect.Slice: + for i := 0; i < v.Len(); i++ { + obj := v.Index(i) + objPt := reflect.NewAt(obj.Type(), unsafe.Pointer(obj.UnsafeAddr())).Interface() + objPt = Fill(objPt) + obj.Set(reflect.ValueOf(objPt)) + } + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + f := reflect.Indirect(v.Field(i)) + if !f.CanSet() { + continue + } + switch f.Kind() { + case reflect.Slice: + f.Set(reflect.MakeSlice(f.Type(), 0, 0)) + case reflect.Struct: + switch f.Type() { + case coinType: + coin := reflect.New(coinType).Interface() + s := reflect.ValueOf(coin).Elem() + f.Set(s) + case coinsType: + coins := reflect.New(coinsType).Interface() + s := reflect.ValueOf(coins).Elem() + f.Set(s) + default: + objPt := reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Interface() + s := Fill(objPt) + f.Set(reflect.ValueOf(s)) + } + } + } + } + return reflect.Indirect(v).Interface() +} diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go new file mode 100644 index 0000000..0a5897b --- /dev/null +++ b/testutil/sample/sample.go @@ -0,0 +1,17 @@ +package sample + +import ( + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// AccAddress returns a sample account address +func AccAddress() sdk.AccAddress { + pk := ed25519.GenPrivKey().PubKey() + addr := pk.Address() + return sdk.AccAddress(addr) +} + +func AccAddressStr() string { + return AccAddress().String() +} diff --git a/testutil/setup.go b/testutil/setup.go new file mode 100644 index 0000000..440726e --- /dev/null +++ b/testutil/setup.go @@ -0,0 +1,154 @@ +package testutil + +import ( + "testing" + + "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" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types" + "github.com/golang/mock/gomock" + "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" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmdb "github.com/tendermint/tm-db" +) + +func init() { + // 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() +} + +func NewTestSetup(t testing.TB, controller ...*gomock.Controller) *TestSetup { + // Test setup params + + logger := log.TestingLogger() + // 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) + + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, logger) + encodingConfig := app.MakeEncodingConfig() + + // Mocks + + // 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) { + 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)) + // ibcClientKeeperMock := mock.NewMockClientKeeper(ctl) + + // Keepers + + // Create a factory first to easily create keepers + factory := keeper.NewKeeperFactory(db, stateStore, ctx, encodingConfig) + + maccPerms := factory.TestModuleAccountPerms() + blockedMaccAddresses := factory.BlockedModuleAccountAddrs(maccPerms) + + paramsKeeper := factory.ParamsKeeper() + epochsKeeper := factory.EpochsKeeper(paramsKeeper) + accountKeeper := factory.AccountKeeper(paramsKeeper, maccPerms) + bankKeeper := factory.BankKeeper(paramsKeeper, accountKeeper, blockedMaccAddresses) + capabilityKeeper := factory.CapabilityKeeper() + capabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) + 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) + + // Note: the relative order of LoadLatestVersion and Set*DefaultParams is important. + // Setting params before loading stores causes store does not exist error. + // LoadLatestVersion must not be called again after setting params, as reloading stores clears set params. + + require.NoError(t, factory.StateStore.LoadLatestVersion()) + + factory.SetQoracleDefaultParams(qoracleKeeper) + factory.SetQosmosisDefaultParams(qosmosisKeeper) + + return &TestSetup{ + Ctx: ctx, + Cdc: encodingConfig.Marshaler, + + Mocks: &testMocks{ + ICAControllerKeeperMock: icaControllerKeeperMock, + }, + + Keepers: &testKeepers{ + ParamsKeeper: paramsKeeper, + EpochsKeeper: epochsKeeper, + AccountKeeper: accountKeeper, + BankKeeper: bankKeeper, + CapabilityKeeper: capabilityKeeper, + QoracleKeeper: qoracleKeeper, + QosmosisKeeper: qosmosisKeeper, + QTransfer: qtransferkeeper, + }, + } +} + +type TestSetup struct { + Ctx sdk.Context + Cdc codec.Codec + + Keepers *testKeepers + Mocks *testMocks +} + +type testMocks struct { + ICAControllerKeeperMock *mock.MockICAControllerKeeper +} + +type testKeepers struct { + ParamsKeeper paramskeeper.Keeper + EpochsKeeper *epochskeeper.Keeper + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + CapabilityKeeper capabilitykeeper.Keeper + QoracleKeeper qoraclekeeper.Keeper + QosmosisKeeper qosmokeeper.Keeper + QTransfer qtransferkeeper.Keeper +} 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 new file mode 100644 index 0000000..c7abd9f --- /dev/null +++ b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.controller.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..1f38efd --- /dev/null +++ b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.controller.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..e73510e --- /dev/null +++ b/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.host.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..02d17d3 --- /dev/null +++ b/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.host.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..2748b93 --- /dev/null +++ b/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..a92b6a0 --- /dev/null +++ b/third_party/proto/ibc/applications/interchain_accounts/v1/genesis.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..6a4b4ab --- /dev/null +++ b/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..8e09a9d --- /dev/null +++ b/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..34672fd --- /dev/null +++ b/third_party/proto/ibc/applications/transfer/v1/genesis.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..075c000 --- /dev/null +++ b/third_party/proto/ibc/applications/transfer/v1/query.proto @@ -0,0 +1,105 @@ +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/v4/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 new file mode 100644 index 0000000..1f92e81 --- /dev/null +++ b/third_party/proto/ibc/applications/transfer/v1/transfer.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..5befdf2 --- /dev/null +++ b/third_party/proto/ibc/applications/transfer/v1/tx.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..acae835 --- /dev/null +++ b/third_party/proto/ibc/applications/transfer/v2/packet.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v2; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..f68ace5 --- /dev/null +++ b/third_party/proto/ibc/core/channel/v1/channel.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..1c0ff6e --- /dev/null +++ b/third_party/proto/ibc/core/channel/v1/genesis.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..9866331 --- /dev/null +++ b/third_party/proto/ibc/core/channel/v1/query.proto @@ -0,0 +1,376 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..5e3ccf3 --- /dev/null +++ b/third_party/proto/ibc/core/channel/v1/tx.proto @@ -0,0 +1,246 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..2ec41ed --- /dev/null +++ b/third_party/proto/ibc/core/client/v1/client.proto @@ -0,0 +1,103 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..b2930c4 --- /dev/null +++ b/third_party/proto/ibc/core/client/v1/genesis.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..2c9618b --- /dev/null +++ b/third_party/proto/ibc/core/client/v1/query.proto @@ -0,0 +1,207 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..11dfdad --- /dev/null +++ b/third_party/proto/ibc/core/client/v1/tx.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..b6a68a9 --- /dev/null +++ b/third_party/proto/ibc/core/commitment/v1/commitment.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package ibc.core.commitment.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..8360af9 --- /dev/null +++ b/third_party/proto/ibc/core/connection/v1/connection.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..f616ae6 --- /dev/null +++ b/third_party/proto/ibc/core/connection/v1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..129f30a --- /dev/null +++ b/third_party/proto/ibc/core/connection/v1/query.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..1ca0b40 --- /dev/null +++ b/third_party/proto/ibc/core/connection/v1/tx.proto @@ -0,0 +1,119 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..4cc931d --- /dev/null +++ b/third_party/proto/ibc/core/types/v1/genesis.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package ibc.core.types.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..9eda835 --- /dev/null +++ b/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package ibc.lightclients.localhost.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..37bd81e --- /dev/null +++ b/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..c735fdd --- /dev/null +++ b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v2; + +option go_package = "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..55a4e06 --- /dev/null +++ b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; + +package ibc.lightclients.tendermint.v1; + +option go_package = "github.com/cosmos/ibc-go/v4/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/tools/tools.go b/tools/tools.go new file mode 100644 index 0000000..939aaab --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,12 @@ +//go:build tools +// +build tools + +// This file uses the recommended method for tracking developer tools in a Go +// module. +// +// REF: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module +package tools + +import ( + _ "github.com/golangci/golangci-lint/cmd/golangci-lint" +) diff --git a/wasmbinding/README.md b/wasmbinding/README.md new file mode 100644 index 0000000..bf32cf1 --- /dev/null +++ b/wasmbinding/README.md @@ -0,0 +1,27 @@ +# 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 new file mode 100644 index 0000000..fdf74db --- /dev/null +++ b/wasmbinding/bindings/msg.go @@ -0,0 +1,94 @@ +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 new file mode 100644 index 0000000..18b8e77 --- /dev/null +++ b/wasmbinding/bindings/query.go @@ -0,0 +1,25 @@ +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 new file mode 100644 index 0000000..a22f4d3 --- /dev/null +++ b/wasmbinding/callback.go @@ -0,0 +1,167 @@ +package wasmbinding + +import ( + "encoding/json" + "strconv" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/CosmWasm/wasmd/x/wasm" + wasmk "github.com/CosmWasm/wasmd/x/wasm/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// 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 *wasm.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 sdkerrors.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 sdkerrors.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 sdkerrors.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 new file mode 100644 index 0000000..06d3533 --- /dev/null +++ b/wasmbinding/message_plugin.go @@ -0,0 +1,347 @@ +package wasmbinding + +import ( + "encoding/json" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + 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, sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "failed validating MsgTestScenario") + } + + // Run the test scenario + _, err := msgServer.TestScenario( + sdk.WrapSDKContext(ctx), + msgTestScenario, + ) + if err != nil { + return sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "basic validate msg") + } + + msgServer := intergammkeeper.NewMsgServerImpl(k) + res, err := msgServer.SendToken(sdk.WrapSDKContext(ctx), sdkMsg) + if err != nil { + return sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "basic validate msg") + } + + msgServer := intergammkeeper.NewMsgServerImpl(k) + _, err := msgServer.RegisterICAOnZone(sdk.WrapSDKContext(ctx), sdkMsg) + if err != nil { + return sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "basic validate msg") + } + + msgServer := intergammkeeper.NewMsgServerImpl(k) + res, err := msgServer.TransmitIbcJoinPool(sdk.WrapSDKContext(ctx), sdkMsg) + if err != nil { + return sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "basic validate msg") + } + + msgServer := intergammkeeper.NewMsgServerImpl(k) + res, err := msgServer.TransmitIbcExitPool(sdk.WrapSDKContext(ctx), sdkMsg) + if err != nil { + return sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "basic validate msg") + } + + msgServer := intergammkeeper.NewMsgServerImpl(k) + res, err := msgServer.TransmitIbcLockTokens(sdk.WrapSDKContext(ctx), sdkMsg) + if err != nil { + return sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "basic validate msg") + } + + msgServer := intergammkeeper.NewMsgServerImpl(k) + res, err := msgServer.TransmitIbcBeginUnlocking(sdk.WrapSDKContext(ctx), sdkMsg) + if err != nil { + return sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "basic validate msg") + } + + msgServer := intergammkeeper.NewMsgServerImpl(k) + res, err := msgServer.TransmitIbcJoinSwapExternAmountIn(sdk.WrapSDKContext(ctx), sdkMsg) + if err != nil { + return sdkerrors.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, sdkerrors.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 sdkerrors.Wrap(err, "basic validate msg") + } + + msgServer := intergammkeeper.NewMsgServerImpl(k) + res, err := msgServer.TransmitIbcExitSwapExternAmountOut(sdk.WrapSDKContext(ctx), sdkMsg) + if err != nil { + return sdkerrors.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 new file mode 100644 index 0000000..89a78b5 --- /dev/null +++ b/wasmbinding/query_plugin.go @@ -0,0 +1,58 @@ +package wasmbinding + +import ( + "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, sdkerrors.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, sdkerrors.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, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "pool not found") + } + + bz, err := json.Marshal(pool) + if err != nil { + return nil, sdkerrors.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, sdkerrors.Wrap(err, "failed to get token price") + } + + bz, err := price.MarshalJSON() + if err != nil { + return nil, sdkerrors.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 new file mode 100644 index 0000000..61a49ec --- /dev/null +++ b/wasmbinding/wasm.go @@ -0,0 +1,27 @@ +package wasmbinding + +import ( + "github.com/CosmWasm/wasmd/x/wasm" + 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 []wasm.Option{ + queryPluginOpt, + messengerDecoratorOpt, + } +} diff --git a/x/epochs/abci.go b/x/epochs/abci.go new file mode 100644 index 0000000..53978e2 --- /dev/null +++ b/x/epochs/abci.go @@ -0,0 +1,65 @@ +package epochs + +import ( + "fmt" + "time" + + "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" +) + +// BeginBlocker of epochs module. +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) + + // 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/abci_test.go b/x/epochs/abci_test.go new file mode 100644 index 0000000..be1ee4f --- /dev/null +++ b/x/epochs/abci_test.go @@ -0,0 +1,253 @@ +package epochs_test + +import ( + "testing" + "time" + + "github.com/quasarlabs/quasarnode/testutil" + "github.com/quasarlabs/quasarnode/x/epochs" + "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/stretchr/testify/require" +) + +func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { + setup := testutil.NewTestSetup(t) + ctx, k := setup.Ctx, setup.Keepers.EpochsKeeper + var epochInfo types.EpochInfo + + now := time.Now() + + tests := []struct { + expCurrentEpochStartTime time.Time + expCurrentEpochStartHeight int64 + expCurrentEpoch int64 + expInitialEpochStartTime time.Time + fn func() + }{ + { + // Only advance 2 seconds, do not increment epoch + expCurrentEpochStartHeight: 2, + expCurrentEpochStartTime: now, + expCurrentEpoch: 1, + expInitialEpochStartTime: now, + fn: func() { + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) + epochs.BeginBlocker(ctx, k) + epochInfo = k.GetEpochInfo(ctx, "monthly") + }, + }, + { + expCurrentEpochStartHeight: 2, + expCurrentEpochStartTime: now, + expCurrentEpoch: 1, + expInitialEpochStartTime: now, + fn: func() { + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) + epochs.BeginBlocker(ctx, k) + epochInfo = k.GetEpochInfo(ctx, "monthly") + }, + }, + { + expCurrentEpochStartHeight: 2, + expCurrentEpochStartTime: now, + expCurrentEpoch: 1, + expInitialEpochStartTime: now, + fn: func() { + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) + epochs.BeginBlocker(ctx, k) + ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 31)) + epochs.BeginBlocker(ctx, k) + epochInfo = k.GetEpochInfo(ctx, "monthly") + }, + }, + // Test that incrementing _exactly_ 1 month increments the epoch count. + { + expCurrentEpochStartHeight: 3, + expCurrentEpochStartTime: now.Add(time.Hour * 24 * 31), + expCurrentEpoch: 2, + expInitialEpochStartTime: now, + fn: func() { + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) + epochs.BeginBlocker(ctx, k) + ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 32)) + epochs.BeginBlocker(ctx, k) + epochInfo = k.GetEpochInfo(ctx, "monthly") + }, + }, + { + expCurrentEpochStartHeight: 3, + expCurrentEpochStartTime: now.Add(time.Hour * 24 * 31), + expCurrentEpoch: 2, + expInitialEpochStartTime: now, + fn: func() { + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) + epochs.BeginBlocker(ctx, k) + ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 32)) + epochs.BeginBlocker(ctx, k) + ctx.WithBlockHeight(4).WithBlockTime(now.Add(time.Hour * 24 * 33)) + epochs.BeginBlocker(ctx, k) + epochInfo = k.GetEpochInfo(ctx, "monthly") + }, + }, + { + expCurrentEpochStartHeight: 3, + expCurrentEpochStartTime: now.Add(time.Hour * 24 * 31), + expCurrentEpoch: 2, + expInitialEpochStartTime: now, + fn: func() { + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) + epochs.BeginBlocker(ctx, k) + ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 32)) + 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) + epochInfo = k.GetEpochInfo(ctx, "monthly") + numBlocksSinceStart, _ = k.NumBlocksSinceEpochStart(ctx, "monthly") + require.Equal(t, int64(1), numBlocksSinceStart) + }, + }, + } + + for _, test := range tests { + // TODO use initialized keeper + context + // On init genesis, default epochs information is set + // To check init genesis again, should make it fresh status + epochInfos := k.AllEpochInfos(ctx) + for _, epochInfo := range epochInfos { + k.DeleteEpochInfo(ctx, epochInfo.Identifier) + } + + ctx = ctx.WithBlockHeight(1).WithBlockTime(now) + + // check init genesis + epochs.InitGenesis(ctx, k, types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24 * 31, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + }, + }) + + test.fn() + + require.Equal(t, epochInfo.Identifier, "monthly") + require.Equal(t, epochInfo.StartTime.UTC().String(), test.expInitialEpochStartTime.UTC().String()) + require.Equal(t, epochInfo.Duration, time.Hour*24*31) + require.Equal(t, epochInfo.CurrentEpoch, test.expCurrentEpoch) + require.Equal(t, epochInfo.CurrentEpochStartHeight, test.expCurrentEpochStartHeight) + require.Equal(t, epochInfo.CurrentEpochStartTime.UTC().String(), test.expCurrentEpochStartTime.UTC().String()) + require.Equal(t, epochInfo.EpochCountingStarted, true) + } +} + +func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { + setup := testutil.NewTestSetup(t) + ctx, k := setup.Ctx, setup.Keepers.EpochsKeeper + + // On init genesis, default epochs information is set + // To check init genesis again, should make it fresh status + epochInfos := k.AllEpochInfos(ctx) + for _, epochInfo := range epochInfos { + k.DeleteEpochInfo(ctx, epochInfo.Identifier) + } + + now := time.Now() + week := time.Hour * 24 * 7 + month := time.Hour * 24 * 30 + initialBlockHeight := int64(1) + ctx = ctx.WithBlockHeight(initialBlockHeight).WithBlockTime(now) + + epochs.InitGenesis(ctx, k, types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: now.Add(month), + Duration: time.Hour * 24 * 30, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + }, + }) + + // epoch not started yet + epochInfo := k.GetEpochInfo(ctx, "monthly") + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, initialBlockHeight) + require.Equal(t, epochInfo.CurrentEpochStartTime, time.Time{}) + require.Equal(t, epochInfo.EpochCountingStarted, false) + + // after 1 week + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(week)) + epochs.BeginBlocker(ctx, k) + + // epoch not started yet + epochInfo = k.GetEpochInfo(ctx, "monthly") + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, initialBlockHeight) + require.Equal(t, epochInfo.CurrentEpochStartTime, time.Time{}) + require.Equal(t, epochInfo.EpochCountingStarted, false) + + // after 1 month + ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(month)) + epochs.BeginBlocker(ctx, k) + + // epoch started + epochInfo = k.GetEpochInfo(ctx, "monthly") + require.Equal(t, epochInfo.CurrentEpoch, int64(1)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, ctx.BlockHeight()) + require.Equal(t, epochInfo.CurrentEpochStartTime.UTC().String(), now.Add(month).UTC().String()) + require.Equal(t, epochInfo.EpochCountingStarted, true) +} + +// This test ensures legacy EpochInfo messages will not throw errors via InitGenesis and BeginBlocker +func TestLegacyEpochSerialization(t *testing.T) { + setup := testutil.NewTestSetup(t) + ctx, k := setup.Ctx, setup.Keepers.EpochsKeeper + + // Legacy Epoch Info message - without CurrentEpochStartHeight property + legacyEpochInfo := types.EpochInfo{ + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24 * 31, + CurrentEpoch: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + } + + now := time.Now() + + // On init genesis, default epochs information is set + // To check init genesis again, should make it fresh status + epochInfos := k.AllEpochInfos(ctx) + for _, epochInfo := range epochInfos { + k.DeleteEpochInfo(ctx, epochInfo.Identifier) + } + + ctx = ctx.WithBlockHeight(1).WithBlockTime(now) + + // check init genesis + epochs.InitGenesis(ctx, k, types.GenesisState{ + Epochs: []types.EpochInfo{legacyEpochInfo}, + }) + + // Do not increment epoch + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) + epochs.BeginBlocker(ctx, k) + + // Increment epoch + ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(time.Hour * 24 * 32)) + epochs.BeginBlocker(ctx, k) + epochInfo := k.GetEpochInfo(ctx, "monthly") + + require.NotEqual(t, epochInfo.CurrentEpochStartHeight, int64(0)) +} diff --git a/x/epochs/client/cli/cli_test.go b/x/epochs/client/cli/cli_test.go new file mode 100644 index 0000000..53f67d6 --- /dev/null +++ b/x/epochs/client/cli/cli_test.go @@ -0,0 +1,115 @@ +package cli_test + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/quasarlabs/quasarnode/testutil/network" + "github.com/quasarlabs/quasarnode/x/epochs/client/cli" + "github.com/quasarlabs/quasarnode/x/epochs/types" + tmcli "github.com/tendermint/tendermint/libs/cli" +) + +func setupNetwork(t *testing.T) *network.Network { + t.Helper() + network := network.New(t) + _, err := network.WaitForHeight(1) + require.NoError(t, err) + + return network +} + +func TestGetCmdCurrentEpoch(t *testing.T) { + network := setupNetwork(t) + + clientCtx := network.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + testCases := []struct { + name string + identifier string + args []string + expectErr bool + resp types.QueryCurrentEpochResponse + }{ + { + "query minutely epoch number", + "minute", + common, + false, + types.QueryCurrentEpochResponse{ + CurrentEpoch: int64(1), + }, + }, + { + "query daily epoch number", + "day", + common, + false, + types.QueryCurrentEpochResponse{ + CurrentEpoch: int64(1), + }, + }, + { + "query weekly epoch number", + "week", + common, + false, + types.QueryCurrentEpochResponse{ + CurrentEpoch: int64(1), + }, + }, + { + "query unavailable epoch number", + "unavailable", + common, + true, + types.QueryCurrentEpochResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + + t.Run(tc.name, func(t *testing.T) { + cmd := cli.GetCmdCurrentEpoch() + args := []string{ + tc.identifier, + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args) + if tc.expectErr { + require.Error(t, err) + } else { + require.NoError(t, err, out.String()) + + var actualResp types.QueryCurrentEpochResponse + err := clientCtx.Codec.UnmarshalJSON(out.Bytes(), &actualResp) + require.NoError(t, err) + require.Equal(t, tc.resp, actualResp) + } + }) + } +} + +func TestGetCmdEpochsInfos(t *testing.T) { + var err error + network := setupNetwork(t) + clientCtx := network.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + cmd := cli.GetCmdEpochsInfos() + + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, common) + require.NoError(t, err, out.String()) + + var resp types.QueryEpochsInfoResponse + err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp) + require.NoError(t, err) + require.Equal(t, 4, len(resp.Epochs)) +} diff --git a/x/epochs/client/cli/query.go b/x/epochs/client/cli/query.go new file mode 100644 index 0000000..857081e --- /dev/null +++ b/x/epochs/client/cli/query.go @@ -0,0 +1,105 @@ +package cli + +import ( + "fmt" + "strings" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/version" + "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/spf13/cobra" +) + +// GetQueryCmd returns the cli query commands for this module. +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group epochs 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( + GetCmdEpochsInfos(), + GetCmdCurrentEpoch(), + ) + + return cmd +} + +// GetCmdEpochsInfos provide running epochInfos. +func GetCmdEpochsInfos() *cobra.Command { + cmd := &cobra.Command{ + Use: "epoch-infos", + Short: "Query running epochInfos", + Long: strings.TrimSpace( + fmt.Sprintf(`Query running epoch infos. + +Example: +$ %s query epochs epoch-infos +`, + version.AppName, + ), + ), + 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.EpochInfos(cmd.Context(), &types.QueryEpochsInfoRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdCurrentEpoch provides current epoch by specified identifier. +func GetCmdCurrentEpoch() *cobra.Command { + cmd := &cobra.Command{ + Use: "current-epoch", + Short: "Query current epoch by specified identifier", + Long: strings.TrimSpace( + fmt.Sprintf(`Query current epoch by specified identifier. + +Example: +$ %s query epochs current-epoch day +`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(1), + 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.CurrentEpoch(cmd.Context(), &types.QueryCurrentEpochRequest{ + Identifier: args[0], + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/epochs/client/cli/tx.go b/x/epochs/client/cli/tx.go new file mode 100644 index 0000000..e8a4a7c --- /dev/null +++ b/x/epochs/client/cli/tx.go @@ -0,0 +1,22 @@ +package cli + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/spf13/cobra" +) + +// 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, + } + + return cmd +} diff --git a/x/epochs/genesis.go b/x/epochs/genesis.go new file mode 100644 index 0000000..af2a8b0 --- /dev/null +++ b/x/epochs/genesis.go @@ -0,0 +1,26 @@ +package epochs + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasarlabs/quasarnode/x/epochs/keeper" + "github.com/quasarlabs/quasarnode/x/epochs/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, k *keeper.Keeper, genState types.GenesisState) { + // set epoch info from genesis + for _, epoch := range genState.Epochs { + err := k.AddEpochInfo(ctx, epoch) + if err != nil { + panic(err) + } + } +} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Epochs = k.AllEpochInfos(ctx) + return genesis +} diff --git a/x/epochs/genesis_test.go b/x/epochs/genesis_test.go new file mode 100644 index 0000000..8e407ab --- /dev/null +++ b/x/epochs/genesis_test.go @@ -0,0 +1,117 @@ +package epochs_test + +import ( + "testing" + "time" + + "github.com/quasarlabs/quasarnode/testutil" + "github.com/quasarlabs/quasarnode/x/epochs" + "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/stretchr/testify/require" +) + +func TestEpochsExportGenesis(t *testing.T) { + setup := testutil.NewTestSetup(t) + ctx, k := setup.Ctx, setup.Keepers.EpochsKeeper + epochs.InitGenesis(ctx, k, *types.DefaultGenesis()) + + chainStartTime := ctx.BlockTime() + chainStartHeight := ctx.BlockHeight() + + genesis := epochs.ExportGenesis(ctx, k) + require.Len(t, genesis.Epochs, 4) + + require.Equal(t, genesis.Epochs[0].Identifier, "day") + require.Equal(t, genesis.Epochs[0].StartTime, chainStartTime) + require.Equal(t, genesis.Epochs[0].Duration, time.Hour*24) + require.Equal(t, genesis.Epochs[0].CurrentEpoch, int64(0)) + require.Equal(t, genesis.Epochs[0].CurrentEpochStartHeight, chainStartHeight) + require.Equal(t, genesis.Epochs[0].CurrentEpochStartTime, chainStartTime) + require.Equal(t, genesis.Epochs[0].EpochCountingStarted, false) + require.Equal(t, genesis.Epochs[1].Identifier, "hour") + require.Equal(t, genesis.Epochs[1].StartTime, chainStartTime) + require.Equal(t, genesis.Epochs[1].Duration, time.Hour) + require.Equal(t, genesis.Epochs[1].CurrentEpoch, int64(0)) + require.Equal(t, genesis.Epochs[1].CurrentEpochStartHeight, chainStartHeight) + require.Equal(t, genesis.Epochs[1].CurrentEpochStartTime, chainStartTime) + require.Equal(t, genesis.Epochs[1].EpochCountingStarted, false) + require.Equal(t, genesis.Epochs[2].Identifier, "minute") + require.Equal(t, genesis.Epochs[2].StartTime, chainStartTime) + require.Equal(t, genesis.Epochs[2].Duration, time.Minute) + require.Equal(t, genesis.Epochs[2].CurrentEpoch, int64(0)) + require.Equal(t, genesis.Epochs[2].CurrentEpochStartHeight, chainStartHeight) + require.Equal(t, genesis.Epochs[2].CurrentEpochStartTime, chainStartTime) + require.Equal(t, genesis.Epochs[2].EpochCountingStarted, false) + require.Equal(t, genesis.Epochs[3].Identifier, "week") + require.Equal(t, genesis.Epochs[3].StartTime, chainStartTime) + require.Equal(t, genesis.Epochs[3].Duration, time.Hour*24*7) + require.Equal(t, genesis.Epochs[3].CurrentEpoch, int64(0)) + require.Equal(t, genesis.Epochs[3].CurrentEpochStartHeight, chainStartHeight) + require.Equal(t, genesis.Epochs[3].CurrentEpochStartTime, chainStartTime) + require.Equal(t, genesis.Epochs[3].EpochCountingStarted, false) +} + +func TestEpochsInitGenesis(t *testing.T) { + setup := testutil.NewTestSetup(t) + ctx, k := setup.Ctx, setup.Keepers.EpochsKeeper + + // On init genesis, default epochs information is set + // To check init genesis again, should make it fresh status + epochInfos := k.AllEpochInfos(ctx) + for _, epochInfo := range epochInfos { + k.DeleteEpochInfo(ctx, epochInfo.Identifier) + } + + now := time.Now() + ctx = ctx.WithBlockHeight(1) + ctx = ctx.WithBlockTime(now) + + //test genesisState validation + genesisState := types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + }, + } + require.EqualError(t, genesisState.Validate(), "epoch identifier should be unique") + + genesisState = types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + }, + } + + epochs.InitGenesis(ctx, k, genesisState) + epochInfo := k.GetEpochInfo(ctx, "monthly") + require.Equal(t, epochInfo.Identifier, "monthly") + require.Equal(t, epochInfo.StartTime.UTC().String(), now.UTC().String()) + require.Equal(t, epochInfo.Duration, time.Hour*24) + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, ctx.BlockHeight()) + require.Equal(t, epochInfo.CurrentEpochStartTime.UTC().String(), time.Time{}.String()) + require.Equal(t, epochInfo.EpochCountingStarted, true) +} diff --git a/x/epochs/handler.go b/x/epochs/handler.go new file mode 100644 index 0000000..8c7c546 --- /dev/null +++ b/x/epochs/handler.go @@ -0,0 +1,21 @@ +package epochs + +import ( + "fmt" + + 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" +) + +// NewHandler returns a handler for epochs module messages. +func NewHandler(k *keeper.Keeper) sdk.Handler { + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + switch msg := msg.(type) { + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/epochs/keeper/epoch.go b/x/epochs/keeper/epoch.go new file mode 100644 index 0000000..e0ab17c --- /dev/null +++ b/x/epochs/keeper/epoch.go @@ -0,0 +1,108 @@ +package keeper + +import ( + "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/gogo/protobuf/proto" + "github.com/quasarlabs/quasarnode/x/epochs/types" +) + +// GetEpochInfo returns epoch info by identifier. +func (k Keeper) GetEpochInfo(ctx sdk.Context, identifier string) types.EpochInfo { + epoch := types.EpochInfo{} + store := ctx.KVStore(k.storeKey) + b := store.Get(append(types.KeyPrefixEpoch, []byte(identifier)...)) + if b == nil { + return epoch + } + err := proto.Unmarshal(b, &epoch) + if err != nil { + panic(err) + } + return epoch +} + +// AddEpochInfo adds a new epoch info. Will return an error if the epoch fails validation, +// or re-uses an existing identifier. +// This method also sets the start time if left unset, and sets the epoch start height. +func (k Keeper) AddEpochInfo(ctx sdk.Context, epoch types.EpochInfo) error { + err := epoch.Validate() + if err != nil { + return err + } + // Check if identifier already exists + if (k.GetEpochInfo(ctx, epoch.Identifier) != types.EpochInfo{}) { + return fmt.Errorf("epoch with identifier %s already exists", epoch.Identifier) + } + + // Initialize empty and default epoch values + if epoch.StartTime.Equal(time.Time{}) { + epoch.StartTime = ctx.BlockTime() + } + epoch.CurrentEpochStartHeight = ctx.BlockHeight() + k.SetEpochInfo(ctx, epoch) + return nil +} + +// SetEpochInfo set epoch info. +func (k Keeper) SetEpochInfo(ctx sdk.Context, epoch types.EpochInfo) { + store := ctx.KVStore(k.storeKey) + value, err := proto.Marshal(&epoch) + if err != nil { + panic(err) + } + store.Set(append(types.KeyPrefixEpoch, []byte(epoch.Identifier)...), value) +} + +// DeleteEpochInfo delete epoch info. +func (k Keeper) DeleteEpochInfo(ctx sdk.Context, identifier string) { + store := ctx.KVStore(k.storeKey) + store.Delete(append(types.KeyPrefixEpoch, []byte(identifier)...)) +} + +// IterateEpochInfo iterate through epochs. +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) + defer iterator.Close() + + i := int64(0) + + for ; iterator.Valid(); iterator.Next() { + epoch := types.EpochInfo{} + err := proto.Unmarshal(iterator.Value(), &epoch) + if err != nil { + panic(err) + } + stop := fn(i, epoch) + + if stop { + break + } + i++ + } +} + +func (k Keeper) AllEpochInfos(ctx sdk.Context) []types.EpochInfo { + epochs := []types.EpochInfo{} + k.IterateEpochInfo(ctx, func(index int64, epochInfo types.EpochInfo) (stop bool) { + epochs = append(epochs, epochInfo) + return false + }) + return epochs +} + +// NumBlocksSinceEpochStart returns the number of blocks since the epoch started. +// if the epoch started on block N, then calling this during block N (after BeforeEpochStart) +// would return 0. +// Calling it any point in block N+1 (assuming the epoch doesn't increment) would return 1. +func (k Keeper) NumBlocksSinceEpochStart(ctx sdk.Context, identifier string) (int64, error) { + epoch := k.GetEpochInfo(ctx, identifier) + if (epoch == types.EpochInfo{}) { + return 0, fmt.Errorf("epoch with identifier %s not found", identifier) + } + return ctx.BlockHeight() - epoch.CurrentEpochStartHeight, nil +} diff --git a/x/epochs/keeper/epoch_test.go b/x/epochs/keeper/epoch_test.go new file mode 100644 index 0000000..0ca5101 --- /dev/null +++ b/x/epochs/keeper/epoch_test.go @@ -0,0 +1,37 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/quasarlabs/quasarnode/testutil" + "github.com/quasarlabs/quasarnode/x/epochs" + "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/stretchr/testify/require" +) + +func TestEpochLifeCycle(t *testing.T) { + setup := testutil.NewTestSetup(t) + ctx, k := setup.Ctx, setup.Keepers.EpochsKeeper + epochs.InitGenesis(ctx, k, *types.DefaultGenesis()) + + epochInfo := types.EpochInfo{ + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24 * 30, + CurrentEpoch: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + } + k.SetEpochInfo(ctx, epochInfo) + epochInfoSaved := k.GetEpochInfo(ctx, "monthly") + require.Equal(t, epochInfo, epochInfoSaved) + + allEpochs := k.AllEpochInfos(ctx) + require.Len(t, allEpochs, 5) + require.Equal(t, allEpochs[0].Identifier, "day") // alphabetical order + require.Equal(t, allEpochs[1].Identifier, "hour") + require.Equal(t, allEpochs[2].Identifier, "minute") + require.Equal(t, allEpochs[3].Identifier, "monthly") + require.Equal(t, allEpochs[4].Identifier, "week") +} diff --git a/x/epochs/keeper/grpc_query.go b/x/epochs/keeper/grpc_query.go new file mode 100644 index 0000000..a5c1bd0 --- /dev/null +++ b/x/epochs/keeper/grpc_query.go @@ -0,0 +1,53 @@ +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" +) + +var _ types.QueryServer = Querier{} + +// Querier defines a wrapper around the x/epochs keeper providing gRPC method +// handlers. +type Querier struct { + *Keeper +} + +func NewQuerier(k *Keeper) Querier { + return Querier{Keeper: k} +} + +// EpochInfos provide running epochInfos. +func (q Querier) EpochInfos(c context.Context, _ *types.QueryEpochsInfoRequest) (*types.QueryEpochsInfoResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryEpochsInfoResponse{ + Epochs: q.Keeper.AllEpochInfos(ctx), + }, nil +} + +// CurrentEpoch provides current epoch of specified identifier. +func (q Querier) CurrentEpoch(c context.Context, req *types.QueryCurrentEpochRequest) (*types.QueryCurrentEpochResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + if req.Identifier == "" { + return nil, status.Error(codes.InvalidArgument, "identifier is empty") + } + + ctx := sdk.UnwrapSDKContext(c) + + info := q.Keeper.GetEpochInfo(ctx, req.Identifier) + if info.Identifier != req.Identifier { + return nil, errors.New("not available identifier") + } + + return &types.QueryCurrentEpochResponse{ + CurrentEpoch: info.CurrentEpoch, + }, nil +} diff --git a/x/epochs/keeper/grpc_query_test.go b/x/epochs/keeper/grpc_query_test.go new file mode 100644 index 0000000..f383923 --- /dev/null +++ b/x/epochs/keeper/grpc_query_test.go @@ -0,0 +1,57 @@ +package keeper_test + +import ( + "testing" + + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "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" + "github.com/stretchr/testify/require" +) + +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) + + // Invalid param + epochInfosResponse, err := querier.EpochInfos(goCtx, &types.QueryEpochsInfoRequest{}) + require.NoError(t, err) + require.Len(t, epochInfosResponse.Epochs, 4) + + // check that EpochInfos are correct + // Epochs come ordered alphabetically by identifier + require.Equal(t, epochInfosResponse.Epochs[0].Identifier, "day") + require.Equal(t, epochInfosResponse.Epochs[0].StartTime, chainStartTime) + require.Equal(t, epochInfosResponse.Epochs[0].Duration, time.Hour*24) + require.Equal(t, epochInfosResponse.Epochs[0].CurrentEpoch, int64(0)) + require.Equal(t, epochInfosResponse.Epochs[0].CurrentEpochStartTime, chainStartTime) + require.Equal(t, epochInfosResponse.Epochs[0].EpochCountingStarted, false) + require.Equal(t, epochInfosResponse.Epochs[1].Identifier, "hour") + require.Equal(t, epochInfosResponse.Epochs[1].StartTime, chainStartTime) + require.Equal(t, epochInfosResponse.Epochs[1].Duration, time.Hour) + require.Equal(t, epochInfosResponse.Epochs[1].CurrentEpoch, int64(0)) + require.Equal(t, epochInfosResponse.Epochs[1].CurrentEpochStartTime, chainStartTime) + require.Equal(t, epochInfosResponse.Epochs[1].EpochCountingStarted, false) + require.Equal(t, epochInfosResponse.Epochs[2].Identifier, "minute") + require.Equal(t, epochInfosResponse.Epochs[2].StartTime, chainStartTime) + require.Equal(t, epochInfosResponse.Epochs[2].Duration, time.Minute) + require.Equal(t, epochInfosResponse.Epochs[2].CurrentEpoch, int64(0)) + require.Equal(t, epochInfosResponse.Epochs[2].CurrentEpochStartTime, chainStartTime) + require.Equal(t, epochInfosResponse.Epochs[2].EpochCountingStarted, false) + require.Equal(t, epochInfosResponse.Epochs[3].Identifier, "week") + require.Equal(t, epochInfosResponse.Epochs[3].StartTime, chainStartTime) + require.Equal(t, epochInfosResponse.Epochs[3].Duration, time.Hour*24*7) + require.Equal(t, epochInfosResponse.Epochs[3].CurrentEpoch, int64(0)) + require.Equal(t, epochInfosResponse.Epochs[3].CurrentEpochStartTime, chainStartTime) + require.Equal(t, epochInfosResponse.Epochs[3].EpochCountingStarted, false) +} diff --git a/x/epochs/keeper/hooks.go b/x/epochs/keeper/hooks.go new file mode 100644 index 0000000..059a2bd --- /dev/null +++ b/x/epochs/keeper/hooks.go @@ -0,0 +1,13 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) AfterEpochEnd(ctx sdk.Context, identifier string, epochNumber int64) { + k.hooks.AfterEpochEnd(ctx, identifier, epochNumber) +} + +func (k Keeper) BeforeEpochStart(ctx sdk.Context, identifier string, epochNumber int64) { + k.hooks.BeforeEpochStart(ctx, identifier, epochNumber) +} diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go new file mode 100644 index 0000000..d9a43d8 --- /dev/null +++ b/x/epochs/keeper/keeper.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasarlabs/quasarnode/x/epochs/types" + "github.com/tendermint/tendermint/libs/log" +) + +type ( + Keeper struct { + cdc codec.Codec + storeKey sdk.StoreKey + hooks types.EpochHooks + } +) + +func NewKeeper(cdc codec.Codec, storeKey sdk.StoreKey) *Keeper { + return &Keeper{ + cdc: cdc, + storeKey: storeKey, + } +} + +// Set the epoch hooks. +func (k *Keeper) SetHooks(eh types.EpochHooks) *Keeper { + if k.hooks != nil { + panic("cannot set epochs hooks twice") + } + + k.hooks = eh + + return k +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/epochs/module.go b/x/epochs/module.go new file mode 100644 index 0000000..6a4b3bb --- /dev/null +++ b/x/epochs/module.go @@ -0,0 +1,202 @@ +package epochs + +import ( + "context" + "encoding/json" + "fmt" + "math/rand" + + "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" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + + "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{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.Codec +} + +func NewAppModuleBasic(cdc codec.Codec) 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) {} + +// 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) + } +} + +// 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(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + keeper *keeper.Keeper +} + +func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + } +} + +// 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 x/epochs module's 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(), keeper.NewQuerier(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) +} + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + BeginBlocker(ctx, am.keeper) +} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} + +// ___________________________________________________________________________ + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the pool-incentives module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized pool-incentives param changes for the simulator. +func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { + return nil +} + +// RegisterStoreDecoder registers a decoder for supply module's types. +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 { + return nil // TODO +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 1 } diff --git a/x/epochs/simulation/genesis.go b/x/epochs/simulation/genesis.go new file mode 100644 index 0000000..0b05e8b --- /dev/null +++ b/x/epochs/simulation/genesis.go @@ -0,0 +1,55 @@ +package simulation + +// DONTCOVER + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/quasarlabs/quasarnode/x/epochs/types" +) + +// RandomizedGenState generates a random GenesisState for mint. +func RandomizedGenState(simState *module.SimulationState) { + epochs := []types.EpochInfo{ + { + Identifier: "day", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + { + Identifier: "hour", + StartTime: time.Time{}, + Duration: time.Hour, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + { + Identifier: "second", + StartTime: time.Time{}, + Duration: time.Second, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + } + epochGenesis := types.NewGenesisState(epochs) + + bz, err := json.MarshalIndent(&epochGenesis, "", " ") + if err != nil { + panic(err) + } + + // TODO: Do some randomization later + fmt.Printf("Selected deterministically generated epoch parameters:\n%s\n", bz) + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(epochGenesis) +} diff --git a/x/epochs/spec/01_concepts.md b/x/epochs/spec/01_concepts.md new file mode 100644 index 0000000..06a6e4b --- /dev/null +++ b/x/epochs/spec/01_concepts.md @@ -0,0 +1,7 @@ + + +# Concepts + +The purpose of `epochs` module is to provide generalized epoch interface to other modules so that they can easily implement epochs without keeping own code for epochs. diff --git a/x/epochs/spec/02_state.md b/x/epochs/spec/02_state.md new file mode 100644 index 0000000..24d77aa --- /dev/null +++ b/x/epochs/spec/02_state.md @@ -0,0 +1,46 @@ + + +# State + +Epochs module keeps `EpochInfo` objects and modify the information as epochs info changes. +Epochs are initialized as part of genesis initialization, and modified on begin blockers or end blockers. + +### Epoch information type + +```protobuf +message EpochInfo { + string identifier = 1; + google.protobuf.Timestamp start_time = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + google.protobuf.Duration duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + int64 current_epoch = 4; + google.protobuf.Timestamp current_epoch_start_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"current_epoch_start_time\"" + ]; + bool epoch_counting_started = 6; + reserved 7; + int64 current_epoch_start_height = 8; +} +``` + +EpochInfo keeps `identifier`, `start_time`,`duration`, `current_epoch`, `current_epoch_start_time`, `epoch_counting_started`, `current_epoch_start_height`. + +1. `identifier` keeps epoch identification string. +2. `start_time` keeps epoch counting start time, if block time passes `start_time`, `epoch_counting_started` is set. +3. `duration` keeps target epoch duration. +4. `current_epoch` keeps current active epoch number. +5. `current_epoch_start_time` keeps the start time of current epoch. +6. `epoch_number` is counted only when `epoch_counting_started` flag is set. +7. `current_epoch_start_height` keeps the start block height of current epoch. diff --git a/x/epochs/spec/03_events.md b/x/epochs/spec/03_events.md new file mode 100644 index 0000000..96f40f3 --- /dev/null +++ b/x/epochs/spec/03_events.md @@ -0,0 +1,20 @@ + + +# Events + +The `epochs` module emits the following events: + +## BeginBlocker + +| Type | Attribute Key | Attribute Value | +| ----------- | ------------- | --------------- | +| epoch_start | epoch_number | {epoch_number} | +| epoch_start | start_time | {start_time} | + +## EndBlocker + +| Type | Attribute Key | Attribute Value | +| ----------- | ------------- | --------------- | +| epoch_end | epoch_number | {epoch_number} | \ No newline at end of file diff --git a/x/epochs/spec/04_keeper.md b/x/epochs/spec/04_keeper.md new file mode 100644 index 0000000..5b3973a --- /dev/null +++ b/x/epochs/spec/04_keeper.md @@ -0,0 +1,25 @@ + + +# Keepers + +## Keeper functions + +Epochs keeper module provides utility functions to manage epochs. + +```go +// Keeper is the interface for lockup module keeper +type Keeper interface { + // GetEpochInfo returns epoch info by identifier + GetEpochInfo(ctx sdk.Context, identifier string) types.EpochInfo + // SetEpochInfo set epoch info + SetEpochInfo(ctx sdk.Context, epoch types.EpochInfo) + // DeleteEpochInfo delete epoch info + DeleteEpochInfo(ctx sdk.Context, identifier string) + // IterateEpochInfo iterate through epochs + IterateEpochInfo(ctx sdk.Context, fn func(index int64, epochInfo types.EpochInfo) (stop bool)) + // Get all epoch infos + AllEpochInfos(ctx sdk.Context) []types.EpochInfo +} +``` \ No newline at end of file diff --git a/x/epochs/spec/05_hooks.md b/x/epochs/spec/05_hooks.md new file mode 100644 index 0000000..e98d8c1 --- /dev/null +++ b/x/epochs/spec/05_hooks.md @@ -0,0 +1,19 @@ + + +# Hooks + +## Hooks +```go + // the first block whose timestamp is after the duration is counted as the end of the epoch + AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) + // new epoch is next block of epoch end block + BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) +``` + +## How modules receive hooks + +On hook receiver function of other modules, they need to filter `epochIdentifier` and only do executions for only specific epochIdentifier. +Filtering epochIdentifier could be in `Params` of other modules so that they can be modified by governance. +Governance can change epoch from `week` to `day` as their need. \ No newline at end of file diff --git a/x/epochs/spec/06_queries.md b/x/epochs/spec/06_queries.md new file mode 100644 index 0000000..2b27521 --- /dev/null +++ b/x/epochs/spec/06_queries.md @@ -0,0 +1,16 @@ + + +# Queries + +Epochs module is providing below queries to check the module's state. + +```protobuf +service Query { + // EpochInfos provide running epochInfos + rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) {} + // CurrentEpoch provide current epoch of specified identifier + rpc CurrentEpoch(QueryCurrentEpochRequest) returns (QueryCurrentEpochResponse) {} +} +``` \ No newline at end of file diff --git a/x/epochs/spec/07_future_improvements.md b/x/epochs/spec/07_future_improvements.md new file mode 100644 index 0000000..6817173 --- /dev/null +++ b/x/epochs/spec/07_future_improvements.md @@ -0,0 +1,24 @@ + + +# Future Improvements + +## Lack point using this module + +In current design each epoch should be at least 2 blocks as start block should be different from endblock. +Because of this, each epoch time will be `max(blocks_time x 2, epoch_duration)`. +If epoch_duration is set to `1s`, and `block_time` is `5s`, actual epoch time should be `10s`. +We definitely recommend configure epoch_duration as more than 2x block_time, to use this module correctly. +If you enforce to set it to 1s, it's same as 10s - could make module logic invalid. + +TODO for postlaunch: We should see if we can architect things such that the receiver doesn't have to do this filtering, and the epochs module would pre-filter for them. + +## Block-time drifts problem + +This implementation has block time drift based on block time. +For instance, we have an epoch of 100 units that ends at t=100, if we have a block at t=97 and a block at t=104 and t=110, this epoch ends at t=104. +And new epoch start at t=110. There are time drifts here, for around 1-2 blocks time. +It will slow down epochs. + +It's going to slow down epoch by 10-20s per week when epoch duration is 1 week. This should be resolved after launch. \ No newline at end of file diff --git a/x/epochs/spec/README.md b/x/epochs/spec/README.md new file mode 100644 index 0000000..2acf984 --- /dev/null +++ b/x/epochs/spec/README.md @@ -0,0 +1,22 @@ + + +# `epochs` + +## Abstract + +Often in the SDK, we would like to run certain code every-so often. The purpose of `epochs` module is to allow other modules to set that they would like to be signaled once every period. So another module can specify it wants to execute code once a week, starting at UTC-time = x. `epochs` creates a generalized epoch interface to other modules so that they can easily be signalled upon such events. + +## Contents + +1. **[Concept](01_concepts.md)** +2. **[State](02_state.md)** +3. **[Events](03_events.md)** +4. **[Keeper](04_keeper.md)** +5. **[Hooks](05_hooks.md)** +6. **[Queries](06_queries.md)** +7. **[Future improvements](07_future_improvements.md)** diff --git a/x/epochs/types/codec.go b/x/epochs/types/codec.go new file mode 100644 index 0000000..a7a04d3 --- /dev/null +++ b/x/epochs/types/codec.go @@ -0,0 +1,17 @@ +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.NewAminoCodec(amino) +) diff --git a/x/epochs/types/errors.go b/x/epochs/types/errors.go new file mode 100644 index 0000000..0c13f2f --- /dev/null +++ b/x/epochs/types/errors.go @@ -0,0 +1,12 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/epochs module sentinel errors. +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") +) diff --git a/x/epochs/types/events.go b/x/epochs/types/events.go new file mode 100644 index 0000000..da0ac83 --- /dev/null +++ b/x/epochs/types/events.go @@ -0,0 +1,9 @@ +package types + +const ( + EventTypeEpochEnd = "epoch_end" + EventTypeEpochStart = "epoch_start" + + AttributeEpochNumber = "epoch_number" + AttributeEpochStartTime = "start_time" +) diff --git a/x/epochs/types/genesis.go b/x/epochs/types/genesis.go new file mode 100644 index 0000000..fd69de2 --- /dev/null +++ b/x/epochs/types/genesis.go @@ -0,0 +1,69 @@ +package types + +import ( + "errors" + "time" +) + +// DefaultIndex is the default capability global index. +const DefaultIndex uint64 = 1 + +func NewGenesisState(epochs []EpochInfo) *GenesisState { + return &GenesisState{Epochs: epochs} +} + +// DefaultGenesis returns the default Capability genesis state. +func DefaultGenesis() *GenesisState { + epochs := []EpochInfo{ + NewGenesisEpochInfo("day", time.Hour*24), // alphabetical order + NewGenesisEpochInfo("hour", time.Hour), + NewGenesisEpochInfo("minute", time.Minute), + NewGenesisEpochInfo("week", time.Hour*24*7), + } + return NewGenesisState(epochs) +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + epochIdentifiers := map[string]bool{} + for _, epoch := range gs.Epochs { + if err := epoch.Validate(); err != nil { + return err + } + if epochIdentifiers[epoch.Identifier] { + return errors.New("epoch identifier should be unique") + } + epochIdentifiers[epoch.Identifier] = true + } + return nil +} + +// Validate also validates epoch info. +func (epoch EpochInfo) Validate() error { + if epoch.Identifier == "" { + return errors.New("epoch identifier should NOT be empty") + } + if epoch.Duration == 0 { + return errors.New("epoch duration should NOT be 0") + } + if epoch.CurrentEpoch < 0 { + return errors.New("epoch CurrentEpoch must be non-negative") + } + if epoch.CurrentEpochStartHeight < 0 { + return errors.New("epoch CurrentEpoch must be non-negative") + } + return nil +} + +func NewGenesisEpochInfo(identifier string, duration time.Duration) EpochInfo { + return EpochInfo{ + Identifier: identifier, + StartTime: time.Time{}, + Duration: duration, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + } +} diff --git a/x/epochs/types/genesis.pb.go b/x/epochs/types/genesis.pb.go new file mode 100644 index 0000000..0bdc460 --- /dev/null +++ b/x/epochs/types/genesis.pb.go @@ -0,0 +1,785 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: epochs/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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 EpochInfo struct { + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` + Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` + CurrentEpoch int64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + 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"` + EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` + 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_b167152c9528ab6c, []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_b167152c9528ab6c, []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), "quasarlabs.quasarnode.epochs.EpochInfo") + proto.RegisterType((*GenesisState)(nil), "quasarlabs.quasarnode.epochs.GenesisState") +} + +func init() { proto.RegisterFile("epochs/genesis.proto", fileDescriptor_b167152c9528ab6c) } + +var fileDescriptor_b167152c9528ab6c = []byte{ + // 470 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x3f, 0x8f, 0xd3, 0x30, + 0x1c, 0xad, 0x69, 0x29, 0xa9, 0xef, 0x10, 0x60, 0x1d, 0x10, 0x2a, 0x48, 0xa2, 0x30, 0x10, 0x09, + 0x64, 0x8b, 0x83, 0x09, 0xb6, 0xc2, 0x09, 0x8e, 0x31, 0x05, 0x09, 0xb1, 0x54, 0x69, 0xeb, 0x26, + 0x96, 0x9a, 0x38, 0x24, 0xbf, 0x48, 0x74, 0xe3, 0x23, 0x74, 0xe4, 0x23, 0xdd, 0x78, 0x23, 0x53, + 0x40, 0xed, 0xc6, 0x78, 0x9f, 0x00, 0xc5, 0x4e, 0xda, 0x42, 0xf9, 0xb3, 0x39, 0x7e, 0xef, 0xf7, + 0x9e, 0x7f, 0x4f, 0x2f, 0xf8, 0x88, 0xa7, 0x72, 0x12, 0xe5, 0x2c, 0xe4, 0x09, 0xcf, 0x45, 0x4e, + 0xd3, 0x4c, 0x82, 0x24, 0x77, 0x3f, 0x16, 0x41, 0x1e, 0x64, 0xf3, 0x60, 0x9c, 0x53, 0x7d, 0x4c, + 0xe4, 0x94, 0x53, 0xcd, 0xed, 0x1f, 0x85, 0x32, 0x94, 0x8a, 0xc8, 0xaa, 0x93, 0x9e, 0xe9, 0x5b, + 0xa1, 0x94, 0xe1, 0x9c, 0x33, 0xf5, 0x35, 0x2e, 0x66, 0x6c, 0x5a, 0x64, 0x01, 0x08, 0x99, 0xd4, + 0xb8, 0xfd, 0x3b, 0x0e, 0x22, 0xe6, 0x39, 0x04, 0x71, 0xaa, 0x09, 0xee, 0xb2, 0x83, 0x7b, 0x27, + 0x95, 0xc3, 0x69, 0x32, 0x93, 0xc4, 0xc2, 0x58, 0x4c, 0x79, 0x02, 0x62, 0x26, 0x78, 0x66, 0x22, + 0x07, 0x79, 0x3d, 0x7f, 0xe7, 0x86, 0xbc, 0xc7, 0x38, 0x87, 0x20, 0x83, 0x51, 0x25, 0x63, 0x5e, + 0x72, 0x90, 0x77, 0x70, 0xdc, 0xa7, 0xda, 0x83, 0x36, 0x1e, 0xf4, 0x6d, 0xe3, 0x31, 0xb8, 0x77, + 0x56, 0xda, 0xad, 0x8b, 0xd2, 0xbe, 0xb1, 0x08, 0xe2, 0xf9, 0x33, 0x77, 0x3b, 0xeb, 0x2e, 0xbf, + 0xd9, 0xc8, 0xef, 0xa9, 0x8b, 0x8a, 0x4e, 0x22, 0x6c, 0x34, 0x4f, 0x37, 0xdb, 0x4a, 0xf7, 0xce, + 0x9e, 0xee, 0xcb, 0x9a, 0x30, 0x78, 0x5c, 0xc9, 0xfe, 0x28, 0x6d, 0xd2, 0x8c, 0x3c, 0x92, 0xb1, + 0x00, 0x1e, 0xa7, 0xb0, 0xb8, 0x28, 0xed, 0x6b, 0xda, 0xac, 0xc1, 0xdc, 0x2f, 0x95, 0xd5, 0x46, + 0x9d, 0xdc, 0xc7, 0x57, 0x27, 0x45, 0x96, 0xf1, 0x04, 0x46, 0x2a, 0x5a, 0xb3, 0xe3, 0x20, 0xaf, + 0xed, 0x1f, 0xd6, 0x97, 0x2a, 0x0c, 0xf2, 0x19, 0x61, 0xf3, 0x17, 0xd6, 0x68, 0x67, 0xef, 0xcb, + 0xff, 0xdd, 0xfb, 0x61, 0xbd, 0xb7, 0xad, 0x9f, 0xf2, 0x37, 0x25, 0x9d, 0xc2, 0xcd, 0x5d, 0xe7, + 0xe1, 0x26, 0x91, 0xa7, 0xf8, 0x96, 0xe6, 0x4f, 0x64, 0x91, 0x80, 0x48, 0x42, 0x3d, 0xc8, 0xa7, + 0x66, 0xd7, 0x41, 0x9e, 0xe1, 0xeb, 0x12, 0xbd, 0xa8, 0xc1, 0xa1, 0xc6, 0xc8, 0x73, 0xdc, 0xff, + 0x93, 0x5b, 0xc4, 0x45, 0x18, 0x81, 0x69, 0xa8, 0x55, 0x6f, 0xef, 0x19, 0xbe, 0x56, 0xf0, 0x9b, + 0x8e, 0x71, 0xe5, 0xba, 0xe1, 0xbe, 0xc3, 0x87, 0xaf, 0x74, 0x31, 0x87, 0x10, 0x00, 0x27, 0x27, + 0xb8, 0xab, 0x3b, 0x68, 0x22, 0xa7, 0xed, 0x1d, 0x1c, 0x3f, 0xa0, 0xff, 0x2a, 0x2a, 0xdd, 0xb4, + 0x69, 0xd0, 0xa9, 0x52, 0xf0, 0xeb, 0xe1, 0xc1, 0xe9, 0xd9, 0xca, 0x42, 0xe7, 0x2b, 0x0b, 0x7d, + 0x5f, 0x59, 0x68, 0xb9, 0xb6, 0x5a, 0xe7, 0x6b, 0xab, 0xf5, 0x75, 0x6d, 0xb5, 0x3e, 0xb0, 0x50, + 0x40, 0x54, 0x8c, 0xe9, 0x44, 0xc6, 0x6c, 0x2b, 0xcd, 0xb6, 0xd2, 0xec, 0x13, 0xab, 0xff, 0x18, + 0x58, 0xa4, 0x3c, 0x1f, 0x77, 0x55, 0xe4, 0x4f, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x3b, + 0xa0, 0x7e, 0x48, 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_gogo_protobuf_types.StdTimeMarshalTo(m.CurrentEpochStartTime, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovGenesis(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovGenesis(uint64(l)) + if m.CurrentEpoch != 0 { + n += 1 + sovGenesis(uint64(m.CurrentEpoch)) + } + l = github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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/x/epochs/types/hooks.go b/x/epochs/types/hooks.go new file mode 100644 index 0000000..8d24652 --- /dev/null +++ b/x/epochs/types/hooks.go @@ -0,0 +1,35 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type EpochHooks interface { + // the first block whose timestamp is after the duration is counted as the end of the epoch + AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) + // new epoch is next block of epoch end block + BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) +} + +var _ EpochHooks = MultiEpochHooks{} + +// combine multiple gamm hooks, all hook functions are run in array sequence. +type MultiEpochHooks []EpochHooks + +func NewMultiEpochHooks(hooks ...EpochHooks) MultiEpochHooks { + return hooks +} + +// AfterEpochEnd is called when epoch is going to be ended, epochNumber is the number of epoch that is ending. +func (h MultiEpochHooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) { + for i := range h { + h[i].AfterEpochEnd(ctx, epochIdentifier, epochNumber) + } +} + +// BeforeEpochStart is called when epoch is going to be started, epochNumber is the number of epoch that is starting. +func (h MultiEpochHooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) { + for i := range h { + h[i].BeforeEpochStart(ctx, epochIdentifier, epochNumber) + } +} diff --git a/x/epochs/types/identifier.go b/x/epochs/types/identifier.go new file mode 100644 index 0000000..bf0392d --- /dev/null +++ b/x/epochs/types/identifier.go @@ -0,0 +1,24 @@ +package types + +import ( + "fmt" +) + +func ValidateEpochIdentifierInterface(i interface{}) error { + v, ok := i.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + if err := ValidateEpochIdentifierString(v); err != nil { + return err + } + + return nil +} + +func ValidateEpochIdentifierString(s string) error { + if s == "" { + return fmt.Errorf("empty distribution epoch identifier: %+v", s) + } + return nil +} diff --git a/x/epochs/types/keys.go b/x/epochs/types/keys.go new file mode 100644 index 0000000..cff81a4 --- /dev/null +++ b/x/epochs/types/keys.go @@ -0,0 +1,22 @@ +package types + +const ( + // ModuleName defines the module name. + ModuleName = "epochs" + + // 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 +) + +// KeyPrefixEpoch defines prefix key for storing epochs. +var KeyPrefixEpoch = []byte{0x01} + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/epochs/types/query.pb.go b/x/epochs/types/query.pb.go new file mode 100644 index 0000000..c500cad --- /dev/null +++ b/x/epochs/types/query.pb.go @@ -0,0 +1,910 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: epochs/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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_2e760c2f82b90e24, []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_2e760c2f82b90e24, []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_2e760c2f82b90e24, []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_2e760c2f82b90e24, []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), "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("epochs/query.proto", fileDescriptor_2e760c2f82b90e24) } + +var fileDescriptor_2e760c2f82b90e24 = []byte{ + // 392 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x4f, 0x4f, 0xe2, 0x40, + 0x18, 0xc6, 0x3b, 0xb0, 0x4b, 0xb2, 0xb3, 0xec, 0x65, 0x42, 0x76, 0xbb, 0x0d, 0xe9, 0xb2, 0xe5, + 0x20, 0x7a, 0xe8, 0x08, 0xfe, 0x4b, 0x3c, 0x19, 0x0c, 0x07, 0x8e, 0xf6, 0xe8, 0x45, 0xdb, 0x32, + 0x94, 0x26, 0x38, 0x53, 0x3a, 0x53, 0x23, 0x57, 0x3f, 0x81, 0x89, 0x5f, 0xc1, 0x2f, 0xe0, 0xb7, + 0xe0, 0x48, 0xe2, 0xc5, 0x93, 0x31, 0xc5, 0x0f, 0x62, 0x98, 0x8e, 0x52, 0x23, 0x21, 0x72, 0x9b, + 0xbe, 0xef, 0xfb, 0x3c, 0xcf, 0x6f, 0xde, 0x0e, 0x44, 0x24, 0x62, 0xfe, 0x80, 0xe3, 0x51, 0x42, + 0xe2, 0xb1, 0x1d, 0xc5, 0x4c, 0x30, 0x54, 0x1d, 0x25, 0x2e, 0x77, 0xe3, 0xa1, 0xeb, 0x71, 0x3b, + 0x3b, 0x52, 0xd6, 0x23, 0x76, 0x36, 0x69, 0x54, 0x02, 0x16, 0x30, 0x39, 0x88, 0xe7, 0xa7, 0x4c, + 0x63, 0x54, 0x03, 0xc6, 0x82, 0x21, 0xc1, 0x6e, 0x14, 0x62, 0x97, 0x52, 0x26, 0x5c, 0x11, 0x32, + 0xca, 0x55, 0xb7, 0xa2, 0x52, 0x02, 0x42, 0x09, 0x0f, 0x55, 0xd5, 0xd2, 0xe1, 0xef, 0x93, 0x79, + 0x6c, 0x47, 0x36, 0xbb, 0xb4, 0xcf, 0x1c, 0x32, 0x4a, 0x08, 0x17, 0xd6, 0x39, 0xfc, 0xf3, 0xa9, + 0xc3, 0x23, 0x46, 0x39, 0x41, 0x1d, 0x58, 0xca, 0xcc, 0x74, 0x50, 0x2b, 0x36, 0x7e, 0xb6, 0x36, + 0xec, 0x55, 0xb4, 0xb6, 0x74, 0x98, 0x1b, 0xb4, 0xbf, 0x4d, 0x9e, 0xfe, 0x69, 0x8e, 0x12, 0x5b, + 0x87, 0x50, 0x97, 0x09, 0xc7, 0x49, 0x1c, 0x13, 0x2a, 0xe4, 0x98, 0x4a, 0x47, 0x26, 0x84, 0x61, + 0x8f, 0x50, 0x11, 0xf6, 0x43, 0x12, 0xeb, 0xa0, 0x06, 0x1a, 0x3f, 0x9c, 0x5c, 0xc5, 0x3a, 0x82, + 0x7f, 0x97, 0x68, 0x15, 0x5f, 0x1d, 0xfe, 0xf2, 0xb3, 0xfa, 0x99, 0x8c, 0x92, 0xfa, 0xa2, 0x53, + 0xf6, 0x73, 0xc3, 0xad, 0xb4, 0x00, 0xbf, 0x4b, 0x0b, 0x74, 0x07, 0x20, 0x7c, 0x67, 0xe4, 0x68, + 0x77, 0xf5, 0x6d, 0x96, 0xaf, 0xcb, 0xd8, 0x5b, 0x53, 0x95, 0xa1, 0x5a, 0x9b, 0xd7, 0x0f, 0x2f, + 0xb7, 0x85, 0x3a, 0xfa, 0x8f, 0x17, 0x72, 0xac, 0xfe, 0xd4, 0x65, 0xd3, 0x23, 0xc2, 0x6d, 0xaa, + 0x4f, 0x74, 0x0f, 0x60, 0x39, 0x7f, 0x5d, 0xb4, 0xff, 0x85, 0xc8, 0x25, 0xbb, 0x35, 0x0e, 0xd6, + 0xd6, 0x29, 0xd8, 0x6d, 0x09, 0xbb, 0x85, 0x1a, 0x2b, 0x60, 0x3f, 0x2c, 0xbe, 0xdd, 0x9d, 0xa4, + 0x26, 0x98, 0xa6, 0x26, 0x78, 0x4e, 0x4d, 0x70, 0x33, 0x33, 0xb5, 0xe9, 0xcc, 0xd4, 0x1e, 0x67, + 0xa6, 0x76, 0x8a, 0x83, 0x50, 0x0c, 0x12, 0xcf, 0xf6, 0xd9, 0x45, 0xde, 0x6d, 0x81, 0x83, 0xaf, + 0xde, 0xac, 0xc5, 0x38, 0x22, 0xdc, 0x2b, 0xc9, 0x07, 0xbb, 0xf3, 0x1a, 0x00, 0x00, 0xff, 0xff, + 0x2e, 0xd2, 0x6f, 0x9f, 0x2e, 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, "/quasarlabs.quasarnode.epochs.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, "/quasarlabs.quasarnode.epochs.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: "/quasarlabs.quasarnode.epochs.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: "/quasarlabs.quasarnode.epochs.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: "quasarlabs.quasarnode.epochs.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EpochInfos", + Handler: _Query_EpochInfos_Handler, + }, + { + MethodName: "CurrentEpoch", + Handler: _Query_CurrentEpoch_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "epochs/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/x/epochs/types/query.pb.gw.go b/x/epochs/types/query.pb.gw.go new file mode 100644 index 0000000..7770df2 --- /dev/null +++ b/x/epochs/types/query.pb.gw.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: epochs/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{"quasarlabs", "epochs", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) + + 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(false))) +) + +var ( + forward_Query_EpochInfos_0 = runtime.ForwardResponseMessage + + forward_Query_CurrentEpoch_0 = runtime.ForwardResponseMessage +) diff --git a/x/qoracle/client/cli/cli.go b/x/qoracle/client/cli/cli.go new file mode 100644 index 0000000..1c5a747 --- /dev/null +++ b/x/qoracle/client/cli/cli.go @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000..ae596da --- /dev/null +++ b/x/qoracle/client/cli/query.go @@ -0,0 +1,80 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/quasarlabs/quasarnode/x/qoracle/types" + "github.com/spf13/cobra" +) + +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 new file mode 100644 index 0000000..c2b01ac --- /dev/null +++ b/x/qoracle/client/cli/tx.go @@ -0,0 +1,25 @@ +package cli + +import ( + "fmt" + + "github.com/quasarlabs/quasarnode/x/qoracle/types" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + qosmocli "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/client/cli" +) + +// 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 new file mode 100644 index 0000000..303507d --- /dev/null +++ b/x/qoracle/genesis.go @@ -0,0 +1,29 @@ +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 new file mode 100644 index 0000000..2a215f6 --- /dev/null +++ b/x/qoracle/genesis/types/genesis.go @@ -0,0 +1,67 @@ +package types + +import ( + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + qosmotypes "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" + types "github.com/quasarlabs/quasarnode/x/qoracle/types" +) + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + Params: types.DefaultParams(), + OsmosisGenesisState: DefaultOsmosisGenesis(), + } +} + +// NewGenesisState creates and returns a new GenesisState instance from the provided controller and host genesis state types +func NewGenesisState(params types.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 new file mode 100644 index 0000000..c747233 --- /dev/null +++ b/x/qoracle/genesis/types/genesis.pb.go @@ -0,0 +1,608 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qoracle/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/gogo/protobuf/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_7f6d2a846a217903, []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_7f6d2a846a217903, []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("qoracle/genesis.proto", fileDescriptor_7f6d2a846a217903) } + +var fileDescriptor_7f6d2a846a217903 = []byte{ + // 322 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0xcc, 0x2f, 0x4a, + 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 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, 0x8a, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x2a, 0xf5, + 0x41, 0x2c, 0x88, 0x26, 0x29, 0x11, 0x98, 0x59, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0xa3, 0xa4, + 0x64, 0x60, 0xa2, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0x99, 0xc5, 0x28, 0xb2, 0x4a, 0x9f, 0x19, 0xb9, + 0x78, 0xdc, 0x21, 0x56, 0x07, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x85, 0x70, 0xb1, 0x41, 0x14, 0x48, + 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0xa9, 0xea, 0xe1, 0x75, 0x8a, 0x5e, 0x00, 0x58, 0xb1, 0x93, + 0xe8, 0x89, 0x7b, 0xf2, 0x0c, 0x9f, 0xee, 0xc9, 0xf3, 0x56, 0x26, 0xe6, 0xe6, 0x58, 0x29, 0x41, + 0x8c, 0x50, 0x0a, 0x82, 0x9a, 0x25, 0xd4, 0xc3, 0xc8, 0x25, 0x0a, 0xb5, 0x3f, 0x1e, 0xea, 0xd3, + 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, 0x47, 0xd8, + 0xa8, 0x8f, 0xb0, 0x51, 0xbf, 0x42, 0x1f, 0x2d, 0x41, 0xe9, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, + 0xb1, 0x81, 0xa3, 0xdb, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x74, 0xcb, 0x31, 0x7a, 0x70, 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 new file mode 100644 index 0000000..501e648 --- /dev/null +++ b/x/qoracle/genesis/types/genesis_test.go @@ -0,0 +1,31 @@ +package types_test + +import ( + "testing" + + "github.com/quasarlabs/quasarnode/x/qoracle/genesis/types" + "github.com/stretchr/testify/require" +) + +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 new file mode 100644 index 0000000..8d54beb --- /dev/null +++ b/x/qoracle/keeper/denom_price.go @@ -0,0 +1,67 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/quasarlabs/quasarnode/x/qoracle/types" + "time" +) + +// 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{}, sdkerrors.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{}, sdkerrors.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(), sdkerrors.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 new file mode 100644 index 0000000..b09d2c7 --- /dev/null +++ b/x/qoracle/keeper/grpc_query.go @@ -0,0 +1,123 @@ +package keeper + +import ( + "context" + + "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" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +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 new file mode 100644 index 0000000..388960d --- /dev/null +++ b/x/qoracle/keeper/grpc_query_test.go @@ -0,0 +1,22 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/quasarlabs/quasarnode/testutil" + "github.com/quasarlabs/quasarnode/x/qoracle/types" + "github.com/stretchr/testify/require" +) + +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 new file mode 100644 index 0000000..8748098 --- /dev/null +++ b/x/qoracle/keeper/keeper.go @@ -0,0 +1,180 @@ +package keeper + +import ( + "fmt" + + "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" + "github.com/tendermint/tendermint/libs/log" +) + +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 new file mode 100644 index 0000000..074ce3c --- /dev/null +++ b/x/qoracle/keeper/msg_server.go @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000..720d2f7 --- /dev/null +++ b/x/qoracle/keeper/params.go @@ -0,0 +1,16 @@ +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 new file mode 100644 index 0000000..8a29d9c --- /dev/null +++ b/x/qoracle/keeper/params_test.go @@ -0,0 +1,19 @@ +package keeper_test + +import ( + "testing" + + "github.com/quasarlabs/quasarnode/testutil" + "github.com/quasarlabs/quasarnode/x/qoracle/types" + "github.com/stretchr/testify/require" +) + +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 new file mode 100644 index 0000000..ef770d9 --- /dev/null +++ b/x/qoracle/keeper/pools.go @@ -0,0 +1,73 @@ +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 new file mode 100644 index 0000000..6187f6f --- /dev/null +++ b/x/qoracle/module.go @@ -0,0 +1,192 @@ +package qoracle + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "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/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" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/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) { +} + +// Route implements the AppModule interface +func (AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, nil) +} + +// NewHandler implements the AppModule interface +func (AppModule) NewHandler() sdk.Handler { + return nil +} + +// QuerierRoute implements the AppModule interface +func (AppModule) QuerierRoute() string { + return types.QuerierRoute +} + +// LegacyQuerierHandler implements the AppModule interface +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) + 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 new file mode 100644 index 0000000..06a6850 --- /dev/null +++ b/x/qoracle/osmosis/client/cli/cli.go @@ -0,0 +1,25 @@ +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 new file mode 100644 index 0000000..baf5050 --- /dev/null +++ b/x/qoracle/osmosis/client/cli/query.go @@ -0,0 +1,154 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" + "github.com/spf13/cobra" +) + +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 new file mode 100644 index 0000000..367a26b --- /dev/null +++ b/x/qoracle/osmosis/client/cli/tx.go @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..941b30f --- /dev/null +++ b/x/qoracle/osmosis/ibc_module.go @@ -0,0 +1,199 @@ +package qoracle + +import ( + "strings" + + // "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/keeper" + "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" + icqtypes "github.com/strangelove-ventures/async-icq/v4/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 "", sdkerrors.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 sdkerrors.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 sdkerrors.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 "", sdkerrors.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 sdkerrors.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 := sdkerrors.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 sdkerrors.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 new file mode 100644 index 0000000..e0f5200 --- /dev/null +++ b/x/qoracle/osmosis/keeper/calculation.go @@ -0,0 +1,116 @@ +package keeper + +import ( + "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + 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{}, sdkerrors.Wrap(err, "could not fetch the price of mint denom") + } + mintEpoch, found := k.findOsmosisEpochByIdentifier(ctx, mintParams.EpochIdentifier) + if !found { + return apyCalculator{}, sdkerrors.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(), sdkerrors.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) (sdk.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 new file mode 100644 index 0000000..5e8ff8e --- /dev/null +++ b/x/qoracle/osmosis/keeper/epoch.go @@ -0,0 +1,13 @@ +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 new file mode 100644 index 0000000..7e9bfee --- /dev/null +++ b/x/qoracle/osmosis/keeper/epoch_hooks.go @@ -0,0 +1,24 @@ +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 new file mode 100644 index 0000000..4946846 --- /dev/null +++ b/x/qoracle/osmosis/keeper/events.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + channeltypes "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..c36ae61 --- /dev/null +++ b/x/qoracle/osmosis/keeper/genesis.go @@ -0,0 +1,33 @@ +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 new file mode 100644 index 0000000..29af2c4 --- /dev/null +++ b/x/qoracle/osmosis/keeper/grpc_query.go @@ -0,0 +1,90 @@ +package keeper + +import ( + "context" + + "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" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +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 new file mode 100644 index 0000000..72431b2 --- /dev/null +++ b/x/qoracle/osmosis/keeper/keeper.go @@ -0,0 +1,106 @@ +package keeper + +import ( + "fmt" + + "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/v4/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + "github.com/quasarlabs/quasarnode/x/qoracle/osmosis/types" + qoracletypes "github.com/quasarlabs/quasarnode/x/qoracle/types" + "github.com/tendermint/tendermint/libs/log" +) + +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 new file mode 100644 index 0000000..43205d1 --- /dev/null +++ b/x/qoracle/osmosis/keeper/msg_server.go @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000..ce7da94 --- /dev/null +++ b/x/qoracle/osmosis/keeper/osmosis.go @@ -0,0 +1,207 @@ +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 new file mode 100644 index 0000000..43fc5a4 --- /dev/null +++ b/x/qoracle/osmosis/keeper/params.go @@ -0,0 +1,53 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + clienttypes "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..c25dc65 --- /dev/null +++ b/x/qoracle/osmosis/keeper/relay.go @@ -0,0 +1,427 @@ +package keeper + +import ( + // "cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + // sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + channeltypes "github.com/cosmos/ibc-go/v4/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" + icqtypes "github.com/strangelove-ventures/async-icq/v4/types" + abcitypes "github.com/tendermint/tendermint/abci/types" +) + +// 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 sdkerrors.Wrapf(err, "could not unmarshal icq packet acknowledgement data") + } + resps, err := icqtypes.DeserializeCosmosResponse(ackData.Data) + if err != nil { + return sdkerrors.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 sdkerrors.Wrapf(err, "could not unmarshal icq packet data") + } + reqs, err := icqtypes.DeserializeCosmosQuery(packetData.Data) + if err != nil { + return sdkerrors.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 sdkerrors.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 sdkerrors.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 sdkerrors.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 sdkerrors.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 sdkerrors.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 sdkerrors.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 sdkerrors.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 sdkerrors.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 new file mode 100644 index 0000000..4e17de2 --- /dev/null +++ b/x/qoracle/osmosis/types/codec.go @@ -0,0 +1,22 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + "github.com/gogo/protobuf/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{}) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +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 new file mode 100644 index 0000000..42fabd1 --- /dev/null +++ b/x/qoracle/osmosis/types/errors.go @@ -0,0 +1,16 @@ +package types + +import ( + // "cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// IBC transfer sentinel errors +var ( + ErrDisabled = sdkerrors.Register(SubModuleName, 2, "osmosis oracle module is disabled") + ErrInvalidChannelFlow = sdkerrors.Register(SubModuleName, 3, "invalid message sent to channel end") + ErrFailedICQResponse = sdkerrors.Register(SubModuleName, 4, "failed ICQ response") + ErrEpochNotFound = sdkerrors.Register(SubModuleName, 5, "epoch not found") + ErrGaugeWeightNotFound = sdkerrors.Register(SubModuleName, 6, "gauge weight not found") + ErrOsmosisICQTimedOut = sdkerrors.Register(SubModuleName, 7, "osmosis icq request timeout") +) diff --git a/x/qoracle/osmosis/types/events.go b/x/qoracle/osmosis/types/events.go new file mode 100644 index 0000000..f61a28a --- /dev/null +++ b/x/qoracle/osmosis/types/events.go @@ -0,0 +1,23 @@ +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 new file mode 100644 index 0000000..6508c94 --- /dev/null +++ b/x/qoracle/osmosis/types/expected_keepers.go @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..5da0ceb --- /dev/null +++ b/x/qoracle/osmosis/types/keys.go @@ -0,0 +1,48 @@ +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 new file mode 100644 index 0000000..a010f6a --- /dev/null +++ b/x/qoracle/osmosis/types/msgs.go @@ -0,0 +1,42 @@ +package types + +/* +const TypeMsgUpdateChainParams = "update_params" + +var _ sdk.Msg = &MsgUpdateChainParams{} + +func NewMsgUpdateChainParams(creator string) *MsgUpdateChainParams { + return &MsgUpdateChainParams{ + Creator: creator, + } +} + +func (msg *MsgUpdateChainParams) Route() string { + return RouterKey +} + +func (msg *MsgUpdateChainParams) Type() string { + return TypeMsgUpdateChainParams +} + +func (msg *MsgUpdateChainParams) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUpdateChainParams) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateChainParams) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} +*/ diff --git a/x/qoracle/osmosis/types/msgs_test.go b/x/qoracle/osmosis/types/msgs_test.go new file mode 100644 index 0000000..ab1254f --- /dev/null +++ b/x/qoracle/osmosis/types/msgs_test.go @@ -0,0 +1 @@ +package types diff --git a/x/qoracle/osmosis/types/osmosis.go b/x/qoracle/osmosis/types/osmosis.go new file mode 100644 index 0000000..68733f9 --- /dev/null +++ b/x/qoracle/osmosis/types/osmosis.go @@ -0,0 +1,124 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/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" + icqtypes "github.com/strangelove-ventures/async-icq/v4/types" + abcitypes "github.com/tendermint/tendermint/abci/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 new file mode 100644 index 0000000..822b40e --- /dev/null +++ b/x/qoracle/osmosis/types/osmosis.pb.go @@ -0,0 +1,796 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qoracle/osmosis/osmosis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/gogo/protobuf/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_3481bb447417ce28, []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_3481bb447417ce28, []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_3481bb447417ce28, []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("qoracle/osmosis/osmosis.proto", fileDescriptor_3481bb447417ce28) } + +var fileDescriptor_3481bb447417ce28 = []byte{ + // 409 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x52, 0xcf, 0x6a, 0xd4, 0x40, + 0x18, 0xdf, 0x71, 0x97, 0x22, 0x53, 0xb1, 0xec, 0x28, 0x12, 0x8a, 0xc6, 0x35, 0x20, 0x06, 0xc5, + 0x19, 0xab, 0x17, 0xaf, 0x16, 0x84, 0xf6, 0xa4, 0xa4, 0xe0, 0xc1, 0x4b, 0x98, 0x24, 0xdf, 0x26, + 0x43, 0xd3, 0xf9, 0x92, 0xcc, 0xa4, 0xda, 0x3e, 0x85, 0x4f, 0xe1, 0xb3, 0xf4, 0xd8, 0xa3, 0x27, + 0x91, 0xdd, 0x17, 0x91, 0x24, 0xb3, 0x59, 0xdd, 0x53, 0x26, 0xbf, 0xef, 0xf7, 0x27, 0xf9, 0xcd, + 0x47, 0x9f, 0xd4, 0xd8, 0xc8, 0xb4, 0x04, 0x81, 0xe6, 0x02, 0x8d, 0x32, 0x9b, 0x27, 0xaf, 0x1a, + 0xb4, 0xc8, 0x9e, 0xd7, 0xad, 0x34, 0xb2, 0x29, 0x65, 0x62, 0xf8, 0x70, 0xd4, 0x98, 0x01, 0x77, + 0x22, 0xee, 0xc8, 0x87, 0x0f, 0x73, 0xcc, 0xb1, 0x57, 0x88, 0xee, 0x34, 0x88, 0x0f, 0x5f, 0x6d, + 0x3c, 0x2b, 0xc4, 0xf2, 0xb5, 0xd2, 0x29, 0x68, 0xab, 0x2e, 0xc1, 0x88, 0xcb, 0xa3, 0x04, 0xac, + 0x3c, 0x12, 0x75, 0x0b, 0xcd, 0x95, 0x23, 0x3f, 0xde, 0x90, 0xa1, 0xc2, 0xb4, 0x30, 0x22, 0x07, + 0x0d, 0xe3, 0x77, 0x04, 0x3f, 0x09, 0x7d, 0xf0, 0x69, 0x20, 0x44, 0x50, 0xb7, 0x60, 0xec, 0x99, + 0x95, 0x16, 0xd8, 0x0b, 0x7a, 0x50, 0xc9, 0xf4, 0x1c, 0x6c, 0x6c, 0x3a, 0x58, 0xa7, 0xe0, 0x91, + 0x05, 0x09, 0x67, 0xd1, 0xfd, 0x01, 0x3e, 0x73, 0x28, 0x0b, 0xe8, 0x3d, 0x99, 0x9e, 0x6b, 0xfc, + 0x56, 0x42, 0x96, 0x43, 0xe6, 0xdd, 0x59, 0x90, 0xf0, 0x6e, 0xf4, 0x1f, 0xc6, 0x1e, 0xd1, 0xbd, + 0xa5, 0x54, 0x25, 0x64, 0xde, 0xb4, 0x9f, 0xba, 0x37, 0xf6, 0x92, 0xce, 0xdb, 0x2a, 0x93, 0x16, + 0xb2, 0x58, 0xda, 0xb8, 0x00, 0x95, 0x17, 0xd6, 0x9b, 0x2d, 0x48, 0x38, 0x8d, 0x0e, 0xdc, 0xe0, + 0x83, 0x3d, 0xe9, 0xe1, 0xe0, 0x9a, 0xce, 0x4f, 0xdd, 0x8f, 0xaa, 0x6b, 0xc8, 0x3e, 0x23, 0x96, + 0x86, 0x01, 0x65, 0xea, 0x1f, 0x30, 0xee, 0xfa, 0x30, 0x1e, 0x59, 0x4c, 0xc3, 0xfd, 0xb7, 0x6f, + 0xf8, 0xd8, 0x38, 0x62, 0xb9, 0x2d, 0x89, 0xbb, 0x92, 0xf8, 0xae, 0xdd, 0xf1, 0xec, 0xe6, 0xf7, + 0xd3, 0x49, 0x34, 0x57, 0xbb, 0x31, 0xc1, 0x17, 0x4a, 0x3f, 0xf6, 0xe5, 0x9d, 0xea, 0x25, 0xb2, + 0x13, 0xba, 0x3f, 0x54, 0x19, 0x2b, 0xbd, 0x44, 0x97, 0xf6, 0x6c, 0x4c, 0x1b, 0x66, 0x63, 0x4a, + 0x2f, 0xec, 0x74, 0xce, 0x9e, 0xc2, 0xe8, 0x74, 0x1c, 0xdd, 0xac, 0x7c, 0x72, 0xbb, 0xf2, 0xc9, + 0x9f, 0x95, 0x4f, 0x7e, 0xac, 0xfd, 0xc9, 0xed, 0xda, 0x9f, 0xfc, 0x5a, 0xfb, 0x93, 0xaf, 0xef, + 0x73, 0x65, 0x8b, 0x36, 0xe1, 0x29, 0x5e, 0x88, 0xed, 0xa6, 0x88, 0xed, 0xa6, 0x88, 0xef, 0x62, + 0x77, 0xc1, 0xec, 0x55, 0x05, 0x26, 0xd9, 0xeb, 0xef, 0xf5, 0xdd, 0xdf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xd8, 0x82, 0x38, 0x94, 0x80, 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 new file mode 100644 index 0000000..7616625 --- /dev/null +++ b/x/qoracle/osmosis/types/osmosis_test.go @@ -0,0 +1,41 @@ +package types + +import ( + "testing" + "time" + + poolincentivestypes "github.com/quasarlabs/quasarnode/osmosis/pool-incentives/types" + "github.com/stretchr/testify/assert" +) + +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 new file mode 100644 index 0000000..017aadc --- /dev/null +++ b/x/qoracle/osmosis/types/params.go @@ -0,0 +1,145 @@ +package types + +import ( + "errors" + "fmt" + "time" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + epochtypes "github.com/quasarlabs/quasarnode/x/epochs/types" + "gopkg.in/yaml.v2" +) + +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 new file mode 100644 index 0000000..cbb1500 --- /dev/null +++ b/x/qoracle/osmosis/types/params.pb.go @@ -0,0 +1,515 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: 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" + types "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + 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 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_bf7c77ca07c7bae6, []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("qoracle/osmosis/params.proto", fileDescriptor_bf7c77ca07c7bae6) } + +var fileDescriptor_bf7c77ca07c7bae6 = []byte{ + // 444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x4d, 0x8b, 0xd4, 0x30, + 0x18, 0x6e, 0xdd, 0x71, 0xd5, 0x0a, 0x7e, 0xd4, 0xaf, 0xee, 0xb8, 0x36, 0x43, 0x55, 0x98, 0x83, + 0x24, 0x8c, 0x5e, 0x64, 0x8f, 0x15, 0x44, 0xc1, 0x83, 0x94, 0x3d, 0x09, 0x32, 0x24, 0x99, 0x77, + 0xdb, 0x60, 0xdb, 0x74, 0x9b, 0x74, 0x70, 0xfc, 0x15, 0x1e, 0x3d, 0x7a, 0xf3, 0xaf, 0xec, 0x71, + 0x8f, 0x9e, 0x8a, 0xcc, 0xfc, 0x83, 0xfe, 0x02, 0x99, 0x26, 0xbb, 0x83, 0xe3, 0x9c, 0xf2, 0xe6, + 0xf9, 0x4a, 0x78, 0x79, 0xbc, 0xc3, 0x53, 0x59, 0x53, 0x9e, 0x03, 0x91, 0xaa, 0x90, 0x4a, 0x28, + 0x52, 0xd1, 0x9a, 0x16, 0x0a, 0x57, 0xb5, 0xd4, 0xd2, 0x7f, 0x7e, 0xda, 0x50, 0x45, 0xeb, 0x9c, + 0x32, 0x85, 0xcd, 0x58, 0xca, 0x19, 0x60, 0xeb, 0xc1, 0xd6, 0x33, 0xbc, 0x9f, 0xca, 0x54, 0xf6, + 0x0e, 0xb2, 0x9e, 0x8c, 0x79, 0x78, 0x90, 0x4a, 0x99, 0xe6, 0x40, 0xfa, 0x1b, 0x6b, 0x4e, 0x08, + 0x2d, 0x17, 0x96, 0x0a, 0x79, 0x6f, 0x25, 0x8c, 0x2a, 0x20, 0xf3, 0x09, 0x03, 0x4d, 0x27, 0x84, + 0x4b, 0x51, 0x5a, 0x1e, 0x09, 0xc6, 0x09, 0x97, 0x35, 0x10, 0x9e, 0x0b, 0x28, 0x35, 0x99, 0x4f, + 0xec, 0x64, 0x04, 0xd1, 0xaf, 0x3d, 0x6f, 0xff, 0x63, 0xff, 0x53, 0xff, 0x85, 0x77, 0x0d, 0x4a, + 0xca, 0x72, 0x98, 0x05, 0xee, 0xc8, 0x1d, 0x5f, 0x8f, 0xfd, 0xae, 0x45, 0xb7, 0x16, 0xb4, 0xc8, + 0x8f, 0x22, 0x4b, 0x44, 0xc9, 0x85, 0xc4, 0x7f, 0xeb, 0xdd, 0x81, 0x4a, 0xf2, 0x6c, 0x2a, 0x66, + 0x50, 0x6a, 0x71, 0x22, 0xa0, 0x0e, 0xae, 0x8c, 0xdc, 0xf1, 0x8d, 0xf8, 0x71, 0xd7, 0xa2, 0x47, + 0xd6, 0xb6, 0xa5, 0x88, 0x92, 0xdb, 0x3d, 0xf4, 0xfe, 0x12, 0xf1, 0x3f, 0x78, 0x3e, 0x6d, 0x74, + 0x26, 0x6b, 0xf1, 0x0d, 0x66, 0x53, 0x9e, 0xd1, 0xb2, 0x84, 0x3c, 0xd8, 0xeb, 0x93, 0x9e, 0x74, + 0x2d, 0x3a, 0x30, 0x49, 0xff, 0x6b, 0xa2, 0xe4, 0xee, 0x06, 0x7c, 0x63, 0x30, 0x5f, 0x7b, 0x0f, + 0x2a, 0xca, 0xbf, 0x80, 0x9e, 0x6a, 0x51, 0x80, 0x6c, 0xf4, 0x34, 0x03, 0x91, 0x66, 0x3a, 0x18, + 0x8c, 0xdc, 0xf1, 0xcd, 0x97, 0x43, 0x2c, 0x18, 0xc7, 0xeb, 0x7d, 0x60, 0xbb, 0x85, 0xf9, 0x04, + 0xbf, 0xeb, 0x15, 0xf1, 0xb3, 0xb3, 0x16, 0x39, 0x5d, 0x8b, 0x0e, 0xcd, 0x83, 0x3b, 0x63, 0xa2, + 0xe4, 0x9e, 0xc1, 0x8f, 0x0d, 0x6c, 0xac, 0xfe, 0x67, 0x2f, 0xd8, 0x92, 0xaf, 0x4f, 0xa5, 0x69, + 0x51, 0x05, 0x57, 0x47, 0xee, 0x78, 0x10, 0x3f, 0xed, 0x5a, 0x84, 0x76, 0x06, 0x5f, 0x2a, 0xa3, + 0xe4, 0xe1, 0x3f, 0xd9, 0xc7, 0x17, 0xc4, 0xd1, 0xe0, 0xc7, 0x4f, 0xe4, 0xc4, 0xc9, 0xd9, 0x32, + 0x74, 0xcf, 0x97, 0xa1, 0xfb, 0x67, 0x19, 0xba, 0xdf, 0x57, 0xa1, 0x73, 0xbe, 0x0a, 0x9d, 0xdf, + 0xab, 0xd0, 0xf9, 0xf4, 0x3a, 0x15, 0x3a, 0x6b, 0x18, 0xe6, 0xb2, 0x20, 0x9b, 0x9e, 0x91, 0x4d, + 0xcf, 0xc8, 0x57, 0xb2, 0xdd, 0x4e, 0xbd, 0xa8, 0x40, 0xb1, 0xfd, 0xbe, 0x04, 0xaf, 0xfe, 0x06, + 0x00, 0x00, 0xff, 0xff, 0x17, 0x27, 0x9e, 0x1e, 0xbd, 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 new file mode 100644 index 0000000..a3df622 --- /dev/null +++ b/x/qoracle/osmosis/types/query.pb.go @@ -0,0 +1,2417 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: 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/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + 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" + 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_480419f3bfe6e877, []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_480419f3bfe6e877, []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_480419f3bfe6e877, []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_480419f3bfe6e877, []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_480419f3bfe6e877, []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_480419f3bfe6e877, []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_480419f3bfe6e877, []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_480419f3bfe6e877, []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_480419f3bfe6e877, []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_480419f3bfe6e877, []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("qoracle/osmosis/query.proto", fileDescriptor_480419f3bfe6e877) } + +var fileDescriptor_480419f3bfe6e877 = []byte{ + // 944 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4b, 0x8f, 0xdb, 0x44, + 0x1c, 0x5f, 0x6f, 0xba, 0x8b, 0x98, 0xc0, 0x21, 0xb3, 0x0b, 0x04, 0xd3, 0x3a, 0x8b, 0x25, 0xca, + 0xf2, 0xd8, 0x99, 0x76, 0xdb, 0xa2, 0xa6, 0x95, 0x78, 0xa4, 0x29, 0x50, 0x21, 0xc1, 0x12, 0x6e, + 0x70, 0x88, 0xc6, 0xce, 0xac, 0xd7, 0xaa, 0xed, 0x71, 0x3c, 0xce, 0x8a, 0xf6, 0xc8, 0x85, 0x2b, + 0x12, 0xe2, 0xcc, 0x77, 0xe0, 0xc0, 0x67, 0xa8, 0xc4, 0xa5, 0x12, 0x17, 0xc4, 0x21, 0x42, 0x1b, + 0x24, 0xbe, 0x03, 0x27, 0x34, 0x2f, 0xdb, 0x89, 0x5b, 0x6d, 0x12, 0x7a, 0x8a, 0x3d, 0xff, 0xc7, + 0xef, 0xf7, 0x7f, 0xcc, 0xcf, 0x01, 0xaf, 0x8d, 0x59, 0x46, 0xfc, 0x88, 0x62, 0xc6, 0x63, 0xc6, + 0x43, 0x8e, 0xc7, 0x13, 0x9a, 0x3d, 0x40, 0x69, 0xc6, 0x72, 0x06, 0xdf, 0x18, 0x4f, 0x08, 0x27, + 0x59, 0x44, 0x3c, 0x8e, 0xd4, 0x63, 0xc2, 0x46, 0x14, 0xe9, 0x10, 0xa4, 0x43, 0xec, 0xdd, 0x80, + 0x05, 0x4c, 0x46, 0x60, 0xf1, 0xa4, 0x82, 0xed, 0x4e, 0xc0, 0x58, 0x10, 0x51, 0x2c, 0xdf, 0xbc, + 0xc9, 0x31, 0xce, 0xc3, 0x98, 0xf2, 0x9c, 0xc4, 0xa9, 0x76, 0xb8, 0xa8, 0x1d, 0x48, 0x1a, 0x62, + 0x92, 0x24, 0x2c, 0x27, 0x79, 0xc8, 0x12, 0xae, 0xad, 0x8e, 0x2f, 0xd3, 0x63, 0x8f, 0x70, 0x8a, + 0x4f, 0xaf, 0x7a, 0x34, 0x27, 0x57, 0xb1, 0xcf, 0xc2, 0x44, 0xdb, 0xdf, 0xae, 0xda, 0x25, 0xe9, + 0xc2, 0x2b, 0x25, 0x41, 0x98, 0xc8, 0x64, 0x06, 0x69, 0xb1, 0xc8, 0x94, 0x64, 0x24, 0x36, 0x48, + 0x97, 0x16, 0xad, 0xfa, 0xd7, 0x04, 0x9b, 0x63, 0x9a, 0x32, 0xff, 0x84, 0xe3, 0x80, 0x26, 0xb4, + 0xb4, 0x76, 0x8c, 0x35, 0x0e, 0x93, 0xbc, 0x60, 0x20, 0x5e, 0xb4, 0xc3, 0x95, 0x02, 0x93, 0xb1, + 0xe8, 0x20, 0x4c, 0x7c, 0x9a, 0xe4, 0xe1, 0x29, 0xe5, 0x85, 0x6f, 0x79, 0xa4, 0x23, 0xde, 0x39, + 0x2f, 0xa2, 0x32, 0x22, 0xfb, 0xba, 0x71, 0x0e, 0x48, 0x1c, 0xab, 0x88, 0x98, 0x8d, 0x68, 0x24, + 0x1a, 0x13, 0x91, 0xc4, 0xa7, 0x59, 0xf1, 0x70, 0xc4, 0x58, 0xa4, 0xa2, 0xdc, 0x5d, 0x00, 0xbf, + 0x14, 0x49, 0x8e, 0x64, 0x1f, 0x06, 0x74, 0x3c, 0xa1, 0x3c, 0x77, 0x3d, 0xb0, 0x33, 0x77, 0xca, + 0x53, 0x96, 0x70, 0x0a, 0x3f, 0x03, 0xdb, 0xaa, 0x5f, 0x6d, 0x6b, 0xcf, 0xda, 0x6f, 0x1e, 0x1e, + 0xa0, 0xa5, 0xd6, 0x02, 0xa9, 0x34, 0xbd, 0x0b, 0x8f, 0xa6, 0x9d, 0x8d, 0x81, 0x4e, 0xe1, 0xee, + 0x80, 0x96, 0xc4, 0xf8, 0x2a, 0x27, 0x39, 0x35, 0xc0, 0xff, 0x6c, 0x6a, 0x3e, 0xfa, 0x54, 0x03, + 0x67, 0x60, 0x57, 0x45, 0x0d, 0x33, 0xe5, 0x38, 0xe4, 0xc2, 0xde, 0xde, 0x94, 0x34, 0x6e, 0x2d, + 0x49, 0xe3, 0x0b, 0xf5, 0xab, 0xb1, 0x24, 0x82, 0xe6, 0x04, 0xd3, 0x6a, 0xf9, 0xd2, 0x02, 0x1f, + 0x82, 0xb6, 0xe9, 0x78, 0xf8, 0x90, 0x8e, 0x86, 0xa2, 0xa3, 0x5c, 0xe3, 0x36, 0x9e, 0x11, 0xee, + 0xcb, 0x55, 0x04, 0x31, 0x15, 0xae, 0xb0, 0x09, 0x68, 0x56, 0xe1, 0x2e, 0x3c, 0x23, 0x38, 0x90, + 0x16, 0x10, 0xee, 0xab, 0xe0, 0x15, 0xd9, 0xe8, 0x3b, 0x27, 0x24, 0x4c, 0xe6, 0xa7, 0xff, 0x73, + 0x03, 0xb4, 0xeb, 0x36, 0x3d, 0x8a, 0x4f, 0x41, 0x53, 0xad, 0xff, 0x30, 0x4c, 0x8e, 0x59, 0xdb, + 0xda, 0x6b, 0xec, 0x37, 0x0f, 0x5f, 0x2f, 0xc0, 0x95, 0x0d, 0xe9, 0x05, 0x45, 0x77, 0xc5, 0xeb, + 0xbd, 0xe4, 0x98, 0x19, 0x06, 0xca, 0x2e, 0x4e, 0xe0, 0x87, 0x00, 0x46, 0xcc, 0xbf, 0x4f, 0xbc, + 0x88, 0x0e, 0x47, 0x93, 0x4c, 0xdd, 0xf9, 0xf6, 0xe6, 0x5e, 0x63, 0xbf, 0xd1, 0x6b, 0xfd, 0x3b, + 0xed, 0xbc, 0x28, 0x64, 0x02, 0xf5, 0xb5, 0x65, 0xd0, 0x32, 0xce, 0xe6, 0x84, 0xc3, 0x3b, 0xa0, + 0x29, 0xee, 0xd7, 0x50, 0x2f, 0xa5, 0x9a, 0xca, 0xc5, 0x82, 0x8b, 0xbc, 0x7b, 0x86, 0xc9, 0xdc, + 0x0e, 0x02, 0x61, 0x52, 0x27, 0xd0, 0x03, 0x2f, 0xc9, 0x24, 0x92, 0xd9, 0x30, 0xcd, 0xd8, 0x69, + 0xc8, 0x25, 0x13, 0xd1, 0xf5, 0x17, 0x7a, 0x48, 0x04, 0xfc, 0x39, 0xed, 0x5c, 0x0e, 0xc2, 0xfc, + 0x64, 0xe2, 0x21, 0x9f, 0xc5, 0x58, 0x0b, 0x8e, 0xfa, 0x39, 0xe0, 0xa3, 0xfb, 0x38, 0x7f, 0x90, + 0x52, 0x8e, 0xfa, 0xd4, 0x1f, 0xec, 0x88, 0x64, 0xb2, 0xec, 0xa3, 0x22, 0x15, 0xfc, 0x1c, 0x80, + 0x51, 0xc8, 0xf3, 0x4c, 0xf5, 0x6c, 0x4b, 0xf2, 0x7c, 0xab, 0xe0, 0x29, 0xa6, 0x52, 0xb9, 0xfb, + 0x86, 0x71, 0x5f, 0x44, 0x54, 0x7a, 0xf7, 0xfc, 0xc8, 0x1c, 0xb8, 0x1d, 0x70, 0x49, 0x0e, 0xe8, + 0xde, 0xe2, 0xfa, 0x98, 0x11, 0x7e, 0x6f, 0x01, 0xe7, 0x69, 0x1e, 0x7a, 0x90, 0x14, 0xc0, 0xfa, + 0x7e, 0xeb, 0x79, 0x5e, 0x39, 0x8f, 0xdb, 0x62, 0x5a, 0x4d, 0xb1, 0x55, 0xdb, 0x67, 0xf7, 0x1b, + 0x7d, 0xcd, 0xab, 0xf4, 0xe0, 0xc7, 0x00, 0x94, 0xd2, 0xac, 0xc5, 0xe4, 0x32, 0x52, 0xfd, 0x44, + 0x42, 0xc7, 0x91, 0x52, 0xb6, 0x72, 0x78, 0x81, 0x91, 0x88, 0x41, 0x25, 0xd2, 0xfd, 0xc9, 0x32, + 0xf2, 0x35, 0x57, 0xda, 0x7b, 0x60, 0xab, 0x5a, 0x8d, 0x5d, 0x54, 0x23, 0xa4, 0xb1, 0x4c, 0x5a, + 0xf2, 0x56, 0xee, 0xf0, 0x93, 0x39, 0x5a, 0x4a, 0x5c, 0xde, 0x3c, 0x97, 0x96, 0x02, 0xad, 0xf2, + 0x3a, 0x9c, 0x3e, 0x07, 0xb6, 0x24, 0x2f, 0xf8, 0xab, 0x05, 0xb6, 0xf5, 0xa2, 0x75, 0x97, 0xbc, + 0xbf, 0x75, 0x3d, 0xb6, 0x6f, 0xad, 0x13, 0xaa, 0x78, 0xb9, 0x37, 0xbe, 0xfb, 0xfd, 0xef, 0x1f, + 0x37, 0x31, 0x3c, 0xc0, 0x65, 0x0e, 0x5c, 0xe6, 0xc0, 0x4f, 0xfe, 0x22, 0xc2, 0x5f, 0x2c, 0xb0, + 0xa5, 0xc4, 0xe8, 0xe6, 0x2a, 0xe0, 0x55, 0x35, 0xb7, 0xbb, 0x6b, 0x44, 0x6a, 0xd6, 0xd7, 0x25, + 0x6b, 0x04, 0xdf, 0x5d, 0x92, 0xb5, 0x14, 0x4a, 0xf8, 0x9b, 0x05, 0x9a, 0x15, 0xd1, 0x82, 0xef, + 0xaf, 0x42, 0xa0, 0xae, 0x84, 0xf6, 0x07, 0x6b, 0xc7, 0xeb, 0x32, 0x6e, 0xcb, 0x32, 0x6e, 0xc0, + 0x6b, 0x4b, 0x96, 0xe1, 0x8b, 0x1c, 0x5a, 0xcf, 0xe0, 0xcc, 0x02, 0xad, 0xda, 0xfd, 0x85, 0xfd, + 0x55, 0x38, 0x3d, 0x4d, 0x20, 0xec, 0xbb, 0xff, 0x33, 0x8b, 0xae, 0xef, 0x23, 0x59, 0xdf, 0x6d, + 0xd8, 0x5d, 0xb2, 0xbe, 0xba, 0xe2, 0xc8, 0x45, 0x53, 0x95, 0xad, 0xb4, 0x68, 0x73, 0xd5, 0x74, + 0xd7, 0x88, 0x5c, 0x73, 0xd1, 0x24, 0xe9, 0xde, 0xe0, 0xd1, 0x99, 0x63, 0x3d, 0x3e, 0x73, 0xac, + 0xbf, 0xce, 0x1c, 0xeb, 0x87, 0x99, 0xb3, 0xf1, 0x78, 0xe6, 0x6c, 0xfc, 0x31, 0x73, 0x36, 0xbe, + 0xbe, 0x59, 0xf9, 0x4e, 0x3c, 0x39, 0xe3, 0xb7, 0xb5, 0x9c, 0xf2, 0xeb, 0xe1, 0x6d, 0xcb, 0x7f, + 0x64, 0xd7, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x28, 0x41, 0xb5, 0xb1, 0x89, 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: "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 new file mode 100644 index 0000000..cdd1062 --- /dev/null +++ b/x/qoracle/osmosis/types/query.pb.gw.go @@ -0,0 +1,431 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) + + 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(false))) +) + +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 new file mode 100644 index 0000000..a067964 --- /dev/null +++ b/x/qoracle/osmosis/types/tx.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qoracle/osmosis/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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("qoracle/osmosis/tx.proto", fileDescriptor_01a99b29a54f6333) } + +var fileDescriptor_01a99b29a54f6333 = []byte{ + // 142 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x28, 0xcc, 0x2f, 0x4a, + 0x4c, 0xce, 0x49, 0xd5, 0xcf, 0x2f, 0xce, 0xcd, 0x2f, 0xce, 0x2c, 0xd6, 0x2f, 0xa9, 0xd0, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x2d, 0x2c, 0x4d, 0x2c, 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, + 0xd6, 0x83, 0x30, 0xf3, 0xf2, 0x53, 0x52, 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, 0x61, 0xa4, 0x3e, + 0xc2, 0x48, 0xfd, 0x0a, 0x7d, 0x0c, 0x47, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x62, + 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x58, 0xb5, 0x7c, 0xa5, 0xa4, 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: "qoracle/osmosis/tx.proto", +} diff --git a/x/qoracle/types/codec.go b/x/qoracle/types/codec.go new file mode 100644 index 0000000..1effa58 --- /dev/null +++ b/x/qoracle/types/codec.go @@ -0,0 +1,20 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +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 new file mode 100644 index 0000000..3f01a99 --- /dev/null +++ b/x/qoracle/types/denom_symbol_mapping.go @@ -0,0 +1,21 @@ +package types + +import ( + //"cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (mapping DenomSymbolMapping) Validate() error { + if err := sdk.ValidateDenom(mapping.Denom); err != nil { + return sdkerrors.Wrap(err, "mapping denom") + } + if err := sdk.ValidateDenom(mapping.OracleSymbol); err != nil { + return sdkerrors.Wrap(err, "mapping oracle symbol") + } + if mapping.Multiplier.IsNegative() { + return sdkerrors.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 new file mode 100644 index 0000000..fa98f0a --- /dev/null +++ b/x/qoracle/types/denom_symbol_mapping.pb.go @@ -0,0 +1,422 @@ +// 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 new file mode 100644 index 0000000..c738755 --- /dev/null +++ b/x/qoracle/types/errors.go @@ -0,0 +1,13 @@ +package types + +import "github.com/cosmos/cosmos-sdk/types/errors" + +// DONTCOVER + +// x/qoracle module sentinel errors +var ( + ErrNegativeDenomPriceMultiplier = errors.Register(ModuleName, 2, "negative denom price multiplier") + ErrPriceListOutdated = errors.Register(ModuleName, 3, "price list is outdated") + ErrDenomPriceNotFound = errors.Register(ModuleName, 4, "symbol price not found") + ErrRelativeDenomPriceNotFound = errors.Register(ModuleName, 5, "relative symbol price not found") +) diff --git a/x/qoracle/types/expected_keepers.go b/x/qoracle/types/expected_keepers.go new file mode 100644 index 0000000..ea094e8 --- /dev/null +++ b/x/qoracle/types/expected_keepers.go @@ -0,0 +1,42 @@ +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/v4/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..055592f --- /dev/null +++ b/x/qoracle/types/keys.go @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..ab1254f --- /dev/null +++ b/x/qoracle/types/msgs.go @@ -0,0 +1 @@ +package types diff --git a/x/qoracle/types/params.go b/x/qoracle/types/params.go new file mode 100644 index 0000000..209ac58 --- /dev/null +++ b/x/qoracle/types/params.go @@ -0,0 +1,52 @@ +package types + +import ( + time "time" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +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 new file mode 100644 index 0000000..0f661ba --- /dev/null +++ b/x/qoracle/types/params.pb.go @@ -0,0 +1,264 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qoracle/params.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// 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_95f4338228c132f2, []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("qoracle/params.proto", fileDescriptor_95f4338228c132f2) } + +var fileDescriptor_95f4338228c132f2 = []byte{ + // 155 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x29, 0xcc, 0x2f, 0x4a, + 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 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, 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, 0xc2, 0x26, 0x7d, 0x84, 0x4d, 0xfa, 0x15, + 0xfa, 0x30, 0x77, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xad, 0x30, 0x06, 0x04, 0x00, + 0x00, 0xff, 0xff, 0xa5, 0x99, 0x5f, 0x24, 0xaf, 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 new file mode 100644 index 0000000..25a4fc8 --- /dev/null +++ b/x/qoracle/types/pool.pb.go @@ -0,0 +1,604 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qoracle/pool.proto + +package types + +import ( + fmt "fmt" + 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/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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_e83c544ee23a2441, []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("qoracle/pool.proto", fileDescriptor_e83c544ee23a2441) } + +var fileDescriptor_e83c544ee23a2441 = []byte{ + // 414 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x8e, 0xd3, 0x40, + 0x10, 0x86, 0xbd, 0xf1, 0x11, 0x71, 0x7b, 0x27, 0x0a, 0xeb, 0x0a, 0x5f, 0x24, 0x6c, 0x2b, 0xc5, + 0xc9, 0x0d, 0xbb, 0xdc, 0x21, 0x1a, 0x2a, 0xe2, 0x43, 0x42, 0x42, 0x14, 0x27, 0x2b, 0x42, 0x82, + 0x06, 0xad, 0xed, 0xc5, 0x58, 0xb1, 0x3d, 0x8e, 0x77, 0x1d, 0xf0, 0x2b, 0x50, 0xe5, 0x39, 0x78, + 0x92, 0x94, 0x29, 0x11, 0x85, 0x83, 0x9c, 0x37, 0xe0, 0x09, 0xd0, 0xda, 0x8e, 0x82, 0xa0, 0x41, + 0x54, 0x3b, 0xab, 0xf9, 0xe7, 0x9b, 0xd9, 0xd9, 0x1f, 0x1b, 0x4b, 0x28, 0x59, 0x98, 0x72, 0x5a, + 0x00, 0xa4, 0xa4, 0x28, 0x41, 0x82, 0xf1, 0x70, 0x59, 0x31, 0xc1, 0xca, 0x94, 0x05, 0x82, 0xf4, + 0x61, 0x0e, 0x11, 0x27, 0x83, 0x72, 0x72, 0x11, 0x43, 0x0c, 0x9d, 0x92, 0xaa, 0xa8, 0x2f, 0x9a, + 0x5c, 0xc6, 0x00, 0xb1, 0xe2, 0xa8, 0x5b, 0x50, 0x7d, 0xa0, 0x2c, 0xaf, 0x87, 0x94, 0xfd, 0x67, + 0x4a, 0x26, 0x19, 0x17, 0x92, 0x65, 0xc5, 0x20, 0xb0, 0x42, 0x10, 0x19, 0x08, 0x1a, 0x30, 0xc1, + 0xe9, 0xea, 0x3a, 0xe0, 0x92, 0x5d, 0xd3, 0x10, 0x92, 0xbc, 0xcf, 0x4f, 0xbf, 0xe8, 0xf8, 0xe4, + 0x0e, 0x20, 0x35, 0x1e, 0xe0, 0x51, 0x12, 0x99, 0xc8, 0x41, 0xee, 0xa9, 0x3f, 0x4a, 0x22, 0x43, + 0xe0, 0x31, 0x13, 0x82, 0x4b, 0x61, 0x8e, 0x1c, 0xdd, 0x3d, 0xbb, 0xb9, 0x24, 0x3d, 0x89, 0x28, + 0x12, 0x19, 0x48, 0xe4, 0x16, 0x92, 0xdc, 0x7b, 0xbe, 0x69, 0x6c, 0xed, 0x67, 0x63, 0x9f, 0xd7, + 0x2c, 0x4b, 0x9f, 0x4d, 0x25, 0x2c, 0x78, 0x3e, 0xfd, 0xba, 0xb3, 0xdd, 0x38, 0x91, 0x1f, 0xab, + 0x80, 0x84, 0x90, 0xd1, 0x61, 0x8c, 0xfe, 0x78, 0x24, 0xa2, 0x05, 0x95, 0x75, 0xc1, 0x45, 0x07, + 0x10, 0xfe, 0xd0, 0xca, 0x78, 0x89, 0x75, 0xb9, 0x4a, 0x4d, 0xdd, 0x41, 0xee, 0xb9, 0xf7, 0x54, + 0x61, 0xbf, 0x37, 0xf6, 0xd5, 0x3f, 0x60, 0x5e, 0xf0, 0xb0, 0x6d, 0x6c, 0x7d, 0xfe, 0xe6, 0xb5, + 0xaf, 0x08, 0x0a, 0xc4, 0x8a, 0xda, 0x3c, 0xf9, 0x5f, 0xd0, 0xec, 0xee, 0xad, 0xaf, 0x08, 0xc6, + 0x15, 0xd6, 0x4b, 0xf6, 0xc9, 0xbc, 0xe7, 0x20, 0xf7, 0xec, 0xe6, 0x82, 0xf4, 0xeb, 0x26, 0x87, + 0x75, 0x93, 0x59, 0x5e, 0xfb, 0x4a, 0x60, 0xdc, 0x62, 0x5c, 0x15, 0x11, 0x93, 0x3c, 0x7a, 0xcf, + 0xa4, 0x39, 0xee, 0xe4, 0x93, 0xbf, 0xe4, 0xf3, 0xc3, 0xef, 0x78, 0xf7, 0xd5, 0x4c, 0xeb, 0x9d, + 0x8d, 0xfc, 0xd3, 0xa1, 0x6e, 0x26, 0xbd, 0x57, 0x9b, 0xd6, 0x42, 0xdb, 0xd6, 0x42, 0x3f, 0x5a, + 0x0b, 0xad, 0xf7, 0x96, 0xb6, 0xdd, 0x5b, 0xda, 0xb7, 0xbd, 0xa5, 0xbd, 0x7b, 0xfc, 0xdb, 0xe8, + 0x47, 0x0b, 0xd1, 0xa3, 0x85, 0xe8, 0x67, 0x7a, 0xb0, 0x5b, 0xf7, 0x90, 0x60, 0xdc, 0x35, 0x7d, + 0xf2, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xac, 0x8c, 0xb7, 0xc4, 0x86, 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_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_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_gogo_protobuf_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_gogo_protobuf_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 new file mode 100644 index 0000000..8350277 --- /dev/null +++ b/x/qoracle/types/pools.go @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000..6220909 --- /dev/null +++ b/x/qoracle/types/price_list.pb.go @@ -0,0 +1,43 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qoracle/price_list.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + 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("qoracle/price_list.proto", fileDescriptor_735f6ba1ec1eb2a7) } + +var fileDescriptor_735f6ba1ec1eb2a7 = []byte{ + // 196 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x8f, 0x31, 0x8e, 0xc2, 0x30, + 0x10, 0x45, 0x93, 0x66, 0x8b, 0x2d, 0x57, 0x5b, 0xac, 0x22, 0xad, 0xf7, 0x06, 0x9e, 0x8d, 0xb8, + 0x01, 0x25, 0x47, 0xa0, 0x41, 0xb6, 0x31, 0xc6, 0x52, 0x9c, 0x71, 0x3c, 0x13, 0x04, 0xb7, 0xe0, + 0x58, 0x94, 0x29, 0x29, 0x51, 0x72, 0x11, 0x44, 0x12, 0x94, 0xee, 0x4b, 0xf3, 0xe6, 0xeb, 0xfd, + 0xcf, 0x9f, 0x06, 0x93, 0x32, 0x95, 0x85, 0x98, 0xbc, 0xb1, 0xbb, 0xca, 0x13, 0xcb, 0x98, 0x90, + 0xf1, 0xeb, 0xb7, 0x69, 0x15, 0xa9, 0x54, 0x29, 0x4d, 0x72, 0x8a, 0x35, 0xee, 0xad, 0x9c, 0xf9, + 0xe2, 0xdb, 0xa1, 0xc3, 0x91, 0x84, 0x57, 0x9a, 0x9e, 0x8a, 0x3f, 0x87, 0xe8, 0xc6, 0x36, 0x64, + 0xd4, 0xed, 0x01, 0xd8, 0x07, 0x4b, 0xac, 0x42, 0x9c, 0x01, 0x61, 0x90, 0x02, 0x12, 0x68, 0x45, + 0x16, 0x4e, 0xa5, 0xb6, 0xac, 0x4a, 0x30, 0xe8, 0xeb, 0xe9, 0xbe, 0xde, 0xdc, 0x7a, 0x91, 0x77, + 0xbd, 0xc8, 0x1f, 0xbd, 0xc8, 0xaf, 0x83, 0xc8, 0xba, 0x41, 0x64, 0xf7, 0x41, 0x64, 0xdb, 0x7f, + 0xe7, 0xf9, 0xd8, 0x6a, 0x69, 0x30, 0xc0, 0xa2, 0x06, 0x8b, 0x1a, 0x9c, 0xe1, 0x3d, 0x86, 0x2f, + 0xd1, 0x92, 0xfe, 0x18, 0x2b, 0x57, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0xff, 0xc6, 0x67, + 0xe4, 0x00, 0x00, 0x00, +} diff --git a/x/qoracle/types/query.pb.go b/x/qoracle/types/query.pb.go new file mode 100644 index 0000000..c119bba --- /dev/null +++ b/x/qoracle/types/query.pb.go @@ -0,0 +1,1064 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: 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/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/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" + 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_68dd2d718d2cdb91, []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_68dd2d718d2cdb91, []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_68dd2d718d2cdb91, []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_68dd2d718d2cdb91, []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("qoracle/query.proto", fileDescriptor_68dd2d718d2cdb91) } + +var fileDescriptor_68dd2d718d2cdb91 = []byte{ + // 465 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcb, 0x6e, 0xd4, 0x30, + 0x14, 0x1d, 0x0f, 0xcc, 0x48, 0xb8, 0x2b, 0xdc, 0x59, 0x54, 0x23, 0x48, 0x51, 0xa0, 0x0f, 0x21, + 0xb0, 0x9b, 0xf0, 0x01, 0x48, 0x45, 0x02, 0x89, 0x55, 0xc9, 0xb2, 0x3b, 0x27, 0x35, 0x21, 0x52, + 0xe2, 0x9b, 0xc4, 0x0e, 0xa2, 0x5b, 0xbe, 0x00, 0x89, 0x1d, 0x8b, 0xfe, 0x0d, 0x52, 0x97, 0x95, + 0xd8, 0xb0, 0x42, 0x68, 0x86, 0x0f, 0x41, 0xb1, 0x9d, 0x99, 0x54, 0x3c, 0xd2, 0xd9, 0xd9, 0xbe, + 0xf7, 0x9c, 0x7b, 0xce, 0xb9, 0x09, 0xde, 0xae, 0xa0, 0xe6, 0x49, 0x2e, 0x58, 0xd5, 0x88, 0xfa, + 0x9c, 0x96, 0x35, 0x68, 0x20, 0xf7, 0xab, 0x86, 0x2b, 0x5e, 0xe7, 0x3c, 0x56, 0xd4, 0x1e, 0x25, + 0x9c, 0x09, 0xea, 0x5a, 0xe7, 0xb3, 0x14, 0x52, 0x30, 0x9d, 0xac, 0x3d, 0x59, 0xd0, 0xfc, 0x5e, + 0x0a, 0x90, 0xe6, 0x82, 0xf1, 0x32, 0x63, 0x5c, 0x4a, 0xd0, 0x5c, 0x67, 0x20, 0x95, 0xab, 0xee, + 0xba, 0xaa, 0xb9, 0xc5, 0xcd, 0x5b, 0xa6, 0xb3, 0x42, 0x28, 0xcd, 0x8b, 0xd2, 0x35, 0x78, 0x09, + 0xa8, 0x02, 0x14, 0x8b, 0xb9, 0x12, 0xec, 0x7d, 0x10, 0x0b, 0xcd, 0x03, 0x96, 0x40, 0x26, 0x5d, + 0xfd, 0x71, 0xbf, 0x6e, 0xc4, 0xae, 0xba, 0x4a, 0x9e, 0x66, 0xd2, 0x4c, 0x73, 0xbd, 0xb3, 0xce, + 0x54, 0xc9, 0x6b, 0x5e, 0x74, 0x12, 0xc8, 0xea, 0x15, 0x20, 0xb7, 0x6f, 0xfe, 0x0c, 0x93, 0x37, + 0x2d, 0xd7, 0x89, 0x69, 0x8c, 0x44, 0xd5, 0x08, 0xa5, 0xfd, 0x53, 0xbc, 0x7d, 0xed, 0x55, 0x95, + 0x20, 0x95, 0x20, 0x2f, 0xf0, 0xd4, 0x12, 0xee, 0xa0, 0x07, 0xe8, 0x70, 0x2b, 0xdc, 0xa3, 0xff, + 0xcd, 0x89, 0x5a, 0xf8, 0xf1, 0xed, 0xcb, 0x1f, 0xbb, 0xa3, 0xc8, 0x41, 0xfd, 0x0a, 0xdf, 0xb5, + 0xdc, 0x00, 0x79, 0x37, 0x90, 0xcc, 0xf0, 0xe4, 0x4c, 0x48, 0x28, 0x0c, 0xf1, 0x9d, 0xc8, 0x5e, + 0xc8, 0x4b, 0x8c, 0xd7, 0xd6, 0x76, 0xc6, 0x66, 0xe6, 0x3e, 0xb5, 0x39, 0xd0, 0x36, 0x07, 0x6a, + 0x97, 0xe6, 0x72, 0xa0, 0x27, 0x3c, 0x15, 0x8e, 0x31, 0xea, 0x21, 0xfd, 0x0b, 0xd4, 0xb9, 0xb4, + 0x33, 0x9d, 0x9d, 0xe7, 0x78, 0xd2, 0x26, 0xd1, 0xba, 0xb9, 0x75, 0xb8, 0x15, 0x3e, 0x1c, 0x72, + 0x03, 0x90, 0x3b, 0x2f, 0x16, 0x47, 0x5e, 0xfd, 0x45, 0xdf, 0xc1, 0xa0, 0x3e, 0x3b, 0xbd, 0x2f, + 0x30, 0xfc, 0x3a, 0xc6, 0x13, 0x23, 0x90, 0x5c, 0x20, 0x3c, 0xb5, 0xb1, 0x91, 0x60, 0x40, 0xcf, + 0x9f, 0x7b, 0x9b, 0x87, 0x9b, 0x40, 0xac, 0x0e, 0xff, 0xe9, 0xc7, 0x6f, 0xbf, 0x3e, 0x8f, 0x0f, + 0xc8, 0x1e, 0x5b, 0x63, 0xd9, 0x1a, 0xcb, 0xae, 0x7f, 0x4a, 0xe4, 0x0b, 0xc2, 0x13, 0x13, 0x23, + 0x39, 0xba, 0xd1, 0xb0, 0xde, 0x96, 0xe7, 0xc1, 0x06, 0x08, 0xa7, 0xee, 0x89, 0x51, 0xb7, 0x4f, + 0x1e, 0x0d, 0xa9, 0x6b, 0x51, 0xc7, 0xaf, 0x2f, 0x17, 0x1e, 0xba, 0x5a, 0x78, 0xe8, 0xe7, 0xc2, + 0x43, 0x9f, 0x96, 0xde, 0xe8, 0x6a, 0xe9, 0x8d, 0xbe, 0x2f, 0xbd, 0xd1, 0xe9, 0x51, 0x9a, 0xe9, + 0x77, 0x4d, 0x4c, 0x13, 0x28, 0xfe, 0xc1, 0xf4, 0x61, 0xc5, 0xa5, 0xcf, 0x4b, 0xa1, 0xe2, 0xa9, + 0xf9, 0x41, 0x9e, 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xb4, 0x39, 0xf5, 0x21, 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: "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 new file mode 100644 index 0000000..93a4d38 --- /dev/null +++ b/x/qoracle/types/query.pb.gw.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: 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(false))) + + 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(false))) +) + +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 new file mode 100644 index 0000000..f568449 --- /dev/null +++ b/x/qoracle/types/tx.pb.go @@ -0,0 +1,82 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qoracle/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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("qoracle/tx.proto", fileDescriptor_a216e1369aaebb38) } + +var fileDescriptor_a216e1369aaebb38 = []byte{ + // 144 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x28, 0xcc, 0x2f, 0x4a, + 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0xa9, 0xd0, 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, 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, 0x47, 0x58, + 0xa0, 0x8f, 0xb0, 0x40, 0xbf, 0x42, 0x1f, 0xee, 0x94, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, + 0xc9, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x18, 0x8c, 0x93, 0xa2, 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: "qoracle/tx.proto", +} diff --git a/x/qoracle/utils/send_packet.go b/x/qoracle/utils/send_packet.go new file mode 100644 index 0000000..a0142a9 --- /dev/null +++ b/x/qoracle/utils/send_packet.go @@ -0,0 +1,123 @@ +package utils + +import ( + // "cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v4/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{}, sdkerrors.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{}, sdkerrors.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{}, sdkerrors.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, packet) + 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, sdkerrors.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 new file mode 100644 index 0000000..8efef33 --- /dev/null +++ b/x/qtransfer/README.md @@ -0,0 +1,119 @@ +# 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 new file mode 100644 index 0000000..55f18df Binary files /dev/null and b/x/qtransfer/bytecode/counter.wasm differ diff --git a/x/qtransfer/bytecode/echo.wasm b/x/qtransfer/bytecode/echo.wasm new file mode 100644 index 0000000..4feb455 Binary files /dev/null and b/x/qtransfer/bytecode/echo.wasm differ diff --git a/x/qtransfer/client/cli/cli.go b/x/qtransfer/client/cli/cli.go new file mode 100644 index 0000000..9f81e7c --- /dev/null +++ b/x/qtransfer/client/cli/cli.go @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..57fe2d9 --- /dev/null +++ b/x/qtransfer/client/cli/query.go @@ -0,0 +1,40 @@ +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/quasarlabs/quasarnode/x/qtransfer/types" + "github.com/spf13/cobra" +) + +// 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 new file mode 100644 index 0000000..766ef43 --- /dev/null +++ b/x/qtransfer/genesis.go @@ -0,0 +1,27 @@ +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 new file mode 100644 index 0000000..fe9a7d8 --- /dev/null +++ b/x/qtransfer/genesis_test.go @@ -0,0 +1,26 @@ +package qtransfer_test + +import ( + "testing" + + "github.com/quasarlabs/quasarnode/testutil" + "github.com/quasarlabs/quasarnode/x/qtransfer" + "github.com/quasarlabs/quasarnode/x/qtransfer/types" + "github.com/stretchr/testify/require" +) + +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 new file mode 100644 index 0000000..0931525 --- /dev/null +++ b/x/qtransfer/hooks.go @@ -0,0 +1,144 @@ +package qtransfer + +import ( + // external libraries + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + // ibc-go + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v4/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) +} + +// 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 new file mode 100644 index 0000000..fe06250 --- /dev/null +++ b/x/qtransfer/ibc_middleware_test.go @@ -0,0 +1,337 @@ +package qtransfer_test + +import ( + "encoding/json" + "fmt" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v4/testing" + "github.com/quasarlabs/quasarnode/x/qtransfer" + qtransfertestutils "github.com/quasarlabs/quasarnode/x/qtransfer/testutils" + "github.com/quasarlabs/quasarnode/x/qtransfer/types" + "github.com/stretchr/testify/suite" +) + +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)) +} + +// ToDo: Move this to quasar testing to avoid repetition +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 sdk.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) 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, + clienttypes.NewHeight(0, 100), + 0, + ) +} + +func (suite *HooksTestSuite) receivePacket(receiver, memo string) []byte { + return suite.receivePacketWithSequence(receiver, memo, 0) +} + +func (suite *HooksTestSuite) receivePacketWithSequence(receiver, memo string, prevSequence uint64) []byte { + channelCap := suite.chainB.GetChannelCapability( + suite.path.EndpointB.ChannelConfig.PortID, + suite.path.EndpointB.ChannelID) + + packet := suite.makeMockPacket(receiver, memo, prevSequence) + + err := suite.chainB.GetQuasarApp().HooksICS4Wrapper.SendPacket( + suite.chainB.GetContext(), channelCap, packet) + 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.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)) + + 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)) + 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)) + + 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)) + 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)) + + 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) + 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)) + 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)) + + 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) + + 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 new file mode 100644 index 0000000..f1995c0 --- /dev/null +++ b/x/qtransfer/ibc_module.go @@ -0,0 +1,257 @@ +package qtransfer + +import ( + // external libraries + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + // ibc-go + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v4/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, + packet ibcexported.PacketI, +) error { + return im.ICS4Middleware.SendPacket(ctx, chanCap, packet) +} + +// 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 new file mode 100644 index 0000000..8ae7a1e --- /dev/null +++ b/x/qtransfer/ics4_middleware.go @@ -0,0 +1,77 @@ +package qtransfer + +import ( + // external libraries + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + // ibc-go + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v4/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, + } +} + +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 new file mode 100644 index 0000000..c7bd156 --- /dev/null +++ b/x/qtransfer/keeper/grpc_query.go @@ -0,0 +1,19 @@ +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 new file mode 100644 index 0000000..2eab793 --- /dev/null +++ b/x/qtransfer/keeper/keeper.go @@ -0,0 +1,112 @@ +package keeper + +import ( + "errors" + "fmt" + "reflect" + + "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" + "github.com/tendermint/tendermint/libs/log" +) + +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 new file mode 100644 index 0000000..0d53e05 --- /dev/null +++ b/x/qtransfer/keeper/params.go @@ -0,0 +1,24 @@ +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 new file mode 100644 index 0000000..6581266 --- /dev/null +++ b/x/qtransfer/keeper/params_test.go @@ -0,0 +1,19 @@ +package keeper_test + +import ( + "testing" + + "github.com/quasarlabs/quasarnode/testutil" + "github.com/quasarlabs/quasarnode/x/qtransfer/types" + "github.com/stretchr/testify/require" +) + +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 new file mode 100644 index 0000000..d39e6bd --- /dev/null +++ b/x/qtransfer/module.go @@ -0,0 +1,152 @@ +package qtransfer + +import ( + "context" + "encoding/json" + "fmt" + "github.com/gorilla/mux" + + "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/grpc-ecosystem/grpc-gateway/runtime" + "github.com/quasarlabs/quasarnode/x/qtransfer/client/cli" + "github.com/quasarlabs/quasarnode/x/qtransfer/keeper" + "github.com/quasarlabs/quasarnode/x/qtransfer/types" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/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 new file mode 100644 index 0000000..6bd7576 --- /dev/null +++ b/x/qtransfer/testutils/Cargo.lock @@ -0,0 +1,841 @@ +# 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 new file mode 100644 index 0000000..9e4bf04 --- /dev/null +++ b/x/qtransfer/testutils/Cargo.toml @@ -0,0 +1,16 @@ +[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 new file mode 100644 index 0000000..fa7d770 --- /dev/null +++ b/x/qtransfer/testutils/chain.go @@ -0,0 +1,41 @@ +package testutils + +import ( + "encoding/json" + + "github.com/cosmos/cosmos-sdk/simapp" + ibctesting "github.com/cosmos/ibc-go/v4/testing" + "github.com/quasarlabs/quasarnode/app" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" +) + +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, + simapp.EmptyAppOptions{}, + app.GetWasmEnabledProposals(), + app.EmptyWasmOpts, + ) + + return quasarApp, app.NewDefaultGenesisState(encCdc.Marshaler) +} + +// GetQuasarApp returns the current chain's app as an QuasarApp +func (chain *TestChain) GetQuasarApp() *app.App { + v, _ := chain.App.(*app.App) + return v +} diff --git a/x/qtransfer/testutils/contracts/counter/Cargo.toml b/x/qtransfer/testutils/contracts/counter/Cargo.toml new file mode 100644 index 0000000..9161f34 --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/Cargo.toml @@ -0,0 +1,43 @@ +[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 new file mode 100644 index 0000000..d13630e --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/README.md @@ -0,0 +1,11 @@ +# 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 new file mode 100644 index 0000000..d9aa259 --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/src/contract.rs @@ -0,0 +1,287 @@ +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 new file mode 100644 index 0000000..3caf0c5 --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/src/error.rs @@ -0,0 +1,16 @@ +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 new file mode 100644 index 0000000..c943c13 --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/src/helpers.rs @@ -0,0 +1,48 @@ +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 new file mode 100644 index 0000000..4c50784 --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/src/integration_tests.rs @@ -0,0 +1,71 @@ +#[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 new file mode 100644 index 0000000..ffd1f6a --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/src/lib.rs @@ -0,0 +1,9 @@ +#![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 new file mode 100644 index 0000000..6c29fdf --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/src/msg.rs @@ -0,0 +1,34 @@ +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 new file mode 100644 index 0000000..4b8002f --- /dev/null +++ b/x/qtransfer/testutils/contracts/counter/src/state.rs @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000..6980ce8 --- /dev/null +++ b/x/qtransfer/testutils/contracts/echo/Cargo.toml @@ -0,0 +1,42 @@ +[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 new file mode 100644 index 0000000..ab1d16a --- /dev/null +++ b/x/qtransfer/testutils/contracts/echo/src/lib.rs @@ -0,0 +1,42 @@ +#[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 new file mode 100644 index 0000000..24fa0ed --- /dev/null +++ b/x/qtransfer/testutils/testing_hooks.go @@ -0,0 +1,38 @@ +package testutils + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v4/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 new file mode 100644 index 0000000..3b77122 --- /dev/null +++ b/x/qtransfer/testutils/wasm.go @@ -0,0 +1,78 @@ +package testutils + +import ( + "crypto/sha256" + "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/v4/modules/apps/transfer/types" + "github.com/stretchr/testify/suite" +) + +func (chain *TestChain) StoreContractCode(suite *suite.Suite, path string) { + quasarApp := chain.GetQuasarApp() + + govKeeper := quasarApp.GovKeeper + wasmCode, err := os.ReadFile(path) + suite.Require().NoError(err) + + addr := quasarApp.AccountKeeper.GetModuleAddress(govtypes.ModuleName) + src := wasmtypes.StoreCodeProposalFixture(func(p *wasmtypes.StoreCodeProposal) { + p.RunAs = addr.String() + p.WASMByteCode = wasmCode + checksum := sha256.Sum256(wasmCode) + p.CodeHash = checksum[:] + }) + + // when stored + storedProposal, err := govKeeper.SubmitProposal(chain.GetContext(), src) + + suite.Require().NoError(err) + + // and proposal execute + handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute()) + + err = handler(chain.GetContext(), src) + 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 new file mode 100644 index 0000000..b2175ba --- /dev/null +++ b/x/qtransfer/types/codec.go @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000..28f4a79 --- /dev/null +++ b/x/qtransfer/types/errors.go @@ -0,0 +1,10 @@ +package types + +import ( + // sdkerrors "cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var ( + ErrInvalidMetadataFormat = sdkerrors.New(ModuleName, 2, "invalid metadata format") +) diff --git a/x/qtransfer/types/expected_keepers.go b/x/qtransfer/types/expected_keepers.go new file mode 100644 index 0000000..94478af --- /dev/null +++ b/x/qtransfer/types/expected_keepers.go @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000..3227265 --- /dev/null +++ b/x/qtransfer/types/genesis.go @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..44de523 --- /dev/null +++ b/x/qtransfer/types/genesis.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qtransfer/genesis.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// 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_d50843074d7a2652, []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("qtransfer/genesis.proto", fileDescriptor_d50843074d7a2652) } + +var fileDescriptor_d50843074d7a2652 = []byte{ + // 199 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0x2c, 0x29, 0x4a, + 0xcc, 0x2b, 0x4e, 0x4b, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x2f, 0x2c, 0x4d, 0x2c, 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, + 0x83, 0x30, 0xf3, 0xf2, 0x53, 0x52, 0xf5, 0xe0, 0xca, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, + 0x6a, 0xf5, 0x41, 0x2c, 0x88, 0x36, 0x29, 0x31, 0x84, 0x79, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, + 0xe3, 0x94, 0x42, 0xb9, 0x78, 0xdc, 0x21, 0xe6, 0x07, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0xb9, 0x72, + 0xb1, 0x41, 0xe4, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xd4, 0xf5, 0x08, 0xd8, 0xa7, 0x17, + 0x00, 0x56, 0xee, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0xb3, 0x93, 0xcf, 0x89, 0x47, + 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, + 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, + 0x25, 0xe7, 0xe7, 0xea, 0x23, 0x8c, 0xd6, 0x47, 0x18, 0xad, 0x5f, 0xa1, 0x8f, 0x70, 0x6b, 0x49, + 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0xad, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x24, + 0x77, 0x77, 0xc7, 0x15, 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 new file mode 100644 index 0000000..03e6ce3 --- /dev/null +++ b/x/qtransfer/types/keys.go @@ -0,0 +1,20 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" +) + +var ( + // 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 + + // 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 new file mode 100644 index 0000000..807fa1c --- /dev/null +++ b/x/qtransfer/types/params.go @@ -0,0 +1,70 @@ +package types + +import ( + "fmt" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +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 new file mode 100644 index 0000000..4c5e1bc --- /dev/null +++ b/x/qtransfer/types/params.pb.go @@ -0,0 +1,309 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: qtransfer/params.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// 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_59c210578e1bef06, []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("qtransfer/params.proto", fileDescriptor_59c210578e1bef06) } + +var fileDescriptor_59c210578e1bef06 = []byte{ + // 210 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2b, 0x2c, 0x29, 0x4a, + 0xcc, 0x2b, 0x4e, 0x4b, 0x2d, 0xd2, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x92, 0x2f, 0x2c, 0x4d, 0x2c, 0x4e, 0x2c, 0xca, 0x49, 0x4c, 0x2a, 0xd6, 0x83, + 0x30, 0xf3, 0xf2, 0x53, 0x52, 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, + 0xc2, 0xe1, 0xfa, 0x08, 0x87, 0xeb, 0x57, 0xe8, 0x23, 0x3c, 0x5a, 0x52, 0x59, 0x90, 0x5a, 0x9c, + 0xc4, 0x06, 0x76, 0xb1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xf9, 0xbf, 0x21, 0x70, 0x02, 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 new file mode 100644 index 0000000..f2d1e37 --- /dev/null +++ b/x/qtransfer/types/query.pb.go @@ -0,0 +1,540 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: 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/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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_849d749a93aa6295, []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_849d749a93aa6295, []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("qtransfer/query.proto", fileDescriptor_849d749a93aa6295) } + +var fileDescriptor_849d749a93aa6295 = []byte{ + // 321 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0xc1, 0x4a, 0x33, 0x31, + 0x10, 0xc7, 0x37, 0x1f, 0x9f, 0x3d, 0xac, 0xb7, 0xb5, 0x8a, 0x14, 0x49, 0xa5, 0x97, 0xaa, 0x87, + 0x84, 0xb6, 0x3e, 0x41, 0xc1, 0x9b, 0x07, 0xed, 0x51, 0xbc, 0xcc, 0xd6, 0x18, 0x17, 0xda, 0x4c, + 0x36, 0xc9, 0x8a, 0xbd, 0xfa, 0x04, 0x82, 0xaf, 0xe0, 0xd9, 0xe7, 0xe8, 0xb1, 0xe0, 0xc5, 0x93, + 0x48, 0xeb, 0x83, 0x48, 0x93, 0xa5, 0xad, 0x8a, 0x14, 0x6f, 0x61, 0xe6, 0xff, 0xfb, 0x65, 0x66, + 0xe2, 0xed, 0xdc, 0x19, 0x50, 0xf6, 0x5a, 0x18, 0x9e, 0x17, 0xc2, 0x8c, 0x98, 0x36, 0xe8, 0x30, + 0xa9, 0xe7, 0x05, 0x58, 0x30, 0x03, 0x48, 0x2d, 0x0b, 0x4f, 0x85, 0x57, 0x82, 0x2d, 0xc2, 0xb5, + 0xaa, 0x44, 0x89, 0x3e, 0xcb, 0xe7, 0xaf, 0x80, 0xd5, 0xf6, 0x24, 0xa2, 0x1c, 0x08, 0x0e, 0x3a, + 0xe3, 0xa0, 0x14, 0x3a, 0x70, 0x19, 0x2a, 0x5b, 0x76, 0x69, 0x1f, 0xed, 0x10, 0x2d, 0x4f, 0xc1, + 0x0a, 0x7e, 0xdb, 0x4a, 0x85, 0x83, 0x16, 0xef, 0x63, 0xa6, 0xca, 0xfe, 0xd1, 0x6a, 0xdf, 0x4f, + 0xb3, 0x48, 0x69, 0x90, 0x99, 0xf2, 0xb2, 0x32, 0xbb, 0xb3, 0x9c, 0x5b, 0x83, 0x81, 0x61, 0xf9, + 0x47, 0xa3, 0x1a, 0x27, 0xe7, 0x73, 0xf2, 0xcc, 0x17, 0x7b, 0x22, 0x2f, 0x84, 0x75, 0x8d, 0xcb, + 0x78, 0xeb, 0x4b, 0xd5, 0x6a, 0x54, 0x56, 0x24, 0x27, 0x71, 0x25, 0xc0, 0xbb, 0x64, 0x9f, 0x1c, + 0x6c, 0xb6, 0x9b, 0x6c, 0xcd, 0xda, 0x2c, 0x08, 0xba, 0xff, 0xc7, 0x6f, 0xf5, 0xa8, 0x57, 0xc2, + 0xed, 0x67, 0x12, 0x6f, 0x78, 0x7d, 0xf2, 0x44, 0xe2, 0x4a, 0x88, 0x24, 0x9d, 0xb5, 0xae, 0x9f, + 0x73, 0xd6, 0x8e, 0xff, 0x06, 0x85, 0x35, 0x1a, 0xfc, 0xfe, 0xe5, 0xe3, 0xf1, 0xdf, 0x61, 0xd2, + 0xe4, 0x4b, 0x9a, 0x2f, 0x69, 0xfe, 0xfd, 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, 0x5f, 0x64, 0x77, 0x2b, 0x3a, 0x37, 0xd2, 0xc2, 0xa6, 0x15, + 0x7f, 0xf9, 0xce, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x69, 0x30, 0xc7, 0xe6, 0x4b, 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: "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 new file mode 100644 index 0000000..1dca2d9 --- /dev/null +++ b/x/qtransfer/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: 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(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/qtransfer/wasm_hooks.go b/x/qtransfer/wasm_hooks.go new file mode 100644 index 0000000..bce021e --- /dev/null +++ b/x/qtransfer/wasm_hooks.go @@ -0,0 +1,387 @@ +package qtransfer + +import ( + "encoding/json" + "errors" + "fmt" + + // sdkerrors "cosmossdk.io/errors" + 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" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v4/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 + wasmKeeper wasmkeeper.Keeper + permissionedKeeper *wasmkeeper.PermissionedKeeper +} + +func NewWasmHooks(k keeper.Keeper, wasmKeeper wasmkeeper.Keeper) WasmHooks { + return WasmHooks{ + keeper: k, + wasmKeeper: wasmKeeper, + permissionedKeeper: wasmkeeper.NewDefaultPermissionKeeper(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(sdkerrors.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 +} + +func (h WasmHooks) execWasmMsg(ctx sdk.Context, execMsg *wasmtypes.MsgExecuteContract) (*wasmtypes.MsgExecuteContractResponse, error) { + if err := execMsg.ValidateBasic(); err != nil { + return nil, sdkerrors.Wrap(err, "invalid wasm contract execution message") + } + wasmMsgServer := wasmkeeper.NewMsgServerImpl(h.permissionedKeeper) + 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, + sdkerrors.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, + sdkerrors.Wrapf(types.ErrInvalidMetadataFormat, `could not find key wasm["contract"]`) + } + + contractAddr, err = sdk.AccAddressFromBech32(contract) + if err != nil { + return isWasmRouted, sdk.AccAddress{}, nil, + sdkerrors.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, + sdkerrors.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, + sdkerrors.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, + sdkerrors.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, + sdkerrors.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 sdkerrors.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 sdkerrors.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, sdkerrors.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, sdkerrors.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 sdkerrors.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 sdkerrors.Wrap(err, "contract returned error for timeout") + } + + return nil +}